| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Called upon completion of profile creation. This function takes care of | 151 // Called upon completion of profile creation. This function takes care of |
| 152 // launching a new browser window and signing the user in to their Google | 152 // launching a new browser window and signing the user in to their Google |
| 153 // account. | 153 // account. |
| 154 void OnOpenWindowForNewProfile(Profile* profile, | 154 void OnOpenWindowForNewProfile(Profile* profile, |
| 155 Profile::CreateStatus status) { | 155 Profile::CreateStatus status) { |
| 156 if (status == Profile::CREATE_STATUS_INITIALIZED) { | 156 if (status == Profile::CREATE_STATUS_INITIALIZED) { |
| 157 ProfileManager::FindOrCreateNewWindowForProfile( | 157 ProfileManager::FindOrCreateNewWindowForProfile( |
| 158 profile, | 158 profile, |
| 159 browser::startup::IS_PROCESS_STARTUP, | 159 chrome::startup::IS_PROCESS_STARTUP, |
| 160 browser::startup::IS_FIRST_RUN, | 160 chrome::startup::IS_FIRST_RUN, |
| 161 false); | 161 false); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace | 165 } // namespace |
| 166 | 166 |
| 167 #if defined(ENABLE_SESSION_SERVICE) | 167 #if defined(ENABLE_SESSION_SERVICE) |
| 168 // static | 168 // static |
| 169 void ProfileManager::ShutdownSessionServices() { | 169 void ProfileManager::ShutdownSessionServices() { |
| 170 ProfileManager* pm = g_browser_process->profile_manager(); | 170 ProfileManager* pm = g_browser_process->profile_manager(); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 468 } |
| 469 | 469 |
| 470 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { | 470 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { |
| 471 ProfilesInfoMap::const_iterator iter = profiles_info_.find(path); | 471 ProfilesInfoMap::const_iterator iter = profiles_info_.find(path); |
| 472 return (iter == profiles_info_.end()) ? NULL : iter->second->profile.get(); | 472 return (iter == profiles_info_.end()) ? NULL : iter->second->profile.get(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 // static | 475 // static |
| 476 void ProfileManager::FindOrCreateNewWindowForProfile( | 476 void ProfileManager::FindOrCreateNewWindowForProfile( |
| 477 Profile* profile, | 477 Profile* profile, |
| 478 browser::startup::IsProcessStartup process_startup, | 478 chrome::startup::IsProcessStartup process_startup, |
| 479 browser::startup::IsFirstRun is_first_run, | 479 chrome::startup::IsFirstRun is_first_run, |
| 480 bool always_create) { | 480 bool always_create) { |
| 481 DCHECK(profile); | 481 DCHECK(profile); |
| 482 | 482 |
| 483 if (!always_create) { | 483 if (!always_create) { |
| 484 Browser* browser = browser::FindTabbedBrowser(profile, false); | 484 Browser* browser = browser::FindTabbedBrowser(profile, false); |
| 485 if (browser) { | 485 if (browser) { |
| 486 browser->window()->Activate(); | 486 browser->window()->Activate(); |
| 487 return; | 487 return; |
| 488 } | 488 } |
| 489 } | 489 } |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 986 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
| 987 Profile* profile, | 987 Profile* profile, |
| 988 Profile::CreateStatus status) { | 988 Profile::CreateStatus status) { |
| 989 for (size_t i = 0; i < callbacks.size(); ++i) | 989 for (size_t i = 0; i < callbacks.size(); ++i) |
| 990 callbacks[i].Run(profile, status); | 990 callbacks[i].Run(profile, status); |
| 991 } | 991 } |
| 992 | 992 |
| 993 ProfileManager::ProfileInfo::~ProfileInfo() { | 993 ProfileManager::ProfileInfo::~ProfileInfo() { |
| 994 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 994 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| 995 } | 995 } |
| OLD | NEW |