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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/user_manager_mac.mm

Issue 1430023002: Enable AutoResize for Constrained Web Dialogs for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per erikchen@'s comments. Created 5 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/profiles/user_manager_mac.h" 5 #include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #import "chrome/browser/app_controller_mac.h" 9 #import "chrome/browser/app_controller_mac.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 content::WebContents::CreateParams(profile))); 196 content::WebContents::CreateParams(profile)));
197 window.get().contentView = reauthWebContents_->GetNativeView(); 197 window.get().contentView = reauthWebContents_->GetNativeView();
198 webContentsDelegate_.reset( 198 webContentsDelegate_.reset(
199 new ReauthDialogDelegate(reauthWebContents_.get(), emailAddress_)); 199 new ReauthDialogDelegate(reauthWebContents_.get(), emailAddress_));
200 reauthWebContents_->SetDelegate(webContentsDelegate_.get()); 200 reauthWebContents_->SetDelegate(webContentsDelegate_.get());
201 201
202 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( 202 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet(
203 [[CustomConstrainedWindowSheet alloc] 203 [[CustomConstrainedWindowSheet alloc]
204 initWithCustomWindow:[self window]]); 204 initWithCustomWindow:[self window]]);
205 constrained_window_.reset( 205 constrained_window_.reset(
206 new ConstrainedWindowMac( 206 CreateAndShowWebModalDialogMac(
207 webContentsDelegate_.get(), webContents_, sheet)); 207 webContentsDelegate_.get(), webContents_, sheet));
208 208
209 // The close button needs to call CloseWebContentsModalDialog() on the 209 // The close button needs to call CloseWebContentsModalDialog() on the
210 // constrained window isntead of just [window close] so grab a reference to 210 // constrained window isntead of just [window close] so grab a reference to
211 // it in the title bar and change its action. 211 // it in the title bar and change its action.
212 auto closeButton = [window standardWindowButton:NSWindowCloseButton]; 212 auto closeButton = [window standardWindowButton:NSWindowCloseButton];
213 [closeButton setTarget:self]; 213 [closeButton setTarget:self];
214 [closeButton setAction:@selector(closeButtonClicked:)]; 214 [closeButton setAction:@selector(closeButtonClicked:)];
215 [self show]; 215 [self show];
216 } 216 }
217 217
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 ProfileMetrics::LogTimeToOpenUserManager( 472 ProfileMetrics::LogTimeToOpenUserManager(
473 base::Time::Now() - user_manager_started_showing_); 473 base::Time::Now() - user_manager_started_showing_);
474 user_manager_started_showing_ = base::Time(); 474 user_manager_started_showing_ = base::Time();
475 } 475 }
476 476
477 void UserManagerMac::WindowWasClosed() { 477 void UserManagerMac::WindowWasClosed() {
478 CloseReauthDialog(); 478 CloseReauthDialog();
479 instance_ = NULL; 479 instance_ = NULL;
480 delete this; 480 delete this;
481 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698