| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 registrar_.Add( | 241 registrar_.Add( |
| 242 this, | 242 this, |
| 243 chrome::NOTIFICATION_BROWSER_OPENED, | 243 chrome::NOTIFICATION_BROWSER_OPENED, |
| 244 content::NotificationService::AllSources()); | 244 content::NotificationService::AllSources()); |
| 245 registrar_.Add( | 245 registrar_.Add( |
| 246 this, | 246 this, |
| 247 chrome::NOTIFICATION_BROWSER_CLOSED, | 247 chrome::NOTIFICATION_BROWSER_CLOSED, |
| 248 content::NotificationService::AllSources()); | 248 content::NotificationService::AllSources()); |
| 249 registrar_.Add( | 249 registrar_.Add( |
| 250 this, | 250 this, |
| 251 content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 251 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 252 content::NotificationService::AllSources()); | 252 content::NotificationService::AllSources()); |
| 253 registrar_.Add( | 253 registrar_.Add( |
| 254 this, | 254 this, |
| 255 chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, | 255 chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, |
| 256 content::NotificationService::AllSources()); | 256 content::NotificationService::AllSources()); |
| 257 } | 257 } |
| 258 | 258 |
| 259 ProfileManager::~ProfileManager() { | 259 ProfileManager::~ProfileManager() { |
| 260 #if defined(OS_WIN) | 260 #if defined(OS_WIN) |
| 261 if (profile_shortcut_manager_.get()) | 261 if (profile_shortcut_manager_.get()) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 FilePath default_profile_dir = | 533 FilePath default_profile_dir = |
| 534 user_data_dir_.Append(GetInitialProfileDir()); | 534 user_data_dir_.Append(GetInitialProfileDir()); |
| 535 CHECK(!GetProfileByPath(default_profile_dir)) | 535 CHECK(!GetProfileByPath(default_profile_dir)) |
| 536 << "The default profile was loaded before we mounted the cryptohome."; | 536 << "The default profile was loaded before we mounted the cryptohome."; |
| 537 } | 537 } |
| 538 return; | 538 return; |
| 539 } | 539 } |
| 540 #endif | 540 #endif |
| 541 bool save_active_profiles = false; | 541 bool save_active_profiles = false; |
| 542 switch (type) { | 542 switch (type) { |
| 543 case content::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: { | 543 case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: { |
| 544 // Ignore any browsers closing from now on. | 544 // Ignore any browsers closing from now on. |
| 545 closing_all_browsers_ = true; | 545 closing_all_browsers_ = true; |
| 546 break; | 546 break; |
| 547 } | 547 } |
| 548 case chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED: { | 548 case chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED: { |
| 549 // This will cancel the shutdown process, so the active profiles are | 549 // This will cancel the shutdown process, so the active profiles are |
| 550 // tracked again. Also, as the active profiles may have changed (i.e. if | 550 // tracked again. Also, as the active profiles may have changed (i.e. if |
| 551 // some windows were closed) we save the current list of active profiles | 551 // some windows were closed) we save the current list of active profiles |
| 552 // again. | 552 // again. |
| 553 closing_all_browsers_ = false; | 553 closing_all_browsers_ = false; |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 1012 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
| 1013 Profile* profile, | 1013 Profile* profile, |
| 1014 Profile::CreateStatus status) { | 1014 Profile::CreateStatus status) { |
| 1015 for (size_t i = 0; i < callbacks.size(); ++i) | 1015 for (size_t i = 0; i < callbacks.size(); ++i) |
| 1016 callbacks[i].Run(profile, status); | 1016 callbacks[i].Run(profile, status); |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 ProfileManager::ProfileInfo::~ProfileInfo() { | 1019 ProfileManager::ProfileInfo::~ProfileInfo() { |
| 1020 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1020 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| 1021 } | 1021 } |
| OLD | NEW |