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

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

Issue 1415743002: Prevent the Online Reauth window from opening twice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return [[self window] isVisible]; 358 return [[self window] isVisible];
359 } 359 }
360 360
361 - (void)windowWillClose:(NSNotification*)notification { 361 - (void)windowWillClose:(NSNotification*)notification {
362 [[NSNotificationCenter defaultCenter] removeObserver:self]; 362 [[NSNotificationCenter defaultCenter] removeObserver:self];
363 DCHECK(userManagerObserver_); 363 DCHECK(userManagerObserver_);
364 userManagerObserver_->WindowWasClosed(); 364 userManagerObserver_->WindowWasClosed();
365 } 365 }
366 366
367 - (void)showReauthDialogWithProfile:(Profile*)profile email:(std::string)email { 367 - (void)showReauthDialogWithProfile:(Profile*)profile email:(std::string)email {
368 reauth_window_controller_.reset( 368 if (!reauth_window_controller_) {
369 [[ReauthDialogWindowController alloc] 369 reauth_window_controller_.reset(
370 initWithProfile:profile 370 [[ReauthDialogWindowController alloc]
371 email:email 371 initWithProfile:profile
372 webContents:webContents_.get()]); 372 email:email
373 webContents:webContents_.get()]);
374 }
373 } 375 }
374 376
375 - (void)closeReauthDialog { 377 - (void)closeReauthDialog {
376 [reauth_window_controller_ close]; 378 reauth_window_controller_.reset();
377 } 379 }
378 380
379 @end 381 @end
380 382
381 383
382 // static 384 // static
383 void UserManager::Show( 385 void UserManager::Show(
384 const base::FilePath& profile_path_to_focus, 386 const base::FilePath& profile_path_to_focus,
385 profiles::UserManagerTutorialMode tutorial_mode, 387 profiles::UserManagerTutorialMode tutorial_mode,
386 profiles::UserManagerProfileSelected profile_open_action) { 388 profiles::UserManagerProfileSelected profile_open_action) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 ProfileMetrics::LogTimeToOpenUserManager( 474 ProfileMetrics::LogTimeToOpenUserManager(
473 base::Time::Now() - user_manager_started_showing_); 475 base::Time::Now() - user_manager_started_showing_);
474 user_manager_started_showing_ = base::Time(); 476 user_manager_started_showing_ = base::Time();
475 } 477 }
476 478
477 void UserManagerMac::WindowWasClosed() { 479 void UserManagerMac::WindowWasClosed() {
478 CloseReauthDialog(); 480 CloseReauthDialog();
479 instance_ = NULL; 481 instance_ = NULL;
480 delete this; 482 delete this;
481 } 483 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698