Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / browser / accessibility / browser_accessibility_mac.h
bloba574086d597fd5cb67d6e3e34e9818232715710f
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.
5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_
8 #include <map>
9 #include <utility>
10 #include <vector>
12 #include "content/browser/accessibility/browser_accessibility.h"
14 @class BrowserAccessibilityCocoa;
16 namespace content {
18 class BrowserAccessibilityMac : public BrowserAccessibility {
19 public:
20 // BrowserAccessibility overrides.
21 void NativeReleaseReference() override;
22 bool IsNative() const override;
23 void OnDataChanged() override;
25 // The BrowserAccessibilityCocoa associated with us.
26 BrowserAccessibilityCocoa* native_view() const {
27 return browser_accessibility_cocoa_;
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();
35 private:
36 // This gives BrowserAccessibility::Create access to the class constructor.
37 friend class BrowserAccessibility;
39 BrowserAccessibilityMac();
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);
49 } // namespace content
51 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MAC_H_