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.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Configuration; | 8 import android.content.res.Configuration; |
9 import android.graphics.Rect; | 9 import android.graphics.Rect; |
10 import android.os.Build; | 10 import android.os.Build; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 super.onDetachedFromWindow(); | 294 super.onDetachedFromWindow(); |
295 mContentViewCore.onDetachedFromWindow(); | 295 mContentViewCore.onDetachedFromWindow(); |
296 } | 296 } |
297 | 297 |
298 // Implements SmartClipProvider | 298 // Implements SmartClipProvider |
299 @Override | 299 @Override |
300 public void extractSmartClipData(int x, int y, int width, int height) { | 300 public void extractSmartClipData(int x, int y, int width, int height) { |
301 float dpi = mContentViewCore.getRenderCoordinates().getDeviceScaleFactor
(); | 301 float dpi = mContentViewCore.getRenderCoordinates().getDeviceScaleFactor
(); |
302 y -= mContentViewCore.getRenderCoordinates().getContentOffsetYPix(); | 302 y -= mContentViewCore.getRenderCoordinates().getContentOffsetYPix(); |
303 mContentViewCore.getWebContents().requestSmartClipExtract( | 303 mContentViewCore.getWebContents().requestSmartClipExtract( |
304 (int) (x / dpi), (int) (y / dpi), (int) (width / dpi), (int) (he
ight / dpi)); | 304 new Rect(x, y, x + width, y + height), (int) (x / dpi), (int) (y
/ dpi), |
| 305 (int) (width / dpi), (int) (height / dpi)); |
305 } | 306 } |
306 | 307 |
307 // Implements SmartClipProvider | 308 // Implements SmartClipProvider |
308 @Override | 309 @Override |
309 public void setSmartClipResultHandler(final Handler resultHandler) { | 310 public void setSmartClipResultHandler(final Handler resultHandler) { |
310 mContentViewCore.getWebContents().setSmartClipResultHandler(resultHandle
r); | 311 mContentViewCore.getWebContents().setSmartClipResultHandler(resultHandle
r); |
311 } | 312 } |
312 | 313 |
313 ////////////////////////////////////////////////////////////////////////////
/////////////////// | 314 ////////////////////////////////////////////////////////////////////////////
/////////////////// |
314 // Start Implementation of ContentViewCore.InternalAccessDelega
te // | 315 // Start Implementation of ContentViewCore.InternalAccessDelega
te // |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 public ContentViewApi23(Context context, ContentViewCore cvc) { | 348 public ContentViewApi23(Context context, ContentViewCore cvc) { |
348 super(context, cvc); | 349 super(context, cvc); |
349 } | 350 } |
350 | 351 |
351 @Override | 352 @Override |
352 public void onProvideVirtualStructure(final ViewStructure structure) { | 353 public void onProvideVirtualStructure(final ViewStructure structure) { |
353 mContentViewCore.onProvideVirtualStructure(structure, false); | 354 mContentViewCore.onProvideVirtualStructure(structure, false); |
354 } | 355 } |
355 } | 356 } |
356 } | 357 } |
OLD | NEW |