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/views/controls/native/native_view_host_aura.h" | 5 #include "ui/views/controls/native/native_view_host_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/aura/client/focus_client.h" | 8 #include "ui/aura/client/focus_client.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/base/cursor/cursor.h" | 10 #include "ui/base/cursor/cursor.h" |
11 #include "ui/views/controls/native/native_view_host.h" | 11 #include "ui/views/controls/native/native_view_host.h" |
12 #include "ui/views/view_constants_aura.h" | 12 #include "ui/views/view_constants_aura.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 #include "ui/wm/public/cursor_delegate.h" | |
15 | 14 |
16 namespace views { | 15 namespace views { |
17 | 16 |
18 NativeViewHostAura::NativeViewHostAura(NativeViewHost* host) | 17 NativeViewHostAura::NativeViewHostAura(NativeViewHost* host) |
19 : host_(host), | 18 : host_(host), |
20 installed_clip_(false) { | 19 installed_clip_(false) { |
21 } | 20 } |
22 | 21 |
23 NativeViewHostAura::~NativeViewHostAura() { | 22 NativeViewHostAura::~NativeViewHostAura() { |
24 if (host_->native_view()) { | 23 if (host_->native_view()) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 aura::client::FocusClient* client = aura::client::GetFocusClient(window); | 95 aura::client::FocusClient* client = aura::client::GetFocusClient(window); |
97 if (client) | 96 if (client) |
98 client->FocusWindow(window); | 97 client->FocusWindow(window); |
99 } | 98 } |
100 | 99 |
101 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() { | 100 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() { |
102 return NULL; | 101 return NULL; |
103 } | 102 } |
104 | 103 |
105 gfx::NativeCursor NativeViewHostAura::GetCursor(int x, int y) { | 104 gfx::NativeCursor NativeViewHostAura::GetCursor(int x, int y) { |
106 if (host_->native_view()) { | 105 if (host_->native_view()) |
107 wm::CursorDelegate* delegate = wm::GetCursorDelegate(host_->native_view()); | 106 return host_->native_view()->GetCursor(gfx::Point(x, y)); |
108 if (delegate) | |
109 return delegate->GetCursorForPoint(gfx::Point(x, y)); | |
110 } | |
111 return gfx::kNullCursor; | 107 return gfx::kNullCursor; |
112 } | 108 } |
113 | 109 |
114 void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) { | 110 void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) { |
115 DCHECK(window == host_->native_view()); | 111 DCHECK(window == host_->native_view()); |
116 host_->NativeViewDestroyed(); | 112 host_->NativeViewDestroyed(); |
117 } | 113 } |
118 | 114 |
119 // static | 115 // static |
120 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 116 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( |
121 NativeViewHost* host) { | 117 NativeViewHost* host) { |
122 return new NativeViewHostAura(host); | 118 return new NativeViewHostAura(host); |
123 } | 119 } |
124 | 120 |
125 } // namespace views | 121 } // namespace views |
OLD | NEW |