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

Side by Side Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: addressed comments Created 4 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
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/web_contents/web_contents_view_android.h" 5 #include "content/browser/web_contents/web_contents_view_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 *render_view_host_delegate_view = rv; 76 *render_view_host_delegate_view = rv;
77 return rv; 77 return rv;
78 } 78 }
79 79
80 WebContentsViewAndroid::WebContentsViewAndroid( 80 WebContentsViewAndroid::WebContentsViewAndroid(
81 WebContentsImpl* web_contents, 81 WebContentsImpl* web_contents,
82 WebContentsViewDelegate* delegate) 82 WebContentsViewDelegate* delegate)
83 : web_contents_(web_contents), 83 : web_contents_(web_contents),
84 content_view_core_(NULL), 84 content_view_core_(NULL),
85 delegate_(delegate), 85 delegate_(delegate),
86 view_(this),
86 synchronous_compositor_client_(nullptr) { 87 synchronous_compositor_client_(nullptr) {
87 } 88 }
88 89
89 WebContentsViewAndroid::~WebContentsViewAndroid() { 90 WebContentsViewAndroid::~WebContentsViewAndroid() {
90 if (view_.GetLayer()) 91 if (view_.GetLayer())
91 view_.GetLayer()->RemoveFromParent(); 92 view_.GetLayer()->RemoveFromParent();
92 } 93 }
93 94
94 void WebContentsViewAndroid::SetContentViewCore( 95 void WebContentsViewAndroid::SetContentViewCore(
95 ContentViewCoreImpl* content_view_core) { 96 ContentViewCoreImpl* content_view_core) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 231
231 void WebContentsViewAndroid::RenderViewCreated(RenderViewHost* host) { 232 void WebContentsViewAndroid::RenderViewCreated(RenderViewHost* host) {
232 } 233 }
233 234
234 void WebContentsViewAndroid::RenderViewSwappedIn(RenderViewHost* host) { 235 void WebContentsViewAndroid::RenderViewSwappedIn(RenderViewHost* host) {
235 } 236 }
236 237
237 void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) { 238 void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) {
238 } 239 }
239 240
241 void WebContentsViewAndroid::OnPhysicalBackingSizeChanged(int width,
242 int height) {
243 // |SendScreenRects()| indirectly calls GetViewSize() that asks Java layer.
244 web_contents_->SendScreenRects();
245 }
246
240 void WebContentsViewAndroid::ShowContextMenu( 247 void WebContentsViewAndroid::ShowContextMenu(
241 RenderFrameHost* render_frame_host, const ContextMenuParams& params) { 248 RenderFrameHost* render_frame_host, const ContextMenuParams& params) {
242 if (delegate_) 249 if (delegate_)
243 delegate_->ShowContextMenu(render_frame_host, params); 250 delegate_->ShowContextMenu(render_frame_host, params);
244 } 251 }
245 252
246 void WebContentsViewAndroid::ShowPopupMenu( 253 void WebContentsViewAndroid::ShowPopupMenu(
247 RenderFrameHost* render_frame_host, 254 RenderFrameHost* render_frame_host,
248 const gfx::Rect& bounds, 255 const gfx::Rect& bounds,
249 int item_height, 256 int item_height,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // This is called when we the renderer asks us to take focus back (i.e., it has 371 // This is called when we the renderer asks us to take focus back (i.e., it has
365 // iterated past the last focusable element on the page). 372 // iterated past the last focusable element on the page).
366 void WebContentsViewAndroid::TakeFocus(bool reverse) { 373 void WebContentsViewAndroid::TakeFocus(bool reverse) {
367 if (web_contents_->GetDelegate() && 374 if (web_contents_->GetDelegate() &&
368 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) 375 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse))
369 return; 376 return;
370 web_contents_->GetRenderWidgetHostView()->Focus(); 377 web_contents_->GetRenderWidgetHostView()->Focus();
371 } 378 }
372 379
373 } // namespace content 380 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698