Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: ui/snapshot/snapshot_gtk.cc

Issue 11399002: Implemented GetWindowSnapshot on RenderViewImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added stub methods for iOS Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/snapshot/snapshot_export.h ('k') | ui/snapshot/snapshot_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/snapshot/snapshot_gtk.cc
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_gtk.cc b/ui/snapshot/snapshot_gtk.cc
similarity index 84%
rename from chrome/browser/ui/window_snapshot/window_snapshot_gtk.cc
rename to ui/snapshot/snapshot_gtk.cc
index 8c255ba851ed2e2348ec0be7a4439bb7457acebd..8a2f8c1edd7003be501dde06f4e26109e1c7c07a 100644
--- a/chrome/browser/ui/window_snapshot/window_snapshot_gtk.cc
+++ b/ui/snapshot/snapshot_gtk.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/window_snapshot/window_snapshot.h"
+#include "ui/snapshot/snapshot.h"
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
@@ -27,13 +27,12 @@ cairo_status_t SnapshotCallback(void* closure,
} // namespace
-namespace chrome {
-namespace internal {
+namespace ui {
-bool GrabWindowSnapshot(gfx::NativeWindow window_handle,
+bool GrabViewSnapshot(gfx::NativeView view_handle,
std::vector<unsigned char>* png_representation,
const gfx::Rect& snapshot_bounds) {
- GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window_handle));
+ GdkWindow* gdk_window = gtk_widget_get_window(view_handle);
Display* display = GDK_WINDOW_XDISPLAY(gdk_window);
XID win = GDK_WINDOW_XID(gdk_window);
@@ -76,5 +75,11 @@ bool GrabWindowSnapshot(gfx::NativeWindow window_handle,
return true;
}
-} // namespace internal
-} // namespace chrome
+bool GrabWindowSnapshot(gfx::NativeWindow window_handle,
+ std::vector<unsigned char>* png_representation,
+ const gfx::Rect& snapshot_bounds) {
+ return GrabViewSnapshot(GTK_WIDGET(window_handle), png_representation,
+ snapshot_bounds);
+}
+
+} // namespace ui
« no previous file with comments | « ui/snapshot/snapshot_export.h ('k') | ui/snapshot/snapshot_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698