#ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_COCOA_H_
#define CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_COCOA_H_
#import <Cocoa/Cocoa.h>
#include "chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
@class ConstrainedWindowAlert;
@class MediaGalleriesScanResultCocoaController;
namespace ui {
class MenuModel;
}
class MediaGalleriesScanResultDialogCocoa
: public ConstrainedWindowMacDelegate,
public MediaGalleriesScanResultDialog {
public:
MediaGalleriesScanResultDialogCocoa(
MediaGalleriesScanResultDialogController* controller,
MediaGalleriesScanResultCocoaController* delegate);
virtual ~MediaGalleriesScanResultDialogCocoa();
void OnAcceptClicked();
void OnCancelClicked();
void OnCheckboxToggled(NSButton* checkbox);
void OnFolderViewClicked(NSButton* folder_viewer_button);
virtual void UpdateResults() OVERRIDE;
virtual void OnConstrainedWindowClosed(
ConstrainedWindowMac* window) OVERRIDE;
ui::MenuModel* GetContextMenu(MediaGalleryPrefId prefid);
private:
friend class MediaGalleriesScanResultDialogCocoaTest;
void UpdateScanResultCheckbox(const MediaGalleryPrefInfo& scan_result,
bool checked,
CGFloat y_pos);
void InitDialogControls();
CGFloat CreateCheckboxes(
CGFloat y_pos,
const MediaGalleriesScanResultDialogController::OrderedScanResults&
scan_results);
virtual void AcceptDialogForTesting() OVERRIDE;
MediaGalleriesScanResultDialogController* controller_;
scoped_ptr<ConstrainedWindowMac> window_;
base::scoped_nsobject<ConstrainedWindowAlert> alert_;
bool accepted_;
base::scoped_nsobject<NSMutableArray> checkboxes_;
base::scoped_nsobject<NSView> checkbox_container_;
base::scoped_nsobject<NSBox> main_container_;
base::scoped_nsobject<MediaGalleriesScanResultCocoaController>
cocoa_controller_;
DISALLOW_COPY_AND_ASSIGN(MediaGalleriesScanResultDialogCocoa);
};
#endif