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.browser; | 5 package org.chromium.content.browser; |
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.app.SearchManager; | 9 import android.app.SearchManager; |
10 import android.content.ContentResolver; | 10 import android.content.ContentResolver; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 * Called when page scale has been changed, so the controls can update t
heir state. | 199 * Called when page scale has been changed, so the controls can update t
heir state. |
200 */ | 200 */ |
201 void updateZoomControls(); | 201 void updateZoomControls(); |
202 } | 202 } |
203 | 203 |
204 /** | 204 /** |
205 * An interface that allows the embedder to be notified when the results of | 205 * An interface that allows the embedder to be notified when the results of |
206 * extractSmartClipData are available. | 206 * extractSmartClipData are available. |
207 */ | 207 */ |
208 public interface SmartClipDataListener { | 208 public interface SmartClipDataListener { |
209 public void onSmartClipDataExtracted(String result); | 209 public void onSmartClipDataExtracted(String result, Rect cliprect); |
210 } | 210 } |
211 | 211 |
212 private final Context mContext; | 212 private final Context mContext; |
213 private ViewGroup mContainerView; | 213 private ViewGroup mContainerView; |
214 private InternalAccessDelegate mContainerViewInternals; | 214 private InternalAccessDelegate mContainerViewInternals; |
215 private WebContents mWebContents; | 215 private WebContents mWebContents; |
216 private WebContentsObserverAndroid mWebContentsObserver; | 216 private WebContentsObserverAndroid mWebContentsObserver; |
217 | 217 |
218 private ContentViewClient mContentViewClient; | 218 private ContentViewClient mContentViewClient; |
219 | 219 |
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3010 return new Rect(x, y, right, bottom); | 3010 return new Rect(x, y, right, bottom); |
3011 } | 3011 } |
3012 | 3012 |
3013 public void extractSmartClipData(int x, int y, int width, int height) { | 3013 public void extractSmartClipData(int x, int y, int width, int height) { |
3014 if (mNativeContentViewCore != 0) { | 3014 if (mNativeContentViewCore != 0) { |
3015 nativeExtractSmartClipData(mNativeContentViewCore, x, y, width, heig
ht); | 3015 nativeExtractSmartClipData(mNativeContentViewCore, x, y, width, heig
ht); |
3016 } | 3016 } |
3017 } | 3017 } |
3018 | 3018 |
3019 @CalledByNative | 3019 @CalledByNative |
3020 private void onSmartClipDataExtracted(String result) { | 3020 private void onSmartClipDataExtracted(String result, Rect cliprect) { |
3021 if (mSmartClipDataListener != null ) { | 3021 if (mSmartClipDataListener != null ) { |
3022 mSmartClipDataListener.onSmartClipDataExtracted(result); | 3022 mSmartClipDataListener.onSmartClipDataExtracted(result, cliprect); |
3023 } | 3023 } |
3024 } | 3024 } |
3025 | 3025 |
3026 public void setSmartClipDataListener(SmartClipDataListener listener) { | 3026 public void setSmartClipDataListener(SmartClipDataListener listener) { |
3027 mSmartClipDataListener = listener; | 3027 mSmartClipDataListener = listener; |
3028 } | 3028 } |
3029 | 3029 |
3030 /** | 3030 /** |
3031 * Offer a long press gesture to the embedding View, primarily for WebView c
ompatibility. | 3031 * Offer a long press gesture to the embedding View, primarily for WebView c
ompatibility. |
3032 * | 3032 * |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3228 boolean enableHiding, boolean enableShowing, boolean animate); | 3228 boolean enableHiding, boolean enableShowing, boolean animate); |
3229 | 3229 |
3230 private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); | 3230 private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); |
3231 | 3231 |
3232 private native void nativeSetAccessibilityEnabled( | 3232 private native void nativeSetAccessibilityEnabled( |
3233 long nativeContentViewCoreImpl, boolean enabled); | 3233 long nativeContentViewCoreImpl, boolean enabled); |
3234 | 3234 |
3235 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3235 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
3236 int x, int y, int w, int h); | 3236 int x, int y, int w, int h); |
3237 } | 3237 } |
OLD | NEW |