| Index: chrome/browser/webdata/web_intents_table.cc
|
| diff --git a/chrome/browser/webdata/web_intents_table.cc b/chrome/browser/webdata/web_intents_table.cc
|
| index 9be56b721d4a7a69de68032c443dc9460658ffb6..819bc6db721e7a70ddbe72007f3b41c97747daf5 100644
|
| --- a/chrome/browser/webdata/web_intents_table.cc
|
| +++ b/chrome/browser/webdata/web_intents_table.cc
|
| @@ -9,7 +9,10 @@
|
| #include "googleurl/src/gurl.h"
|
| #include "sql/statement.h"
|
|
|
| +using webkit_glue::WebIntentServiceData;
|
| +
|
| namespace {
|
| +
|
| bool ExtractIntents(sql::Statement* s,
|
| std::vector<WebIntentServiceData>* services) {
|
| DCHECK(s);
|
| @@ -30,7 +33,8 @@ bool ExtractIntents(sql::Statement* s,
|
| }
|
| return true;
|
| }
|
| -}
|
| +
|
| +} // namespace
|
|
|
| WebIntentsTable::WebIntentsTable(sql::Connection* db,
|
| sql::MetaTable* meta_table)
|
| @@ -67,8 +71,8 @@ bool WebIntentsTable::IsSyncable() {
|
|
|
| bool WebIntentsTable::GetWebIntents(
|
| const string16& action,
|
| - std::vector<WebIntentServiceData>* intents) {
|
| - DCHECK(intents);
|
| + std::vector<WebIntentServiceData>* services) {
|
| + DCHECK(services);
|
| sql::Statement s(db_->GetUniqueStatement(
|
| "SELECT service_url, action, type, title, disposition FROM web_intents "
|
| "WHERE action=?"));
|
| @@ -76,21 +80,21 @@ bool WebIntentsTable::GetWebIntents(
|
| NOTREACHED() << "Statement prepare failed";
|
|
|
| s.BindString16(0, action);
|
| - return ExtractIntents(&s, intents);
|
| + return ExtractIntents(&s, services);
|
| }
|
|
|
| bool WebIntentsTable::GetAllWebIntents(
|
| - std::vector<WebIntentServiceData>* intents) {
|
| - DCHECK(intents);
|
| + std::vector<WebIntentServiceData>* services) {
|
| + DCHECK(services);
|
| sql::Statement s(db_->GetUniqueStatement(
|
| "SELECT service_url, action, type, title, disposition FROM web_intents"));
|
| if (!s)
|
| NOTREACHED() << "Statement prepare failed";
|
|
|
| - return ExtractIntents(&s, intents);
|
| + return ExtractIntents(&s, services);
|
| }
|
|
|
| -bool WebIntentsTable::SetWebIntent(const WebIntentServiceData& intent) {
|
| +bool WebIntentsTable::SetWebIntent(const WebIntentServiceData& service) {
|
| sql::Statement s(db_->GetUniqueStatement(
|
| "INSERT OR REPLACE INTO web_intents "
|
| "(service_url, type, action, title, disposition) "
|
| @@ -100,28 +104,28 @@ bool WebIntentsTable::SetWebIntent(const WebIntentServiceData& intent) {
|
|
|
| // Default to window disposition.
|
| string16 disposition = ASCIIToUTF16("window");
|
| - if (intent.disposition == WebIntentServiceData::DISPOSITION_INLINE)
|
| + if (service.disposition == WebIntentServiceData::DISPOSITION_INLINE)
|
| disposition = ASCIIToUTF16("inline");
|
| - s.BindString(0, intent.service_url.spec());
|
| - s.BindString16(1, intent.type);
|
| - s.BindString16(2, intent.action);
|
| - s.BindString16(3, intent.title);
|
| + s.BindString(0, service.service_url.spec());
|
| + s.BindString16(1, service.type);
|
| + s.BindString16(2, service.action);
|
| + s.BindString16(3, service.title);
|
| s.BindString16(4, disposition);
|
| return s.Run();
|
| }
|
|
|
| // TODO(jhawkins): Investigate the need to remove rows matching only
|
| -// |intent.service_url|. It's unlikely the user will be given the ability to
|
| +// |service.service_url|. It's unlikely the user will be given the ability to
|
| // remove at the granularity of actions or types.
|
| -bool WebIntentsTable::RemoveWebIntent(const WebIntentServiceData& intent) {
|
| +bool WebIntentsTable::RemoveWebIntent(const WebIntentServiceData& service) {
|
| sql::Statement s(db_->GetUniqueStatement(
|
| "DELETE FROM web_intents "
|
| "WHERE service_url = ? AND action = ? AND type = ?"));
|
| if (!s)
|
| NOTREACHED() << "Statement prepare failed";
|
|
|
| - s.BindString(0, intent.service_url.spec());
|
| - s.BindString16(1, intent.action);
|
| - s.BindString16(2, intent.type);
|
| + s.BindString(0, service.service_url.spec());
|
| + s.BindString16(1, service.action);
|
| + s.BindString16(2, service.type);
|
| return s.Run();
|
| }
|
|
|