OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/aeropeek_manager.h" | 5 #include "chrome/browser/aeropeek_manager.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shobjidl.h> | 8 #include <shobjidl.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "skia/ext/platform_canvas.h" | 35 #include "skia/ext/platform_canvas.h" |
36 #include "third_party/skia/include/core/SkBitmap.h" | 36 #include "third_party/skia/include/core/SkBitmap.h" |
37 #include "ui/base/win/shell.h" | 37 #include "ui/base/win/shell.h" |
38 #include "ui/base/win/window_impl.h" | 38 #include "ui/base/win/window_impl.h" |
39 #include "ui/gfx/gdi_util.h" | 39 #include "ui/gfx/gdi_util.h" |
40 #include "ui/gfx/icon_util.h" | 40 #include "ui/gfx/icon_util.h" |
41 #include "views/widget/native_widget_win.h" | 41 #include "views/widget/native_widget_win.h" |
42 | 42 |
43 #pragma comment(lib, "dwmapi.lib") | 43 #pragma comment(lib, "dwmapi.lib") |
44 | 44 |
| 45 using content::BrowserThread; |
| 46 |
45 namespace { | 47 namespace { |
46 | 48 |
47 // Sends a thumbnail bitmap to Windows. Windows assumes this function is called | 49 // Sends a thumbnail bitmap to Windows. Windows assumes this function is called |
48 // when a WM_DWMSENDICONICTHUMBNAIL message sent to a place-holder window. We | 50 // when a WM_DWMSENDICONICTHUMBNAIL message sent to a place-holder window. We |
49 // can use DwmInvalidateIconicBitmap() to force Windows to send the message. | 51 // can use DwmInvalidateIconicBitmap() to force Windows to send the message. |
50 HRESULT CallDwmSetIconicThumbnail(HWND window, HBITMAP bitmap, DWORD flags) { | 52 HRESULT CallDwmSetIconicThumbnail(HWND window, HBITMAP bitmap, DWORD flags) { |
51 FilePath dwmapi_path(base::GetNativeLibraryName(L"dwmapi")); | 53 FilePath dwmapi_path(base::GetNativeLibraryName(L"dwmapi")); |
52 base::ScopedNativeLibrary dwmapi(dwmapi_path); | 54 base::ScopedNativeLibrary dwmapi(dwmapi_path); |
53 | 55 |
54 typedef HRESULT (STDAPICALLTYPE *DwmSetIconicThumbnailProc)( | 56 typedef HRESULT (STDAPICALLTYPE *DwmSetIconicThumbnailProc)( |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 // This code is just copied from "thumbnail_generator.cc". | 1119 // This code is just copied from "thumbnail_generator.cc". |
1118 skia::PlatformCanvas canvas; | 1120 skia::PlatformCanvas canvas; |
1119 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), | 1121 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), |
1120 &canvas)) | 1122 &canvas)) |
1121 return false; | 1123 return false; |
1122 | 1124 |
1123 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); | 1125 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); |
1124 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); | 1126 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); |
1125 return true; | 1127 return true; |
1126 } | 1128 } |
OLD | NEW |