Chromium Code Reviews| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "content/common/view_message_enums.h" | |
| 14 #include "content/public/browser/browser_accessibility_state.h" | 13 #include "content/public/browser/browser_accessibility_state.h" |
| 15 | 14 |
| 16 namespace content { | 15 namespace content { |
| 17 | 16 |
| 18 // The BrowserAccessibilityState class is used to determine if Chrome should be | 17 // The BrowserAccessibilityState class is used to determine if Chrome should be |
| 19 // customized for users with assistive technology, such as screen readers. We | 18 // customized for users with assistive technology, such as screen readers. We |
| 20 // modify the behavior of certain user interfaces to provide a better experience | 19 // modify the behavior of certain user interfaces to provide a better experience |
| 21 // for screen reader users. The way we detect a screen reader program is | 20 // for screen reader users. The way we detect a screen reader program is |
| 22 // different for each platform. | 21 // different for each platform. |
| 23 // | 22 // |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 41 static BrowserAccessibilityStateImpl* GetInstance(); | 40 static BrowserAccessibilityStateImpl* GetInstance(); |
| 42 | 41 |
| 43 virtual void EnableAccessibility() OVERRIDE; | 42 virtual void EnableAccessibility() OVERRIDE; |
| 44 virtual void DisableAccessibility() OVERRIDE; | 43 virtual void DisableAccessibility() OVERRIDE; |
| 45 virtual void OnScreenReaderDetected() OVERRIDE; | 44 virtual void OnScreenReaderDetected() OVERRIDE; |
| 46 virtual bool IsAccessibleBrowser() OVERRIDE; | 45 virtual bool IsAccessibleBrowser() OVERRIDE; |
| 47 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; | 46 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE; |
| 48 | 47 |
| 49 virtual void UpdateHistogramsForTesting() OVERRIDE; | 48 virtual void UpdateHistogramsForTesting() OVERRIDE; |
| 50 | 49 |
| 51 AccessibilityMode accessibility_mode() const { return accessibility_mode_; }; | 50 unsigned int accessibility_mode() const { return accessibility_mode_; }; |
| 52 void SetAccessibilityMode(AccessibilityMode mode); | 51 void SetAccessibilityMode(unsigned int mode); |
| 53 | 52 void SetRendererAccessibilityMode(bool on); |
|
David Tseng
2014/01/27 22:16:06
Is this method just for convenience?
aboxhall
2014/01/28 00:18:42
Yes. Want me to remove it?
| |
| 54 private: | 53 private: |
| 55 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; | 54 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; |
| 56 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; | 55 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; |
| 57 | 56 |
| 58 // Called a short while after startup to allow time for the accessibility | 57 // Called a short while after startup to allow time for the accessibility |
| 59 // state to be determined. Updates histograms with the current state. | 58 // state to be determined. Updates histograms with the current state. |
| 60 void UpdateHistograms(); | 59 void UpdateHistograms(); |
| 61 | 60 |
| 62 // Leaky singleton, destructor generally won't be called. | 61 // Leaky singleton, destructor generally won't be called. |
| 63 virtual ~BrowserAccessibilityStateImpl(); | 62 virtual ~BrowserAccessibilityStateImpl(); |
| 64 | 63 |
| 65 void UpdatePlatformSpecificHistograms(); | 64 void UpdatePlatformSpecificHistograms(); |
| 66 | 65 |
| 67 AccessibilityMode accessibility_mode_; | 66 unsigned int accessibility_mode_; |
| 68 | 67 |
| 69 std::vector<base::Closure> histogram_callbacks_; | 68 std::vector<base::Closure> histogram_callbacks_; |
| 70 | 69 |
| 71 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); | 70 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace content | 73 } // namespace content |
| 75 | 74 |
| 76 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ | 75 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ |
| OLD | NEW |