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

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

Issue 11362130: [Android] Attach RenderWidgetHostView to ContentView at construction time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 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 | « no previous file | no next file » | 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/web_contents/web_contents_view_android.h" 5 #include "content/browser/web_contents/web_contents_view_android.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/android/content_view_core_impl.h" 8 #include "content/browser/android/content_view_core_impl.h"
9 #include "content/browser/android/media_player_manager_android.h" 9 #include "content/browser/android/media_player_manager_android.h"
10 #include "content/browser/renderer_host/render_widget_host_view_android.h" 10 #include "content/browser/renderer_host/render_widget_host_view_android.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // making special ones (which go along with the special views). 61 // making special ones (which go along with the special views).
62 DCHECK(RenderViewHostFactory::has_factory()); 62 DCHECK(RenderViewHostFactory::has_factory());
63 return render_widget_host->GetView(); 63 return render_widget_host->GetView();
64 } 64 }
65 // Note that while this instructs the render widget host to reference 65 // Note that while this instructs the render widget host to reference
66 // |native_view_|, this has no effect without also instructing the 66 // |native_view_|, this has no effect without also instructing the
67 // native view (i.e. ContentView) how to obtain a reference to this widget in 67 // native view (i.e. ContentView) how to obtain a reference to this widget in
68 // order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an 68 // order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an
69 // example of how this is achieved for InterstitialPages. 69 // example of how this is achieved for InterstitialPages.
70 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host); 70 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host);
71 return new RenderWidgetHostViewAndroid(rwhi, content_view_core_); 71 RenderWidgetHostView* view = new RenderWidgetHostViewAndroid(
72 rwhi, content_view_core_);
73 view->Show();
74 return view;
72 } 75 }
73 76
74 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { 77 gfx::NativeView WebContentsViewAndroid::GetNativeView() const {
75 return content_view_core_; 78 return content_view_core_;
76 } 79 }
77 80
78 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { 81 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const {
79 return content_view_core_; 82 return content_view_core_;
80 } 83 }
81 84
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // This is called when we the renderer asks us to take focus back (i.e., it has 202 // This is called when we the renderer asks us to take focus back (i.e., it has
200 // iterated past the last focusable element on the page). 203 // iterated past the last focusable element on the page).
201 void WebContentsViewAndroid::TakeFocus(bool reverse) { 204 void WebContentsViewAndroid::TakeFocus(bool reverse) {
202 if (web_contents_->GetDelegate() && 205 if (web_contents_->GetDelegate() &&
203 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) 206 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse))
204 return; 207 return;
205 web_contents_->GetRenderWidgetHostView()->Focus(); 208 web_contents_->GetRenderWidgetHostView()->Focus();
206 } 209 }
207 210
208 } // namespace content 211 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698