Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 2842653004: Add back Rect parcelable to onSmartClipDataExtracted. (Closed)
Patch Set: Avoid coordinate conversion Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.app.Activity; 9 import android.app.Activity;
10 import android.content.ComponentCallbacks2; 10 import android.content.ComponentCallbacks2;
(...skipping 2996 matching lines...) Expand 10 before | Expand all | Expand 10 after
3007 } 3007 }
3008 3008
3009 Log.e(TAG, "Unable to auto generate archive name for path: %s", baseName ); 3009 Log.e(TAG, "Unable to auto generate archive name for path: %s", baseName );
3010 return null; 3010 return null;
3011 } 3011 }
3012 3012
3013 @Override 3013 @Override
3014 public void extractSmartClipData(int x, int y, int width, int height) { 3014 public void extractSmartClipData(int x, int y, int width, int height) {
3015 float dpi = mContentViewCore.getRenderCoordinates().getDeviceScaleFactor (); 3015 float dpi = mContentViewCore.getRenderCoordinates().getDeviceScaleFactor ();
3016 if (!isDestroyedOrNoOperation(WARN)) { 3016 if (!isDestroyedOrNoOperation(WARN)) {
3017 mWebContents.requestSmartClipExtract( 3017 mWebContents.requestSmartClipExtract(new Rect(x, y, x + width, y + h eight),
David Trainor- moved to gerrit 2017/04/26 20:58:17 It looks like rect isn't scaled by dpi but the oth
3018 (int) (x / dpi), (int) (y / dpi), (int) (width / dpi), (int) (height / dpi)); 3018 (int) (x / dpi), (int) (y / dpi), (int) (width / dpi), (int) (height / dpi));
3019 } 3019 }
3020 } 3020 }
3021 3021
3022 @Override 3022 @Override
3023 public void setSmartClipResultHandler(final Handler resultHandler) { 3023 public void setSmartClipResultHandler(final Handler resultHandler) {
3024 if (isDestroyedOrNoOperation(WARN)) return; 3024 if (isDestroyedOrNoOperation(WARN)) return;
3025 3025
3026 mWebContents.setSmartClipResultHandler(resultHandler); 3026 mWebContents.setSmartClipResultHandler(resultHandler);
3027 } 3027 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
3483 3483
3484 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin, 3484 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin,
3485 long resources); 3485 long resources);
3486 3486
3487 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId, 3487 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId,
3488 String message, String targetOrigin, MessagePort[] ports); 3488 String message, String targetOrigin, MessagePort[] ports);
3489 3489
3490 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC ontents); 3490 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC ontents);
3491 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw Contents); 3491 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw Contents);
3492 } 3492 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698