| 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 "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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 RecordPermissionAction(request_, profile_, | 327 RecordPermissionAction(request_, profile_, |
| 328 base::Bind(PermissionUmaUtil::PermissionDismissed)); | 328 base::Bind(PermissionUmaUtil::PermissionDismissed)); |
| 329 RunCallback(old_audio_setting_, old_video_setting_, | 329 RunCallback(old_audio_setting_, old_video_setting_, |
| 330 content::MEDIA_DEVICE_PERMISSION_DISMISSED); | 330 content::MEDIA_DEVICE_PERMISSION_DISMISSED); |
| 331 } | 331 } |
| 332 | 332 |
| 333 void MediaStreamDevicesController::RequestFinished() { | 333 void MediaStreamDevicesController::RequestFinished() { |
| 334 delete this; | 334 delete this; |
| 335 } | 335 } |
| 336 | 336 |
| 337 PermissionBubbleType MediaStreamDevicesController::GetPermissionBubbleType() | 337 PermissionRequestType MediaStreamDevicesController::GetPermissionRequestType() |
| 338 const { | 338 const { |
| 339 return PermissionBubbleType::MEDIA_STREAM; | 339 return PermissionRequestType::MEDIA_STREAM; |
| 340 } | 340 } |
| 341 | 341 |
| 342 content::MediaStreamDevices MediaStreamDevicesController::GetDevices( | 342 content::MediaStreamDevices MediaStreamDevicesController::GetDevices( |
| 343 ContentSetting audio_setting, | 343 ContentSetting audio_setting, |
| 344 ContentSetting video_setting) { | 344 ContentSetting video_setting) { |
| 345 bool audio_allowed = audio_setting == CONTENT_SETTING_ALLOW; | 345 bool audio_allowed = audio_setting == CONTENT_SETTING_ALLOW; |
| 346 bool video_allowed = video_setting == CONTENT_SETTING_ALLOW; | 346 bool video_allowed = video_setting == CONTENT_SETTING_ALLOW; |
| 347 | 347 |
| 348 if (!audio_allowed && !video_allowed) | 348 if (!audio_allowed && !video_allowed) |
| 349 return content::MediaStreamDevices(); | 349 return content::MediaStreamDevices(); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 if (android_permission_blocked) | 634 if (android_permission_blocked) |
| 635 return false; | 635 return false; |
| 636 | 636 |
| 637 // Don't approve device requests if the tab was hidden. | 637 // Don't approve device requests if the tab was hidden. |
| 638 // TODO(qinmin): Add a test for this. http://crbug.com/396869. | 638 // TODO(qinmin): Add a test for this. http://crbug.com/396869. |
| 639 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? | 639 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? |
| 640 return web_contents_->GetRenderWidgetHostView()->IsShowing(); | 640 return web_contents_->GetRenderWidgetHostView()->IsShowing(); |
| 641 #endif | 641 #endif |
| 642 return true; | 642 return true; |
| 643 } | 643 } |
| OLD | NEW |