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

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

Issue 757033005: Make tab audible and muted states and cause available for an extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better webcontents_impl decoupling Created 5 years, 11 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 4480a41609f149cbc48f01466975e4358718eaa5..dedee37534231d68025cc3bf5dcf15a59ed4be95 100644
--- a/chrome/browser/ui/tabs/tab_utils.h
+++ b/chrome/browser/ui/tabs/tab_utils.h
@@ -5,10 +5,12 @@
#ifndef CHROME_BROWSER_UI_TABS_TAB_UTILS_H_
#define CHROME_BROWSER_UI_TABS_TAB_UTILS_H_
+#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
+#include "content/public/browser/web_contents_user_data.h"
class TabStripModel;
@@ -33,6 +35,11 @@ enum TabMediaState {
namespace chrome {
+// String to indicate reason for muted state change (user, capture, extension
+// id, or empty string)
+const char kMutedToggleCauseUser[] = "user";
+const char kMutedToggleCauseCapture[] = "auto-forced for capture";
+
// Logic to determine which components (i.e., close button, favicon, and media
// indicator) of a tab should be shown, given current state. |capacity|
// specifies how many components can be shown, given available tab width.
@@ -99,7 +106,12 @@ bool CanToggleAudioMute(content::WebContents* contents);
// Indicates/Sets whether all audio output from |contents| is muted.
bool IsTabAudioMuted(content::WebContents* contents);
-void SetTabAudioMuted(content::WebContents* contents, bool mute);
+void SetTabAudioMuted(content::WebContents* contents,
+ bool muted,
+ const std::string& cause);
+
+// Get cause of mute (extensionid, kMutedToggleCause constant, or empty string)
+std::string& GetTabAudioMutedCause(content::WebContents* contents);
miu 2015/01/22 00:55:23 Please make the return type const std::string& to
// Returns true if the tabs at the |indices| in |tab_strip| are all muted.
bool AreAllTabsMuted(const TabStripModel& tab_strip,

Powered by Google App Engine
This is Rietveld 408576698