| 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/common/extensions/extension_l10n_util.h" | 5 #include "chrome/common/extensions/extension_l10n_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
| 14 #include "base/json/json_file_value_serializer.h" | 14 #include "base/json/json_file_value_serializer.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/common/extensions/extension_file_util.h" | 19 #include "chrome/common/extensions/extension_file_util.h" |
| 20 #include "chrome/common/extensions/extension_manifest_constants.h" | 20 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 21 #include "chrome/common/extensions/message_bundle.h" | 21 #include "chrome/common/extensions/message_bundle.h" |
| 22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 23 #include "extensions/common/constants.h" | 23 #include "extensions/common/constants.h" |
| 24 #include "third_party/icu/source/common/unicode/uloc.h" | 24 #include "third_party/icu/source/common/unicode/uloc.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 | 26 |
| 27 namespace errors = extension_manifest_errors; | 27 namespace errors = extension_manifest_errors; |
| 28 namespace keys = extension_manifest_keys; | 28 namespace keys = extensions::manifest_keys; |
| 29 | 29 |
| 30 static std::string& GetProcessLocale() { | 30 static std::string& GetProcessLocale() { |
| 31 CR_DEFINE_STATIC_LOCAL(std::string, locale, ()); | 31 CR_DEFINE_STATIC_LOCAL(std::string, locale, ()); |
| 32 return locale; | 32 return locale; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace extension_l10n_util { | 35 namespace extension_l10n_util { |
| 36 | 36 |
| 37 void SetProcessLocale(const std::string& locale) { | 37 void SetProcessLocale(const std::string& locale) { |
| 38 GetProcessLocale() = locale; | 38 GetProcessLocale() = locale; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale) | 367 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale) |
| 368 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) { | 368 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) { |
| 369 extension_l10n_util::SetProcessLocale(locale); | 369 extension_l10n_util::SetProcessLocale(locale); |
| 370 } | 370 } |
| 371 | 371 |
| 372 ScopedLocaleForTest::~ScopedLocaleForTest() { | 372 ScopedLocaleForTest::~ScopedLocaleForTest() { |
| 373 extension_l10n_util::SetProcessLocale(locale_); | 373 extension_l10n_util::SetProcessLocale(locale_); |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace extension_l10n_util | 376 } // namespace extension_l10n_util |
| OLD | NEW |