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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 | 53 |
54 // Adds the given accessibility mode to the current accessibility mode bitmap. | 54 // Adds the given accessibility mode to the current accessibility mode bitmap. |
55 void AddAccessibilityMode(AccessibilityMode mode); | 55 void AddAccessibilityMode(AccessibilityMode mode); |
56 | 56 |
57 // Removes the given accessibility mode from the current accessibility mode | 57 // Removes the given accessibility mode from the current accessibility mode |
58 // bitmap, managing the bits that are shared with other modes such that a | 58 // bitmap, managing the bits that are shared with other modes such that a |
59 // bit will only be turned off when all modes that depend on it have been | 59 // bit will only be turned off when all modes that depend on it have been |
60 // removed. | 60 // removed. |
61 void RemoveAccessibilityMode(AccessibilityMode mode); | 61 void RemoveAccessibilityMode(AccessibilityMode mode); |
62 | 62 |
63 // Accessibility objects can have the "hot tracked" state set when | |
David Tseng
2015/02/03 02:19:42
I wonder if an easier fix to this is to just move
dmazzoni
2015/02/03 06:54:11
I think that'd be annoying for anyone who runs con
| |
64 // the mouse is hovering over them, but this makes tests flaky because | |
65 // the test behaves differently when the mouse happens to be over an | |
66 // element. This is a global switch to not use the "hot tracked" state | |
67 // in a test. | |
68 void set_disable_hot_tracking_for_testing(bool disable_hot_tracking) { | |
69 disable_hot_tracking_ = disable_hot_tracking; | |
70 } | |
71 bool disable_hot_tracking_for_testing() const { | |
72 return disable_hot_tracking_; | |
73 } | |
74 | |
63 private: | 75 private: |
64 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; | 76 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; |
65 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; | 77 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; |
66 | 78 |
67 // Resets accessibility_mode_ to the default value. | 79 // Resets accessibility_mode_ to the default value. |
68 void ResetAccessibilityModeValue(); | 80 void ResetAccessibilityModeValue(); |
69 | 81 |
70 // Called a short while after startup to allow time for the accessibility | 82 // Called a short while after startup to allow time for the accessibility |
71 // state to be determined. Updates histograms with the current state. | 83 // state to be determined. Updates histograms with the current state. |
72 void UpdateHistograms(); | 84 void UpdateHistograms(); |
73 | 85 |
74 // Leaky singleton, destructor generally won't be called. | 86 // Leaky singleton, destructor generally won't be called. |
75 ~BrowserAccessibilityStateImpl() override; | 87 ~BrowserAccessibilityStateImpl() override; |
76 | 88 |
77 void UpdatePlatformSpecificHistograms(); | 89 void UpdatePlatformSpecificHistograms(); |
78 | 90 |
79 // Updates the accessibility mode of all web contents, including swapped out | 91 // Updates the accessibility mode of all web contents, including swapped out |
80 // ones. |add| specifies whether the mode should be added or removed. | 92 // ones. |add| specifies whether the mode should be added or removed. |
81 void AddOrRemoveFromAllWebContents(AccessibilityMode mode, bool add); | 93 void AddOrRemoveFromAllWebContents(AccessibilityMode mode, bool add); |
82 | 94 |
83 AccessibilityMode accessibility_mode_; | 95 AccessibilityMode accessibility_mode_; |
84 | 96 |
85 std::vector<base::Closure> histogram_callbacks_; | 97 std::vector<base::Closure> histogram_callbacks_; |
86 | 98 |
99 bool disable_hot_tracking_; | |
100 | |
87 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); | 101 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); |
88 }; | 102 }; |
89 | 103 |
90 } // namespace content | 104 } // namespace content |
91 | 105 |
92 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 106 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
OLD | NEW |