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

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

Issue 18615010: Refactor utility methods out of the ProfileManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix CrOS compile error Created 7 years, 5 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
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "chrome/browser/plugins/plugin_prefs.h" 79 #include "chrome/browser/plugins/plugin_prefs.h"
80 #include "chrome/browser/pref_service_flags_storage.h" 80 #include "chrome/browser/pref_service_flags_storage.h"
81 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 81 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
82 #include "chrome/browser/prefs/command_line_pref_store.h" 82 #include "chrome/browser/prefs/command_line_pref_store.h"
83 #include "chrome/browser/prefs/scoped_user_pref_update.h" 83 #include "chrome/browser/prefs/scoped_user_pref_update.h"
84 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 84 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
85 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 85 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
86 #include "chrome/browser/process_singleton.h" 86 #include "chrome/browser/process_singleton.h"
87 #include "chrome/browser/profiles/profile.h" 87 #include "chrome/browser/profiles/profile.h"
88 #include "chrome/browser/profiles/profile_manager.h" 88 #include "chrome/browser/profiles/profile_manager.h"
89 #include "chrome/browser/profiles/profile_manager_util.h"
89 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" 90 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h"
90 #include "chrome/browser/search_engines/search_engine_type.h" 91 #include "chrome/browser/search_engines/search_engine_type.h"
91 #include "chrome/browser/search_engines/template_url.h" 92 #include "chrome/browser/search_engines/template_url.h"
92 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" 93 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
93 #include "chrome/browser/search_engines/template_url_service.h" 94 #include "chrome/browser/search_engines/template_url_service.h"
94 #include "chrome/browser/search_engines/template_url_service_factory.h" 95 #include "chrome/browser/search_engines/template_url_service_factory.h"
95 #include "chrome/browser/service/service_process_control.h" 96 #include "chrome/browser/service/service_process_control.h"
96 #include "chrome/browser/shell_integration.h" 97 #include "chrome/browser/shell_integration.h"
97 #include "chrome/browser/three_d_api_observer.h" 98 #include "chrome/browser/three_d_api_observer.h"
98 #include "chrome/browser/translate/translate_manager.h" 99 #include "chrome/browser/translate/translate_manager.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 user_data_dir); 330 user_data_dir);
330 } 331 }
331 332
332 // Initializes the profile, possibly doing some user prompting to pick a 333 // Initializes the profile, possibly doing some user prompting to pick a
333 // fallback profile. Returns the newly created profile, or NULL if startup 334 // fallback profile. Returns the newly created profile, or NULL if startup
334 // should not continue. 335 // should not continue.
335 Profile* CreateProfile(const content::MainFunctionParams& parameters, 336 Profile* CreateProfile(const content::MainFunctionParams& parameters,
336 const base::FilePath& user_data_dir, 337 const base::FilePath& user_data_dir,
337 const CommandLine& parsed_command_line) { 338 const CommandLine& parsed_command_line) {
338 TRACE_EVENT0("startup", "ChromeBrowserMainParts::CreateProfile") 339 TRACE_EVENT0("startup", "ChromeBrowserMainParts::CreateProfile")
339 if (ProfileManager::IsMultipleProfilesEnabled() && 340 if (profiles::IsMultipleProfilesEnabled() &&
340 parsed_command_line.HasSwitch(switches::kProfileDirectory)) { 341 parsed_command_line.HasSwitch(switches::kProfileDirectory)) {
341 g_browser_process->local_state()->SetString(prefs::kProfileLastUsed, 342 g_browser_process->local_state()->SetString(prefs::kProfileLastUsed,
342 parsed_command_line.GetSwitchValueASCII(switches::kProfileDirectory)); 343 parsed_command_line.GetSwitchValueASCII(switches::kProfileDirectory));
343 // Clear kProfilesLastActive since the user only wants to launch a specific 344 // Clear kProfilesLastActive since the user only wants to launch a specific
344 // profile. 345 // profile.
345 ListPrefUpdate update(g_browser_process->local_state(), 346 ListPrefUpdate update(g_browser_process->local_state(),
346 prefs::kProfilesLastActive); 347 prefs::kProfilesLastActive);
347 ListValue* profile_list = update.Get(); 348 ListValue* profile_list = update.Get();
348 profile_list->Clear(); 349 profile_list->Clear();
349 } 350 }
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 if (base::win::GetVersion() <= base::win::VERSION_XP) 1785 if (base::win::GetVersion() <= base::win::VERSION_XP)
1785 uma_name += "_XP"; 1786 uma_name += "_XP";
1786 1787
1787 uma_name += "_PreRead_"; 1788 uma_name += "_PreRead_";
1788 uma_name += pre_read_percentage; 1789 uma_name += pre_read_percentage;
1789 AddPreReadHistogramTime(uma_name.c_str(), time); 1790 AddPreReadHistogramTime(uma_name.c_str(), time);
1790 } 1791 }
1791 #endif 1792 #endif
1792 #endif 1793 #endif
1793 } 1794 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698