| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |