| 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/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/prefs/scoped_user_pref_update.h" | |
| 14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/values.h" | 14 #include "base/values.h" |
| 16 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 15 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 16 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 18 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 17 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 19 #include "chrome/browser/media/media_permission.h" | 18 #include "chrome/browser/media/media_permission.h" |
| 20 #include "chrome/browser/media/media_stream_capture_indicator.h" | 19 #include "chrome/browser/media/media_stream_capture_indicator.h" |
| 21 #include "chrome/browser/media/media_stream_device_permissions.h" | 20 #include "chrome/browser/media/media_stream_device_permissions.h" |
| 22 #include "chrome/browser/permissions/permission_uma_util.h" | 21 #include "chrome/browser/permissions/permission_uma_util.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/features.h" | 25 #include "chrome/common/features.h" |
| 27 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/grit/generated_resources.h" | 27 #include "chrome/grit/generated_resources.h" |
| 29 #include "components/content_settings/core/browser/host_content_settings_map.h" | 28 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 30 #include "components/content_settings/core/common/content_settings_pattern.h" | 29 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 31 #include "components/pref_registry/pref_registry_syncable.h" | 30 #include "components/pref_registry/pref_registry_syncable.h" |
| 31 #include "components/prefs/scoped_user_pref_update.h" |
| 32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/permission_type.h" | 33 #include "content/public/browser/permission_type.h" |
| 34 #include "content/public/browser/render_frame_host.h" | 34 #include "content/public/browser/render_frame_host.h" |
| 35 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
| 36 #include "content/public/browser/render_widget_host_view.h" | 36 #include "content/public/browser/render_widget_host_view.h" |
| 37 #include "content/public/common/media_stream_request.h" | 37 #include "content/public/common/media_stream_request.h" |
| 38 #include "content/public/common/origin_util.h" | 38 #include "content/public/common/origin_util.h" |
| 39 #include "extensions/common/constants.h" | 39 #include "extensions/common/constants.h" |
| 40 #include "grit/theme_resources.h" | 40 #include "grit/theme_resources.h" |
| 41 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 if (android_permission_blocked) | 615 if (android_permission_blocked) |
| 616 return false; | 616 return false; |
| 617 | 617 |
| 618 // Don't approve device requests if the tab was hidden. | 618 // Don't approve device requests if the tab was hidden. |
| 619 // TODO(qinmin): Add a test for this. http://crbug.com/396869. | 619 // TODO(qinmin): Add a test for this. http://crbug.com/396869. |
| 620 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? | 620 // TODO(raymes): Shouldn't this apply to all permissions not just audio/video? |
| 621 return web_contents_->GetRenderWidgetHostView()->IsShowing(); | 621 return web_contents_->GetRenderWidgetHostView()->IsShowing(); |
| 622 #endif | 622 #endif |
| 623 return true; | 623 return true; |
| 624 } | 624 } |
| OLD | NEW |