Index: chrome/browser/content_settings/tab_specific_content_settings.h |
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h |
index b3b8d2d6c7dacc7c8f6f58d8629b3a2afdb94945..698c1fcc0bb69e30894a56293d7a951cf08981d7 100644 |
--- a/chrome/browser/content_settings/tab_specific_content_settings.h |
+++ b/chrome/browser/content_settings/tab_specific_content_settings.h |
@@ -45,15 +45,15 @@ class TabSpecificContentSettings |
public content_settings::Observer, |
public content::WebContentsUserData<TabSpecificContentSettings> { |
public: |
- enum MicrophoneCameraState { |
- MICROPHONE_CAMERA_NOT_ACCESSED = 0, |
- MICROPHONE_ACCESSED, |
- CAMERA_ACCESSED, |
- MICROPHONE_CAMERA_ACCESSED, |
- MICROPHONE_BLOCKED, |
- CAMERA_BLOCKED, |
- MICROPHONE_CAMERA_BLOCKED, |
- }; |
+ // Fields describing the current mic/camera state. If a page has attempted to |
+ // access a device, the XXX_ACCESSED bit will be set. If access was blocked, |
+ // XXX_BLOCKED will be set. |
+ typedef uint32_t MicrophoneCameraState; |
+ static const MicrophoneCameraState MICROPHONE_CAMERA_NOT_ACCESSED = 0; |
+ static const MicrophoneCameraState MICROPHONE_ACCESSED = 1 << 0; |
+ static const MicrophoneCameraState MICROPHONE_BLOCKED = 1 << 1; |
+ static const MicrophoneCameraState CAMERA_ACCESSED = 1 << 2; |
+ static const MicrophoneCameraState CAMERA_BLOCKED = 1 << 3; |
// Classes that want to be notified about site data events must implement |
// this abstract class and add themselves as observer to the |
@@ -211,9 +211,21 @@ class TabSpecificContentSettings |
return media_stream_requested_video_device_; |
} |
+ const std::string& media_stream_selected_audio_device() const { |
+ return media_stream_selected_audio_device_; |
+ } |
+ |
+ const std::string& media_stream_selected_video_device() const { |
+ return media_stream_selected_video_device_; |
+ } |
+ |
// Returns the state of the camera and microphone usage. |
MicrophoneCameraState GetMicrophoneCameraState() const; |
+ // Returns whether the state of the camera and microphone usage or device has |
+ // changed. |
+ bool IsMicrophoneCameraStateChanged() const; |
+ |
// Returns the ContentSettingsUsagesState that controls the |
// geolocation API usage on this page. |
const ContentSettingsUsagesState& geolocation_usages_state() const { |
@@ -413,6 +425,13 @@ class TabSpecificContentSettings |
// stored here. http://crbug.com/259794 |
GURL media_stream_access_origin_; |
+ // The microphone and camera state at the last media stream request. |
+ // This value is composed of MicrophoneCameraState values. |
+ MicrophoneCameraState microphone_camera_state_; |
+ // The selected devices at the last media stream request. |
+ std::string media_stream_selected_audio_device_; |
+ std::string media_stream_selected_video_device_; |
+ |
// The devices to be displayed in the media bubble when the media stream |
// request is requesting certain specific devices. |
std::string media_stream_requested_audio_device_; |