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

Unified Diff: chrome/browser/ui/window_snapshot/window_snapshot.cc

Issue 11399002: Implemented GetWindowSnapshot on RenderViewImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed aura snapshot circular dependency Created 8 years, 1 month 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
Index: chrome/browser/ui/window_snapshot/window_snapshot.cc
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot.cc b/chrome/browser/ui/window_snapshot/window_snapshot.cc
index ed0419745fa222d4aa4190e24faaae10fad1d6e2..7d922b6131f3dcc34ef7186e4177b316d08500ec 100644
--- a/chrome/browser/ui/window_snapshot/window_snapshot.cc
+++ b/chrome/browser/ui/window_snapshot/window_snapshot.cc
@@ -8,6 +8,12 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/pref_names.h"
+#if defined(USE_AURA)
+#include "chrome/browser/ui/window_snapshot/window_snapshot_aura.h"
+#else
+#include "ui/base/snapshot/snapshot.h"
+#endif
+
namespace chrome {
bool GrabWindowSnapshotForUser(
@@ -24,4 +30,19 @@ void RegisterScreenshotPrefs(PrefService* service) {
service->RegisterBooleanPref(prefs::kDisableScreenshots, false);
}
-} // namespace browser
+namespace internal {
+
+bool GrabWindowSnapshot(gfx::NativeWindow window,
+ std::vector<unsigned char>* png_representation,
+ const gfx::Rect& snapshot_bounds) {
+#if defined(USE_AURA)
+ return chrome::GrabAuraCompositorSnapshot(window, png_representation,
+ snapshot_bounds);
+#else
+ return ui::GrabWindowSnapshot(window, png_representation,
+ snapshot_bounds);
+#endif
+}
+
+} // namespace internal
+} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698