Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ | |
| 6 #define CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ | |
| 7 | |
| 8 #include <gtk/gtk.h> | |
| 9 #include <map> | |
| 10 | |
| 11 #include "base/compiler_specific.h" | |
| 12 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" | |
| 13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | |
| 14 #include "ui/base/gtk/gtk_signal.h" | |
| 15 #include "ui/base/gtk/owned_widget_gtk.h" | |
| 16 | |
| 17 namespace chrome { | |
| 18 | |
| 19 class MediaGalleriesDialogController; | |
| 20 | |
| 21 // The media galleries configuration view for Gtk. It will immediately show | |
| 22 // upon construction. | |
| 23 class MediaGalleriesDialogGtk : public MediaGalleriesDialog, | |
| 24 public ConstrainedWindowGtkDelegate { | |
| 25 public: | |
| 26 explicit MediaGalleriesDialogGtk(MediaGalleriesDialogController* controller); | |
| 27 virtual ~MediaGalleriesDialogGtk() {} | |
| 28 | |
| 29 // MediaGalleriesDialog implementation: | |
| 30 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, | |
| 31 bool permitted) OVERRIDE; | |
| 32 | |
| 33 // ConstrainedWindowGtkDelegate implementation: | |
| 34 virtual GtkWidget* GetWidgetRoot() OVERRIDE; | |
| 35 virtual GtkWidget* GetFocusWidget() OVERRIDE; | |
| 36 virtual void DeleteDelegate() OVERRIDE; | |
| 37 | |
| 38 // Event callbacks. | |
| 39 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnToggled); | |
| 40 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnAddFolder); | |
| 41 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnConfirm); | |
| 42 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnCancel); | |
| 43 | |
| 44 private: | |
| 45 // Creates the widget hierarchy. | |
| 46 void InitWidgets(); | |
| 47 | |
| 48 // Updates the state of the confirm button. It will be disabled when | |
| 49 void UpdateConfirmButtonState(); | |
| 50 | |
| 51 MediaGalleriesDialogController* controller_; | |
| 52 ConstrainedWindowGtk* window_; | |
| 53 | |
| 54 // The root widget for the dialog. | |
| 55 ui::OwnedWidgetGtk contents_; | |
| 56 | |
| 57 // The confirm button. | |
| 58 GtkWidget* confirm_; | |
| 59 | |
| 60 // A map from MediaGalleryPrefInfo struct (owned by controller) to the | |
| 61 // GtkCheckButton that controls it. | |
| 62 GtkWidget* checkbox_container_; | |
| 63 typedef std::map<const MediaGalleryPrefInfo*, GtkWidget*> CheckboxMap; | |
|
vandebo (ex-Chrome)
2012/08/08 19:24:21
typedef should be just after private
Evan Stade
2012/08/08 21:48:57
Done.
| |
| 64 CheckboxMap checkbox_map_; | |
| 65 | |
| 66 // When true, checkbox toggles are ignored (used when updating the UI). | |
| 67 bool ignore_toggles_; | |
| 68 | |
| 69 // True if the user has pressed accept. | |
| 70 bool accepted_; | |
| 71 | |
| 72 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogGtk); | |
| 73 }; | |
| 74 | |
| 75 } // namespace chrome | |
| 76 | |
| 77 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ | |
| OLD | NEW |