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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 const int closed_tab_index = FindClosingTab(tab).first->first; | 997 const int closed_tab_index = FindClosingTab(tab).first->first; |
998 if (closed_tab_index < GetModelCount()) | 998 if (closed_tab_index < GetModelCount()) |
999 controller_->CloseTab(closed_tab_index, source); | 999 controller_->CloseTab(closed_tab_index, source); |
1000 return; | 1000 return; |
1001 } | 1001 } |
1002 int model_index = GetModelIndexOfTab(tab); | 1002 int model_index = GetModelIndexOfTab(tab); |
1003 if (IsValidModelIndex(model_index)) | 1003 if (IsValidModelIndex(model_index)) |
1004 controller_->CloseTab(model_index, source); | 1004 controller_->CloseTab(model_index, source); |
1005 } | 1005 } |
1006 | 1006 |
| 1007 void TabStrip::ToggleTabAudioMute(Tab* tab) { |
| 1008 int model_index = GetModelIndexOfTab(tab); |
| 1009 if (IsValidModelIndex(model_index)) |
| 1010 controller_->ToggleTabAudioMute(model_index); |
| 1011 } |
| 1012 |
1007 void TabStrip::ShowContextMenuForTab(Tab* tab, | 1013 void TabStrip::ShowContextMenuForTab(Tab* tab, |
1008 const gfx::Point& p, | 1014 const gfx::Point& p, |
1009 ui::MenuSourceType source_type) { | 1015 ui::MenuSourceType source_type) { |
1010 controller_->ShowContextMenuForTab(tab, p, source_type); | 1016 controller_->ShowContextMenuForTab(tab, p, source_type); |
1011 } | 1017 } |
1012 | 1018 |
1013 bool TabStrip::IsActiveTab(const Tab* tab) const { | 1019 bool TabStrip::IsActiveTab(const Tab* tab) const { |
1014 int model_index = GetModelIndexOfTab(tab); | 1020 int model_index = GetModelIndexOfTab(tab); |
1015 return IsValidModelIndex(model_index) && | 1021 return IsValidModelIndex(model_index) && |
1016 controller_->IsActiveTab(model_index); | 1022 controller_->IsActiveTab(model_index); |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2724 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2730 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2725 if (view) | 2731 if (view) |
2726 return view; | 2732 return view; |
2727 } | 2733 } |
2728 Tab* tab = FindTabForEvent(point); | 2734 Tab* tab = FindTabForEvent(point); |
2729 if (tab) | 2735 if (tab) |
2730 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2736 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2731 } | 2737 } |
2732 return this; | 2738 return this; |
2733 } | 2739 } |
OLD | NEW |