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" |
11 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram_macros.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
18 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 18 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
19 #include "chrome/browser/media/media_permission.h" | 19 #include "chrome/browser/media/media_permission.h" |
20 #include "chrome/browser/media/media_stream_capture_indicator.h" | 20 #include "chrome/browser/media/media_stream_capture_indicator.h" |
21 #include "chrome/browser/media/media_stream_device_permissions.h" | 21 #include "chrome/browser/media/media_stream_device_permissions.h" |
22 #include "chrome/browser/permissions/permission_uma_util.h" | 22 #include "chrome/browser/permissions/permission_uma_util.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 if (android_permission_blocked) | 640 if (android_permission_blocked) |
641 return false; | 641 return false; |
642 | 642 |
643 // Don't approve device requests if the tab was hidden. | 643 // Don't approve device requests if the tab was hidden. |
644 // TODO(qinmin): Add a test for this. http://crbug.com/396869. | 644 // TODO(qinmin): Add a test for this. http://crbug.com/396869. |
645 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? | 645 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? |
646 return web_contents_->GetRenderWidgetHostView()->IsShowing(); | 646 return web_contents_->GetRenderWidgetHostView()->IsShowing(); |
647 #endif | 647 #endif |
648 return true; | 648 return true; |
649 } | 649 } |
OLD | NEW |