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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 100173003: Cursor state should be global among all root windows for desktop Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make DesktopNativeCursorManager a WindowObserver Created 7 years 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_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 3a411290af7b0119c155226cd99f70b5fd21e376..6143e1aaf03072d03d208b50f28698768c3ca8ea 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -376,11 +376,23 @@ void DesktopNativeWidgetAura::InitNativeWidget(
// 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.
- // No event filter for aura::Env. Create CompoundEvnetFilter per RootWindow.
+ // No event filter for aura::Env. Create CompoundEventFilter per RootWindow.
root_window_event_filter_ = new corewm::CompoundEventFilter;
// Pass ownership of the filter to the root_window.
root_window_->window()->SetEventFilter(root_window_event_filter_);
+ // SetCursorClient() must be called before OnRootWindowCreated().
+ // TODO(tdanderson): DesktopNativeCursorManager should be a singleton.
+ DesktopNativeCursorManager* desktop_native_cursor_manager =
+ new views::DesktopNativeCursorManager(
+ root_window_.get(),
+ DesktopCursorLoaderUpdater::Create());
+ cursor_client_.reset(
+ new views::corewm::CursorManager(
+ scoped_ptr<corewm::NativeCursorManager>(
+ desktop_native_cursor_manager)));
+ aura::client::SetCursorClient(root_window_->window(), cursor_client_.get());
+
desktop_root_window_host_->OnRootWindowCreated(root_window_.get(), params);
UpdateWindowTransparency();
@@ -398,16 +410,6 @@ void DesktopNativeWidgetAura::InitNativeWidget(
aura::client::SetDispatcherClient(root_window_->window(),
dispatcher_client_.get());
- DesktopNativeCursorManager* desktop_native_cursor_manager =
- new views::DesktopNativeCursorManager(
- root_window_.get(),
- DesktopCursorLoaderUpdater::Create());
- cursor_client_.reset(
- new views::corewm::CursorManager(
- scoped_ptr<corewm::NativeCursorManager>(
- desktop_native_cursor_manager)));
- aura::client::SetCursorClient(root_window_->window(), cursor_client_.get());
-
position_client_.reset(new DesktopScreenPositionClient());
aura::client::SetScreenPositionClient(root_window_->window(),
position_client_.get());

Powered by Google App Engine
This is Rietveld 408576698