OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/search_engines/search_provider_install_data.h" | 5 #include "chrome/browser/search_engines/search_provider_install_data.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 if (!result) { | 238 if (!result) { |
239 // Results are null if the database went away or (most likely) wasn't | 239 // Results are null if the database went away or (most likely) wasn't |
240 // loaded. | 240 // loaded. |
241 OnLoadFailed(); | 241 OnLoadFailed(); |
242 return; | 242 return; |
243 } | 243 } |
244 | 244 |
245 TemplateURL* default_search_provider = NULL; | 245 TemplateURL* default_search_provider = NULL; |
246 int new_resource_keyword_version = 0; | 246 int new_resource_keyword_version = 0; |
247 std::vector<TemplateURL*> extracted_template_urls; | 247 std::vector<TemplateURL*> extracted_template_urls; |
248 GetSearchProvidersUsingKeywordResult(*result, | 248 GetSearchProvidersUsingKeywordResult(*result, NULL, NULL, |
249 NULL, | 249 &extracted_template_urls, &default_search_provider, |
250 NULL, | 250 &new_resource_keyword_version, NULL); |
251 &extracted_template_urls, | |
252 &default_search_provider, | |
253 &new_resource_keyword_version); | |
254 template_urls_.get().insert(template_urls_.get().begin(), | 251 template_urls_.get().insert(template_urls_.get().begin(), |
255 extracted_template_urls.begin(), | 252 extracted_template_urls.begin(), |
256 extracted_template_urls.end()); | 253 extracted_template_urls.end()); |
257 IOThreadSearchTermsData search_terms_data(google_base_url_); | 254 IOThreadSearchTermsData search_terms_data(google_base_url_); |
258 provider_map_.reset(new SearchHostToURLsMap()); | 255 provider_map_.reset(new SearchHostToURLsMap()); |
259 provider_map_->Init(template_urls_.get(), search_terms_data); | 256 provider_map_->Init(template_urls_.get(), search_terms_data); |
260 SetDefault(default_search_provider); | 257 SetDefault(default_search_provider); |
261 NotifyLoaded(); | 258 NotifyLoaded(); |
262 } | 259 } |
263 | 260 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 296 |
300 std::for_each(closure_queue.begin(), | 297 std::for_each(closure_queue.begin(), |
301 closure_queue.end(), | 298 closure_queue.end(), |
302 std::mem_fun_ref(&base::Closure::Run)); | 299 std::mem_fun_ref(&base::Closure::Run)); |
303 | 300 |
304 // Since we expect this request to be rare, clear out the information. This | 301 // Since we expect this request to be rare, clear out the information. This |
305 // also keeps the responses current as the search providers change. | 302 // also keeps the responses current as the search providers change. |
306 provider_map_.reset(); | 303 provider_map_.reset(); |
307 SetDefault(NULL); | 304 SetDefault(NULL); |
308 } | 305 } |
OLD | NEW |