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 20 matching lines...) Expand all Loading... |
31 #include "content/browser/tab_contents/tab_contents_delegate.h" | 31 #include "content/browser/tab_contents/tab_contents_delegate.h" |
32 #include "content/browser/tab_contents/tab_contents_view.h" | 32 #include "content/browser/tab_contents/tab_contents_view.h" |
33 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
34 #include "skia/ext/image_operations.h" | 34 #include "skia/ext/image_operations.h" |
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 "ui/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; | 45 using content::BrowserThread; |
46 | 46 |
47 namespace { | 47 namespace { |
48 | 48 |
49 // 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 |
50 // 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 |
51 // can use DwmInvalidateIconicBitmap() to force Windows to send the message. | 51 // can use DwmInvalidateIconicBitmap() to force Windows to send the message. |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 // This code is just copied from "thumbnail_generator.cc". | 1119 // This code is just copied from "thumbnail_generator.cc". |
1120 skia::PlatformCanvas canvas; | 1120 skia::PlatformCanvas canvas; |
1121 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), | 1121 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), |
1122 &canvas)) | 1122 &canvas)) |
1123 return false; | 1123 return false; |
1124 | 1124 |
1125 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); | 1125 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); |
1126 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); | 1126 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); |
1127 return true; | 1127 return true; |
1128 } | 1128 } |
OLD | NEW |