#ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_SCAN_RESULT_DIALOG_VIEWS_H_
#include <map>
#include "base/compiler_specific.h"
#include "chrome/browser/media_galleries/media_galleries_scan_result_dialog_controller.h"
#include "ui/views/context_menu_controller.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/window/dialog_delegate.h"
namespace views {
class Checkbox;
class ImageButton;
class Label;
class MenuRunner;
class Widget;
}
class MediaGalleryCheckboxView;
class MediaGalleriesScanResultDialogViews
: public MediaGalleriesScanResultDialog,
public views::ButtonListener,
public views::ContextMenuController,
public views::DialogDelegate {
public:
explicit MediaGalleriesScanResultDialogViews(
MediaGalleriesScanResultDialogController* controller);
virtual ~MediaGalleriesScanResultDialogViews();
virtual void UpdateResults() OVERRIDE;
virtual base::string16 GetWindowTitle() const OVERRIDE;
virtual void DeleteDelegate() OVERRIDE;
virtual views::Widget* GetWidget() OVERRIDE;
virtual const views::Widget* GetWidget() const OVERRIDE;
virtual views::View* GetContentsView() OVERRIDE;
virtual base::string16 GetDialogButtonLabel(
ui::DialogButton button) const OVERRIDE;
virtual ui::ModalType GetModalType() const OVERRIDE;
virtual bool Cancel() OVERRIDE;
virtual bool Accept() OVERRIDE;
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
virtual void ShowContextMenuForView(views::View* source,
const gfx::Point& point,
ui::MenuSourceType source_type) OVERRIDE;
private:
typedef std::map<MediaGalleryPrefId, MediaGalleryCheckboxView*>
GalleryViewMap;
void InitChildViews();
bool AddOrUpdateScanResult(const MediaGalleryPrefInfo& gallery,
bool selected,
views::View* container,
int trailing_vertical_space);
void ShowContextMenu(const gfx::Point& point,
ui::MenuSourceType source_type,
MediaGalleryPrefId id);
virtual void AcceptDialogForTesting() OVERRIDE;
MediaGalleriesScanResultDialogController* controller_;
views::Widget* window_;
views::View* contents_;
GalleryViewMap gallery_view_map_;
bool accepted_;
scoped_ptr<views::MenuRunner> context_menu_runner_;
DISALLOW_COPY_AND_ASSIGN(MediaGalleriesScanResultDialogViews);
};
#endif