Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Side by Side Diff: content/browser/accessibility/browser_accessibility_state_impl.h

Issue 11414232: Add Chrome OS accessibility histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, fix style errors Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
8 #include "base/basictypes.h" 10 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
10 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
11 #include "content/common/view_message_enums.h" 13 #include "content/common/view_message_enums.h"
12 #include "content/public/browser/browser_accessibility_state.h" 14 #include "content/public/browser/browser_accessibility_state.h"
13 15
14 namespace content { 16 namespace content {
15 17
16 // The BrowserAccessibilityState class is used to determine if Chrome should be 18 // The BrowserAccessibilityState class is used to determine if Chrome should be
17 // customized for users with assistive technology, such as screen readers. We 19 // customized for users with assistive technology, such as screen readers. We
(...skipping 16 matching lines...) Expand all
34 : public base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>, 36 : public base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>,
35 public BrowserAccessibilityState { 37 public BrowserAccessibilityState {
36 public: 38 public:
37 BrowserAccessibilityStateImpl(); 39 BrowserAccessibilityStateImpl();
38 40
39 static BrowserAccessibilityStateImpl* GetInstance(); 41 static BrowserAccessibilityStateImpl* GetInstance();
40 42
41 virtual void OnAccessibilityEnabledManually() OVERRIDE; 43 virtual void OnAccessibilityEnabledManually() OVERRIDE;
42 virtual void OnScreenReaderDetected() OVERRIDE; 44 virtual void OnScreenReaderDetected() OVERRIDE;
43 virtual bool IsAccessibleBrowser() OVERRIDE; 45 virtual bool IsAccessibleBrowser() OVERRIDE;
46 virtual void AddHistogramCallback(base::Closure callback) OVERRIDE;
44 47
45 // 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
46 // state to be determined. Updates a histogram with the current state. 49 // state to be determined. Updates a histogram with the current state.
47 void UpdateHistogram(); 50 void UpdateHistogram();
48 51
49 AccessibilityMode GetAccessibilityMode(); 52 AccessibilityMode GetAccessibilityMode();
50 void SetAccessibilityMode(AccessibilityMode mode); 53 void SetAccessibilityMode(AccessibilityMode mode);
51 54
52 private: 55 private:
53 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>; 56 friend class base::RefCountedThreadSafe<BrowserAccessibilityStateImpl>;
54 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>; 57 friend struct DefaultSingletonTraits<BrowserAccessibilityStateImpl>;
55 58
56 // Leaky singleton, destructor generally won't be called. 59 // Leaky singleton, destructor generally won't be called.
57 virtual ~BrowserAccessibilityStateImpl(); 60 virtual ~BrowserAccessibilityStateImpl();
58 61
59 void UpdatePlatformSpecificHistograms(); 62 void UpdatePlatformSpecificHistograms();
60 63
61 AccessibilityMode accessibility_mode_; 64 AccessibilityMode accessibility_mode_;
62 65
66 std::vector<base::Closure> histogram_callbacks_;
67
63 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); 68 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl);
64 }; 69 };
65 70
66 } // namespace content 71 } // namespace content
67 72
68 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ 73 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698