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.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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |