| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/shell/browser/shell_extensions_browser_client.h" | 5 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "components/version_info/version_info.h" |
| 11 #include "content/public/browser/browser_context.h" | 12 #include "content/public/browser/browser_context.h" |
| 12 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/render_frame_host.h" | 14 #include "content/public/browser/render_frame_host.h" |
| 14 #include "content/public/browser/resource_request_info.h" | 15 #include "content/public/browser/resource_request_info.h" |
| 15 #include "extensions/browser/api/extensions_api_client.h" | 16 #include "extensions/browser/api/extensions_api_client.h" |
| 16 #include "extensions/browser/api/generated_api_registration.h" | 17 #include "extensions/browser/api/generated_api_registration.h" |
| 17 #include "extensions/browser/event_router.h" | 18 #include "extensions/browser/event_router.h" |
| 18 #include "extensions/browser/extension_function_registry.h" | 19 #include "extensions/browser/extension_function_registry.h" |
| 19 #include "extensions/browser/mojo/service_registration.h" | 20 #include "extensions/browser/mojo/service_registration.h" |
| 20 #include "extensions/browser/null_app_sorting.h" | 21 #include "extensions/browser/null_app_sorting.h" |
| 21 #include "extensions/browser/updater/null_extension_cache.h" | 22 #include "extensions/browser/updater/null_extension_cache.h" |
| 22 #include "extensions/browser/url_request_util.h" | 23 #include "extensions/browser/url_request_util.h" |
| 24 #include "extensions/common/features/feature_channel.h" |
| 23 #include "extensions/shell/browser/api/generated_api_registration.h" | 25 #include "extensions/shell/browser/api/generated_api_registration.h" |
| 24 #include "extensions/shell/browser/delegates/shell_kiosk_delegate.h" | 26 #include "extensions/shell/browser/delegates/shell_kiosk_delegate.h" |
| 25 #include "extensions/shell/browser/shell_extension_host_delegate.h" | 27 #include "extensions/shell/browser/shell_extension_host_delegate.h" |
| 26 #include "extensions/shell/browser/shell_extension_system_factory.h" | 28 #include "extensions/shell/browser/shell_extension_system_factory.h" |
| 27 #include "extensions/shell/browser/shell_extension_web_contents_observer.h" | 29 #include "extensions/shell/browser/shell_extension_web_contents_observer.h" |
| 28 #include "extensions/shell/browser/shell_extensions_api_client.h" | 30 #include "extensions/shell/browser/shell_extensions_api_client.h" |
| 29 #include "extensions/shell/browser/shell_navigation_ui_data.h" | 31 #include "extensions/shell/browser/shell_navigation_ui_data.h" |
| 30 #include "extensions/shell/browser/shell_runtime_api_delegate.h" | 32 #include "extensions/shell/browser/shell_runtime_api_delegate.h" |
| 31 | 33 |
| 32 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
| 33 #include "chromeos/login/login_state.h" | 35 #include "chromeos/login/login_state.h" |
| 34 #endif | 36 #endif |
| 35 | 37 |
| 36 using content::BrowserContext; | 38 using content::BrowserContext; |
| 37 using content::BrowserThread; | 39 using content::BrowserThread; |
| 38 | 40 |
| 39 namespace extensions { | 41 namespace extensions { |
| 40 | 42 |
| 41 ShellExtensionsBrowserClient::ShellExtensionsBrowserClient( | 43 ShellExtensionsBrowserClient::ShellExtensionsBrowserClient( |
| 42 BrowserContext* context, | 44 BrowserContext* context, |
| 43 PrefService* pref_service) | 45 PrefService* pref_service) |
| 44 : browser_context_(context), | 46 : browser_context_(context), |
| 45 pref_service_(pref_service), | 47 pref_service_(pref_service), |
| 46 api_client_(new ShellExtensionsAPIClient), | 48 api_client_(new ShellExtensionsAPIClient), |
| 47 extension_cache_(new NullExtensionCache()) { | 49 extension_cache_(new NullExtensionCache()) { |
| 50 // app_shell does not have a concept of channel yet, so leave UNKNOWN to |
| 51 // enable all channel-dependent extension APIs. |
| 52 SetCurrentChannel(version_info::Channel::UNKNOWN); |
| 48 } | 53 } |
| 49 | 54 |
| 50 ShellExtensionsBrowserClient::~ShellExtensionsBrowserClient() { | 55 ShellExtensionsBrowserClient::~ShellExtensionsBrowserClient() { |
| 51 } | 56 } |
| 52 | 57 |
| 53 bool ShellExtensionsBrowserClient::IsShuttingDown() { | 58 bool ShellExtensionsBrowserClient::IsShuttingDown() { |
| 54 return false; | 59 return false; |
| 55 } | 60 } |
| 56 | 61 |
| 57 bool ShellExtensionsBrowserClient::AreExtensionsDisabled( | 62 bool ShellExtensionsBrowserClient::AreExtensionsDisabled( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 return navigation_data->GetExtensionNavigationUIData(); | 266 return navigation_data->GetExtensionNavigationUIData(); |
| 262 } | 267 } |
| 263 | 268 |
| 264 KioskDelegate* ShellExtensionsBrowserClient::GetKioskDelegate() { | 269 KioskDelegate* ShellExtensionsBrowserClient::GetKioskDelegate() { |
| 265 if (!kiosk_delegate_) | 270 if (!kiosk_delegate_) |
| 266 kiosk_delegate_.reset(new ShellKioskDelegate()); | 271 kiosk_delegate_.reset(new ShellKioskDelegate()); |
| 267 return kiosk_delegate_.get(); | 272 return kiosk_delegate_.get(); |
| 268 } | 273 } |
| 269 | 274 |
| 270 } // namespace extensions | 275 } // namespace extensions |
| OLD | NEW |