| 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.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.app.SearchManager; | 9 import android.app.SearchManager; |
| 10 import android.content.ContentResolver; | 10 import android.content.ContentResolver; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 import org.chromium.base.CommandLine; | 52 import org.chromium.base.CommandLine; |
| 53 import org.chromium.base.JNINamespace; | 53 import org.chromium.base.JNINamespace; |
| 54 import org.chromium.base.ObserverList; | 54 import org.chromium.base.ObserverList; |
| 55 import org.chromium.base.ObserverList.RewindableIterator; | 55 import org.chromium.base.ObserverList.RewindableIterator; |
| 56 import org.chromium.base.TraceEvent; | 56 import org.chromium.base.TraceEvent; |
| 57 import org.chromium.content.R; | 57 import org.chromium.content.R; |
| 58 import org.chromium.content.browser.ScreenOrientationListener.ScreenOrientationO
bserver; | 58 import org.chromium.content.browser.ScreenOrientationListener.ScreenOrientationO
bserver; |
| 59 import org.chromium.content.browser.accessibility.AccessibilityInjector; | 59 import org.chromium.content.browser.accessibility.AccessibilityInjector; |
| 60 import org.chromium.content.browser.accessibility.BrowserAccessibilityManager; | 60 import org.chromium.content.browser.accessibility.BrowserAccessibilityManager; |
| 61 import org.chromium.content.browser.input.AdapterInputConnection; | 61 import org.chromium.content.browser.input.AdapterInputConnection; |
| 62 import org.chromium.content.browser.input.GamepadList; | |
| 63 import org.chromium.content.browser.input.HandleView; | 62 import org.chromium.content.browser.input.HandleView; |
| 64 import org.chromium.content.browser.input.ImeAdapter; | 63 import org.chromium.content.browser.input.ImeAdapter; |
| 65 import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFacto
ry; | 64 import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFacto
ry; |
| 66 import org.chromium.content.browser.input.InputMethodManagerWrapper; | 65 import org.chromium.content.browser.input.InputMethodManagerWrapper; |
| 67 import org.chromium.content.browser.input.InsertionHandleController; | 66 import org.chromium.content.browser.input.InsertionHandleController; |
| 68 import org.chromium.content.browser.input.SelectPopup; | 67 import org.chromium.content.browser.input.SelectPopup; |
| 69 import org.chromium.content.browser.input.SelectPopupDialog; | 68 import org.chromium.content.browser.input.SelectPopupDialog; |
| 70 import org.chromium.content.browser.input.SelectPopupDropdown; | 69 import org.chromium.content.browser.input.SelectPopupDropdown; |
| 71 import org.chromium.content.browser.input.SelectPopupItem; | 70 import org.chromium.content.browser.input.SelectPopupItem; |
| 72 import org.chromium.content.browser.input.SelectionHandleController; | 71 import org.chromium.content.browser.input.SelectionHandleController; |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 } | 1378 } |
| 1380 | 1379 |
| 1381 /** | 1380 /** |
| 1382 * @see View#onAttachedToWindow() | 1381 * @see View#onAttachedToWindow() |
| 1383 */ | 1382 */ |
| 1384 @SuppressWarnings("javadoc") | 1383 @SuppressWarnings("javadoc") |
| 1385 public void onAttachedToWindow() { | 1384 public void onAttachedToWindow() { |
| 1386 setAccessibilityState(mAccessibilityManager.isEnabled()); | 1385 setAccessibilityState(mAccessibilityManager.isEnabled()); |
| 1387 | 1386 |
| 1388 ScreenOrientationListener.getInstance().addObserver(this, mContext); | 1387 ScreenOrientationListener.getInstance().addObserver(this, mContext); |
| 1389 GamepadList.onAttachedToWindow(mContext); | |
| 1390 } | 1388 } |
| 1391 | 1389 |
| 1392 /** | 1390 /** |
| 1393 * @see View#onDetachedFromWindow() | 1391 * @see View#onDetachedFromWindow() |
| 1394 */ | 1392 */ |
| 1395 @SuppressWarnings("javadoc") | 1393 @SuppressWarnings("javadoc") |
| 1396 @SuppressLint("MissingSuperCall") | 1394 @SuppressLint("MissingSuperCall") |
| 1397 public void onDetachedFromWindow() { | 1395 public void onDetachedFromWindow() { |
| 1398 setInjectedAccessibility(false); | 1396 setInjectedAccessibility(false); |
| 1399 hidePopups(); | 1397 hidePopups(); |
| 1400 mZoomControlsDelegate.dismissZoomPicker(); | 1398 mZoomControlsDelegate.dismissZoomPicker(); |
| 1401 unregisterAccessibilityContentObserver(); | 1399 unregisterAccessibilityContentObserver(); |
| 1402 | 1400 |
| 1403 ScreenOrientationListener.getInstance().removeObserver(this); | 1401 ScreenOrientationListener.getInstance().removeObserver(this); |
| 1404 GamepadList.onDetachedFromWindow(); | |
| 1405 } | 1402 } |
| 1406 | 1403 |
| 1407 /** | 1404 /** |
| 1408 * @see View#onVisibilityChanged(android.view.View, int) | 1405 * @see View#onVisibilityChanged(android.view.View, int) |
| 1409 */ | 1406 */ |
| 1410 public void onVisibilityChanged(View changedView, int visibility) { | 1407 public void onVisibilityChanged(View changedView, int visibility) { |
| 1411 if (visibility != View.VISIBLE) { | 1408 if (visibility != View.VISIBLE) { |
| 1412 mZoomControlsDelegate.dismissZoomPicker(); | 1409 mZoomControlsDelegate.dismissZoomPicker(); |
| 1413 } | 1410 } |
| 1414 } | 1411 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1587 return mContainerViewInternals.super_dispatchKeyEventPreIme(event); | 1584 return mContainerViewInternals.super_dispatchKeyEventPreIme(event); |
| 1588 } finally { | 1585 } finally { |
| 1589 TraceEvent.end(); | 1586 TraceEvent.end(); |
| 1590 } | 1587 } |
| 1591 } | 1588 } |
| 1592 | 1589 |
| 1593 /** | 1590 /** |
| 1594 * @see View#dispatchKeyEvent(KeyEvent) | 1591 * @see View#dispatchKeyEvent(KeyEvent) |
| 1595 */ | 1592 */ |
| 1596 public boolean dispatchKeyEvent(KeyEvent event) { | 1593 public boolean dispatchKeyEvent(KeyEvent event) { |
| 1597 if (GamepadList.dispatchKeyEvent(event)) return true; | |
| 1598 if (getContentViewClient().shouldOverrideKeyEvent(event)) { | 1594 if (getContentViewClient().shouldOverrideKeyEvent(event)) { |
| 1599 return mContainerViewInternals.super_dispatchKeyEvent(event); | 1595 return mContainerViewInternals.super_dispatchKeyEvent(event); |
| 1600 } | 1596 } |
| 1601 | 1597 |
| 1602 if (mImeAdapter.dispatchKeyEvent(event)) return true; | 1598 if (mImeAdapter.dispatchKeyEvent(event)) return true; |
| 1603 | 1599 |
| 1604 return mContainerViewInternals.super_dispatchKeyEvent(event); | 1600 return mContainerViewInternals.super_dispatchKeyEvent(event); |
| 1605 } | 1601 } |
| 1606 | 1602 |
| 1607 /** | 1603 /** |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1633 } finally { | 1629 } finally { |
| 1634 offset.recycle(); | 1630 offset.recycle(); |
| 1635 TraceEvent.end("onHoverEvent"); | 1631 TraceEvent.end("onHoverEvent"); |
| 1636 } | 1632 } |
| 1637 } | 1633 } |
| 1638 | 1634 |
| 1639 /** | 1635 /** |
| 1640 * @see View#onGenericMotionEvent(MotionEvent) | 1636 * @see View#onGenericMotionEvent(MotionEvent) |
| 1641 */ | 1637 */ |
| 1642 public boolean onGenericMotionEvent(MotionEvent event) { | 1638 public boolean onGenericMotionEvent(MotionEvent event) { |
| 1643 if (GamepadList.onGenericMotionEvent(event)) return true; | |
| 1644 if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { | 1639 if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { |
| 1645 switch (event.getAction()) { | 1640 switch (event.getAction()) { |
| 1646 case MotionEvent.ACTION_SCROLL: | 1641 case MotionEvent.ACTION_SCROLL: |
| 1647 if (mNativeContentViewCore == 0) return false; | 1642 if (mNativeContentViewCore == 0) return false; |
| 1648 | 1643 |
| 1649 nativeSendMouseWheelEvent(mNativeContentViewCore, event.getE
ventTime(), | 1644 nativeSendMouseWheelEvent(mNativeContentViewCore, event.getE
ventTime(), |
| 1650 event.getX(), event.getY(), | 1645 event.getX(), event.getY(), |
| 1651 event.getAxisValue(MotionEvent.AXIS_VSCROLL)); | 1646 event.getAxisValue(MotionEvent.AXIS_VSCROLL)); |
| 1652 | 1647 |
| 1653 mContainerView.removeCallbacks(mFakeMouseMoveRunnable); | 1648 mContainerView.removeCallbacks(mFakeMouseMoveRunnable); |
| (...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3216 boolean enableHiding, boolean enableShowing, boolean animate); | 3211 boolean enableHiding, boolean enableShowing, boolean animate); |
| 3217 | 3212 |
| 3218 private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); | 3213 private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); |
| 3219 | 3214 |
| 3220 private native void nativeSetAccessibilityEnabled( | 3215 private native void nativeSetAccessibilityEnabled( |
| 3221 long nativeContentViewCoreImpl, boolean enabled); | 3216 long nativeContentViewCoreImpl, boolean enabled); |
| 3222 | 3217 |
| 3223 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3218 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
| 3224 int x, int y, int w, int h); | 3219 int x, int y, int w, int h); |
| 3225 } | 3220 } |
| OLD | NEW |