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

Side by Side Diff: chrome/browser/intents/web_intents_registry.cc

Issue 8733004: Make ExtensionService use ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: + Created 9 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 | Annotate | Revision Log
OLDNEW
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/intents/web_intents_registry.h" 5 #include "chrome/browser/intents/web_intents_registry.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/webdata/web_data_service.h" 9 #include "chrome/browser/webdata/web_data_service.h"
10 #include "net/base/mime_util.h" 10 #include "net/base/mime_util.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 IntentsQuery* query(it->second); 75 IntentsQuery* query(it->second);
76 DCHECK(query); 76 DCHECK(query);
77 queries_.erase(it); 77 queries_.erase(it);
78 78
79 IntentServiceList matching_services = static_cast< 79 IntentServiceList matching_services = static_cast<
80 const WDResult<IntentServiceList>*>(result)->GetValue(); 80 const WDResult<IntentServiceList>*>(result)->GetValue();
81 81
82 // Loop over all intents in all extensions, collect ones matching the query. 82 // Loop over all intents in all extensions, collect ones matching the query.
83 if (extension_service_) { 83 if (extension_service_) {
84 const ExtensionList* extensions = extension_service_->extensions(); 84 const ExtensionSet* extensions = extension_service_->extensions();
85 if (extensions) { 85 if (extensions) {
86 for (ExtensionList::const_iterator i(extensions->begin()); 86 for (ExtensionSet::const_iterator i(extensions->begin());
87 i != extensions->end(); ++i) { 87 i != extensions->end(); ++i) {
88 const IntentServiceList& intents((*i)->intents_services()); 88 const IntentServiceList& intents((*i)->intents_services());
89 for (IntentServiceList::const_iterator j(intents.begin()); 89 for (IntentServiceList::const_iterator j(intents.begin());
90 j != intents.end(); ++j) { 90 j != intents.end(); ++j) {
91 if (query->action_.empty() || query->action_ == j->action) 91 if (query->action_.empty() || query->action_ == j->action)
92 matching_services.push_back(*j); 92 matching_services.push_back(*j);
93 } 93 }
94 } 94 }
95 } 95 }
96 } 96 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const WebIntentServiceData& service) { 190 const WebIntentServiceData& service) {
191 DCHECK(wds_.get()); 191 DCHECK(wds_.get());
192 wds_->AddWebIntentService(service); 192 wds_->AddWebIntentService(service);
193 } 193 }
194 194
195 void WebIntentsRegistry::UnregisterIntentProvider( 195 void WebIntentsRegistry::UnregisterIntentProvider(
196 const WebIntentServiceData& service) { 196 const WebIntentServiceData& service) {
197 DCHECK(wds_.get()); 197 DCHECK(wds_.get());
198 wds_->RemoveWebIntentService(service); 198 wds_->RemoveWebIntentService(service);
199 } 199 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/user_script_listener_unittest.cc ('k') | chrome/browser/intents/web_intents_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698