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 15 matching lines...) Expand all Loading... |
26 #include "base/threading/thread_restrictions.h" | 26 #include "base/threading/thread_restrictions.h" |
27 #include "chrome/browser/auto_launch_trial.h" | 27 #include "chrome/browser/auto_launch_trial.h" |
28 #include "chrome/browser/browser_process.h" | 28 #include "chrome/browser/browser_process.h" |
29 #include "chrome/browser/chrome_notification_types.h" | 29 #include "chrome/browser/chrome_notification_types.h" |
30 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 30 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
31 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 31 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
32 #include "chrome/browser/defaults.h" | 32 #include "chrome/browser/defaults.h" |
33 #include "chrome/browser/extensions/extension_creator.h" | 33 #include "chrome/browser/extensions/extension_creator.h" |
34 #include "chrome/browser/extensions/extension_service.h" | 34 #include "chrome/browser/extensions/extension_service.h" |
35 #include "chrome/browser/extensions/extension_system.h" | 35 #include "chrome/browser/extensions/extension_system.h" |
| 36 #include "chrome/browser/extensions/launch_util.h" |
36 #include "chrome/browser/extensions/pack_extension_job.h" | 37 #include "chrome/browser/extensions/pack_extension_job.h" |
37 #include "chrome/browser/first_run/first_run.h" | 38 #include "chrome/browser/first_run/first_run.h" |
38 #include "chrome/browser/google/google_util.h" | 39 #include "chrome/browser/google/google_util.h" |
39 #include "chrome/browser/infobars/infobar_service.h" | 40 #include "chrome/browser/infobars/infobar_service.h" |
40 #include "chrome/browser/net/predictor.h" | 41 #include "chrome/browser/net/predictor.h" |
41 #include "chrome/browser/notifications/desktop_notification_service.h" | 42 #include "chrome/browser/notifications/desktop_notification_service.h" |
42 #include "chrome/browser/performance_monitor/startup_timer.h" | 43 #include "chrome/browser/performance_monitor/startup_timer.h" |
43 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 44 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
44 #include "chrome/browser/prefs/session_startup_pref.h" | 45 #include "chrome/browser/prefs/session_startup_pref.h" |
45 #include "chrome/browser/profiles/profile.h" | 46 #include "chrome/browser/profiles/profile.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // The extension with id |app_id| may have been uninstalled. | 197 // The extension with id |app_id| may have been uninstalled. |
197 if (!extension) | 198 if (!extension) |
198 return false; | 199 return false; |
199 LOG(ERROR) << app_id; | 200 LOG(ERROR) << app_id; |
200 // Don't launch platform apps in incognito mode. | 201 // Don't launch platform apps in incognito mode. |
201 if (profile->IsOffTheRecord() && extension->is_platform_app()) | 202 if (profile->IsOffTheRecord() && extension->is_platform_app()) |
202 return false; | 203 return false; |
203 LOG(ERROR) << app_id; | 204 LOG(ERROR) << app_id; |
204 // Look at preferences to find the right launch container. If no | 205 // Look at preferences to find the right launch container. If no |
205 // preference is set, launch as a window. | 206 // preference is set, launch as a window. |
206 extensions::LaunchContainer launch_container = | 207 extensions::LaunchContainer launch_container = extensions::GetLaunchContainer( |
207 extensions_service->extension_prefs()->GetLaunchContainer(extension); | 208 extensions_service->extension_prefs(), extension); |
208 | 209 |
209 if (!extensions_service->extension_prefs()->HasPreferredLaunchContainer( | 210 if (!extensions::HasPreferredLaunchContainer( |
210 extension)) | 211 extensions_service->extension_prefs(), extension)) |
211 launch_container = extensions::LAUNCH_WINDOW; | 212 launch_container = extensions::LAUNCH_WINDOW; |
212 | 213 |
213 *out_extension = extension; | 214 *out_extension = extension; |
214 *out_launch_container = launch_container; | 215 *out_launch_container = launch_container; |
215 return true; | 216 return true; |
216 } | 217 } |
217 | 218 |
218 // Parse two comma-separated integers from string. Return true on success. | 219 // Parse two comma-separated integers from string. Return true on success. |
219 bool ParseCommaSeparatedIntegers(const std::string& str, | 220 bool ParseCommaSeparatedIntegers(const std::string& str, |
220 int* ret_num1, | 221 int* ret_num1, |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 } | 991 } |
991 | 992 |
992 #if !defined(OS_WIN) | 993 #if !defined(OS_WIN) |
993 // static | 994 // static |
994 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 995 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
995 Profile* profile, | 996 Profile* profile, |
996 const std::vector<GURL>& startup_urls) { | 997 const std::vector<GURL>& startup_urls) { |
997 return false; | 998 return false; |
998 } | 999 } |
999 #endif | 1000 #endif |
OLD | NEW |