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.view.Surface; | 10 import android.view.Surface; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 @SuppressWarnings("unused") | 80 @SuppressWarnings("unused") |
81 @CalledByNative | 81 @CalledByNative |
82 private Object createShell() { | 82 private Object createShell() { |
83 LayoutInflater inflater = | 83 LayoutInflater inflater = |
84 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN
FLATER_SERVICE); | 84 (LayoutInflater) getContext().getSystemService(Context.LAYOUT_IN
FLATER_SERVICE); |
85 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); | 85 Shell shellView = (Shell) inflater.inflate(R.layout.shell_view, null); |
86 shellView.setSurfaceView(mSurfaceView); | 86 shellView.setSurfaceView(mSurfaceView); |
87 | 87 |
88 removeAllViews(); | 88 removeAllViews(); |
| 89 if (mActiveShell != null && mActiveShell.getContentView() != null) { |
| 90 mActiveShell.getContentView().onHide(); |
| 91 } |
| 92 |
89 addView(shellView, new FrameLayout.LayoutParams( | 93 addView(shellView, new FrameLayout.LayoutParams( |
90 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.
MATCH_PARENT)); | 94 FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.
MATCH_PARENT)); |
91 mActiveShell = shellView; | 95 mActiveShell = shellView; |
| 96 if (mActiveShell.getContentView() != null) mActiveShell.getContentView()
.onShow(); |
92 | 97 |
93 return shellView; | 98 return shellView; |
94 } | 99 } |
95 | 100 |
96 private static native void nativeInit(Object shellManagerInstance); | 101 private static native void nativeInit(Object shellManagerInstance); |
97 private static native void nativeLaunchShell(String url); | 102 private static native void nativeLaunchShell(String url); |
98 private static native void nativeSurfaceCreated(Surface surface); | 103 private static native void nativeSurfaceCreated(Surface surface); |
99 private static native void nativeSurfaceDestroyed(); | 104 private static native void nativeSurfaceDestroyed(); |
100 private static native void nativeSurfaceSetSize(int width, int height); | 105 private static native void nativeSurfaceSetSize(int width, int height); |
101 } | 106 } |
OLD | NEW |