| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_WEBREQUEST_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 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/time.h" | 15 #include "base/time.h" |
| 16 #include "chrome/browser/extensions/extension_function.h" | 16 #include "chrome/browser/extensions/extension_function.h" |
| 17 #include "chrome/browser/extensions/extension_webrequest_api_helpers.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/common/extensions/url_pattern_set.h" | 19 #include "chrome/common/extensions/url_pattern_set.h" |
| 19 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
| 20 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
| 21 #include "net/base/network_delegate.h" | 22 #include "net/base/network_delegate.h" |
| 22 #include "net/http/http_request_headers.h" | 23 #include "net/http/http_request_headers.h" |
| 23 #include "webkit/glue/resource_type.h" | 24 #include "webkit/glue/resource_type.h" |
| 24 | 25 |
| 25 class ExtensionInfoMap; | 26 class ExtensionInfoMap; |
| 26 class ExtensionWebRequestTimeTracker; | 27 class ExtensionWebRequestTimeTracker; |
| 27 class GURL; | 28 class GURL; |
| 28 class RenderProcessHost; | 29 class RenderProcessHost; |
| 29 | 30 |
| 30 namespace base { | 31 namespace base { |
| 31 class DictionaryValue; | 32 class DictionaryValue; |
| 32 class ListValue; | 33 class ListValue; |
| 33 class StringValue; | 34 class StringValue; |
| 34 } | 35 } |
| 35 | 36 |
| 36 namespace extension_webrequest_api_helpers { | |
| 37 struct EventResponseDelta; | |
| 38 } | |
| 39 | |
| 40 namespace net { | 37 namespace net { |
| 41 class AuthCredentials; | 38 class AuthCredentials; |
| 42 class AuthChallengeInfo; | 39 class AuthChallengeInfo; |
| 43 class HostPortPair; | 40 class HostPortPair; |
| 44 class HttpRequestHeaders; | 41 class HttpRequestHeaders; |
| 45 class HttpResponseHeaders; | 42 class HttpResponseHeaders; |
| 46 class URLRequest; | 43 class URLRequest; |
| 47 } | 44 } |
| 48 | 45 |
| 49 // This class observes network events and routes them to the appropriate | 46 // This class observes network events and routes them to the appropriate |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 102 |
| 106 // The time that the extension was installed. Used for deciding order of | 103 // The time that the extension was installed. Used for deciding order of |
| 107 // precedence in case multiple extensions respond with conflicting | 104 // precedence in case multiple extensions respond with conflicting |
| 108 // decisions. | 105 // decisions. |
| 109 base::Time extension_install_time; | 106 base::Time extension_install_time; |
| 110 | 107 |
| 111 // Response values. These are mutually exclusive. | 108 // Response values. These are mutually exclusive. |
| 112 bool cancel; | 109 bool cancel; |
| 113 GURL new_url; | 110 GURL new_url; |
| 114 scoped_ptr<net::HttpRequestHeaders> request_headers; | 111 scoped_ptr<net::HttpRequestHeaders> request_headers; |
| 115 // Contains all header lines after the status line, lines are \n separated. | 112 scoped_ptr<extension_webrequest_api_helpers::ResponseHeaders> |
| 116 std::string response_headers_string; | 113 response_headers; |
| 114 |
| 117 scoped_ptr<net::AuthCredentials> auth_credentials; | 115 scoped_ptr<net::AuthCredentials> auth_credentials; |
| 118 | 116 |
| 119 EventResponse(const std::string& extension_id, | 117 EventResponse(const std::string& extension_id, |
| 120 const base::Time& extension_install_time); | 118 const base::Time& extension_install_time); |
| 121 ~EventResponse(); | 119 ~EventResponse(); |
| 122 | 120 |
| 123 DISALLOW_COPY_AND_ASSIGN(EventResponse); | 121 DISALLOW_COPY_AND_ASSIGN(EventResponse); |
| 124 }; | 122 }; |
| 125 | 123 |
| 126 static ExtensionWebRequestEventRouter* GetInstance(); | 124 static ExtensionWebRequestEventRouter* GetInstance(); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // function. | 365 // function. |
| 368 virtual void OnQuotaExceeded() OVERRIDE; | 366 virtual void OnQuotaExceeded() OVERRIDE; |
| 369 }; | 367 }; |
| 370 | 368 |
| 371 // Send updates to |host| with information about what webRequest-related | 369 // Send updates to |host| with information about what webRequest-related |
| 372 // extensions are installed. | 370 // extensions are installed. |
| 373 // TODO(mpcomplete): remove. http://crbug.com/100411 | 371 // TODO(mpcomplete): remove. http://crbug.com/100411 |
| 374 void SendExtensionWebRequestStatusToHost(RenderProcessHost* host); | 372 void SendExtensionWebRequestStatusToHost(RenderProcessHost* host); |
| 375 | 373 |
| 376 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ | 374 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ |
| OLD | NEW |