Chromium Code Reviews| Index: chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h |
| diff --git a/chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h b/chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h |
| index 909d8b68371f07b1f2336942441da1b09ae42242..10f6e147ed285b13b7d727487a2423029c905494 100644 |
| --- a/chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h |
| +++ b/chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h |
| @@ -11,19 +11,36 @@ |
| class SkBitmap; |
| +class TaskbarWindowThumbnailerDelegateWin { |
| + public: |
| + // Returns the handle list of all windows that are used to construct the |
|
Dmitry Titov
2013/05/29 21:12:54
"handle list of all windows" -> "list of handles f
|
| + // thumbnail. If empty list is returned, the snapshot of current window |
| + // is used. |
| + virtual std::vector<HWND> GetSnapshotWindowHandles() const = 0; |
| +}; |
| + |
| // Provides the custom thumbnail and live preview for the window that appears |
| // in the taskbar (Windows 7 and later). |
| class TaskbarWindowThumbnailerWin : public ui::HWNDMessageFilter { |
| public: |
| - explicit TaskbarWindowThumbnailerWin(HWND hwnd); |
| + TaskbarWindowThumbnailerWin(HWND hwnd, |
| + TaskbarWindowThumbnailerDelegateWin* delegate); |
| virtual ~TaskbarWindowThumbnailerWin(); |
| - // Use the snapshots from all the windows in |snapshot_hwnds| to construct |
| - // the thumbnail. If |snapshot_hwnds| is empty, use the snapshot of current |
| - // window. |
| - void Start(const std::vector<HWND>& snapshot_hwnds); |
| + // Starts using the custom snapshot for live preview. The snapshot is only |
| + // captured once when the system requests it. |
|
Dmitry Titov
2013/05/29 21:12:54
Lets add "... when system requests it, so the upda
|
| + void Start(); |
| + |
| + // Stops providing the custom snapshot for live preview. |
| void Stop(); |
| + // Captures the snapshot now instead of when the system requests it. |
| + void CaptureSnapshot(); |
| + |
| + // Invalidates the snapshot such that a fresh copy can be obtained next time |
| + // when the system requests it. |
| + void InvalidateSnapshot(); |
| + |
| private: |
| // Overridden from ui::HWNDMessageFilter: |
| virtual bool FilterMessage(HWND hwnd, |
| @@ -33,8 +50,7 @@ class TaskbarWindowThumbnailerWin : public ui::HWNDMessageFilter { |
| LRESULT* l_result) OVERRIDE; |
| // Message handlers. |
| - bool OnDwmSendIconicThumbnail( |
| - int width, int height, LRESULT* l_result); |
| + bool OnDwmSendIconicThumbnail(int width, int height, LRESULT* l_result); |
| bool OnDwmSendIconicLivePreviewBitmap(LRESULT* l_result); |
| // Captures and returns the screenshot of the window. The caller is |
| @@ -42,7 +58,7 @@ class TaskbarWindowThumbnailerWin : public ui::HWNDMessageFilter { |
| SkBitmap* CaptureWindowImage() const; |
| HWND hwnd_; |
| - std::vector<HWND> snapshot_hwnds_; |
| + TaskbarWindowThumbnailerDelegateWin* delegate_; // Weak, owns us. |
| scoped_ptr<SkBitmap> capture_bitmap_; |
| DISALLOW_COPY_AND_ASSIGN(TaskbarWindowThumbnailerWin); |