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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/widget/desktop_aura/desktop_window_tree_host_win.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
6 6
7 #include "base/win/metro.h" 7 #include "base/win/metro.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 if (!GetWidget()->GetNativeView()) 833 if (!GetWidget()->GetNativeView())
834 return; 834 return;
835 835
836 // Currently we assume the window that has capture gets touch events too. 836 // Currently we assume the window that has capture gets touch events too.
837 aura::WindowTreeHost* host = 837 aura::WindowTreeHost* host =
838 aura::WindowTreeHost::GetForAcceleratedWidget(GetCapture()); 838 aura::WindowTreeHost::GetForAcceleratedWidget(GetCapture());
839 if (host) { 839 if (host) {
840 DesktopWindowTreeHostWin* target = 840 DesktopWindowTreeHostWin* target =
841 host->window()->GetProperty(kDesktopWindowTreeHostKey); 841 host->window()->GetProperty(kDesktopWindowTreeHostKey);
842 if (target && target->HasCapture() && target != this) { 842 if (target && target->HasCapture() && target != this) {
843 POINT target_location(event.location().ToPOINT()); 843 POINT target_location(gfx::ToFlooredPoint(event.location()).ToPOINT());
844 ClientToScreen(GetHWND(), &target_location); 844 ClientToScreen(GetHWND(), &target_location);
845 ScreenToClient(target->GetHWND(), &target_location); 845 ScreenToClient(target->GetHWND(), &target_location);
846 ui::TouchEvent target_event(event, static_cast<View*>(NULL), 846 ui::TouchEvent target_event(event, static_cast<View*>(NULL),
847 static_cast<View*>(NULL)); 847 static_cast<View*>(NULL));
848 target_event.set_location(gfx::Point(target_location)); 848 target_event.set_location(gfx::Point(target_location));
849 target_event.set_root_location(target_event.location()); 849 target_event.set_root_location(
850 gfx::ToFlooredPoint(target_event.location()));
850 target->SendEventToProcessor(&target_event); 851 target->SendEventToProcessor(&target_event);
851 return; 852 return;
852 } 853 }
853 } 854 }
854 SendEventToProcessor(const_cast<ui::TouchEvent*>(&event)); 855 SendEventToProcessor(const_cast<ui::TouchEvent*>(&event));
855 } 856 }
856 857
857 bool DesktopWindowTreeHostWin::HandleIMEMessage(UINT message, 858 bool DesktopWindowTreeHostWin::HandleIMEMessage(UINT message,
858 WPARAM w_param, 859 WPARAM w_param,
859 LPARAM l_param, 860 LPARAM l_param,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 968
968 // static 969 // static
969 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( 970 DesktopWindowTreeHost* DesktopWindowTreeHost::Create(
970 internal::NativeWidgetDelegate* native_widget_delegate, 971 internal::NativeWidgetDelegate* native_widget_delegate,
971 DesktopNativeWidgetAura* desktop_native_widget_aura) { 972 DesktopNativeWidgetAura* desktop_native_widget_aura) {
972 return new DesktopWindowTreeHostWin(native_widget_delegate, 973 return new DesktopWindowTreeHostWin(native_widget_delegate,
973 desktop_native_widget_aura); 974 desktop_native_widget_aura);
974 } 975 }
975 976
976 } // namespace views 977 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698