OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "chrome/browser/extensions/api/declarative_webrequest/request_stage.h" | 17 #include "chrome/browser/extensions/api/declarative_webrequest/request_stage.h" |
18 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" | 18 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" |
19 #include "chrome/browser/extensions/api/web_request/web_request_permissions.h" | 19 #include "chrome/browser/extensions/api/web_request/web_request_permissions.h" |
20 #include "chrome/browser/extensions/extension_function.h" | 20 #include "chrome/browser/extensions/extension_function.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/common/chrome_version_info.h" |
22 #include "chrome/common/extensions/url_pattern_set.h" | 23 #include "chrome/common/extensions/url_pattern_set.h" |
23 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
24 #include "net/base/completion_callback.h" | 25 #include "net/base/completion_callback.h" |
25 #include "net/base/network_delegate.h" | 26 #include "net/base/network_delegate.h" |
26 #include "net/http/http_request_headers.h" | 27 #include "net/http/http_request_headers.h" |
27 #include "webkit/glue/resource_type.h" | 28 #include "webkit/glue/resource_type.h" |
28 | 29 |
29 class ExtensionInfoMap; | 30 class ExtensionInfoMap; |
30 class ExtensionWebRequestTimeTracker; | 31 class ExtensionWebRequestTimeTracker; |
31 class GURL; | 32 class GURL; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 93 |
93 // Internal representation of the extraInfoSpec parameter on webRequest | 94 // Internal representation of the extraInfoSpec parameter on webRequest |
94 // events, used to specify extra information to be included with network | 95 // events, used to specify extra information to be included with network |
95 // events. | 96 // events. |
96 struct ExtraInfoSpec { | 97 struct ExtraInfoSpec { |
97 enum Flags { | 98 enum Flags { |
98 REQUEST_HEADERS = 1<<0, | 99 REQUEST_HEADERS = 1<<0, |
99 RESPONSE_HEADERS = 1<<1, | 100 RESPONSE_HEADERS = 1<<1, |
100 BLOCKING = 1<<2, | 101 BLOCKING = 1<<2, |
101 ASYNC_BLOCKING = 1<<3, | 102 ASYNC_BLOCKING = 1<<3, |
| 103 REQUEST_BODY = 1<<4, |
102 }; | 104 }; |
103 | 105 |
104 static bool InitFromValue(const base::ListValue& value, | 106 static bool InitFromValue(const base::ListValue& value, |
105 int* extra_info_spec); | 107 int* extra_info_spec); |
106 }; | 108 }; |
107 | 109 |
108 // Contains an extension's response to a blocking event. | 110 // Contains an extension's response to a blocking event. |
109 struct EventResponse { | 111 struct EventResponse { |
110 EventResponse(const std::string& extension_id, | 112 EventResponse(const std::string& extension_id, |
111 const base::Time& extension_install_time); | 113 const base::Time& extension_install_time); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; | 442 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; |
441 virtual bool RunImpl() OVERRIDE; | 443 virtual bool RunImpl() OVERRIDE; |
442 }; | 444 }; |
443 | 445 |
444 // Send updates to |host| with information about what webRequest-related | 446 // Send updates to |host| with information about what webRequest-related |
445 // extensions are installed. | 447 // extensions are installed. |
446 // TODO(mpcomplete): remove. http://crbug.com/100411 | 448 // TODO(mpcomplete): remove. http://crbug.com/100411 |
447 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); | 449 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); |
448 | 450 |
449 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 451 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
OLD | NEW |