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.ui.base; | 5 package org.chromium.ui.base; |
6 | 6 |
7 import android.animation.Animator; | 7 import android.animation.Animator; |
8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
9 import android.annotation.SuppressLint; | 9 import android.annotation.SuppressLint; |
10 import android.annotation.TargetApi; | 10 import android.annotation.TargetApi; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 mAccessibilityManager.addTouchExplorationStateChangeListener(mTouchE
xplorationListener); | 64 mAccessibilityManager.addTouchExplorationStateChangeListener(mTouchE
xplorationListener); |
65 } | 65 } |
66 | 66 |
67 void destroy() { | 67 void destroy() { |
68 mAccessibilityManager.removeTouchExplorationStateChangeListener( | 68 mAccessibilityManager.removeTouchExplorationStateChangeListener( |
69 mTouchExplorationListener); | 69 mTouchExplorationListener); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 // Native pointer to the c++ WindowAndroid object. | 73 // Native pointer to the c++ WindowAndroid object. |
74 private long mNativeWindowAndroid = 0; | 74 private long mNativeWindowAndroid; |
75 private final VSyncMonitor mVSyncMonitor; | 75 private final VSyncMonitor mVSyncMonitor; |
76 private final DisplayAndroid mDisplayAndroid; | 76 private final DisplayAndroid mDisplayAndroid; |
77 | 77 |
78 // A string used as a key to store intent errors in a bundle | 78 // A string used as a key to store intent errors in a bundle |
79 static final String WINDOW_CALLBACK_ERRORS = "window_callback_errors"; | 79 static final String WINDOW_CALLBACK_ERRORS = "window_callback_errors"; |
80 | 80 |
81 // Error code returned when an Intent fails to start an Activity. | 81 // Error code returned when an Intent fails to start an Activity. |
82 public static final int START_INTENT_FAILURE = -1; | 82 public static final int START_INTENT_FAILURE = -1; |
83 | 83 |
84 protected Context mApplicationContext; | 84 protected Context mApplicationContext; |
85 protected SparseArray<IntentCallback> mOutstandingIntents; | 85 protected SparseArray<IntentCallback> mOutstandingIntents; |
86 // We use a weak reference here to prevent this from leaking in WebView. | 86 // We use a weak reference here to prevent this from leaking in WebView. |
87 private WeakReference<Context> mContextRef; | 87 private WeakReference<Context> mContextRef; |
88 | 88 |
89 // Ideally, this would be a SparseArray<String>, but there's no easy way to
store a | 89 // Ideally, this would be a SparseArray<String>, but there's no easy way to
store a |
90 // SparseArray<String> in a bundle during saveInstanceState(). So we use a H
ashMap and suppress | 90 // SparseArray<String> in a bundle during saveInstanceState(). So we use a H
ashMap and suppress |
91 // the Android lint warning "UseSparseArrays". | 91 // the Android lint warning "UseSparseArrays". |
92 protected HashMap<Integer, String> mIntentErrors; | 92 protected HashMap<Integer, String> mIntentErrors; |
93 | 93 |
94 // We track all animations over content and provide a drawing placeholder fo
r them. | 94 // We track all animations over content and provide a drawing placeholder fo
r them. |
95 private HashSet<Animator> mAnimationsOverContent = new HashSet<>(); | 95 private HashSet<Animator> mAnimationsOverContent = new HashSet<>(); |
96 private View mAnimationPlaceholderView; | 96 private View mAnimationPlaceholderView; |
97 | 97 |
98 private ViewGroup mKeyboardAccessoryView; | 98 private ViewGroup mKeyboardAccessoryView; |
99 | 99 |
100 protected boolean mIsKeyboardShowing = false; | 100 protected boolean mIsKeyboardShowing; |
101 | 101 |
102 // System accessibility service. | 102 // System accessibility service. |
103 private final AccessibilityManager mAccessibilityManager; | 103 private final AccessibilityManager mAccessibilityManager; |
104 | 104 |
105 // Whether touch exploration is enabled. | 105 // Whether touch exploration is enabled. |
106 private boolean mIsTouchExplorationEnabled; | 106 private boolean mIsTouchExplorationEnabled; |
107 | 107 |
108 // On KitKat and higher, a class that monitors the touch exploration state. | 108 // On KitKat and higher, a class that monitors the touch exploration state. |
109 private TouchExplorationMonitor mTouchExplorationMonitor; | 109 private TouchExplorationMonitor mTouchExplorationMonitor; |
110 | 110 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 private native long nativeInit(int displayId); | 730 private native long nativeInit(int displayId); |
731 private native void nativeOnVSync(long nativeWindowAndroid, | 731 private native void nativeOnVSync(long nativeWindowAndroid, |
732 long vsyncTimeMicros, | 732 long vsyncTimeMicros, |
733 long vsyncPeriodMicros); | 733 long vsyncPeriodMicros); |
734 private native void nativeOnVisibilityChanged(long nativeWindowAndroid, bool
ean visible); | 734 private native void nativeOnVisibilityChanged(long nativeWindowAndroid, bool
ean visible); |
735 private native void nativeOnActivityStopped(long nativeWindowAndroid); | 735 private native void nativeOnActivityStopped(long nativeWindowAndroid); |
736 private native void nativeOnActivityStarted(long nativeWindowAndroid); | 736 private native void nativeOnActivityStarted(long nativeWindowAndroid); |
737 private native void nativeDestroy(long nativeWindowAndroid); | 737 private native void nativeDestroy(long nativeWindowAndroid); |
738 | 738 |
739 } | 739 } |
OLD | NEW |