Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / web_request / web_request_api.h
index c3bf24c..18de73d 100644 (file)
@@ -18,6 +18,7 @@
 #include "chrome/browser/extensions/api/declarative_webrequest/request_stage.h"
 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h"
 #include "chrome/browser/extensions/api/web_request/web_request_permissions.h"
+#include "content/public/common/resource_type.h"
 #include "extensions/browser/browser_context_keyed_api_factory.h"
 #include "extensions/browser/event_router.h"
 #include "extensions/browser/extension_function.h"
@@ -26,7 +27,6 @@
 #include "net/base/completion_callback.h"
 #include "net/base/network_delegate.h"
 #include "net/http/http_request_headers.h"
-#include "webkit/common/resource_type.h"
 
 class ExtensionWebRequestTimeTracker;
 class GURL;
@@ -57,7 +57,7 @@ class WebRequestRulesRegistry;
 
 // Support class for the WebRequest API. Lives on the UI thread. Most of the
 // work is done by ExtensionWebRequestEventRouter below. This class observes
-// extension::EventRouter to deal with event listeners. There is one instance
+// extensions::EventRouter to deal with event listeners. There is one instance
 // per BrowserContext which is shared with incognito.
 class WebRequestAPI : public BrowserContextKeyedAPI,
                       public EventRouter::Observer {
@@ -119,7 +119,7 @@ class ExtensionWebRequestEventRouter
     bool InitFromValue(const base::DictionaryValue& value, std::string* error);
 
     extensions::URLPatternSet urls;
-    std::vector<ResourceType::Type> types;
+    std::vector<content::ResourceType> types;
     int tab_id;
     int window_id;
   };
@@ -357,7 +357,7 @@ class ExtensionWebRequestEventRouter
       int window_id,
       int render_process_host_id,
       int routing_id,
-      ResourceType::Type resource_type,
+      content::ResourceType resource_type,
       bool is_async_request,
       bool is_request_from_extension,
       int* extra_info_spec,
@@ -467,25 +467,27 @@ class ExtensionWebRequestEventRouter
   DISALLOW_COPY_AND_ASSIGN(ExtensionWebRequestEventRouter);
 };
 
-class WebRequestAddEventListener : public SyncIOThreadExtensionFunction {
+class WebRequestInternalAddEventListenerFunction
+    : public SyncIOThreadExtensionFunction {
  public:
   DECLARE_EXTENSION_FUNCTION("webRequestInternal.addEventListener",
                              WEBREQUESTINTERNAL_ADDEVENTLISTENER)
 
  protected:
-  virtual ~WebRequestAddEventListener() {}
+  virtual ~WebRequestInternalAddEventListenerFunction() {}
 
   // ExtensionFunction:
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunSync() OVERRIDE;
 };
 
-class WebRequestEventHandled : public SyncIOThreadExtensionFunction {
+class WebRequestInternalEventHandledFunction
+    : public SyncIOThreadExtensionFunction {
  public:
   DECLARE_EXTENSION_FUNCTION("webRequestInternal.eventHandled",
                              WEBREQUESTINTERNAL_EVENTHANDLED)
 
  protected:
-  virtual ~WebRequestEventHandled() {}
+  virtual ~WebRequestInternalEventHandledFunction() {}
 
   // Unblocks the network request and sets |error_| such that the developer
   // console will show the respective error message. Use this function to handle
@@ -499,7 +501,7 @@ class WebRequestEventHandled : public SyncIOThreadExtensionFunction {
       const std::string& error);
 
   // ExtensionFunction:
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunSync() OVERRIDE;
 };
 
 class WebRequestHandlerBehaviorChangedFunction
@@ -517,12 +519,11 @@ class WebRequestHandlerBehaviorChangedFunction
   // Handle quota exceeded gracefully: Only warn the user but still execute the
   // function.
   virtual void OnQuotaExceeded(const std::string& error) OVERRIDE;
-  virtual bool RunImpl() OVERRIDE;
+  virtual bool RunSync() OVERRIDE;
 };
 
 // Send updates to |host| with information about what webRequest-related
 // extensions are installed.
-// TODO(mpcomplete): remove. http://crbug.com/100411
 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host);
 
 #endif  // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_