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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.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_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
11 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" 11 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h"
12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
13 13
14 @class ConstrainedWindowAlert; 14 @class ConstrainedWindowAlert;
15 @class MediaGalleriesCocoaController; 15 @class MediaGalleriesCocoaController;
16 16
17 class MediaGalleriesDialogBrowserTest; 17 class MediaGalleriesDialogBrowserTest;
18 class MediaGalleriesDialogTest; 18 class MediaGalleriesDialogTest;
19 19
20 namespace ui {
21 class MenuModel;
22 }
23
groby-ooo-7-16 2014/01/29 05:01:37 nit: Keep the forward declare here, since ui::Menu
vandebo (ex-Chrome) 2014/01/29 17:16:55 Done.
24 // This class displays an alert that can be used to grant permission for 20 // This class displays an alert that can be used to grant permission for
25 // extensions to access a gallery (media folders). 21 // extensions to access a gallery (media folders).
26 class MediaGalleriesDialogCocoa : public ConstrainedWindowMacDelegate, 22 class MediaGalleriesDialogCocoa : public ConstrainedWindowMacDelegate,
27 public MediaGalleriesDialog { 23 public MediaGalleriesDialog {
28 public: 24 public:
29 MediaGalleriesDialogCocoa( 25 MediaGalleriesDialogCocoa(
30 MediaGalleriesDialogController* controller, 26 MediaGalleriesDialogController* controller,
31 MediaGalleriesCocoaController* delegate); 27 MediaGalleriesCocoaController* delegate);
32 virtual ~MediaGalleriesDialogCocoa(); 28 virtual ~MediaGalleriesDialogCocoa();
33 29
34 // Called when the user clicks the accept button. 30 // Called when the user clicks the accept button.
35 void OnAcceptClicked(); 31 void OnAcceptClicked();
36 // Called when the user clicks the cancel button. 32 // Called when the user clicks the cancel button.
37 void OnCancelClicked(); 33 void OnCancelClicked();
38 // Called when the user clicks the Add Gallery button. 34 // Called when the user clicks the Add Gallery button.
39 void OnAddFolderClicked(); 35 void OnAddFolderClicked();
40 // Called when the user toggles a gallery checkbox. 36 // Called when the user toggles a gallery checkbox.
41 void OnCheckboxToggled(NSButton* checkbox); 37 void OnCheckboxToggled(NSButton* checkbox);
42 38
43 // MediaGalleriesDialog implementation: 39 // MediaGalleriesDialog implementation:
44 virtual void UpdateGalleries() OVERRIDE; 40 virtual void UpdateGalleries() OVERRIDE;
45 41
46 // ConstrainedWindowMacDelegate implementation. 42 // ConstrainedWindowMacDelegate implementation.
47 virtual void OnConstrainedWindowClosed( 43 virtual void OnConstrainedWindowClosed(
48 ConstrainedWindowMac* window) OVERRIDE; 44 ConstrainedWindowMac* window) OVERRIDE;
49 45
50 ui::MenuModel* GetContextMenuModel(MediaGalleryPrefId prefid); 46 ui::MenuModel* GetContextMenu(MediaGalleryPrefId prefid);
51 47
52 private: 48 private:
53 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogBrowserTest, Close); 49 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogBrowserTest, Close);
54 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes); 50 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes);
55 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes); 51 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes);
56 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds); 52 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds);
57 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ForgetDeletes); 53 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ForgetDeletes);
58 54
59 void UpdateGalleryCheckbox(const MediaGalleryPrefInfo& gallery, 55 void UpdateGalleryCheckbox(const MediaGalleryPrefInfo& gallery,
60 bool permitted, 56 bool permitted,
(...skipping 29 matching lines...) Expand all
90 // Container view for the main dialog contents. 86 // Container view for the main dialog contents.
91 base::scoped_nsobject<NSBox> accessory_; 87 base::scoped_nsobject<NSBox> accessory_;
92 88
93 // An Objective-C class to route callbacks from Cocoa code. 89 // An Objective-C class to route callbacks from Cocoa code.
94 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller_; 90 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller_;
95 91
96 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa); 92 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa);
97 }; 93 };
98 94
99 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ 95 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698