| 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 28 matching lines...) Expand all Loading... |
| 39 BrowserAccessibilityStateImpl(); | 39 BrowserAccessibilityStateImpl(); |
| 40 | 40 |
| 41 static BrowserAccessibilityStateImpl* GetInstance(); | 41 static BrowserAccessibilityStateImpl* GetInstance(); |
| 42 | 42 |
| 43 virtual void OnAccessibilityEnabledManually() OVERRIDE; | 43 virtual void OnAccessibilityEnabledManually() OVERRIDE; |
| 44 virtual void OnScreenReaderDetected() OVERRIDE; | 44 virtual void OnScreenReaderDetected() OVERRIDE; |
| 45 virtual bool IsAccessibleBrowser() OVERRIDE; | 45 virtual bool IsAccessibleBrowser() OVERRIDE; |
| 46 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; | 46 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; |
| 47 | 47 |
| 48 // Called a short while after startup to allow time for the accessibility | 48 // Called a short while after startup to allow time for the accessibility |
| 49 // state to be determined. Updates a histogram with the current state. | 49 // state to be determined. Updates histograms with the current state. |
| 50 void UpdateHistogram(); | 50 // This method is public only for testing! |
| 51 virtual void UpdateHistograms(); |
| 51 | 52 |
| 52 AccessibilityMode GetAccessibilityMode(); | 53 AccessibilityMode GetAccessibilityMode(); |
| 53 void SetAccessibilityMode(AccessibilityMode mode); | 54 void SetAccessibilityMode(AccessibilityMode mode); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; | 57 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; |
| 57 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; | 58 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; |
| 58 | 59 |
| 59 // Leaky singleton, destructor generally won't be called. | 60 // Leaky singleton, destructor generally won't be called. |
| 60 virtual ~BrowserAccessibilityStateImpl(); | 61 virtual ~BrowserAccessibilityStateImpl(); |
| 61 | 62 |
| 62 void UpdatePlatformSpecificHistograms(); | 63 void UpdatePlatformSpecificHistograms(); |
| 63 | 64 |
| 64 AccessibilityMode accessibility_mode_; | 65 AccessibilityMode accessibility_mode_; |
| 65 | 66 |
| 66 std::vector<base::Closure> histogram_callbacks_; | 67 std::vector<base::Closure> histogram_callbacks_; |
| 67 | 68 |
| 68 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); | 69 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 } // namespace content | 72 } // namespace content |
| 72 | 73 |
| 73 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 74 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
| OLD | NEW |