| 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_util.h" | 10 #include "app/win_util.h" |
| 11 #include "app/win/window_impl.h" | |
| 12 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 13 #include "base/scoped_comptr_win.h" | 12 #include "base/scoped_comptr_win.h" |
| 14 #include "base/scoped_handle_win.h" | 13 #include "base/scoped_handle_win.h" |
| 15 #include "base/scoped_native_library.h" | 14 #include "base/scoped_native_library.h" |
| 16 #include "base/win_util.h" | 15 #include "base/win_util.h" |
| 17 #include "chrome/browser/app_icon_win.h" | 16 #include "chrome/browser/app_icon_win.h" |
| 18 #include "chrome/browser/browser_list.h" | 17 #include "chrome/browser/browser_list.h" |
| 19 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/chrome_thread.h" | 19 #include "chrome/browser/chrome_thread.h" |
| 21 #include "chrome/browser/renderer_host/backing_store.h" | 20 #include "chrome/browser/renderer_host/backing_store.h" |
| 22 #include "chrome/browser/renderer_host/render_view_host.h" | 21 #include "chrome/browser/renderer_host/render_view_host.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
| 24 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 23 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 25 #include "chrome/browser/tab_contents/tab_contents_view.h" | 24 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 26 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 25 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| 27 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 28 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/installer/util/browser_distribution.h" | 28 #include "chrome/installer/util/browser_distribution.h" |
| 30 #include "gfx/gdi_util.h" | 29 #include "gfx/gdi_util.h" |
| 31 #include "gfx/icon_util.h" | 30 #include "gfx/icon_util.h" |
| 31 #include "gfx/window_impl.h" |
| 32 #include "skia/ext/image_operations.h" | 32 #include "skia/ext/image_operations.h" |
| 33 #include "skia/ext/platform_canvas.h" | 33 #include "skia/ext/platform_canvas.h" |
| 34 #include "third_party/skia/include/core/SkBitmap.h" | 34 #include "third_party/skia/include/core/SkBitmap.h" |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // Macros and COM interfaces used in this file. | 38 // Macros and COM interfaces used in this file. |
| 39 // These interface declarations are copied from Windows SDK 7. | 39 // These interface declarations are copied from Windows SDK 7. |
| 40 // TODO(hbono): Bug 16903: to be deleted when we use Windows SDK 7. | 40 // TODO(hbono): Bug 16903: to be deleted when we use Windows SDK 7. |
| 41 | 41 |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 556 |
| 557 } // namespace | 557 } // namespace |
| 558 | 558 |
| 559 // A class which implements a place-holder window used by AeroPeek. | 559 // A class which implements a place-holder window used by AeroPeek. |
| 560 // The major work of this class are: | 560 // The major work of this class are: |
| 561 // * Updating the status of Tab Thumbnails; | 561 // * Updating the status of Tab Thumbnails; |
| 562 // * Receiving messages from Windows, and; | 562 // * Receiving messages from Windows, and; |
| 563 // * Translating received messages for TabStrip. | 563 // * Translating received messages for TabStrip. |
| 564 // This class is used by the AeroPeekManager class, which is a proxy | 564 // This class is used by the AeroPeekManager class, which is a proxy |
| 565 // between TabStrip and Windows 7. | 565 // between TabStrip and Windows 7. |
| 566 class AeroPeekWindow : public app::WindowImpl { | 566 class AeroPeekWindow : public gfx::WindowImpl { |
| 567 public: | 567 public: |
| 568 AeroPeekWindow(HWND frame_window, | 568 AeroPeekWindow(HWND frame_window, |
| 569 AeroPeekWindowDelegate* delegate, | 569 AeroPeekWindowDelegate* delegate, |
| 570 int tab_id, | 570 int tab_id, |
| 571 bool tab_active, | 571 bool tab_active, |
| 572 const std::wstring& title, | 572 const std::wstring& title, |
| 573 const SkBitmap& favicon_bitmap); | 573 const SkBitmap& favicon_bitmap); |
| 574 ~AeroPeekWindow(); | 574 ~AeroPeekWindow(); |
| 575 | 575 |
| 576 // Activates or deactivates this window. | 576 // Activates or deactivates this window. |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 // This code is just copied from "thumbnail_generator.cc". | 1221 // This code is just copied from "thumbnail_generator.cc". |
| 1222 skia::PlatformCanvas canvas; | 1222 skia::PlatformCanvas canvas; |
| 1223 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), | 1223 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), |
| 1224 &canvas)) | 1224 &canvas)) |
| 1225 return false; | 1225 return false; |
| 1226 | 1226 |
| 1227 const SkBitmap& bitmap = canvas.getTopPlatformDevice().accessBitmap(false); | 1227 const SkBitmap& bitmap = canvas.getTopPlatformDevice().accessBitmap(false); |
| 1228 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); | 1228 bitmap.copyTo(preview, SkBitmap::kARGB_8888_Config); |
| 1229 return true; | 1229 return true; |
| 1230 } | 1230 } |
| OLD | NEW |