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

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

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Move web_contents_view_android.h header in web_contents_android.h into cc file, modify CreateRefres… 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 WebContentsViewAndroid* rv = new WebContentsViewAndroid( 74 WebContentsViewAndroid* rv = new WebContentsViewAndroid(
75 web_contents, delegate); 75 web_contents, delegate);
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_(nullptr),
85 overscroll_refresh_handler_(nullptr),
85 delegate_(delegate), 86 delegate_(delegate),
86 synchronous_compositor_client_(nullptr) { 87 synchronous_compositor_client_(nullptr) {}
87 }
88 88
89 WebContentsViewAndroid::~WebContentsViewAndroid() { 89 WebContentsViewAndroid::~WebContentsViewAndroid() {
90 if (view_.GetLayer()) 90 if (view_.GetLayer())
91 view_.GetLayer()->RemoveFromParent(); 91 view_.GetLayer()->RemoveFromParent();
92 } 92 }
93 93
94 void WebContentsViewAndroid::SetContentViewCore( 94 void WebContentsViewAndroid::SetContentViewCore(
95 ContentViewCoreImpl* content_view_core) { 95 ContentViewCoreImpl* content_view_core) {
96 content_view_core_ = content_view_core; 96 content_view_core_ = content_view_core;
97 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( 97 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 DCHECK(RenderViewHostFactory::has_factory()); 209 DCHECK(RenderViewHostFactory::has_factory());
210 return static_cast<RenderWidgetHostViewBase*>( 210 return static_cast<RenderWidgetHostViewBase*>(
211 render_widget_host->GetView()); 211 render_widget_host->GetView());
212 } 212 }
213 // Note that while this instructs the render widget host to reference 213 // Note that while this instructs the render widget host to reference
214 // |native_view_|, this has no effect without also instructing the 214 // |native_view_|, this has no effect without also instructing the
215 // native view (i.e. ContentView) how to obtain a reference to this widget in 215 // native view (i.e. ContentView) how to obtain a reference to this widget in
216 // order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an 216 // order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an
217 // example of how this is achieved for InterstitialPages. 217 // example of how this is achieved for InterstitialPages.
218 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host); 218 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host);
219 RenderWidgetHostViewAndroid* rwhv = 219 RenderWidgetHostViewAndroid* rwhv = new RenderWidgetHostViewAndroid(
220 new RenderWidgetHostViewAndroid(rwhi, content_view_core_); 220 rwhi, content_view_core_, overscroll_refresh_handler_);
221 rwhv->SetSynchronousCompositorClient(synchronous_compositor_client_); 221 rwhv->SetSynchronousCompositorClient(synchronous_compositor_client_);
222 return rwhv; 222 return rwhv;
223 } 223 }
224 224
225 RenderWidgetHostViewBase* WebContentsViewAndroid::CreateViewForPopupWidget( 225 RenderWidgetHostViewBase* WebContentsViewAndroid::CreateViewForPopupWidget(
226 RenderWidgetHost* render_widget_host) { 226 RenderWidgetHost* render_widget_host) {
227 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host); 227 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host);
228 return new RenderWidgetHostViewAndroid(rwhi, NULL); 228 return new RenderWidgetHostViewAndroid(rwhi, nullptr, nullptr);
229 } 229 }
230 230
231 void WebContentsViewAndroid::RenderViewCreated(RenderViewHost* host) { 231 void WebContentsViewAndroid::RenderViewCreated(RenderViewHost* host) {
232 } 232 }
233 233
234 void WebContentsViewAndroid::RenderViewSwappedIn(RenderViewHost* host) { 234 void WebContentsViewAndroid::RenderViewSwappedIn(RenderViewHost* host) {
235 } 235 }
236 236
237 void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) { 237 void WebContentsViewAndroid::SetOverscrollControllerEnabled(bool enabled) {
238 } 238 }
(...skipping 125 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 364 // 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). 365 // iterated past the last focusable element on the page).
366 void WebContentsViewAndroid::TakeFocus(bool reverse) { 366 void WebContentsViewAndroid::TakeFocus(bool reverse) {
367 if (web_contents_->GetDelegate() && 367 if (web_contents_->GetDelegate() &&
368 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) 368 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse))
369 return; 369 return;
370 web_contents_->GetRenderWidgetHostView()->Focus(); 370 web_contents_->GetRenderWidgetHostView()->Focus();
371 } 371 }
372 372
373 } // namespace content 373 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698