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

Side by Side Diff: ui/aura/window_event_dispatcher.cc

Issue 2525113002: Rename WindowTreeHost functions to indicate pixels/dips. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/aura/window_event_dispatcher.h" 5 #include "ui/aura/window_event_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 // instead of a MOVED event, but in multi-display/multi-host scenarios, the 707 // instead of a MOVED event, but in multi-display/multi-host scenarios, the
708 // DRAGGED event can be synthesized in the incorrect host. So avoid 708 // DRAGGED event can be synthesized in the incorrect host. So avoid
709 // synthesizing any events at all. 709 // synthesizing any events at all.
710 if (Env::GetInstance()->mouse_button_flags()) 710 if (Env::GetInstance()->mouse_button_flags())
711 return details; 711 return details;
712 712
713 gfx::Point root_mouse_location = GetLastMouseLocationInRoot(); 713 gfx::Point root_mouse_location = GetLastMouseLocationInRoot();
714 if (!window()->bounds().Contains(root_mouse_location)) 714 if (!window()->bounds().Contains(root_mouse_location))
715 return details; 715 return details;
716 gfx::Point host_mouse_location = root_mouse_location; 716 gfx::Point host_mouse_location = root_mouse_location;
717 host_->ConvertPointToHost(&host_mouse_location); 717 host_->ConvertPointFromDIPToHost(&host_mouse_location);
718 ui::MouseEvent event(ui::ET_MOUSE_MOVED, host_mouse_location, 718 ui::MouseEvent event(ui::ET_MOUSE_MOVED, host_mouse_location,
719 host_mouse_location, ui::EventTimeForNow(), 719 host_mouse_location, ui::EventTimeForNow(),
720 ui::EF_IS_SYNTHESIZED, 0); 720 ui::EF_IS_SYNTHESIZED, 0);
721 return OnEventFromSource(&event); 721 return OnEventFromSource(&event);
722 } 722 }
723 723
724 DispatchDetails WindowEventDispatcher::PreDispatchLocatedEvent( 724 DispatchDetails WindowEventDispatcher::PreDispatchLocatedEvent(
725 Window* target, 725 Window* target,
726 ui::LocatedEvent* event) { 726 ui::LocatedEvent* event) {
727 int flags = event->flags(); 727 int flags = event->flags();
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 } 861 }
862 862
863 // This flag is set depending on the gestures recognized in the call above, 863 // This flag is set depending on the gestures recognized in the call above,
864 // and needs to propagate with the forwarded event. 864 // and needs to propagate with the forwarded event.
865 event->set_may_cause_scrolling(orig_event.may_cause_scrolling()); 865 event->set_may_cause_scrolling(orig_event.may_cause_scrolling());
866 866
867 return PreDispatchLocatedEvent(target, event); 867 return PreDispatchLocatedEvent(target, event);
868 } 868 }
869 869
870 } // namespace aura 870 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window.cc ('k') | ui/aura/window_tree_host.h » ('j') | ui/aura/window_tree_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698