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

Unified Diff: chrome/browser/ui/tabs/tab_menu_model.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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_menu_model.cc
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc
index 6ab624ad6d3a52576ff486a07cc73132bbb72a91..ba70eac9ac2c9f5cb39d408af6ccbf112950d374 100644
--- a/chrome/browser/ui/tabs/tab_menu_model.cc
+++ b/chrome/browser/ui/tabs/tab_menu_model.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
+#include "chrome/browser/ui/tabs/tab_utils.h"
#include "chrome/grit/generated_resources.h"
TabMenuModel::TabMenuModel(ui::SimpleMenuModel::Delegate* delegate,
@@ -35,6 +36,23 @@ void TabMenuModel::Build(TabStripModel* tab_strip, int index) {
TabStripModel::CommandTogglePinned,
will_pin ? IDS_TAB_CXMENU_PIN_TAB : IDS_TAB_CXMENU_UNPIN_TAB);
}
+ if (chrome::IsTabAudioMutingFeatureEnabled()) {
+ if (affects_multiple_tabs) {
+ const bool will_mute = !chrome::AreAllTabsMuted(
+ *tab_strip, tab_strip->selection_model().selected_indices());
+ AddItemWithStringId(
+ TabStripModel::CommandToggleTabAudioMuted,
+ will_mute ? IDS_TAB_CXMENU_AUDIO_MUTE_TABS :
+ IDS_TAB_CXMENU_AUDIO_UNMUTE_TABS);
+ } else {
+ const bool will_mute =
+ !chrome::IsTabAudioMuted(tab_strip->GetWebContentsAt(index));
+ AddItemWithStringId(
+ TabStripModel::CommandToggleTabAudioMuted,
+ will_mute ? IDS_TAB_CXMENU_AUDIO_MUTE_TAB :
+ IDS_TAB_CXMENU_AUDIO_UNMUTE_TAB);
+ }
+ }
AddSeparator(ui::NORMAL_SEPARATOR);
if (affects_multiple_tabs) {
AddItemWithStringId(TabStripModel::CommandCloseTab,
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/tabs/tab_strip_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698