Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / content / public / android / java / src / org / chromium / content / browser / ContentVideoView.java
index a4be526..dc1d62b 100644 (file)
@@ -238,6 +238,11 @@ public class ContentVideoView extends FrameLayout
 
         mCurrentState = STATE_ERROR;
 
+        if (!isActivityContext(getContext())) {
+            Log.w(TAG, "Unable to show alert dialog because it requires an activity context");
+            return;
+        }
+
         /* Pop up an error dialog so the user knows that
          * something bad has happened. Only try and pop up the dialog
          * if we're attached to a window. When we're going away and no
@@ -432,6 +437,7 @@ public class ContentVideoView extends FrameLayout
         // an Activity, given that Activity is already a subclass of ContextWrapper.
         if (context instanceof ContextWrapper && !(context instanceof Activity)) {
             context = ((ContextWrapper) context).getBaseContext();
+            return isActivityContext(context);
         }
         return context instanceof Activity;
     }