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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 591963002: Tab audio mute control (views UI), behind a switch (off by default). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + add about:flags experiment Created 6 years, 2 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
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 #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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698