Index: chrome/browser/webdata/web_data_service.cc |
=================================================================== |
--- chrome/browser/webdata/web_data_service.cc (revision 130759) |
+++ chrome/browser/webdata/web_data_service.cc (working copy) |
@@ -72,7 +72,9 @@ |
WDKeywordsResult::WDKeywordsResult() |
: default_search_provider_id(0), |
- builtin_keyword_version(0) { |
+ builtin_keyword_version(0), |
+ backup_valid(false), |
+ did_default_search_provider_change(false) { |
} |
WDKeywordsResult::~WDKeywordsResult() {} |
@@ -152,14 +154,14 @@ |
// the TemplateURL for use on another keyword. |
url.EnsureKeyword(); |
GenericRequest<TemplateURL>* request = |
- new GenericRequest<TemplateURL>(this, GetNextRequestHandle(), NULL, url); |
+ new GenericRequest<TemplateURL>(this, GetNextRequestHandle(), NULL, url); |
RegisterRequest(request); |
ScheduleTask(FROM_HERE, Bind(&WebDataService::AddKeywordImpl, this, request)); |
} |
-void WebDataService::RemoveKeyword(const TemplateURL& url) { |
- GenericRequest<TemplateURLID>* request = new GenericRequest<TemplateURLID>( |
- this, GetNextRequestHandle(), NULL, url.id()); |
+void WebDataService::RemoveKeyword(TemplateURLID id) { |
+ GenericRequest<TemplateURLID>* request = |
+ new GenericRequest<TemplateURLID>(this, GetNextRequestHandle(), NULL, id); |
RegisterRequest(request); |
ScheduleTask(FROM_HERE, |
Bind(&WebDataService::RemoveKeywordImpl, this, request)); |
@@ -819,8 +821,7 @@ |
request->RequestComplete(); |
} |
-void WebDataService::RemoveKeywordImpl( |
- GenericRequest<TemplateURLID>* request) { |
+void WebDataService::RemoveKeywordImpl(GenericRequest<TemplateURLID>* request) { |
InitializeDatabaseIfNecessary(); |
if (db_ && !request->IsCancelled(NULL)) { |
DCHECK(request->arg()); |
@@ -853,10 +854,9 @@ |
db_->GetKeywordTable()->GetBuiltinKeywordVersion(); |
result.did_default_search_provider_change = |
db_->GetKeywordTable()->DidDefaultSearchProviderChange(); |
- result.default_search_provider_backup = |
- result.did_default_search_provider_change ? |
- db_->GetKeywordTable()->GetDefaultSearchProviderBackup() : |
- NULL; |
+ result.backup_valid = result.did_default_search_provider_change && |
+ db_->GetKeywordTable()->GetDefaultSearchProviderBackup( |
+ &result.default_search_provider_backup); |
request->SetResult( |
new WDResult<WDKeywordsResult>(KEYWORDS_RESULT, result)); |
} |