Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.h

Issue 10823303: add unit tests for MediaGalleriesDialogGtk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include <map> 9 #include <map>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h"
12 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" 13 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h"
13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" 14 #include "chrome/browser/ui/gtk/constrained_window_gtk.h"
14 #include "ui/base/gtk/gtk_signal.h" 15 #include "ui/base/gtk/gtk_signal.h"
15 #include "ui/base/gtk/owned_widget_gtk.h" 16 #include "ui/base/gtk/owned_widget_gtk.h"
16 17
17 namespace chrome { 18 namespace chrome {
18 19
19 class MediaGalleriesDialogController; 20 class MediaGalleriesDialogController;
21 class MediaGalleriesDialogTest;
20 22
21 // The media galleries configuration view for Gtk. It will immediately show 23 // The media galleries configuration view for Gtk. It will immediately show
22 // upon construction. 24 // upon construction.
23 class MediaGalleriesDialogGtk : public MediaGalleriesDialog, 25 class MediaGalleriesDialogGtk : public MediaGalleriesDialog,
24 public ConstrainedWindowGtkDelegate { 26 public ConstrainedWindowGtkDelegate {
25 public: 27 public:
26 explicit MediaGalleriesDialogGtk(MediaGalleriesDialogController* controller); 28 explicit MediaGalleriesDialogGtk(MediaGalleriesDialogController* controller);
27 virtual ~MediaGalleriesDialogGtk(); 29 virtual ~MediaGalleriesDialogGtk();
28 30
29 // MediaGalleriesDialog implementation: 31 // MediaGalleriesDialog implementation:
30 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, 32 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery,
31 bool permitted) OVERRIDE; 33 bool permitted) OVERRIDE;
32 34
33 // ConstrainedWindowGtkDelegate implementation: 35 // ConstrainedWindowGtkDelegate implementation:
34 virtual GtkWidget* GetWidgetRoot() OVERRIDE; 36 virtual GtkWidget* GetWidgetRoot() OVERRIDE;
35 virtual GtkWidget* GetFocusWidget() OVERRIDE; 37 virtual GtkWidget* GetFocusWidget() OVERRIDE;
36 virtual void DeleteDelegate() OVERRIDE; 38 virtual void DeleteDelegate() OVERRIDE;
37 39
38 // Event callbacks. 40 // Event callbacks.
39 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnToggled); 41 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnToggled);
40 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnAddFolder); 42 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnAddFolder);
41 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnConfirm); 43 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnConfirm);
42 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnCancel); 44 CHROMEGTK_CALLBACK_0(MediaGalleriesDialogGtk, void, OnCancel);
43 45
44 private: 46 private:
47 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes);
48 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes);
49 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds);
50
45 typedef std::map<const MediaGalleryPrefInfo*, GtkWidget*> CheckboxMap; 51 typedef std::map<const MediaGalleryPrefInfo*, GtkWidget*> CheckboxMap;
46 52
47 // Creates the widget hierarchy. 53 // Creates the widget hierarchy.
48 void InitWidgets(); 54 void InitWidgets();
49 55
50 // Updates the state of the confirm button. It will be disabled when 56 // Updates the state of the confirm button. It will be disabled when
51 void UpdateConfirmButtonState(); 57 void UpdateConfirmButtonState();
52 58
53 MediaGalleriesDialogController* controller_; 59 MediaGalleriesDialogController* controller_;
54 ConstrainedWindowGtk* window_; 60 ConstrainedWindowGtk* window_;
(...skipping 16 matching lines...) Expand all
71 77
72 // True if the user has pressed accept. 78 // True if the user has pressed accept.
73 bool accepted_; 79 bool accepted_;
74 80
75 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogGtk); 81 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogGtk);
76 }; 82 };
77 83
78 } // namespace chrome 84 } // namespace chrome
79 85
80 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_ 86 #endif // CHROME_BROWSER_UI_GTK_EXTENSIONS_MEDIA_GALLERIES_DIALOG_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698