Chromium Code Reviews| Index: chrome/browser/media/desktop_media_picker_model.h |
| diff --git a/chrome/browser/media/desktop_media_picker_model.h b/chrome/browser/media/desktop_media_picker_model.h |
| index 7773c3d9476b8aa8f6e687760ca9722c019f5c52..b4d43b9f78f06184a80fc592c761df54a5492929 100644 |
| --- a/chrome/browser/media/desktop_media_picker_model.h |
| +++ b/chrome/browser/media/desktop_media_picker_model.h |
| @@ -49,32 +49,48 @@ class DesktopMediaPickerModel { |
| gfx::ImageSkia thumbnail; |
| }; |
| - // 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). |
| - DesktopMediaPickerModel(scoped_ptr<webrtc::ScreenCapturer> screen_capturer, |
| - scoped_ptr<webrtc::WindowCapturer> window_capturer); |
| - virtual ~DesktopMediaPickerModel(); |
| + virtual ~DesktopMediaPickerModel() {} |
| // Sets time interval between updates. By default list of sources and their |
| // thumbnail are updated once per second. If called after StartUpdating() then |
| // it will take effect only after the next update. |
| - void SetUpdatePeriod(base::TimeDelta period); |
| + virtual void SetUpdatePeriod(base::TimeDelta period) = 0; |
| // Sets size to which the thumbnails should be scaled. If called after |
| // StartUpdating() then some thumbnails may be still scaled to the old size |
| // until they are updated. |
| - void SetThumbnailSize(const gfx::Size& thumbnail_size); |
| + virtual void SetThumbnailSize(const gfx::Size& thumbnail_size) = 0; |
| // Starts updating the model. The model is initially empty, so OnSourceAdded() |
| // notifications will be generated for each existing source as it is |
| // enumerated. After the initial enumeration the model will be refreshed based |
| // on the update period, and notifications generated only for changes in the |
| // model. |
| - void StartUpdating(Observer* observer); |
| + virtual void StartUpdating(Observer* observer) = 0; |
| - int source_count() const { return sources_.size(); } |
| - const Source& source(int index) const { return sources_.at(index); } |
| + virtual int source_count() const = 0; |
| + virtual const Source& source(int index) const = 0; |
| + |
| + private: |
| + DISALLOW_ASSIGN(DesktopMediaPickerModel); |
|
Sergey Ulanov
2013/09/04 22:50:06
nit: Why not DISALLOW_COPY_AND_ASSIGN? In either c
dcaiafa
2013/09/04 23:00:27
Done.
|
| +}; |
| + |
| +class DesktopMediaPickerModelImpl : public DesktopMediaPickerModel { |
| + public: |
| + // 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). |
| + DesktopMediaPickerModelImpl( |
| + scoped_ptr<webrtc::ScreenCapturer> screen_capturer, |
| + scoped_ptr<webrtc::WindowCapturer> window_capturer); |
| + virtual ~DesktopMediaPickerModelImpl(); |
| + |
| + // DesktopMediaPickerModelInterface: |
| + virtual void SetUpdatePeriod(base::TimeDelta period) OVERRIDE; |
| + virtual void SetThumbnailSize(const gfx::Size& thumbnail_size) OVERRIDE; |
| + virtual void StartUpdating(Observer* observer) OVERRIDE; |
| + virtual int source_count() const OVERRIDE; |
| + virtual const Source& source(int index) const OVERRIDE; |
| private: |
| class Worker; |
| @@ -127,9 +143,9 @@ class DesktopMediaPickerModel { |
| // Current list of sources. |
| std::vector<Source> sources_; |
| - base::WeakPtrFactory<DesktopMediaPickerModel> weak_factory_; |
| + base::WeakPtrFactory<DesktopMediaPickerModelImpl> weak_factory_; |
| - DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerModel); |
| + DISALLOW_COPY_AND_ASSIGN(DesktopMediaPickerModelImpl); |
| }; |
| #endif // CHROME_BROWSER_MEDIA_DESKTOP_MEDIA_PICKER_MODEL_H_ |