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/template_url_prepopulate_data.h" | 5 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
6 | 6 |
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
8 #include <locale.h> | 8 #include <locale.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3357 string16 keyword; | 3357 string16 keyword; |
3358 std::string search_url; | 3358 std::string search_url; |
3359 std::string suggest_url; | 3359 std::string suggest_url; |
3360 std::string instant_url; | 3360 std::string instant_url; |
3361 std::string favicon_url; | 3361 std::string favicon_url; |
3362 std::string encoding; | 3362 std::string encoding; |
3363 int id; | 3363 int id; |
3364 | 3364 |
3365 size_t num_engines = list->GetSize(); | 3365 size_t num_engines = list->GetSize(); |
3366 for (size_t i = 0; i != num_engines; ++i) { | 3366 for (size_t i = 0; i != num_engines; ++i) { |
3367 Value* val; | 3367 const Value* val; |
3368 DictionaryValue* engine; | 3368 const DictionaryValue* engine; |
3369 if (list->GetDictionary(i, &engine) && | 3369 if (list->GetDictionary(i, &engine) && |
3370 engine->Get("name", &val) && val->GetAsString(&name) && | 3370 engine->Get("name", &val) && val->GetAsString(&name) && |
3371 engine->Get("keyword", &val) && val->GetAsString(&keyword) && | 3371 engine->Get("keyword", &val) && val->GetAsString(&keyword) && |
3372 engine->Get("search_url", &val) && val->GetAsString(&search_url) && | 3372 engine->Get("search_url", &val) && val->GetAsString(&search_url) && |
3373 engine->Get("suggest_url", &val) && val->GetAsString(&suggest_url) && | 3373 engine->Get("suggest_url", &val) && val->GetAsString(&suggest_url) && |
3374 engine->Get("instant_url", &val) && val->GetAsString(&instant_url) && | 3374 engine->Get("instant_url", &val) && val->GetAsString(&instant_url) && |
3375 engine->Get("favicon_url", &val) && val->GetAsString(&favicon_url) && | 3375 engine->Get("favicon_url", &val) && val->GetAsString(&favicon_url) && |
3376 engine->Get("encoding", &val) && val->GetAsString(&encoding) && | 3376 engine->Get("encoding", &val) && val->GetAsString(&encoding) && |
3377 engine->Get("id", &val) && val->GetAsInteger(&id)) { | 3377 engine->Get("id", &val) && val->GetAsInteger(&id)) { |
3378 // These next fields are not allowed to be empty. | 3378 // These next fields are not allowed to be empty. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3479 g_country_code_at_install = kCountryIDUnknown; | 3479 g_country_code_at_install = kCountryIDUnknown; |
3480 } else { | 3480 } else { |
3481 g_country_code_at_install = | 3481 g_country_code_at_install = |
3482 CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]); | 3482 CountryCharsToCountryIDWithUpdate(country_code[0], country_code[1]); |
3483 } | 3483 } |
3484 } | 3484 } |
3485 | 3485 |
3486 #endif | 3486 #endif |
3487 | 3487 |
3488 } // namespace TemplateURLPrepopulateData | 3488 } // namespace TemplateURLPrepopulateData |
OLD | NEW |