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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_dialog_controller.h

Issue 148093011: Abstract media galleries context menu code and use it in scan result dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Header too Created 6 years, 10 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_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 namespace extensions { 23 namespace extensions {
24 class Extension; 24 class Extension;
25 } 25 }
26 26
27 namespace ui { 27 namespace ui {
28 class MenuModel; 28 class MenuModel;
29 } 29 }
30 30
31 class GalleryContextMenuModel;
32 class MediaGalleriesDialogController; 31 class MediaGalleriesDialogController;
32 class MediaGalleryContextMenu;
33 class Profile; 33 class Profile;
34 34
35 // The view. 35 // The view.
36 class MediaGalleriesDialog { 36 class MediaGalleriesDialog {
37 public: 37 public:
38 virtual ~MediaGalleriesDialog(); 38 virtual ~MediaGalleriesDialog();
39 39
40 // Tell the dialog to update its display list of galleries. 40 // Tell the dialog to update its display list of galleries.
41 virtual void UpdateGalleries() = 0; 41 virtual void UpdateGalleries() = 0;
42 42
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 virtual void OnAddFolderClicked(); 91 virtual void OnAddFolderClicked();
92 92
93 // A checkbox beside a gallery permission was checked. The full set 93 // A checkbox beside a gallery permission was checked. The full set
94 // of gallery permissions checkbox settings is sent on every checkbox toggle. 94 // of gallery permissions checkbox settings is sent on every checkbox toggle.
95 virtual void DidToggleGalleryId(MediaGalleryPrefId pref_id, 95 virtual void DidToggleGalleryId(MediaGalleryPrefId pref_id,
96 bool enabled); 96 bool enabled);
97 virtual void DidToggleNewGallery(const MediaGalleryPrefInfo& gallery, 97 virtual void DidToggleNewGallery(const MediaGalleryPrefInfo& gallery,
98 bool enabled); 98 bool enabled);
99 99
100 // The forget command in the context menu was selected. 100 // The forget command in the context menu was selected.
101 virtual void DidForgetGallery(MediaGalleryPrefId pref_id); 101 virtual void DidForgetGallery(MediaGalleryPrefId pref_id);
groby-ooo-7-16 2014/01/29 05:01:37 Out of scope for this CL, but: A base class with n
vandebo (ex-Chrome) 2014/01/29 17:16:55 Presumably that's to support the controller mock:
102 102
103 // The dialog is being deleted. 103 // The dialog is being deleted.
104 virtual void DialogFinished(bool accepted); 104 virtual void DialogFinished(bool accepted);
105 105
106 virtual content::WebContents* web_contents(); 106 virtual content::WebContents* web_contents();
107 107
108 ui::MenuModel* GetContextMenuModel(MediaGalleryPrefId id); 108 ui::MenuModel* GetContextMenu(MediaGalleryPrefId id);
109 109
110 protected: 110 protected:
111 // For use with tests. 111 // For use with tests.
112 explicit MediaGalleriesDialogController( 112 explicit MediaGalleriesDialogController(
113 const extensions::Extension& extension); 113 const extensions::Extension& extension);
114 114
115 virtual ~MediaGalleriesDialogController(); 115 virtual ~MediaGalleriesDialogController();
116 116
117 private: 117 private:
118 // This type keeps track of media galleries already known to the prefs system. 118 // This type keeps track of media galleries already known to the prefs system.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // The model that tracks galleries and extensions' permissions. 194 // The model that tracks galleries and extensions' permissions.
195 // This is the authoritative source for gallery information. 195 // This is the authoritative source for gallery information.
196 MediaGalleriesPreferences* preferences_; 196 MediaGalleriesPreferences* preferences_;
197 197
198 // The view that's showing. 198 // The view that's showing.
199 scoped_ptr<MediaGalleriesDialog> dialog_; 199 scoped_ptr<MediaGalleriesDialog> dialog_;
200 200
201 scoped_refptr<ui::SelectFileDialog> select_folder_dialog_; 201 scoped_refptr<ui::SelectFileDialog> select_folder_dialog_;
202 202
203 scoped_ptr<ui::MenuModel> context_menu_model_; 203 scoped_ptr<MediaGalleryContextMenu> context_menu_;
204 scoped_ptr<GalleryContextMenuModel> gallery_menu_model_;
205 204
206 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogController); 205 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogController);
207 }; 206 };
208 207
209 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_ 208 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_DIALOG_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698