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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 static std::string InitSharedInstanceWithLocale( | 127 static std::string InitSharedInstanceWithLocale( |
128 const std::string& pref_locale, Delegate* delegate); | 128 const std::string& pref_locale, Delegate* delegate); |
129 | 129 |
130 // Same as InitSharedInstanceWithLocale(), but loads only localized resources, | 130 // Same as InitSharedInstanceWithLocale(), but loads only localized resources, |
131 // without default resource packs. | 131 // without default resource packs. |
132 static std::string InitSharedInstanceLocaleOnly( | 132 static std::string InitSharedInstanceLocaleOnly( |
133 const std::string& pref_locale, Delegate* delegate); | 133 const std::string& pref_locale, Delegate* delegate); |
134 | 134 |
135 // Initialize the ResourceBundle using the given file region. If |region| is | 135 // Initialize the ResourceBundle using the given file region. If |region| is |
136 // MemoryMappedFile::Region::kWholeFile, the entire |pak_file| is used. | 136 // MemoryMappedFile::Region::kWholeFile, the entire |pak_file| is used. |
137 // |should_load_common_resources| controls whether or not LoadCommonResources | |
138 // is called. | |
139 // This allows the use of this function in a sandbox without local file | 137 // This allows the use of this function in a sandbox without local file |
140 // access (as on Android). | 138 // access (as on Android). |
141 static void InitSharedInstanceWithPakFileRegion( | 139 static void InitSharedInstanceWithPakFileRegion( |
142 base::File pak_file, | 140 base::File pak_file, |
143 const base::MemoryMappedFile::Region& region, | 141 const base::MemoryMappedFile::Region& region); |
144 bool should_load_common_resources); | |
145 | 142 |
146 // Initialize the ResourceBundle using given data pack path for testing. | 143 // Initialize the ResourceBundle using given data pack path for testing. |
147 static void InitSharedInstanceWithPakPath(const base::FilePath& path); | 144 static void InitSharedInstanceWithPakPath(const base::FilePath& path); |
148 | 145 |
149 // Delete the ResourceBundle for this process if it exists. | 146 // Delete the ResourceBundle for this process if it exists. |
150 static void CleanupSharedInstance(); | 147 static void CleanupSharedInstance(); |
151 | 148 |
152 // Returns true after the global resource loader instance has been created. | 149 // Returns true after the global resource loader instance has been created. |
153 static bool HasSharedInstance(); | 150 static bool HasSharedInstance(); |
154 | 151 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 418 |
422 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); | 419 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); |
423 }; | 420 }; |
424 | 421 |
425 } // namespace ui | 422 } // namespace ui |
426 | 423 |
427 // TODO(beng): Someday, maybe, get rid of this. | 424 // TODO(beng): Someday, maybe, get rid of this. |
428 using ui::ResourceBundle; | 425 using ui::ResourceBundle; |
429 | 426 |
430 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ | 427 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ |
OLD | NEW |