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

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: 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_.get()) {
groby-ooo-7-16 2015/10/19 20:09:31 Nit: no .get() needed
anthonyvd 2015/10/20 19:40:49 Done.
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_ close];
379 reauth_window_controller_.reset();
groby-ooo-7-16 2015/10/19 20:09:31 Q: Doesn't reset() imply -close?
anthonyvd 2015/10/20 19:40:49 It does, thanks for noticing!
377 } 380 }
378 381
379 @end 382 @end
380 383
381 384
382 // static 385 // static
383 void UserManager::Show( 386 void UserManager::Show(
384 const base::FilePath& profile_path_to_focus, 387 const base::FilePath& profile_path_to_focus,
385 profiles::UserManagerTutorialMode tutorial_mode, 388 profiles::UserManagerTutorialMode tutorial_mode,
386 profiles::UserManagerProfileSelected profile_open_action) { 389 profiles::UserManagerProfileSelected profile_open_action) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 ProfileMetrics::LogTimeToOpenUserManager( 475 ProfileMetrics::LogTimeToOpenUserManager(
473 base::Time::Now() - user_manager_started_showing_); 476 base::Time::Now() - user_manager_started_showing_);
474 user_manager_started_showing_ = base::Time(); 477 user_manager_started_showing_ = base::Time();
475 } 478 }
476 479
477 void UserManagerMac::WindowWasClosed() { 480 void UserManagerMac::WindowWasClosed() {
478 CloseReauthDialog(); 481 CloseReauthDialog();
479 instance_ = NULL; 482 instance_ = NULL;
480 delete this; 483 delete this;
481 } 484 }
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