Chromium Code Reviews| Index: chrome/browser/extensions/api/tabs/tabs_api.cc |
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc |
| index 4816da7e0687d8ce20a9b3f0af4717c47edc2252..c157b3cad2cd007e5e8f5bed0705870c410c906a 100644 |
| --- a/chrome/browser/extensions/api/tabs/tabs_api.cc |
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc |
| @@ -43,6 +43,7 @@ |
| #include "chrome/browser/ui/host_desktop.h" |
| #include "chrome/browser/ui/panels/panel_manager.h" |
| #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| +#include "chrome/browser/ui/tabs/tab_utils.h" |
| #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| #include "chrome/browser/web_applications/web_app.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -908,6 +909,16 @@ bool TabsQueryFunction::RunSync() { |
| continue; |
| } |
| + if (!MatchesBool(params->query_info.audible.get(), |
| + chrome::IsPlayingAudio(web_contents))) { |
| + continue; |
| + } |
| + |
| + if (!MatchesBool(params->query_info.muted.get(), |
| + chrome::IsTabAudioMuted(web_contents))) { |
| + continue; |
| + } |
| + |
| if (!title.empty() && !MatchPattern(web_contents->GetTitle(), |
| base::UTF8ToUTF16(title))) |
| continue; |
| @@ -1185,6 +1196,11 @@ bool TabsUpdateFunction::RunAsync() { |
| tab_index = tab_strip->GetIndexOfWebContents(contents); |
| } |
| + if (params->update_properties.muted.get()) { |
| + bool muted = *params->update_properties.muted; |
|
not at google - send to devlin
2015/05/26 23:09:46
Could you make this (and I may have the names wron
Jared Sohn
2015/05/27 14:52:02
Done (after making a few changes including not nam
not at google - send to devlin
2015/05/28 23:04:42
Nah no need for a separate flag. I think the API c
miu
2015/05/28 23:36:59
It's designed to report whatever state the WebCont
not at google - send to devlin
2015/05/29 21:28:15
Awesome. In that case we should actually be able t
|
| + chrome::SetTabAudioMuted(contents, muted, extension()->id()); |
| + } |
| + |
| if (params->update_properties.opener_tab_id.get()) { |
| int opener_id = *params->update_properties.opener_tab_id; |