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 26 matching lines...) Expand all Loading... |
37 #include "googleurl/src/gurl.h" | 37 #include "googleurl/src/gurl.h" |
38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
39 #include "net/base/auth.h" | 39 #include "net/base/auth.h" |
40 #include "net/base/net_errors.h" | 40 #include "net/base/net_errors.h" |
41 #include "net/base/net_log.h" | 41 #include "net/base/net_log.h" |
42 #include "net/http/http_response_headers.h" | 42 #include "net/http/http_response_headers.h" |
43 #include "net/http/http_util.h" | 43 #include "net/http/http_util.h" |
44 #include "net/url_request/url_request.h" | 44 #include "net/url_request/url_request.h" |
45 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
46 | 46 |
| 47 using content::BrowserThread; |
| 48 |
47 namespace keys = extension_webrequest_api_constants; | 49 namespace keys = extension_webrequest_api_constants; |
48 | 50 |
49 namespace { | 51 namespace { |
50 | 52 |
51 // List of all the webRequest events. | 53 // List of all the webRequest events. |
52 static const char* const kWebRequestEvents[] = { | 54 static const char* const kWebRequestEvents[] = { |
53 keys::kOnBeforeRedirect, | 55 keys::kOnBeforeRedirect, |
54 keys::kOnBeforeRequest, | 56 keys::kOnBeforeRequest, |
55 keys::kOnBeforeSendHeaders, | 57 keys::kOnBeforeSendHeaders, |
56 keys::kOnCompleted, | 58 keys::kOnCompleted, |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 1739 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
1738 adblock = true; | 1740 adblock = true; |
1739 } else { | 1741 } else { |
1740 other = true; | 1742 other = true; |
1741 } | 1743 } |
1742 } | 1744 } |
1743 } | 1745 } |
1744 | 1746 |
1745 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 1747 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
1746 } | 1748 } |
OLD | NEW |