OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <Cocoa/Cocoa.h> | 5 #include <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "ui/aura/window_tree_host_mac.h" | 7 #include "ui/aura/window_tree_host_mac.h" |
8 #include "ui/aura/window_tree_host.h" | 8 #include "ui/aura/window_tree_host.h" |
9 | 9 |
10 namespace aura { | 10 namespace aura { |
11 | 11 |
12 WindowTreeHostMac::WindowTreeHostMac(const gfx::Rect& bounds) { | 12 WindowTreeHostMac::WindowTreeHostMac(const gfx::Rect& bounds) { |
13 window_.reset( | 13 window_.reset( |
14 [[NSWindow alloc] | 14 [[NSWindow alloc] |
15 initWithContentRect:NSRectFromCGRect(bounds.ToCGRect()) | 15 initWithContentRect:NSRectFromCGRect(bounds.ToCGRect()) |
16 styleMask:NSBorderlessWindowMask | 16 styleMask:NSBorderlessWindowMask |
17 backing:NSBackingStoreBuffered | 17 backing:NSBackingStoreBuffered |
18 defer:NO]); | 18 defer:NO]); |
19 CreateCompositor(GetAcceleratedWidget()); | 19 CreateCompositor(GetAcceleratedWidget()); |
20 } | 20 } |
21 | 21 |
22 WindowTreeHostMac::~WindowTreeHostMac() { | 22 WindowTreeHostMac::~WindowTreeHostMac() { |
23 DestroyDispatcher(); | 23 DestroyDispatcher(); |
24 } | 24 } |
25 | 25 |
| 26 EventSource* WindowTreeHostMac::GetEventSource() { |
| 27 NOTIMPLEMENTED(); |
| 28 return nil; |
| 29 } |
| 30 |
26 gfx::AcceleratedWidget WindowTreeHostMac::GetAcceleratedWidget() { | 31 gfx::AcceleratedWidget WindowTreeHostMac::GetAcceleratedWidget() { |
27 return [window_ contentView]; | 32 return [window_ contentView]; |
28 } | 33 } |
29 void WindowTreeHostMac::Show() { | 34 void WindowTreeHostMac::Show() { |
30 [window_ makeKeyAndOrderFront:nil]; | 35 [window_ makeKeyAndOrderFront:nil]; |
31 } | 36 } |
32 | 37 |
33 void WindowTreeHostMac::Hide() { | 38 void WindowTreeHostMac::Hide() { |
34 [window_ orderOut:nil]; | 39 [window_ orderOut:nil]; |
35 } | 40 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return new WindowTreeHostMac(bounds); | 110 return new WindowTreeHostMac(bounds); |
106 } | 111 } |
107 | 112 |
108 // static | 113 // static |
109 gfx::Size WindowTreeHost::GetNativeScreenSize() { | 114 gfx::Size WindowTreeHost::GetNativeScreenSize() { |
110 NOTIMPLEMENTED(); | 115 NOTIMPLEMENTED(); |
111 return gfx::Size(1024, 768); | 116 return gfx::Size(1024, 768); |
112 } | 117 } |
113 | 118 |
114 } // namespace aura | 119 } // namespace aura |
OLD | NEW |