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

Unified Diff: ui/window_snapshot/window_snapshot.h

Issue 10821104: Support GrabWindowSnapshot with no g_browser_process (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased Created 8 years, 5 months 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/ui.gyp ('k') | ui/window_snapshot/window_snapshot_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/window_snapshot/window_snapshot.h
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot.h b/ui/window_snapshot/window_snapshot.h
similarity index 54%
copy from chrome/browser/ui/window_snapshot/window_snapshot.h
copy to ui/window_snapshot/window_snapshot.h
index bad52012aefd21c6f7ae39856540e8154468b70a..2c4f8c5b6dc5dbd82891e1c9dcb19444cf9f8889 100644
--- a/chrome/browser/ui/window_snapshot/window_snapshot.h
+++ b/ui/window_snapshot/window_snapshot.h
@@ -2,32 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
-#define CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
+#ifndef UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
+#define UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
#include <vector>
+#include "ui/base/ui_export.h"
#include "ui/gfx/native_widget_types.h"
-class PrefService;
-
namespace gfx {
class Rect;
}
-namespace chrome {
+namespace ui {
// Grabs a snapshot of the rectangle area |snapshot_bounds| with respect to the
// top left corner of the designated window and stores a PNG representation
// into a byte vector. On Windows, |window| may be NULL to grab a snapshot of
-// the primary monitor. Returns true if the operation is successful.
-bool GrabWindowSnapshot(
+// the primary monitor. DO NOT use in browser code. Screenshots initiated by
+// user action should be taken with chrome::GrabWindowSnapshot
+// (chrome/browser/ui/window_snapshot/window_snapshot.cc), so user context is
+// taken into account (eg. policy settings are checked).
+// Returns true if the operation is successful.
+UI_EXPORT bool GrabWindowSnapshot(
gfx::NativeWindow window,
std::vector<unsigned char>* png_representation,
const gfx::Rect& snapshot_bounds);
-void RegisterScreenshotPrefs(PrefService* service);
-
} // namespace chrome
-#endif // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
+#endif // UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
« no previous file with comments | « ui/ui.gyp ('k') | ui/window_snapshot/window_snapshot_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698