OLD | NEW |
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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 chrome::NOTIFICATION_BROWSER_CLOSED, | 252 chrome::NOTIFICATION_BROWSER_CLOSED, |
253 content::NotificationService::AllSources()); | 253 content::NotificationService::AllSources()); |
254 registrar_.Add( | 254 registrar_.Add( |
255 this, | 255 this, |
256 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 256 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
257 content::NotificationService::AllSources()); | 257 content::NotificationService::AllSources()); |
258 registrar_.Add( | 258 registrar_.Add( |
259 this, | 259 this, |
260 chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, | 260 chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, |
261 content::NotificationService::AllSources()); | 261 content::NotificationService::AllSources()); |
262 registrar_.Add( | |
263 this, | |
264 chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | |
265 content::NotificationService::AllSources()); | |
266 | 262 |
267 if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty()) | 263 if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty()) |
268 profile_shortcut_manager_.reset(ProfileShortcutManager::Create( | 264 profile_shortcut_manager_.reset(ProfileShortcutManager::Create( |
269 this)); | 265 this)); |
270 } | 266 } |
271 | 267 |
272 ProfileManager::~ProfileManager() { | 268 ProfileManager::~ProfileManager() { |
273 } | 269 } |
274 | 270 |
275 #if defined(ENABLE_SESSION_SERVICE) | 271 #if defined(ENABLE_SESSION_SERVICE) |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 DCHECK(browser); | 903 DCHECK(browser); |
908 Profile* profile = browser->profile(); | 904 Profile* profile = browser->profile(); |
909 DCHECK(profile); | 905 DCHECK(profile); |
910 if (!profile->IsOffTheRecord() && --browser_counts_[profile] == 0) { | 906 if (!profile->IsOffTheRecord() && --browser_counts_[profile] == 0) { |
911 active_profiles_.erase(std::find(active_profiles_.begin(), | 907 active_profiles_.erase(std::find(active_profiles_.begin(), |
912 active_profiles_.end(), profile)); | 908 active_profiles_.end(), profile)); |
913 save_active_profiles = !closing_all_browsers_; | 909 save_active_profiles = !closing_all_browsers_; |
914 } | 910 } |
915 break; | 911 break; |
916 } | 912 } |
917 case chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED: { | |
918 save_active_profiles = !closing_all_browsers_; | |
919 break; | |
920 } | |
921 default: { | 913 default: { |
922 NOTREACHED(); | 914 NOTREACHED(); |
923 break; | 915 break; |
924 } | 916 } |
925 } | 917 } |
926 | 918 |
927 if (save_active_profiles) { | 919 if (save_active_profiles) { |
928 PrefService* local_state = g_browser_process->local_state(); | 920 PrefService* local_state = g_browser_process->local_state(); |
929 DCHECK(local_state); | 921 DCHECK(local_state); |
930 ListPrefUpdate update(local_state, prefs::kProfilesLastActive); | 922 ListPrefUpdate update(local_state, prefs::kProfilesLastActive); |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1358 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1367 FinishDeletingProfile(profile_to_delete_path); | 1359 FinishDeletingProfile(profile_to_delete_path); |
1368 } | 1360 } |
1369 } | 1361 } |
1370 } | 1362 } |
1371 #endif | 1363 #endif |
1372 | 1364 |
1373 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1365 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1374 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1366 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1375 } | 1367 } |
OLD | NEW |