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

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

Issue 398373006: Audit the last time the media stream content settings have been used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.h ('k') | no next file » | 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/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 338
339 // TODO(raymes): We currently set the content permission for non-https 339 // TODO(raymes): We currently set the content permission for non-https
340 // websites for Pepper requests as well. This is temporary and should be 340 // websites for Pepper requests as well. This is temporary and should be
341 // removed. 341 // removed.
342 if (update_content_setting) { 342 if (update_content_setting) {
343 if ((IsSchemeSecure() && !devices.empty()) || 343 if ((IsSchemeSecure() && !devices.empty()) ||
344 request_.request_type == content::MEDIA_OPEN_DEVICE) { 344 request_.request_type == content::MEDIA_OPEN_DEVICE) {
345 SetPermission(true); 345 SetPermission(true);
346 } 346 }
347 } 347 }
348
349 if (audio_allowed) {
350 profile_->GetHostContentSettingsMap()->UpdateLastUsageByPattern(
351 ContentSettingsPattern::FromURLNoWildcard(request_.security_origin),
tommi (sloooow) - chröme 2014/07/18 07:30:24 4 space indent here and below.
Daniel Nishi 2014/07/18 15:59:26 Done.
352 ContentSettingsPattern::Wildcard(),
353 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
354 }
355 if (video_allowed) {
356 profile_->GetHostContentSettingsMap()->UpdateLastUsageByPattern(
357 ContentSettingsPattern::FromURLNoWildcard(request_.security_origin),
358 ContentSettingsPattern::Wildcard(),
359 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
360 }
348 } 361 }
349 362
350 scoped_ptr<content::MediaStreamUI> ui; 363 scoped_ptr<content::MediaStreamUI> ui;
351 if (!devices.empty()) { 364 if (!devices.empty()) {
352 ui = MediaCaptureDevicesDispatcher::GetInstance()-> 365 ui = MediaCaptureDevicesDispatcher::GetInstance()->
353 GetMediaStreamCaptureIndicator()->RegisterMediaStream( 366 GetMediaStreamCaptureIndicator()->RegisterMediaStream(
354 web_contents_, devices); 367 web_contents_, devices);
355 } 368 }
356 content::MediaResponseCallback cb = callback_; 369 content::MediaResponseCallback cb = callback_;
357 callback_.Reset(); 370 callback_.Reset();
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 it->second.permission == MEDIA_ALLOWED); 666 it->second.permission == MEDIA_ALLOWED);
654 } 667 }
655 668
656 bool MediaStreamDevicesController::IsDeviceVideoCaptureRequestedAndAllowed() 669 bool MediaStreamDevicesController::IsDeviceVideoCaptureRequestedAndAllowed()
657 const { 670 const {
658 MediaStreamTypeSettingsMap::const_iterator it = 671 MediaStreamTypeSettingsMap::const_iterator it =
659 request_permissions_.find(content::MEDIA_DEVICE_VIDEO_CAPTURE); 672 request_permissions_.find(content::MEDIA_DEVICE_VIDEO_CAPTURE);
660 return (it != request_permissions_.end() && 673 return (it != request_permissions_.end() &&
661 it->second.permission == MEDIA_ALLOWED); 674 it->second.permission == MEDIA_ALLOWED);
662 } 675 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698