Chromium Code Reviews| 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/renderer_host/render_widget_host_view_android.h" | 9 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 10 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 // making special ones (which go along with the special views). | 59 // making special ones (which go along with the special views). |
| 60 DCHECK(RenderViewHostFactory::has_factory()); | 60 DCHECK(RenderViewHostFactory::has_factory()); |
| 61 return render_widget_host->GetView(); | 61 return render_widget_host->GetView(); |
| 62 } | 62 } |
| 63 // Note that while this instructs the render widget host to reference | 63 // Note that while this instructs the render widget host to reference |
| 64 // |native_view_|, this has no effect without also instructing the | 64 // |native_view_|, this has no effect without also instructing the |
| 65 // native view (i.e. ContentView) how to obtain a reference to this widget in | 65 // native view (i.e. ContentView) how to obtain a reference to this widget in |
| 66 // order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an | 66 // order to paint it. See ContentView::GetRenderWidgetHostViewAndroid for an |
| 67 // example of how this is achieved for InterstitialPages. | 67 // example of how this is achieved for InterstitialPages. |
| 68 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host); | 68 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(render_widget_host); |
| 69 return new RenderWidgetHostViewAndroid(rwhi, content_view_core_); | 69 RenderWidgetHostView* view = new RenderWidgetHostViewAndroid( |
| 70 rwhi, content_view_core_); | |
| 71 view->Show(); | |
|
klobag.chromium
2012/08/22 07:01:19
Should we only call Show if content_view_core_ is
no sievers
2012/08/22 21:17:40
This eliminates a little diff vs. downstream, wher
| |
| 72 return view; | |
| 70 } | 73 } |
| 71 | 74 |
| 72 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { | 75 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { |
| 73 return content_view_core_; | 76 return content_view_core_; |
| 74 } | 77 } |
| 75 | 78 |
| 76 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { | 79 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { |
| 77 return content_view_core_; | 80 return content_view_core_; |
| 78 } | 81 } |
| 79 | 82 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 // This is called when we the renderer asks us to take focus back (i.e., it has | 200 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 198 // iterated past the last focusable element on the page). | 201 // iterated past the last focusable element on the page). |
| 199 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 202 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 200 if (web_contents_->GetDelegate() && | 203 if (web_contents_->GetDelegate() && |
| 201 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 204 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 202 return; | 205 return; |
| 203 web_contents_->GetRenderWidgetHostView()->Focus(); | 206 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 204 } | 207 } |
| 205 | 208 |
| 206 } // namespace content | 209 } // namespace content |
| OLD | NEW |