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

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: Created 4 years, 11 months 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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/desktop_media_id.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1d0ac67fa426d2d8179ad49b982b9eaea72997cf 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_WEB_CONTENTS };
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 web_contents_id)
+ : type(type), id(id), web_contents_id(web_contents_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 WebContents capture.
+ WebContentsMediaCaptureId web_contents_id;
};
} // namespace content
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/desktop_media_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698