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" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 WebDatabase* db) { | 125 WebDatabase* db) { |
126 scoped_ptr<WDTypedResult> result_ptr; | 126 scoped_ptr<WDTypedResult> result_ptr; |
127 WDKeywordsResult result; | 127 WDKeywordsResult result; |
128 if (KeywordTable::FromWebDatabase(db)->GetKeywords(&result.keywords)) { | 128 if (KeywordTable::FromWebDatabase(db)->GetKeywords(&result.keywords)) { |
129 result.default_search_provider_id = | 129 result.default_search_provider_id = |
130 KeywordTable::FromWebDatabase(db)->GetDefaultSearchProviderID(); | 130 KeywordTable::FromWebDatabase(db)->GetDefaultSearchProviderID(); |
131 result.builtin_keyword_version = | 131 result.builtin_keyword_version = |
132 KeywordTable::FromWebDatabase(db)->GetBuiltinKeywordVersion(); | 132 KeywordTable::FromWebDatabase(db)->GetBuiltinKeywordVersion(); |
133 result_ptr.reset(new WDResult<WDKeywordsResult>(KEYWORDS_RESULT, result)); | 133 result_ptr.reset(new WDResult<WDKeywordsResult>(KEYWORDS_RESULT, result)); |
134 } | 134 } |
135 return result_ptr.Pass(); | 135 return result_ptr; |
136 } | 136 } |
137 | 137 |
138 WebDatabase::State KeywordWebDataService::SetDefaultSearchProviderIDImpl( | 138 WebDatabase::State KeywordWebDataService::SetDefaultSearchProviderIDImpl( |
139 TemplateURLID id, | 139 TemplateURLID id, |
140 WebDatabase* db) { | 140 WebDatabase* db) { |
141 return KeywordTable::FromWebDatabase(db)->SetDefaultSearchProviderID(id) ? | 141 return KeywordTable::FromWebDatabase(db)->SetDefaultSearchProviderID(id) ? |
142 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; | 142 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; |
143 } | 143 } |
144 | 144 |
145 WebDatabase::State KeywordWebDataService::SetBuiltinKeywordVersionImpl( | 145 WebDatabase::State KeywordWebDataService::SetBuiltinKeywordVersionImpl( |
146 int version, | 146 int version, |
147 WebDatabase* db) { | 147 WebDatabase* db) { |
148 return KeywordTable::FromWebDatabase(db)->SetBuiltinKeywordVersion(version) ? | 148 return KeywordTable::FromWebDatabase(db)->SetBuiltinKeywordVersion(version) ? |
149 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; | 149 WebDatabase::COMMIT_NEEDED : WebDatabase::COMMIT_NOT_NEEDED; |
150 } | 150 } |
OLD | NEW |