Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: extensions/common/extension_l10n_util.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « extensions/common/event_filter_unittest.cc ('k') | extensions/common/permissions/media_galleries_permission_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698