[a11y] Remove ui:: usage within the ui namespace for ui/accessibility
In CL:5520052 I moved many files from //content/accessibility to
//ui/accessibility/platform and to reduce diff in that CL, I deferred
removing the redundant ui:: namespace specifier when we are already in
the ui namespace.
While those moved files have been addressed by a prior change, this
CL does the same for the remainder of the ui/accessibility
directory.
Bug: 40672441
Change-Id: Iee9407c7c47f55e1b0593fdbc743cb6fedd5f7fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5805625
Auto-Submit: Jacques Newman <[email protected]>
Commit-Queue: Jacques Newman <[email protected]>
Reviewed-by: Aaron Leventhal <[email protected]>
Reviewed-by: Elly FJ <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1348345}
diff --git a/ui/accessibility/android/accessibility_state.cc b/ui/accessibility/android/accessibility_state.cc
index 40ac10d..1b26b756 100644
--- a/ui/accessibility/android/accessibility_state.cc
+++ b/ui/accessibility/android/accessibility_state.cc
@@ -98,35 +98,32 @@
// static
int AccessibilityState::GetAccessibilityServiceEventTypeMask() {
JNIEnv* env = AttachCurrentThread();
- return ui::Java_AccessibilityState_getAccessibilityServiceEventTypeMask(env);
+ return Java_AccessibilityState_getAccessibilityServiceEventTypeMask(env);
}
// static
int AccessibilityState::GetAccessibilityServiceFeedbackTypeMask() {
JNIEnv* env = AttachCurrentThread();
- return ui::Java_AccessibilityState_getAccessibilityServiceFeedbackTypeMask(
- env);
+ return Java_AccessibilityState_getAccessibilityServiceFeedbackTypeMask(env);
}
// static
int AccessibilityState::GetAccessibilityServiceFlagsMask() {
JNIEnv* env = AttachCurrentThread();
- return ui::Java_AccessibilityState_getAccessibilityServiceFlagsMask(env);
+ return Java_AccessibilityState_getAccessibilityServiceFlagsMask(env);
}
// static
int AccessibilityState::GetAccessibilityServiceCapabilitiesMask() {
JNIEnv* env = AttachCurrentThread();
- return ui::Java_AccessibilityState_getAccessibilityServiceCapabilitiesMask(
- env);
+ return Java_AccessibilityState_getAccessibilityServiceCapabilitiesMask(env);
}
// static
std::vector<std::string> AccessibilityState::GetAccessibilityServiceIds() {
JNIEnv* env = AttachCurrentThread();
- auto j_service_ids =
- ui::Java_AccessibilityState_getAccessibilityServiceIds(env);
+ auto j_service_ids = Java_AccessibilityState_getAccessibilityServiceIds(env);
std::vector<std::string> service_ids;
AppendJavaStringArrayToStringVector(env, j_service_ids, &service_ids);
return service_ids;
@@ -135,8 +132,8 @@
// static
bool AccessibilityState::ShouldRespectDisplayedPasswordText() {
JNIEnv* env = AttachCurrentThread();
- return ui::
- Java_AccessibilityAutofillHelper_shouldRespectDisplayedPasswordText(env);
+ return Java_AccessibilityAutofillHelper_shouldRespectDisplayedPasswordText(
+ env);
}
// static
@@ -149,7 +146,7 @@
// static
bool AccessibilityState::ShouldExposePasswordText() {
JNIEnv* env = AttachCurrentThread();
- return ui::Java_AccessibilityAutofillHelper_shouldExposePasswordText(env);
+ return Java_AccessibilityAutofillHelper_shouldExposePasswordText(env);
}
} // namespace ui
diff --git a/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java b/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java
index 97835d3..a9efbb2 100644
--- a/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java
+++ b/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java
@@ -51,7 +51,7 @@
/**
* Provides utility methods relating to measuring accessibility state on Android. See native
- * counterpart in ui::accessibility::AccessibilityState.
+ * counterpart in accessibility::AccessibilityState.
*/
@JNINamespace("ui")
public class AccessibilityState {
diff --git a/ui/accessibility/aura/aura_window_properties.h b/ui/accessibility/aura/aura_window_properties.h
index 22e0e237..4cc7898 100644
--- a/ui/accessibility/aura/aura_window_properties.h
+++ b/ui/accessibility/aura/aura_window_properties.h
@@ -13,9 +13,9 @@
namespace ui {
-// Value is a serialized |ui::AXTreeID| because code in //ui/aura/mus needs
+// Value is a serialized |AXTreeID| because code in //ui/aura/mus needs
// to serialize the window property, but //ui/aura cannot depend on
-// //ui/accessibility and hence cannot know about the type ui::AXTreeID.
+// //ui/accessibility and hence cannot know about the type AXTreeID.
// (Note: it would probably be better if this was a base::UnguessableToken
// instead of a std::string.)
AX_EXPORT extern const aura::WindowProperty<std::string*>* const kChildAXTreeID;
diff --git a/ui/accessibility/ax_action_handler_base.cc b/ui/accessibility/ax_action_handler_base.cc
index caff4ae9..4a6d8d768 100644
--- a/ui/accessibility/ax_action_handler_base.cc
+++ b/ui/accessibility/ax_action_handler_base.cc
@@ -13,7 +13,7 @@
}
AXActionHandlerBase::AXActionHandlerBase()
- : AXActionHandlerBase(ui::AXTreeIDUnknown()) {}
+ : AXActionHandlerBase(AXTreeIDUnknown()) {}
AXActionHandlerBase::AXActionHandlerBase(const AXTreeID& ax_tree_id)
: tree_id_(ax_tree_id) {}
@@ -23,7 +23,7 @@
}
void AXActionHandlerBase::SetAXTreeID(AXTreeID new_ax_tree_id) {
- DCHECK_NE(new_ax_tree_id, ui::AXTreeIDUnknown());
+ DCHECK_NE(new_ax_tree_id, AXTreeIDUnknown());
AXActionHandlerRegistry::GetInstance()->RemoveAXTreeID(tree_id_);
tree_id_ = new_ax_tree_id;
AXActionHandlerRegistry::GetInstance()->SetAXTreeID(tree_id_, this);
diff --git a/ui/accessibility/ax_action_handler_base.h b/ui/accessibility/ax_action_handler_base.h
index 81ce8c7..536333a 100644
--- a/ui/accessibility/ax_action_handler_base.h
+++ b/ui/accessibility/ax_action_handler_base.h
@@ -36,11 +36,11 @@
const AXTreeID& ax_tree_id() const { return tree_id_; }
protected:
- // Initializes the AXActionHandlerBase subclass with ui::AXTreeIDUnknown().
+ // Initializes the AXActionHandlerBase subclass with AXTreeIDUnknown().
AXActionHandlerBase();
// Initializes the AXActionHandlerBase subclass with |ax_tree_id|. It is Ok to
- // pass ui::AXTreeIDUnknown() and then call SetAXTreeID() at a later point.
+ // pass AXTreeIDUnknown() and then call SetAXTreeID() at a later point.
explicit AXActionHandlerBase(const AXTreeID& ax_tree_id);
// Change the AXTreeID.
diff --git a/ui/accessibility/ax_action_handler_registry.cc b/ui/accessibility/ax_action_handler_registry.cc
index d3b3a1d4..b09d988 100644
--- a/ui/accessibility/ax_action_handler_registry.cc
+++ b/ui/accessibility/ax_action_handler_registry.cc
@@ -39,8 +39,7 @@
observers_.RemoveObserver(observer);
}
-void AXActionHandlerRegistry::PerformAction(
- const ui::AXActionData& action_data) {
+void AXActionHandlerRegistry::PerformAction(const AXActionData& action_data) {
for (AXActionHandlerObserver& observer : observers_) {
observer.PerformAction(action_data);
}
@@ -61,7 +60,7 @@
if (it != frame_to_ax_tree_id_map_.end())
return it->second;
- return ui::AXTreeIDUnknown();
+ return AXTreeIDUnknown();
}
AXTreeID AXActionHandlerRegistry::GetOrCreateAXTreeID(
@@ -83,7 +82,7 @@
return it->second;
}
-void AXActionHandlerRegistry::SetAXTreeID(const ui::AXTreeID& id,
+void AXActionHandlerRegistry::SetAXTreeID(const AXTreeID& id,
AXActionHandlerBase* action_handler) {
DCHECK(id_to_action_handler_.find(id) == id_to_action_handler_.end());
id_to_action_handler_[id] = action_handler;
diff --git a/ui/accessibility/ax_action_handler_registry.h b/ui/accessibility/ax_action_handler_registry.h
index 2398ea1..839e1c4 100644
--- a/ui/accessibility/ax_action_handler_registry.h
+++ b/ui/accessibility/ax_action_handler_registry.h
@@ -30,7 +30,7 @@
// routing is asynchronous and we do not know which observers intend to
// respond to which actions -- so we forward all actions to all observers.
// Only the observer that owns the unique |tree_id| will perform the action.
- virtual void PerformAction(const ui::AXActionData& action_data) {}
+ virtual void PerformAction(const AXActionData& action_data) {}
// Informs the observer that a tree has been removed.
virtual void TreeRemoved(AXTreeID tree_id) {}
@@ -80,7 +80,7 @@
void RemoveObserver(AXActionHandlerObserver* observer);
// Calls PerformAction on all observers.
- void PerformAction(const ui::AXActionData& action_data);
+ void PerformAction(const AXActionData& action_data);
private:
friend base::NoDestructor<AXActionHandlerRegistry>;
diff --git a/ui/accessibility/ax_assistant_structure.cc b/ui/accessibility/ax_assistant_structure.cc
index bbd564cc..dd240b4 100644
--- a/ui/accessibility/ax_assistant_structure.cc
+++ b/ui/accessibility/ax_assistant_structure.cc
@@ -111,7 +111,7 @@
ax::mojom::NameFrom name_from = node->GetNameFrom();
- if (!ui::IsLeaf(node) && name_from == ax::mojom::NameFrom::kContents) {
+ if (!IsLeaf(node) && name_from == ax::mojom::NameFrom::kContents) {
return std::u16string();
}
@@ -168,8 +168,8 @@
}
}
- if (text.empty() && (ui::IsLink(node->GetRole()) ||
- node->GetRole() == ax::mojom::Role::kImage)) {
+ if (text.empty() &&
+ (IsLink(node->GetRole()) || node->GetRole() == ax::mojom::Role::kImage)) {
std::u16string url =
node->GetString16Attribute(ax::mojom::StringAttribute::kUrl);
text = AXUrlBaseText(url);
diff --git a/ui/accessibility/ax_enum_util.h b/ui/accessibility/ax_enum_util.h
index 85fc7b5..cb90afa 100644
--- a/ui/accessibility/ax_enum_util.h
+++ b/ui/accessibility/ax_enum_util.h
@@ -173,7 +173,7 @@
for (auto i = base::to_underlying(T::kMinValue);
i <= base::to_underlying(T::kMaxValue); ++i) {
T attr = T{i};
- std::string str = ui::ToString(attr);
+ std::string str = ToString(attr);
entries.push_back({std::move(str), attr});
}
return base::flat_map(std::move(entries));
@@ -187,7 +187,7 @@
// Convert from the string representation of an enum defined in ax_enums.mojom
// into the enum value. The first time this is called, builds up a map.
-// Relies on the existence of ui::ToString(enum).
+// Relies on the existence of ToString(enum).
template <typename T>
T ParseAXEnum(const char* attribute) {
auto result = MaybeParseAXEnum<T>(attribute);
diff --git a/ui/accessibility/ax_enums.mojom b/ui/accessibility/ax_enums.mojom
index 86d84ad..4f7346f 100644
--- a/ui/accessibility/ax_enums.mojom
+++ b/ui/accessibility/ax_enums.mojom
@@ -1439,7 +1439,7 @@
kAfter,
};
-// For internal use by ui::AXTreeID / ax::mojom::AXTreeID.
+// For internal use by AXTreeID / ax::mojom::AXTreeID.
enum AXTreeIDType {
kUnknown, // The Tree ID is unknown.
kToken, // Every other tree ID must have a valid unguessable token.
diff --git a/ui/accessibility/ax_event_generator.cc b/ui/accessibility/ax_event_generator.cc
index 3122b794f..20ca257 100644
--- a/ui/accessibility/ax_event_generator.cc
+++ b/ui/accessibility/ax_event_generator.cc
@@ -987,7 +987,7 @@
}
// Text and line breaks contribute.
- if (ui::IsText(target_node->GetRole())) {
+ if (IsText(target_node->GetRole())) {
return true;
}
@@ -1341,7 +1341,7 @@
return "documentSelectionChanged";
case AXEventGenerator::Event::DOCUMENT_TITLE_CHANGED:
return "documentTitleChanged";
- case ui::AXEventGenerator::Event::EDITABLE_TEXT_CHANGED:
+ case AXEventGenerator::Event::EDITABLE_TEXT_CHANGED:
return "editableTextChanged";
case AXEventGenerator::Event::ENABLED_CHANGED:
return "enabledChanged";
@@ -1357,7 +1357,7 @@
return "haspopupChanged";
case AXEventGenerator::Event::HIERARCHICAL_LEVEL_CHANGED:
return "hierarchicalLevelChanged";
- case ui::AXEventGenerator::Event::IGNORED_CHANGED:
+ case AXEventGenerator::Event::IGNORED_CHANGED:
return "ignoredChanged";
case AXEventGenerator::Event::IMAGE_ANNOTATION_CHANGED:
return "imageAnnotationChanged";
@@ -1383,9 +1383,9 @@
return "liveStatusChanged";
case AXEventGenerator::Event::MENU_ITEM_SELECTED:
return "menuItemSelected";
- case ui::AXEventGenerator::Event::MENU_POPUP_END:
+ case AXEventGenerator::Event::MENU_POPUP_END:
return "menuPopupEnd";
- case ui::AXEventGenerator::Event::MENU_POPUP_START:
+ case AXEventGenerator::Event::MENU_POPUP_START:
return "menuPopupStart";
case AXEventGenerator::Event::MULTILINE_STATE_CHANGED:
return "multilineStateChanged";
diff --git a/ui/accessibility/ax_event_generator.h b/ui/accessibility/ax_event_generator.h
index e3f2b1c..b4e6e3b 100644
--- a/ui/accessibility/ax_event_generator.h
+++ b/ui/accessibility/ax_event_generator.h
@@ -240,7 +240,7 @@
// Note that events are organized by node and then by event id to
// efficiently remove duplicates, so events won't be retrieved in the
// same order they were added.
- void AddEvent(ui::AXNode* node, Event event);
+ void AddEvent(AXNode* node, Event event);
// Registers for events on the node or one of its descendants.
// Registration offers a more performant path for event generation.
@@ -299,8 +299,8 @@
const std::vector<int32_t>& old_value,
const std::vector<int32_t>& new_value) override;
void OnTreeDataChanged(AXTree* tree,
- const ui::AXTreeData& old_data,
- const ui::AXTreeData& new_data) override;
+ const AXTreeData& old_data,
+ const AXTreeData& new_data) override;
void OnSubtreeWillBeDeleted(AXTree* tree, AXNode* node) override;
void OnNodeWillBeReparented(AXTree* tree, AXNode* node) override;
void OnSubtreeWillBeReparented(AXTree* tree, AXNode* node) override;
diff --git a/ui/accessibility/ax_generated_tree_unittest.cc b/ui/accessibility/ax_generated_tree_unittest.cc
index 381941da..ab5b680 100644
--- a/ui/accessibility/ax_generated_tree_unittest.cc
+++ b/ui/accessibility/ax_generated_tree_unittest.cc
@@ -79,10 +79,10 @@
}
AXTreeUpdate SerializeEntireTree(AXSerializableTree& tree) {
- std::unique_ptr<AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
tree_source(tree.CreateTreeSource());
- AXTreeSerializer<const AXNode*, std::vector<const AXNode*>, ui::AXTreeUpdate*,
- ui::AXTreeData*, ui::AXNodeData>
+ AXTreeSerializer<const AXNode*, std::vector<const AXNode*>, AXTreeUpdate*,
+ AXTreeData*, AXNodeData>
serializer(tree_source.get());
AXTreeUpdate update;
CHECK(serializer.SerializeChanges(tree.root(), &update));
@@ -276,11 +276,10 @@
// Start by serializing tree0 and unserializing it into a new
// empty tree |dst_tree|.
- std::unique_ptr<
- AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
tree0_source(tree0.CreateTreeSource());
AXTreeSerializer<const AXNode*, std::vector<const AXNode*>,
- ui::AXTreeUpdate*, ui::AXTreeData*, ui::AXNodeData>
+ AXTreeUpdate*, AXTreeData*, AXNodeData>
serializer(tree0_source.get());
AXTreeUpdate update0;
ASSERT_TRUE(serializer.SerializeChanges(tree0.root(), &update0));
@@ -295,8 +294,7 @@
EXPECT_EQ(TreeToString(tree0), TreeToString(dst_tree));
// Next, pretend that tree0 turned into tree1.
- std::unique_ptr<
- AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
tree1_source(tree1.CreateTreeSource());
serializer.ChangeTreeSourceForTesting(tree1_source.get());
diff --git a/ui/accessibility/ax_language_detection.cc b/ui/accessibility/ax_language_detection.cc
index 5658b82..fe906efe0 100644
--- a/ui/accessibility/ax_language_detection.cc
+++ b/ui/accessibility/ax_language_detection.cc
@@ -478,7 +478,7 @@
}
void AXLanguageDetectionObserver::OnAtomicUpdateFinished(
- ui::AXTree* tree,
+ AXTree* tree,
bool root_changed,
const std::vector<Change>& changes) {
// TODO(chrishall): We likely want to re-consider updating or resetting
diff --git a/ui/accessibility/ax_language_detection.h b/ui/accessibility/ax_language_detection.h
index 7e5aa50..da991f3 100644
--- a/ui/accessibility/ax_language_detection.h
+++ b/ui/accessibility/ax_language_detection.h
@@ -217,7 +217,7 @@
// TODO(chrishall): Investigate the cost of using AXTreeObserver, given that it
// has many empty virtual methods which are called for every AXTree change and
// we are only currently interested in OnAtomicUpdateFinished.
-class AX_EXPORT AXLanguageDetectionObserver : public ui::AXTreeObserver {
+class AX_EXPORT AXLanguageDetectionObserver : public AXTreeObserver {
public:
// Observer constructor will register itself with the provided AXTree.
explicit AXLanguageDetectionObserver(AXTree* tree);
@@ -231,7 +231,7 @@
delete;
private:
- void OnAtomicUpdateFinished(ui::AXTree* tree,
+ void OnAtomicUpdateFinished(AXTree* tree,
bool root_changed,
const std::vector<Change>& changes) override;
diff --git a/ui/accessibility/ax_mode.h b/ui/accessibility/ax_mode.h
index 7ea3f97..b11d2376 100644
--- a/ui/accessibility/ax_mode.h
+++ b/ui/accessibility/ax_mode.h
@@ -181,7 +181,7 @@
static constexpr uint32_t kExperimentalLastFlag = 1 << 0;
private:
- friend struct mojo::StructTraits<ax::mojom::AXModeDataView, ui::AXMode>;
+ friend struct mojo::StructTraits<ax::mojom::AXModeDataView, AXMode>;
uint32_t flags_ = 0U;
uint32_t experimental_flags_ = 0U;
diff --git a/ui/accessibility/ax_mode_histogram_logger.cc b/ui/accessibility/ax_mode_histogram_logger.cc
index f6a72707..8d95438 100644
--- a/ui/accessibility/ax_mode_histogram_logger.cc
+++ b/ui/accessibility/ax_mode_histogram_logger.cc
@@ -38,46 +38,46 @@
// Record individual mode flags transitioning from unset to set state.
int new_mode_flags = mode.flags() & (~previous_mode.flags());
if (new_mode_flags) {
- if (new_mode_flags & ui::AXMode::kNativeAPIs) {
+ if (new_mode_flags & AXMode::kNativeAPIs) {
RecordModeFlag(prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_NATIVE_APIS);
}
- if (new_mode_flags & ui::AXMode::kWebContents) {
+ if (new_mode_flags & AXMode::kWebContents) {
RecordModeFlag(prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_WEB_CONTENTS);
}
- if (new_mode_flags & ui::AXMode::kInlineTextBoxes) {
+ if (new_mode_flags & AXMode::kInlineTextBoxes) {
RecordModeFlag(
prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_INLINE_TEXT_BOXES);
}
- if (new_mode_flags & ui::AXMode::kScreenReader) {
+ if (new_mode_flags & AXMode::kScreenReader) {
RecordModeFlag(prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_SCREEN_READER);
}
- if (new_mode_flags & ui::AXMode::kHTML) {
+ if (new_mode_flags & AXMode::kHTML) {
RecordModeFlag(prefix, AXMode::ModeFlagHistogramValue::UMA_AX_MODE_HTML);
}
- if (new_mode_flags & ui::AXMode::kHTMLMetadata) {
+ if (new_mode_flags & AXMode::kHTMLMetadata) {
RecordModeFlag(prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_HTML_METADATA);
}
- if (new_mode_flags & ui::AXMode::kLabelImages) {
+ if (new_mode_flags & AXMode::kLabelImages) {
RecordModeFlag(prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_LABEL_IMAGES);
}
- if (new_mode_flags & ui::AXMode::kPDFPrinting) {
+ if (new_mode_flags & AXMode::kPDFPrinting) {
RecordModeFlag(prefix, AXMode::ModeFlagHistogramValue::UMA_AX_MODE_PDF);
}
- if (new_mode_flags & ui::AXMode::kAnnotateMainNode) {
+ if (new_mode_flags & AXMode::kAnnotateMainNode) {
RecordModeFlag(
prefix,
AXMode::ModeFlagHistogramValue::UMA_AX_MODE_ANNOTATE_MAIN_NODE);
@@ -87,7 +87,7 @@
// Record forms control flag transitioning from unset to set.
int new_experimental_mode_flags =
mode.experimental_flags() & (~previous_mode.experimental_flags());
- if (new_experimental_mode_flags & ui::AXMode::kExperimentalFormControls) {
+ if (new_experimental_mode_flags & AXMode::kExperimentalFormControls) {
switch (prefix) {
case AXHistogramPrefix::kNone:
base::UmaHistogramBoolean(
diff --git a/ui/accessibility/ax_node_data.h b/ui/accessibility/ax_node_data.h
index 8fa0d37..abffc93 100644
--- a/ui/accessibility/ax_node_data.h
+++ b/ui/accessibility/ax_node_data.h
@@ -116,7 +116,7 @@
//
void AddBoolAttribute(ax::mojom::BoolAttribute attribute, bool value);
- void AddChildTreeId(const ui::AXTreeID& tree_id);
+ void AddChildTreeId(const AXTreeID& tree_id);
void AddIntAttribute(ax::mojom::IntAttribute attribute, int32_t value);
void AddFloatAttribute(ax::mojom::FloatAttribute attribute, float value);
// This method cannot be used to set kChildTreeId due to a common
diff --git a/ui/accessibility/ax_node_data_unittest.cc b/ui/accessibility/ax_node_data_unittest.cc
index 6d8e6c2..62960828 100644
--- a/ui/accessibility/ax_node_data_unittest.cc
+++ b/ui/accessibility/ax_node_data_unittest.cc
@@ -224,7 +224,7 @@
data.role = static_cast<ax::mojom::Role>(role_idx);
bool is_activatable = data.IsActivatable();
const bool supports_expand_collapse = data.SupportsExpandCollapse();
- const bool supports_toggle = ui::SupportsToggle(data.role);
+ const bool supports_toggle = SupportsToggle(data.role);
const bool is_clickable = data.IsClickable();
const bool is_invocable = data.IsInvocable();
@@ -236,9 +236,8 @@
<< ", Actual: isInvocable=" << is_invocable
<< ", Expected: isInvocable=" << !is_invocable);
- if (ui::IsLink(data.role) ||
- (is_clickable && !is_activatable && !supports_toggle &&
- !supports_expand_collapse)) {
+ if (IsLink(data.role) || (is_clickable && !is_activatable &&
+ !supports_toggle && !supports_expand_collapse)) {
EXPECT_TRUE(is_invocable);
} else {
EXPECT_FALSE(is_invocable);
diff --git a/ui/accessibility/ax_node_position_unittest.cc b/ui/accessibility/ax_node_position_unittest.cc
index 1dc1a44..862110a 100644
--- a/ui/accessibility/ax_node_position_unittest.cc
+++ b/ui/accessibility/ax_node_position_unittest.cc
@@ -12148,7 +12148,7 @@
//
// Child Tree
// ++1 kDocument
- ui::AXTreeID child_tree_id = ui::AXTreeID::CreateNewAXTreeID();
+ AXTreeID child_tree_id = AXTreeID::CreateNewAXTreeID();
// Create tree manager for parent tree.
AXNodeData root;
diff --git a/ui/accessibility/ax_position.h b/ui/accessibility/ax_position.h
index e648ad5..03704b5 100644
--- a/ui/accessibility/ax_position.h
+++ b/ui/accessibility/ax_position.h
@@ -385,7 +385,7 @@
// Use initialize without validation because this is used by ATs that
// used outdated information to generated a selection request.
new_position->InitializeWithoutValidation(
- serialization.kind, ui::AXTreeID::FromString(serialization.tree_id),
+ serialization.kind, AXTreeID::FromString(serialization.tree_id),
serialization.anchor_id, serialization.child_index,
serialization.text_offset, serialization.affinity);
return new_position;
@@ -4715,8 +4715,7 @@
// child index is larger than AnchorChildCount(), which does not account
// for them. We need to get a child count that includes extra mac nodes,
// similar to how BrowserAccessibility::PlatformChildCount() does.
- if (!IsValid() && IsTreePosition() &&
- ui::IsTableLike(GetAnchor()->GetRole()) &&
+ if (!IsValid() && IsTreePosition() && IsTableLike(GetAnchor()->GetRole()) &&
child_index > AnchorChildCount()) {
child_index_ = AnchorChildCount();
}
diff --git a/ui/accessibility/ax_range.h b/ui/accessibility/ax_range.h
index 34bc3f6..206f1a5 100644
--- a/ui/accessibility/ax_range.h
+++ b/ui/accessibility/ax_range.h
@@ -41,7 +41,7 @@
AXNodeID node_id,
int start_offset,
int end_offset,
- ui::AXClippingBehavior clipping_behavior,
+ AXClippingBehavior clipping_behavior,
AXOffscreenResult* offscreen_result) = 0;
virtual gfx::Rect GetBoundsRect(AXTreeID tree_id,
AXNodeID node_id,
@@ -441,7 +441,7 @@
gfx::Rect degenerate_range_rect = delegate->GetInnerTextRangeBoundsRect(
range_start->tree_id(), range_start->anchor_id(),
range_start->text_offset(), range_end->text_offset(),
- ui::AXClippingBehavior::kUnclipped, &offscreen_result);
+ AXClippingBehavior::kUnclipped, &offscreen_result);
if (offscreen_result == AXOffscreenResult::kOnscreen) {
DCHECK(degenerate_range_rect.width() == 0);
degenerate_range_rect.set_width(1);
@@ -474,7 +474,7 @@
current_rect = delegate->GetInnerTextRangeBoundsRect(
current_line_start->tree_id(), current_line_start->anchor_id(),
current_line_start->text_offset(), current_line_end->text_offset(),
- ui::AXClippingBehavior::kClipped, &offscreen_result);
+ AXClippingBehavior::kClipped, &offscreen_result);
} else {
current_rect = delegate->GetBoundsRect(current_line_start->tree_id(),
current_line_start->anchor_id(),
diff --git a/ui/accessibility/ax_range_unittest.cc b/ui/accessibility/ax_range_unittest.cc
index e77d966e..b92f006e 100644
--- a/ui/accessibility/ax_range_unittest.cc
+++ b/ui/accessibility/ax_range_unittest.cc
@@ -65,7 +65,7 @@
AXNodeID node_id,
int start_offset,
int end_offset,
- const ui::AXClippingBehavior clipping_behavior,
+ const AXClippingBehavior clipping_behavior,
AXOffscreenResult* offscreen_result) override {
if (tree_manager_->GetTreeID() != tree_id)
return gfx::Rect();
diff --git a/ui/accessibility/ax_serializable_tree.cc b/ui/accessibility/ax_serializable_tree.cc
index 15138d9..f54e8d0 100644
--- a/ui/accessibility/ax_serializable_tree.cc
+++ b/ui/accessibility/ax_serializable_tree.cc
@@ -18,7 +18,7 @@
// AXTree directly. Another AXTreeSource is used to abstract the Blink
// accessibility tree.
class AX_EXPORT AXTreeSourceAdapter
- : public AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData> {
+ : public AXTreeSource<const AXNode*, AXTreeData*, AXNodeData> {
public:
explicit AXTreeSourceAdapter(AXTree* tree) : tree_(tree) {}
~AXTreeSourceAdapter() override = default;
@@ -80,7 +80,7 @@
AXSerializableTree::~AXSerializableTree() {
}
-AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>*
+AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>*
AXSerializableTree::CreateTreeSource() {
return new AXTreeSourceAdapter(this);
}
diff --git a/ui/accessibility/ax_serializable_tree.h b/ui/accessibility/ax_serializable_tree.h
index a8d37f8..d6f4551 100644
--- a/ui/accessibility/ax_serializable_tree.h
+++ b/ui/accessibility/ax_serializable_tree.h
@@ -19,7 +19,7 @@
// Create a TreeSource adapter for this tree. The client gets ownership
// of the return value and should delete it when done.
- virtual AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>*
+ virtual AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>*
CreateTreeSource();
};
diff --git a/ui/accessibility/ax_table_info.cc b/ui/accessibility/ax_table_info.cc
index 665bd77..c4c49d37 100644
--- a/ui/accessibility/ax_table_info.cc
+++ b/ui/accessibility/ax_table_info.cc
@@ -99,7 +99,7 @@
// 2-dimensional array.
void FindCells(std::vector<raw_ptr<AXNode, VectorExperimental>>* row_node_list,
std::vector<std::vector<AXNode*>>* cell_nodes_per_row) {
- for (ui::AXNode* row : *row_node_list) {
+ for (AXNode* row : *row_node_list) {
cell_nodes_per_row->emplace_back();
FindCellsInRow(row, &cell_nodes_per_row->back());
}
@@ -646,7 +646,7 @@
}
void AXTableInfo::UpdateExtraMacColumnNodeAttributes(size_t col_index) {
- ui::AXNodeData data = extra_mac_nodes[col_index]->data();
+ AXNodeData data = extra_mac_nodes[col_index]->data();
data.int_attributes.clear();
// Update the column index.
diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc
index 1e1a0842..3a90679 100644
--- a/ui/accessibility/ax_tree.cc
+++ b/ui/accessibility/ax_tree.cc
@@ -61,7 +61,7 @@
return std::accumulate(
node->children().cbegin(), node->children().cend(),
std::string(2 * indent, ' ') + node->data().ToString(verbose) + "\n",
- [indent, verbose](const std::string& str, const ui::AXNode* child) {
+ [indent, verbose](const std::string& str, const AXNode* child) {
return str + TreeToStringHelper(child, indent + 1, verbose);
});
}
@@ -386,7 +386,7 @@
DCHECK_EQ(AXTreePendingStructureStatus::kComputing, pending_update_status)
<< "This method should only be called while computing pending changes, "
"before updates are made to the tree.";
- static base::NoDestructor<ui::AXNodeData> empty_data;
+ static base::NoDestructor<AXNodeData> empty_data;
PendingStructureChanges* data = GetPendingStructureChanges(node_id);
return (data && data->last_known_data) ? *data->last_known_data
: *empty_data;
@@ -831,8 +831,9 @@
}
AXNode* AXTree::GetFromId(AXNodeID id) const {
- if (id == ui::kInvalidAXNodeID)
+ if (id == kInvalidAXNodeID) {
return nullptr;
+ }
auto iter = id_map_.find(id);
return iter != id_map_.end() ? iter->second.get() : nullptr;
}
@@ -885,7 +886,7 @@
// bad state.
if (bounds.IsEmpty() && !GetTreeUpdateInProgressState() &&
allow_recursion) {
- for (ui::AXNode* child : node->children()) {
+ for (AXNode* child : node->children()) {
gfx::RectF child_bounds = RelativeToTreeBoundsInternal(
child, gfx::RectF(), /*offscreen=*/nullptr, clip_bounds,
skip_container_offset,
@@ -1248,7 +1249,7 @@
// If the tree doesn't exists any more because the root has just been
// replaced, there is nothing more to clear.
if (root_) {
- for (ui::AXNode* child : cleared_node->children()) {
+ for (AXNode* child : cleared_node->children()) {
DestroySubtree(child, &update_state);
}
std::vector<raw_ptr<AXNode, VectorExperimental>> children;
@@ -1951,7 +1952,7 @@
for (AXTreeObserver& observer : observers_)
observer.OnNodeDeleted(this, node->id());
- for (ui::AXNode* child : node->children()) {
+ for (AXNode* child : node->children()) {
RecursivelyNotifyNodeDeletedForTreeTeardown(child);
}
}
@@ -2286,7 +2287,7 @@
DCHECK(!update_state || update_state->GetPendingDestroyNodeCount(id) > 0);
// Clear out any reverse relations.
- static base::NoDestructor<ui::AXNodeData> empty_data;
+ static base::NoDestructor<AXNodeData> empty_data;
UpdateReverseRelations(node, *empty_data);
auto iter = id_map_.find(id);
@@ -2295,7 +2296,7 @@
id_map_.erase(iter);
node = nullptr;
- for (ui::AXNode* child : node_to_delete->children()) {
+ for (AXNode* child : node_to_delete->children()) {
DestroyNodeAndSubtree(child, update_state);
}
if (update_state) {
diff --git a/ui/accessibility/ax_tree_combiner.h b/ui/accessibility/ax_tree_combiner.h
index fe15162..ad0f81e 100644
--- a/ui/accessibility/ax_tree_combiner.h
+++ b/ui/accessibility/ax_tree_combiner.h
@@ -39,7 +39,7 @@
void ProcessTree(AXTreeUpdate* tree,
const std::map<AXTreeID, AXTreeUpdate*>& tree_id_map);
- std::vector<ui::AXTreeUpdate> trees_;
+ std::vector<AXTreeUpdate> trees_;
AXTreeID root_tree_id_;
AXNodeID next_id_ = 1;
std::map<std::pair<AXTreeID, AXNodeID>, AXNodeID> tree_id_node_id_map_;
diff --git a/ui/accessibility/ax_tree_data.h b/ui/accessibility/ax_tree_data.h
index 77fa55da..e6bf8f1 100644
--- a/ui/accessibility/ax_tree_data.h
+++ b/ui/accessibility/ax_tree_data.h
@@ -60,7 +60,7 @@
// (selection end). If the offset could correspond to a position on two
// different lines, sel_upstream_affinity means the cursor is on the first
// line, otherwise it's on the second line.
- // Most use cases will want to use ui::OwnerTree::GetUnignoredSelection.
+ // Most use cases will want to use OwnerTree::GetUnignoredSelection.
bool sel_is_backward = false;
AXNodeID sel_anchor_object_id = kInvalidAXNodeID;
int32_t sel_anchor_offset = -1;
diff --git a/ui/accessibility/ax_tree_id.cc b/ui/accessibility/ax_tree_id.cc
index e76f6bf..4557b23 100644
--- a/ui/accessibility/ax_tree_id.cc
+++ b/ui/accessibility/ax_tree_id.cc
@@ -94,7 +94,7 @@
return !(*this < rhs);
}
-size_t AXTreeIDHash::operator()(const ui::AXTreeID& tree_id) const {
+size_t AXTreeIDHash::operator()(const AXTreeID& tree_id) const {
DCHECK(tree_id.type() == ax::mojom::AXTreeIDType::kToken);
return base::UnguessableTokenHash()(tree_id.token().value());
}
diff --git a/ui/accessibility/ax_tree_id.h b/ui/accessibility/ax_tree_id.h
index 8357185..9cef7ec6 100644
--- a/ui/accessibility/ax_tree_id.h
+++ b/ui/accessibility/ax_tree_id.h
@@ -62,7 +62,7 @@
explicit AXTreeID(ax::mojom::AXTreeIDType type);
explicit AXTreeID(const std::string& string);
- friend struct mojo::UnionTraits<ax::mojom::AXTreeIDDataView, ui::AXTreeID>;
+ friend struct mojo::UnionTraits<ax::mojom::AXTreeIDDataView, AXTreeID>;
friend AX_BASE_EXPORT const AXTreeID& AXTreeIDUnknown();
friend void swap(AXTreeID& first, AXTreeID& second);
@@ -72,7 +72,7 @@
// For use in std::unordered_map.
struct AX_BASE_EXPORT AXTreeIDHash {
- size_t operator()(const ui::AXTreeID& tree_id) const;
+ size_t operator()(const AXTreeID& tree_id) const;
};
AX_BASE_EXPORT std::ostream& operator<<(std::ostream& stream,
diff --git a/ui/accessibility/ax_tree_manager.cc b/ui/accessibility/ax_tree_manager.cc
index fafd2d1..36c880b 100644
--- a/ui/accessibility/ax_tree_manager.cc
+++ b/ui/accessibility/ax_tree_manager.cc
@@ -133,7 +133,7 @@
return manager ? manager->GetNode(node_id) : nullptr;
}
-void AXTreeManager::Initialize(const ui::AXTreeUpdate& initial_tree) {
+void AXTreeManager::Initialize(const AXTreeUpdate& initial_tree) {
if (!ax_tree()->Unserialize(initial_tree)) {
LOG(FATAL) << "No recovery is possible if the initial tree is broken: "
<< ax_tree()->error() << ", AXTreeUpdate info: "
@@ -412,8 +412,8 @@
parent, RetargetEventType::RetargetEventTypeGenerated);
DCHECK(parent) << "RetargetForEvents shouldn't return a "
"null pointer when |parent| is not null.";
- parent_manager->FireGeneratedEvent(
- ui::AXEventGenerator::Event::CHILDREN_CHANGED, parent);
+ parent_manager->FireGeneratedEvent(AXEventGenerator::Event::CHILDREN_CHANGED,
+ parent);
}
void AXTreeManager::EnsureParentConnectionIfNotRootManager() {
diff --git a/ui/accessibility/ax_tree_manager.h b/ui/accessibility/ax_tree_manager.h
index 6873bec..58ed72a 100644
--- a/ui/accessibility/ax_tree_manager.h
+++ b/ui/accessibility/ax_tree_manager.h
@@ -68,8 +68,8 @@
// Return |node| by default, but some platforms want to update the target node
// based on the event type.
virtual AXNode* RetargetForEvents(AXNode* node, RetargetEventType type) const;
- virtual void FireGeneratedEvent(ui::AXEventGenerator::Event event_type,
- const ui::AXNode* node) {}
+ virtual void FireGeneratedEvent(AXEventGenerator::Event event_type,
+ const AXNode* node) {}
virtual bool CanFireEvents() const;
// Returns whether or not this tree manager is for a view.
@@ -88,12 +88,12 @@
// Returns true if the manager has a tree with a valid (not unknown) ID.
bool HasValidTreeID() const {
- return ax_tree_ && ax_tree_->GetAXTreeID() != ui::AXTreeIDUnknown();
+ return ax_tree_ && ax_tree_->GetAXTreeID() != AXTreeIDUnknown();
}
// Returns the tree id of the tree managed by this AXTreeManager.
const AXTreeID& GetTreeID() const {
- return ax_tree_ ? ax_tree_->GetAXTreeID() : ui::AXTreeIDUnknown();
+ return ax_tree_ ? ax_tree_->GetAXTreeID() : AXTreeIDUnknown();
}
// Returns the AXTreeData for the tree managed by this AXTreeManager.
diff --git a/ui/accessibility/ax_tree_serializer_unittest.cc b/ui/accessibility/ax_tree_serializer_unittest.cc
index 42695ac..45432c7 100644
--- a/ui/accessibility/ax_tree_serializer_unittest.cc
+++ b/ui/accessibility/ax_tree_serializer_unittest.cc
@@ -26,9 +26,9 @@
using BasicAXTreeSerializer =
AXTreeSerializer<const AXNode*,
std::vector<raw_ptr<const AXNode, VectorExperimental>>,
- ui::AXTreeUpdate*,
- ui::AXTreeData*,
- ui::AXNodeData>;
+ AXTreeUpdate*,
+ AXTreeData*,
+ AXNodeData>;
// The framework for these tests is that each test sets up |treedata0_|
// and |treedata1_| and then calls GetTreeSerializer, which creates a
@@ -52,9 +52,9 @@
AXTreeUpdate treedata1_;
std::unique_ptr<AXSerializableTree> tree0_;
std::unique_ptr<AXSerializableTree> tree1_;
- std::unique_ptr<AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
tree0_source_;
- std::unique_ptr<AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
tree1_source_;
std::unique_ptr<BasicAXTreeSerializer> serializer_;
};
@@ -310,7 +310,7 @@
// A variant of AXTreeSource that does not serialize one particular id,
// returning nullptr from methods that try to retrieve it.
class AXTreeSourceWithInvalidId
- : public AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData> {
+ : public AXTreeSource<const AXNode*, AXTreeData*, AXNodeData> {
public:
AXTreeSourceWithInvalidId(AXTree* tree, int invalid_id)
: tree_(tree),
@@ -594,8 +594,7 @@
}
// The result should be indistinguishable from the source tree.
- std::unique_ptr<
- AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
dst_tree_source(dst_tree.CreateTreeSource());
BasicAXTreeSerializer serializer(dst_tree_source.get());
AXTreeUpdate dst_update;
diff --git a/ui/accessibility/ax_tree_source.h b/ui/accessibility/ax_tree_source.h
index ac569240..03f9cf5 100644
--- a/ui/accessibility/ax_tree_source.h
+++ b/ui/accessibility/ax_tree_source.h
@@ -87,13 +87,13 @@
// updated in this tree source.
virtual void AddObserver(
- ui::AXTreeSourceObserver<AXNodeSource, AXTreeDataType, AXNodeDataType>*
+ AXTreeSourceObserver<AXNodeSource, AXTreeDataType, AXNodeDataType>*
observer) {
NOTIMPLEMENTED();
}
virtual void RemoveObserver(
- ui::AXTreeSourceObserver<AXNodeSource, AXTreeDataType, AXNodeDataType>*
+ AXTreeSourceObserver<AXNodeSource, AXTreeDataType, AXNodeDataType>*
observer) {
NOTIMPLEMENTED();
}
diff --git a/ui/accessibility/ax_tree_source_annotator.h b/ui/accessibility/ax_tree_source_annotator.h
index 903983e9..be7abab 100644
--- a/ui/accessibility/ax_tree_source_annotator.h
+++ b/ui/accessibility/ax_tree_source_annotator.h
@@ -21,9 +21,7 @@
// work on multiple `AXNodeSource`s, e.g. `AXNode*` and `WebAXObject`.
template <typename AXNodeSource>
class AX_EXPORT AXTreeSourceAnnotator
- : public AXTreeSourceObserver<AXNodeSource,
- ui::AXTreeData*,
- ui::AXNodeData> {
+ : public AXTreeSourceObserver<AXNodeSource, AXTreeData*, AXNodeData> {
public:
virtual ~AXTreeSourceAnnotator() = default;
@@ -31,8 +29,7 @@
// `AXNodeSource`, if any. For example, in the case of an unlabeled image,
// this would return automatically generated alt text for the image.
virtual std::string GetAnnotation(
- const AXTreeSource<AXNodeSource, ui::AXTreeData*, ui::AXNodeData>&
- tree_source,
+ const AXTreeSource<AXNodeSource, AXTreeData*, AXNodeData>& tree_source,
const AXNodeSource& node_source) const = 0;
// Returns a value indicating the status of the automatically generated
@@ -41,23 +38,20 @@
//
// TODO(nektar): Rename `ImageAnnotationStatus` to `AnnotationStatus`.
virtual ax::mojom::ImageAnnotationStatus GetAnnotationStatus(
- const AXTreeSource<AXNodeSource, ui::AXTreeData*, ui::AXNodeData>&
- tree_source,
+ const AXTreeSource<AXNodeSource, AXTreeData*, AXNodeData>& tree_source,
const AXNodeSource& node_source) const = 0;
// Returns true if an accessible name for the given `AXNodeSource` has already
// been automatically generated.
virtual bool HasAnnotationInCache(
- const AXTreeSource<AXNodeSource, ui::AXTreeData*, ui::AXNodeData>&
- tree_source,
+ const AXTreeSource<AXNodeSource, AXTreeData*, AXNodeData>& tree_source,
const AXNodeSource& node_source) const = 0;
// Returns true if an accessible name for the given `AXNodeSource` has already
// been automatically generated, is in the process of being generated, or has
// encountered an error.
virtual bool HasNodeInCache(
- const AXTreeSource<AXNodeSource, ui::AXTreeData*, ui::AXNodeData>&
- tree_source,
+ const AXTreeSource<AXNodeSource, AXTreeData*, AXNodeData>& tree_source,
const AXNodeSource& node_source) const = 0;
// Returns true if the existing accessible name for a node consists of mostly
diff --git a/ui/accessibility/ax_tree_source_checker.h b/ui/accessibility/ax_tree_source_checker.h
index d56f6fc..ab3a4d6 100644
--- a/ui/accessibility/ax_tree_source_checker.h
+++ b/ui/accessibility/ax_tree_source_checker.h
@@ -19,7 +19,7 @@
class AXTreeSourceChecker {
public:
explicit AXTreeSourceChecker(
- AXTreeSource<AXSourceNode, ui::AXTreeData*, ui::AXNodeData>* tree);
+ AXTreeSource<AXSourceNode, AXTreeData*, AXNodeData>* tree);
AXTreeSourceChecker(const AXTreeSourceChecker&) = delete;
AXTreeSourceChecker& operator=(const AXTreeSourceChecker&) = delete;
@@ -35,14 +35,14 @@
bool Check(AXSourceNode node, std::string indent, std::string* output);
std::string NodeToString(AXSourceNode node);
- raw_ptr<AXTreeSource<AXSourceNode, ui::AXTreeData*, ui::AXNodeData>> tree_;
+ raw_ptr<AXTreeSource<AXSourceNode, AXTreeData*, AXNodeData>> tree_;
std::map<AXNodeID, AXNodeID> node_id_to_parent_id_map_;
};
template <typename AXSourceNode>
AXTreeSourceChecker<AXSourceNode>::AXTreeSourceChecker(
- AXTreeSource<AXSourceNode, ui::AXTreeData*, ui::AXNodeData>* tree)
+ AXTreeSource<AXSourceNode, AXTreeData*, AXNodeData>* tree)
: tree_(tree) {}
template <typename AXSourceNode>
diff --git a/ui/accessibility/ax_tree_source_checker_unittest.cc b/ui/accessibility/ax_tree_source_checker_unittest.cc
index c41eef0..6f41ddd1 100644
--- a/ui/accessibility/ax_tree_source_checker_unittest.cc
+++ b/ui/accessibility/ax_tree_source_checker_unittest.cc
@@ -33,7 +33,7 @@
// about errors in accessibility trees that have inconsistent parent/child
// links.
class FakeAXTreeSource
- : public AXTreeSource<const FakeAXNode*, ui::AXTreeData*, ui::AXNodeData> {
+ : public AXTreeSource<const FakeAXNode*, AXTreeData*, AXNodeData> {
public:
FakeAXTreeSource(std::vector<FakeAXNode> nodes, AXNodeID root_id)
: nodes_(nodes), root_id_(root_id) {
diff --git a/ui/accessibility/ax_tree_unittest.cc b/ui/accessibility/ax_tree_unittest.cc
index d2fe1f1..ff702819 100644
--- a/ui/accessibility/ax_tree_unittest.cc
+++ b/ui/accessibility/ax_tree_unittest.cc
@@ -110,8 +110,8 @@
const AXNodeData& old_node_data,
const AXNodeData& new_node_data) override {}
void OnTreeDataChanged(AXTree* tree,
- const ui::AXTreeData& old_data,
- const ui::AXTreeData& new_data) override {
+ const AXTreeData& old_data,
+ const AXTreeData& new_data) override {
tree_data_changed_ = true;
}
@@ -376,10 +376,10 @@
initial_state.tree_data.title = "Title";
AXSerializableTree src_tree(initial_state);
- std::unique_ptr<AXTreeSource<const AXNode*, ui::AXTreeData*, ui::AXNodeData>>
+ std::unique_ptr<AXTreeSource<const AXNode*, AXTreeData*, AXNodeData>>
tree_source(src_tree.CreateTreeSource());
- AXTreeSerializer<const AXNode*, std::vector<const AXNode*>, ui::AXTreeUpdate*,
- ui::AXTreeData*, ui::AXNodeData>
+ AXTreeSerializer<const AXNode*, std::vector<const AXNode*>, AXTreeUpdate*,
+ AXTreeData*, AXNodeData>
serializer(tree_source.get());
AXTreeUpdate update;
serializer.SerializeChanges(src_tree.root(), &update);
@@ -1240,7 +1240,7 @@
node.id = 0;
initial_state.nodes.push_back(node);
initial_state.nodes.push_back(node);
- ui::AXTree tree;
+ AXTree tree;
#if DCHECK_IS_ON()
EXPECT_DEATH_IF_SUPPORTED(tree.Unserialize(initial_state),
"AXTreeUpdate contains invalid node");
@@ -1261,7 +1261,7 @@
node2.child_ids.push_back(1);
node2.child_ids.push_back(1);
initial_state.nodes.push_back(node2);
- ui::AXTree tree;
+ AXTree tree;
#if defined(AX_FAIL_FAST_BUILD)
EXPECT_DEATH_IF_SUPPORTED(tree.Unserialize(initial_state),
"Node 1 has duplicate child id 1");
@@ -1285,7 +1285,7 @@
node2.id = 2;
initial_state.nodes.push_back(node2);
- ui::AXTree tree;
+ AXTree tree;
#if defined(AX_FAIL_FAST_BUILD)
EXPECT_DEATH_IF_SUPPORTED(tree.Unserialize(initial_state),
"Node 1 has duplicate child id 2");
@@ -4998,26 +4998,26 @@
}
TEST(AXTreeTest, UpdateFromOutOfSyncTree) {
- ui::AXNodeData empty_document;
+ AXNodeData empty_document;
empty_document.id = 1;
empty_document.role = ax::mojom::Role::kRootWebArea;
- ui::AXTreeUpdate empty_document_initial_update;
+ AXTreeUpdate empty_document_initial_update;
empty_document_initial_update.root_id = empty_document.id;
empty_document_initial_update.nodes.push_back(empty_document);
AXTree tree;
EXPECT_TRUE(tree.Unserialize(empty_document_initial_update));
- ui::AXNodeData root;
+ AXNodeData root;
root.id = 3;
root.role = ax::mojom::Role::kRootWebArea;
root.child_ids = {1};
- ui::AXNodeData div;
+ AXNodeData div;
div.id = 1;
div.role = ax::mojom::Role::kGenericContainer;
- ui::AXTreeUpdate first_update;
+ AXTreeUpdate first_update;
first_update.root_id = root.id;
first_update.node_id_to_clear = root.id;
first_update.nodes = {root, div};
@@ -5027,19 +5027,19 @@
TEST(AXTreeTest, UnserializeErrors) {
base::HistogramTester histogram_tester;
- ui::AXNodeData empty_document;
+ AXNodeData empty_document;
empty_document.id = 1;
empty_document.role = ax::mojom::Role::kRootWebArea;
- ui::AXTreeUpdate tree_update;
+ AXTreeUpdate tree_update;
tree_update.root_id = empty_document.id;
tree_update.nodes.push_back(empty_document);
AXTree tree;
EXPECT_TRUE(tree.Unserialize(tree_update));
- ui::AXTreeUpdate tree_update_3;
+ AXTreeUpdate tree_update_3;
tree_update_3.root_id = empty_document.id;
- ui::AXNodeData disconnected_node;
+ AXNodeData disconnected_node;
disconnected_node.id = 2;
tree_update_3.nodes.push_back(disconnected_node);
#if defined(AX_FAIL_FAST_BUILD)
diff --git a/ui/accessibility/ax_tree_update.cc b/ui/accessibility/ax_tree_update.cc
index adf26fe..fae878a 100644
--- a/ui/accessibility/ax_tree_update.cc
+++ b/ui/accessibility/ax_tree_update.cc
@@ -17,7 +17,7 @@
AXTreeUpdate& AXTreeUpdate::operator=(AXTreeUpdate&& other) = default;
-AXTreeUpdate::AXTreeUpdate(const ui::AXTreeUpdate& other) = default;
+AXTreeUpdate::AXTreeUpdate(const AXTreeUpdate& other) = default;
AXTreeUpdate& AXTreeUpdate::operator=(const AXTreeUpdate& other) = default;
diff --git a/ui/accessibility/ax_tree_update_util.h b/ui/accessibility/ax_tree_update_util.h
index 72d6a98..0c3e5fa 100644
--- a/ui/accessibility/ax_tree_update_util.h
+++ b/ui/accessibility/ax_tree_update_util.h
@@ -22,8 +22,8 @@
//
// Merging tree updates helps minimize the overhead of calling
// Unserialize multiple times.
-AX_EXPORT bool MergeAXTreeUpdates(const std::vector<ui::AXTreeUpdate>& src,
- std::vector<ui::AXTreeUpdate>* dst);
+AX_EXPORT bool MergeAXTreeUpdates(const std::vector<AXTreeUpdate>& src,
+ std::vector<AXTreeUpdate>* dst);
} // namespace ui
diff --git a/ui/accessibility/ax_updates_and_events.cc b/ui/accessibility/ax_updates_and_events.cc
index 8293dae..7c91df9 100644
--- a/ui/accessibility/ax_updates_and_events.cc
+++ b/ui/accessibility/ax_updates_and_events.cc
@@ -8,7 +8,7 @@
namespace ui {
-AXUpdatesAndEvents::AXUpdatesAndEvents() : ax_tree_id(ui::AXTreeIDUnknown()) {}
+AXUpdatesAndEvents::AXUpdatesAndEvents() : ax_tree_id(AXTreeIDUnknown()) {}
AXUpdatesAndEvents::AXUpdatesAndEvents(AXUpdatesAndEvents&& other) = default;
AXUpdatesAndEvents& AXUpdatesAndEvents::operator=(AXUpdatesAndEvents&& other) =
@@ -17,7 +17,7 @@
AXUpdatesAndEvents::~AXUpdatesAndEvents() = default;
AXLocationChanges::AXLocationChanges()
- : id(-1), ax_tree_id(ui::AXTreeIDUnknown()) {}
+ : id(-1), ax_tree_id(AXTreeIDUnknown()) {}
AXLocationChanges::AXLocationChanges(const AXLocationChanges& other) = default;
diff --git a/ui/accessibility/ax_updates_and_events.h b/ui/accessibility/ax_updates_and_events.h
index a0441e5..072a81a3 100644
--- a/ui/accessibility/ax_updates_and_events.h
+++ b/ui/accessibility/ax_updates_and_events.h
@@ -30,13 +30,13 @@
~AXUpdatesAndEvents();
// The unique ID of the accessibility tree this event bundle applies to.
- ui::AXTreeID ax_tree_id;
+ AXTreeID ax_tree_id;
// Zero or more updates to the accessibility tree to apply first.
- std::vector<ui::AXTreeUpdate> updates;
+ std::vector<AXTreeUpdate> updates;
// Zero or more events to fire after the tree updates have been applied.
- std::vector<ui::AXEvent> events;
+ std::vector<AXEvent> events;
};
struct AX_BASE_EXPORT AXLocationChanges {
@@ -47,8 +47,8 @@
~AXLocationChanges();
int id;
- ui::AXTreeID ax_tree_id;
- ui::AXRelativeBounds new_location;
+ AXTreeID ax_tree_id;
+ AXRelativeBounds new_location;
};
} // namespace ui
diff --git a/ui/accessibility/null_ax_action_target.cc b/ui/accessibility/null_ax_action_target.cc
index c00e6df..2d6c5f0 100644
--- a/ui/accessibility/null_ax_action_target.cc
+++ b/ui/accessibility/null_ax_action_target.cc
@@ -10,8 +10,7 @@
return AXActionTarget::Type::kNull;
}
-bool NullAXActionTarget::PerformAction(
- const ui::AXActionData& action_data) const {
+bool NullAXActionTarget::PerformAction(const AXActionData& action_data) const {
return false;
}
diff --git a/ui/accessibility/null_ax_action_target_unittest.cc b/ui/accessibility/null_ax_action_target_unittest.cc
index eb27a0e..24ab1d9 100644
--- a/ui/accessibility/null_ax_action_target_unittest.cc
+++ b/ui/accessibility/null_ax_action_target_unittest.cc
@@ -15,7 +15,7 @@
std::make_unique<NullAXActionTarget>();
EXPECT_EQ(AXActionTarget::Type::kNull, action_target->GetType());
- ui::AXActionData action_data;
+ AXActionData action_data;
action_data.action = ax::mojom::Action::kFocus;
EXPECT_FALSE(action_target->PerformAction(action_data));
EXPECT_EQ(gfx::Rect(), action_target->GetRelativeBounds());
diff --git a/ui/accessibility/platform/browser_accessibility_cocoa.mm b/ui/accessibility/platform/browser_accessibility_cocoa.mm
index 3e9f034..2bf55206 100644
--- a/ui/accessibility/platform/browser_accessibility_cocoa.mm
+++ b/ui/accessibility/platform/browser_accessibility_cocoa.mm
@@ -46,10 +46,6 @@
using AXRange = ui::AXPlatformNodeDelegate::AXRange;
using StringAttribute = ax::mojom::StringAttribute;
using ui::AccessibilityMatchPredicate;
-using ui::BrowserAccessibility;
-using ui::BrowserAccessibilityManager;
-using ui::BrowserAccessibilityManagerMac;
-using ui::OneShotAccessibilityTreeSearch;
using ui::AXActionHandlerRegistry;
using ui::AXNodeData;
using ui::AXPlatformTreeManagerDelegate;
@@ -57,6 +53,10 @@
using ui::AXRangeToAXTextMarkerRange;
using ui::AXTextMarkerRangeToAXRange;
using ui::AXTextMarkerToAXPosition;
+using ui::BrowserAccessibility;
+using ui::BrowserAccessibilityManager;
+using ui::BrowserAccessibilityManagerMac;
+using ui::OneShotAccessibilityTreeSearch;
static_assert(
std::is_trivially_copyable<BrowserAccessibility::SerializedPosition>::value,
diff --git a/ui/accessibility/test_ax_tree_update.cc b/ui/accessibility/test_ax_tree_update.cc
index ae4dd60..e6f1489 100644
--- a/ui/accessibility/test_ax_tree_update.cc
+++ b/ui/accessibility/test_ax_tree_update.cc
@@ -334,9 +334,9 @@
DCHECK(node_data_vector.size() >= 1);
- tree_data.tree_id = ui::AXTreeID::CreateNewAXTreeID();
+ tree_data.tree_id = AXTreeID::CreateNewAXTreeID();
tree_data.focused_tree_id = tree_data.tree_id;
- tree_data.parent_tree_id = ui::AXTreeIDUnknown();
+ tree_data.parent_tree_id = AXTreeIDUnknown();
tree_data = tree_data;
has_tree_data = true;
root_id = node_data_vector[0].id;
diff --git a/ui/accessibility/test_single_ax_tree_manager.cc b/ui/accessibility/test_single_ax_tree_manager.cc
index 3be0eb3..0a2dbcd 100644
--- a/ui/accessibility/test_single_ax_tree_manager.cc
+++ b/ui/accessibility/test_single_ax_tree_manager.cc
@@ -73,18 +73,18 @@
}
AXTree* TestSingleAXTreeManager::Init(
- const ui::AXNodeData& node1,
- const ui::AXNodeData& node2 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node3 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node4 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node5 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node6 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node7 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node8 /* = ui::AXNodeData() */,
- const ui::AXNodeData& node9 /* = AXNodeData() */,
- const ui::AXNodeData& node10 /* = AXNodeData() */,
- const ui::AXNodeData& node11 /* = AXNodeData() */,
- const ui::AXNodeData& node12 /* = AXNodeData() */) {
+ const AXNodeData& node1,
+ const AXNodeData& node2 /* = AXNodeData() */,
+ const AXNodeData& node3 /* = AXNodeData() */,
+ const AXNodeData& node4 /* = AXNodeData() */,
+ const AXNodeData& node5 /* = AXNodeData() */,
+ const AXNodeData& node6 /* = AXNodeData() */,
+ const AXNodeData& node7 /* = AXNodeData() */,
+ const AXNodeData& node8 /* = AXNodeData() */,
+ const AXNodeData& node9 /* = AXNodeData() */,
+ const AXNodeData& node10 /* = AXNodeData() */,
+ const AXNodeData& node11 /* = AXNodeData() */,
+ const AXNodeData& node12 /* = AXNodeData() */) {
AXTreeUpdate update;
update.root_id = node1.id;
update.tree_data.title = "Dialog title";