Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: ui/base/resource/resource_bundle.cc

Issue 2845163006: Android: Add version suffix to extracted .pak files (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/java/src/org/chromium/base/ResourceExtractor.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.cc
diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc
index 03ab51f52ceb656de3b75a232353bff5e4bd2e82..1a24b13c6108c7b236e0df9640138b06856bab64 100644
--- a/ui/base/resource/resource_bundle.cc
+++ b/ui/base/resource/resource_bundle.cc
@@ -44,6 +44,7 @@
#include "ui/strings/grit/app_locale_settings.h"
#if defined(OS_ANDROID)
+#include "base/android/build_info.h"
#include "ui/base/resource/resource_bundle_android.h"
#endif
@@ -66,7 +67,7 @@ const unsigned char kPngScaleChunkType[4] = { 'c', 's', 'C', 'l' };
const unsigned char kPngDataChunkType[4] = { 'I', 'D', 'A', 'T' };
#if !defined(OS_MACOSX)
-const char kPakFileSuffix[] = ".pak";
+const char kPakFileExtension[] = ".pak";
#endif
ResourceBundle* g_shared_instance_ = NULL;
@@ -304,8 +305,22 @@ base::FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale,
PathService::Get(ui::DIR_LOCALES, &locale_file_path);
if (!locale_file_path.empty()) {
+#if defined(OS_ANDROID)
+ if (locale_file_path.value().find("chromium_tests") == std::string::npos) {
+ std::string extracted_file_suffix =
+ base::android::BuildInfo::GetInstance()->extracted_file_suffix();
+ locale_file_path = locale_file_path.AppendASCII(
+ app_locale + kPakFileExtension + extracted_file_suffix);
+ } else {
+ // TODO(agrieve): Update tests to not side-load pak files and remove
+ // this special-case. https://crbug.com/691719
+ locale_file_path =
+ locale_file_path.AppendASCII(app_locale + kPakFileExtension);
+ }
+#else
locale_file_path =
- locale_file_path.AppendASCII(app_locale + kPakFileSuffix);
+ locale_file_path.AppendASCII(app_locale + kPakFileExtension);
+#endif
}
if (delegate_) {
« no previous file with comments | « base/android/java/src/org/chromium/base/ResourceExtractor.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698