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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_root_window_host_win.cc
===================================================================
--- ui/views/widget/desktop_root_window_host_win.cc (revision 157082)
+++ ui/views/widget/desktop_root_window_host_win.cc (working copy)
@@ -5,13 +5,16 @@
#include "ui/views/widget/desktop_root_window_host_win.h"
#include "ui/aura/desktop/desktop_activation_client.h"
+#include "ui/aura/desktop/desktop_cursor_client.h"
#include "ui/aura/desktop/desktop_dispatcher_client.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/shared/compound_event_filter.h"
+#include "ui/base/cursor/cursor_loader_win.h"
#include "ui/base/win/shell.h"
#include "ui/views/ime/input_method_win.h"
#include "ui/views/widget/desktop_capture_client.h"
+#include "ui/views/widget/desktop_screen_position_client_aura.h"
#include "ui/views/win/hwnd_message_handler.h"
namespace views {
@@ -67,6 +70,14 @@
aura::client::SetDispatcherClient(root_window_.get(),
dispatcher_client_.get());
+ cursor_client_.reset(new aura::DesktopCursorClient(root_window_.get()));
+ aura::client::SetCursorClient(root_window_.get(), cursor_client_.get());
+
+
+ position_client_.reset(new DesktopScreenPositionClient());
+ aura::client::SetScreenPositionClient(root_window_.get(),
+ position_client_.get());
+
// CEF sets focus to the window the user clicks down on.
// TODO(beng): see if we can't do this some other way. CEF seems a heavy-
// handed way of accomplishing focus.
@@ -222,6 +233,13 @@
}
void DesktopRootWindowHostWin::SetCursor(gfx::NativeCursor cursor) {
+ // Custom web cursors are handled directly.
+ if (cursor == ui::kCursorCustom)
+ return;
+ ui::CursorLoaderWin cursor_loader;
+ cursor_loader.SetPlatformCursor(&cursor);
+
+ message_handler_->SetCursor(cursor.platform());
}
void DesktopRootWindowHostWin::ShowCursor(bool show) {

Powered by Google App Engine
This is Rietveld 408576698