| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return controller_->GetContextMenu(pref_id); | 278 return controller_->GetContextMenu(pref_id); |
| 279 } | 279 } |
| 280 | 280 |
| 281 // static | 281 // static |
| 282 MediaGalleriesDialog* MediaGalleriesDialog::Create( | 282 MediaGalleriesDialog* MediaGalleriesDialog::Create( |
| 283 MediaGalleriesDialogController* controller) { | 283 MediaGalleriesDialogController* controller) { |
| 284 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( | 284 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( |
| 285 [[MediaGalleriesCocoaController alloc] init]); | 285 [[MediaGalleriesCocoaController alloc] init]); |
| 286 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); | 286 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); |
| 287 } | 287 } |
| OLD | NEW |