Home | History | Annotate | Download | only in browser
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_
      6 #define CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_
      7 
      8 #include "base/callback_forward.h"
      9 
     10 #include "content/common/content_export.h"
     11 
     12 namespace content {
     13 
     14 // The BrowserAccessibilityState class is used to determine if the browser
     15 // should be customized for users with assistive technology, such as screen
     16 // readers.
     17 class CONTENT_EXPORT BrowserAccessibilityState {
     18  public:
     19   virtual ~BrowserAccessibilityState() { }
     20 
     21   // Returns the singleton instance.
     22   static BrowserAccessibilityState* GetInstance();
     23 
     24   // Enables accessibility for all running tabs.
     25   virtual void EnableAccessibility() = 0;
     26 
     27   // Disables accessibility for all running tabs.
     28   virtual void DisableAccessibility() = 0;
     29 
     30   // Called when screen reader client is detected.
     31   virtual void OnScreenReaderDetected() = 0;
     32 
     33   // Returns true if the browser should be customized for accessibility.
     34   virtual bool IsAccessibleBrowser() = 0;
     35 
     36   // Add a callback method that will be called once, a small while after the
     37   // browser starts up, when accessibility state histograms are updated.
     38   // Use this to register a method to update additional accessibility
     39   // histograms.
     40   virtual void AddHistogramCallback(base::Closure callback) = 0;
     41 
     42   virtual void UpdateHistogramsForTesting() = 0;
     43 };
     44 
     45 }  // namespace content
     46 
     47 #endif  // CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_
     48