Index: chrome/browser/webdata/web_data_service.cc |
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc |
index d451fca137cd21d1fcfde2ab6464bb3543e1955d..4fb8b889f0dfc4438d93d9fc18031c79ff7470b6 100644 |
--- a/chrome/browser/webdata/web_data_service.cc |
+++ b/chrome/browser/webdata/web_data_service.cc |
@@ -264,8 +264,9 @@ void WebDataService::RemoveWebIntent(const WebIntentServiceData& service) { |
ScheduleTask(Bind(&WebDataService::RemoveWebIntentImpl, this, request)); |
} |
-WebDataService::Handle WebDataService::GetWebIntents(const string16& action, |
- WebDataServiceConsumer* consumer) { |
+WebDataService::Handle WebDataService::GetWebIntents( |
+ const string16& action, |
+ WebDataServiceConsumer* consumer) { |
DCHECK(consumer); |
GenericRequest<string16>* request = new GenericRequest<string16>( |
this, GetNextRequestHandle(), consumer, action); |
@@ -274,6 +275,18 @@ WebDataService::Handle WebDataService::GetWebIntents(const string16& action, |
return request->GetHandle(); |
} |
+WebDataService::Handle WebDataService::GetWebIntentsForURL( |
+ const string16& service_url, |
+ WebDataServiceConsumer* consumer) { |
+ DCHECK(consumer); |
+ GenericRequest<string16>* request = new GenericRequest<string16>( |
+ this, GetNextRequestHandle(), consumer, service_url); |
+ RegisterRequest(request); |
+ ScheduleTask(Bind(&WebDataService::GetWebIntentsForURLImpl, this, request)); |
+ return request->GetHandle(); |
+} |
+ |
+ |
WebDataService::Handle WebDataService::GetAllWebIntents( |
WebDataServiceConsumer* consumer) { |
DCHECK(consumer); |
@@ -884,6 +897,20 @@ void WebDataService::GetWebIntentsImpl(GenericRequest<string16>* request) { |
request->RequestComplete(); |
} |
+void WebDataService::GetWebIntentsForURLImpl( |
+ GenericRequest<string16>* request) { |
+ InitializeDatabaseIfNecessary(); |
+ if (db_ && !request->IsCancelled(NULL)) { |
+ std::vector<WebIntentServiceData> result; |
+ db_->GetWebIntentsTable()->GetWebIntentsForURL( |
+ request->arg(), &result); |
+ request->SetResult( |
+ new WDResult<std::vector<WebIntentServiceData> >( |
+ WEB_INTENTS_RESULT, result)); |
+ } |
+ request->RequestComplete(); |
+} |
+ |
void WebDataService::GetAllWebIntentsImpl( |
GenericRequest<std::string>* request) { |
InitializeDatabaseIfNecessary(); |