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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1505723005: Null-check GetView before using it in GetFocusedRenderWidgetHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop the event instead of giving to main frame. Created 5 years 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 | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 const NativeWebKeyboardEvent& event) { 1688 const NativeWebKeyboardEvent& event) {
1689 if (!host_) 1689 if (!host_)
1690 return; 1690 return;
1691 1691
1692 RenderWidgetHostImpl* target_host = host_; 1692 RenderWidgetHostImpl* target_host = host_;
1693 1693
1694 // If there are multiple widgets on the page (such as when there are 1694 // If there are multiple widgets on the page (such as when there are
1695 // out-of-process iframes), pick the one that should process this event. 1695 // out-of-process iframes), pick the one that should process this event.
1696 if (host_->delegate()) 1696 if (host_->delegate())
1697 target_host = host_->delegate()->GetFocusedRenderWidgetHost(host_); 1697 target_host = host_->delegate()->GetFocusedRenderWidgetHost(host_);
1698 if (!target_host)
1699 return;
1698 1700
1699 target_host->ForwardKeyboardEvent(event); 1701 target_host->ForwardKeyboardEvent(event);
1700 } 1702 }
1701 1703
1702 void RenderWidgetHostViewAndroid::SendMouseEvent( 1704 void RenderWidgetHostViewAndroid::SendMouseEvent(
1703 const blink::WebMouseEvent& event) { 1705 const blink::WebMouseEvent& event) {
1704 if (host_) 1706 if (host_)
1705 host_->ForwardMouseEvent(event); 1707 host_->ForwardMouseEvent(event);
1706 } 1708 }
1707 1709
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 results->orientationAngle = display.RotationAsDegree(); 2057 results->orientationAngle = display.RotationAsDegree();
2056 results->orientationType = 2058 results->orientationType =
2057 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2059 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2058 gfx::DeviceDisplayInfo info; 2060 gfx::DeviceDisplayInfo info;
2059 results->depth = info.GetBitsPerPixel(); 2061 results->depth = info.GetBitsPerPixel();
2060 results->depthPerComponent = info.GetBitsPerComponent(); 2062 results->depthPerComponent = info.GetBitsPerComponent();
2061 results->isMonochrome = (results->depthPerComponent == 0); 2063 results->isMonochrome = (results->depthPerComponent == 0);
2062 } 2064 }
2063 2065
2064 } // namespace content 2066 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698