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.android_webview; | 5 package org.chromium.android_webview; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2554 mContext.registerComponentCallbacks(mComponentCallbacks); | 2554 mContext.registerComponentCallbacks(mComponentCallbacks); |
2555 } | 2555 } |
2556 | 2556 |
2557 @Override | 2557 @Override |
2558 public void onDetachedFromWindow() { | 2558 public void onDetachedFromWindow() { |
2559 if (isDestroyed()) return; | 2559 if (isDestroyed()) return; |
2560 if (!mIsAttachedToWindow) { | 2560 if (!mIsAttachedToWindow) { |
2561 Log.w(TAG, "onDetachedFromWindow called when already detached. I gnoring"); | 2561 Log.w(TAG, "onDetachedFromWindow called when already detached. I gnoring"); |
2562 return; | 2562 return; |
2563 } | 2563 } |
2564 mNativeGLDelegate.detachGLFunctor(); | |
boliu
2015/02/12 19:42:43
As discussed, this should be moved to invalidateOn
boliu
2015/02/13 01:33:28
Since we might want to cherry-pick this back, do t
| |
2565 | |
2564 mIsAttachedToWindow = false; | 2566 mIsAttachedToWindow = false; |
2565 hideAutofillPopup(); | 2567 hideAutofillPopup(); |
2566 nativeOnDetachedFromWindow(mNativeAwContents); | 2568 nativeOnDetachedFromWindow(mNativeAwContents); |
2567 | 2569 |
2568 mContentViewCore.onDetachedFromWindow(); | 2570 mContentViewCore.onDetachedFromWindow(); |
2569 updateHardwareAcceleratedFeaturesToggle(); | 2571 updateHardwareAcceleratedFeaturesToggle(); |
2570 | 2572 |
2571 if (mComponentCallbacks != null) { | 2573 if (mComponentCallbacks != null) { |
2572 mContext.unregisterComponentCallbacks(mComponentCallbacks); | 2574 mContext.unregisterComponentCallbacks(mComponentCallbacks); |
2573 mComponentCallbacks = null; | 2575 mComponentCallbacks = null; |
2574 } | 2576 } |
2575 | 2577 |
2576 mScrollAccessibilityHelper.removePostedCallbacks(); | 2578 mScrollAccessibilityHelper.removePostedCallbacks(); |
2577 mNativeGLDelegate.detachGLFunctor(); | |
2578 } | 2579 } |
2579 | 2580 |
2580 @Override | 2581 @Override |
2581 public void onWindowFocusChanged(boolean hasWindowFocus) { | 2582 public void onWindowFocusChanged(boolean hasWindowFocus) { |
2582 if (isDestroyed()) return; | 2583 if (isDestroyed()) return; |
2583 mWindowFocused = hasWindowFocus; | 2584 mWindowFocused = hasWindowFocus; |
2584 mContentViewCore.onWindowFocusChanged(hasWindowFocus); | 2585 mContentViewCore.onWindowFocusChanged(hasWindowFocus); |
2585 } | 2586 } |
2586 | 2587 |
2587 @Override | 2588 @Override |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2761 | 2762 |
2762 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin, | 2763 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin, |
2763 long resources); | 2764 long resources); |
2764 | 2765 |
2765 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId, | 2766 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId, |
2766 String message, String sourceOrigin, String targetOrigin, int[] msgP orts); | 2767 String message, String sourceOrigin, String targetOrigin, int[] msgP orts); |
2767 | 2768 |
2768 private native void nativeCreateMessageChannel(long nativeAwContents, | 2769 private native void nativeCreateMessageChannel(long nativeAwContents, |
2769 ValueCallback<MessagePort[]> callback); | 2770 ValueCallback<MessagePort[]> callback); |
2770 } | 2771 } |
OLD | NEW |