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

Side by Side Diff: chrome/browser/ui/window_snapshot/window_snapshot.h

Issue 10830158: Refactor GrabWindowSnapshot and GrabWindowSnapshotImpl names to GrabWindowSnapshotForUser and GrabW… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Enabled tests Created 8 years, 4 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 unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
6 #define CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ 6 #define CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ui/gfx/native_widget_types.h" 10 #include "ui/gfx/native_widget_types.h"
11 11
12 class PrefService; 12 class PrefService;
13 13
14 namespace gfx { 14 namespace gfx {
15 class Rect; 15 class Rect;
16 } 16 }
17 17
18 namespace chrome { 18 namespace chrome {
19 19
20 // Grabs a snapshot of the rectangle area |snapshot_bounds| with respect to the 20 // 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 21 // 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 22 // 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. 23 // the primary monitor. This takes into account calling user context (ie. checks
24 // policy settings if taking screenshots is allowed), and is intended to by used
grt (UTC plus 2) 2012/08/03 20:50:45 "to by" -> "to be"
qfel 2012/08/06 08:49:10 Done.
25 // by browser code. If you need to take a screenshot for debugging purposes,
26 // consider using GrabWindowSnapshot.
27 // Returns true if the operation is successful (ie. permitted).
28 bool GrabWindowSnapshotForUser(
29 gfx::NativeWindow window,
30 std::vector<unsigned char>* png_representation,
31 const gfx::Rect& snapshot_bounds);
32
33 // Like GrabWindowSnapshotForUser, but does not perform additional security
34 // checks - just grabs a snapshot. This is intended to be used for debugging
35 // purposes where no BrowserProcess instance is available (ie. tests).
36 // DO NOT use in a result of user action.
24 bool GrabWindowSnapshot( 37 bool GrabWindowSnapshot(
sky 2012/08/03 17:24:59 move this into an internal namespace (inside the c
qfel 2012/08/06 08:49:10 Done.
25 gfx::NativeWindow window, 38 gfx::NativeWindow window,
26 std::vector<unsigned char>* png_representation, 39 std::vector<unsigned char>* png_representation,
27 const gfx::Rect& snapshot_bounds); 40 const gfx::Rect& snapshot_bounds);
28 41
29 void RegisterScreenshotPrefs(PrefService* service); 42 void RegisterScreenshotPrefs(PrefService* service);
30 43
31 } // namespace chrome 44 } // namespace chrome
32 45
33 #endif // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ 46 #endif // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698