OLD | NEW |
1 // Copyright (c) 2012 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_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ | 5 #ifndef UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ |
6 #define CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ | 6 #define UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "ui/base/ui_export.h" |
10 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
11 | 12 |
12 class PrefService; | |
13 | |
14 namespace gfx { | 13 namespace gfx { |
15 class Rect; | 14 class Rect; |
16 } | 15 } |
17 | 16 |
18 namespace chrome { | 17 namespace ui { |
19 | 18 |
20 // Grabs a snapshot of the rectangle area |snapshot_bounds| with respect to the | 19 // Grabs a snapshot of the rectangle area |snapshot_bounds| with respect to the |
21 // top left corner of the designated window and stores a PNG representation | 20 // top left corner of the designated window and stores a PNG representation |
22 // into a byte vector. On Windows, |window| may be NULL to grab a snapshot of | 21 // into a byte vector. On Windows, |window| may be NULL to grab a snapshot of |
23 // the primary monitor. Returns true if the operation is successful. | 22 // the primary monitor. DO NOT use in browser code. Screenshots initiated by |
24 bool GrabWindowSnapshot( | 23 // user action should be taken with chrome::GrabWindowSnapshot |
| 24 // (chrome/browser/ui/window_snapshot/window_snapshot.cc), so user context is |
| 25 // taken into account (eg. policy settings are checked). |
| 26 // Returns true if the operation is successful. |
| 27 UI_EXPORT bool GrabWindowSnapshot( |
25 gfx::NativeWindow window, | 28 gfx::NativeWindow window, |
26 std::vector<unsigned char>* png_representation, | 29 std::vector<unsigned char>* png_representation, |
27 const gfx::Rect& snapshot_bounds); | 30 const gfx::Rect& snapshot_bounds); |
28 | 31 |
29 void RegisterScreenshotPrefs(PrefService* service); | |
30 | |
31 } // namespace chrome | 32 } // namespace chrome |
32 | 33 |
33 #endif // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ | 34 #endif // UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ |
OLD | NEW |