OLD | NEW |
---|---|
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 Loading... | |
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 (tab_count() <= 0 || GetModelIndexOfTab(tab) < 0) | |
sky
2017/02/28 20:52:30
Why the tab_count() <= 0? Should GetModelIndexOfTa
| |
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 |
1351 int pos_in_set = GetModelIndexOfTab(tab) + 1; | |
1352 node_data->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, pos_in_set); | |
1348 } | 1353 } |
1349 | 1354 |
1350 void TabStrip::MouseMovedOutOfHost() { | 1355 void TabStrip::MouseMovedOutOfHost() { |
1351 ResizeLayoutTabs(); | 1356 ResizeLayoutTabs(); |
1352 if (reset_to_shrink_on_exit_) { | 1357 if (reset_to_shrink_on_exit_) { |
1353 reset_to_shrink_on_exit_ = false; | 1358 reset_to_shrink_on_exit_ = false; |
1354 SetStackedLayout(false); | 1359 SetStackedLayout(false); |
1355 controller_->StackedLayoutMaybeChanged(); | 1360 controller_->StackedLayoutMaybeChanged(); |
1356 } | 1361 } |
1357 } | 1362 } |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2781 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2786 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2782 if (view) | 2787 if (view) |
2783 return view; | 2788 return view; |
2784 } | 2789 } |
2785 Tab* tab = FindTabForEvent(point); | 2790 Tab* tab = FindTabForEvent(point); |
2786 if (tab) | 2791 if (tab) |
2787 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2792 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2788 } | 2793 } |
2789 return this; | 2794 return this; |
2790 } | 2795 } |
OLD | NEW |