OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/tabs/tab_utils.h" | 5 #include "chrome/browser/ui/tabs/tab_utils.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 9 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
10 #include "chrome/browser/media/media_stream_capture_indicator.h" | 10 #include "chrome/browser/media/media_stream_capture_indicator.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_MEDIA_STATE_CAPTURING)); | 227 l10n_util::GetStringUTF16(IDS_TOOLTIP_TAB_MEDIA_STATE_CAPTURING)); |
228 break; | 228 break; |
229 case TAB_MEDIA_STATE_NONE: | 229 case TAB_MEDIA_STATE_NONE: |
230 NOTREACHED(); | 230 NOTREACHED(); |
231 break; | 231 break; |
232 } | 232 } |
233 return result; | 233 return result; |
234 } | 234 } |
235 | 235 |
236 bool IsTabAudioMutingFeatureEnabled() { | 236 bool IsTabAudioMutingFeatureEnabled() { |
237 #if defined(USE_AURA) | |
238 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 237 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
239 switches::kEnableTabAudioMuting); | 238 switches::kEnableTabAudioMuting); |
240 #else | |
241 return false; | |
242 #endif | |
243 } | 239 } |
244 | 240 |
245 bool CanToggleAudioMute(content::WebContents* contents) { | 241 bool CanToggleAudioMute(content::WebContents* contents) { |
246 switch (GetTabMediaStateForContents(contents)) { | 242 switch (GetTabMediaStateForContents(contents)) { |
247 case TAB_MEDIA_STATE_NONE: | 243 case TAB_MEDIA_STATE_NONE: |
248 case TAB_MEDIA_STATE_AUDIO_PLAYING: | 244 case TAB_MEDIA_STATE_AUDIO_PLAYING: |
249 case TAB_MEDIA_STATE_AUDIO_MUTING: | 245 case TAB_MEDIA_STATE_AUDIO_MUTING: |
250 return IsTabAudioMutingFeatureEnabled(); | 246 return IsTabAudioMutingFeatureEnabled(); |
251 case TAB_MEDIA_STATE_RECORDING: | 247 case TAB_MEDIA_STATE_RECORDING: |
252 case TAB_MEDIA_STATE_CAPTURING: | 248 case TAB_MEDIA_STATE_CAPTURING: |
(...skipping 17 matching lines...) Expand all Loading... |
270 const std::vector<int>& indices) { | 266 const std::vector<int>& indices) { |
271 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); | 267 for (std::vector<int>::const_iterator i = indices.begin(); i != indices.end(); |
272 ++i) { | 268 ++i) { |
273 if (!IsTabAudioMuted(tab_strip.GetWebContentsAt(*i))) | 269 if (!IsTabAudioMuted(tab_strip.GetWebContentsAt(*i))) |
274 return false; | 270 return false; |
275 } | 271 } |
276 return true; | 272 return true; |
277 } | 273 } |
278 | 274 |
279 } // namespace chrome | 275 } // namespace chrome |
OLD | NEW |