| 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; |
| 62 import org.chromium.content.browser.input.HandleView; | 63 import org.chromium.content.browser.input.HandleView; |
| 63 import org.chromium.content.browser.input.ImeAdapter; | 64 import org.chromium.content.browser.input.ImeAdapter; |
| 64 import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFacto
ry; | 65 import org.chromium.content.browser.input.ImeAdapter.AdapterInputConnectionFacto
ry; |
| 65 import org.chromium.content.browser.input.InputMethodManagerWrapper; | 66 import org.chromium.content.browser.input.InputMethodManagerWrapper; |
| 66 import org.chromium.content.browser.input.InsertionHandleController; | 67 import org.chromium.content.browser.input.InsertionHandleController; |
| 67 import org.chromium.content.browser.input.SelectPopup; | 68 import org.chromium.content.browser.input.SelectPopup; |
| 68 import org.chromium.content.browser.input.SelectPopupDialog; | 69 import org.chromium.content.browser.input.SelectPopupDialog; |
| 69 import org.chromium.content.browser.input.SelectPopupDropdown; | 70 import org.chromium.content.browser.input.SelectPopupDropdown; |
| 70 import org.chromium.content.browser.input.SelectPopupItem; | 71 import org.chromium.content.browser.input.SelectPopupItem; |
| 71 import org.chromium.content.browser.input.SelectionHandleController; | 72 import org.chromium.content.browser.input.SelectionHandleController; |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 } | 1380 } |
| 1380 | 1381 |
| 1381 /** | 1382 /** |
| 1382 * @see View#onAttachedToWindow() | 1383 * @see View#onAttachedToWindow() |
| 1383 */ | 1384 */ |
| 1384 @SuppressWarnings("javadoc") | 1385 @SuppressWarnings("javadoc") |
| 1385 public void onAttachedToWindow() { | 1386 public void onAttachedToWindow() { |
| 1386 setAccessibilityState(mAccessibilityManager.isEnabled()); | 1387 setAccessibilityState(mAccessibilityManager.isEnabled()); |
| 1387 | 1388 |
| 1388 ScreenOrientationListener.getInstance().addObserver(this, mContext); | 1389 ScreenOrientationListener.getInstance().addObserver(this, mContext); |
| 1390 GamepadList.onAttachedToWindow(mContext); |
| 1389 } | 1391 } |
| 1390 | 1392 |
| 1391 /** | 1393 /** |
| 1392 * @see View#onDetachedFromWindow() | 1394 * @see View#onDetachedFromWindow() |
| 1393 */ | 1395 */ |
| 1394 @SuppressWarnings("javadoc") | 1396 @SuppressWarnings("javadoc") |
| 1395 @SuppressLint("MissingSuperCall") | 1397 @SuppressLint("MissingSuperCall") |
| 1396 public void onDetachedFromWindow() { | 1398 public void onDetachedFromWindow() { |
| 1397 setInjectedAccessibility(false); | 1399 setInjectedAccessibility(false); |
| 1398 hidePopups(); | 1400 hidePopups(); |
| 1399 mZoomControlsDelegate.dismissZoomPicker(); | 1401 mZoomControlsDelegate.dismissZoomPicker(); |
| 1400 unregisterAccessibilityContentObserver(); | 1402 unregisterAccessibilityContentObserver(); |
| 1401 | 1403 |
| 1402 ScreenOrientationListener.getInstance().removeObserver(this); | 1404 ScreenOrientationListener.getInstance().removeObserver(this); |
| 1405 GamepadList.onDetachedFromWindow(); |
| 1403 } | 1406 } |
| 1404 | 1407 |
| 1405 /** | 1408 /** |
| 1406 * @see View#onVisibilityChanged(android.view.View, int) | 1409 * @see View#onVisibilityChanged(android.view.View, int) |
| 1407 */ | 1410 */ |
| 1408 public void onVisibilityChanged(View changedView, int visibility) { | 1411 public void onVisibilityChanged(View changedView, int visibility) { |
| 1409 if (visibility != View.VISIBLE) { | 1412 if (visibility != View.VISIBLE) { |
| 1410 mZoomControlsDelegate.dismissZoomPicker(); | 1413 mZoomControlsDelegate.dismissZoomPicker(); |
| 1411 } | 1414 } |
| 1412 } | 1415 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 return mContainerViewInternals.super_dispatchKeyEventPreIme(event); | 1597 return mContainerViewInternals.super_dispatchKeyEventPreIme(event); |
| 1595 } finally { | 1598 } finally { |
| 1596 TraceEvent.end(); | 1599 TraceEvent.end(); |
| 1597 } | 1600 } |
| 1598 } | 1601 } |
| 1599 | 1602 |
| 1600 /** | 1603 /** |
| 1601 * @see View#dispatchKeyEvent(KeyEvent) | 1604 * @see View#dispatchKeyEvent(KeyEvent) |
| 1602 */ | 1605 */ |
| 1603 public boolean dispatchKeyEvent(KeyEvent event) { | 1606 public boolean dispatchKeyEvent(KeyEvent event) { |
| 1607 if (GamepadList.dispatchKeyEvent(event)) return true; |
| 1604 if (getContentViewClient().shouldOverrideKeyEvent(event)) { | 1608 if (getContentViewClient().shouldOverrideKeyEvent(event)) { |
| 1605 return mContainerViewInternals.super_dispatchKeyEvent(event); | 1609 return mContainerViewInternals.super_dispatchKeyEvent(event); |
| 1606 } | 1610 } |
| 1607 | 1611 |
| 1608 if (mImeAdapter.dispatchKeyEvent(event)) return true; | 1612 if (mImeAdapter.dispatchKeyEvent(event)) return true; |
| 1609 | 1613 |
| 1610 return mContainerViewInternals.super_dispatchKeyEvent(event); | 1614 return mContainerViewInternals.super_dispatchKeyEvent(event); |
| 1611 } | 1615 } |
| 1612 | 1616 |
| 1613 /** | 1617 /** |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1639 } finally { | 1643 } finally { |
| 1640 offset.recycle(); | 1644 offset.recycle(); |
| 1641 TraceEvent.end("onHoverEvent"); | 1645 TraceEvent.end("onHoverEvent"); |
| 1642 } | 1646 } |
| 1643 } | 1647 } |
| 1644 | 1648 |
| 1645 /** | 1649 /** |
| 1646 * @see View#onGenericMotionEvent(MotionEvent) | 1650 * @see View#onGenericMotionEvent(MotionEvent) |
| 1647 */ | 1651 */ |
| 1648 public boolean onGenericMotionEvent(MotionEvent event) { | 1652 public boolean onGenericMotionEvent(MotionEvent event) { |
| 1653 if (GamepadList.onGenericMotionEvent(event)) return true; |
| 1649 if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { | 1654 if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { |
| 1650 switch (event.getAction()) { | 1655 switch (event.getAction()) { |
| 1651 case MotionEvent.ACTION_SCROLL: | 1656 case MotionEvent.ACTION_SCROLL: |
| 1652 if (mNativeContentViewCore == 0) return false; | 1657 if (mNativeContentViewCore == 0) return false; |
| 1653 | 1658 |
| 1654 nativeSendMouseWheelEvent(mNativeContentViewCore, event.getE
ventTime(), | 1659 nativeSendMouseWheelEvent(mNativeContentViewCore, event.getE
ventTime(), |
| 1655 event.getX(), event.getY(), | 1660 event.getX(), event.getY(), |
| 1656 event.getAxisValue(MotionEvent.AXIS_VSCROLL)); | 1661 event.getAxisValue(MotionEvent.AXIS_VSCROLL)); |
| 1657 | 1662 |
| 1658 mContainerView.removeCallbacks(mFakeMouseMoveRunnable); | 1663 mContainerView.removeCallbacks(mFakeMouseMoveRunnable); |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3218 boolean enableHiding, boolean enableShowing, boolean animate); | 3223 boolean enableHiding, boolean enableShowing, boolean animate); |
| 3219 | 3224 |
| 3220 private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); | 3225 private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); |
| 3221 | 3226 |
| 3222 private native void nativeSetAccessibilityEnabled( | 3227 private native void nativeSetAccessibilityEnabled( |
| 3223 long nativeContentViewCoreImpl, boolean enabled); | 3228 long nativeContentViewCoreImpl, boolean enabled); |
| 3224 | 3229 |
| 3225 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, | 3230 private native void nativeExtractSmartClipData(long nativeContentViewCoreImp
l, |
| 3226 int x, int y, int w, int h); | 3231 int x, int y, int w, int h); |
| 3227 } | 3232 } |
| OLD | NEW |