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/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 26 matching lines...) Expand all Loading... | |
| 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 if (web_contents_->ShowingInterstitialPage()) { | 46 if (web_contents_->ShowingInterstitialPage()) { |
| 47 NOTIMPLEMENTED() << "not upstreamed yet"; | 47 rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
| 48 web_contents_->GetInterstitialPage()-> | |
| 49 GetRenderViewHost()->GetView()); | |
| 50 if (rwhv) | |
|
no sievers
2012/11/06 22:42:56
Can this ever be null? Should it match the logic i
Ted C
2012/11/07 01:34:31
Based on the number of checks in content_view_core
| |
| 51 rwhv->SetContentViewCore(content_view_core_); | |
| 48 } | 52 } |
| 49 } | 53 } |
| 50 | 54 |
| 51 void WebContentsViewAndroid::CreateView(const gfx::Size& initial_size) { | 55 void WebContentsViewAndroid::CreateView(const gfx::Size& initial_size) { |
| 52 } | 56 } |
| 53 | 57 |
| 54 RenderWidgetHostView* WebContentsViewAndroid::CreateViewForWidget( | 58 RenderWidgetHostView* WebContentsViewAndroid::CreateViewForWidget( |
| 55 RenderWidgetHost* render_widget_host) { | 59 RenderWidgetHost* render_widget_host) { |
| 56 if (render_widget_host->GetView()) { | 60 if (render_widget_host->GetView()) { |
| 57 // During testing, the view will already be set up in most cases to the | 61 // 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 | 203 // 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). | 204 // iterated past the last focusable element on the page). |
| 201 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 205 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 202 if (web_contents_->GetDelegate() && | 206 if (web_contents_->GetDelegate() && |
| 203 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 207 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 204 return; | 208 return; |
| 205 web_contents_->GetRenderWidgetHostView()->Focus(); | 209 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 206 } | 210 } |
| 207 | 211 |
| 208 } // namespace content | 212 } // namespace content |
| OLD | NEW |