| 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 "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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 #include "chrome/browser/profiles/profile_manager.h" | 87 #include "chrome/browser/profiles/profile_manager.h" |
| 88 #include "chrome/browser/search_engines/search_engine_type.h" | 88 #include "chrome/browser/search_engines/search_engine_type.h" |
| 89 #include "chrome/browser/search_engines/template_url.h" | 89 #include "chrome/browser/search_engines/template_url.h" |
| 90 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 90 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 91 #include "chrome/browser/search_engines/template_url_service.h" | 91 #include "chrome/browser/search_engines/template_url_service.h" |
| 92 #include "chrome/browser/search_engines/template_url_service_factory.h" | 92 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 93 #include "chrome/browser/service/service_process_control.h" | 93 #include "chrome/browser/service/service_process_control.h" |
| 94 #include "chrome/browser/shell_integration.h" | 94 #include "chrome/browser/shell_integration.h" |
| 95 #include "chrome/browser/three_d_api_observer.h" | 95 #include "chrome/browser/three_d_api_observer.h" |
| 96 #include "chrome/browser/translate/translate_manager.h" | 96 #include "chrome/browser/translate/translate_manager.h" |
| 97 #include "chrome/browser/ui/app_list/app_list_util.h" | 97 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 98 #include "chrome/browser/ui/browser.h" | 98 #include "chrome/browser/ui/browser.h" |
| 99 #include "chrome/browser/ui/browser_finder.h" | 99 #include "chrome/browser/ui/browser_finder.h" |
| 100 #include "chrome/browser/ui/host_desktop.h" | 100 #include "chrome/browser/ui/host_desktop.h" |
| 101 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 101 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
| 102 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 102 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 103 #include "chrome/browser/ui/uma_browsing_activity_observer.h" | 103 #include "chrome/browser/ui/uma_browsing_activity_observer.h" |
| 104 #include "chrome/browser/ui/user_data_dir_dialog.h" | 104 #include "chrome/browser/ui/user_data_dir_dialog.h" |
| 105 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 105 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 106 #include "chrome/common/child_process_logging.h" | 106 #include "chrome/common/child_process_logging.h" |
| 107 #include "chrome/common/chrome_constants.h" | 107 #include "chrome/common/chrome_constants.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 334 |
| 335 // Returns the path that contains the profile that should be loaded | 335 // Returns the path that contains the profile that should be loaded |
| 336 // on process startup. | 336 // on process startup. |
| 337 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 337 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, |
| 338 const CommandLine& command_line) { | 338 const CommandLine& command_line) { |
| 339 if (command_line.HasSwitch(switches::kProfileDirectory)) { | 339 if (command_line.HasSwitch(switches::kProfileDirectory)) { |
| 340 return user_data_dir.Append( | 340 return user_data_dir.Append( |
| 341 command_line.GetSwitchValuePath(switches::kProfileDirectory)); | 341 command_line.GetSwitchValuePath(switches::kProfileDirectory)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 #if defined(ENABLE_APP_LIST) | |
| 345 // If we are showing the app list then chrome isn't shown so load the app | 344 // If we are showing the app list then chrome isn't shown so load the app |
| 346 // list's profile rather than chrome's. | 345 // list's profile rather than chrome's. |
| 347 if (command_line.HasSwitch(switches::kShowAppList)) | 346 if (command_line.HasSwitch(switches::kShowAppList)) |
| 348 return chrome::GetAppListProfilePath(user_data_dir); | 347 return AppListService::Get()->GetAppListProfilePath(user_data_dir); |
| 349 #endif | |
| 350 | 348 |
| 351 return g_browser_process->profile_manager()->GetLastUsedProfileDir( | 349 return g_browser_process->profile_manager()->GetLastUsedProfileDir( |
| 352 user_data_dir); | 350 user_data_dir); |
| 353 } | 351 } |
| 354 | 352 |
| 355 // Initializes the profile, possibly doing some user prompting to pick a | 353 // Initializes the profile, possibly doing some user prompting to pick a |
| 356 // fallback profile. Returns the newly created profile, or NULL if startup | 354 // fallback profile. Returns the newly created profile, or NULL if startup |
| 357 // should not continue. | 355 // should not continue. |
| 358 Profile* CreateProfile(const content::MainFunctionParams& parameters, | 356 Profile* CreateProfile(const content::MainFunctionParams& parameters, |
| 359 const base::FilePath& user_data_dir, | 357 const base::FilePath& user_data_dir, |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1798 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1801 uma_name += "_XP"; | 1799 uma_name += "_XP"; |
| 1802 | 1800 |
| 1803 uma_name += "_PreRead_"; | 1801 uma_name += "_PreRead_"; |
| 1804 uma_name += pre_read_percentage; | 1802 uma_name += pre_read_percentage; |
| 1805 AddPreReadHistogramTime(uma_name.c_str(), time); | 1803 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1806 } | 1804 } |
| 1807 #endif | 1805 #endif |
| 1808 #endif | 1806 #endif |
| 1809 } | 1807 } |
| OLD | NEW |