Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 } | 77 } |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Creates a new shell pointing to the specified URL. | 80 * Creates a new shell pointing to the specified URL. |
| 81 * @param url The URL the shell should load upon creation. | 81 * @param url The URL the shell should load upon creation. |
| 82 */ | 82 */ |
| 83 public void launchShell(String url) { | 83 public void launchShell(String url) { |
| 84 nativeLaunchShell(url); | 84 nativeLaunchShell(url); |
| 85 } | 85 } |
| 86 | 86 |
| 87 /** | |
| 88 * Enter or leave overlay video mode. | |
| 89 */ | |
| 90 public void setOverlayVideoMode(boolean enabled) { | |
| 91 if (mContentViewRenderView == null) | |
|
Ted C
2013/09/30 15:54:36
In java land, braces are always required on condit
| |
| 92 return; | |
| 93 mContentViewRenderView.setOverlayVideoMode(enabled); | |
| 94 } | |
| 95 | |
| 87 @SuppressWarnings("unused") | 96 @SuppressWarnings("unused") |
| 88 @CalledByNative | 97 @CalledByNative |
| 89 private Object createShell() { | 98 private Object createShell() { |
| 90 LayoutInflater inflater = | 99 LayoutInflater inflater = |
| 91 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN FLATER_SERVICE); | 100 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN FLATER_SERVICE); |
| 92 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); | 101 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); |
| 93 shellView.setWindow(mWindow); | 102 shellView.setWindow(mWindow); |
| 94 | 103 |
| 95 if (mActiveShell != null) closeShell(mActiveShell); | 104 if (mActiveShell != null) closeShell(mActiveShell); |
| 96 | 105 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 114 ContentView contentView = shellView.getContentView(); | 123 ContentView contentView = shellView.getContentView(); |
| 115 if (contentView != null) contentView.onHide(); | 124 if (contentView != null) contentView.onHide(); |
| 116 shellView.setContentViewRenderView(null); | 125 shellView.setContentViewRenderView(null); |
| 117 shellView.setWindow(null); | 126 shellView.setWindow(null); |
| 118 removeView(shellView); | 127 removeView(shellView); |
| 119 } | 128 } |
| 120 | 129 |
| 121 private static native void nativeInit(Object shellManagerInstance); | 130 private static native void nativeInit(Object shellManagerInstance); |
| 122 private static native void nativeLaunchShell(String url); | 131 private static native void nativeLaunchShell(String url); |
| 123 } | 132 } |
| OLD | NEW |