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

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

Issue 1405293002: OOPIF: Route keyboard events to focused frame in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-page
Patch Set: Cleanup Created 5 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
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 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 } 1670 }
1671 1671
1672 void RenderWidgetHostViewAndroid::UnlockMouse() { 1672 void RenderWidgetHostViewAndroid::UnlockMouse() {
1673 NOTIMPLEMENTED(); 1673 NOTIMPLEMENTED();
1674 } 1674 }
1675 1675
1676 // Methods called from the host to the render 1676 // Methods called from the host to the render
1677 1677
1678 void RenderWidgetHostViewAndroid::SendKeyEvent( 1678 void RenderWidgetHostViewAndroid::SendKeyEvent(
1679 const NativeWebKeyboardEvent& event) { 1679 const NativeWebKeyboardEvent& event) {
1680 if (host_) 1680 if (host_) {
kenrb 2015/10/28 21:07:05 It's cleaner to invert this into an early return i
alexmos 2015/10/29 05:26:29 Done.
1681 host_->ForwardKeyboardEvent(event); 1681 RenderWidgetHostImpl* target_host = host_;
1682
1683 // If there are multiple widgets on the page (such as when there are
1684 // out-of-process iframes), pick the one that should process this event.
1685 if (host_->delegate()) {
1686 RenderWidgetHostImpl* focused_host =
1687 host_->delegate()->GetFocusedRenderWidgetHost();
1688 if (focused_host)
1689 target_host = focused_host;
1690 }
1691
1692 target_host->ForwardKeyboardEvent(event);
1693 }
1682 } 1694 }
1683 1695
1684 void RenderWidgetHostViewAndroid::SendMouseEvent( 1696 void RenderWidgetHostViewAndroid::SendMouseEvent(
1685 const blink::WebMouseEvent& event) { 1697 const blink::WebMouseEvent& event) {
1686 if (host_) 1698 if (host_)
1687 host_->ForwardMouseEvent(event); 1699 host_->ForwardMouseEvent(event);
1688 } 1700 }
1689 1701
1690 void RenderWidgetHostViewAndroid::SendMouseWheelEvent( 1702 void RenderWidgetHostViewAndroid::SendMouseWheelEvent(
1691 const blink::WebMouseWheelEvent& event) { 1703 const blink::WebMouseWheelEvent& event) {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 results->orientationAngle = display.RotationAsDegree(); 2057 results->orientationAngle = display.RotationAsDegree();
2046 results->orientationType = 2058 results->orientationType =
2047 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2059 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2048 gfx::DeviceDisplayInfo info; 2060 gfx::DeviceDisplayInfo info;
2049 results->depth = info.GetBitsPerPixel(); 2061 results->depth = info.GetBitsPerPixel();
2050 results->depthPerComponent = info.GetBitsPerComponent(); 2062 results->depthPerComponent = info.GetBitsPerComponent();
2051 results->isMonochrome = (results->depthPerComponent == 0); 2063 results->isMonochrome = (results->depthPerComponent == 0);
2052 } 2064 }
2053 2065
2054 } // namespace content 2066 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698