Index: chrome/browser/extensions/api/tabs/tabs_event_router.h |
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.h b/chrome/browser/extensions/api/tabs/tabs_event_router.h |
index 73ee2c95945800530d26e0e89ebcf410b8c8dc4a..1a5eb3283dec203c18818b4ca9cab2761ba67efe 100644 |
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.h |
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.h |
@@ -84,6 +84,14 @@ class TabsEventRouter : public TabStripModelObserver, |
// and Observe/NAV_ENTRY_COMMITTED. |
void TabUpdated(content::WebContents* contents, bool did_navigate); |
+ // Internal processing of tab audible and muted state change events. |
+ // Called by TabUpdated. |
+ void TabAudibleStateChanged(content::WebContents* contents, |
+ bool audible); |
+ void TabMutedStateChanged(content::WebContents* contents, |
+ bool muted, |
+ const std::string& cause); |
+ |
// Triggers a tab updated event if the favicon URL changes. |
void FaviconUrlUpdated(content::WebContents* contents); |
@@ -129,6 +137,7 @@ class TabsEventRouter : public TabStripModelObserver, |
// - distinguish between tab creation and tab insertion |
// - not send tab-detached after tab-removed |
// - reduce the "noise" of TabChangedAt() when sending events to extensions |
+ // - remember last muted and audible states to know if there was a change |
class TabEntry { |
public: |
// Create a new tab entry whose initial state is TAB_COMPLETE. This |
@@ -150,6 +159,12 @@ class TabsEventRouter : public TabStripModelObserver, |
// should be sent. |
base::DictionaryValue* DidNavigate(const content::WebContents* contents); |
+ // Keep track of previous audible and muted states and allow toggling them |
+ bool AudibleChanged(bool val) const; |
+ bool MutedChanged(bool val) const; |
+ void ToggleAudible(); |
+ void ToggleMuted(); |
+ |
private: |
// Whether we are waiting to fire the 'complete' status change. This will |
// occur the first time the WebContents stops loading after the |
@@ -157,6 +172,10 @@ class TabsEventRouter : public TabStripModelObserver, |
// loading state subsequently, but we will ignore those changes. |
bool complete_waiting_on_load_; |
+ // Previous audible and muted states |
+ bool wasAudible_; |
miu
2015/03/10 18:51:39
style: No camel case for variables in Chromium C++
Jared Sohn
2015/03/16 02:34:29
Done.
|
+ bool wasMuted_; |
+ |
GURL url_; |
}; |