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

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: address comments, avoid at_exit work 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/host_desktop.h" 99 #include "chrome/browser/ui/host_desktop.h"
100 #include "chrome/browser/ui/startup/default_browser_prompt.h" 100 #include "chrome/browser/ui/startup/default_browser_prompt.h"
101 #include "chrome/browser/ui/startup/startup_browser_creator.h" 101 #include "chrome/browser/ui/startup/startup_browser_creator.h"
102 #include "chrome/browser/ui/uma_browsing_activity_observer.h" 102 #include "chrome/browser/ui/uma_browsing_activity_observer.h"
103 #include "chrome/browser/ui/user_data_dir_dialog.h" 103 #include "chrome/browser/ui/user_data_dir_dialog.h"
104 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 104 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
105 #include "chrome/common/child_process_logging.h" 105 #include "chrome/common/child_process_logging.h"
106 #include "chrome/common/chrome_constants.h" 106 #include "chrome/common/chrome_constants.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 // Returns the path that contains the profile that should be loaded 334 // Returns the path that contains the profile that should be loaded
335 // on process startup. 335 // on process startup.
336 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, 336 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
337 const CommandLine& command_line) { 337 const CommandLine& command_line) {
338 if (command_line.HasSwitch(switches::kProfileDirectory)) { 338 if (command_line.HasSwitch(switches::kProfileDirectory)) {
339 return user_data_dir.Append( 339 return user_data_dir.Append(
340 command_line.GetSwitchValuePath(switches::kProfileDirectory)); 340 command_line.GetSwitchValuePath(switches::kProfileDirectory));
341 } 341 }
342 342
343 #if defined(ENABLE_APP_LIST)
344 // If we are showing the app list then chrome isn't shown so load the app 343 // If we are showing the app list then chrome isn't shown so load the app
345 // list's profile rather than chrome's. 344 // list's profile rather than chrome's.
346 if (command_line.HasSwitch(switches::kShowAppList)) 345 if (command_line.HasSwitch(switches::kShowAppList))
347 return chrome::GetAppListProfilePath(user_data_dir); 346 return AppListService::Get()->GetAppListProfilePath(user_data_dir);
tapted 2013/02/25 07:18:05 note: now non-static
348 #endif
349 347
350 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 348 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
351 user_data_dir); 349 user_data_dir);
352 } 350 }
353 351
354 // Initializes the profile, possibly doing some user prompting to pick a 352 // Initializes the profile, possibly doing some user prompting to pick a
355 // fallback profile. Returns the newly created profile, or NULL if startup 353 // fallback profile. Returns the newly created profile, or NULL if startup
356 // should not continue. 354 // should not continue.
357 Profile* CreateProfile(const content::MainFunctionParams& parameters, 355 Profile* CreateProfile(const content::MainFunctionParams& parameters,
358 const base::FilePath& user_data_dir, 356 const base::FilePath& user_data_dir,
(...skipping 1438 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