Chromium Code Reviews| 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 3f2971e4eb95fb512552a9d40f391a86564999a6..db2d3cd10dc25fbd9309d083df18048dba5dde9b 100644 |
| --- a/content/public/browser/desktop_media_id.h |
| +++ b/content/public/browser/desktop_media_id.h |
| @@ -9,6 +9,7 @@ |
| #include <tuple> |
| #include "content/common/content_export.h" |
| +#include "content/public/browser/web_contents_media_capture_id.h" |
| #if defined(USE_AURA) |
| namespace aura { |
| @@ -22,11 +23,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 }; |
|
Avi (use Gerrit)
2016/01/08 17:11:39
Whoa, whoa. Now we're getting into sketchy territo
GeorgeZ
2016/01/08 19:39:02
This class actually is a part of the implementatio
miu
2016/01/08 19:49:56
Avi makes a good point here, and I should have cau
|
| typedef intptr_t Id; |
| @@ -42,35 +39,20 @@ 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; } |
| + // Operators so that DesktopMediaID can be used with STL containers. |
| + bool operator<(const DesktopMediaID& other) const; |
| + bool operator==(const DesktopMediaID& other) const; |
| - std::string ToString(); |
| + bool is_null() const { return type == TYPE_NONE; } |
| + std::string ToString() const; |
| + static DesktopMediaID Parse(const std::string& str); |
| Type type = TYPE_NONE; |
| @@ -84,6 +66,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 |