Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: ui/accessibility/ax_node_data.cc

Issue 2719223002: Use correct position when setting pos_in_set for tabs.
Patch Set: Potential nit. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/accessibility/ax_node_data.h" 5 #include "ui/accessibility/ax_node_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 void AXNodeData::AddStringAttribute( 362 void AXNodeData::AddStringAttribute(
363 AXStringAttribute attribute, const std::string& value) { 363 AXStringAttribute attribute, const std::string& value) {
364 string_attributes.push_back(std::make_pair(attribute, value)); 364 string_attributes.push_back(std::make_pair(attribute, value));
365 } 365 }
366 366
367 void AXNodeData::AddIntAttribute( 367 void AXNodeData::AddIntAttribute(
368 AXIntAttribute attribute, int value) { 368 AXIntAttribute attribute, int value) {
369 int_attributes.push_back(std::make_pair(attribute, value)); 369 int_attributes.push_back(std::make_pair(attribute, value));
370 } 370 }
371 371
372 void AXNodeData::AddValidatedIntAttribute(AXValidatedIntAttribute attribute,
373 int value) {
374 switch (attribute) {
375 case ui::AX_ATTR_INDEX_IN_SET:
376 if (value < 0) {
377 NOTREACHED();
378 return;
379 }
380 AddIntAttribute(ui::AX_ATTR_POS_IN_SET, value + 1);
381 break;
382 default:
383 NOTREACHED();
384 }
385 }
386
372 void AXNodeData::AddFloatAttribute( 387 void AXNodeData::AddFloatAttribute(
373 AXFloatAttribute attribute, float value) { 388 AXFloatAttribute attribute, float value) {
374 float_attributes.push_back(std::make_pair(attribute, value)); 389 float_attributes.push_back(std::make_pair(attribute, value));
375 } 390 }
376 391
377 void AXNodeData::AddBoolAttribute( 392 void AXNodeData::AddBoolAttribute(
378 AXBoolAttribute attribute, bool value) { 393 AXBoolAttribute attribute, bool value) {
379 bool_attributes.push_back(std::make_pair(attribute, value)); 394 bool_attributes.push_back(std::make_pair(attribute, value));
380 } 395 }
381 396
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 } 936 }
922 } 937 }
923 938
924 if (!child_ids.empty()) 939 if (!child_ids.empty())
925 result += " child_ids=" + IntVectorToString(child_ids); 940 result += " child_ids=" + IntVectorToString(child_ids);
926 941
927 return result; 942 return result;
928 } 943 }
929 944
930 } // namespace ui 945 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698