| Index: ui/views/accessibility/native_view_accessibility.h
|
| diff --git a/ui/views/accessibility/native_view_accessibility.h b/ui/views/accessibility/native_view_accessibility.h
|
| index ec1e0dbe626e0f256b985e9d75acd184515b5687..803db433932cb9b3e93d53a5597c1cf6b5a1d6ed 100644
|
| --- a/ui/views/accessibility/native_view_accessibility.h
|
| +++ b/ui/views/accessibility/native_view_accessibility.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2017 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.
|
|
|
| @@ -8,90 +8,29 @@
|
| #include <memory>
|
|
|
| #include "base/macros.h"
|
| -#include "build/build_config.h"
|
| -#include "ui/accessibility/ax_action_data.h"
|
| -#include "ui/accessibility/ax_node_data.h"
|
| -#include "ui/accessibility/platform/ax_platform_node.h"
|
| -#include "ui/accessibility/platform/ax_platform_node_delegate.h"
|
| +#include "ui/accessibility/ax_enums.h"
|
| #include "ui/gfx/native_widget_types.h"
|
| #include "ui/views/views_export.h"
|
| -#include "ui/views/widget/widget_observer.h"
|
| -
|
| -// Set PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL if this platform has a
|
| -// specific implementation of NativeViewAccessibility::Create().
|
| -#undef PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL
|
| -
|
| -#if defined(OS_WIN)
|
| -#define PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL 1
|
| -#endif
|
| -
|
| -#if defined(OS_MACOSX)
|
| -#define PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL 1
|
| -#endif
|
| -
|
| -#if defined(OS_LINUX) && defined(USE_X11) && !defined(OS_CHROMEOS)
|
| -#define PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL 1
|
| -#endif
|
|
|
| namespace views {
|
|
|
| class View;
|
| -class Widget;
|
|
|
| -class VIEWS_EXPORT NativeViewAccessibility
|
| - : public ui::AXPlatformNodeDelegate,
|
| - public WidgetObserver {
|
| +// Abstract base for that allows native platform accessibility toolkits to
|
| +// interface with a View.
|
| +class VIEWS_EXPORT NativeViewAccessibility {
|
| public:
|
| static std::unique_ptr<NativeViewAccessibility> Create(View* view);
|
|
|
| - ~NativeViewAccessibility() override;
|
| -
|
| - gfx::NativeViewAccessible GetNativeObject();
|
| -
|
| - void NotifyAccessibilityEvent(ui::AXEvent event_type);
|
| -
|
| - // Focuses or unfocuses a View.
|
| - bool SetFocused(bool focused);
|
| + virtual ~NativeViewAccessibility() {}
|
|
|
| - // ui::AXPlatformNodeDelegate
|
| - const ui::AXNodeData& GetData() override;
|
| - int GetChildCount() override;
|
| - gfx::NativeViewAccessible ChildAtIndex(int index) override;
|
| - gfx::NativeWindow GetTopLevelWidget() override;
|
| - gfx::NativeViewAccessible GetParent() override;
|
| - gfx::Vector2d GetGlobalCoordinateOffset() override;
|
| - gfx::NativeViewAccessible HitTestSync(int x, int y) override;
|
| - gfx::NativeViewAccessible GetFocus() override;
|
| - gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override;
|
| - bool AccessibilityPerformAction(const ui::AXActionData& data) override;
|
| - void DoDefaultAction() override;
|
| -
|
| - // WidgetObserver
|
| - void OnWidgetDestroying(Widget* widget) override;
|
| -
|
| - Widget* parent_widget() const { return parent_widget_; }
|
| - void SetParentWidget(Widget* parent_widget);
|
| + virtual gfx::NativeViewAccessible GetNativeObject() = 0;
|
| + virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) = 0;
|
|
|
| protected:
|
| - explicit NativeViewAccessibility(View* view);
|
| -
|
| - // Weak. Owns this.
|
| - View* view_;
|
| -
|
| - // Weak. Uses WidgetObserver to clear. This is set on the root view for
|
| - // a widget that's owned by another widget, so we can walk back up the
|
| - // tree.
|
| - Widget* parent_widget_;
|
| + NativeViewAccessibility() {}
|
|
|
| private:
|
| - void PopulateChildWidgetVector(std::vector<Widget*>* result_child_widgets);
|
| -
|
| - // We own this, but it is reference-counted on some platforms so we can't use
|
| - // a scoped_ptr. It is dereferenced in the destructor.
|
| - ui::AXPlatformNode* ax_node_;
|
| -
|
| - ui::AXNodeData data_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(NativeViewAccessibility);
|
| };
|
|
|
|
|