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

Side by Side Diff: athena/content/chrome/media_utils.cc

Issue 863033002: Delete athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « athena/content/chrome/dialogs.cc ('k') | athena/content/chrome/web_activity_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "athena/content/media_utils.h"
6
7 #include "athena/activity/public/activity.h"
8 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
9 #include "chrome/browser/media/media_stream_capture_indicator.h"
10 #include "content/browser/media/audio_stream_monitor.h"
11 #include "content/public/browser/web_contents.h"
12
13 namespace athena {
14
15 Activity::ActivityMediaState GetActivityMediaState(
16 content::WebContents* contents) {
17 // TODO(skuhne): This needs to be refactored and / or moved out of Chrome.
18 // See crbug.com/420677.
19 scoped_refptr<MediaStreamCaptureIndicator> indicator =
20 MediaCaptureDevicesDispatcher::GetInstance()->
21 GetMediaStreamCaptureIndicator();
22 if (indicator.get() && indicator->IsCapturingUserMedia(contents))
23 return Activity::ACTIVITY_MEDIA_STATE_RECORDING;
24
25 if (contents->GetCapturerCount())
26 return Activity::ACTIVITY_MEDIA_STATE_CAPTURING;
27
28 DCHECK(content::AudioStreamMonitor::monitoring_available());
29 return contents->WasRecentlyAudible() ?
30 Activity::ACTIVITY_MEDIA_STATE_AUDIO_PLAYING :
31 Activity::ACTIVITY_MEDIA_STATE_NONE;
32 }
33
34 } // namespace athena
OLDNEW
« no previous file with comments | « athena/content/chrome/dialogs.cc ('k') | athena/content/chrome/web_activity_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698