OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/html_viewer/html_frame.h" | 5 #include "components/html_viewer/html_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 void HTMLFrame::OnViewDestroyed(View* view) { | 624 void HTMLFrame::OnViewDestroyed(View* view) { |
625 DCHECK_EQ(view, view_); | 625 DCHECK_EQ(view, view_); |
626 view_->RemoveObserver(this); | 626 view_->RemoveObserver(this); |
627 view_ = nullptr; | 627 view_ = nullptr; |
628 Close(); | 628 Close(); |
629 } | 629 } |
630 | 630 |
631 void HTMLFrame::OnViewInputEvent(View* view, const mojo::EventPtr& event) { | 631 void HTMLFrame::OnViewInputEvent(View* view, const mojo::EventPtr& event) { |
632 if (event->pointer_data) { | 632 if (event->pointer_data) { |
633 // Blink expects coordintes to be in DIPs. | 633 // Blink expects coordintes to be in DIPs. |
634 event->pointer_data->x /= global_state()->device_pixel_ratio(); | 634 event->pointer_data->location->x /= global_state()->device_pixel_ratio(); |
635 event->pointer_data->y /= global_state()->device_pixel_ratio(); | 635 event->pointer_data->location->y /= global_state()->device_pixel_ratio(); |
636 event->pointer_data->screen_x /= global_state()->device_pixel_ratio(); | 636 event->pointer_data->location->screen_x /= |
637 event->pointer_data->screen_y /= global_state()->device_pixel_ratio(); | 637 global_state()->device_pixel_ratio(); |
| 638 event->pointer_data->location->screen_y /= |
| 639 global_state()->device_pixel_ratio(); |
638 } | 640 } |
639 | 641 |
640 blink::WebWidget* web_widget = GetWebWidget(); | 642 blink::WebWidget* web_widget = GetWebWidget(); |
641 | 643 |
642 if (!touch_handler_ && web_widget) | 644 if (!touch_handler_ && web_widget) |
643 touch_handler_.reset(new TouchHandler(web_widget)); | 645 touch_handler_.reset(new TouchHandler(web_widget)); |
644 | 646 |
645 if (touch_handler_ && (event->action == mojo::EVENT_TYPE_POINTER_DOWN || | 647 if (touch_handler_ && (event->action == mojo::EVENT_TYPE_POINTER_DOWN || |
646 event->action == mojo::EVENT_TYPE_POINTER_UP || | 648 event->action == mojo::EVENT_TYPE_POINTER_UP || |
647 event->action == mojo::EVENT_TYPE_POINTER_CANCEL || | 649 event->action == mojo::EVENT_TYPE_POINTER_CANCEL || |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 806 |
805 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) { | 807 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) { |
806 NOTIMPLEMENTED(); | 808 NOTIMPLEMENTED(); |
807 } | 809 } |
808 | 810 |
809 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) { | 811 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) { |
810 NOTIMPLEMENTED(); | 812 NOTIMPLEMENTED(); |
811 } | 813 } |
812 | 814 |
813 } // namespace mojo | 815 } // namespace mojo |
OLD | NEW |