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