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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 127343004: Avoid loading the last used browser profile in app_controller_mac when it's not needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for comment-string merge conflict from r243939 Created 6 years, 11 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 "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 local_state->GetString(prefs::kApplicationLocale) != owner_locale && 293 local_state->GetString(prefs::kApplicationLocale) != owner_locale &&
294 !local_state->IsManagedPreference(prefs::kApplicationLocale)) { 294 !local_state->IsManagedPreference(prefs::kApplicationLocale)) {
295 local_state->SetString(prefs::kApplicationLocale, owner_locale); 295 local_state->SetString(prefs::kApplicationLocale, owner_locale);
296 } 296 }
297 } 297 }
298 #endif 298 #endif
299 299
300 return local_state; 300 return local_state;
301 } 301 }
302 302
303 // Returns the path that contains the profile that should be loaded
304 // on process startup.
305 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
306 const CommandLine& command_line) {
307 if (command_line.HasSwitch(switches::kProfileDirectory)) {
308 return user_data_dir.Append(
309 command_line.GetSwitchValuePath(switches::kProfileDirectory));
310 }
311
312 // If we are showing the app list then chrome isn't shown so load the app
313 // list's profile rather than chrome's.
314 if (command_line.HasSwitch(switches::kShowAppList)) {
315 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->
316 GetProfilePath(user_data_dir);
317 }
318
319 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
320 user_data_dir);
321 }
322
323 // Initializes the primary profile, possibly doing some user prompting to pick 303 // Initializes the primary profile, possibly doing some user prompting to pick
324 // a fallback profile. Returns the newly created profile, or NULL if startup 304 // a fallback profile. Returns the newly created profile, or NULL if startup
325 // should not continue. 305 // should not continue.
326 Profile* CreatePrimaryProfile(const content::MainFunctionParams& parameters, 306 Profile* CreatePrimaryProfile(const content::MainFunctionParams& parameters,
327 const base::FilePath& user_data_dir, 307 const base::FilePath& user_data_dir,
328 const CommandLine& parsed_command_line) { 308 const CommandLine& parsed_command_line) {
329 TRACE_EVENT0("startup", "ChromeBrowserMainParts::CreateProfile") 309 TRACE_EVENT0("startup", "ChromeBrowserMainParts::CreateProfile")
330 base::Time start = base::Time::Now(); 310 base::Time start = base::Time::Now();
331 if (profiles::IsMultipleProfilesEnabled() && 311 if (profiles::IsMultipleProfilesEnabled() &&
332 parsed_command_line.HasSwitch(switches::kProfileDirectory)) { 312 parsed_command_line.HasSwitch(switches::kProfileDirectory)) {
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 chromeos::CrosSettings::Shutdown(); 1655 chromeos::CrosSettings::Shutdown();
1676 #endif 1656 #endif
1677 #endif 1657 #endif
1678 } 1658 }
1679 1659
1680 // Public members: 1660 // Public members:
1681 1661
1682 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1662 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1683 chrome_extra_parts_.push_back(parts); 1663 chrome_extra_parts_.push_back(parts);
1684 } 1664 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698