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 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 [alert_ setAccessoryView:checkbox_container_]; | 87 [alert_ setAccessoryView:checkbox_container_]; |
88 | 88 |
89 // As a safeguard against the user skipping reading over the dialog and just | 89 // As a safeguard against the user skipping reading over the dialog and just |
90 // confirming, the button will be unavailable for dialogs without any checks | 90 // confirming, the button will be unavailable for dialogs without any checks |
91 // until the user toggles something. | 91 // until the user toggles something. |
92 [[[alert_ buttons] objectAtIndex:0] setEnabled: | 92 [[[alert_ buttons] objectAtIndex:0] setEnabled: |
93 controller_->HasPermittedGalleries()]; | 93 controller_->HasPermittedGalleries()]; |
94 | 94 |
95 set_sheet(alert_); | 95 set_sheet(alert_); |
96 // May be NULL during tests. | 96 // May be NULL during tests. |
97 if (controller->tab_contents()) | 97 if (controller->web_contents()) |
98 window_ = new ConstrainedWindowMac(controller->tab_contents(), this); | 98 window_ = new ConstrainedWindowMac(controller->web_contents(), this); |
99 } | 99 } |
100 | 100 |
101 MediaGalleriesDialogCocoa::~MediaGalleriesDialogCocoa() { | 101 MediaGalleriesDialogCocoa::~MediaGalleriesDialogCocoa() { |
102 } | 102 } |
103 | 103 |
104 void MediaGalleriesDialogCocoa::OnAddFolderClicked() { | 104 void MediaGalleriesDialogCocoa::OnAddFolderClicked() { |
105 controller_->OnAddFolderClicked(); | 105 controller_->OnAddFolderClicked(); |
106 } | 106 } |
107 | 107 |
108 void MediaGalleriesDialogCocoa::OnCheckboxToggled(NSButton* checkbox) { | 108 void MediaGalleriesDialogCocoa::OnCheckboxToggled(NSButton* checkbox) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 // static | 212 // static |
213 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 213 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
214 MediaGalleriesDialogController* controller) { | 214 MediaGalleriesDialogController* controller) { |
215 scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( | 215 scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( |
216 [[MediaGalleriesCocoaController alloc] init]); | 216 [[MediaGalleriesCocoaController alloc] init]); |
217 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); | 217 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); |
218 } | 218 } |
219 | 219 |
220 } // namespace chrome | 220 } // namespace chrome |
OLD | NEW |