Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / extensions / shell / browser / shell_extensions_browser_client.cc
index a4aee60..6cbaa14 100644 (file)
@@ -17,7 +17,9 @@
 #include "extensions/browser/extension_function_registry.h"
 #include "extensions/browser/extension_prefs.h"
 #include "extensions/browser/null_app_sorting.h"
+#include "extensions/browser/updater/null_extension_cache.h"
 #include "extensions/browser/url_request_util.h"
+#include "extensions/shell/browser/api/generated_api_registration.h"
 #include "extensions/shell/browser/shell_extension_host_delegate.h"
 #include "extensions/shell/browser/shell_extension_system_factory.h"
 #include "extensions/shell/browser/shell_runtime_api_delegate.h"
@@ -37,7 +39,9 @@ void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) {
 
 ShellExtensionsBrowserClient::ShellExtensionsBrowserClient(
     BrowserContext* context)
-    : browser_context_(context), api_client_(new ExtensionsAPIClient) {
+    : browser_context_(context),
+      api_client_(new ExtensionsAPIClient),
+      extension_cache_(new NullExtensionCache()) {
   // Set up the preferences service.
   base::PrefServiceFactory factory;
   factory.set_user_prefs(new TestingPrefStore);
@@ -184,6 +188,9 @@ void ShellExtensionsBrowserClient::RegisterExtensionFunctions(
     ExtensionFunctionRegistry* registry) const {
   // Register core extension-system APIs.
   core_api::GeneratedFunctionRegistry::RegisterAll(registry);
+
+  // app_shell-only APIs.
+  shell::api::GeneratedFunctionRegistry::RegisterAll(registry);
 }
 
 scoped_ptr<RuntimeAPIDelegate>
@@ -219,4 +226,17 @@ net::NetLog* ShellExtensionsBrowserClient::GetNetLog() {
   return NULL;
 }
 
+ExtensionCache* ShellExtensionsBrowserClient::GetExtensionCache() {
+  return extension_cache_.get();
+}
+
+bool ShellExtensionsBrowserClient::IsBackgroundUpdateAllowed() {
+  return true;
+}
+
+bool ShellExtensionsBrowserClient::IsMinBrowserVersionSupported(
+    const std::string& min_version) {
+  return true;
+}
+
 }  // namespace extensions