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_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ |
| 7 |
| 8 #include "chrome/browser/media_gallery/media_galleries_dialog_controller.h" |
| 9 #import "chrome/browser/ui/cocoa/constrained_window_mac.h" |
| 10 |
| 11 @class MediaGalleriesCocoaBridge; |
| 12 |
| 13 namespace chrome { |
| 14 |
| 15 class MediaGalleriesDialogCocoa : |
| 16 public ConstrainedWindowMacDelegateSystemSheet, |
| 17 public MediaGalleriesDialog { |
| 18 public: |
| 19 MediaGalleriesDialogCocoa( |
| 20 MediaGalleriesDialogController* controller, |
| 21 MediaGalleriesCocoaBridge* delegate); |
| 22 virtual ~MediaGalleriesDialogCocoa(); |
| 23 |
| 24 void OnAddFolderClicked(); |
| 25 void OnCheckboxToggled(NSButton* checkbox); |
| 26 void SheetDidEnd(NSInteger result); |
| 27 |
| 28 // MediaGalleriesDialog implementation: |
| 29 virtual void UpdateGallery(const MediaGalleryPrefInfo* gallery, |
| 30 bool permitted) OVERRIDE; |
| 31 |
| 32 // ConstrainedWindowMacDelegateSystemSheet implementation. |
| 33 virtual void DeleteDelegate() OVERRIDE; |
| 34 |
| 35 private: |
| 36 void UpdateGalleryCheckbox(NSButton* checkbox, |
| 37 const MediaGalleryPrefInfo* gallery, |
| 38 bool permitted); |
| 39 void UpdateCheckboxContainerFrame(); |
| 40 |
| 41 // Weak pointer to the controller. |
| 42 MediaGalleriesDialogController* controller_; |
| 43 |
| 44 // Weak pointer to the window. |
| 45 ConstrainedWindow* window_; |
| 46 |
| 47 // True if the user has pressed accept. |
| 48 bool accepted_; |
| 49 |
| 50 // List of checkboxes ordered from bottom to top. |
| 51 scoped_nsobject<NSMutableArray> checkboxes_; |
| 52 |
| 53 // Container view for checkboxes. |
| 54 scoped_nsobject<NSView> checkbox_container_; |
| 55 |
| 56 // The alert that the dialog is being displayed as. |
| 57 scoped_nsobject<NSAlert> alert_; |
| 58 |
| 59 // An Objective-C class to route callbacks from Cocoa code. |
| 60 scoped_nsobject<MediaGalleriesCocoaBridge> cocoa_bridge_; |
| 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogCocoa); |
| 63 }; |
| 64 |
| 65 } // namespace chrome |
| 66 |
| 67 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERIES_DIALOG_COCOA_H_ |
OLD | NEW |