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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.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: fixes cocoa, back to windows 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/ui/startup/startup_browser_creator_impl.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "apps/app_restore_service.h" 10 #include "apps/app_restore_service.h"
(...skipping 29 matching lines...) Expand all
40 #include "chrome/browser/performance_monitor/startup_timer.h" 40 #include "chrome/browser/performance_monitor/startup_timer.h"
41 #include "chrome/browser/prefs/incognito_mode_prefs.h" 41 #include "chrome/browser/prefs/incognito_mode_prefs.h"
42 #include "chrome/browser/prefs/session_startup_pref.h" 42 #include "chrome/browser/prefs/session_startup_pref.h"
43 #include "chrome/browser/profiles/profile.h" 43 #include "chrome/browser/profiles/profile.h"
44 #include "chrome/browser/profiles/profile_io_data.h" 44 #include "chrome/browser/profiles/profile_io_data.h"
45 #include "chrome/browser/rlz/rlz.h" 45 #include "chrome/browser/rlz/rlz.h"
46 #include "chrome/browser/sessions/session_restore.h" 46 #include "chrome/browser/sessions/session_restore.h"
47 #include "chrome/browser/sessions/session_service.h" 47 #include "chrome/browser/sessions/session_service.h"
48 #include "chrome/browser/sessions/session_service_factory.h" 48 #include "chrome/browser/sessions/session_service_factory.h"
49 #include "chrome/browser/shell_integration.h" 49 #include "chrome/browser/shell_integration.h"
50 #include "chrome/browser/ui/app_list_service.h"
50 #include "chrome/browser/ui/browser_commands.h" 51 #include "chrome/browser/ui/browser_commands.h"
51 #include "chrome/browser/ui/browser_finder.h" 52 #include "chrome/browser/ui/browser_finder.h"
52 #include "chrome/browser/ui/browser_list.h" 53 #include "chrome/browser/ui/browser_list.h"
53 #include "chrome/browser/ui/browser_navigator.h" 54 #include "chrome/browser/ui/browser_navigator.h"
54 #include "chrome/browser/ui/browser_tabrestore.h" 55 #include "chrome/browser/ui/browser_tabrestore.h"
55 #include "chrome/browser/ui/browser_tabstrip.h" 56 #include "chrome/browser/ui/browser_tabstrip.h"
56 #include "chrome/browser/ui/browser_window.h" 57 #include "chrome/browser/ui/browser_window.h"
57 #include "chrome/browser/ui/extensions/application_launch.h" 58 #include "chrome/browser/ui/extensions/application_launch.h"
58 #include "chrome/browser/ui/host_desktop.h" 59 #include "chrome/browser/ui/host_desktop.h"
59 #include "chrome/browser/ui/startup/autolaunch_prompt.h" 60 #include "chrome/browser/ui/startup/autolaunch_prompt.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #endif 97 #endif
97 98
98 #if defined(TOOLKIT_GTK) 99 #if defined(TOOLKIT_GTK)
99 #include "chrome/browser/ui/gtk/gtk_util.h" 100 #include "chrome/browser/ui/gtk/gtk_util.h"
100 #endif 101 #endif
101 102
102 #if defined(OS_WIN) 103 #if defined(OS_WIN)
103 #include "base/win/windows_version.h" 104 #include "base/win/windows_version.h"
104 #endif 105 #endif
105 106
106 #if defined(ENABLE_APP_LIST)
107 #include "chrome/browser/ui/app_list/app_list_util.h"
108 #endif
109
110 using content::ChildProcessSecurityPolicy; 107 using content::ChildProcessSecurityPolicy;
111 using content::WebContents; 108 using content::WebContents;
112 using extensions::Extension; 109 using extensions::Extension;
113 110
114 namespace { 111 namespace {
115 112
116 // Utility functions ---------------------------------------------------------- 113 // Utility functions ----------------------------------------------------------
117 114
118 enum LaunchMode { 115 enum LaunchMode {
119 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. 116 LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if (command_line_.HasSwitch(switches::kDnsLogDetails)) 324 if (command_line_.HasSwitch(switches::kDnsLogDetails))
328 chrome_browser_net::EnablePredictorDetailedLog(true); 325 chrome_browser_net::EnablePredictorDetailedLog(true);
329 if (command_line_.HasSwitch(switches::kDnsPrefetchDisable) && 326 if (command_line_.HasSwitch(switches::kDnsPrefetchDisable) &&
330 profile->GetNetworkPredictor()) { 327 profile->GetNetworkPredictor()) {
331 profile->GetNetworkPredictor()->EnablePredictor(false); 328 profile->GetNetworkPredictor()->EnablePredictor(false);
332 } 329 }
333 330
334 if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit)) 331 if (command_line_.HasSwitch(switches::kDumpHistogramsOnExit))
335 base::StatisticsRecorder::set_dump_on_exit(true); 332 base::StatisticsRecorder::set_dump_on_exit(true);
336 333
337 #if defined(ENABLE_APP_LIST) 334 AppListService* app_list_service = AppListService::Get();
338 chrome::InitAppList(profile); 335 app_list_service->Init(profile);
339 if (command_line_.HasSwitch(switches::kShowAppList)) { 336 if (command_line_.HasSwitch(switches::kShowAppList)) {
340 chrome::ShowAppList(profile); 337 app_list_service->ShowAppList(profile);
341 return true; 338 return true;
342 } 339 }
343 #endif
344 340
345 // Open the required browser windows and tabs. First, see if 341 // Open the required browser windows and tabs. First, see if
346 // we're being run as an application window. If so, the user 342 // we're being run as an application window. If so, the user
347 // opened an app shortcut. Don't restore tabs or open initial 343 // opened an app shortcut. Don't restore tabs or open initial
348 // URLs in that case. The user should see the window as an app, 344 // URLs in that case. The user should see the window as an app,
349 // not as chrome. 345 // not as chrome.
350 // Special case is when app switches are passed but we do want to restore 346 // Special case is when app switches are passed but we do want to restore
351 // session. In that case open app window + focus it after session is restored. 347 // session. In that case open app window + focus it after session is restored.
352 content::WebContents* app_contents = NULL; 348 content::WebContents* app_contents = NULL;
353 if (OpenApplicationWindow(profile, &app_contents)) { 349 if (OpenApplicationWindow(profile, &app_contents)) {
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 } 937 }
942 938
943 #if !defined(OS_WIN) || defined(USE_AURA) 939 #if !defined(OS_WIN) || defined(USE_AURA)
944 // static 940 // static
945 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( 941 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser(
946 Profile* profile, 942 Profile* profile,
947 const std::vector<GURL>& startup_urls) { 943 const std::vector<GURL>& startup_urls) {
948 return false; 944 return false;
949 } 945 }
950 #endif 946 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698