| 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 30 matching lines...) Expand all Loading... |
| 41 static BrowserAccessibilityStateImpl* GetInstance(); | 41 static BrowserAccessibilityStateImpl* GetInstance(); |
| 42 | 42 |
| 43 virtual void EnableAccessibility() OVERRIDE; | 43 virtual void EnableAccessibility() OVERRIDE; |
| 44 virtual void DisableAccessibility() OVERRIDE; | 44 virtual void DisableAccessibility() OVERRIDE; |
| 45 virtual void OnScreenReaderDetected() OVERRIDE; | 45 virtual void OnScreenReaderDetected() OVERRIDE; |
| 46 virtual bool IsAccessibleBrowser() OVERRIDE; | 46 virtual bool IsAccessibleBrowser() OVERRIDE; |
| 47 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; | 47 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; |
| 48 | 48 |
| 49 virtual void UpdateHistogramsForTesting() OVERRIDE; | 49 virtual void UpdateHistogramsForTesting() OVERRIDE; |
| 50 | 50 |
| 51 AccessibilityMode accessibility_mode() const { return accessibility_mode_; }; | 51 unsigned int accessibility_mode() const { return accessibility_mode_; }; |
| 52 void SetAccessibilityMode(AccessibilityMode mode); | 52 |
| 53 // Adds the given accessibility mode to the current accessibility mode bitmap. |
| 54 void AddAccessibilityMode(AccessibilityMode mode); |
| 55 |
| 56 // Removes the given accessibility mode from the current accessibility mode |
| 57 // bitmap, managing the bits that are shared with other modes such that a |
| 58 // bit will only be turned off when all modes that depend on it have been |
| 59 // removed. |
| 60 void RemoveAccessibilityMode(AccessibilityMode mode); |
| 53 | 61 |
| 54 private: | 62 private: |
| 55 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; | 63 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; |
| 56 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; | 64 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; |
| 57 | 65 |
| 58 // Called a short while after startup to allow time for the accessibility | 66 // Called a short while after startup to allow time for the accessibility |
| 59 // state to be determined. Updates histograms with the current state. | 67 // state to be determined. Updates histograms with the current state. |
| 60 void UpdateHistograms(); | 68 void UpdateHistograms(); |
| 61 | 69 |
| 62 // Leaky singleton, destructor generally won't be called. | 70 // Leaky singleton, destructor generally won't be called. |
| 63 virtual ~BrowserAccessibilityStateImpl(); | 71 virtual ~BrowserAccessibilityStateImpl(); |
| 64 | 72 |
| 65 void UpdatePlatformSpecificHistograms(); | 73 void UpdatePlatformSpecificHistograms(); |
| 66 | 74 |
| 67 AccessibilityMode accessibility_mode_; | 75 // Updates the accessibility mode of all render widgets, including swapped out |
| 76 // ones. |add| specifies whether the mode should be added or removed. |
| 77 void AddOrRemoveFromRenderWidgets(AccessibilityMode mode, bool add); |
| 78 |
| 79 unsigned int accessibility_mode_; |
| 68 | 80 |
| 69 std::vector<base::Closure> histogram_callbacks_; | 81 std::vector<base::Closure> histogram_callbacks_; |
| 70 | 82 |
| 71 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); | 83 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); |
| 72 }; | 84 }; |
| 73 | 85 |
| 74 } // namespace content | 86 } // namespace content |
| 75 | 87 |
| 76 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 88 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
| OLD | NEW |