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 2994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3005 testName = baseName + name + "-" + i + WEB_ARCHIVE_EXTENSION; | 3005 testName = baseName + name + "-" + i + WEB_ARCHIVE_EXTENSION; |
3006 if (!new File(testName).exists()) return testName; | 3006 if (!new File(testName).exists()) return testName; |
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
(); | |
3016 if (!isDestroyedOrNoOperation(WARN)) { | 3015 if (!isDestroyedOrNoOperation(WARN)) { |
3017 mWebContents.requestSmartClipExtract( | 3016 mWebContents.requestSmartClipExtract( |
3018 (int) (x / dpi), (int) (y / dpi), (int) (width / dpi), (int)
(height / dpi)); | 3017 x, y, width, height, mContentViewCore.getRenderCoordinates()
); |
3019 } | 3018 } |
3020 } | 3019 } |
3021 | 3020 |
3022 @Override | 3021 @Override |
3023 public void setSmartClipResultHandler(final Handler resultHandler) { | 3022 public void setSmartClipResultHandler(final Handler resultHandler) { |
3024 if (isDestroyedOrNoOperation(WARN)) return; | 3023 if (isDestroyedOrNoOperation(WARN)) return; |
3025 | 3024 |
3026 mWebContents.setSmartClipResultHandler(resultHandler); | 3025 mWebContents.setSmartClipResultHandler(resultHandler); |
3027 } | 3026 } |
3028 | 3027 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3483 | 3482 |
3484 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, | 3483 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, |
3485 long resources); | 3484 long resources); |
3486 | 3485 |
3487 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, | 3486 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, |
3488 String message, String targetOrigin, MessagePort[] ports); | 3487 String message, String targetOrigin, MessagePort[] ports); |
3489 | 3488 |
3490 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); | 3489 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); |
3491 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); | 3490 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); |
3492 } | 3491 } |
OLD | NEW |