Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Unified Diff: content/public/browser/desktop_media_id.h

Issue 1503563004: Desktop chrome tab capture-chooseDesktopMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review patch 5 Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
Sergey Ulanov 2016/01/04 18:59:29 I don't think this constructor is necessary given
GeorgeZ 2016/01/06 22:41:39 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698