| 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 <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "chrome/browser/extensions/extension_function.h" | 17 #include "chrome/browser/extensions/extension_function.h" |
| 18 #include "chrome/browser/extensions/extension_webrequest_api_helpers.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/common/extensions/url_pattern_set.h" | 20 #include "chrome/common/extensions/url_pattern_set.h" |
| 20 #include "ipc/ipc_message.h" | 21 #include "ipc/ipc_message.h" |
| 21 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
| 22 #include "net/base/network_delegate.h" | 23 #include "net/base/network_delegate.h" |
| 23 #include "net/http/http_request_headers.h" | 24 #include "net/http/http_request_headers.h" |
| 24 #include "webkit/glue/resource_type.h" | 25 #include "webkit/glue/resource_type.h" |
| 25 | 26 |
| 26 class ExtensionInfoMap; | 27 class ExtensionInfoMap; |
| 27 class ExtensionWebRequestTimeTracker; | 28 class ExtensionWebRequestTimeTracker; |
| 28 class GURL; | 29 class GURL; |
| 29 class RenderProcessHost; | 30 class RenderProcessHost; |
| 30 | 31 |
| 31 namespace base { | 32 namespace base { |
| 32 class DictionaryValue; | 33 class DictionaryValue; |
| 33 class ListValue; | 34 class ListValue; |
| 35 class StringValue; |
| 34 } | 36 } |
| 35 | 37 |
| 36 namespace net { | 38 namespace net { |
| 37 class AuthCredentials; | 39 class AuthCredentials; |
| 38 class AuthChallengeInfo; | 40 class AuthChallengeInfo; |
| 39 class HttpRequestHeaders; | 41 class HttpRequestHeaders; |
| 40 class HttpResponseHeaders; | 42 class HttpResponseHeaders; |
| 41 class URLRequest; | 43 class URLRequest; |
| 42 } | 44 } |
| 43 | 45 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 102 |
| 101 // 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 |
| 102 // precedence in case multiple extensions respond with conflicting | 104 // precedence in case multiple extensions respond with conflicting |
| 103 // decisions. | 105 // decisions. |
| 104 base::Time extension_install_time; | 106 base::Time extension_install_time; |
| 105 | 107 |
| 106 // Response values. These are mutually exclusive. | 108 // Response values. These are mutually exclusive. |
| 107 bool cancel; | 109 bool cancel; |
| 108 GURL new_url; | 110 GURL new_url; |
| 109 scoped_ptr<net::HttpRequestHeaders> request_headers; | 111 scoped_ptr<net::HttpRequestHeaders> request_headers; |
| 110 // Contains all header lines after the status line, lines are \n separated. | 112 scoped_ptr<extension_webrequest_api_helpers::ResponseHeaders> |
| 111 std::string response_headers_string; | 113 response_headers; |
| 114 |
| 112 scoped_ptr<net::AuthCredentials> auth_credentials; | 115 scoped_ptr<net::AuthCredentials> auth_credentials; |
| 113 | 116 |
| 114 EventResponse(const std::string& extension_id, | 117 EventResponse(const std::string& extension_id, |
| 115 const base::Time& extension_install_time); | 118 const base::Time& extension_install_time); |
| 116 ~EventResponse(); | 119 ~EventResponse(); |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(EventResponse); | 121 DISALLOW_COPY_AND_ASSIGN(EventResponse); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 static ExtensionWebRequestEventRouter* GetInstance(); | 124 static ExtensionWebRequestEventRouter* GetInstance(); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 // function. | 365 // function. |
| 363 virtual void OnQuotaExceeded() OVERRIDE; | 366 virtual void OnQuotaExceeded() OVERRIDE; |
| 364 }; | 367 }; |
| 365 | 368 |
| 366 // Send updates to |host| with information about what webRequest-related | 369 // Send updates to |host| with information about what webRequest-related |
| 367 // extensions are installed. | 370 // extensions are installed. |
| 368 // TODO(mpcomplete): remove. http://crbug.com/100411 | 371 // TODO(mpcomplete): remove. http://crbug.com/100411 |
| 369 void SendExtensionWebRequestStatusToHost(RenderProcessHost* host); | 372 void SendExtensionWebRequestStatusToHost(RenderProcessHost* host); |
| 370 | 373 |
| 371 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ | 374 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBREQUEST_API_H_ |
| OLD | NEW |