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_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 #include "base/gtest_prod_util.h" |
8 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" | 9 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" |
9 #import "chrome/browser/ui/cocoa/constrained_window_mac.h" | 10 #import "chrome/browser/ui/cocoa/constrained_window_mac.h" |
10 | 11 |
11 @class MediaGalleriesCocoaBridge; | 12 @class MediaGalleriesCocoaBridge; |
12 | 13 |
13 namespace chrome { | 14 namespace chrome { |
14 | 15 |
| 16 class MediaGalleriesDialogTest; |
| 17 |
15 class MediaGalleriesDialogCocoa : | 18 class MediaGalleriesDialogCocoa : |
16 public ConstrainedWindowMacDelegateSystemSheet, | 19 public ConstrainedWindowMacDelegateSystemSheet, |
17 public MediaGalleriesDialog { | 20 public MediaGalleriesDialog { |
18 public: | 21 public: |
19 MediaGalleriesDialogCocoa( | 22 MediaGalleriesDialogCocoa( |
20 MediaGalleriesDialogController* controller, | 23 MediaGalleriesDialogController* controller, |
21 MediaGalleriesCocoaBridge* delegate); | 24 MediaGalleriesCocoaBridge* delegate); |
22 virtual ~MediaGalleriesDialogCocoa(); | 25 virtual ~MediaGalleriesDialogCocoa(); |
23 | 26 |
24 void OnAddFolderClicked(); | 27 void OnAddFolderClicked(); |
25 void OnCheckboxToggled(NSButton* checkbox); | 28 void OnCheckboxToggled(NSButton* checkbox); |
26 void SheetDidEnd(NSInteger result); | 29 void SheetDidEnd(NSInteger result); |
27 | 30 |
28 // MediaGalleriesDialog implementation: | 31 // MediaGalleriesDialog implementation: |
29 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, | 32 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, |
30 bool permitted) OVERRIDE; | 33 bool permitted) OVERRIDE; |
31 | 34 |
32 // ConstrainedWindowMacDelegateSystemSheet implementation. | 35 // ConstrainedWindowMacDelegateSystemSheet implementation. |
33 virtual void DeleteDelegate() OVERRIDE; | 36 virtual void DeleteDelegate() OVERRIDE; |
34 | 37 |
35 private: | 38 private: |
| 39 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, InitializeCheckboxes); |
| 40 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, ToggleCheckboxes); |
| 41 FRIEND_TEST_ALL_PREFIXES(MediaGalleriesDialogTest, UpdateAdds); |
| 42 |
36 void UpdateGalleryCheckbox(NSButton* checkbox, | 43 void UpdateGalleryCheckbox(NSButton* checkbox, |
37 const MediaGalleryPrefInfo* gallery, | 44 const MediaGalleryPrefInfo* gallery, |
38 bool permitted); | 45 bool permitted); |
39 void UpdateCheckboxContainerFrame(); | 46 void UpdateCheckboxContainerFrame(); |
40 | 47 |
41 // Weak pointer to the controller. | 48 // Weak pointer to the controller. |
42 MediaGalleriesDialogController* controller_; | 49 MediaGalleriesDialogController* controller_; |
43 | 50 |
44 // Weak pointer to the window. | 51 // Weak pointer to the window. |
45 ConstrainedWindow* window_; | 52 ConstrainedWindow* window_; |
(...skipping 12 matching lines...) Expand all Loading... |
58 | 65 |
59 // An Objective-C class to route callbacks from Cocoa code. | 66 // An Objective-C class to route callbacks from Cocoa code. |
60 scoped_nsobject<MediaGalleriesCocoaBridge> cocoa_bridge_; | 67 scoped_nsobject<MediaGalleriesCocoaBridge> cocoa_bridge_; |
61 | 68 |
62 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa); | 69 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa); |
63 }; | 70 }; |
64 | 71 |
65 } // namespace chrome | 72 } // namespace chrome |
66 | 73 |
67 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ | 74 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ |
OLD | NEW |