| Index: chrome/browser/chromeos/arc/accessibility_helper/ax_tree_source_arc.cc
|
| diff --git a/chrome/browser/chromeos/arc/accessibility_helper/ax_tree_source_arc.cc b/chrome/browser/chromeos/arc/accessibility_helper/ax_tree_source_arc.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..14484eb621a7d3ad1a8db7e45f2da5450b901d2e
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/arc/accessibility_helper/ax_tree_source_arc.cc
|
| @@ -0,0 +1,81 @@
|
| +// 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.
|
| +
|
| +#include "chrome/browser/chromeos/arc/accessibility_helper/ax_tree_source_arc.h"
|
| +
|
| +#include "components/exo/shell_surface.h"
|
| +#include "components/exo/surface.h"
|
| +#include "ui/aura/window.h"
|
| +
|
| +namespace {
|
| +
|
| +exo::Surface* GetArcSurface(const aura::Window* window) {
|
| + exo::Surface* arc_surface = exo::Surface::AsSurface(window);
|
| + if (!arc_surface)
|
| + arc_surface = exo::ShellSurface::GetMainSurface(window);
|
| + return arc_surface;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +namespace arc {
|
| +
|
| +bool AXTreeSourceArc::GetTreeData(ui::AXTreeData* data) const {
|
| + return false;
|
| +}
|
| +
|
| +ui::AXNode* AXTreeSourceArc::GetRoot() const {
|
| + return nullptr;
|
| +}
|
| +
|
| +ui::AXNode* AXTreeSourceArc::GetFromId(int32_t id) const {
|
| + return nullptr;
|
| +}
|
| +
|
| +int32_t AXTreeSourceArc::GetId(ui::AXNode* node) const {
|
| + return -1;
|
| +}
|
| +
|
| +void AXTreeSourceArc::GetChildren(
|
| + ui::AXNode* node,
|
| + std::vector<ui::AXNode*>* out_children) const {}
|
| +
|
| +ui::AXNode* AXTreeSourceArc::GetParent(ui::AXNode* node) const {
|
| + return nullptr;
|
| +}
|
| +
|
| +bool AXTreeSourceArc::IsValid(ui::AXNode* node) const {
|
| + return false;
|
| +}
|
| +
|
| +bool AXTreeSourceArc::IsEqual(ui::AXNode* node1, ui::AXNode* node2) const {
|
| + return false;
|
| +}
|
| +
|
| +ui::AXNode* AXTreeSourceArc::GetNull() const {
|
| + return nullptr;
|
| +}
|
| +
|
| +void AXTreeSourceArc::SerializeNode(ui::AXNode* node,
|
| + ui::AXNodeData* out_data) const {}
|
| +
|
| +void AXTreeSourceArc::Reset() {}
|
| +
|
| +void AXTreeSourceArc::OnWindowFocused(aura::Window* gained_focus,
|
| + aura::Window* lost_focus) {
|
| + exo::Surface* focused_surface = GetArcSurface(gained_focus);
|
| + if (gained_focus == lost_focus || !focused_surface)
|
| + return;
|
| +
|
| + exo::Surface* unfocused_surface = GetArcSurface(lost_focus);
|
| + if (unfocused_surface) {
|
| + unfocused_surface->set_ax_tree_source(nullptr);
|
| + }
|
| +
|
| + Reset();
|
| +
|
| + focused_surface->set_ax_tree_source(this);
|
| +}
|
| +
|
| +} // namespace arc
|
|
|