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..cdf556de52e853368f1b9c78d7fbdf06ed7b4685 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. |
+ void GetTabSourceDescriptions(std::vector<SourceDescription>& tab_sources); |
miu
2015/12/12 00:00:33
style guide: You must pass by pointer, not by refe
GeorgeZ
2015/12/14 18:33:07
Done.
|
+ |
// 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. |
+ const bool tab_capture_enabled_; |
+ |
+ // Map between tab id and corresponding favicon. |
+ std::map<int, gfx::ImageSkia> tab_icon_map_; |
miu
2015/12/12 00:00:33
Please make the key a std::pair<int, int> instead.
GeorgeZ
2015/12/14 18:33:07
Done.
|
+ |
// Time interval between mode updates. |
base::TimeDelta update_period_; |