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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 DCHECK(browser); | 908 DCHECK(browser); |
913 Profile* profile = browser->profile(); | 909 Profile* profile = browser->profile(); |
914 DCHECK(profile); | 910 DCHECK(profile); |
915 if (!profile->IsOffTheRecord() && --browser_counts_[profile] == 0) { | 911 if (!profile->IsOffTheRecord() && --browser_counts_[profile] == 0) { |
916 active_profiles_.erase(std::find(active_profiles_.begin(), | 912 active_profiles_.erase(std::find(active_profiles_.begin(), |
917 active_profiles_.end(), profile)); | 913 active_profiles_.end(), profile)); |
918 save_active_profiles = !closing_all_browsers_; | 914 save_active_profiles = !closing_all_browsers_; |
919 } | 915 } |
920 break; | 916 break; |
921 } | 917 } |
922 case chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED: { | |
923 save_active_profiles = !closing_all_browsers_; | |
924 break; | |
925 } | |
926 default: { | 918 default: { |
927 NOTREACHED(); | 919 NOTREACHED(); |
928 break; | 920 break; |
929 } | 921 } |
930 } | 922 } |
931 | 923 |
932 if (save_active_profiles) { | 924 if (save_active_profiles) { |
933 PrefService* local_state = g_browser_process->local_state(); | 925 PrefService* local_state = g_browser_process->local_state(); |
934 DCHECK(local_state); | 926 DCHECK(local_state); |
935 ListPrefUpdate update(local_state, prefs::kProfilesLastActive); | 927 ListPrefUpdate update(local_state, prefs::kProfilesLastActive); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1391 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1400 FinishDeletingProfile(profile_to_delete_path); | 1392 FinishDeletingProfile(profile_to_delete_path); |
1401 } | 1393 } |
1402 } | 1394 } |
1403 } | 1395 } |
1404 #endif | 1396 #endif |
1405 | 1397 |
1406 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1398 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1407 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1399 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1408 } | 1400 } |
OLD | NEW |