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

Side by Side Diff: chrome/browser/app_controller_mac.mm

Issue 8592006: Update last used profile when deleting profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "chrome/browser/app_controller_mac.h" 5 #import "chrome/browser/app_controller_mac.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 withObject:nil 454 withObject:nil
455 afterDelay:0.0]; 455 afterDelay:0.0];
456 } 456 }
457 457
458 // If the window changed to a new BrowserWindowController, update the profile. 458 // If the window changed to a new BrowserWindowController, update the profile.
459 id windowController = [[notify object] windowController]; 459 id windowController = [[notify object] windowController];
460 if ([windowController isKindOfClass:[BrowserWindowController class]]) { 460 if ([windowController isKindOfClass:[BrowserWindowController class]]) {
461 // If the profile is incognito, use the original profile. 461 // If the profile is incognito, use the original profile.
462 Profile* newProfile = [windowController profile]->GetOriginalProfile(); 462 Profile* newProfile = [windowController profile]->GetOriginalProfile();
463 [self windowChangedToProfile:newProfile]; 463 [self windowChangedToProfile:newProfile];
464 } else if (BrowserList::empty()) {
465 [self windowChangedToProfile:
466 g_browser_process->profile_manager()->GetLastUsedProfile()];
464 } 467 }
465 } 468 }
466 469
467 // Called when the user has changed browser windows, meaning the backing profile 470 // Called when the user has changed browser windows, meaning the backing profile
468 // may have changed. This can cause a rebuild of the user-data menus. This is a 471 // may have changed. This can cause a rebuild of the user-data menus. This is a
469 // no-op if the new profile is the same as the current one. This will always be 472 // no-op if the new profile is the same as the current one. This will always be
470 // the original profile and never incognito. 473 // the original profile and never incognito.
471 - (void)windowChangedToProfile:(Profile*)profile { 474 - (void)windowChangedToProfile:(Profile*)profile {
472 if (lastProfile_ == profile) 475 if (lastProfile_ == profile)
473 return; 476 return;
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 1283
1281 } // namespace browser 1284 } // namespace browser
1282 1285
1283 namespace app_controller_mac { 1286 namespace app_controller_mac {
1284 1287
1285 bool IsOpeningNewWindow() { 1288 bool IsOpeningNewWindow() {
1286 return g_is_opening_new_window; 1289 return g_is_opening_new_window;
1287 } 1290 }
1288 1291
1289 } // namespace app_controller_mac 1292 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698