| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Canvas; | 13 class CanvasSkia; |
| 14 class Rect; | 14 class Rect; |
| 15 } | 15 } |
| 16 /////////////////////////////////////////////////////////////////////////////// | 16 /////////////////////////////////////////////////////////////////////////////// |
| 17 // NativeViewPhotobooth | 17 // NativeViewPhotobooth |
| 18 // | 18 // |
| 19 // An object that a NativeView "steps into" to have its picture taken. This is | 19 // An object that a NativeView "steps into" to have its picture taken. This is |
| 20 // used to generate a full size screen shot of the contents of a NativeView | 20 // used to generate a full size screen shot of the contents of a NativeView |
| 21 // including any child windows. | 21 // including any child windows. |
| 22 // | 22 // |
| 23 // Implementation note: This causes the NativeView to be re-parented to a | 23 // Implementation note: This causes the NativeView to be re-parented to a |
| 24 // mostly off-screen layered window. | 24 // mostly off-screen layered window. |
| 25 // | 25 // |
| 26 class NativeViewPhotobooth { | 26 class NativeViewPhotobooth { |
| 27 public: | 27 public: |
| 28 // Creates the photo booth. Constructs a nearly off-screen window, parents | 28 // Creates the photo booth. Constructs a nearly off-screen window, parents |
| 29 // the view, then shows it. The caller is responsible for destroying this | 29 // the view, then shows it. The caller is responsible for destroying this |
| 30 // photo-booth, since the photo-booth will detach it before it is destroyed. | 30 // photo-booth, since the photo-booth will detach it before it is destroyed. |
| 31 static NativeViewPhotobooth* Create(gfx::NativeView initial_view); | 31 static NativeViewPhotobooth* Create(gfx::NativeView initial_view); |
| 32 | 32 |
| 33 // Destroys the photo booth window. | 33 // Destroys the photo booth window. |
| 34 virtual ~NativeViewPhotobooth() {} | 34 virtual ~NativeViewPhotobooth() {} |
| 35 | 35 |
| 36 // Replaces the view in the photo booth with the specified one. | 36 // Replaces the view in the photo booth with the specified one. |
| 37 virtual void Replace(gfx::NativeView new_view) = 0; | 37 virtual void Replace(gfx::NativeView new_view) = 0; |
| 38 | 38 |
| 39 // Paints the current display image of the window into |canvas|, clipped to | 39 // Paints the current display image of the window into |canvas|, clipped to |
| 40 // |target_bounds|. | 40 // |target_bounds|. |
| 41 virtual void PaintScreenshotIntoCanvas(gfx::Canvas* canvas, | 41 virtual void PaintScreenshotIntoCanvas(gfx::CanvasSkia* canvas, |
| 42 const gfx::Rect& target_bounds) = 0; | 42 const gfx::Rect& target_bounds) = 0; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 #endif // CHROME_BROWSER_UI_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_ | 45 #endif // CHROME_BROWSER_UI_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_ |
| OLD | NEW |