| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.drawable.ClipDrawable; | 8 import android.graphics.drawable.ClipDrawable; |
| 9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
| 10 import android.util.AttributeSet; | 10 import android.util.AttributeSet; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 */ | 97 */ |
| 98 public void close() { | 98 public void close() { |
| 99 if (mNativeShell == 0) return; | 99 if (mNativeShell == 0) return; |
| 100 nativeCloseShell(mNativeShell); | 100 nativeCloseShell(mNativeShell); |
| 101 } | 101 } |
| 102 | 102 |
| 103 @CalledByNative | 103 @CalledByNative |
| 104 private void onNativeDestroyed() { | 104 private void onNativeDestroyed() { |
| 105 mWindow = null; | 105 mWindow = null; |
| 106 mNativeShell = 0; | 106 mNativeShell = 0; |
| 107 assert !mContentView.isAttachedToWindow() | |
| 108 : "Attempting to destroy the content view while attached to the
view hierarchy."; | |
| 109 mContentView.destroy(); | 107 mContentView.destroy(); |
| 110 } | 108 } |
| 111 | 109 |
| 112 /** | 110 /** |
| 113 * @return Whether the Shell has been destroyed. | 111 * @return Whether the Shell has been destroyed. |
| 114 * @see #onNativeDestroyed() | 112 * @see #onNativeDestroyed() |
| 115 */ | 113 */ |
| 116 public boolean isDestroyed() { | 114 public boolean isDestroyed() { |
| 117 return mNativeShell == 0; | 115 return mNativeShell == 0; |
| 118 } | 116 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 Context.INPUT_METHOD_SERVICE); | 267 Context.INPUT_METHOD_SERVICE); |
| 270 if (visible) { | 268 if (visible) { |
| 271 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); | 269 imm.showSoftInput(mUrlTextView, InputMethodManager.SHOW_IMPLICIT); |
| 272 } else { | 270 } else { |
| 273 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); | 271 imm.hideSoftInputFromWindow(mUrlTextView.getWindowToken(), 0); |
| 274 } | 272 } |
| 275 } | 273 } |
| 276 | 274 |
| 277 private static native void nativeCloseShell(long shellPtr); | 275 private static native void nativeCloseShell(long shellPtr); |
| 278 } | 276 } |
| OLD | NEW |