| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 assert window != null; | 71 assert window != null; |
| 72 mWindow = window; | 72 mWindow = window; |
| 73 mContentViewRenderView = new ContentViewRenderView(getContext()) { | 73 mContentViewRenderView = new ContentViewRenderView(getContext()) { |
| 74 @Override | 74 @Override |
| 75 protected void onReadyToRender() { | 75 protected void onReadyToRender() { |
| 76 if (sStartup) { | 76 if (sStartup) { |
| 77 mActiveShell.loadUrl(mStartupUrl); | 77 mActiveShell.loadUrl(mStartupUrl); |
| 78 sStartup = false; | 78 sStartup = false; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 |
| 82 @Override |
| 83 protected void onWindowVisibilityChanged(int visibility) { |
| 84 if (visibility == View.GONE && mActiveShell != null) { |
| 85 ContentViewCore contentViewCore = mActiveShell.getContentVie
wCore(); |
| 86 if (contentViewCore != null) contentViewCore.onHide(); |
| 87 } |
| 88 super.onWindowVisibilityChanged(visibility); |
| 89 } |
| 81 }; | 90 }; |
| 82 mContentViewRenderView.onNativeLibraryLoaded(window); | 91 mContentViewRenderView.onNativeLibraryLoaded(window); |
| 83 } | 92 } |
| 84 | 93 |
| 85 /** | 94 /** |
| 86 * @return The window used to generate all shells. | 95 * @return The window used to generate all shells. |
| 87 */ | 96 */ |
| 88 public WindowAndroid getWindow() { | 97 public WindowAndroid getWindow() { |
| 89 return mWindow; | 98 return mWindow; |
| 90 } | 99 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 if (shellView.getParent() == null) return; | 166 if (shellView.getParent() == null) return; |
| 158 ContentViewCore contentViewCore = shellView.getContentViewCore(); | 167 ContentViewCore contentViewCore = shellView.getContentViewCore(); |
| 159 if (contentViewCore != null) contentViewCore.onHide(); | 168 if (contentViewCore != null) contentViewCore.onHide(); |
| 160 shellView.setContentViewRenderView(null); | 169 shellView.setContentViewRenderView(null); |
| 161 removeView(shellView); | 170 removeView(shellView); |
| 162 } | 171 } |
| 163 | 172 |
| 164 private static native void nativeInit(Object shellManagerInstance); | 173 private static native void nativeInit(Object shellManagerInstance); |
| 165 private static native void nativeLaunchShell(String url); | 174 private static native void nativeLaunchShell(String url); |
| 166 } | 175 } |
| OLD | NEW |