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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 2681203002: Add Browser::SkipCallBeforeUnload so that the browser windows can be closed regardless of beforeunl… (Closed)
Patch Set: cr - remove delegate in UnloadController Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 service->CancelDownloads(); 813 service->CancelDownloads();
814 DCHECK_EQ(0, service->NonMaliciousDownloadCount()); 814 DCHECK_EQ(0, service->NonMaliciousDownloadCount());
815 815
816 // Close all browser windows before deleting the profile. If the user 816 // Close all browser windows before deleting the profile. If the user
817 // cancels the closing of any tab in an OnBeforeUnload event, profile 817 // cancels the closing of any tab in an OnBeforeUnload event, profile
818 // deletion is also cancelled. (crbug.com/289390) 818 // deletion is also cancelled. (crbug.com/289390)
819 BrowserList::CloseAllBrowsersWithProfile( 819 BrowserList::CloseAllBrowsersWithProfile(
820 profile, 820 profile,
821 base::Bind(&ProfileManager::EnsureActiveProfileExistsBeforeDeletion, 821 base::Bind(&ProfileManager::EnsureActiveProfileExistsBeforeDeletion,
822 base::Unretained(this), callback), 822 base::Unretained(this), callback),
823 base::Bind(&CancelProfileDeletion)); 823 base::Bind(&CancelProfileDeletion), false);
824 } else { 824 } else {
825 EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir); 825 EnsureActiveProfileExistsBeforeDeletion(callback, profile_dir);
826 } 826 }
827 } 827 }
828 #endif // !defined(OS_ANDROID) 828 #endif // !defined(OS_ANDROID)
829 829
830 void ProfileManager::AutoloadProfiles() { 830 void ProfileManager::AutoloadProfiles() {
831 // If running in the background is disabled for the browser, do not autoload 831 // If running in the background is disabled for the browser, do not autoload
832 // any profiles. 832 // any profiles.
833 PrefService* local_state = g_browser_process->local_state(); 833 PrefService* local_state = g_browser_process->local_state();
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 1765
1766 const base::FilePath new_active_profile_dir = 1766 const base::FilePath new_active_profile_dir =
1767 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath(); 1767 found_entry ? found_entry->GetPath() : GenerateNextProfileDirectoryPath();
1768 FinishDeletingProfile(profile_dir, new_active_profile_dir); 1768 FinishDeletingProfile(profile_dir, new_active_profile_dir);
1769 } 1769 }
1770 #endif // !defined(OS_ANDROID) 1770 #endif // !defined(OS_ANDROID)
1771 1771
1772 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1772 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1773 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1773 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1774 } 1774 }
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager.cc ('k') | chrome/browser/profiles/profile_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698