Home | History | Annotate | Download | only in snapshot
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef UI_SNAPSHOT_SNAPSHOT_H_
      6 #define UI_SNAPSHOT_SNAPSHOT_H_
      7 
      8 #include <vector>
      9 
     10 #include "ui/gfx/native_widget_types.h"
     11 #include "ui/snapshot/snapshot_export.h"
     12 
     13 namespace gfx {
     14 class Rect;
     15 }
     16 
     17 namespace ui {
     18 
     19 // Grabs a snapshot of the window/view. No security checks are done.
     20 // This is intended to be used for debugging purposes where no BrowserProcess
     21 // instance is available (ie. tests). DO NOT use in a result of user action.
     22 SNAPSHOT_EXPORT bool GrabWindowSnapshot(
     23     gfx::NativeWindow window,
     24     std::vector<unsigned char>* png_representation,
     25     const gfx::Rect& snapshot_bounds);
     26 
     27 SNAPSHOT_EXPORT bool GrabViewSnapshot(
     28     gfx::NativeView view,
     29     std::vector<unsigned char>* png_representation,
     30     const gfx::Rect& snapshot_bounds);
     31 
     32 }  // namespace ui
     33 
     34 #endif  // UI_SNAPSHOT_SNAPSHOT_H_
     35