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..e3e3dc96b4b1d8f7f8cf8efbcaba26e2e98cec00 100644 |
--- a/chrome/browser/content_settings/tab_specific_content_settings.h |
+++ b/chrome/browser/content_settings/tab_specific_content_settings.h |
@@ -45,14 +45,14 @@ class TabSpecificContentSettings |
public content_settings::Observer, |
public content::WebContentsUserData<TabSpecificContentSettings> { |
public: |
+ // Flags for use in microphone_camera_state_. If *_BLOCKED is set, then |
+ // its corresponding *_ALLOWED flag must also be set. |
Peter Kasting
2014/09/24 01:33:00
Was _ALLOWED here supposed to be _ACCESSED? If so
|
enum MicrophoneCameraState { |
Peter Kasting
2014/09/24 01:33:00
Nit: Don't use an enum to declare bitmasks. Use c
robwu
2014/09/24 23:38:44
Done.
|
MICROPHONE_CAMERA_NOT_ACCESSED = 0, |
- MICROPHONE_ACCESSED, |
- CAMERA_ACCESSED, |
- MICROPHONE_CAMERA_ACCESSED, |
- MICROPHONE_BLOCKED, |
- CAMERA_BLOCKED, |
- MICROPHONE_CAMERA_BLOCKED, |
+ MICROPHONE_ACCESSED = 1 << 0, |
+ MICROPHONE_BLOCKED = 1 << 1, |
+ CAMERA_ACCESSED = 1 << 2, |
+ CAMERA_BLOCKED = 1 << 3, |
}; |
// Classes that want to be notified about site data events must implement |
@@ -211,8 +211,20 @@ 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; |
+ unsigned GetMicrophoneCameraState() const; |
Peter Kasting
2014/09/24 01:33:00
(Here and elsewhere) Use types like uint32_t inste
robwu
2014/09/24 23:38:44
Done.
|
+ |
+ // 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. |
@@ -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. |
+ unsigned 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_; |