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

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

Issue 1884073002: Add a new metric for how many times permissions prompts are shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 4 years, 8 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 (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 <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 RecordPermissionAction( 300 RecordPermissionAction(
301 request_, base::Bind(PermissionUmaUtil::PermissionDismissed)); 301 request_, base::Bind(PermissionUmaUtil::PermissionDismissed));
302 RunCallback(old_audio_setting_, old_video_setting_, 302 RunCallback(old_audio_setting_, old_video_setting_,
303 content::MEDIA_DEVICE_PERMISSION_DISMISSED); 303 content::MEDIA_DEVICE_PERMISSION_DISMISSED);
304 } 304 }
305 305
306 void MediaStreamDevicesController::RequestFinished() { 306 void MediaStreamDevicesController::RequestFinished() {
307 delete this; 307 delete this;
308 } 308 }
309 309
310 PermissionBubbleType MediaStreamDevicesController::GetPermissionBubbleType()
311 const {
312 return PermissionBubbleType::MEDIA_STREAM;
313 }
314
310 content::MediaStreamDevices MediaStreamDevicesController::GetDevices( 315 content::MediaStreamDevices MediaStreamDevicesController::GetDevices(
311 ContentSetting audio_setting, 316 ContentSetting audio_setting,
312 ContentSetting video_setting) { 317 ContentSetting video_setting) {
313 bool audio_allowed = audio_setting == CONTENT_SETTING_ALLOW; 318 bool audio_allowed = audio_setting == CONTENT_SETTING_ALLOW;
314 bool video_allowed = video_setting == CONTENT_SETTING_ALLOW; 319 bool video_allowed = video_setting == CONTENT_SETTING_ALLOW;
315 320
316 if (!audio_allowed && !video_allowed) 321 if (!audio_allowed && !video_allowed)
317 return content::MediaStreamDevices(); 322 return content::MediaStreamDevices();
318 323
319 content::MediaStreamDevices devices; 324 content::MediaStreamDevices devices;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 if (android_permission_blocked) 616 if (android_permission_blocked)
612 return false; 617 return false;
613 618
614 // Don't approve device requests if the tab was hidden. 619 // Don't approve device requests if the tab was hidden.
615 // TODO(qinmin): Add a test for this. http://crbug.com/396869. 620 // TODO(qinmin): Add a test for this. http://crbug.com/396869.
616 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? 621 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video?
617 return web_contents_->GetRenderWidgetHostView()->IsShowing(); 622 return web_contents_->GetRenderWidgetHostView()->IsShowing();
618 #endif 623 #endif
619 return true; 624 return true;
620 } 625 }
OLDNEW
« no previous file with comments | « chrome/browser/media/media_stream_devices_controller.h ('k') | chrome/browser/permissions/permission_bubble_request_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698