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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 778183002: [android_webview] Correctly handle ContextWrapper in AwContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 6 years 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 | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 7f0dc03d2026e3d4c13a1ea271a648e167713bd2..d1fd6ce614507f429982fb4a27ce6be237137a1a 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -811,8 +811,9 @@ public class AwContents implements SmartClipProvider {
long nativeWebContents = nativeGetWebContents(mNativeAwContents);
- mWindowAndroid = mContext instanceof Activity
- ? new ActivityWindowAndroid((Activity) mContext)
+ Activity activity = ContentViewCore.activityFromContext(mContext);
+ mWindowAndroid = activity != null
+ ? new ActivityWindowAndroid(activity)
: new WindowAndroid(mContext.getApplicationContext());
mContentViewCore = createAndInitializeContentViewCore(
mContainerView, mContext, mInternalAccessAdapter, nativeWebContents,
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698