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

Unified Diff: components/html_viewer/html_frame.cc

Issue 1362793002: Construct and check for mojo::Event's LocationData as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also audit wheel_data and brush_data. 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 side-by-side diff with in-line comments
Download patch
Index: components/html_viewer/html_frame.cc
diff --git a/components/html_viewer/html_frame.cc b/components/html_viewer/html_frame.cc
index 2a307bc718923c32181cd23ceae28352a1dabf6d..9dacd421bf1c58b2e10189a1c3b6aa9d53e659b2 100644
--- a/components/html_viewer/html_frame.cc
+++ b/components/html_viewer/html_frame.cc
@@ -350,8 +350,7 @@ blink::WebNavigationPolicy HTMLFrame::decidePolicyForNavigation(
return blink::WebNavigationPolicyCurrentTab;
}
- // about:blank is treated as the same origin and is always allowed for
- // frames.
+ // about:blank is treated as the same origin and is always allowed for frames.
if (parent_ && info.urlRequest.url() == GURL(url::kAboutBlankURL) &&
info.defaultPolicy == blink::WebNavigationPolicyCurrentTab) {
return blink::WebNavigationPolicyCurrentTab;
@@ -650,7 +649,7 @@ void HTMLFrame::OnViewDestroyed(View* view) {
}
void HTMLFrame::OnViewInputEvent(View* view, const mojo::EventPtr& event) {
- if (event->pointer_data) {
+ if (event->pointer_data && event->pointer_data->location) {
// Blink expects coordintes to be in DIPs.
event->pointer_data->location->x /= global_state()->device_pixel_ratio();
event->pointer_data->location->y /= global_state()->device_pixel_ratio();
@@ -669,6 +668,7 @@ void HTMLFrame::OnViewInputEvent(View* view, const mojo::EventPtr& event) {
event->action == mojo::EVENT_TYPE_POINTER_UP ||
event->action == mojo::EVENT_TYPE_POINTER_CANCEL ||
event->action == mojo::EVENT_TYPE_POINTER_MOVE) &&
+ event->pointer_data &&
event->pointer_data->kind == mojo::POINTER_KIND_TOUCH) {
touch_handler_->OnTouchEvent(*event);
return;

Powered by Google App Engine
This is Rietveld 408576698