| 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/util.h" | 5 #include "chrome/browser/search_engines/util.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 Profile* profile, | 242 Profile* profile, |
| 243 TemplateURLService::TemplateURLVector* template_urls, | 243 TemplateURLService::TemplateURLVector* template_urls, |
| 244 TemplateURL** default_search_provider, | 244 TemplateURL** default_search_provider, |
| 245 int* new_resource_keyword_version, | 245 int* new_resource_keyword_version, |
| 246 std::set<std::string>* removed_keyword_guids) { | 246 std::set<std::string>* removed_keyword_guids) { |
| 247 DCHECK(service == NULL || BrowserThread::CurrentlyOn(BrowserThread::UI)); | 247 DCHECK(service == NULL || BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 248 DCHECK(template_urls); | 248 DCHECK(template_urls); |
| 249 DCHECK(template_urls->empty()); | 249 DCHECK(template_urls->empty()); |
| 250 DCHECK(default_search_provider); | 250 DCHECK(default_search_provider); |
| 251 DCHECK(*default_search_provider == NULL); | 251 DCHECK(*default_search_provider == NULL); |
| 252 DCHECK_EQ(result.GetType(), KEYWORDS_RESULT); | 252 DCHECK_EQ(KEYWORDS_RESULT, result.GetType()); |
| 253 DCHECK(new_resource_keyword_version); | 253 DCHECK(new_resource_keyword_version); |
| 254 | 254 |
| 255 *new_resource_keyword_version = 0; | 255 *new_resource_keyword_version = 0; |
| 256 WDKeywordsResult keyword_result = reinterpret_cast< | 256 WDKeywordsResult keyword_result = reinterpret_cast< |
| 257 const WDResult<WDKeywordsResult>*>(&result)->GetValue(); | 257 const WDResult<WDKeywordsResult>*>(&result)->GetValue(); |
| 258 | 258 |
| 259 for (KeywordTable::Keywords::const_iterator i( | 259 for (KeywordTable::Keywords::const_iterator i( |
| 260 keyword_result.keywords.begin()); i != keyword_result.keywords.end(); | 260 keyword_result.keywords.begin()); i != keyword_result.keywords.end(); |
| 261 ++i) | 261 ++i) |
| 262 template_urls->push_back(new TemplateURL(profile, *i)); | 262 template_urls->push_back(new TemplateURL(profile, *i)); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 if (!keyword_result.did_default_search_provider_change) | 300 if (!keyword_result.did_default_search_provider_change) |
| 301 return false; | 301 return false; |
| 302 | 302 |
| 303 if (keyword_result.backup_valid) { | 303 if (keyword_result.backup_valid) { |
| 304 backup_default_search_provider->reset(new TemplateURL(profile, | 304 backup_default_search_provider->reset(new TemplateURL(profile, |
| 305 keyword_result.default_search_provider_backup)); | 305 keyword_result.default_search_provider_backup)); |
| 306 } | 306 } |
| 307 return true; | 307 return true; |
| 308 } | 308 } |
| OLD | NEW |