| 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 #include "chrome/browser/extensions/extension_webrequest_api.h" | 5 #include "chrome/browser/extensions/extension_webrequest_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/extensions/extension_webrequest_time_tracker.h" | 25 #include "chrome/browser/extensions/extension_webrequest_time_tracker.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/profiles/profile_manager.h" | 27 #include "chrome/browser/profiles/profile_manager.h" |
| 28 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 28 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| 29 #include "chrome/browser/renderer_host/web_cache_manager.h" | 29 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 30 #include "chrome/common/extensions/extension.h" | 30 #include "chrome/common/extensions/extension.h" |
| 31 #include "chrome/common/extensions/extension_error_utils.h" | 31 #include "chrome/common/extensions/extension_error_utils.h" |
| 32 #include "chrome/common/extensions/extension_messages.h" | 32 #include "chrome/common/extensions/extension_messages.h" |
| 33 #include "chrome/common/extensions/url_pattern.h" | 33 #include "chrome/common/extensions/url_pattern.h" |
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 35 #include "content/browser/browser_message_filter.h" | |
| 36 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 35 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 37 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 36 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 37 #include "content/public/browser/browser_message_filter.h" |
| 38 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 39 #include "googleurl/src/gurl.h" | 39 #include "googleurl/src/gurl.h" |
| 40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
| 41 #include "net/base/auth.h" | 41 #include "net/base/auth.h" |
| 42 #include "net/base/net_errors.h" | 42 #include "net/base/net_errors.h" |
| 43 #include "net/base/net_log.h" | 43 #include "net/base/net_log.h" |
| 44 #include "net/http/http_response_headers.h" | 44 #include "net/http/http_response_headers.h" |
| 45 #include "net/url_request/url_request.h" | 45 #include "net/url_request/url_request.h" |
| 46 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
| 47 | 47 |
| 48 using content::BrowserMessageFilter; |
| 48 using content::BrowserThread; | 49 using content::BrowserThread; |
| 49 | 50 |
| 50 namespace helpers = extension_webrequest_api_helpers; | 51 namespace helpers = extension_webrequest_api_helpers; |
| 51 namespace keys = extension_webrequest_api_constants; | 52 namespace keys = extension_webrequest_api_constants; |
| 52 | 53 |
| 53 namespace { | 54 namespace { |
| 54 | 55 |
| 55 // List of all the webRequest events. | 56 // List of all the webRequest events. |
| 56 static const char* const kWebRequestEvents[] = { | 57 static const char* const kWebRequestEvents[] = { |
| 57 keys::kOnBeforeRedirect, | 58 keys::kOnBeforeRedirect, |
| (...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 1723 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
| 1723 adblock = true; | 1724 adblock = true; |
| 1724 } else { | 1725 } else { |
| 1725 other = true; | 1726 other = true; |
| 1726 } | 1727 } |
| 1727 } | 1728 } |
| 1728 } | 1729 } |
| 1729 | 1730 |
| 1730 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 1731 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
| 1731 } | 1732 } |
| OLD | NEW |