Chromium Code Reviews| 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_; |