| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // in a test. | 67 // in a test. |
| 68 void set_disable_hot_tracking_for_testing(bool disable_hot_tracking) { | 68 void set_disable_hot_tracking_for_testing(bool disable_hot_tracking) { |
| 69 disable_hot_tracking_ = disable_hot_tracking; | 69 disable_hot_tracking_ = disable_hot_tracking; |
| 70 } | 70 } |
| 71 bool disable_hot_tracking_for_testing() const { | 71 bool disable_hot_tracking_for_testing() const { |
| 72 return disable_hot_tracking_; | 72 return disable_hot_tracking_; |
| 73 } | 73 } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; | 76 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; |
| 77 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; | 77 friend struct base::DefaultSingletonTraits<BrowserAccessibilityStateImpl>; |
| 78 | 78 |
| 79 // Resets accessibility_mode_ to the default value. | 79 // Resets accessibility_mode_ to the default value. |
| 80 void ResetAccessibilityModeValue(); | 80 void ResetAccessibilityModeValue(); |
| 81 | 81 |
| 82 // 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 |
| 83 // state to be determined. Updates histograms with the current state. | 83 // state to be determined. Updates histograms with the current state. |
| 84 void UpdateHistograms(); | 84 void UpdateHistograms(); |
| 85 | 85 |
| 86 // Leaky singleton, destructor generally won't be called. | 86 // Leaky singleton, destructor generally won't be called. |
| 87 ~BrowserAccessibilityStateImpl() override; | 87 ~BrowserAccessibilityStateImpl() override; |
| 88 | 88 |
| 89 void UpdatePlatformSpecificHistograms(); | 89 void UpdatePlatformSpecificHistograms(); |
| 90 | 90 |
| 91 // Updates the accessibility mode of all web contents, including swapped out | 91 // Updates the accessibility mode of all web contents, including swapped out |
| 92 // ones. |add| specifies whether the mode should be added or removed. | 92 // ones. |add| specifies whether the mode should be added or removed. |
| 93 void AddOrRemoveFromAllWebContents(AccessibilityMode mode, bool add); | 93 void AddOrRemoveFromAllWebContents(AccessibilityMode mode, bool add); |
| 94 | 94 |
| 95 AccessibilityMode accessibility_mode_; | 95 AccessibilityMode accessibility_mode_; |
| 96 | 96 |
| 97 std::vector<base::Closure> histogram_callbacks_; | 97 std::vector<base::Closure> histogram_callbacks_; |
| 98 | 98 |
| 99 bool disable_hot_tracking_; | 99 bool disable_hot_tracking_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); | 101 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace content | 104 } // namespace content |
| 105 | 105 |
| 106 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 106 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
| OLD | NEW |