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

Unified Diff: ui/aura/root_window.cc

Issue 13902003: Remove Event::system_location (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index e706ef0a2be1c15c16b0ff5260ff5a5442d1bc92..df9e87918dbbea1c8fc2dca3047208006e2db770 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -40,6 +40,10 @@
#include "ui/gfx/screen.h"
#include "ui/gfx/size_conversions.h"
+#if defined(OS_CHROMEOS)
+#include "ui/base/events/event_utils.h"
+#endif
+
using std::vector;
namespace aura {
@@ -694,14 +698,20 @@ void RootWindow::TransformEventForDeviceScaleFactor(bool keep_inside_root,
event->UpdateForRootTransform(GetInverseRootTransform());
#if defined(OS_CHROMEOS)
const gfx::Rect& root_bounds = bounds();
+ if (!event->native_event())
+ return;
+ const gfx::Point system_location =
+ ui::EventSystemLocationFromNative(event->native_event());
if (keep_inside_root &
- host_->GetBounds().Contains(event->system_location()) &&
+ host_->GetBounds().Contains(system_location) &&
!root_bounds.Contains(event->root_location())) {
// Make sure that the mouse location inside the host window gets
// translated inside root window.
// TODO(oshima): This is (hopefully) short term bandaid to deal
// with calculation error due to the fact that we rotate in dip
// coordinates instead of pixels. crbug.com/222483.
+ // When removing this, don't forget to remove the include of the
+ // event_util.h file.
int x = event->location().x();
int y = event->location().y();
x = std::min(std::max(x, root_bounds.x()), root_bounds.right());
@@ -1169,7 +1179,6 @@ void RootWindow::SynthesizeMouseMoveEvent() {
host_mouse_location,
ui::EF_IS_SYNTHESIZED);
ConvertPointToNativeScreen(&root_mouse_location);
sadrul 2013/04/10 00:12:41 Is this conversion necessary anymore?
oshima 2013/04/10 01:28:01 doh, you're right. removed.
- event.set_system_location(root_mouse_location);
OnHostMouseEvent(&event);
}
« no previous file with comments | « no previous file | ui/aura/test/event_generator.cc » ('j') | ui/views/widget/desktop_aura/x11_window_event_filter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698