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.content.Context; | 7 import android.content.Context; |
8 import android.util.AttributeSet; | 8 import android.util.AttributeSet; |
9 import android.view.LayoutInflater; | 9 import android.view.LayoutInflater; |
10 import android.widget.FrameLayout; | 10 import android.widget.FrameLayout; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 /** | 80 /** |
81 * Creates a new shell pointing to the specified URL. | 81 * Creates a new shell pointing to the specified URL. |
82 * @param url The URL the shell should load upon creation. | 82 * @param url The URL the shell should load upon creation. |
83 */ | 83 */ |
84 public void launchShell(String url) { | 84 public void launchShell(String url) { |
85 nativeLaunchShell(url); | 85 nativeLaunchShell(url); |
86 } | 86 } |
87 | 87 |
| 88 /** |
| 89 * Enter or leave overlay video mode. |
| 90 * @param enabled Whether overlay mode is enabled. |
| 91 */ |
| 92 public void setOverlayVideoMode(boolean enabled) { |
| 93 if (mContentViewRenderView == null) return; |
| 94 mContentViewRenderView.setOverlayVideoMode(enabled); |
| 95 } |
| 96 |
88 @SuppressWarnings("unused") | 97 @SuppressWarnings("unused") |
89 @CalledByNative | 98 @CalledByNative |
90 private Object createShell() { | 99 private Object createShell() { |
91 assert mContentViewRenderView != null; | 100 assert mContentViewRenderView != null; |
92 LayoutInflater inflater = | 101 LayoutInflater inflater = |
93 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN
FLATER_SERVICE); | 102 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN
FLATER_SERVICE); |
94 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); | 103 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); |
95 shellView.setWindow(mWindow); | 104 shellView.setWindow(mWindow); |
96 | 105 |
97 if (mActiveShell != null) closeShell(mActiveShell); | 106 if (mActiveShell != null) closeShell(mActiveShell); |
(...skipping 18 matching lines...) Expand all Loading... |
116 ContentView contentView = shellView.getContentView(); | 125 ContentView contentView = shellView.getContentView(); |
117 if (contentView != null) contentView.onHide(); | 126 if (contentView != null) contentView.onHide(); |
118 shellView.setContentViewRenderView(null); | 127 shellView.setContentViewRenderView(null); |
119 shellView.setWindow(null); | 128 shellView.setWindow(null); |
120 removeView(shellView); | 129 removeView(shellView); |
121 } | 130 } |
122 | 131 |
123 private static native void nativeInit(Object shellManagerInstance); | 132 private static native void nativeInit(Object shellManagerInstance); |
124 private static native void nativeLaunchShell(String url); | 133 private static native void nativeLaunchShell(String url); |
125 } | 134 } |
OLD | NEW |