Chromium Code Reviews| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 if (!result) { | 236 if (!result) { |
| 237 // Results are null if the database went away or (most likely) wasn't | 237 // Results are null if the database went away or (most likely) wasn't |
| 238 // loaded. | 238 // loaded. |
| 239 OnLoadFailed(); | 239 OnLoadFailed(); |
| 240 return; | 240 return; |
| 241 } | 241 } |
| 242 | 242 |
| 243 TemplateURL* default_search_provider = NULL; | 243 TemplateURL* default_search_provider = NULL; |
| 244 int new_resource_keyword_version = 0; | 244 int new_resource_keyword_version = 0; |
| 245 std::vector<TemplateURL*> extracted_template_urls; | 245 std::vector<TemplateURL*> extracted_template_urls; |
| 246 GetSearchProvidersUsingKeywordResult(*result, | 246 GetSearchProvidersUsingKeywordResult(*result, |
|
Peter Kasting
2012/05/15 21:28:10
Nit: This has so many arguments, feel free to cond
SteveT
2012/05/16 13:26:43
Done.
| |
| 247 NULL, | 247 NULL, |
| 248 NULL, | 248 NULL, |
| 249 &extracted_template_urls, | 249 &extracted_template_urls, |
| 250 &default_search_provider, | 250 &default_search_provider, |
| 251 &new_resource_keyword_version); | 251 &new_resource_keyword_version, |
| 252 NULL); | |
| 252 template_urls_.get().insert(template_urls_.get().begin(), | 253 template_urls_.get().insert(template_urls_.get().begin(), |
| 253 extracted_template_urls.begin(), | 254 extracted_template_urls.begin(), |
| 254 extracted_template_urls.end()); | 255 extracted_template_urls.end()); |
| 255 IOThreadSearchTermsData search_terms_data(google_base_url_); | 256 IOThreadSearchTermsData search_terms_data(google_base_url_); |
| 256 provider_map_.reset(new SearchHostToURLsMap()); | 257 provider_map_.reset(new SearchHostToURLsMap()); |
| 257 provider_map_->Init(template_urls_.get(), search_terms_data); | 258 provider_map_->Init(template_urls_.get(), search_terms_data); |
| 258 SetDefault(default_search_provider); | 259 SetDefault(default_search_provider); |
| 259 NotifyLoaded(); | 260 NotifyLoaded(); |
| 260 } | 261 } |
| 261 | 262 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 | 298 |
| 298 std::for_each(closure_queue.begin(), | 299 std::for_each(closure_queue.begin(), |
| 299 closure_queue.end(), | 300 closure_queue.end(), |
| 300 std::mem_fun_ref(&base::Closure::Run)); | 301 std::mem_fun_ref(&base::Closure::Run)); |
| 301 | 302 |
| 302 // Since we expect this request to be rare, clear out the information. This | 303 // Since we expect this request to be rare, clear out the information. This |
| 303 // also keeps the responses current as the search providers change. | 304 // also keeps the responses current as the search providers change. |
| 304 provider_map_.reset(); | 305 provider_map_.reset(); |
| 305 SetDefault(NULL); | 306 SetDefault(NULL); |
| 306 } | 307 } |
| OLD | NEW |