Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5690)

Unified Diff: chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h

Issue 16035007: Provide the custom thumbnail for live preview of stacked panels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « chrome/browser/ui/views/panels/panel_view.cc ('k') | chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698