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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 [[alert_ closeButton] setTarget:cocoa_controller_]; | 95 [[alert_ closeButton] setTarget:cocoa_controller_]; |
96 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; | 96 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; |
97 | 97 |
98 InitDialogControls(); | 98 InitDialogControls(); |
99 | 99 |
100 // May be NULL during tests. | 100 // May be NULL during tests. |
101 if (controller->WebContents()) { | 101 if (controller->WebContents()) { |
102 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 102 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
103 [[CustomConstrainedWindowSheet alloc] | 103 [[CustomConstrainedWindowSheet alloc] |
104 initWithCustomWindow:[alert_ window]]); | 104 initWithCustomWindow:[alert_ window]]); |
105 window_.reset(new ConstrainedWindowMac( | 105 window_ = CreateAndShowWebModalDialogMac( |
106 this, controller->WebContents(), sheet)); | 106 this, controller->WebContents(), sheet); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 MediaGalleriesDialogCocoa::~MediaGalleriesDialogCocoa() { | 110 MediaGalleriesDialogCocoa::~MediaGalleriesDialogCocoa() { |
111 } | 111 } |
112 | 112 |
113 void MediaGalleriesDialogCocoa::AcceptDialogForTesting() { | 113 void MediaGalleriesDialogCocoa::AcceptDialogForTesting() { |
114 OnAcceptClicked(); | 114 OnAcceptClicked(); |
115 } | 115 } |
116 | 116 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 return controller_->GetContextMenu(pref_id); | 272 return controller_->GetContextMenu(pref_id); |
273 } | 273 } |
274 | 274 |
275 // static | 275 // static |
276 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 276 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
277 MediaGalleriesDialogController* controller) { | 277 MediaGalleriesDialogController* controller) { |
278 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( | 278 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( |
279 [[MediaGalleriesCocoaController alloc] init]); | 279 [[MediaGalleriesCocoaController alloc] init]); |
280 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); | 280 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); |
281 } | 281 } |
OLD | NEW |