OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/window_impl.h" |
10 #include "app/win_util.h" | 11 #include "app/win_util.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/scoped_comptr_win.h" | 13 #include "base/scoped_comptr_win.h" |
13 #include "base/scoped_handle_win.h" | 14 #include "base/scoped_handle_win.h" |
14 #include "base/scoped_native_library.h" | 15 #include "base/scoped_native_library.h" |
15 #include "base/waitable_event.h" | 16 #include "base/waitable_event.h" |
16 #include "base/win/windows_version.h" | 17 #include "base/win/windows_version.h" |
17 #include "chrome/browser/app_icon_win.h" | 18 #include "chrome/browser/app_icon_win.h" |
18 #include "chrome/browser/browser_list.h" | 19 #include "chrome/browser/browser_list.h" |
19 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/browser_thread.h" | 21 #include "chrome/browser/browser_thread.h" |
21 #include "chrome/browser/renderer_host/backing_store.h" | 22 #include "chrome/browser/renderer_host/backing_store.h" |
22 #include "chrome/browser/renderer_host/render_view_host.h" | 23 #include "chrome/browser/renderer_host/render_view_host.h" |
23 #include "chrome/browser/tab_contents/tab_contents.h" | 24 #include "chrome/browser/tab_contents/tab_contents.h" |
24 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 25 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
25 #include "chrome/browser/tab_contents/tab_contents_view.h" | 26 #include "chrome/browser/tab_contents/tab_contents_view.h" |
26 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 27 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
27 #include "chrome/browser/tabs/tab_strip_model.h" | 28 #include "chrome/browser/tabs/tab_strip_model.h" |
28 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 29 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
29 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
30 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/installer/util/browser_distribution.h" | 32 #include "chrome/installer/util/browser_distribution.h" |
32 #include "gfx/gdi_util.h" | 33 #include "gfx/gdi_util.h" |
33 #include "gfx/icon_util.h" | 34 #include "gfx/icon_util.h" |
34 #include "gfx/window_impl.h" | |
35 #include "skia/ext/image_operations.h" | 35 #include "skia/ext/image_operations.h" |
36 #include "skia/ext/platform_canvas.h" | 36 #include "skia/ext/platform_canvas.h" |
37 #include "third_party/skia/include/core/SkBitmap.h" | 37 #include "third_party/skia/include/core/SkBitmap.h" |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 // Macros and COM interfaces used in this file. | 41 // Macros and COM interfaces used in this file. |
42 // These interface declarations are copied from Windows SDK 7. | 42 // These interface declarations are copied from Windows SDK 7. |
43 // TODO(hbono): Bug 16903: to be deleted when we use Windows SDK 7. | 43 // TODO(hbono): Bug 16903: to be deleted when we use Windows SDK 7. |
44 | 44 |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 537 |
538 } // namespace | 538 } // namespace |
539 | 539 |
540 // A class which implements a place-holder window used by AeroPeek. | 540 // A class which implements a place-holder window used by AeroPeek. |
541 // The major work of this class are: | 541 // The major work of this class are: |
542 // * Updating the status of Tab Thumbnails; | 542 // * Updating the status of Tab Thumbnails; |
543 // * Receiving messages from Windows, and; | 543 // * Receiving messages from Windows, and; |
544 // * Translating received messages for TabStrip. | 544 // * Translating received messages for TabStrip. |
545 // This class is used by the AeroPeekManager class, which is a proxy | 545 // This class is used by the AeroPeekManager class, which is a proxy |
546 // between TabStrip and Windows 7. | 546 // between TabStrip and Windows 7. |
547 class AeroPeekWindow : public gfx::WindowImpl { | 547 class AeroPeekWindow : public app::win::WindowImpl { |
548 public: | 548 public: |
549 AeroPeekWindow(HWND frame_window, | 549 AeroPeekWindow(HWND frame_window, |
550 AeroPeekWindowDelegate* delegate, | 550 AeroPeekWindowDelegate* delegate, |
551 int tab_id, | 551 int tab_id, |
552 bool tab_active, | 552 bool tab_active, |
553 const std::wstring& title, | 553 const std::wstring& title, |
554 const SkBitmap& favicon_bitmap); | 554 const SkBitmap& favicon_bitmap); |
555 ~AeroPeekWindow(); | 555 ~AeroPeekWindow(); |
556 | 556 |
557 // Activates or deactivates this window. | 557 // Activates or deactivates this window. |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 // This code is just copied from "thumbnail_generator.cc". | 1230 // This code is just copied from "thumbnail_generator.cc". |
1231 skia::PlatformCanvas canvas; | 1231 skia::PlatformCanvas canvas; |
1232 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), | 1232 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), |
1233 &canvas)) | 1233 &canvas)) |
1234 return false; | 1234 return false; |
1235 | 1235 |
1236 const SkBitmap& bitmap = canvas.getTopPlatformDevice().accessBitmap(false); | 1236 const SkBitmap& bitmap = canvas.getTopPlatformDevice().accessBitmap(false); |
1237 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); | 1237 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); |
1238 return true; | 1238 return true; |
1239 } | 1239 } |
OLD | NEW |