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 "extensions/common/extension_l10n_util.h" | 5 #include "extensions/common/extension_l10n_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 std::string* error) { | 85 std::string* error) { |
86 base::ListValue* list = NULL; | 86 base::ListValue* list = NULL; |
87 if (!manifest->GetList(key, &list)) | 87 if (!manifest->GetList(key, &list)) |
88 return true; | 88 return true; |
89 | 89 |
90 bool ret = true; | 90 bool ret = true; |
91 for (size_t i = 0; i < list->GetSize(); ++i) { | 91 for (size_t i = 0; i < list->GetSize(); ++i) { |
92 std::string result; | 92 std::string result; |
93 if (list->GetString(i, &result)) { | 93 if (list->GetString(i, &result)) { |
94 if (messages.ReplaceMessages(&result, error)) | 94 if (messages.ReplaceMessages(&result, error)) |
95 list->Set(i, new base::StringValue(result)); | 95 list->Set(i, new base::Value(result)); |
96 else | 96 else |
97 ret = false; | 97 ret = false; |
98 } | 98 } |
99 } | 99 } |
100 return ret; | 100 return ret; |
101 } | 101 } |
102 | 102 |
103 std::string& GetProcessLocale() { | 103 std::string& GetProcessLocale() { |
104 CR_DEFINE_STATIC_LOCAL(std::string, locale, ()); | 104 CR_DEFINE_STATIC_LOCAL(std::string, locale, ()); |
105 return locale; | 105 return locale; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale) | 458 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale) |
459 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) { | 459 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) { |
460 extension_l10n_util::SetProcessLocale(locale); | 460 extension_l10n_util::SetProcessLocale(locale); |
461 } | 461 } |
462 | 462 |
463 ScopedLocaleForTest::~ScopedLocaleForTest() { | 463 ScopedLocaleForTest::~ScopedLocaleForTest() { |
464 extension_l10n_util::SetProcessLocale(locale_); | 464 extension_l10n_util::SetProcessLocale(locale_); |
465 } | 465 } |
466 | 466 |
467 } // namespace extension_l10n_util | 467 } // namespace extension_l10n_util |
OLD | NEW |