| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.content_shell; | 5 package org.chromium.content_shell; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.util.AttributeSet; | 9 import android.util.AttributeSet; |
| 10 import android.view.LayoutInflater; | 10 import android.view.LayoutInflater; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 public ShellManager(final Context context, AttributeSet attrs) { | 46 public ShellManager(final Context context, AttributeSet attrs) { |
| 47 super(context, attrs); | 47 super(context, attrs); |
| 48 nativeInit(this); | 48 nativeInit(this); |
| 49 mContentViewClient = new ContentViewClient() { | 49 mContentViewClient = new ContentViewClient() { |
| 50 @Override | 50 @Override |
| 51 public ContentVideoViewClient getContentVideoViewClient() { | 51 public ContentVideoViewClient getContentVideoViewClient() { |
| 52 return new ActivityContentVideoViewClient((Activity) context) { | 52 return new ActivityContentVideoViewClient((Activity) context) { |
| 53 @Override | 53 @Override |
| 54 public void onShowCustomView(View view) { | 54 public void onShowCustomView(View view) { |
| 55 super.onShowCustomView(view); | 55 super.onShowCustomView(view); |
| 56 if (CommandLine.getInstance().hasSwitch( | 56 if (!CommandLine.getInstance().hasSwitch( |
| 57 ContentSwitches.ENABLE_OVERLAY_FULLSCREEN_VIDEO_
SUBTITLE)) { | 57 ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO
_SUBTITLE)) { |
| 58 setOverlayVideoMode(true); | 58 setOverlayVideoMode(true); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 @Override | 62 @Override |
| 63 public void onDestroyContentVideoView() { | 63 public void onDestroyContentVideoView() { |
| 64 super.onDestroyContentVideoView(); | 64 super.onDestroyContentVideoView(); |
| 65 if (CommandLine.getInstance().hasSwitch( | 65 if (!CommandLine.getInstance().hasSwitch( |
| 66 ContentSwitches.ENABLE_OVERLAY_FULLSCREEN_VIDEO_
SUBTITLE)) { | 66 ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO
_SUBTITLE)) { |
| 67 setOverlayVideoMode(false); | 67 setOverlayVideoMode(false); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 }; | 70 }; |
| 71 } | 71 } |
| 72 }; | 72 }; |
| 73 } | 73 } |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * @param window The window used to generate all shells. | 76 * @param window The window used to generate all shells. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 if (shellView.getParent() == null) return; | 164 if (shellView.getParent() == null) return; |
| 165 ContentView contentView = shellView.getContentView(); | 165 ContentView contentView = shellView.getContentView(); |
| 166 if (contentView != null) contentView.onHide(); | 166 if (contentView != null) contentView.onHide(); |
| 167 shellView.setContentViewRenderView(null); | 167 shellView.setContentViewRenderView(null); |
| 168 removeView(shellView); | 168 removeView(shellView); |
| 169 } | 169 } |
| 170 | 170 |
| 171 private static native void nativeInit(Object shellManagerInstance); | 171 private static native void nativeInit(Object shellManagerInstance); |
| 172 private static native void nativeLaunchShell(String url); | 172 private static native void nativeLaunchShell(String url); |
| 173 } | 173 } |
| OLD | NEW |