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

Side by Side 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, 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/tabs/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND; 1337 IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND;
1338 *custom_image = 1338 *custom_image =
1339 tp->HasCustomImage(id) || tp->HasCustomImage(IDR_THEME_FRAME) || 1339 tp->HasCustomImage(id) || tp->HasCustomImage(IDR_THEME_FRAME) ||
1340 (incognito && tp->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); 1340 (incognito && tp->HasCustomImage(IDR_THEME_FRAME_INCOGNITO));
1341 return id; 1341 return id;
1342 } 1342 }
1343 1343
1344 void TabStrip::UpdateTabAccessibilityState(const Tab* tab, 1344 void TabStrip::UpdateTabAccessibilityState(const Tab* tab,
1345 ui::AXNodeData* node_data) { 1345 ui::AXNodeData* node_data) {
1346 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count()); 1346 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count());
1347 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, GetModelIndexOfTab(tab)); 1347
1348 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
1349 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
1348 } 1350 }
1349 1351
1350 void TabStrip::MouseMovedOutOfHost() { 1352 void TabStrip::MouseMovedOutOfHost() {
1351 ResizeLayoutTabs(); 1353 ResizeLayoutTabs();
1352 if (reset_to_shrink_on_exit_) { 1354 if (reset_to_shrink_on_exit_) {
1353 reset_to_shrink_on_exit_ = false; 1355 reset_to_shrink_on_exit_ = false;
1354 SetStackedLayout(false); 1356 SetStackedLayout(false);
1355 controller_->StackedLayoutMaybeChanged(); 1357 controller_->StackedLayoutMaybeChanged();
1356 } 1358 }
1357 } 1359 }
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); 2783 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point);
2782 if (view) 2784 if (view)
2783 return view; 2785 return view;
2784 } 2786 }
2785 Tab* tab = FindTabForEvent(point); 2787 Tab* tab = FindTabForEvent(point);
2786 if (tab) 2788 if (tab)
2787 return ConvertPointToViewAndGetEventHandler(this, tab, point); 2789 return ConvertPointToViewAndGetEventHandler(this, tab, point);
2788 } 2790 }
2789 return this; 2791 return this;
2790 } 2792 }
OLDNEW
« 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