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

Side by Side Diff: Source/web/WebInputEventConversion.cpp

Issue 23187005: [DevTools] Use device metrics emulation implemented in content. (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Reupload Created 7 years, 2 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 static float widgetScaleFactor(const Widget* widget) 57 static float widgetScaleFactor(const Widget* widget)
58 { 58 {
59 if (!widget) 59 if (!widget)
60 return 1; 60 return 1;
61 61
62 ScrollView* rootView = widget->root(); 62 ScrollView* rootView = widget->root();
63 if (!rootView) 63 if (!rootView)
64 return 1; 64 return 1;
65 65
66 return rootView->visibleContentScaleFactor(); 66 return rootView->inputEventsScaleFactor();
67 } 67 }
68 68
69 // MakePlatformMouseEvent ----------------------------------------------------- 69 // MakePlatformMouseEvent -----------------------------------------------------
70 70
71 PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMo useEvent& e) 71 PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMo useEvent& e)
72 { 72 {
73 float scale = widgetScaleFactor(widget); 73 float scale = widgetScaleFactor(widget);
74 // FIXME: Widget is always toplevel, unless it's a popup. We may be able 74 // FIXME: Widget is always toplevel, unless it's a popup. We may be able
75 // to get rid of this once we abstract popups into a WebKit API. 75 // to get rid of this once we abstract popups into a WebKit API.
76 m_position = widget->convertFromContainingWindow(IntPoint(e.x / scale, e.y / scale)); 76 m_position = widget->convertFromContainingWindow(IntPoint(e.x / scale, e.y / scale));
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 modifiers = getWebInputModifiers(event); 738 modifiers = getWebInputModifiers(event);
739 739
740 globalX = event.screenX(); 740 globalX = event.screenX();
741 globalY = event.screenY(); 741 globalY = event.screenY();
742 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject); 742 IntPoint localPoint = convertAbsoluteLocationForRenderObject(event.absoluteL ocation(), *renderObject);
743 x = localPoint.x(); 743 x = localPoint.x();
744 y = localPoint.y(); 744 y = localPoint.y();
745 } 745 }
746 746
747 } // namespace WebKit 747 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698