• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_
7 
8 #include <map>
9 #include <utility>
10 #include <vector>
11 
12 #include "content/browser/accessibility/browser_accessibility.h"
13 
14 @class BrowserAccessibilityCocoa;
15 
16 namespace content {
17 
18 class BrowserAccessibilityMac : public BrowserAccessibility {
19  public:
20   // BrowserAccessibility overrides.
21   virtual void NativeReleaseReference() OVERRIDE;
22   virtual bool IsNative() const OVERRIDE;
23   virtual void OnDataChanged() OVERRIDE;
24 
25   // The BrowserAccessibilityCocoa associated with us.
native_view()26   BrowserAccessibilityCocoa* native_view() const {
27     return browser_accessibility_cocoa_;
28   }
29 
30   // Detach the BrowserAccessibilityCocoa object and then recreate it.
31   // This is only used to work around VoiceOver bugs by forcing VoiceOver
32   // to rebuild its internal state.
33   void RecreateNativeObject();
34 
35  private:
36   // This gives BrowserAccessibility::Create access to the class constructor.
37   friend class BrowserAccessibility;
38 
39   BrowserAccessibilityMac();
40 
41   // Allows access to the BrowserAccessibilityCocoa which wraps this.
42   // BrowserAccessibility.
43   // We own this object until our manager calls ReleaseReference;
44   // thereafter, the cocoa object owns us.
45   BrowserAccessibilityCocoa* browser_accessibility_cocoa_;
46   DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityMac);
47 };
48 
49 }  // namespace content
50 
51 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_
52