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->location->x /= global_state()->device_pixel_ratio(); | 634 event->pointer_data->x /= global_state()->device_pixel_ratio(); |
635 event->pointer_data->location->y /= global_state()->device_pixel_ratio(); | 635 event->pointer_data->y /= global_state()->device_pixel_ratio(); |
636 event->pointer_data->location->screen_x /= | 636 event->pointer_data->screen_x /= global_state()->device_pixel_ratio(); |
637 global_state()->device_pixel_ratio(); | 637 event->pointer_data->screen_y /= global_state()->device_pixel_ratio(); |
638 event->pointer_data->location->screen_y /= | |
639 global_state()->device_pixel_ratio(); | |
640 } | 638 } |
641 | 639 |
642 blink::WebWidget* web_widget = GetWebWidget(); | 640 blink::WebWidget* web_widget = GetWebWidget(); |
643 | 641 |
644 if (!touch_handler_ && web_widget) | 642 if (!touch_handler_ && web_widget) |
645 touch_handler_.reset(new TouchHandler(web_widget)); | 643 touch_handler_.reset(new TouchHandler(web_widget)); |
646 | 644 |
647 if (touch_handler_ && (event->action == mojo::EVENT_TYPE_POINTER_DOWN || | 645 if (touch_handler_ && (event->action == mojo::EVENT_TYPE_POINTER_DOWN || |
648 event->action == mojo::EVENT_TYPE_POINTER_UP || | 646 event->action == mojo::EVENT_TYPE_POINTER_UP || |
649 event->action == mojo::EVENT_TYPE_POINTER_CANCEL || | 647 event->action == mojo::EVENT_TYPE_POINTER_CANCEL || |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 804 |
807 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) { | 805 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) { |
808 NOTIMPLEMENTED(); | 806 NOTIMPLEMENTED(); |
809 } | 807 } |
810 | 808 |
811 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) { | 809 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) { |
812 NOTIMPLEMENTED(); | 810 NOTIMPLEMENTED(); |
813 } | 811 } |
814 | 812 |
815 } // namespace mojo | 813 } // namespace mojo |
OLD | NEW |