| 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 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // the primary monitor. This takes into account calling user context (ie. checks | 25 // the primary monitor. This takes into account calling user context (ie. checks |
| 26 // policy settings if taking screenshots is allowed), and is intended to be used | 26 // policy settings if taking screenshots is allowed), and is intended to be used |
| 27 // by browser code. If you need to take a screenshot for debugging purposes, | 27 // by browser code. If you need to take a screenshot for debugging purposes, |
| 28 // consider using GrabWindowSnapshot. | 28 // consider using GrabWindowSnapshot. |
| 29 // Returns true if the operation is successful (ie. permitted). | 29 // Returns true if the operation is successful (ie. permitted). |
| 30 bool GrabWindowSnapshotForUser( | 30 bool GrabWindowSnapshotForUser( |
| 31 gfx::NativeWindow window, | 31 gfx::NativeWindow window, |
| 32 std::vector<unsigned char>* png_representation, | 32 std::vector<unsigned char>* png_representation, |
| 33 const gfx::Rect& snapshot_bounds); | 33 const gfx::Rect& snapshot_bounds); |
| 34 | 34 |
| 35 namespace internal { | |
| 36 | |
| 37 // Like GrabWindowSnapshotForUser, but does not perform additional security | |
| 38 // checks - just grabs a snapshot. This is intended to be used for debugging | |
| 39 // purposes where no BrowserProcess instance is available (ie. tests). | |
| 40 // DO NOT use in a result of user action. | |
| 41 bool GrabWindowSnapshot( | |
| 42 gfx::NativeWindow window, | |
| 43 std::vector<unsigned char>* png_representation, | |
| 44 const gfx::Rect& snapshot_bounds); | |
| 45 | |
| 46 } // namespace internal | |
| 47 } // namespace chrome | 35 } // namespace chrome |
| 48 | 36 |
| 49 #endif // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ | 37 #endif // CHROME_BROWSER_UI_WINDOW_SNAPSHOT_WINDOW_SNAPSHOT_H_ |
| OLD | NEW |