| 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 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_ROUTER_DELEGATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_ROUTER_DELEGATE_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_ROUTER_DELEGATE_H_ | 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_ROUTER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/values.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 | 12 |
| 13 class GURL; | 13 class GURL; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 } // namspace base | 17 } // namespace base |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BrowserContext; | 20 class BrowserContext; |
| 21 } // namespace content | 21 } // namespace content |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 class URLRequest; | 24 class URLRequest; |
| 25 } // namspace net | 25 } // namespace net |
| 26 | 26 |
| 27 namespace extensions { | 27 namespace extensions { |
| 28 | 28 |
| 29 class WebRequestEventDetails; |
| 30 |
| 29 // A delegate class of WebRequestApi that are not a part of chrome. | 31 // A delegate class of WebRequestApi that are not a part of chrome. |
| 30 class WebRequestEventRouterDelegate { | 32 class WebRequestEventRouterDelegate { |
| 31 public: | 33 public: |
| 32 WebRequestEventRouterDelegate(); | 34 WebRequestEventRouterDelegate(); |
| 33 virtual ~WebRequestEventRouterDelegate(); | 35 virtual ~WebRequestEventRouterDelegate(); |
| 34 | 36 |
| 35 // Looks up the tab and window ID for a given request. | 37 // Looks up the tab and window ID for a given request. |
| 36 // Called on the IO thread. | 38 // Called on the IO thread. |
| 37 virtual void ExtractExtraRequestDetails(const net::URLRequest* request, | 39 virtual void ExtractExtraRequestDetails(const net::URLRequest* request, |
| 38 base::DictionaryValue* out); | 40 WebRequestEventDetails* out); |
| 39 | 41 |
| 40 // Called to check extra parameters (e.g., tab_id, windown_id) when filtering | 42 // Called to check extra parameters (e.g., tab_id, windown_id) when filtering |
| 41 // event listeners. | 43 // event listeners. |
| 42 virtual bool OnGetMatchingListenersImplCheck(int tab_id, | 44 virtual bool OnGetMatchingListenersImplCheck(int tab_id, |
| 43 int window_id, | 45 int window_id, |
| 44 const net::URLRequest* request); | 46 const net::URLRequest* request); |
| 45 | 47 |
| 46 // Logs an extension action. | 48 // Logs an extension action. |
| 47 virtual void LogExtensionActivity(content::BrowserContext* browser_context, | 49 virtual void LogExtensionActivity(content::BrowserContext* browser_context, |
| 48 bool is_incognito, | 50 bool is_incognito, |
| 49 const std::string& extension_id, | 51 const std::string& extension_id, |
| 50 const GURL& url, | 52 const GURL& url, |
| 51 const std::string& api_call, | 53 const std::string& api_call, |
| 52 scoped_ptr<base::DictionaryValue> details) { | 54 scoped_ptr<base::DictionaryValue> details) { |
| 53 } | 55 } |
| 54 | 56 |
| 55 private: | 57 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(WebRequestEventRouterDelegate); | 58 DISALLOW_COPY_AND_ASSIGN(WebRequestEventRouterDelegate); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace extensions | 61 } // namespace extensions |
| 60 | 62 |
| 61 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_ROUTER_DELEGATE_
H_ | 63 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_ROUTER_DELEGATE_
H_ |
| OLD | NEW |