OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
11 import android.graphics.Canvas; | 11 import android.graphics.Canvas; |
12 import android.graphics.Rect; | 12 import android.graphics.Rect; |
13 import android.os.Build; | 13 import android.os.Build; |
14 import android.util.AttributeSet; | 14 import android.util.AttributeSet; |
15 import android.view.KeyEvent; | 15 import android.view.KeyEvent; |
16 import android.view.MotionEvent; | 16 import android.view.MotionEvent; |
17 import android.view.View; | 17 import android.view.View; |
18 import android.view.accessibility.AccessibilityEvent; | 18 import android.view.accessibility.AccessibilityEvent; |
19 import android.view.accessibility.AccessibilityNodeInfo; | 19 import android.view.accessibility.AccessibilityNodeInfo; |
| 20 import android.view.accessibility.AccessibilityNodeProvider; |
20 import android.view.inputmethod.EditorInfo; | 21 import android.view.inputmethod.EditorInfo; |
21 import android.view.inputmethod.InputConnection; | 22 import android.view.inputmethod.InputConnection; |
22 import android.widget.FrameLayout; | 23 import android.widget.FrameLayout; |
23 | 24 |
24 import com.google.common.annotations.VisibleForTesting; | 25 import com.google.common.annotations.VisibleForTesting; |
25 | 26 |
26 import org.chromium.content.common.TraceEvent; | 27 import org.chromium.content.common.TraceEvent; |
27 import org.chromium.ui.WindowAndroid; | 28 import org.chromium.ui.WindowAndroid; |
28 | 29 |
29 /** | 30 /** |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 boolean consumed = mContentViewCore.onHoverEvent(offset); | 488 boolean consumed = mContentViewCore.onHoverEvent(offset); |
488 offset.recycle(); | 489 offset.recycle(); |
489 return consumed; | 490 return consumed; |
490 } | 491 } |
491 | 492 |
492 @Override | 493 @Override |
493 public boolean onGenericMotionEvent(MotionEvent event) { | 494 public boolean onGenericMotionEvent(MotionEvent event) { |
494 return mContentViewCore.onGenericMotionEvent(event); | 495 return mContentViewCore.onGenericMotionEvent(event); |
495 } | 496 } |
496 | 497 |
| 498 @Override |
| 499 public boolean dispatchHoverEvent(MotionEvent event) { |
| 500 if (mContentViewCore.dispatchHoverEvent(event)) { |
| 501 return true; |
| 502 } |
| 503 return super.dispatchHoverEvent(event); |
| 504 } |
| 505 |
497 /** | 506 /** |
498 * Sets the current amount to offset incoming touch events by. This is used
to handle content | 507 * Sets the current amount to offset incoming touch events by. This is used
to handle content |
499 * moving and not lining up properly with the android input system. | 508 * moving and not lining up properly with the android input system. |
500 * @param dx The X offset in pixels to shift touch events. | 509 * @param dx The X offset in pixels to shift touch events. |
501 * @param dy The Y offset in pixels to shift touch events. | 510 * @param dy The Y offset in pixels to shift touch events. |
502 */ | 511 */ |
503 public void setCurrentMotionEventOffsets(float dx, float dy) { | 512 public void setCurrentMotionEventOffsets(float dx, float dy) { |
504 mCurrentTouchOffsetX = dx; | 513 mCurrentTouchOffsetX = dx; |
505 mCurrentTouchOffsetY = dy; | 514 mCurrentTouchOffsetY = dy; |
506 } | 515 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 587 |
579 public int getSingleTapX() { | 588 public int getSingleTapX() { |
580 return mContentViewCore.getContentViewGestureHandler().getSingleTapX(); | 589 return mContentViewCore.getContentViewGestureHandler().getSingleTapX(); |
581 } | 590 } |
582 | 591 |
583 public int getSingleTapY() { | 592 public int getSingleTapY() { |
584 return mContentViewCore.getContentViewGestureHandler().getSingleTapY(); | 593 return mContentViewCore.getContentViewGestureHandler().getSingleTapY(); |
585 } | 594 } |
586 | 595 |
587 @Override | 596 @Override |
| 597 public AccessibilityNodeProvider getAccessibilityNodeProvider() { |
| 598 AccessibilityNodeProvider provider = mContentViewCore.getAccessibilityNo
deProvider(); |
| 599 if (provider != null) |
| 600 return provider; |
| 601 else |
| 602 return super.getAccessibilityNodeProvider(); |
| 603 } |
| 604 |
| 605 @Override |
588 public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { | 606 public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { |
589 super.onInitializeAccessibilityNodeInfo(info); | 607 super.onInitializeAccessibilityNodeInfo(info); |
590 mContentViewCore.onInitializeAccessibilityNodeInfo(info); | 608 mContentViewCore.onInitializeAccessibilityNodeInfo(info); |
591 } | 609 } |
592 | 610 |
593 /** | 611 /** |
594 * Fills in scrolling values for AccessibilityEvents. | 612 * Fills in scrolling values for AccessibilityEvents. |
595 * @param event Event being fired. | 613 * @param event Event being fired. |
596 */ | 614 */ |
597 @Override | 615 @Override |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 830 |
813 @Override | 831 @Override |
814 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { | 832 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { |
815 return super.awakenScrollBars(startDelay, invalidate); | 833 return super.awakenScrollBars(startDelay, invalidate); |
816 } | 834 } |
817 | 835 |
818 ////////////////////////////////////////////////////////////////////////////
/////////////////// | 836 ////////////////////////////////////////////////////////////////////////////
/////////////////// |
819 // End Implementation of ContentViewCore.InternalAccessDelega
te // | 837 // End Implementation of ContentViewCore.InternalAccessDelega
te // |
820 ////////////////////////////////////////////////////////////////////////////
/////////////////// | 838 ////////////////////////////////////////////////////////////////////////////
/////////////////// |
821 } | 839 } |
OLD | NEW |