summaryrefslogtreecommitdiff
path: root/chromium/ui/views/accessibility/native_view_accessibility.h
blob: 2fc4c4423b6e53c63f1ab0c2e16460ff5ca00cb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_
#define UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_

#include "ui/base/accessibility/accessibility_types.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/views_export.h"

namespace views {

class View;

class VIEWS_EXPORT NativeViewAccessibility {
 public:
  static NativeViewAccessibility* Create(View* view);

  virtual void NotifyAccessibilityEvent(
      ui::AccessibilityTypes::Event event_type) {}

  virtual gfx::NativeViewAccessible GetNativeObject();

  // Call Destroy rather than deleting this, because the subclass may
  // use reference counting.
  virtual void Destroy();

  // WebViews need to be registered because they implement their own
  // tree of accessibility objects, and we need to check them when
  // mapping a child id to a NativeViewAccessible.
  static void RegisterWebView(View* web_view);
  static void UnregisterWebView(View* web_view);

 protected:
  NativeViewAccessibility();
  virtual ~NativeViewAccessibility();

 private:
  DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility);
};

}  // namespace views

#endif  // UI_VIEWS_ACCESSIBILITY_NATIVE_VIEW_ACCESSIBILITY_H_