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

Side by Side Diff: chrome/browser/media/media_stream_devices_controller_browsertest.cc

Issue 795703003: Don't auto allow access to media devices unless a the security origin of the requester is the same … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win compile. 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const std::string& video_id) { 83 const std::string& video_id) {
84 content::MediaStreamType audio_type = 84 content::MediaStreamType audio_type =
85 audio_id.empty() ? content::MEDIA_NO_SERVICE 85 audio_id.empty() ? content::MEDIA_NO_SERVICE
86 : content::MEDIA_DEVICE_AUDIO_CAPTURE; 86 : content::MEDIA_DEVICE_AUDIO_CAPTURE;
87 content::MediaStreamType video_type = 87 content::MediaStreamType video_type =
88 video_id.empty() ? content::MEDIA_NO_SERVICE 88 video_id.empty() ? content::MEDIA_NO_SERVICE
89 : content::MEDIA_DEVICE_VIDEO_CAPTURE; 89 : content::MEDIA_DEVICE_VIDEO_CAPTURE;
90 return content::MediaStreamRequest(0, 90 return content::MediaStreamRequest(0,
91 0, 91 0,
92 0, 92 0,
93 std::string(),
93 example_url(), 94 example_url(),
94 false, 95 false,
95 content::MEDIA_DEVICE_ACCESS, 96 content::MEDIA_DEVICE_ACCESS,
96 audio_id, 97 audio_id,
97 video_id, 98 video_id,
98 audio_type, 99 audio_type,
99 video_type); 100 video_type);
100 } 101 }
101 102
102 // Dummy callback for when we deny the current request directly. 103 // Dummy callback for when we deny the current request directly.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 TabSpecificContentSettings::CAMERA_ACCESSED, 464 TabSpecificContentSettings::CAMERA_ACCESSED,
464 GetContentSettings()->GetMicrophoneCameraState()); 465 GetContentSettings()->GetMicrophoneCameraState());
465 466
466 // After ending the camera capture, the camera permission is no longer 467 // After ending the camera capture, the camera permission is no longer
467 // relevant, so it should no be included in the mic/cam state. 468 // relevant, so it should no be included in the mic/cam state.
468 video_stream_ui.reset(); 469 video_stream_ui.reset();
469 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED | 470 EXPECT_EQ(TabSpecificContentSettings::MICROPHONE_ACCESSED |
470 TabSpecificContentSettings::MICROPHONE_BLOCKED, 471 TabSpecificContentSettings::MICROPHONE_BLOCKED,
471 GetContentSettings()->GetMicrophoneCameraState()); 472 GetContentSettings()->GetMicrophoneCameraState());
472 } 473 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698