Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm

Issue 1446623003: [Reland] Enable AutoResize for Constrained Web Dialogs for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h ('k') | chrome/browser/ui/cocoa/login_prompt_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698