OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |