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

Side by Side Diff: ui/snapshot/snapshot_mac.mm

Issue 823133004: Cleanup: Update the path to gfx rect headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rect_f.h Created 5 years, 11 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
« no previous file with comments | « ui/snapshot/snapshot_ios.mm ('k') | ui/snapshot/snapshot_mac_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ui/snapshot/snapshot.h" 5 #include "ui/snapshot/snapshot.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/mac/scoped_cftyperef.h" 11 #include "base/mac/scoped_cftyperef.h"
12 #include "base/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/task_runner.h" 13 #include "base/task_runner.h"
14 #include "ui/gfx/geometry/rect.h"
14 #include "ui/gfx/image/image.h" 15 #include "ui/gfx/image/image.h"
15 #include "ui/gfx/rect.h"
16 16
17 namespace ui { 17 namespace ui {
18 18
19 bool GrabViewSnapshot(gfx::NativeView view, 19 bool GrabViewSnapshot(gfx::NativeView view,
20 std::vector<unsigned char>* png_representation, 20 std::vector<unsigned char>* png_representation,
21 const gfx::Rect& snapshot_bounds) { 21 const gfx::Rect& snapshot_bounds) {
22 NSWindow* window = [view window]; 22 NSWindow* window = [view window];
23 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 23 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
24 gfx::Rect screen_bounds = gfx::Rect(NSRectToCGRect([screen frame])); 24 gfx::Rect screen_bounds = gfx::Rect(NSRectToCGRect([screen frame]));
25 25
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void GrabWindowSnapshotAsync( 95 void GrabWindowSnapshotAsync(
96 gfx::NativeWindow window, 96 gfx::NativeWindow window,
97 const gfx::Rect& source_rect, 97 const gfx::Rect& source_rect,
98 scoped_refptr<base::TaskRunner> background_task_runner, 98 scoped_refptr<base::TaskRunner> background_task_runner,
99 const GrabWindowSnapshotAsyncPNGCallback& callback) { 99 const GrabWindowSnapshotAsyncPNGCallback& callback) {
100 return GrabViewSnapshotAsync([[window contentView] superview], source_rect, 100 return GrabViewSnapshotAsync([[window contentView] superview], source_rect,
101 background_task_runner, callback); 101 background_task_runner, callback);
102 } 102 }
103 103
104 } // namespace ui 104 } // namespace ui
OLDNEW
« no previous file with comments | « ui/snapshot/snapshot_ios.mm ('k') | ui/snapshot/snapshot_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698