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

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

Issue 2291893002: Let Contraints Controll Mute/Unmute Audio Local Playback For Desktop Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename To DisableLocalEcho Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 "content/public/browser/desktop_media_id.h" 5 #include "content/public/browser/desktop_media_id.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 audio_share == other.audio_share; 119 audio_share == other.audio_share;
120 #endif 120 #endif
121 } 121 }
122 122
123 // static 123 // static
124 // Input string should in format: 124 // Input string should in format:
125 // for WebContents: 125 // for WebContents:
126 // web-contents-media-stream://"render_process_id":"render_process_id" 126 // web-contents-media-stream://"render_process_id":"render_process_id"
127 // for no aura screen and window: screen:"window_id" or window:"window_id" 127 // for no aura screen and window: screen:"window_id" or window:"window_id"
128 // for aura screen and window: screen:"window_id:aura_id" or 128 // for aura screen and window: screen:"window_id:aura_id" or
129 // window:"window_id:aura_id". 129 // window:"window_id:aura_id".
dcheng 2016/09/16 22:36:04 It doesn't have to be done in this CL... but can w
qiangchen 2016/09/16 22:45:52 Good suggestion. But I think one reason we use str
130 DesktopMediaID DesktopMediaID::Parse(const std::string& str) { 130 DesktopMediaID DesktopMediaID::Parse(const std::string& str) {
131 // For WebContents type. 131 // For WebContents type.
132 WebContentsMediaCaptureId web_id = WebContentsMediaCaptureId::Parse(str); 132 WebContentsMediaCaptureId web_id;
133 if (!web_id.is_null()) 133 if (WebContentsMediaCaptureId::Parse(str, &web_id))
134 return DesktopMediaID(TYPE_WEB_CONTENTS, 0, web_id); 134 return DesktopMediaID(TYPE_WEB_CONTENTS, 0, web_id);
135 135
136 // For screen and window types. 136 // For screen and window types.
137 std::vector<std::string> parts = base::SplitString( 137 std::vector<std::string> parts = base::SplitString(
138 str, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 138 str, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
139 139
140 #if defined(USE_AURA) 140 #if defined(USE_AURA)
141 if (parts.size() != 3) 141 if (parts.size() != 3)
142 return DesktopMediaID(); 142 return DesktopMediaID();
143 #else 143 #else
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 #if defined(USE_AURA) 195 #if defined(USE_AURA)
196 prefix.append(":"); 196 prefix.append(":");
197 prefix.append(base::Int64ToString(aura_id)); 197 prefix.append(base::Int64ToString(aura_id));
198 #endif // defined(USE_AURA) 198 #endif // defined(USE_AURA)
199 199
200 return prefix; 200 return prefix;
201 } 201 }
202 202
203 } // namespace content 203 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698