| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 #include "chrome/common/pref_names.h" | 80 #include "chrome/common/pref_names.h" |
| 81 #include "chrome/common/url_constants.h" | 81 #include "chrome/common/url_constants.h" |
| 82 #include "chrome/installer/util/browser_distribution.h" | 82 #include "chrome/installer/util/browser_distribution.h" |
| 83 #include "content/public/browser/child_process_security_policy.h" | 83 #include "content/public/browser/child_process_security_policy.h" |
| 84 #include "content/public/browser/dom_storage_context.h" | 84 #include "content/public/browser/dom_storage_context.h" |
| 85 #include "content/public/browser/notification_observer.h" | 85 #include "content/public/browser/notification_observer.h" |
| 86 #include "content/public/browser/notification_registrar.h" | 86 #include "content/public/browser/notification_registrar.h" |
| 87 #include "content/public/browser/storage_partition.h" | 87 #include "content/public/browser/storage_partition.h" |
| 88 #include "content/public/browser/web_contents.h" | 88 #include "content/public/browser/web_contents.h" |
| 89 #include "content/public/browser/web_contents_view.h" | 89 #include "content/public/browser/web_contents_view.h" |
| 90 #include "extensions/browser/extension_prefs.h" |
| 90 #include "extensions/browser/extension_system.h" | 91 #include "extensions/browser/extension_system.h" |
| 91 #include "extensions/common/constants.h" | 92 #include "extensions/common/constants.h" |
| 92 #include "grit/locale_settings.h" | 93 #include "grit/locale_settings.h" |
| 93 #include "ui/base/l10n/l10n_util.h" | 94 #include "ui/base/l10n/l10n_util.h" |
| 94 #include "ui/base/resource/resource_bundle.h" | 95 #include "ui/base/resource/resource_bundle.h" |
| 95 #include "ui/gfx/rect.h" | 96 #include "ui/gfx/rect.h" |
| 96 #include "ui/gfx/screen.h" | 97 #include "ui/gfx/screen.h" |
| 97 | 98 |
| 98 #if defined(OS_MACOSX) | 99 #if defined(OS_MACOSX) |
| 99 #include "base/mac/mac_util.h" | 100 #include "base/mac/mac_util.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if (!extension) | 198 if (!extension) |
| 198 return false; | 199 return false; |
| 199 | 200 |
| 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 | 204 |
| 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 = extensions::GetLaunchContainer( | 207 extensions::LaunchContainer launch_container = extensions::GetLaunchContainer( |
| 207 extensions_service->extension_prefs(), extension); | 208 extensions::ExtensionPrefs::Get(profile), extension); |
| 208 | 209 |
| 209 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 210 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 210 switches::kEnableStreamlinedHostedApps) && | 211 switches::kEnableStreamlinedHostedApps) && |
| 211 !extensions::HasPreferredLaunchContainer( | 212 !extensions::HasPreferredLaunchContainer( |
| 212 extensions_service->extension_prefs(), extension)) { | 213 extensions::ExtensionPrefs::Get(profile), extension)) { |
| 213 launch_container = extensions::LAUNCH_CONTAINER_WINDOW; | 214 launch_container = extensions::LAUNCH_CONTAINER_WINDOW; |
| 214 } | 215 } |
| 215 | 216 |
| 216 *out_extension = extension; | 217 *out_extension = extension; |
| 217 *out_launch_container = launch_container; | 218 *out_launch_container = launch_container; |
| 218 return true; | 219 return true; |
| 219 } | 220 } |
| 220 | 221 |
| 221 // Parse two comma-separated integers from string. Return true on success. | 222 // Parse two comma-separated integers from string. Return true on success. |
| 222 bool ParseCommaSeparatedIntegers(const std::string& str, | 223 bool ParseCommaSeparatedIntegers(const std::string& str, |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 990 } |
| 990 | 991 |
| 991 #if !defined(OS_WIN) | 992 #if !defined(OS_WIN) |
| 992 // static | 993 // static |
| 993 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 994 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
| 994 Profile* profile, | 995 Profile* profile, |
| 995 const std::vector<GURL>& startup_urls) { | 996 const std::vector<GURL>& startup_urls) { |
| 996 return false; | 997 return false; |
| 997 } | 998 } |
| 998 #endif | 999 #endif |
| OLD | NEW |