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

Side by Side Diff: ui/views/controls/native/native_view_host_aura.cc

Issue 211733003: Move GetCursor() method from WindowDelegate to its own delegate interface CursorDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 | Annotate | Revision Log
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/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"
14 15
15 namespace views { 16 namespace views {
16 17
17 NativeViewHostAura::NativeViewHostAura(NativeViewHost* host) 18 NativeViewHostAura::NativeViewHostAura(NativeViewHost* host)
18 : host_(host), 19 : host_(host),
19 installed_clip_(false) { 20 installed_clip_(false) {
20 } 21 }
21 22
22 NativeViewHostAura::~NativeViewHostAura() { 23 NativeViewHostAura::~NativeViewHostAura() {
23 if (host_->native_view()) { 24 if (host_->native_view()) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 aura::client::FocusClient* client = aura::client::GetFocusClient(window); 96 aura::client::FocusClient* client = aura::client::GetFocusClient(window);
96 if (client) 97 if (client)
97 client->FocusWindow(window); 98 client->FocusWindow(window);
98 } 99 }
99 100
100 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() { 101 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() {
101 return NULL; 102 return NULL;
102 } 103 }
103 104
104 gfx::NativeCursor NativeViewHostAura::GetCursor(int x, int y) { 105 gfx::NativeCursor NativeViewHostAura::GetCursor(int x, int y) {
105 if (host_->native_view()) 106 if (host_->native_view()) {
106 return host_->native_view()->GetCursor(gfx::Point(x, y)); 107 wm::CursorDelegate* delegate = wm::GetCursorDelegate(host_->native_view());
108 if (delegate)
109 return delegate->GetCursorForPoint(gfx::Point(x, y));
110 }
107 return gfx::kNullCursor; 111 return gfx::kNullCursor;
108 } 112 }
109 113
110 void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) { 114 void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) {
111 DCHECK(window == host_->native_view()); 115 DCHECK(window == host_->native_view());
112 host_->NativeViewDestroyed(); 116 host_->NativeViewDestroyed();
113 } 117 }
114 118
115 // static 119 // static
116 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( 120 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper(
117 NativeViewHost* host) { 121 NativeViewHost* host) {
118 return new NativeViewHostAura(host); 122 return new NativeViewHostAura(host);
119 } 123 }
120 124
121 } // namespace views 125 } // namespace views
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_controller.cc ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698