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

Side by Side Diff: components/html_viewer/html_frame.cc

Issue 1313353010: Overhaul Mandoline event transport code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments2 Created 5 years, 3 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
OLDNEW
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 void HTMLFrame::OnViewDestroyed(View* view) { 454 void HTMLFrame::OnViewDestroyed(View* view) {
455 DCHECK_EQ(view, view_); 455 DCHECK_EQ(view, view_);
456 view_->RemoveObserver(this); 456 view_->RemoveObserver(this);
457 view_ = nullptr; 457 view_ = nullptr;
458 Close(); 458 Close();
459 } 459 }
460 460
461 void HTMLFrame::OnViewInputEvent(View* view, const mojo::EventPtr& event) { 461 void HTMLFrame::OnViewInputEvent(View* view, const mojo::EventPtr& event) {
462 if (event->pointer_data) { 462 if (event->pointer_data) {
463 // Blink expects coordintes to be in DIPs. 463 // Blink expects coordintes to be in DIPs.
464 event->pointer_data->x /= global_state()->device_pixel_ratio(); 464 event->pointer_data->where->x /= global_state()->device_pixel_ratio();
465 event->pointer_data->y /= global_state()->device_pixel_ratio(); 465 event->pointer_data->where->y /= global_state()->device_pixel_ratio();
466 event->pointer_data->screen_x /= global_state()->device_pixel_ratio(); 466 event->pointer_data->where->screen_x /=
467 event->pointer_data->screen_y /= global_state()->device_pixel_ratio(); 467 global_state()->device_pixel_ratio();
468 event->pointer_data->where->screen_y /=
469 global_state()->device_pixel_ratio();
468 } 470 }
469 471
470 blink::WebWidget* web_widget = GetWebWidget(); 472 blink::WebWidget* web_widget = GetWebWidget();
471 473
472 if (!touch_handler_ && web_widget) 474 if (!touch_handler_ && web_widget)
473 touch_handler_.reset(new TouchHandler(web_widget)); 475 touch_handler_.reset(new TouchHandler(web_widget));
474 476
475 if (touch_handler_ && (event->action == mojo::EVENT_TYPE_POINTER_DOWN || 477 if (touch_handler_ && (event->action == mojo::EVENT_TYPE_POINTER_DOWN ||
476 event->action == mojo::EVENT_TYPE_POINTER_UP || 478 event->action == mojo::EVENT_TYPE_POINTER_UP ||
477 event->action == mojo::EVENT_TYPE_POINTER_CANCEL || 479 event->action == mojo::EVENT_TYPE_POINTER_CANCEL ||
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 805
804 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) { 806 void HTMLFrame::reload(bool ignore_cache, bool is_client_redirect) {
805 NOTIMPLEMENTED(); 807 NOTIMPLEMENTED();
806 } 808 }
807 809
808 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) { 810 void HTMLFrame::forwardInputEvent(const blink::WebInputEvent* event) {
809 NOTIMPLEMENTED(); 811 NOTIMPLEMENTED();
810 } 812 }
811 813
812 } // namespace mojo 814 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698