OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 9 |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
| 14 #include "webkit/glue/resource_type.h" |
| 15 |
14 class DictionaryValue; | 16 class DictionaryValue; |
15 class Extension; | 17 class Extension; |
16 class ExtensionMessageBundle; | 18 class ExtensionMessageBundle; |
17 class FilePath; | 19 class FilePath; |
| 20 class GURL; |
| 21 class ResourceDispatcherHostRequestInfo; |
18 struct ExtensionInfo; | 22 struct ExtensionInfo; |
19 | 23 |
20 namespace extension_l10n_util { | 24 namespace extension_l10n_util { |
21 | 25 |
22 // Set the locale for this process to a fixed value, rather than using the | 26 // Set the locale for this process to a fixed value, rather than using the |
23 // normal file-based lookup mechanisms. This is used to set the locale inside | 27 // normal file-based lookup mechanisms. This is used to set the locale inside |
24 // the sandboxed utility process, where file reading is not allowed. | 28 // the sandboxed utility process, where file reading is not allowed. |
25 void SetProcessLocale(const std::string& locale); | 29 void SetProcessLocale(const std::string& locale); |
26 | 30 |
27 // Returns default locale in form "en-US" or "sr" or empty string if | 31 // Returns default locale in form "en-US" or "sr" or empty string if |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // parents. | 88 // parents. |
85 // Returns message bundle if it can load default locale messages file, and all | 89 // Returns message bundle if it can load default locale messages file, and all |
86 // messages are valid, else returns NULL and sets error. | 90 // messages are valid, else returns NULL and sets error. |
87 ExtensionMessageBundle* LoadMessageCatalogs( | 91 ExtensionMessageBundle* LoadMessageCatalogs( |
88 const FilePath& locale_path, | 92 const FilePath& locale_path, |
89 const std::string& default_locale, | 93 const std::string& default_locale, |
90 const std::string& app_locale, | 94 const std::string& app_locale, |
91 const std::set<std::string>& valid_locales, | 95 const std::set<std::string>& valid_locales, |
92 std::string* error); | 96 std::string* error); |
93 | 97 |
| 98 // Applies FilterPolicy::FILTER_EXTENSION_MESSAGES to all text/css requests |
| 99 // that have "chrome-extension://" scheme. |
| 100 void ApplyMessageFilterPolicy(const GURL& url, |
| 101 const ResourceType::Type& resource_type, |
| 102 ResourceDispatcherHostRequestInfo* request_info); |
| 103 |
94 } // namespace extension_l10n_util | 104 } // namespace extension_l10n_util |
95 | 105 |
96 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ | 106 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_L10N_UTIL_H_ |
OLD | NEW |