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