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

Side by Side Diff: chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h

Issue 2263863002: Remove implementation of Panels on OSes other than ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PANELS_TASKBAR_WINDOW_THUMBNAILER_WIN_H_
6 #define CHROME_BROWSER_UI_VIEWS_PANELS_TASKBAR_WINDOW_THUMBNAILER_WIN_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "ui/base/win/hwnd_subclass.h"
13
14 class SkBitmap;
15
16 class TaskbarWindowThumbnailerDelegateWin {
17 public:
18 // Returns the list of handles for all windows that are used to construct the
19 // thumbnail. If empty list is returned, the snapshot of current window
20 // is used.
21 virtual std::vector<HWND> GetSnapshotWindowHandles() const = 0;
22 };
23
24 // Provides the custom thumbnail and live preview for the window that appears
25 // in the taskbar (Windows 7 and later).
26 class TaskbarWindowThumbnailerWin : public ui::HWNDMessageFilter {
27 public:
28 TaskbarWindowThumbnailerWin(HWND hwnd,
29 TaskbarWindowThumbnailerDelegateWin* delegate);
30 ~TaskbarWindowThumbnailerWin() override;
31
32 // Starts using the custom snapshot for live preview. The snapshot is only
33 // captured once when the system requests it, so the updates of the panels'
34 // content will not be automatically reflected in the thumbnail.
35 void Start();
36
37 // Stops providing the custom snapshot for live preview.
38 void Stop();
39
40 // Captures the snapshot now instead of when the system requests it.
41 void CaptureSnapshot();
42
43 // Invalidates the snapshot such that a fresh copy can be obtained next time
44 // when the system requests it.
45 void InvalidateSnapshot();
46
47 // Provide the snapshot to the new window. If the snapshot is captured for the
48 // old window, it will also be used for the new window.
49 void ReplaceWindow(HWND new_hwnd);
50
51 private:
52 // Overridden from ui::HWNDMessageFilter:
53 bool FilterMessage(HWND hwnd,
54 UINT message,
55 WPARAM w_param,
56 LPARAM l_param,
57 LRESULT* l_result) override;
58
59 // Message handlers.
60 bool OnDwmSendIconicThumbnail(int width, int height, LRESULT* l_result);
61 bool OnDwmSendIconicLivePreviewBitmap(LRESULT* l_result);
62
63 // Captures and returns the screenshot of the window. The caller is
64 // responsible to release the returned SkBitmap instance.
65 SkBitmap* CaptureWindowImage() const;
66
67 HWND hwnd_;
68 TaskbarWindowThumbnailerDelegateWin* delegate_; // Weak, owns us.
69 std::unique_ptr<SkBitmap> capture_bitmap_;
70
71 DISALLOW_COPY_AND_ASSIGN(TaskbarWindowThumbnailerWin);
72 };
73
74 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_TASKBAR_WINDOW_THUMBNAILER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698