| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_VIEWS_TABS_HWND_PHOTOBOOTH_H__ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_HWND_PHOTOBOOTH_H__ |
| 6 #define CHROME_BROWSER_VIEWS_TABS_HWND_PHOTOBOOTH_H__ | 6 #define CHROME_BROWSER_VIEWS_TABS_HWND_PHOTOBOOTH_H__ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
| 10 | 10 |
| 11 class ChromeCanvas; | 11 namespace gfx { |
| 12 class Canvas; |
| 13 } |
| 12 namespace views { | 14 namespace views { |
| 13 class WidgetWin; | 15 class WidgetWin; |
| 14 } | 16 } |
| 15 | 17 |
| 16 /////////////////////////////////////////////////////////////////////////////// | 18 /////////////////////////////////////////////////////////////////////////////// |
| 17 // HWNDPhotobooth | 19 // HWNDPhotobooth |
| 18 // | 20 // |
| 19 // An object that a HWND "steps into" to have its picture taken. This is used | 21 // An object that a HWND "steps into" to have its picture taken. This is used |
| 20 // to generate a full size screen shot of the contents of a HWND including | 22 // to generate a full size screen shot of the contents of a HWND including |
| 21 // any child windows. | 23 // any child windows. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 // Destroys the photo booth window. | 37 // Destroys the photo booth window. |
| 36 virtual ~HWNDPhotobooth(); | 38 virtual ~HWNDPhotobooth(); |
| 37 | 39 |
| 38 // Replaces the HWND in the photo booth with the specified one. The caller is | 40 // Replaces the HWND in the photo booth with the specified one. The caller is |
| 39 // responsible for destroying this HWND since it will be detached from the | 41 // responsible for destroying this HWND since it will be detached from the |
| 40 // capture window before the capture window is destroyed. | 42 // capture window before the capture window is destroyed. |
| 41 void ReplaceHWND(HWND new_hwnd); | 43 void ReplaceHWND(HWND new_hwnd); |
| 42 | 44 |
| 43 // Paints the current display image of the window into |canvas|, clipped to | 45 // Paints the current display image of the window into |canvas|, clipped to |
| 44 // |target_bounds|. | 46 // |target_bounds|. |
| 45 void PaintScreenshotIntoCanvas(ChromeCanvas* canvas, | 47 void PaintScreenshotIntoCanvas(gfx::Canvas* canvas, |
| 46 const gfx::Rect& target_bounds); | 48 const gfx::Rect& target_bounds); |
| 47 | 49 |
| 48 private: | 50 private: |
| 49 // Creates a mostly off-screen window to contain the HWND to be captured. | 51 // Creates a mostly off-screen window to contain the HWND to be captured. |
| 50 void CreateCaptureWindow(HWND initial_hwnd); | 52 void CreateCaptureWindow(HWND initial_hwnd); |
| 51 | 53 |
| 52 // The nearly off-screen photo-booth layered window used to hold the HWND. | 54 // The nearly off-screen photo-booth layered window used to hold the HWND. |
| 53 views::WidgetWin* capture_window_; | 55 views::WidgetWin* capture_window_; |
| 54 | 56 |
| 55 // The current HWND being captured. | 57 // The current HWND being captured. |
| 56 HWND current_hwnd_; | 58 HWND current_hwnd_; |
| 57 | 59 |
| 58 DISALLOW_EVIL_CONSTRUCTORS(HWNDPhotobooth); | 60 DISALLOW_EVIL_CONSTRUCTORS(HWNDPhotobooth); |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 #endif // #ifndef CHROME_BROWSER_VIEWS_TABS_HWND_PHOTOBOOTH_H__ | 63 #endif // #ifndef CHROME_BROWSER_VIEWS_TABS_HWND_PHOTOBOOTH_H__ |
| OLD | NEW |