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

Unified Diff: ui/aura/shared/compound_event_filter.cc

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment 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/aura/shared/compound_event_filter.cc
diff --git a/ui/aura/shared/compound_event_filter.cc b/ui/aura/shared/compound_event_filter.cc
index b9f0716174218c55da9135bc75d63499fc4bc23a..6af53b0d51087aef4de3e49c876d2095aa3470a4 100644
--- a/ui/aura/shared/compound_event_filter.cc
+++ b/ui/aura/shared/compound_event_filter.cc
@@ -6,6 +6,7 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/cursor_client.h"
+#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/env.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
@@ -86,9 +87,17 @@ size_t CompoundEventFilter::GetFilterCount() const {
// CompoundEventFilter, private:
void CompoundEventFilter::UpdateCursor(Window* target, ui::MouseEvent* event) {
- client::CursorClient* client =
- client::GetCursorClient(target->GetRootWindow());
- if (client) {
+ // If drag and drap is in progress, let the drag drop client set the cursor
+ // and does not set cursor here.
Daniel Erat 2012/09/07 04:55:39 s/and does not set/instead of setting the/
mazda 2012/09/07 19:42:24 Done.
+ aura::RootWindow* root_window = target->GetRootWindow();
+ client::DragDropClient* drag_drop_client =
+ client::GetDragDropClient(root_window);
+ if (drag_drop_client && drag_drop_client->IsDragDropInProgress())
oshima 2012/09/07 19:52:01 just curious. Does drag and drop work on displays
mazda 2012/09/07 22:38:14 1x -> 2x works well, but it doesn't seems 2x -> 1x
+ return;
+
+ client::CursorClient* cursor_client =
+ client::GetCursorClient(root_window);
+ if (cursor_client) {
gfx::NativeCursor cursor = target->GetCursor(event->location());
if (event->flags() & ui::EF_IS_NON_CLIENT) {
int window_component =
@@ -96,7 +105,9 @@ void CompoundEventFilter::UpdateCursor(Window* target, ui::MouseEvent* event) {
cursor = CursorForWindowComponent(window_component);
}
- client->SetCursor(cursor);
+ cursor_client->SetCursor(cursor);
+ cursor_client->SetDeviceScaleFactor(
+ root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
}
}

Powered by Google App Engine
This is Rietveld 408576698