#include "ui/views/accessibility/ax_aura_obj_cache.h"
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_util.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
#include "ui/views/accessibility/ax_aura_obj_wrapper.h"
#include "ui/views/accessibility/ax_view_obj_wrapper.h"
#include "ui/views/accessibility/ax_virtual_view.h"
#include "ui/views/accessibility/ax_virtual_view_wrapper.h"
#include "ui/views/accessibility/ax_widget_obj_wrapper.h"
#include "ui/views/accessibility/ax_window_obj_wrapper.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
namespace views {
namespace {
aura::client::FocusClient* GetFocusClient(aura::Window* root_window) { … }
}
class AXAuraObjCache::A11yOverrideWindowObserver : public aura::WindowObserver { … };
AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(View* view) { … }
AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(AXVirtualView* virtual_view) { … }
AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(Widget* widget) { … }
AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(aura::Window* window) { … }
void AXAuraObjCache::CreateOrReplace(std::unique_ptr<AXAuraObjWrapper> obj) { … }
int32_t AXAuraObjCache::GetID(View* view) const { … }
int32_t AXAuraObjCache::GetID(AXVirtualView* virtual_view) const { … }
int32_t AXAuraObjCache::GetID(Widget* widget) const { … }
int32_t AXAuraObjCache::GetID(aura::Window* window) const { … }
void AXAuraObjCache::Remove(View* view) { … }
void AXAuraObjCache::Remove(AXVirtualView* virtual_view) { … }
void AXAuraObjCache::RemoveViewSubtree(View* view) { … }
void AXAuraObjCache::Remove(Widget* widget) { … }
void AXAuraObjCache::Remove(aura::Window* window, aura::Window* parent) { … }
AXAuraObjWrapper* AXAuraObjCache::Get(int32_t id) { … }
void AXAuraObjCache::GetTopLevelWindows(
std::vector<raw_ptr<AXAuraObjWrapper, VectorExperimental>>* children) { … }
AXAuraObjWrapper* AXAuraObjCache::GetFocus() { … }
void AXAuraObjCache::OnFocusedViewChanged() { … }
void AXAuraObjCache::FireEvent(AXAuraObjWrapper* aura_obj,
ax::mojom::Event event_type) { … }
AXAuraObjCache::AXAuraObjCache()
: … { … }
AXAuraObjCache::~AXAuraObjCache() { … }
View* AXAuraObjCache::GetFocusedView() { … }
void AXAuraObjCache::OnWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) { … }
void AXAuraObjCache::OnRootWindowObjCreated(aura::Window* window) { … }
void AXAuraObjCache::OnRootWindowObjDestroyed(aura::Window* window) { … }
void AXAuraObjCache::SetA11yOverrideWindow(aura::Window* a11y_override_window) { … }
template <typename AuraViewWrapper, typename AuraView>
AXAuraObjWrapper* AXAuraObjCache::CreateInternal(
AuraView* aura_view,
std::map<AuraView*, int32_t>* aura_view_to_id_map) { … }
template <typename AuraView>
int32_t AXAuraObjCache::GetIDInternal(
AuraView* aura_view,
const std::map<AuraView*, int32_t>& aura_view_to_id_map) const { … }
template <typename AuraView>
void AXAuraObjCache::RemoveInternal(
AuraView* aura_view,
std::map<AuraView*, int32_t>* aura_view_to_id_map) { … }
}