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

Side by Side Diff: ui/views/widget/desktop_root_window_host_win.cc

Issue 10939006: Make cursors work on win aura. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 3 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/widget/desktop_root_window_host_win.h" 5 #include "ui/views/widget/desktop_root_window_host_win.h"
6 6
7 #include "third_party/skia/include/core/SkPath.h" 7 #include "third_party/skia/include/core/SkPath.h"
8 #include "third_party/skia/include/core/SkRegion.h" 8 #include "third_party/skia/include/core/SkRegion.h"
9 #include "ui/aura/desktop/desktop_activation_client.h" 9 #include "ui/aura/desktop/desktop_activation_client.h"
10 #include "ui/aura/desktop/desktop_cursor_client.h"
10 #include "ui/aura/desktop/desktop_dispatcher_client.h" 11 #include "ui/aura/desktop/desktop_dispatcher_client.h"
11 #include "ui/aura/focus_manager.h" 12 #include "ui/aura/focus_manager.h"
12 #include "ui/aura/root_window.h" 13 #include "ui/aura/root_window.h"
13 #include "ui/aura/shared/compound_event_filter.h" 14 #include "ui/aura/shared/compound_event_filter.h"
15 #include "ui/base/cursor/cursor_loader_win.h"
14 #include "ui/base/win/shell.h" 16 #include "ui/base/win/shell.h"
15 #include "ui/gfx/native_widget_types.h" 17 #include "ui/gfx/native_widget_types.h"
16 #include "ui/gfx/path_win.h" 18 #include "ui/gfx/path_win.h"
17 #include "ui/views/ime/input_method_win.h" 19 #include "ui/views/ime/input_method_win.h"
18 #include "ui/views/widget/desktop_capture_client.h" 20 #include "ui/views/widget/desktop_capture_client.h"
21 #include "ui/views/widget/desktop_screen_position_client.h"
19 #include "ui/views/widget/widget_delegate.h" 22 #include "ui/views/widget/widget_delegate.h"
20 #include "ui/views/win/hwnd_message_handler.h" 23 #include "ui/views/win/hwnd_message_handler.h"
21 24
22 namespace views { 25 namespace views {
23 26
24 //////////////////////////////////////////////////////////////////////////////// 27 ////////////////////////////////////////////////////////////////////////////////
25 // DesktopRootWindowHostWin, public: 28 // DesktopRootWindowHostWin, public:
26 29
27 DesktopRootWindowHostWin::DesktopRootWindowHostWin( 30 DesktopRootWindowHostWin::DesktopRootWindowHostWin(
28 internal::NativeWidgetDelegate* native_widget_delegate, 31 internal::NativeWidgetDelegate* native_widget_delegate,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 68
66 activation_client_.reset( 69 activation_client_.reset(
67 new aura::DesktopActivationClient(root_window_->GetFocusManager())); 70 new aura::DesktopActivationClient(root_window_->GetFocusManager()));
68 aura::client::SetActivationClient(root_window_.get(), 71 aura::client::SetActivationClient(root_window_.get(),
69 activation_client_.get()); 72 activation_client_.get());
70 73
71 dispatcher_client_.reset(new aura::DesktopDispatcherClient); 74 dispatcher_client_.reset(new aura::DesktopDispatcherClient);
72 aura::client::SetDispatcherClient(root_window_.get(), 75 aura::client::SetDispatcherClient(root_window_.get(),
73 dispatcher_client_.get()); 76 dispatcher_client_.get());
74 77
78 cursor_client_.reset(new aura::DesktopCursorClient(root_window_.get()));
79 aura::client::SetCursorClient(root_window_.get(), cursor_client_.get());
80
81
82 position_client_.reset(new DesktopScreenPositionClient());
83 aura::client::SetScreenPositionClient(root_window_.get(),
84 position_client_.get());
85
75 // CEF sets focus to the window the user clicks down on. 86 // CEF sets focus to the window the user clicks down on.
76 // TODO(beng): see if we can't do this some other way. CEF seems a heavy- 87 // TODO(beng): see if we can't do this some other way. CEF seems a heavy-
77 // handed way of accomplishing focus. 88 // handed way of accomplishing focus.
78 root_window_->SetEventFilter(new aura::shared::CompoundEventFilter); 89 root_window_->SetEventFilter(new aura::shared::CompoundEventFilter);
79 } 90 }
80 91
81 void DesktopRootWindowHostWin::Close() { 92 void DesktopRootWindowHostWin::Close() {
82 message_handler_->Close(); 93 message_handler_->Close();
83 } 94 }
84 95
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 243
233 void DesktopRootWindowHostWin::SetCapture() { 244 void DesktopRootWindowHostWin::SetCapture() {
234 message_handler_->SetCapture(); 245 message_handler_->SetCapture();
235 } 246 }
236 247
237 void DesktopRootWindowHostWin::ReleaseCapture() { 248 void DesktopRootWindowHostWin::ReleaseCapture() {
238 message_handler_->ReleaseCapture(); 249 message_handler_->ReleaseCapture();
239 } 250 }
240 251
241 void DesktopRootWindowHostWin::SetCursor(gfx::NativeCursor cursor) { 252 void DesktopRootWindowHostWin::SetCursor(gfx::NativeCursor cursor) {
253 // Custom web cursors are handled directly.
254 if (cursor == ui::kCursorCustom)
255 return;
256 ui::CursorLoaderWin cursor_loader;
257 cursor_loader.SetPlatformCursor(&cursor);
258
259 message_handler_->SetCursor(cursor.platform());
242 } 260 }
243 261
244 void DesktopRootWindowHostWin::ShowCursor(bool show) { 262 void DesktopRootWindowHostWin::ShowCursor(bool show) {
245 } 263 }
246 264
247 bool DesktopRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) { 265 bool DesktopRootWindowHostWin::QueryMouseLocation(gfx::Point* location_return) {
248 return false; 266 return false;
249 } 267 }
250 268
251 bool DesktopRootWindowHostWin::ConfineCursorToRootWindow() { 269 bool DesktopRootWindowHostWin::ConfineCursorToRootWindow() {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 // DesktopRootWindowHost, public: 603 // DesktopRootWindowHost, public:
586 604
587 // static 605 // static
588 DesktopRootWindowHost* DesktopRootWindowHost::Create( 606 DesktopRootWindowHost* DesktopRootWindowHost::Create(
589 internal::NativeWidgetDelegate* native_widget_delegate, 607 internal::NativeWidgetDelegate* native_widget_delegate,
590 const gfx::Rect& initial_bounds) { 608 const gfx::Rect& initial_bounds) {
591 return new DesktopRootWindowHostWin(native_widget_delegate, initial_bounds); 609 return new DesktopRootWindowHostWin(native_widget_delegate, initial_bounds);
592 } 610 }
593 611
594 } // namespace views 612 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_root_window_host_win.h ('k') | ui/views/widget/desktop_screen_position_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698