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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 months 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 | Annotate | Revision Log
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 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2244 if (!profile || !profile->GetExtensionService()) 2244 if (!profile || !profile->GetExtensionService())
2245 return; 2245 return;
2246 2246
2247 bool adblock = false; 2247 bool adblock = false;
2248 bool adblock_plus = false; 2248 bool adblock_plus = false;
2249 bool other = false; 2249 bool other = false;
2250 const ExtensionSet* extensions = 2250 const ExtensionSet* extensions =
2251 profile->GetExtensionService()->extensions(); 2251 profile->GetExtensionService()->extensions();
2252 for (ExtensionSet::const_iterator it = extensions->begin(); 2252 for (ExtensionSet::const_iterator it = extensions->begin();
2253 it != extensions->end(); ++it) { 2253 it != extensions->end(); ++it) {
2254 if (profile->GetExtensionService()->HasUsedWebRequest(*it)) { 2254 if (profile->GetExtensionService()->HasUsedWebRequest(it->get())) {
2255 if ((*it)->name().find("Adblock Plus") != std::string::npos) { 2255 if ((*it)->name().find("Adblock Plus") != std::string::npos) {
2256 adblock_plus = true; 2256 adblock_plus = true;
2257 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 2257 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
2258 adblock = true; 2258 adblock = true;
2259 } else { 2259 } else {
2260 other = true; 2260 other = true;
2261 } 2261 }
2262 } 2262 }
2263 } 2263 }
2264 2264
2265 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 2265 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
2266 } 2266 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698