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" |
11 #include "content/browser/renderer_host/render_view_host_factory.h" | 11 #include "content/browser/renderer_host/render_view_host_factory.h" |
12 #include "content/browser/renderer_host/render_view_host_impl.h" | 12 #include "content/browser/renderer_host/render_view_host_impl.h" |
13 #include "content/browser/web_contents/interstitial_page_impl.h" | |
13 #include "content/browser/web_contents/web_contents_impl.h" | 14 #include "content/browser/web_contents/web_contents_impl.h" |
14 #include "content/public/browser/interstitial_page.h" | |
15 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 WebContentsView* CreateWebContentsView( | 18 WebContentsView* CreateWebContentsView( |
19 WebContentsImpl* web_contents, | 19 WebContentsImpl* web_contents, |
20 WebContentsViewDelegate* delegate, | 20 WebContentsViewDelegate* delegate, |
21 RenderViewHostDelegateView** render_view_host_delegate_view) { | 21 RenderViewHostDelegateView** render_view_host_delegate_view) { |
22 WebContentsViewAndroid* rv = new WebContentsViewAndroid( | 22 WebContentsViewAndroid* rv = new WebContentsViewAndroid( |
23 web_contents, delegate); | 23 web_contents, delegate); |
24 *render_view_host_delegate_view = rv; | 24 *render_view_host_delegate_view = rv; |
(...skipping 11 matching lines...) Expand all Loading... | |
36 WebContentsViewAndroid::~WebContentsViewAndroid() { | 36 WebContentsViewAndroid::~WebContentsViewAndroid() { |
37 } | 37 } |
38 | 38 |
39 void WebContentsViewAndroid::SetContentViewCore( | 39 void WebContentsViewAndroid::SetContentViewCore( |
40 ContentViewCoreImpl* content_view_core) { | 40 ContentViewCoreImpl* content_view_core) { |
41 content_view_core_ = content_view_core; | 41 content_view_core_ = content_view_core; |
42 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( | 42 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
43 web_contents_->GetRenderWidgetHostView()); | 43 web_contents_->GetRenderWidgetHostView()); |
44 if (rwhv) | 44 if (rwhv) |
45 rwhv->SetContentViewCore(content_view_core_); | 45 rwhv->SetContentViewCore(content_view_core_); |
46 | |
46 if (web_contents_->ShowingInterstitialPage()) { | 47 if (web_contents_->ShowingInterstitialPage()) { |
47 NOTIMPLEMENTED() << "not upstreamed yet"; | 48 rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
49 static_cast<InterstitialPageImpl*>( | |
50 web_contents_->GetInterstitialPage())-> | |
51 GetRenderViewHost()->GetView()); | |
52 if (rwhv) | |
53 rwhv->SetContentViewCore(content_view_core_); | |
Ted C
2012/11/07 18:55:21
I ended up needing to switch this back to the prev
| |
48 } | 54 } |
49 } | 55 } |
50 | 56 |
51 void WebContentsViewAndroid::CreateView(const gfx::Size& initial_size) { | 57 void WebContentsViewAndroid::CreateView(const gfx::Size& initial_size) { |
52 } | 58 } |
53 | 59 |
54 RenderWidgetHostView* WebContentsViewAndroid::CreateViewForWidget( | 60 RenderWidgetHostView* WebContentsViewAndroid::CreateViewForWidget( |
55 RenderWidgetHost* render_widget_host) { | 61 RenderWidgetHost* render_widget_host) { |
56 if (render_widget_host->GetView()) { | 62 if (render_widget_host->GetView()) { |
57 // During testing, the view will already be set up in most cases to the | 63 // During testing, the view will already be set up in most cases to the |
(...skipping 141 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 | 205 // 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). | 206 // iterated past the last focusable element on the page). |
201 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 207 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
202 if (web_contents_->GetDelegate() && | 208 if (web_contents_->GetDelegate() && |
203 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 209 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
204 return; | 210 return; |
205 web_contents_->GetRenderWidgetHostView()->Focus(); | 211 web_contents_->GetRenderWidgetHostView()->Focus(); |
206 } | 212 } |
207 | 213 |
208 } // namespace content | 214 } // namespace content |
OLD | NEW |