| OLD | NEW |
| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #import "chrome/browser/app_controller_mac.h" | 10 #import "chrome/browser/app_controller_mac.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 reauthWebContents_.reset(content::WebContents::Create( | 196 reauthWebContents_.reset(content::WebContents::Create( |
| 197 content::WebContents::CreateParams(profile))); | 197 content::WebContents::CreateParams(profile))); |
| 198 window.get().contentView = reauthWebContents_->GetNativeView(); | 198 window.get().contentView = reauthWebContents_->GetNativeView(); |
| 199 webContentsDelegate_.reset( | 199 webContentsDelegate_.reset( |
| 200 new ReauthDialogDelegate(reauthWebContents_.get(), emailAddress_)); | 200 new ReauthDialogDelegate(reauthWebContents_.get(), emailAddress_)); |
| 201 reauthWebContents_->SetDelegate(webContentsDelegate_.get()); | 201 reauthWebContents_->SetDelegate(webContentsDelegate_.get()); |
| 202 | 202 |
| 203 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 203 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 204 [[CustomConstrainedWindowSheet alloc] | 204 [[CustomConstrainedWindowSheet alloc] |
| 205 initWithCustomWindow:[self window]]); | 205 initWithCustomWindow:[self window]]); |
| 206 constrained_window_.reset( | 206 constrained_window_ = |
| 207 new ConstrainedWindowMac( | 207 CreateAndShowWebModalDialogMac( |
| 208 webContentsDelegate_.get(), webContents_, sheet)); | 208 webContentsDelegate_.get(), webContents_, sheet); |
| 209 | 209 |
| 210 // The close button needs to call CloseWebContentsModalDialog() on the | 210 // The close button needs to call CloseWebContentsModalDialog() on the |
| 211 // constrained window isntead of just [window close] so grab a reference to | 211 // constrained window isntead of just [window close] so grab a reference to |
| 212 // it in the title bar and change its action. | 212 // it in the title bar and change its action. |
| 213 auto closeButton = [window standardWindowButton:NSWindowCloseButton]; | 213 auto closeButton = [window standardWindowButton:NSWindowCloseButton]; |
| 214 [closeButton setTarget:self]; | 214 [closeButton setTarget:self]; |
| 215 [closeButton setAction:@selector(closeButtonClicked:)]; | 215 [closeButton setAction:@selector(closeButtonClicked:)]; |
| 216 [self show]; | 216 [self show]; |
| 217 } | 217 } |
| 218 | 218 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 ProfileMetrics::LogTimeToOpenUserManager( | 475 ProfileMetrics::LogTimeToOpenUserManager( |
| 476 base::Time::Now() - user_manager_started_showing_); | 476 base::Time::Now() - user_manager_started_showing_); |
| 477 user_manager_started_showing_ = base::Time(); | 477 user_manager_started_showing_ = base::Time(); |
| 478 } | 478 } |
| 479 | 479 |
| 480 void UserManagerMac::WindowWasClosed() { | 480 void UserManagerMac::WindowWasClosed() { |
| 481 CloseReauthDialog(); | 481 CloseReauthDialog(); |
| 482 instance_ = NULL; | 482 instance_ = NULL; |
| 483 delete this; | 483 delete this; |
| 484 } | 484 } |
| OLD | NEW |