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

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

Issue 12207104: Refactor app_list_util.h into AppListService abstract base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stray newline Created 7 years, 10 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #include "chrome/browser/profiles/profile.h" 86 #include "chrome/browser/profiles/profile.h"
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/translate/translate_manager.h" 95 #include "chrome/browser/translate/translate_manager.h"
96 #include "chrome/browser/ui/app_list/app_list_util.h" 96 #include "chrome/browser/ui/app_list/app_list_service.h"
97 #include "chrome/browser/ui/browser.h" 97 #include "chrome/browser/ui/browser.h"
98 #include "chrome/browser/ui/browser_finder.h" 98 #include "chrome/browser/ui/browser_finder.h"
99 #include "chrome/browser/ui/startup/default_browser_prompt.h" 99 #include "chrome/browser/ui/startup/default_browser_prompt.h"
100 #include "chrome/browser/ui/startup/startup_browser_creator.h" 100 #include "chrome/browser/ui/startup/startup_browser_creator.h"
101 #include "chrome/browser/ui/uma_browsing_activity_observer.h" 101 #include "chrome/browser/ui/uma_browsing_activity_observer.h"
102 #include "chrome/browser/ui/user_data_dir_dialog.h" 102 #include "chrome/browser/ui/user_data_dir_dialog.h"
103 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 103 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
104 #include "chrome/common/child_process_logging.h" 104 #include "chrome/common/child_process_logging.h"
105 #include "chrome/common/chrome_constants.h" 105 #include "chrome/common/chrome_constants.h"
106 #include "chrome/common/chrome_paths.h" 106 #include "chrome/common/chrome_paths.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 // Returns the path that contains the profile that should be loaded 333 // Returns the path that contains the profile that should be loaded
334 // on process startup. 334 // on process startup.
335 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, 335 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
336 const CommandLine& command_line) { 336 const CommandLine& command_line) {
337 if (command_line.HasSwitch(switches::kProfileDirectory)) { 337 if (command_line.HasSwitch(switches::kProfileDirectory)) {
338 return user_data_dir.Append( 338 return user_data_dir.Append(
339 command_line.GetSwitchValuePath(switches::kProfileDirectory)); 339 command_line.GetSwitchValuePath(switches::kProfileDirectory));
340 } 340 }
341 341
342 #if defined(ENABLE_APP_LIST)
343 // If we are showing the app list then chrome isn't shown so load the app 342 // If we are showing the app list then chrome isn't shown so load the app
344 // list's profile rather than chrome's. 343 // list's profile rather than chrome's.
345 if (command_line.HasSwitch(switches::kShowAppList)) 344 if (command_line.HasSwitch(switches::kShowAppList))
346 return chrome::GetAppListProfilePath(user_data_dir); 345 return AppListService::GetAppListProfilePath(user_data_dir);
347 #endif
348 346
349 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 347 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
350 user_data_dir); 348 user_data_dir);
351 } 349 }
352 350
353 // Initializes the profile, possibly doing some user prompting to pick a 351 // Initializes the profile, possibly doing some user prompting to pick a
354 // fallback profile. Returns the newly created profile, or NULL if startup 352 // fallback profile. Returns the newly created profile, or NULL if startup
355 // should not continue. 353 // should not continue.
356 Profile* CreateProfile(const content::MainFunctionParams& parameters, 354 Profile* CreateProfile(const content::MainFunctionParams& parameters,
357 const base::FilePath& user_data_dir, 355 const base::FilePath& user_data_dir,
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 if (base::win::GetVersion() <= base::win::VERSION_XP) 1795 if (base::win::GetVersion() <= base::win::VERSION_XP)
1798 uma_name += "_XP"; 1796 uma_name += "_XP";
1799 1797
1800 uma_name += "_PreRead_"; 1798 uma_name += "_PreRead_";
1801 uma_name += pre_read_percentage; 1799 uma_name += pre_read_percentage;
1802 AddPreReadHistogramTime(uma_name.c_str(), time); 1800 AddPreReadHistogramTime(uma_name.c_str(), time);
1803 } 1801 }
1804 #endif 1802 #endif
1805 #endif 1803 #endif
1806 } 1804 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698