Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / extensions / browser / api / extensions_api_client.h
index a13b8fe..7fc2c1c 100644 (file)
@@ -8,6 +8,8 @@
 #include <map>
 
 #include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "extensions/browser/api/declarative_content/content_rules_registry.h"
 #include "extensions/browser/api/storage/settings_namespace.h"
 
 class GURL;
@@ -19,12 +21,20 @@ namespace content {
 class BrowserContext;
 }
 
-namespace device {
-class HidService;
-}
-
 namespace extensions {
 
+class AppViewGuestDelegate;
+class ContentRulesRegistry;
+class ExtensionOptionsGuest;
+class ExtensionOptionsGuestDelegate;
+class MimeHandlerViewGuest;
+class MimeHandlerViewGuestDelegate;
+class WebViewGuest;
+class WebViewGuestDelegate;
+class WebViewPermissionHelper;
+class WebViewPermissionHelperDelegate;
+class WebRequestEventRouterDelegate;
+class RulesCacheDelegate;
 class SettingsObserver;
 class SettingsStorageFactory;
 class ValueStoreCache;
@@ -53,25 +63,45 @@ class ExtensionsAPIClient {
       const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers,
       std::map<settings_namespace::Namespace, ValueStoreCache*>* caches);
 
-  // Attaches a frame |url| inside the <appview> specified by
-  // |guest_instance_id|. Returns true if the operation completes succcessfully.
-  virtual bool AppViewInternalAttachFrame(
-      content::BrowserContext* browser_context,
-      const GURL& url,
-      int guest_instance_id,
-      const std::string& guest_extension_id);
+  // Creates the AppViewGuestDelegate.
+  virtual AppViewGuestDelegate* CreateAppViewGuestDelegate() const;
+
+  // Returns a delegate for ExtensionOptionsGuest. The caller owns the returned
+  // ExtensionOptionsGuestDelegate.
+  virtual ExtensionOptionsGuestDelegate* CreateExtensionOptionsGuestDelegate(
+      ExtensionOptionsGuest* guest) const;
 
-  // Denies the embedding requested by the <appview> specified by
-  // |guest_instance_id|. Returns true if the operation completes successfully.
-  virtual bool AppViewInternalDenyRequest(
+  // Creates a delegate for MimeHandlerViewGuest.
+  virtual scoped_ptr<MimeHandlerViewGuestDelegate>
+      CreateMimeHandlerViewGuestDelegate(MimeHandlerViewGuest* guest) const;
+
+  // Returns a delegate for some of WebViewGuest's behavior. The caller owns the
+  // returned WebViewGuestDelegate.
+  virtual WebViewGuestDelegate* CreateWebViewGuestDelegate (
+      WebViewGuest* web_view_guest) const;
+
+  // Returns a delegate for some of WebViewPermissionHelper's behavior. The
+  // caller owns the returned WebViewPermissionHelperDelegate.
+  virtual WebViewPermissionHelperDelegate*
+      CreateWebViewPermissionHelperDelegate (
+          WebViewPermissionHelper* web_view_permission_helper) const;
+
+  // TODO(wjmaclean): Remove this as soon as rules_registry_service.* moves to
+  // extensions/browser/api/declarative/.
+  virtual scoped_refptr<RulesRegistry> GetRulesRegistry(
       content::BrowserContext* browser_context,
-      int guest_instance_id,
-      const std::string& guest_extension_id);
+      const RulesRegistry::WebViewKey& webview_key,
+      const std::string& event_name);
 
-  // Returns the HidService instance for this embedder.
-  virtual device::HidService* GetHidService();
+  // Creates a delegate for WebRequestEventRouter.
+  virtual WebRequestEventRouterDelegate* CreateWebRequestEventRouterDelegate()
+      const;
 
-  virtual void RegisterGuestViewTypes() {}
+  // TODO(wjmaclean): Remove this when (if) ContentRulesRegistry code moves
+  // to extensions/browser/api.
+  virtual scoped_refptr<ContentRulesRegistry> CreateContentRulesRegistry(
+      content::BrowserContext* browser_context,
+      RulesCacheDelegate* cache_delegate) const;
 
   // NOTE: If this interface gains too many methods (perhaps more than 20) it
   // should be split into one interface per API.