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

Side by Side Diff: chrome/browser/ui/webui/signin/user_manager_screen_handler.cc

Issue 1113333003: Don't create a new profile when cleaning up stale ephemeral profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fix? Created 5 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/webui/signin/user_manager_screen_handler.h" 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 NOTREACHED(); 470 NOTREACHED();
471 return; 471 return;
472 } 472 }
473 473
474 if (!profiles::IsMultipleProfilesEnabled()) { 474 if (!profiles::IsMultipleProfilesEnabled()) {
475 NOTREACHED(); 475 NOTREACHED();
476 return; 476 return;
477 } 477 }
478 478
479 g_browser_process->profile_manager()->ScheduleProfileForDeletion( 479 g_browser_process->profile_manager()->ScheduleProfileForDeletion(
480 profile_path, 480 profile_path, false /* suppress_profile_creation */,
481 base::Bind(&OpenNewWindowForProfile, desktop_type_)); 481 base::Bind(&OpenNewWindowForProfile, desktop_type_));
482 ProfileMetrics::LogProfileDeleteUser( 482 ProfileMetrics::LogProfileDeleteUser(
483 ProfileMetrics::DELETE_PROFILE_USER_MANAGER); 483 ProfileMetrics::DELETE_PROFILE_USER_MANAGER);
484 } 484 }
485 485
486 void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) { 486 void UserManagerScreenHandler::HandleLaunchGuest(const base::ListValue* args) {
487 if (IsGuestModeEnabled()) { 487 if (IsGuestModeEnabled()) {
488 profiles::SwitchToGuestProfile( 488 profiles::SwitchToGuestProfile(
489 desktop_type_, 489 desktop_type_,
490 base::Bind(&UserManagerScreenHandler::OnSwitchToProfileComplete, 490 base::Bind(&UserManagerScreenHandler::OnSwitchToProfileComplete,
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 Profile* profile, Profile::CreateStatus profile_create_status) { 864 Profile* profile, Profile::CreateStatus profile_create_status) {
865 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); 865 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_);
866 if (browser && browser->window()) { 866 if (browser && browser->window()) {
867 OnBrowserWindowReady(browser); 867 OnBrowserWindowReady(browser);
868 } else { 868 } else {
869 registrar_.Add(this, 869 registrar_.Add(this,
870 chrome::NOTIFICATION_BROWSER_WINDOW_READY, 870 chrome::NOTIFICATION_BROWSER_WINDOW_READY,
871 content::NotificationService::AllSources()); 871 content::NotificationService::AllSources());
872 } 872 }
873 } 873 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698