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

Side by Side Diff: content/renderer/pepper/pepper_device_enumeration_event_handler.cc

Issue 10912004: Begin adding support for tab mirroring via the MediaStream audio/video capturing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 8 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 | Annotate | Revision Log
OLDNEW
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 "content/renderer/pepper/pepper_device_enumeration_event_handler.h" 5 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/shared_impl/ppb_device_ref_shared.h" 8 #include "ppapi/shared_impl/ppb_device_ref_shared.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed(int request_id) { 87 void PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed(int request_id) {
88 NotifyDeviceOpened(request_id, false, ""); 88 NotifyDeviceOpened(request_id, false, "");
89 } 89 }
90 90
91 // static 91 // static
92 media_stream::MediaStreamType 92 media_stream::MediaStreamType
93 PepperDeviceEnumerationEventHandler::FromPepperDeviceType( 93 PepperDeviceEnumerationEventHandler::FromPepperDeviceType(
94 PP_DeviceType_Dev type) { 94 PP_DeviceType_Dev type) {
95 switch (type) { 95 switch (type) {
96 case PP_DEVICETYPE_DEV_INVALID: 96 case PP_DEVICETYPE_DEV_INVALID:
97 return MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE; 97 return MEDIA_NO_SERVICE;
98 case PP_DEVICETYPE_DEV_AUDIOCAPTURE: 98 case PP_DEVICETYPE_DEV_AUDIOCAPTURE:
99 return MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE; 99 return MEDIA_DEVICE_AUDIO_CAPTURE;
100 case PP_DEVICETYPE_DEV_VIDEOCAPTURE: 100 case PP_DEVICETYPE_DEV_VIDEOCAPTURE:
101 return MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE; 101 return MEDIA_DEVICE_VIDEO_CAPTURE;
102 default: 102 default:
103 NOTREACHED(); 103 NOTREACHED();
104 return MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE; 104 return MEDIA_NO_SERVICE;
105 } 105 }
106 } 106 }
107 107
108 // static 108 // static
109 PP_DeviceType_Dev PepperDeviceEnumerationEventHandler::FromMediaStreamType( 109 PP_DeviceType_Dev PepperDeviceEnumerationEventHandler::FromMediaStreamType(
110 media_stream::MediaStreamType type) { 110 media_stream::MediaStreamType type) {
111 switch (type) { 111 switch (type) {
112 case MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE: 112 case MEDIA_NO_SERVICE:
113 return PP_DEVICETYPE_DEV_INVALID; 113 return PP_DEVICETYPE_DEV_INVALID;
114 case MEDIA_STREAM_DEVICE_TYPE_AUDIO_CAPTURE: 114 case MEDIA_DEVICE_AUDIO_CAPTURE:
115 return PP_DEVICETYPE_DEV_AUDIOCAPTURE; 115 return PP_DEVICETYPE_DEV_AUDIOCAPTURE;
116 case MEDIA_STREAM_DEVICE_TYPE_VIDEO_CAPTURE: 116 case MEDIA_DEVICE_VIDEO_CAPTURE:
117 return PP_DEVICETYPE_DEV_VIDEOCAPTURE; 117 return PP_DEVICETYPE_DEV_VIDEOCAPTURE;
118 default: 118 default:
119 NOTREACHED(); 119 NOTREACHED();
120 return PP_DEVICETYPE_DEV_INVALID; 120 return PP_DEVICETYPE_DEV_INVALID;
121 } 121 }
122 } 122 }
123 123
124 void PepperDeviceEnumerationEventHandler::NotifyDevicesEnumerated( 124 void PepperDeviceEnumerationEventHandler::NotifyDevicesEnumerated(
125 int request_id, 125 int request_id,
126 bool succeeded, 126 bool succeeded,
(...skipping 30 matching lines...) Expand all
157 return; 157 return;
158 } 158 }
159 159
160 PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second; 160 PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second;
161 open_callbacks_.erase(iter); 161 open_callbacks_.erase(iter);
162 162
163 callback.Run(request_id, succeeded, label); 163 callback.Run(request_id, succeeded, label);
164 } 164 }
165 165
166 } // namespace content 166 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/mock_media_stream_dispatcher.cc ('k') | content/test/webrtc_audio_device_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698