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

Unified Diff: chrome/browser/intents/web_intents_registry.cc

Issue 10838004: Support for loading all default intent services. Necessary to allow editing of defaults from settin… (Closed) Base URL: http://git.chromium.org/chromium/src.git@newreg
Patch Set: Support for selecting all defaults via WebIntentsRegistry. Necessary for editing of defaults in set… Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/intents/web_intents_registry.cc
diff --git a/chrome/browser/intents/web_intents_registry.cc b/chrome/browser/intents/web_intents_registry.cc
index 9669528c4e9621ebcb0f81d4954cb6a5a1c55a42..34153b1e1a5e73ccf29dddabb3c04b06c982166e 100644
--- a/chrome/browser/intents/web_intents_registry.cc
+++ b/chrome/browser/intents/web_intents_registry.cc
@@ -265,6 +265,19 @@ void WebIntentsRegistry::OnWebIntentsResultReceived(
callback.Run(matching_services);
}
+void WebIntentsRegistry::OnAllDefaultIntentServicesReceived(
+ const DefaultIntentServicesCallback& callback,
+ const WDTypedResult* result) {
+ DCHECK(result);
+ DCHECK(result->GetType() == WEB_INTENTS_DEFAULTS_RESULT);
+
+ const std::vector<DefaultWebIntentService> services = static_cast<
+ const WDResult<std::vector<DefaultWebIntentService> >*>(result)->
+ GetValue();
+
+ callback.Run(services);
+}
+
void WebIntentsRegistry::OnWebIntentsDefaultsResultReceived(
const QueryParams& params,
const DefaultQueryCallback& callback,
@@ -359,6 +372,20 @@ void WebIntentsRegistry::GetAllIntentServices(
query->query_handle_ = wds_->GetAllWebIntentServices(query);
}
+void WebIntentsRegistry::GetAllDefaultIntentServices(
+ const DefaultIntentServicesCallback& callback) {
+ DCHECK(!callback.is_null());
+
+ ResultsHandler handler = base::Bind(
+ &WebIntentsRegistry::OnAllDefaultIntentServicesReceived,
+ base::Unretained(this),
+ callback);
+
+ QueryAdapter* query = new QueryAdapter(this, handler);
+ query->query_handle_ =
+ wds_->GetAllDefaultWebIntentServices(query);
+}
+
void WebIntentsRegistry::IntentServiceExists(
const WebIntentServiceData& service,
const base::Callback<void(bool)>& callback) {

Powered by Google App Engine
This is Rietveld 408576698