| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 class MediaGalleriesDialogViews : public MediaGalleriesDialog, | 27 class MediaGalleriesDialogViews : public MediaGalleriesDialog, |
| 28 public views::ButtonListener, | 28 public views::ButtonListener, |
| 29 public views::ContextMenuController, | 29 public views::ContextMenuController, |
| 30 public views::DialogDelegate { | 30 public views::DialogDelegate { |
| 31 public: | 31 public: |
| 32 explicit MediaGalleriesDialogViews( | 32 explicit MediaGalleriesDialogViews( |
| 33 MediaGalleriesDialogController* controller); | 33 MediaGalleriesDialogController* controller); |
| 34 virtual ~MediaGalleriesDialogViews(); | 34 virtual ~MediaGalleriesDialogViews(); |
| 35 | 35 |
| 36 // MediaGalleriesDialog implementation: | 36 // MediaGalleriesDialog implementation: |
| 37 virtual void UpdateGalleries() OVERRIDE; | 37 virtual void UpdateGalleries() override; |
| 38 | 38 |
| 39 // views::DialogDelegate implementation: | 39 // views::DialogDelegate implementation: |
| 40 virtual base::string16 GetWindowTitle() const OVERRIDE; | 40 virtual base::string16 GetWindowTitle() const override; |
| 41 virtual void DeleteDelegate() OVERRIDE; | 41 virtual void DeleteDelegate() override; |
| 42 virtual views::Widget* GetWidget() OVERRIDE; | 42 virtual views::Widget* GetWidget() override; |
| 43 virtual const views::Widget* GetWidget() const OVERRIDE; | 43 virtual const views::Widget* GetWidget() const override; |
| 44 virtual views::View* GetContentsView() OVERRIDE; | 44 virtual views::View* GetContentsView() override; |
| 45 virtual base::string16 GetDialogButtonLabel( | 45 virtual base::string16 GetDialogButtonLabel( |
| 46 ui::DialogButton button) const OVERRIDE; | 46 ui::DialogButton button) const override; |
| 47 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | 47 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| 48 virtual ui::ModalType GetModalType() const OVERRIDE; | 48 virtual ui::ModalType GetModalType() const override; |
| 49 virtual views::View* CreateExtraView() OVERRIDE; | 49 virtual views::View* CreateExtraView() override; |
| 50 virtual bool Cancel() OVERRIDE; | 50 virtual bool Cancel() override; |
| 51 virtual bool Accept() OVERRIDE; | 51 virtual bool Accept() override; |
| 52 | 52 |
| 53 // views::ButtonListener implementation: | 53 // views::ButtonListener implementation: |
| 54 virtual void ButtonPressed(views::Button* sender, | 54 virtual void ButtonPressed(views::Button* sender, |
| 55 const ui::Event& event) OVERRIDE; | 55 const ui::Event& event) override; |
| 56 | 56 |
| 57 // views::ContextMenuController implementation: | 57 // views::ContextMenuController implementation: |
| 58 virtual void ShowContextMenuForView(views::View* source, | 58 virtual void ShowContextMenuForView(views::View* source, |
| 59 const gfx::Point& point, | 59 const gfx::Point& point, |
| 60 ui::MenuSourceType source_type) OVERRIDE; | 60 ui::MenuSourceType source_type) override; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes); | 63 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes); |
| 64 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes); | 64 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes); |
| 65 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds); | 65 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds); |
| 66 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ForgetDeletes); | 66 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ForgetDeletes); |
| 67 | 67 |
| 68 typedef std::map<MediaGalleryPrefId, MediaGalleryCheckboxView*> CheckboxMap; | 68 typedef std::map<MediaGalleryPrefId, MediaGalleryCheckboxView*> CheckboxMap; |
| 69 | 69 |
| 70 // MediaGalleriesDialog implementation: | 70 // MediaGalleriesDialog implementation: |
| 71 virtual void AcceptDialogForTesting() OVERRIDE; | 71 virtual void AcceptDialogForTesting() override; |
| 72 | 72 |
| 73 void InitChildViews(); | 73 void InitChildViews(); |
| 74 | 74 |
| 75 // Adds a checkbox or updates an existing checkbox. Returns true if a new one | 75 // Adds a checkbox or updates an existing checkbox. Returns true if a new one |
| 76 // was added. | 76 // was added. |
| 77 bool AddOrUpdateGallery( | 77 bool AddOrUpdateGallery( |
| 78 const MediaGalleriesDialogController::Entry& gallery, | 78 const MediaGalleriesDialogController::Entry& gallery, |
| 79 views::View* container, | 79 views::View* container, |
| 80 int trailing_vertical_space); | 80 int trailing_vertical_space); |
| 81 | 81 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 106 | 106 |
| 107 // True if the user has pressed accept. | 107 // True if the user has pressed accept. |
| 108 bool accepted_; | 108 bool accepted_; |
| 109 | 109 |
| 110 scoped_ptr<views::MenuRunner> context_menu_runner_; | 110 scoped_ptr<views::MenuRunner> context_menu_runner_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogViews); | 112 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogViews); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ | 115 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_MEDIA_GALLERIES_DIALOG_VIEWS_H_ |
| OLD | NEW |