| 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> | |
| 9 | |
| 10 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 12 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 13 #include "content/common/view_message_enums.h" | 11 #include "content/common/view_message_enums.h" |
| 14 #include "content/public/browser/browser_accessibility_state.h" | 12 #include "content/public/browser/browser_accessibility_state.h" |
| 15 | 13 |
| 16 namespace content { | 14 namespace content { |
| 17 | 15 |
| 18 // The BrowserAccessibilityState class is used to determine if Chrome should be | 16 // The BrowserAccessibilityState class is used to determine if Chrome should be |
| 19 // customized for users with assistive technology, such as screen readers. We | 17 // customized for users with assistive technology, such as screen readers. We |
| (...skipping 16 matching lines...) Expand all Loading... |
| 36 : public base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>, | 34 : public base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>, |
| 37 public BrowserAccessibilityState { | 35 public BrowserAccessibilityState { |
| 38 public: | 36 public: |
| 39 BrowserAccessibilityStateImpl(); | 37 BrowserAccessibilityStateImpl(); |
| 40 | 38 |
| 41 static BrowserAccessibilityStateImpl* GetInstance(); | 39 static BrowserAccessibilityStateImpl* GetInstance(); |
| 42 | 40 |
| 43 virtual void OnAccessibilityEnabledManually() OVERRIDE; | 41 virtual void OnAccessibilityEnabledManually() OVERRIDE; |
| 44 virtual void OnScreenReaderDetected() OVERRIDE; | 42 virtual void OnScreenReaderDetected() OVERRIDE; |
| 45 virtual bool IsAccessibleBrowser() OVERRIDE; | 43 virtual bool IsAccessibleBrowser() OVERRIDE; |
| 46 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; | |
| 47 | 44 |
| 48 // Called a short while after startup to allow time for the accessibility | 45 // Called a short while after startup to allow time for the accessibility |
| 49 // state to be determined. Updates a histogram with the current state. | 46 // state to be determined. Updates a histogram with the current state. |
| 50 void UpdateHistogram(); | 47 void UpdateHistogram(); |
| 51 | 48 |
| 52 AccessibilityMode GetAccessibilityMode(); | 49 AccessibilityMode GetAccessibilityMode(); |
| 53 void SetAccessibilityMode(AccessibilityMode mode); | 50 void SetAccessibilityMode(AccessibilityMode mode); |
| 54 | 51 |
| 55 private: | 52 private: |
| 56 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; | 53 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; |
| 57 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; | 54 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; |
| 58 | 55 |
| 59 // Leaky singleton, destructor generally won't be called. | 56 // Leaky singleton, destructor generally won't be called. |
| 60 virtual ~BrowserAccessibilityStateImpl(); | 57 virtual ~BrowserAccessibilityStateImpl(); |
| 61 | 58 |
| 62 void UpdatePlatformSpecificHistograms(); | 59 void UpdatePlatformSpecificHistograms(); |
| 63 | 60 |
| 64 AccessibilityMode accessibility_mode_; | 61 AccessibilityMode accessibility_mode_; |
| 65 | 62 |
| 66 std::vector<base::Closure> histogram_callbacks_; | |
| 67 | |
| 68 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); | 63 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); |
| 69 }; | 64 }; |
| 70 | 65 |
| 71 } // namespace content | 66 } // namespace content |
| 72 | 67 |
| 73 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 68 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
| OLD | NEW |