Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_ | 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_ |
| 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_ | 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/files/memory_mapped_file.h" | 12 #include "base/files/memory_mapped_file.h" |
| 13 #include "ui/base/ui_base_export.h" | 13 #include "ui/base/ui_base_export.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 // Loads "resources.apk" from the .apk. | 17 // Loads "resources.apk" from the .apk. |
| 18 UI_BASE_EXPORT void LoadMainAndroidPackFile(); | 18 UI_BASE_EXPORT void LoadMainAndroidPackFile(); |
| 19 | 19 |
| 20 // Returns the file descriptor and region for resources.pak. | 20 // Returns the file descriptor and region for resources.pak. |
| 21 UI_BASE_EXPORT int GetMainAndroidPackFd( | 21 UI_BASE_EXPORT int GetMainAndroidPackFd( |
| 22 base::MemoryMappedFile::Region* out_region); | 22 base::MemoryMappedFile::Region* out_region); |
| 23 | 23 |
| 24 // Returns the file descriptor and region for chrome_100_percent.pak | 24 // Returns the file descriptor and region for chrome_100_percent.pak. |
| 25 UI_BASE_EXPORT int GetCommonResourcesPackFd( | 25 UI_BASE_EXPORT int GetCommonResourcesPackFd( |
| 26 base::MemoryMappedFile::Region* out_region); | 26 base::MemoryMappedFile::Region* out_region); |
| 27 | 27 |
| 28 // Returns the file descriptor and region for the locale .pak file. | |
| 29 UI_BASE_EXPORT int GetLocalePackFd( | |
| 30 base::MemoryMappedFile::Region* out_region); | |
| 31 | |
| 28 // Tell ResourceBundle to locate locale pak files via | 32 // Tell ResourceBundle to locate locale pak files via |
| 29 // GetPathForAndroidLocalePakWithinApk rather than looking for them on disk. | 33 // GetPathForAndroidLocalePakWithinApk rather than looking for them on disk. |
| 30 UI_BASE_EXPORT void SetLocalePaksStoredInApk(bool value); | 34 UI_BASE_EXPORT void SetLocalePaksStoredInApk(bool value); |
| 31 | 35 |
| 36 // Returns whether ResourceBundle will look for locale paks within the apk. | |
| 37 UI_BASE_EXPORT bool GetLocalePaksStoredInApk(); | |
|
sadrul
2015/06/23 08:34:06
This doesn't seem to be actually used?
agrieve
2015/06/23 15:33:57
Good eye. Deleted.
| |
| 38 | |
| 32 // Returns the path within the apk for the given locale's .pak file, or an | 39 // Returns the path within the apk for the given locale's .pak file, or an |
| 33 // empty string if it doesn't exist. | 40 // empty string if it doesn't exist. |
| 34 // Only locale paks for the active Android language can be retrieved. | 41 // Only locale paks for the active Android language can be retrieved. |
| 35 UI_BASE_EXPORT std::string GetPathForAndroidLocalePakWithinApk( | 42 UI_BASE_EXPORT std::string GetPathForAndroidLocalePakWithinApk( |
| 36 const std::string& locale); | 43 const std::string& locale); |
| 37 | 44 |
| 38 bool RegisterResourceBundleAndroid(JNIEnv* env); | 45 bool RegisterResourceBundleAndroid(JNIEnv* env); |
| 39 | 46 |
| 40 } // namespace ui | 47 } // namespace ui |
| 41 | 48 |
| 42 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_ | 49 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_ANDROID_H_ |
| OLD | NEW |