Chromium Code Reviews| 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.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.content.res.Configuration; | 7 import android.content.res.Configuration; |
| 8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
| 10 import android.graphics.Color; | 10 import android.graphics.Color; |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 953 @CalledByNative | 953 @CalledByNative |
| 954 private void invalidate() { | 954 private void invalidate() { |
| 955 mContainerView.invalidate(); | 955 mContainerView.invalidate(); |
| 956 } | 956 } |
| 957 | 957 |
| 958 @CalledByNative | 958 @CalledByNative |
| 959 private boolean performLongClick() { | 959 private boolean performLongClick() { |
| 960 return mContainerView.performLongClick(); | 960 return mContainerView.performLongClick(); |
| 961 } | 961 } |
| 962 | 962 |
| 963 @CalledByNative | |
| 964 private boolean isAttachedToViewHierarchy() { | |
|
joth
2013/03/08 23:23:46
shouldn't need this method: we already pushed the
mnaganov (inactive)
2013/03/11 14:39:20
Right. When I first tried using these notification
| |
| 965 if (mContainerView.getWindowToken() == null) { | |
| 966 // Not attached to a window. | |
| 967 return false; | |
| 968 } | |
| 969 // Verify that the whole subtree containing the view is attached. | |
| 970 View parent = mContainerView; | |
| 971 while (parent.getParent() != null && parent.getParent() instanceof View) { | |
| 972 parent = (View) parent.getParent(); | |
| 973 } | |
| 974 return parent == mContainerView.getRootView(); | |
| 975 } | |
| 976 | |
| 977 @CalledByNative | |
| 978 private int[] getLocationOnScreen() { | |
| 979 int[] result = new int[2]; | |
| 980 mContainerView.getLocationOnScreen(result); | |
| 981 return result; | |
| 982 } | |
| 983 | |
| 963 // ------------------------------------------------------------------------- ------------------ | 984 // ------------------------------------------------------------------------- ------------------ |
| 964 // Helper methods | 985 // Helper methods |
| 965 // ------------------------------------------------------------------------- ------------------ | 986 // ------------------------------------------------------------------------- ------------------ |
| 966 | 987 |
| 967 private void saveWebArchiveInternal(String path, final ValueCallback<String> callback) { | 988 private void saveWebArchiveInternal(String path, final ValueCallback<String> callback) { |
| 968 if (path == null || mNativeAwContents == 0) { | 989 if (path == null || mNativeAwContents == 0) { |
| 969 ThreadUtils.runOnUiThread(new Runnable() { | 990 ThreadUtils.runOnUiThread(new Runnable() { |
| 970 @Override | 991 @Override |
| 971 public void run() { | 992 public void run() { |
| 972 callback.onReceiveValue(null); | 993 callback.onReceiveValue(null); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1087 private native boolean nativeDrawSW(int nativeAwContents, Canvas canvas, int clipX, int clipY, | 1108 private native boolean nativeDrawSW(int nativeAwContents, Canvas canvas, int clipX, int clipY, |
| 1088 int clipW, int clipH); | 1109 int clipW, int clipH); |
| 1089 private native int nativeGetAwDrawGLViewContext(int nativeAwContents); | 1110 private native int nativeGetAwDrawGLViewContext(int nativeAwContents); |
| 1090 private native Picture nativeCapturePicture(int nativeAwContents); | 1111 private native Picture nativeCapturePicture(int nativeAwContents); |
| 1091 private native void nativeEnableOnNewPicture(int nativeAwContents, boolean e nabled, | 1112 private native void nativeEnableOnNewPicture(int nativeAwContents, boolean e nabled, |
| 1092 boolean invalidationOnly); | 1113 boolean invalidationOnly); |
| 1093 | 1114 |
| 1094 private native void nativeInvokeGeolocationCallback( | 1115 private native void nativeInvokeGeolocationCallback( |
| 1095 int nativeAwContents, boolean value, String requestingFrame); | 1116 int nativeAwContents, boolean value, String requestingFrame); |
| 1096 } | 1117 } |
| OLD | NEW |