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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 2719223002: Use correct position when setting pos_in_set for tabs.
Patch Set: Potential nit. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index e22c45709fd4e6b4064187737033379e62305ec0..c57ee1cfc16e6806b244619f620f98a83efc651d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1343,8 +1343,12 @@ int TabStrip::GetBackgroundResourceId(bool* custom_image) const {
void TabStrip::UpdateTabAccessibilityState(const Tab* tab,
ui::AXNodeData* node_data) {
+ if (GetModelIndexOfTab(tab) < 0)
sky 2017/03/01 00:31:18 Assign to local variable to avoid multiple calls.
+ return;
+
node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count());
- node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, GetModelIndexOfTab(tab));
+ node_data->AddValidatedIntAttribute(ui::AX_ATTR_INDEX_IN_SET,
+ GetModelIndexOfTab(tab));
}
void TabStrip::MouseMovedOutOfHost() {
« no previous file with comments | « no previous file | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698