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 "app/win/shell.h" | |
11 #include "base/command_line.h" | 10 #include "base/command_line.h" |
12 #include "base/scoped_native_library.h" | 11 #include "base/scoped_native_library.h" |
13 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
14 #include "base/win/scoped_comptr.h" | 13 #include "base/win/scoped_comptr.h" |
15 #include "base/win/scoped_gdi_object.h" | 14 #include "base/win/scoped_gdi_object.h" |
16 #include "base/win/scoped_hdc.h" | 15 #include "base/win/scoped_hdc.h" |
17 #include "base/win/windows_version.h" | 16 #include "base/win/windows_version.h" |
18 #include "chrome/browser/app_icon_win.h" | 17 #include "chrome/browser/app_icon_win.h" |
19 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/favicon/favicon_tab_helper.h" | 19 #include "chrome/browser/favicon/favicon_tab_helper.h" |
21 #include "chrome/browser/sessions/restore_tab_helper.h" | 20 #include "chrome/browser/sessions/restore_tab_helper.h" |
22 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 21 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
23 #include "chrome/browser/tabs/tab_strip_model.h" | 22 #include "chrome/browser/tabs/tab_strip_model.h" |
24 #include "chrome/browser/ui/browser_list.h" | 23 #include "chrome/browser/ui/browser_list.h" |
25 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
26 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/installer/util/browser_distribution.h" | 27 #include "chrome/installer/util/browser_distribution.h" |
29 #include "content/browser/browser_thread.h" | 28 #include "content/browser/browser_thread.h" |
30 #include "content/browser/renderer_host/backing_store.h" | 29 #include "content/browser/renderer_host/backing_store.h" |
31 #include "content/browser/renderer_host/render_view_host.h" | 30 #include "content/browser/renderer_host/render_view_host.h" |
32 #include "content/browser/tab_contents/tab_contents.h" | 31 #include "content/browser/tab_contents/tab_contents.h" |
33 #include "content/browser/tab_contents/tab_contents_delegate.h" | 32 #include "content/browser/tab_contents/tab_contents_delegate.h" |
34 #include "content/browser/tab_contents/tab_contents_view.h" | 33 #include "content/browser/tab_contents/tab_contents_view.h" |
35 #include "skia/ext/image_operations.h" | 34 #include "skia/ext/image_operations.h" |
36 #include "skia/ext/platform_canvas.h" | 35 #include "skia/ext/platform_canvas.h" |
37 #include "third_party/skia/include/core/SkBitmap.h" | 36 #include "third_party/skia/include/core/SkBitmap.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 namespace { | 43 namespace { |
44 | 44 |
45 // Macros and COM interfaces used in this file. | 45 // Macros and COM interfaces used in this file. |
46 // These interface declarations are copied from Windows SDK 7. | 46 // These interface declarations are copied from Windows SDK 7. |
47 // TODO(hbono): Bug 16903: to be deleted when we use Windows SDK 7. | 47 // TODO(hbono): Bug 16903: to be deleted when we use Windows SDK 7. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 247 } |
248 | 248 |
249 private: | 249 private: |
250 void Run() { | 250 void Run() { |
251 // Set the App ID of the browser for this place-holder window to tell | 251 // Set the App ID of the browser for this place-holder window to tell |
252 // that this window is a child of the browser application, i.e. to tell | 252 // that this window is a child of the browser application, i.e. to tell |
253 // that this thumbnail window should be displayed when we hover the | 253 // that this thumbnail window should be displayed when we hover the |
254 // browser icon in the taskbar. | 254 // browser icon in the taskbar. |
255 // TODO(mattm): This should use ShellIntegration::GetChromiumAppId to work | 255 // TODO(mattm): This should use ShellIntegration::GetChromiumAppId to work |
256 // properly with multiple profiles. | 256 // properly with multiple profiles. |
257 app::win::SetAppIdForWindow( | 257 ui::win::SetAppIdForWindow( |
258 BrowserDistribution::GetDistribution()->GetBrowserAppId(), window_); | 258 BrowserDistribution::GetDistribution()->GetBrowserAppId(), window_); |
259 | 259 |
260 // Register this place-holder window to the taskbar as a child of | 260 // Register this place-holder window to the taskbar as a child of |
261 // the browser window and add it to the end of its tab list. | 261 // the browser window and add it to the end of its tab list. |
262 // Correctly, this registration should be called after this browser window | 262 // Correctly, this registration should be called after this browser window |
263 // receives a registered window message "TaskbarButtonCreated", which | 263 // receives a registered window message "TaskbarButtonCreated", which |
264 // means that Windows creates a taskbar button for this window in its | 264 // means that Windows creates a taskbar button for this window in its |
265 // taskbar. But it seems to be OK to register it without checking the | 265 // taskbar. But it seems to be OK to register it without checking the |
266 // message. | 266 // message. |
267 // TODO(hbono): we need to check this registered message? | 267 // TODO(hbono): we need to check this registered message? |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 // This code is just copied from "thumbnail_generator.cc". | 1235 // This code is just copied from "thumbnail_generator.cc". |
1236 skia::PlatformCanvas canvas; | 1236 skia::PlatformCanvas canvas; |
1237 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), | 1237 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), |
1238 &canvas)) | 1238 &canvas)) |
1239 return false; | 1239 return false; |
1240 | 1240 |
1241 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); | 1241 const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); |
1242 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); | 1242 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); |
1243 return true; | 1243 return true; |
1244 } | 1244 } |
OLD | NEW |