| 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 tab_at(new_selection.active())->NotifyAccessibilityEvent( | 849 tab_at(new_selection.active())->NotifyAccessibilityEvent( |
| 850 ui::AX_EVENT_SELECTION, true); | 850 ui::AX_EVENT_SELECTION, true); |
| 851 } | 851 } |
| 852 | 852 |
| 853 void TabStrip::TabTitleChangedNotLoading(int model_index) { | 853 void TabStrip::TabTitleChangedNotLoading(int model_index) { |
| 854 Tab* tab = tab_at(model_index); | 854 Tab* tab = tab_at(model_index); |
| 855 if (tab->data().mini && !tab->IsActive()) | 855 if (tab->data().mini && !tab->IsActive()) |
| 856 tab->StartMiniTabTitleAnimation(); | 856 tab->StartMiniTabTitleAnimation(); |
| 857 } | 857 } |
| 858 | 858 |
| 859 int TabStrip::GetModelIndexOfTab(const Tab* tab) const { | |
| 860 return tabs_.GetIndexOfView(tab); | |
| 861 } | |
| 862 | |
| 863 int TabStrip::GetModelCount() const { | 859 int TabStrip::GetModelCount() const { |
| 864 return controller_->GetCount(); | 860 return controller_->GetCount(); |
| 865 } | 861 } |
| 866 | 862 |
| 867 bool TabStrip::IsValidModelIndex(int model_index) const { | 863 bool TabStrip::IsValidModelIndex(int model_index) const { |
| 868 return controller_->IsValidIndex(model_index); | 864 return controller_->IsValidIndex(model_index); |
| 869 } | 865 } |
| 870 | 866 |
| 871 bool TabStrip::IsDragSessionActive() const { | 867 bool TabStrip::IsDragSessionActive() const { |
| 872 return drag_controller_.get() != NULL; | 868 return drag_controller_.get() != NULL; |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 if (view) | 1458 if (view) |
| 1463 return view; | 1459 return view; |
| 1464 } | 1460 } |
| 1465 Tab* tab = FindTabForEvent(point); | 1461 Tab* tab = FindTabForEvent(point); |
| 1466 if (tab) | 1462 if (tab) |
| 1467 return ConvertPointToViewAndGetTooltipHandler(this, tab, point); | 1463 return ConvertPointToViewAndGetTooltipHandler(this, tab, point); |
| 1468 } | 1464 } |
| 1469 return this; | 1465 return this; |
| 1470 } | 1466 } |
| 1471 | 1467 |
| 1468 int TabStrip::GetModelIndexOfTab(const Tab* tab) const { |
| 1469 return tabs_.GetIndexOfView(tab); |
| 1470 } |
| 1471 |
| 1472 // static | 1472 // static |
| 1473 int TabStrip::GetImmersiveHeight() { | 1473 int TabStrip::GetImmersiveHeight() { |
| 1474 return Tab::GetImmersiveHeight(); | 1474 return Tab::GetImmersiveHeight(); |
| 1475 } | 1475 } |
| 1476 | 1476 |
| 1477 /////////////////////////////////////////////////////////////////////////////// | 1477 /////////////////////////////////////////////////////////////////////////////// |
| 1478 // TabStrip, private: | 1478 // TabStrip, private: |
| 1479 | 1479 |
| 1480 void TabStrip::Init() { | 1480 void TabStrip::Init() { |
| 1481 set_id(VIEW_ID_TAB_STRIP); | 1481 set_id(VIEW_ID_TAB_STRIP); |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 action = TouchUMA::GESTURE_TABSWITCH_TAP; | 2713 action = TouchUMA::GESTURE_TABSWITCH_TAP; |
| 2714 TouchUMA::RecordGestureAction(action); | 2714 TouchUMA::RecordGestureAction(action); |
| 2715 break; | 2715 break; |
| 2716 } | 2716 } |
| 2717 | 2717 |
| 2718 default: | 2718 default: |
| 2719 break; | 2719 break; |
| 2720 } | 2720 } |
| 2721 event->SetHandled(); | 2721 event->SetHandled(); |
| 2722 } | 2722 } |
| OLD | NEW |