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

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: include case for TAB_MUTED_RESULT_SUCCESS first within switch to match enum order 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
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_constants.cc ('k') | chrome/browser/ui/tabs/tab_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0349b98ef596b081ac65efd90e420595f5c5f6dd 100644
--- a/chrome/browser/ui/tabs/tab_utils.h
+++ b/chrome/browser/ui/tabs/tab_utils.h
@@ -33,6 +33,12 @@ 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,
+};
+
namespace chrome {
// String to indicate reason for muted state change (user, capture, extension
@@ -109,9 +115,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);
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_constants.cc ('k') | chrome/browser/ui/tabs/tab_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698