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

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

Issue 11759020: Implement a TODO in the media code: Change a "const MediaStreamRequest*" arg in various APIs to "co… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/media/media_stream_devices_controller.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/media/media_stream_devices_controller.h" 5 #include "chrome/browser/media/media_stream_devices_controller.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/content_settings/content_settings_provider.h" 8 #include "chrome/browser/content_settings/content_settings_provider.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" 10 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
(...skipping 23 matching lines...) Expand all
34 return !audio_devices.empty() || !video_devices.empty(); 34 return !audio_devices.empty() || !video_devices.empty();
35 }; 35 };
36 36
37 const char kAudioKey[] = "audio"; 37 const char kAudioKey[] = "audio";
38 const char kVideoKey[] = "video"; 38 const char kVideoKey[] = "video";
39 39
40 } // namespace 40 } // namespace
41 41
42 MediaStreamDevicesController::MediaStreamDevicesController( 42 MediaStreamDevicesController::MediaStreamDevicesController(
43 Profile* profile, 43 Profile* profile,
44 const content::MediaStreamRequest* request, 44 const content::MediaStreamRequest& request,
45 const content::MediaResponseCallback& callback) 45 const content::MediaResponseCallback& callback)
46 : profile_(profile), 46 : profile_(profile),
47 request_(*request), 47 request_(request),
48 callback_(callback), 48 callback_(callback),
49 has_audio_(content::IsAudioMediaType(request->audio_type) && 49 has_audio_(content::IsAudioMediaType(request.audio_type) &&
50 !IsAudioDeviceBlockedByPolicy()), 50 !IsAudioDeviceBlockedByPolicy()),
51 has_video_(content::IsVideoMediaType(request->video_type) && 51 has_video_(content::IsVideoMediaType(request.video_type) &&
52 !IsVideoDeviceBlockedByPolicy()) { 52 !IsVideoDeviceBlockedByPolicy()) {
53 DCHECK(request);
54 } 53 }
55 54
56 MediaStreamDevicesController::~MediaStreamDevicesController() {} 55 MediaStreamDevicesController::~MediaStreamDevicesController() {}
57 56
58 // static 57 // static
59 void MediaStreamDevicesController::RegisterUserPrefs( 58 void MediaStreamDevicesController::RegisterUserPrefs(
60 PrefServiceSyncable* prefs) { 59 PrefServiceSyncable* prefs) {
61 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed, 60 prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed,
62 true, 61 true,
63 PrefServiceSyncable::UNSYNCABLE_PREF); 62 PrefServiceSyncable::UNSYNCABLE_PREF);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 266 }
268 if (has_video_) { 267 if (has_video_) {
269 profile_->GetHostContentSettingsMap()->SetContentSetting( 268 profile_->GetHostContentSettingsMap()->SetContentSetting(
270 primary_pattern, 269 primary_pattern,
271 ContentSettingsPattern::Wildcard(), 270 ContentSettingsPattern::Wildcard(),
272 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, 271 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
273 std::string(), 272 std::string(),
274 content_setting); 273 content_setting);
275 } 274 }
276 } 275 }
OLDNEW
« no previous file with comments | « chrome/browser/media/media_stream_devices_controller.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698