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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java

Issue 2828353002: Android: Remove GetApplicationContext part 3 (Closed)
Patch Set: Fix android webview tests 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
Index: content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
index f4ad96f27339b7b7dbc915d8b9e2ec7845e807c3..e50d3b3ce1369a7e4398d105b655f236cdaff8f5 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
@@ -13,6 +13,7 @@ import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import org.chromium.base.ApiCompatibilityUtils;
+import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
@@ -67,8 +68,12 @@ public class HandleViewResources {
return drawable;
}
- private static Bitmap getHandleBitmap(Context context, final int[] attrs) {
+ private static Bitmap getHandleBitmap(Context activityContext, final int[] attrs) {
// TODO(jdduke): Properly derive and apply theme color.
+ Context context = activityContext;
+ if (context == null) {
+ context = ContextUtils.getApplicationContext();
+ }
TypedArray a = context.getTheme().obtainStyledAttributes(attrs);
final int resId = a.getResourceId(a.getIndex(0), 0);
final Resources res = a.getResources();

Powered by Google App Engine
This is Rietveld 408576698