summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/window_snapshot/window_snapshot.h
blob: cb681db739eb1cb3940ae43f8349fb3b135cf2ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// 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_

#include <vector>

#include "ui/gfx/native_widget_types.h"

class PrefRegistrySimple;

namespace gfx {
class Rect;
}

namespace chrome {

void RegisterScreenshotPrefs(PrefRegistrySimple* registry);

// 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. This takes into account calling user context (ie. checks
// policy settings if taking screenshots is allowed), and is intended to be used
// by browser code. If you need to take a screenshot for debugging purposes,
// consider using ui::GrabWindowSnapshot.
// Returns true if the operation is successful (ie. permitted).
bool GrabWindowSnapshotForUser(
    gfx::NativeWindow window,
    std::vector<unsigned char>* png_representation,
    const gfx::Rect& snapshot_bounds);

}  // namespace chrome

#endif  // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_