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

Side by Side Diff: ui/android/java/src/org/chromium/ui/base/ResourceBundle.java

Issue 2890813002: Separate WebView's locale paks from Chrome's locale paks (Closed)
Patch Set: renaming "stored" Created 3 years, 7 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 unified diff | Download patch
« chrome/android/BUILD.gn ('K') | « chrome/chrome_paks.gni ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 package org.chromium.ui.base; 5 package org.chromium.ui.base;
6 6
7 import android.util.DisplayMetrics; 7 import android.util.DisplayMetrics;
8 import android.view.Display; 8 import android.view.Display;
9 9
10 import org.chromium.base.BuildConfig; 10 import org.chromium.base.BuildConfig;
11 import org.chromium.base.ContextUtils; 11 import org.chromium.base.ContextUtils;
12 import org.chromium.base.annotations.CalledByNative; 12 import org.chromium.base.annotations.CalledByNative;
13 import org.chromium.base.annotations.JNINamespace; 13 import org.chromium.base.annotations.JNINamespace;
14 import org.chromium.ui.display.DisplayAndroidManager; 14 import org.chromium.ui.display.DisplayAndroidManager;
15 15
16 import java.util.Arrays; 16 import java.util.Arrays;
17 17
18 /** 18 /**
19 * This class provides the resource bundle related methods for the native 19 * This class provides the resource bundle related methods for the native
20 * library. 20 * library.
21 */ 21 */
22 @JNINamespace("ui") 22 @JNINamespace("ui")
23 final class ResourceBundle { 23 final class ResourceBundle {
24 private ResourceBundle() {} 24 private ResourceBundle() {}
25 25
26 @CalledByNative 26 @CalledByNative
27 private static String getLocalePakResourcePath(String locale) { 27 private static String getLocalePakResourcePath(String locale) {
28 if (Arrays.binarySearch(BuildConfig.UNCOMPRESSED_LOCALES, locale) >= 0) { 28 if (Arrays.binarySearch(BuildConfig.UNCOMPRESSED_LOCALES,
29 return "assets/" + locale + ".pak"; 29 "stored-locales/" + locale) >= 0) {
30 return "assets/stored-locales/" + locale + ".pak";
30 } 31 }
31 return null; 32 return null;
32 } 33 }
33 34
34 @CalledByNative 35 @CalledByNative
35 private static float getPrimaryDisplayScale() { 36 private static float getPrimaryDisplayScale() {
36 Display primaryDisplay = DisplayAndroidManager.getDefaultDisplayForConte xt( 37 Display primaryDisplay = DisplayAndroidManager.getDefaultDisplayForConte xt(
37 ContextUtils.getApplicationContext()); 38 ContextUtils.getApplicationContext());
38 DisplayMetrics displayMetrics = new DisplayMetrics(); 39 DisplayMetrics displayMetrics = new DisplayMetrics();
39 primaryDisplay.getMetrics(displayMetrics); 40 primaryDisplay.getMetrics(displayMetrics);
40 return displayMetrics.density; 41 return displayMetrics.density;
41 } 42 }
42 } 43 }
OLDNEW
« chrome/android/BUILD.gn ('K') | « chrome/chrome_paks.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698