OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file declares extension specific l10n utils. | 5 // This file declares extension specific l10n utils. |
6 | 6 |
7 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 7 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
8 #define CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 8 #define CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 class DictionaryValue; | |
16 class Extension; | 15 class Extension; |
17 class ExtensionMessageBundle; | 16 class ExtensionMessageBundle; |
18 class FilePath; | 17 class FilePath; |
19 class GURL; | 18 class GURL; |
20 class ResourceDispatcherHostRequestInfo; | 19 class ResourceDispatcherHostRequestInfo; |
21 struct ExtensionInfo; | 20 struct ExtensionInfo; |
22 | 21 |
22 namespace base { | |
23 class DictionaryValue; | |
24 } | |
25 | |
26 using base::DictionaryValue; | |
brettw
2011/07/07 16:05:08
We shouldn't have this in header files other than
dmazzoni
2011/07/07 22:57:00
Done.
| |
27 | |
23 namespace extension_l10n_util { | 28 namespace extension_l10n_util { |
24 | 29 |
25 // Set the locale for this process to a fixed value, rather than using the | 30 // Set the locale for this process to a fixed value, rather than using the |
26 // normal file-based lookup mechanisms. This is used to set the locale inside | 31 // normal file-based lookup mechanisms. This is used to set the locale inside |
27 // the sandboxed utility process, where file reading is not allowed. | 32 // the sandboxed utility process, where file reading is not allowed. |
28 void SetProcessLocale(const std::string& locale); | 33 void SetProcessLocale(const std::string& locale); |
29 | 34 |
30 // Returns default locale in form "en-US" or "sr" or empty string if | 35 // Returns default locale in form "en-US" or "sr" or empty string if |
31 // "default_locale" section was not defined in the manifest.json file. | 36 // "default_locale" section was not defined in the manifest.json file. |
32 std::string GetDefaultLocaleFromManifest(const DictionaryValue& manifest, | 37 std::string GetDefaultLocaleFromManifest(const DictionaryValue& manifest, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 // |locales_path| is extension_id/_locales | 99 // |locales_path| is extension_id/_locales |
95 // |locale_path| is extension_id/_locales/xx | 100 // |locale_path| is extension_id/_locales/xx |
96 // |all_locales| is a set of all valid Chrome locales. | 101 // |all_locales| is a set of all valid Chrome locales. |
97 bool ShouldSkipValidation(const FilePath& locales_path, | 102 bool ShouldSkipValidation(const FilePath& locales_path, |
98 const FilePath& locale_path, | 103 const FilePath& locale_path, |
99 const std::set<std::string>& all_locales); | 104 const std::set<std::string>& all_locales); |
100 | 105 |
101 } // namespace extension_l10n_util | 106 } // namespace extension_l10n_util |
102 | 107 |
103 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 108 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
OLD | NEW |