summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs/native_view_photobooth.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-18 21:22:51 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-18 21:22:51 +0000
commit434ff6a6e51ac0c1853c6b0ade3af6cfea8092de (patch)
treec0fc0a599d9f38d0b98ed994e533c8b38d21ce2e /chrome/browser/views/tabs/native_view_photobooth.h
parent39797c02ac4020c0537166b3311a57e6d0c296ac (diff)
downloadchromium_src-434ff6a6e51ac0c1853c6b0ade3af6cfea8092de.zip
chromium_src-434ff6a6e51ac0c1853c6b0ade3af6cfea8092de.tar.gz
chromium_src-434ff6a6e51ac0c1853c6b0ade3af6cfea8092de.tar.bz2
Refactors HWNDPhotobooth into NativeViewPhotobooth and
NativeViewPhotoboothWin. BUG=none TEST=none Review URL: http://codereview.chromium.org/115475 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16324 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/native_view_photobooth.h')
-rw-r--r--chrome/browser/views/tabs/native_view_photobooth.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome/browser/views/tabs/native_view_photobooth.h b/chrome/browser/views/tabs/native_view_photobooth.h
new file mode 100644
index 0000000..3d639b3
--- /dev/null
+++ b/chrome/browser/views/tabs/native_view_photobooth.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_
+#define CHROME_BROWSER_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_
+
+#include "base/gfx/native_widget_types.h"
+
+namespace gfx {
+class Canvas;
+class Rect;
+}
+///////////////////////////////////////////////////////////////////////////////
+// NativeViewPhotobooth
+//
+// An object that a NativeView "steps into" to have its picture taken. This is
+// used to generate a full size screen shot of the contents of a NativeView
+// including any child windows.
+//
+// Implementation note: This causes the NativeView to be re-parented to a
+// mostly off-screen layered window.
+//
+class NativeViewPhotobooth {
+ public:
+ // Creates the photo booth. Constructs a nearly off-screen window, parents
+ // the view, then shows it. The caller is responsible for destroying this
+ // photo-booth, since the photo-booth will detach it before it is destroyed.
+ static NativeViewPhotobooth* Create(gfx::NativeView initial_view);
+
+ // Destroys the photo booth window.
+ virtual ~NativeViewPhotobooth() {}
+
+ // Replaces the view in the photo booth with the specified one.
+ virtual void Replace(gfx::NativeView new_view) = 0;
+
+ // Paints the current display image of the window into |canvas|, clipped to
+ // |target_bounds|.
+ virtual void PaintScreenshotIntoCanvas(gfx::Canvas* canvas,
+ const gfx::Rect& target_bounds) = 0;
+};
+
+#endif // #ifndef CHROME_BROWSER_VIEWS_TABS_NATIVE_VIEW_PHOTOBOOTH_H_