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

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

Issue 10384106: Extract StartupTabs and startup types from StartupBrowserCreator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
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 <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 11 matching lines...) Expand all
22 #include "chrome/browser/managed_mode.h" 22 #include "chrome/browser/managed_mode.h"
23 #include "chrome/browser/prefs/pref_service.h" 23 #include "chrome/browser/prefs/pref_service.h"
24 #include "chrome/browser/prefs/scoped_user_pref_update.h" 24 #include "chrome/browser/prefs/scoped_user_pref_update.h"
25 #include "chrome/browser/profiles/profile_info_cache.h" 25 #include "chrome/browser/profiles/profile_info_cache.h"
26 #include "chrome/browser/profiles/profile_metrics.h" 26 #include "chrome/browser/profiles/profile_metrics.h"
27 #include "chrome/browser/sessions/session_service_factory.h" 27 #include "chrome/browser/sessions/session_service_factory.h"
28 #include "chrome/browser/sync/profile_sync_service.h" 28 #include "chrome/browser/sync/profile_sync_service.h"
29 #include "chrome/browser/sync/profile_sync_service_factory.h" 29 #include "chrome/browser/sync/profile_sync_service_factory.h"
30 #include "chrome/browser/ui/browser.h" 30 #include "chrome/browser/ui/browser.h"
31 #include "chrome/browser/ui/browser_window.h" 31 #include "chrome/browser/ui/browser_window.h"
32 #include "chrome/browser/ui/startup/startup_browser_creator.h"
32 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" 33 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
33 #include "chrome/common/chrome_constants.h" 34 #include "chrome/common/chrome_constants.h"
34 #include "chrome/common/chrome_notification_types.h" 35 #include "chrome/common/chrome_notification_types.h"
35 #include "chrome/common/chrome_paths_internal.h" 36 #include "chrome/common/chrome_paths_internal.h"
36 #include "chrome/common/chrome_switches.h" 37 #include "chrome/common/chrome_switches.h"
37 #include "chrome/common/logging_chrome.h" 38 #include "chrome/common/logging_chrome.h"
38 #include "chrome/common/pref_names.h" 39 #include "chrome/common/pref_names.h"
39 #include "chrome/common/url_constants.h" 40 #include "chrome/common/url_constants.h"
40 #if defined(OS_WIN) 41 #if defined(OS_WIN)
41 #include "chrome/installer/util/browser_distribution.h" 42 #include "chrome/installer/util/browser_distribution.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 144 }
144 145
145 // Called upon completion of profile creation. This function takes care of 146 // Called upon completion of profile creation. This function takes care of
146 // launching a new browser window and signing the user in to their Google 147 // launching a new browser window and signing the user in to their Google
147 // account. 148 // account.
148 void OnOpenWindowForNewProfile(Profile* profile, 149 void OnOpenWindowForNewProfile(Profile* profile,
149 Profile::CreateStatus status) { 150 Profile::CreateStatus status) {
150 if (status == Profile::CREATE_STATUS_INITIALIZED) { 151 if (status == Profile::CREATE_STATUS_INITIALIZED) {
151 ProfileManager::FindOrCreateNewWindowForProfile( 152 ProfileManager::FindOrCreateNewWindowForProfile(
152 profile, 153 profile,
153 StartupBrowserCreator::IS_PROCESS_STARTUP, 154 browser::startup::IS_PROCESS_STARTUP,
154 StartupBrowserCreator::IS_FIRST_RUN, 155 browser::startup::IS_FIRST_RUN,
155 false); 156 false);
156 } 157 }
157 } 158 }
158 159
159 } // namespace 160 } // namespace
160 161
161 #if defined(ENABLE_SESSION_SERVICE) 162 #if defined(ENABLE_SESSION_SERVICE)
162 // static 163 // static
163 void ProfileManager::ShutdownSessionServices() { 164 void ProfileManager::ShutdownSessionServices() {
164 ProfileManager* pm = g_browser_process->profile_manager(); 165 ProfileManager* pm = g_browser_process->profile_manager();
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 } 463 }
463 464
464 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { 465 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const {
465 ProfilesInfoMap::const_iterator iter = profiles_info_.find(path); 466 ProfilesInfoMap::const_iterator iter = profiles_info_.find(path);
466 return (iter == profiles_info_.end()) ? NULL : iter->second->profile.get(); 467 return (iter == profiles_info_.end()) ? NULL : iter->second->profile.get();
467 } 468 }
468 469
469 // static 470 // static
470 void ProfileManager::FindOrCreateNewWindowForProfile( 471 void ProfileManager::FindOrCreateNewWindowForProfile(
471 Profile* profile, 472 Profile* profile,
472 StartupBrowserCreator::IsProcessStartup process_startup, 473 browser::startup::IsProcessStartup process_startup,
473 StartupBrowserCreator::IsFirstRun is_first_run, 474 browser::startup::IsFirstRun is_first_run,
474 bool always_create) { 475 bool always_create) {
475 DCHECK(profile); 476 DCHECK(profile);
476 477
477 if (!always_create) { 478 if (!always_create) {
478 Browser* browser = BrowserList::FindTabbedBrowser(profile, false); 479 Browser* browser = BrowserList::FindTabbedBrowser(profile, false);
479 if (browser) { 480 if (browser) {
480 browser->window()->Activate(); 481 browser->window()->Activate();
481 return; 482 return;
482 } 483 }
483 } 484 }
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 AddProfileToCache(profile); 967 AddProfileToCache(profile);
967 } 968 }
968 } 969 }
969 970
970 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, 971 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks,
971 Profile* profile, 972 Profile* profile,
972 Profile::CreateStatus status) { 973 Profile::CreateStatus status) {
973 for (size_t i = 0; i < callbacks.size(); ++i) 974 for (size_t i = 0; i < callbacks.size(); ++i)
974 callbacks[i].Run(profile, status); 975 callbacks[i].Run(profile, status);
975 } 976 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/protector/base_setting_change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698