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/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 Loading... |
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/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 Loading... |
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 Loading... |
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::InitAll(profile); |
338 chrome::InitAppList(profile); | |
339 if (command_line_.HasSwitch(switches::kShowAppList)) { | 335 if (command_line_.HasSwitch(switches::kShowAppList)) { |
340 chrome::ShowAppList(profile); | 336 AppListService::Get()->ShowAppList(profile); |
341 return true; | 337 return true; |
342 } | 338 } |
343 #endif | |
344 | 339 |
345 // Open the required browser windows and tabs. First, see if | 340 // Open the required browser windows and tabs. First, see if |
346 // we're being run as an application window. If so, the user | 341 // we're being run as an application window. If so, the user |
347 // opened an app shortcut. Don't restore tabs or open initial | 342 // 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, | 343 // URLs in that case. The user should see the window as an app, |
349 // not as chrome. | 344 // not as chrome. |
350 // Special case is when app switches are passed but we do want to restore | 345 // 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. | 346 // session. In that case open app window + focus it after session is restored. |
352 content::WebContents* app_contents = NULL; | 347 content::WebContents* app_contents = NULL; |
353 if (OpenApplicationWindow(profile, &app_contents)) { | 348 if (OpenApplicationWindow(profile, &app_contents)) { |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 } | 938 } |
944 | 939 |
945 #if !defined(OS_WIN) || defined(USE_AURA) | 940 #if !defined(OS_WIN) || defined(USE_AURA) |
946 // static | 941 // static |
947 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 942 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
948 Profile* profile, | 943 Profile* profile, |
949 const std::vector<GURL>& startup_urls) { | 944 const std::vector<GURL>& startup_urls) { |
950 return false; | 945 return false; |
951 } | 946 } |
952 #endif | 947 #endif |
OLD | NEW |