Commit d4503c39 authored by Hiroki Sato's avatar Hiroki Sato Committed by Commit Bot

Fix lint errors under chrome/browser/chromeos/arc/accessibility/

Bug: None
Test: git cl lint
Change-Id: I52cc6c0c8191417f394e03e971a31c594cd424e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2206140Reviewed-by: default avatarSara Kato <sarakato@chromium.org>
Commit-Queue: Hiroki Sato <hirokisato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769963}
parent 1b10c593
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "components/arc/mojom/accessibility_helper.mojom.h" #include "components/arc/mojom/accessibility_helper.mojom.h"
#include <vector>
namespace ui { namespace ui {
struct AXNodeData; struct AXNodeData;
} // namespace ui } // namespace ui
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/arc/accessibility/accessibility_node_info_data_wrapper.h" #include "chrome/browser/chromeos/arc/accessibility/accessibility_node_info_data_wrapper.h"
#include <algorithm>
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "chrome/browser/chromeos/arc/accessibility/arc_accessibility_util.h" #include "chrome/browser/chromeos/arc/accessibility/arc_accessibility_util.h"
...@@ -353,7 +355,7 @@ void AccessibilityNodeInfoDataWrapper::Serialize( ...@@ -353,7 +355,7 @@ void AccessibilityNodeInfoDataWrapper::Serialize(
if (cached_name_ && !(*cached_name_).empty()) if (cached_name_ && !(*cached_name_).empty())
names.push_back(*cached_name_); names.push_back(*cached_name_);
// TODO (sarakato): Exposing all possible labels for a node, may result in // TODO(sarakato): Exposing all possible labels for a node, may result in
// too much being spoken. For ARC ++, this may result in divergent behaviour // too much being spoken. For ARC ++, this may result in divergent behaviour
// from Talkback. // from Talkback.
if (!names.empty()) if (!names.empty())
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_NODE_INFO_DATA_WRAPPER_H_ #ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_NODE_INFO_DATA_WRAPPER_H_
#define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_NODE_INFO_DATA_WRAPPER_H_ #define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_NODE_INFO_DATA_WRAPPER_H_
#include <string>
#include <vector>
#include "chrome/browser/chromeos/arc/accessibility/accessibility_info_data_wrapper.h" #include "chrome/browser/chromeos/arc/accessibility/accessibility_info_data_wrapper.h"
#include "ui/accessibility/ax_enum_util.h" #include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_node_data.h"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_WINDOW_INFO_DATA_WRAPPER_H_ #ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_WINDOW_INFO_DATA_WRAPPER_H_
#define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_WINDOW_INFO_DATA_WRAPPER_H_ #define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_ACCESSIBILITY_WINDOW_INFO_DATA_WRAPPER_H_
#include <string>
#include <vector> #include <vector>
#include "chrome/browser/chromeos/arc/accessibility/accessibility_info_data_wrapper.h" #include "chrome/browser/chromeos/arc/accessibility/accessibility_info_data_wrapper.h"
......
...@@ -502,7 +502,7 @@ void ArcAccessibilityHelperBridge::OnAction( ...@@ -502,7 +502,7 @@ void ArcAccessibilityHelperBridge::OnAction(
auto* instance = ARC_GET_INSTANCE_FOR_METHOD( auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
arc_bridge_service_->accessibility_helper(), PerformAction); arc_bridge_service_->accessibility_helper(), PerformAction);
if (!instance) { if (!instance) {
// TODO (b/146809329): This case should probably destroy all trees. // TODO(b/146809329): This case should probably destroy all trees.
OnActionResult(data, false); OnActionResult(data, false);
return; return;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <memory> #include <memory>
#include <set> #include <set>
#include <string> #include <string>
#include <tuple>
#include "ash/system/message_center/arc/arc_notification_surface_manager.h" #include "ash/system/message_center/arc/arc_notification_surface_manager.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h" #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include <unordered_map> #include <unordered_map>
#include <utility> #include <utility>
#include <vector>
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/system/message_center/arc/arc_notification_constants.h" #include "ash/system/message_center/arc/arc_notification_constants.h"
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <stack> #include <stack>
#include <string> #include <string>
#include <utility>
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -108,7 +109,7 @@ void AXTreeSourceArc::NotifyAccessibilityEvent(AXEventData* event_data) { ...@@ -108,7 +109,7 @@ void AXTreeSourceArc::NotifyAccessibilityEvent(AXEventData* event_data) {
} }
} }
std::vector<bool> is_important(event_data->node_data.size()); std::vector<bool> is_important(event_data->node_data.size());
BuildImportanceTable(event_data, node_data_index_map, is_important); BuildImportanceTable(event_data, node_data_index_map, &is_important);
for (int i = event_data->node_data.size() - 1; i >= 0; --i) { for (int i = event_data->node_data.size() - 1; i >= 0; --i) {
int32_t id = event_data->node_data[i]->id; int32_t id = event_data->node_data[i]->id;
AXNodeInfoData* node = event_data->node_data[i].get(); AXNodeInfoData* node = event_data->node_data[i].get();
...@@ -179,7 +180,7 @@ void AXTreeSourceArc::NotifyAccessibilityEvent(AXEventData* event_data) { ...@@ -179,7 +180,7 @@ void AXTreeSourceArc::NotifyAccessibilityEvent(AXEventData* event_data) {
if (!android_focused_id_ || !GetFromId(*android_focused_id_)) { if (!android_focused_id_ || !GetFromId(*android_focused_id_)) {
AccessibilityInfoDataWrapper* root = GetRoot(); AccessibilityInfoDataWrapper* root = GetRoot();
// TODO (sarakato): Add proper fix once cause of invalid node is known. // TODO(sarakato): Add proper fix once cause of invalid node is known.
if (!IsValid(root)) { if (!IsValid(root)) {
return; return;
} else { } else {
...@@ -329,16 +330,17 @@ gfx::Rect AXTreeSourceArc::ComputeEnclosingBounds( ...@@ -329,16 +330,17 @@ gfx::Rect AXTreeSourceArc::ComputeEnclosingBounds(
if (!info_data->IsVisibleToUser()) if (!info_data->IsVisibleToUser())
return computed_bounds; return computed_bounds;
ComputeEnclosingBoundsInternal(info_data, computed_bounds); ComputeEnclosingBoundsInternal(info_data, &computed_bounds);
return computed_bounds; return computed_bounds;
} }
void AXTreeSourceArc::ComputeEnclosingBoundsInternal( void AXTreeSourceArc::ComputeEnclosingBoundsInternal(
AccessibilityInfoDataWrapper* info_data, AccessibilityInfoDataWrapper* info_data,
gfx::Rect& computed_bounds) const { gfx::Rect* computed_bounds) const {
DCHECK(computed_bounds);
auto cached_bounds = computed_bounds_.find(info_data->GetId()); auto cached_bounds = computed_bounds_.find(info_data->GetId());
if (cached_bounds != computed_bounds_.end()) { if (cached_bounds != computed_bounds_.end()) {
computed_bounds.Union(cached_bounds->second); computed_bounds->Union(cached_bounds->second);
return; return;
} }
...@@ -346,7 +348,7 @@ void AXTreeSourceArc::ComputeEnclosingBoundsInternal( ...@@ -346,7 +348,7 @@ void AXTreeSourceArc::ComputeEnclosingBoundsInternal(
return; return;
if (info_data->CanBeAccessibilityFocused()) { if (info_data->CanBeAccessibilityFocused()) {
// Only consider nodes that can possibly be accessibility focused. // Only consider nodes that can possibly be accessibility focused.
computed_bounds.Union(info_data->GetBounds()); computed_bounds->Union(info_data->GetBounds());
return; return;
} }
std::vector<AccessibilityInfoDataWrapper*> children; std::vector<AccessibilityInfoDataWrapper*> children;
...@@ -391,8 +393,9 @@ bool AXTreeSourceArc::ComputeIsClickableLeaf( ...@@ -391,8 +393,9 @@ bool AXTreeSourceArc::ComputeIsClickableLeaf(
void AXTreeSourceArc::BuildImportanceTable( void AXTreeSourceArc::BuildImportanceTable(
AXEventData* event_data, AXEventData* event_data,
const std::map<int32_t, int32_t>& node_id_to_nodes_index, const std::map<int32_t, int32_t>& node_id_to_nodes_index,
std::vector<bool>& out_values) const { std::vector<bool>* out_values) const {
DCHECK(out_values.size() == event_data->node_data.size()); DCHECK(out_values);
DCHECK(out_values->size() == event_data->node_data.size());
// First, compute whether each node has important properties in its subtree. // First, compute whether each node has important properties in its subtree.
for (size_t i = 0; i < event_data->window_data->size(); ++i) { for (size_t i = 0; i < event_data->window_data->size(); ++i) {
...@@ -409,15 +412,16 @@ void AXTreeSourceArc::BuildImportanceTable( ...@@ -409,15 +412,16 @@ void AXTreeSourceArc::BuildImportanceTable(
// Second, node is important in Chrome if it's important in Android and has // Second, node is important in Chrome if it's important in Android and has
// any important property. // any important property.
for (size_t i = 0; i < event_data->node_data.size(); ++i) for (size_t i = 0; i < event_data->node_data.size(); ++i)
out_values[i] = out_values->at(i) = out_values->at(i) &
out_values[i] & IsImportantInAndroid(event_data->node_data[i].get()); IsImportantInAndroid(event_data->node_data[i].get());
} }
bool AXTreeSourceArc::BuildHasImportantProperty( bool AXTreeSourceArc::BuildHasImportantProperty(
int32_t nodes_index, int32_t nodes_index,
const std::vector<AXNodeInfoDataPtr>& nodes, const std::vector<AXNodeInfoDataPtr>& nodes,
const std::map<int32_t, int32_t>& node_id_to_nodes_index, const std::map<int32_t, int32_t>& node_id_to_nodes_index,
std::vector<bool>& has_important_prop_cache) const { std::vector<bool>* has_important_prop_cache) const {
DCHECK(has_important_prop_cache);
AXNodeInfoData* node = nodes[nodes_index].get(); AXNodeInfoData* node = nodes[nodes_index].get();
bool has_important_prop = HasImportantProperty(node) || bool has_important_prop = HasImportantProperty(node) ||
...@@ -433,7 +437,7 @@ bool AXTreeSourceArc::BuildHasImportantProperty( ...@@ -433,7 +437,7 @@ bool AXTreeSourceArc::BuildHasImportantProperty(
} }
} }
has_important_prop_cache[nodes_index] = has_important_prop; has_important_prop_cache->at(nodes_index) = has_important_prop;
return has_important_prop; return has_important_prop;
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <map> #include <map>
#include <memory> #include <memory>
#include <set>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -97,7 +98,7 @@ class AXTreeSourceArc : public ui::AXTreeSource<AccessibilityInfoDataWrapper*, ...@@ -97,7 +98,7 @@ class AXTreeSourceArc : public ui::AXTreeSource<AccessibilityInfoDataWrapper*,
// Helper to recursively compute bounds for |info_data|. Returns true if // Helper to recursively compute bounds for |info_data|. Returns true if
// non-empty bounds were encountered. // non-empty bounds were encountered.
void ComputeEnclosingBoundsInternal(AccessibilityInfoDataWrapper* info_data, void ComputeEnclosingBoundsInternal(AccessibilityInfoDataWrapper* info_data,
gfx::Rect& computed_bounds) const; gfx::Rect* computed_bounds) const;
// Computes if the node is clickable and has no clickable descendants. // Computes if the node is clickable and has no clickable descendants.
bool ComputeIsClickableLeaf( bool ComputeIsClickableLeaf(
...@@ -110,13 +111,13 @@ class AXTreeSourceArc : public ui::AXTreeSource<AccessibilityInfoDataWrapper*, ...@@ -110,13 +111,13 @@ class AXTreeSourceArc : public ui::AXTreeSource<AccessibilityInfoDataWrapper*,
void BuildImportanceTable( void BuildImportanceTable(
mojom::AccessibilityEventData* event_data, mojom::AccessibilityEventData* event_data,
const std::map<int32_t, int32_t>& node_id_to_nodes_index, const std::map<int32_t, int32_t>& node_id_to_nodes_index,
std::vector<bool>& out_node) const; std::vector<bool>* out_node) const;
bool BuildHasImportantProperty( bool BuildHasImportantProperty(
int32_t nodes_index, int32_t nodes_index,
const std::vector<mojom::AccessibilityNodeInfoDataPtr>& nodes, const std::vector<mojom::AccessibilityNodeInfoDataPtr>& nodes,
const std::map<int32_t, int32_t>& node_id_to_nodes_index, const std::map<int32_t, int32_t>& node_id_to_nodes_index,
std::vector<bool>& has_important_prop_cache) const; std::vector<bool>* has_important_prop_cache) const;
// Find the most top-left focusable node under the given node. // Find the most top-left focusable node under the given node.
AccessibilityInfoDataWrapper* FindFirstFocusableNode( AccessibilityInfoDataWrapper* FindFirstFocusableNode(
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_ #ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_
#define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_ #define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_
#include "chrome/browser/chromeos/arc/accessibility/geometry_util.h"
#include "components/exo/wm_helper.h" #include "components/exo/wm_helper.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_ #ifndef CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_
#define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_ #define CHROME_BROWSER_CHROMEOS_ARC_ACCESSIBILITY_GEOMETRY_UTIL_H_
// TODO(hirokisato) support multiple display. // TODO(hirokisato): support multiple display.
namespace gfx { namespace gfx {
class RectF; class RectF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment