Chromium Code Reviews| 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 onWindowHidden() { | |
|
David Trainor- moved to gerrit
2015/01/15 01:16:07
We should just use the other method IMO. Lets kee
Changwan Ryu
2015/01/15 01:51:34
Done.
| |
| 84 if (mActiveShell == null) return; | |
| 85 ContentViewCore contentViewCore = mActiveShell.getContentViewCor e(); | |
| 86 if (contentViewCore != null) contentViewCore.onHide(); | |
| 87 } | |
| 81 }; | 88 }; |
| 82 mContentViewRenderView.onNativeLibraryLoaded(window); | 89 mContentViewRenderView.onNativeLibraryLoaded(window); |
| 83 } | 90 } |
| 84 | 91 |
| 85 /** | 92 /** |
| 86 * @return The window used to generate all shells. | 93 * @return The window used to generate all shells. |
| 87 */ | 94 */ |
| 88 public WindowAndroid getWindow() { | 95 public WindowAndroid getWindow() { |
| 89 return mWindow; | 96 return mWindow; |
| 90 } | 97 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 if (shellView.getParent() == null) return; | 164 if (shellView.getParent() == null) return; |
| 158 ContentViewCore contentViewCore = shellView.getContentViewCore(); | 165 ContentViewCore contentViewCore = shellView.getContentViewCore(); |
| 159 if (contentViewCore != null) contentViewCore.onHide(); | 166 if (contentViewCore != null) contentViewCore.onHide(); |
| 160 shellView.setContentViewRenderView(null); | 167 shellView.setContentViewRenderView(null); |
| 161 removeView(shellView); | 168 removeView(shellView); |
| 162 } | 169 } |
| 163 | 170 |
| 164 private static native void nativeInit(Object shellManagerInstance); | 171 private static native void nativeInit(Object shellManagerInstance); |
| 165 private static native void nativeLaunchShell(String url); | 172 private static native void nativeLaunchShell(String url); |
| 166 } | 173 } |
| OLD | NEW |