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 #include "ui/aura/root_window_host_mac.h" | 5 #include "ui/aura/root_window_host_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 38 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
39 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 39 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; |
40 virtual void SetCapture() OVERRIDE; | 40 virtual void SetCapture() OVERRIDE; |
41 virtual void ReleaseCapture() OVERRIDE; | 41 virtual void ReleaseCapture() OVERRIDE; |
42 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 42 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
43 virtual void ShowCursor(bool show) OVERRIDE; | 43 virtual void ShowCursor(bool show) OVERRIDE; |
44 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; | 44 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; |
45 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 45 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
46 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 46 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
47 virtual void UnConfineCursor() OVERRIDE; | 47 virtual void UnConfineCursor() OVERRIDE; |
| 48 virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, |
| 49 const gfx::Point& dest_offset, |
| 50 SkCanvas* canvas) OVERRIDE; |
48 virtual bool GrabSnapshot( | 51 virtual bool GrabSnapshot( |
49 const gfx::Rect& snapshot_bounds, | 52 const gfx::Rect& snapshot_bounds, |
50 std::vector<unsigned char>* png_representation) OVERRIDE; | 53 std::vector<unsigned char>* png_representation) OVERRIDE; |
51 | 54 |
52 // RootWindowHostMacDelegate: | 55 // RootWindowHostMacDelegate: |
53 virtual void SendEvent(const base::NativeEvent& native_event) OVERRIDE; | 56 virtual void SendEvent(const base::NativeEvent& native_event) OVERRIDE; |
54 | 57 |
55 // Set the initial location of the root window. The origin of |bounds| is | 58 // Set the initial location of the root window. The origin of |bounds| is |
56 // top-left. This gets converted to bottom-left to match Mac coordinates on | 59 // top-left. This gets converted to bottom-left to match Mac coordinates on |
57 // the main screen. | 60 // the main screen. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 219 |
217 void RootWindowHostMac::SetLocation(const gfx::Rect& bounds) { | 220 void RootWindowHostMac::SetLocation(const gfx::Rect& bounds) { |
218 NSRect screen = [[NSScreen mainScreen] visibleFrame]; | 221 NSRect screen = [[NSScreen mainScreen] visibleFrame]; |
219 NSPoint origin = NSMakePoint(screen.origin.x + bounds.x(), | 222 NSPoint origin = NSMakePoint(screen.origin.x + bounds.x(), |
220 screen.origin.y + screen.size.height - | 223 screen.origin.y + screen.size.height - |
221 bounds.y() - bounds.height()); | 224 bounds.y() - bounds.height()); |
222 [[controller_ window] setFrameOrigin:origin]; | 225 [[controller_ window] setFrameOrigin:origin]; |
223 } | 226 } |
224 | 227 |
225 } // namespace aura | 228 } // namespace aura |
OLD | NEW |