| 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 "chrome/browser/extensions/api/chrome_extensions_api_client.h" | 5 #include "chrome/browser/extensions/api/chrome_extensions_api_client.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "chrome/browser/extensions/api/storage/sync_value_store_cache.h" | 8 #include "chrome/browser/extensions/api/storage/sync_value_store_cache.h" |
| 9 #include "chrome/browser/guest_view/app_view/app_view_guest.h" |
| 9 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| 10 | 11 |
| 11 #if defined(ENABLE_CONFIGURATION_POLICY) | 12 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 12 #include "chrome/browser/extensions/api/storage/managed_value_store_cache.h" | 13 #include "chrome/browser/extensions/api/storage/managed_value_store_cache.h" |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 namespace extensions { | 16 namespace extensions { |
| 16 | 17 |
| 17 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {} | 18 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {} |
| 18 | 19 |
| 19 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {} | 20 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {} |
| 20 | 21 |
| 21 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( | 22 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( |
| 22 content::BrowserContext* context, | 23 content::BrowserContext* context, |
| 23 const scoped_refptr<SettingsStorageFactory>& factory, | 24 const scoped_refptr<SettingsStorageFactory>& factory, |
| 24 const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers, | 25 const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers, |
| 25 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { | 26 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { |
| 26 // Add support for chrome.storage.sync. | 27 // Add support for chrome.storage.sync. |
| 27 (*caches)[settings_namespace::SYNC] = | 28 (*caches)[settings_namespace::SYNC] = |
| 28 new SyncValueStoreCache(factory, observers, context->GetPath()); | 29 new SyncValueStoreCache(factory, observers, context->GetPath()); |
| 29 | 30 |
| 30 #if defined(ENABLE_CONFIGURATION_POLICY) | 31 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 31 // Add support for chrome.storage.managed. | 32 // Add support for chrome.storage.managed. |
| 32 (*caches)[settings_namespace::MANAGED] = | 33 (*caches)[settings_namespace::MANAGED] = |
| 33 new ManagedValueStoreCache(context, factory, observers); | 34 new ManagedValueStoreCache(context, factory, observers); |
| 34 #endif | 35 #endif |
| 35 } | 36 } |
| 36 | 37 |
| 38 bool ChromeExtensionsAPIClient::AppViewInternalAttachFrame( |
| 39 content::BrowserContext* browser_context, |
| 40 const GURL& url, |
| 41 int guest_instance_id, |
| 42 const std::string& guest_extension_id) { |
| 43 return AppViewGuest::CompletePendingRequest(browser_context, |
| 44 url, |
| 45 guest_instance_id, |
| 46 guest_extension_id); |
| 47 } |
| 48 |
| 49 bool ChromeExtensionsAPIClient::AppViewInternalDenyRequest( |
| 50 content::BrowserContext* browser_context, |
| 51 int guest_instance_id, |
| 52 const std::string& guest_extension_id) { |
| 53 return AppViewGuest::CompletePendingRequest(browser_context, |
| 54 GURL(), |
| 55 guest_instance_id, |
| 56 guest_extension_id); |
| 57 } |
| 58 |
| 37 } // namespace extensions | 59 } // namespace extensions |
| OLD | NEW |