| Index: chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
|
| diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm b/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
|
| index ab790872e0db1c88dd5602bf31d0f384e2623306..134a0deeb53ea0aaa42006168ae6d879dbe16953 100644
|
| --- a/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
|
| +++ b/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm
|
| @@ -14,9 +14,19 @@
|
| namespace browser {
|
|
|
| gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window,
|
| - std::vector<unsigned char>* png_representation) {
|
| + std::vector<unsigned char>* png_representation,
|
| + gfx::Rect snapshot_bounds) {
|
| png_representation->clear();
|
|
|
| + CGRect windowRect = CGRectNUll;
|
| + if (!snapshot_bounds.IsEmpty()) {
|
| + gfx::Rect window_bounds = gfx::Rect([window frame]);
|
| + snapshot_bounds.Offset(window_bounds.left(), window_bounds.top());
|
| + windowRect = snapshot_bounds.ToCGRect();
|
| + DCHECK(snapshot_bounds.right() <= window_bounds.right());
|
| + DCHECK(snapshot_bounds.bottom() <= window_bounds.bottom());
|
| + }
|
| +
|
| // Make sure to grab the "window frame" view so we get current tab +
|
| // tabstrip.
|
| NSView* view = [[window contentView] superview];
|
|
|