| 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..6d13b00daf9beeec817647643b609fab6be19957 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,37 @@
|
|
|
| class SkBitmap;
|
|
|
| +class TaskbarWindowThumbnailerDelegateWin {
|
| + public:
|
| + // Returns the list of handles for all windows that are used to construct the
|
| + // 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, so the updates of the panels'
|
| + // content will not be automatically reflected in the thumbnail.
|
| + 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 +51,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 +59,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);
|
|
|