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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/child/child_process.h" | 8 #include "content/child/child_process.h" |
9 #include "content/renderer/media/media_stream.h" | 9 #include "content/renderer/media/media_stream.h" |
10 #include "content/renderer/media/media_stream_track.h" | 10 #include "content/renderer/media/media_stream_track.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 void RequestSources() { | 72 void RequestSources() { |
73 blink::WebMediaStreamTrackSourcesRequest sources_request; | 73 blink::WebMediaStreamTrackSourcesRequest sources_request; |
74 state_ = REQUEST_NOT_COMPLETE; | 74 state_ = REQUEST_NOT_COMPLETE; |
75 requestSources(sources_request); | 75 requestSources(sources_request); |
76 } | 76 } |
77 | 77 |
78 void GetUserMediaRequestSucceeded( | 78 void GetUserMediaRequestSucceeded( |
79 const blink::WebMediaStream& stream, | 79 const blink::WebMediaStream& stream, |
80 blink::WebUserMediaRequest* request_info) override { | 80 blink::WebUserMediaRequest request_info) override { |
81 last_generated_stream_ = stream; | 81 last_generated_stream_ = stream; |
82 state_ = REQUEST_SUCCEEDED; | 82 state_ = REQUEST_SUCCEEDED; |
83 } | 83 } |
84 | 84 |
85 void GetUserMediaRequestFailed( | 85 void GetUserMediaRequestFailed( |
86 blink::WebUserMediaRequest* request_info, | 86 blink::WebUserMediaRequest request_info, |
87 content::MediaStreamRequestResult result, | 87 content::MediaStreamRequestResult result, |
88 const blink::WebString& result_name) override { | 88 const blink::WebString& result_name) override { |
89 last_generated_stream_.reset(); | 89 last_generated_stream_.reset(); |
90 state_ = REQUEST_FAILED; | 90 state_ = REQUEST_FAILED; |
91 result_ = result; | 91 result_ = result; |
92 result_name_ = result_name; | 92 result_name_ = result_name; |
93 } | 93 } |
94 | 94 |
95 void EnumerateDevicesSucceded( | 95 void EnumerateDevicesSucceded( |
96 blink::WebMediaDevicesRequest* request, | 96 blink::WebMediaDevicesRequest* request, |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 // Video input device environment facing. | 564 // Video input device environment facing. |
565 source = &used_media_impl_->last_sources()[3]; | 565 source = &used_media_impl_->last_sources()[3]; |
566 EXPECT_FALSE(source->id().isEmpty()); | 566 EXPECT_FALSE(source->id().isEmpty()); |
567 EXPECT_EQ(blink::WebSourceInfo::SourceKindVideo, source->kind()); | 567 EXPECT_EQ(blink::WebSourceInfo::SourceKindVideo, source->kind()); |
568 EXPECT_FALSE(source->label().isEmpty()); | 568 EXPECT_FALSE(source->label().isEmpty()); |
569 EXPECT_EQ(blink::WebSourceInfo::VideoFacingModeEnvironment, source->facing()); | 569 EXPECT_EQ(blink::WebSourceInfo::VideoFacingModeEnvironment, source->facing()); |
570 } | 570 } |
571 | 571 |
572 } // namespace content | 572 } // namespace content |
OLD | NEW |