| Index: content/public/browser/desktop_media_id.h
|
| diff --git a/content/public/browser/desktop_media_id.h b/content/public/browser/desktop_media_id.h
|
| index 921dc952387dab40ed5ea88d05efa491f26067d9..dae652c9fe7c4e9d929462f54f62ec4fd91663e0 100644
|
| --- a/content/public/browser/desktop_media_id.h
|
| +++ b/content/public/browser/desktop_media_id.h
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "content/common/content_export.h"
|
| +#include "content/public/browser/web_contents_media_capture_id.h"
|
|
|
| #if defined(USE_AURA)
|
| namespace aura {
|
| @@ -23,11 +24,7 @@ namespace content {
|
| // stored in MediaStreamRequest::requested_video_device_id.
|
| struct CONTENT_EXPORT DesktopMediaID {
|
| public:
|
| - enum Type {
|
| - TYPE_NONE,
|
| - TYPE_SCREEN,
|
| - TYPE_WINDOW,
|
| - };
|
| + enum Type { TYPE_NONE, TYPE_SCREEN, TYPE_WINDOW, TYPE_TAB };
|
|
|
| typedef intptr_t Id;
|
|
|
| @@ -43,35 +40,26 @@ struct CONTENT_EXPORT DesktopMediaID {
|
| static aura::Window* GetAuraWindowById(const DesktopMediaID& id);
|
| #endif // defined(USE_AURA)
|
|
|
| - static DesktopMediaID Parse(const std::string& str);
|
| -
|
| DesktopMediaID() = default;
|
|
|
| - DesktopMediaID(Type type, Id id)
|
| - : type(type),
|
| - id(id) {
|
| - }
|
| + DesktopMediaID(Type type, Id id) : type(type), id(id) {}
|
|
|
| - // Operators so that DesktopMediaID can be used with STL containers.
|
| - bool operator<(const DesktopMediaID& other) const {
|
| -#if defined(USE_AURA)
|
| - return std::tie(type, id, aura_id) <
|
| - std::tie(other.type, other.id, other.aura_id);
|
| -#else
|
| - return std::tie(type, id) < std::tie(other.type, other.id);
|
| -#endif
|
| - }
|
| - bool operator==(const DesktopMediaID& other) const {
|
| -#if defined(USE_AURA)
|
| - return type == other.type && id == other.id && aura_id == other.aura_id;
|
| -#else
|
| - return type == other.type && id == other.id;
|
| -#endif
|
| - }
|
| + DesktopMediaID(Type type, Id id, WebContentsMediaCaptureId tab_id)
|
| + : type(type), id(id), tab_id(tab_id) {}
|
|
|
| - bool is_null() { return type == TYPE_NONE; }
|
| + DesktopMediaID(Type type,
|
| + Id id,
|
| + int render_process_id,
|
| + int main_render_frame_id)
|
| + : type(type), id(id), tab_id(render_process_id, main_render_frame_id) {}
|
|
|
| - std::string ToString();
|
| + // Operators so that DesktopMediaID can be used with STL containers.
|
| + bool operator<(const DesktopMediaID& other) const;
|
| + bool operator==(const DesktopMediaID& other) const;
|
| +
|
| + bool is_null() const { return type == TYPE_NONE; }
|
| + std::string ToString() const;
|
| + static DesktopMediaID Parse(const std::string& str);
|
|
|
| Type type = TYPE_NONE;
|
|
|
| @@ -85,6 +73,9 @@ struct CONTENT_EXPORT DesktopMediaID {
|
| // TODO(miu): Make this an int, after clean-up for http://crbug.com/513490.
|
| Id aura_id = kNullId;
|
| #endif
|
| +
|
| + // This id contains information for tab capture.
|
| + WebContentsMediaCaptureId tab_id;
|
| };
|
|
|
| } // namespace content
|
|
|