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

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: 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
« no previous file with comments | « no previous file | ui/accessibility/ax_enums.idl » ('j') | 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 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 const int id = incognito ? 1336 const int id = incognito ?
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 if (GetModelIndexOfTab(tab) < 0)
sky 2017/03/01 00:31:18 Assign to local variable to avoid multiple calls.
1347 return;
1348
1346 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count()); 1349 node_data->AddIntAttribute(ui::AX_ATTR_SET_SIZE, tab_count());
1347 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, GetModelIndexOfTab(tab)); 1350 node_data->AddValidatedIntAttribute(ui::AX_ATTR_INDEX_IN_SET,
1351 GetModelIndexOfTab(tab));
1348 } 1352 }
1349 1353
1350 void TabStrip::MouseMovedOutOfHost() { 1354 void TabStrip::MouseMovedOutOfHost() {
1351 ResizeLayoutTabs(); 1355 ResizeLayoutTabs();
1352 if (reset_to_shrink_on_exit_) { 1356 if (reset_to_shrink_on_exit_) {
1353 reset_to_shrink_on_exit_ = false; 1357 reset_to_shrink_on_exit_ = false;
1354 SetStackedLayout(false); 1358 SetStackedLayout(false);
1355 controller_->StackedLayoutMaybeChanged(); 1359 controller_->StackedLayoutMaybeChanged();
1356 } 1360 }
1357 } 1361 }
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); 2785 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point);
2782 if (view) 2786 if (view)
2783 return view; 2787 return view;
2784 } 2788 }
2785 Tab* tab = FindTabForEvent(point); 2789 Tab* tab = FindTabForEvent(point);
2786 if (tab) 2790 if (tab)
2787 return ConvertPointToViewAndGetEventHandler(this, tab, point); 2791 return ConvertPointToViewAndGetEventHandler(this, tab, point);
2788 } 2792 }
2789 return this; 2793 return this;
2790 } 2794 }
OLDNEW
« 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