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/chrome_version_info.h" |
23 #include "chrome/common/extensions/url_pattern_set.h" | 23 #include "extensions/common/url_pattern_set.h" |
24 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
25 #include "net/base/completion_callback.h" | 25 #include "net/base/completion_callback.h" |
26 #include "net/base/network_delegate.h" | 26 #include "net/base/network_delegate.h" |
27 #include "net/http/http_request_headers.h" | 27 #include "net/http/http_request_headers.h" |
28 #include "webkit/glue/resource_type.h" | 28 #include "webkit/glue/resource_type.h" |
29 | 29 |
30 class ExtensionInfoMap; | 30 class ExtensionInfoMap; |
31 class ExtensionWebRequestTimeTracker; | 31 class ExtensionWebRequestTimeTracker; |
32 class GURL; | 32 class GURL; |
33 | 33 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // filter what network events an extension cares about. | 78 // filter what network events an extension cares about. |
79 struct RequestFilter { | 79 struct RequestFilter { |
80 RequestFilter(); | 80 RequestFilter(); |
81 ~RequestFilter(); | 81 ~RequestFilter(); |
82 | 82 |
83 // Returns false if there was an error initializing. If it is a user error, | 83 // Returns false if there was an error initializing. If it is a user error, |
84 // an error message is provided, otherwise the error is internal (and | 84 // an error message is provided, otherwise the error is internal (and |
85 // unexpected). | 85 // unexpected). |
86 bool InitFromValue(const base::DictionaryValue& value, std::string* error); | 86 bool InitFromValue(const base::DictionaryValue& value, std::string* error); |
87 | 87 |
88 URLPatternSet urls; | 88 extensions::URLPatternSet urls; |
89 std::vector<ResourceType::Type> types; | 89 std::vector<ResourceType::Type> types; |
90 int tab_id; | 90 int tab_id; |
91 int window_id; | 91 int window_id; |
92 }; | 92 }; |
93 | 93 |
94 // Internal representation of the extraInfoSpec parameter on webRequest | 94 // Internal representation of the extraInfoSpec parameter on webRequest |
95 // events, used to specify extra information to be included with network | 95 // events, used to specify extra information to be included with network |
96 // events. | 96 // events. |
97 struct ExtraInfoSpec { | 97 struct ExtraInfoSpec { |
98 enum Flags { | 98 enum Flags { |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; | 443 virtual void OnQuotaExceeded(const std::string& error) OVERRIDE; |
444 virtual bool RunImpl() OVERRIDE; | 444 virtual bool RunImpl() OVERRIDE; |
445 }; | 445 }; |
446 | 446 |
447 // Send updates to |host| with information about what webRequest-related | 447 // Send updates to |host| with information about what webRequest-related |
448 // extensions are installed. | 448 // extensions are installed. |
449 // TODO(mpcomplete): remove. http://crbug.com/100411 | 449 // TODO(mpcomplete): remove. http://crbug.com/100411 |
450 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); | 450 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host); |
451 | 451 |
452 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 452 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
OLD | NEW |