| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/search_engines/keyword_web_data_service.h" | 5 #include "components/search_engines/keyword_web_data_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "components/search_engines/keyword_table.h" | 10 #include "components/search_engines/keyword_table.h" |
| 11 #include "components/search_engines/template_url_data.h" | 11 #include "components/search_engines/template_url_data.h" |
| 12 #include "components/webdata/common/web_data_results.h" | 12 #include "components/webdata/common/web_data_results.h" |
| 13 #include "components/webdata/common/web_database_service.h" | 13 #include "components/webdata/common/web_database_service.h" |
| 14 | 14 |
| 15 using base::Bind; | 15 using base::Bind; |
| 16 | 16 |
| 17 WDKeywordsResult::WDKeywordsResult() | 17 WDKeywordsResult::WDKeywordsResult() |
| 18 : default_search_provider_id(0), | 18 : default_search_provider_id(0), |
| 19 builtin_keyword_version(0) { | 19 builtin_keyword_version(0) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 WDKeywordsResult::WDKeywordsResult(const WDKeywordsResult& other) = default; |
| 23 |
| 22 WDKeywordsResult::~WDKeywordsResult() {} | 24 WDKeywordsResult::~WDKeywordsResult() {} |
| 23 | 25 |
| 24 KeywordWebDataService::BatchModeScoper::BatchModeScoper( | 26 KeywordWebDataService::BatchModeScoper::BatchModeScoper( |
| 25 KeywordWebDataService* service) | 27 KeywordWebDataService* service) |
| 26 : service_(service) { | 28 : service_(service) { |
| 27 if (service_) | 29 if (service_) |
| 28 service_->AdjustBatchModeLevel(true); | 30 service_->AdjustBatchModeLevel(true); |
| 29 } | 31 } |
| 30 | 32 |
| 31 KeywordWebDataService::BatchModeScoper::~BatchModeScoper() { | 33 KeywordWebDataService::BatchModeScoper::~BatchModeScoper() { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 return KeywordTable::FromWebDatabase(db)->SetDefaultSearchProviderID(id) ? | 143 return KeywordTable::FromWebDatabase(db)->SetDefaultSearchProviderID(id) ? |
| 142 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; | 144 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; |
| 143 } | 145 } |
| 144 | 146 |
| 145 WebDatabase::State KeywordWebDataService::SetBuiltinKeywordVersionImpl( | 147 WebDatabase::State KeywordWebDataService::SetBuiltinKeywordVersionImpl( |
| 146 int version, | 148 int version, |
| 147 WebDatabase* db) { | 149 WebDatabase* db) { |
| 148 return KeywordTable::FromWebDatabase(db)->SetBuiltinKeywordVersion(version) ? | 150 return KeywordTable::FromWebDatabase(db)->SetBuiltinKeywordVersion(version) ? |
| 149 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; | 151 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; |
| 150 } | 152 } |
| OLD | NEW |