| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 assert window != null; | 81 assert window != null; |
| 82 mWindow = window; | 82 mWindow = window; |
| 83 mContentViewRenderView = new ContentViewRenderView(getContext()) { | 83 mContentViewRenderView = new ContentViewRenderView(getContext()) { |
| 84 @Override | 84 @Override |
| 85 protected void onReadyToRender() { | 85 protected void onReadyToRender() { |
| 86 if (sStartup) { | 86 if (sStartup) { |
| 87 if (initialLoadingNeeded) mActiveShell.loadUrl(mStartupUrl); | 87 if (initialLoadingNeeded) mActiveShell.loadUrl(mStartupUrl); |
| 88 sStartup = false; | 88 sStartup = false; |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | |
| 92 @Override | |
| 93 protected void onWindowVisibilityChanged(int visibility) { | |
| 94 if (visibility == View.GONE && mActiveShell != null) { | |
| 95 ContentViewCore contentViewCore = mActiveShell.getContentVie
wCore(); | |
| 96 if (contentViewCore != null) contentViewCore.onHide(); | |
| 97 } | |
| 98 super.onWindowVisibilityChanged(visibility); | |
| 99 } | |
| 100 }; | 91 }; |
| 101 mContentViewRenderView.onNativeLibraryLoaded(window); | 92 mContentViewRenderView.onNativeLibraryLoaded(window); |
| 102 } | 93 } |
| 103 | 94 |
| 104 /** | 95 /** |
| 105 * @return The window used to generate all shells. | 96 * @return The window used to generate all shells. |
| 106 */ | 97 */ |
| 107 public WindowAndroid getWindow() { | 98 public WindowAndroid getWindow() { |
| 108 return mWindow; | 99 return mWindow; |
| 109 } | 100 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 if (shellView.getParent() == null) return; | 174 if (shellView.getParent() == null) return; |
| 184 ContentViewCore contentViewCore = shellView.getContentViewCore(); | 175 ContentViewCore contentViewCore = shellView.getContentViewCore(); |
| 185 if (contentViewCore != null) contentViewCore.onHide(); | 176 if (contentViewCore != null) contentViewCore.onHide(); |
| 186 shellView.setContentViewRenderView(null); | 177 shellView.setContentViewRenderView(null); |
| 187 removeView(shellView); | 178 removeView(shellView); |
| 188 } | 179 } |
| 189 | 180 |
| 190 private static native void nativeInit(Object shellManagerInstance); | 181 private static native void nativeInit(Object shellManagerInstance); |
| 191 private static native void nativeLaunchShell(String url); | 182 private static native void nativeLaunchShell(String url); |
| 192 } | 183 } |
| OLD | NEW |