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

Unified Diff: chrome/browser/media/native_desktop_media_list.h

Issue 1503563004: Desktop chrome tab capture-chooseDesktopMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: chrome/browser/media/native_desktop_media_list.h
diff --git a/chrome/browser/media/native_desktop_media_list.h b/chrome/browser/media/native_desktop_media_list.h
index f576d518b0bc62baf9601994a5f8f4352747b247..448a6817d6c4d4eee77febc1adbf355a2e851b5e 100644
--- a/chrome/browser/media/native_desktop_media_list.h
+++ b/chrome/browser/media/native_desktop_media_list.h
@@ -11,7 +11,9 @@
#include "base/sequenced_task_runner.h"
#include "chrome/browser/media/desktop_media_list.h"
#include "content/public/browser/desktop_media_id.h"
+#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/native_widget_types.h"
namespace webrtc {
class ScreenCapturer;
@@ -25,9 +27,9 @@ class NativeDesktopMediaList : public DesktopMediaList {
// Caller may pass NULL for either of the arguments in case when only some
// types of sources the model should be populated with (e.g. it will only
// contain windows, if |screen_capturer| is NULL).
- NativeDesktopMediaList(
- scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
- scoped_ptr<webrtc::WindowCapturer> window_capturer);
+ NativeDesktopMediaList(scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
+ scoped_ptr<webrtc::WindowCapturer> window_capturer,
+ bool tab_capture_enabled);
~NativeDesktopMediaList() override;
// DesktopMediaList interface.
@@ -45,7 +47,6 @@ class NativeDesktopMediaList : public DesktopMediaList {
// Struct used to represent sources list the model gets from the Worker.
struct SourceDescription {
SourceDescription(content::DesktopMediaID id, const base::string16& name);
-
content::DesktopMediaID id;
base::string16 name;
};
@@ -57,18 +58,28 @@ class NativeDesktopMediaList : public DesktopMediaList {
// Post a task for the |worker_| to update list of windows and get thumbnails.
void Refresh();
+ // Get the source descriptions for tabs.
+ bool GetTabSourceDescription(std::vector<SourceDescription>& tab_sources);
+
// Called by |worker_| to refresh the model. First it posts tasks for
// OnSourcesList() with the fresh list of sources, then follows with
- // OnSourceThumbnail() for each changed thumbnail and then calls
- // OnRefreshFinished() at the end.
+ // OnSourceThumbnail() or OnSourceTabThumbnail() for each changed thumbnail
+ // and then calls OnRefreshFinished() at the end.
void OnSourcesList(const std::vector<SourceDescription>& sources);
void OnSourceThumbnail(int index, const gfx::ImageSkia& thumbnail);
+ void OnSourceTabThumbnail(SourceDescription source);
void OnRefreshFinished();
// Capturers specified in SetCapturers() and passed to the |worker_| later.
scoped_ptr<webrtc::ScreenCapturer> screen_capturer_;
scoped_ptr<webrtc::WindowCapturer> window_capturer_;
+ // Whether allow tab capture.
+ bool tab_capture_enabled_;
miu 2015/12/08 01:54:38 Should be: const bool tab_capture_enabled_ (since
GeorgeZ 2015/12/09 19:36:37 Done.
+
+ // Map between tab id and corresponding favicon.
+ std::map<int, gfx::ImageSkia> tab_icon_map_;
+
// Time interval between mode updates.
base::TimeDelta update_period_;

Powered by Google App Engine
This is Rietveld 408576698