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

Unified Diff: chrome/browser/webdata/web_data_service.cc

Issue 8144013: Add a check to the registry before the intent infobar is shown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More updates Created 9 years, 2 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/webdata/web_data_service.cc
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 00ce1c3114ec346a1647f214055335c09ce3703f..6b1caf5daec149a103ac27fae4530f50ccf2d6cf 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -260,8 +260,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,
James Hawkins 2011/10/29 21:41:32 Optional: You can save a line by moving |consumer|
Greg Billock 2011/10/31 17:07:09 I think when split having these long args one per
+ WebDataServiceConsumer* consumer) {
DCHECK(consumer);
GenericRequest<string16>* request = new GenericRequest<string16>(
this, GetNextRequestHandle(), consumer, action);
@@ -270,6 +271,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);
@@ -872,6 +885,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();

Powered by Google App Engine
This is Rietveld 408576698