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

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

Issue 2719223002: Use correct position when setting pos_in_set for tabs.
Patch Set: 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 | no next file » | 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..8ca3342a37703a142424c62f8f150f7854bda14c 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1344,7 +1344,9 @@ int TabStrip::GetBackgroundResourceId(bool* custom_image) const {
void TabStrip::UpdateTabAccessibilityState(const Tab* tab,
ui::AXNodeData* node_data) {
node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count());
- node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, GetModelIndexOfTab(tab));
+
+ int pos_in_set = tab_count() ? GetModelIndexOfTab(tab) + 1 : 0;
sky 2017/02/28 04:01:05 GetModelIndexOfTab may return -1 if tab is closing
David Tseng 2017/02/28 19:26:52 Added explicit check (which omits data if it is no
+ node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, pos_in_set);
sky 2017/02/28 04:02:33 One more comment. Why do we need AX_ATTR_POS_IN_SE
David Tseng 2017/02/28 19:26:52 It's spec'ed as 1-based in the relevant W3C doc (A
}
void TabStrip::MouseMovedOutOfHost() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698