| 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_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // upon construction. | 25 // upon construction. |
| 26 class MediaGalleriesDialogGtk : public MediaGalleriesDialog, | 26 class MediaGalleriesDialogGtk : public MediaGalleriesDialog, |
| 27 public ConstrainedWindowGtkDelegate { | 27 public ConstrainedWindowGtkDelegate { |
| 28 public: | 28 public: |
| 29 explicit MediaGalleriesDialogGtk(MediaGalleriesDialogController* controller); | 29 explicit MediaGalleriesDialogGtk(MediaGalleriesDialogController* controller); |
| 30 virtual ~MediaGalleriesDialogGtk(); | 30 virtual ~MediaGalleriesDialogGtk(); |
| 31 | 31 |
| 32 // MediaGalleriesDialog implementation: | 32 // MediaGalleriesDialog implementation: |
| 33 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, | 33 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, |
| 34 bool permitted) OVERRIDE; | 34 bool permitted) OVERRIDE; |
| 35 virtual void ForgetGallery(const MediaGalleryPrefInfo* gallery) OVERRIDE; |
| 35 | 36 |
| 36 // ConstrainedWindowGtkDelegate implementation: | 37 // ConstrainedWindowGtkDelegate implementation: |
| 37 virtual GtkWidget* GetWidgetRoot() OVERRIDE; | 38 virtual GtkWidget* GetWidgetRoot() OVERRIDE; |
| 38 virtual GtkWidget* GetFocusWidget() OVERRIDE; | 39 virtual GtkWidget* GetFocusWidget() OVERRIDE; |
| 39 virtual void DeleteDelegate() OVERRIDE; | 40 virtual void DeleteDelegate() OVERRIDE; |
| 40 | 41 |
| 41 // Event callbacks. | 42 // Event callbacks. |
| 42 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnToggled); | 43 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnToggled); |
| 43 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnAddFolder); | 44 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnAddFolder); |
| 44 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnConfirm); | 45 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnConfirm); |
| 45 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnCancel); | 46 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnCancel); |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes); | 49 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes); |
| 49 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes); | 50 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes); |
| 50 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds); | 51 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds); |
| 52 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ForgetDeletes); |
| 51 | 53 |
| 52 typedef std::map<const MediaGalleryPrefInfo*, GtkWidget*> CheckboxMap; | 54 typedef std::map<const MediaGalleryPrefInfo*, GtkWidget*> CheckboxMap; |
| 53 | 55 |
| 54 // Creates the widget hierarchy. | 56 // Creates the widget hierarchy. |
| 55 void InitWidgets(); | 57 void InitWidgets(); |
| 56 | 58 |
| 57 // Updates the state of the confirm button. It will be disabled when | 59 // Updates the state of the confirm button. It will be disabled when |
| 58 void UpdateConfirmButtonState(); | 60 void UpdateConfirmButtonState(); |
| 59 | 61 |
| 60 MediaGalleriesDialogController* controller_; | 62 MediaGalleriesDialogController* controller_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 78 | 80 |
| 79 // True if the user has pressed accept. | 81 // True if the user has pressed accept. |
| 80 bool accepted_; | 82 bool accepted_; |
| 81 | 83 |
| 82 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogGtk); | 84 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogGtk); |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 } // namespace chrome | 87 } // namespace chrome |
| 86 | 88 |
| 87 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ | 89 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ |
| OLD | NEW |