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

Side by Side Diff: chrome/browser/android/vr_shell/vr_input_manager.cc

Issue 2464373005: Fix VR Shell crashing when renderer crashes or native page is shown. (Closed)
Patch Set: Rebase + address comment Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/android/vr_shell/vr_input_manager.h" 5 #include "chrome/browser/android/vr_shell/vr_input_manager.h"
6 6
7 #include "base/task_runner_util.h" 7 #include "base/task_runner_util.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/render_widget_host.h" 9 #include "content/public/browser/render_widget_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 result.x = x / dpi_scale_; 73 result.x = x / dpi_scale_;
74 result.y = y / dpi_scale_; 74 result.y = y / dpi_scale_;
75 result.timeStampSeconds = time_ms / 1000.0; 75 result.timeStampSeconds = time_ms / 1000.0;
76 result.sourceDevice = blink::WebGestureDeviceTouchpad; 76 result.sourceDevice = blink::WebGestureDeviceTouchpad;
77 77
78 return result; 78 return result;
79 } 79 }
80 80
81 void VrInputManager::ForwardGestureEvent( 81 void VrInputManager::ForwardGestureEvent(
82 const blink::WebGestureEvent& gesture) { 82 const blink::WebGestureEvent& gesture) {
83 if (!web_contents_->GetRenderWidgetHostView())
84 return;
83 content::RenderWidgetHost* rwh = 85 content::RenderWidgetHost* rwh =
84 web_contents_->GetRenderWidgetHostView()->GetRenderWidgetHost(); 86 web_contents_->GetRenderWidgetHostView()->GetRenderWidgetHost();
85 if (rwh) 87 if (rwh)
86 rwh->ForwardGestureEvent(gesture); 88 rwh->ForwardGestureEvent(gesture);
87 } 89 }
88 90
89 void VrInputManager::ForwardMouseEvent( 91 void VrInputManager::ForwardMouseEvent(
90 const blink::WebMouseEvent& mouse_event) { 92 const blink::WebMouseEvent& mouse_event) {
93 if (!web_contents_->GetRenderWidgetHostView())
94 return;
91 content::RenderWidgetHost* rwh = 95 content::RenderWidgetHost* rwh =
92 web_contents_->GetRenderWidgetHostView()->GetRenderWidgetHost(); 96 web_contents_->GetRenderWidgetHostView()->GetRenderWidgetHost();
93 if (rwh) 97 if (rwh)
94 rwh->ForwardMouseEvent(mouse_event); 98 rwh->ForwardMouseEvent(mouse_event);
95 } 99 }
96 100
97 } // namespace vr_shell 101 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/BUILD.gn ('k') | chrome/browser/android/vr_shell/vr_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698