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

Side by Side Diff: content/public/common/desktop_media_id.cc

Issue 100743003: Extend content::DesktopMediaID to allow Aura windows as capture sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « content/public/common/desktop_media_id.h ('k') | content/renderer/media/media_stream_impl.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 2013 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 "content/public/common/desktop_media_id.h"
6
7 namespace content {
8
9 // static
10 DesktopMediaID DesktopMediaID::Parse(const std::string& str) {
11 if (str == "screen")
12 return DesktopMediaID(TYPE_SCREEN, 0);
13
14 std::string window_prefix("window:");
15 if (StartsWithASCII(str, window_prefix, true)) {
16 int64 id;
17 if (!base::StringToInt64(str.substr(window_prefix.size()), &id))
18 return DesktopMediaID(TYPE_NONE, 0);
19 return DesktopMediaID(TYPE_WINDOW, id);
20 }
21
22 return DesktopMediaID(TYPE_NONE, 0);
23 }
24
25 std::string DesktopMediaID::ToString() {
26 switch (type) {
27 case TYPE_NONE:
28 NOTREACHED();
29 return std::string();
30
31 case TYPE_SCREEN:
32 return "screen";
33
34 case TYPE_WINDOW:
35 return "window:" + base::Int64ToString(id);
36 }
37 NOTREACHED();
38 return std::string();
39 }
40
41 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/desktop_media_id.h ('k') | content/renderer/media/media_stream_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698