Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api.cc

Issue 102103005: Move c/c/e/extension_set to top-level extensions/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_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/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "content/public/browser/browser_message_filter.h" 46 #include "content/public/browser/browser_message_filter.h"
47 #include "content/public/browser/browser_thread.h" 47 #include "content/public/browser/browser_thread.h"
48 #include "content/public/browser/render_process_host.h" 48 #include "content/public/browser/render_process_host.h"
49 #include "content/public/browser/resource_request_info.h" 49 #include "content/public/browser/resource_request_info.h"
50 #include "content/public/browser/user_metrics.h" 50 #include "content/public/browser/user_metrics.h"
51 #include "extensions/browser/event_router.h" 51 #include "extensions/browser/event_router.h"
52 #include "extensions/browser/info_map.h" 52 #include "extensions/browser/info_map.h"
53 #include "extensions/common/error_utils.h" 53 #include "extensions/common/error_utils.h"
54 #include "extensions/common/event_filtering_info.h" 54 #include "extensions/common/event_filtering_info.h"
55 #include "extensions/common/extension.h" 55 #include "extensions/common/extension.h"
56 #include "extensions/common/extension_set.h"
56 #include "extensions/common/features/feature.h" 57 #include "extensions/common/features/feature.h"
57 #include "extensions/common/permissions/permissions_data.h" 58 #include "extensions/common/permissions/permissions_data.h"
58 #include "extensions/common/url_pattern.h" 59 #include "extensions/common/url_pattern.h"
59 #include "grit/generated_resources.h" 60 #include "grit/generated_resources.h"
60 #include "net/base/auth.h" 61 #include "net/base/auth.h"
61 #include "net/base/net_errors.h" 62 #include "net/base/net_errors.h"
62 #include "net/base/upload_data_stream.h" 63 #include "net/base/upload_data_stream.h"
63 #include "net/http/http_response_headers.h" 64 #include "net/http/http_response_headers.h"
64 #include "net/url_request/url_request.h" 65 #include "net/url_request/url_request.h"
65 #include "ui/base/l10n/l10n_util.h" 66 #include "ui/base/l10n/l10n_util.h"
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 } 2355 }
2355 2356
2356 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host) { 2357 void SendExtensionWebRequestStatusToHost(content::RenderProcessHost* host) {
2357 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 2358 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
2358 if (!profile || !profile->GetExtensionService()) 2359 if (!profile || !profile->GetExtensionService())
2359 return; 2360 return;
2360 2361
2361 bool adblock = false; 2362 bool adblock = false;
2362 bool adblock_plus = false; 2363 bool adblock_plus = false;
2363 bool other = false; 2364 bool other = false;
2364 const ExtensionSet* extensions = 2365 const extensions::ExtensionSet* extensions =
2365 profile->GetExtensionService()->extensions(); 2366 profile->GetExtensionService()->extensions();
2366 for (ExtensionSet::const_iterator it = extensions->begin(); 2367 for (extensions::ExtensionSet::const_iterator it = extensions->begin();
2367 it != extensions->end(); ++it) { 2368 it != extensions->end(); ++it) {
2368 if (profile->GetExtensionService()->HasUsedWebRequest(it->get())) { 2369 if (profile->GetExtensionService()->HasUsedWebRequest(it->get())) {
2369 if ((*it)->name().find("Adblock Plus") != std::string::npos) { 2370 if ((*it)->name().find("Adblock Plus") != std::string::npos) {
2370 adblock_plus = true; 2371 adblock_plus = true;
2371 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 2372 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
2372 adblock = true; 2373 adblock = true;
2373 } else { 2374 } else {
2374 other = true; 2375 other = true;
2375 } 2376 }
2376 } 2377 }
2377 } 2378 }
2378 2379
2379 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 2380 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
2380 } 2381 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/storage/managed_value_store_cache.cc ('k') | chrome/browser/extensions/app_sync_bundle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698