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

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

Issue 1233263002: Clean up error handling logic for extension tab muting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: followups through codereview #8 Created 5 years, 5 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 2ca81514a81b2d0486e6534def812969cb610cd2..e55d87eb121433329693b631507c1467e5a7ae7d 100644
--- a/chrome/browser/ui/tabs/tab_utils.h
+++ b/chrome/browser/ui/tabs/tab_utils.h
@@ -7,7 +7,7 @@
#include <string>
#include <vector>
-
+#include "base/containers/hash_tables.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -33,6 +33,13 @@ enum TabMediaState {
TAB_MEDIA_STATE_AUDIO_MUTING, // Tab audio is being muted.
};
+enum TabMutedResult {
+ TAB_MUTED_RESULT_SUCCESS,
+ TAB_MUTED_RESULT_FAIL_NOT_ENABLED,
+ TAB_MUTED_RESULT_FAIL_TABCAPTURE,
+ TAB_MUTED_RESULT_FAIL_RATE_LIMITED,
+};
+
namespace chrome {
// String to indicate reason for muted state change (user, capture, extension
@@ -109,9 +116,9 @@ bool IsTabAudioMuted(content::WebContents* contents);
// Sets whether all audio output from |contents| is muted.
// Cause is extensionid, kMutedToggleCause constant, or empty string
-void SetTabAudioMuted(content::WebContents* contents,
- bool mute,
- const std::string& cause);
+TabMutedResult SetTabAudioMuted(content::WebContents* contents,
+ bool mute,
+ const std::string& cause);
// Get cause of mute (extensionid, kMutedToggleCause constant, or empty string)
const std::string& GetTabAudioMutedCause(content::WebContents* contents);

Powered by Google App Engine
This is Rietveld 408576698