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

Unified Diff: chrome/browser/ui/tabs/tab_utils.h

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: Addressed mpearson's comments; added a few CloseTab UMA's. 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
Index: chrome/browser/ui/tabs/tab_utils.h
diff --git a/chrome/browser/ui/tabs/tab_utils.h b/chrome/browser/ui/tabs/tab_utils.h
index c11000bc44596eb9e06c8a790e2558bc4a8f2554..152fbdd2756e2ae74f1e5aa6f696ab135431493e 100644
--- a/chrome/browser/ui/tabs/tab_utils.h
+++ b/chrome/browser/ui/tabs/tab_utils.h
@@ -23,7 +23,8 @@ enum TabMediaState {
TAB_MEDIA_STATE_NONE,
TAB_MEDIA_STATE_RECORDING, // Audio/Video being recorded, consumed by tab.
TAB_MEDIA_STATE_CAPTURING, // Tab contents being captured.
- TAB_MEDIA_STATE_AUDIO_PLAYING // Audible audio is playing from the tab.
+ TAB_MEDIA_STATE_AUDIO_PLAYING, // Audible audio is playing from the tab.
+ TAB_MEDIA_STATE_AUDIO_MUTING, // Tab audio is being muted.
};
namespace chrome {
@@ -67,6 +68,12 @@ TabMediaState GetTabMediaStateForContents(content::WebContents* contents);
// |media_state|. Uses the global ui::ResourceBundle shared instance.
const gfx::Image& GetTabMediaIndicatorImage(TabMediaState media_state);
+// Returns the cached image, to be shown by the media indicator button for mouse
+// hover/pressed, when the indicator is in the given |media_state|. Uses the
+// global ui::ResourceBundle shared instance.
+const gfx::Image& GetTabMediaIndicatorAffordanceImage(
+ TabMediaState media_state);
+
// Returns a non-continuous Animation that performs a fade-in or fade-out
// appropriate for the given |next_media_state|. This is used by the tab media
// indicator to alert the user that recording, tab capture, or audio playback
@@ -79,6 +86,13 @@ scoped_ptr<gfx::Animation> CreateTabMediaIndicatorFadeAnimation(
base::string16 AssembleTabTooltipText(const base::string16& title,
TabMediaState media_state);
+// Returns true if the experimental tab audio mute feature is enabled.
+bool IsTabAudioMutingFeatureEnabled();
+
+// Returns true if audio mute can be activated/deactivated for the given
+// |contents|.
+bool CanToggleAudioMute(content::WebContents* contents);
+
} // namespace chrome
#endif // CHROME_BROWSER_UI_TABS_TAB_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698