| // Copyright 2014 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 "ui/accessibility/platform/ax_platform_node.h" |
| |
| #include "base/containers/hash_tables.h" |
| #include "base/lazy_instance.h" |
| #include "build/build_config.h" |
| #include "ui/accessibility/ax_node_data.h" |
| #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| |
| namespace ui { |
| |
| // static |
| base::LazyInstance<base::ObserverList<AXModeObserver>>::Leaky |
| ui::AXPlatformNode::ax_mode_observers_ = LAZY_INSTANCE_INITIALIZER; |
| |
| AXPlatformNode::AXPlatformNode() {} |
| |
| AXPlatformNode::~AXPlatformNode() { |
| } |
| |
| void AXPlatformNode::Destroy() { |
| } |
| |
| // static |
| void AXPlatformNode::AddAXModeObserver(AXModeObserver* observer) { |
| ax_mode_observers_.Get().AddObserver(observer); |
| } |
| |
| // static |
| void AXPlatformNode::RemoveAXModeObserver(AXModeObserver* observer) { |
| ax_mode_observers_.Get().RemoveObserver(observer); |
| } |
| |
| // static |
| void AXPlatformNode::NotifyAddAXModeFlags(ui::AXMode mode_flags) { |
| for (auto& observer : ax_mode_observers_.Get()) |
| observer.OnAXModeAdded(mode_flags); |
| } |
| |
| } // namespace ui |