| 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/frame_host/interstitial_page_impl.h" | 9 #include "content/browser/frame_host/interstitial_page_impl.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 27 matching lines...) Expand all Loading... |
| 38 void WebContentsViewAndroid::SetContentViewCore( | 38 void WebContentsViewAndroid::SetContentViewCore( |
| 39 ContentViewCoreImpl* content_view_core) { | 39 ContentViewCoreImpl* content_view_core) { |
| 40 content_view_core_ = content_view_core; | 40 content_view_core_ = content_view_core; |
| 41 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( | 41 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
| 42 web_contents_->GetRenderWidgetHostView()); | 42 web_contents_->GetRenderWidgetHostView()); |
| 43 if (rwhv) | 43 if (rwhv) |
| 44 rwhv->SetContentViewCore(content_view_core_); | 44 rwhv->SetContentViewCore(content_view_core_); |
| 45 | 45 |
| 46 if (web_contents_->ShowingInterstitialPage()) { | 46 if (web_contents_->ShowingInterstitialPage()) { |
| 47 rwhv = static_cast<RenderWidgetHostViewAndroid*>( | 47 rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
| 48 static_cast<InterstitialPageImpl*>( | 48 web_contents_->GetInterstitialPage() |
| 49 web_contents_->GetInterstitialPage())-> | 49 ->GetMainFrame() |
| 50 GetRenderViewHost()->GetView()); | 50 ->GetRenderViewHost() |
| 51 ->GetView()); |
| 51 if (rwhv) | 52 if (rwhv) |
| 52 rwhv->SetContentViewCore(content_view_core_); | 53 rwhv->SetContentViewCore(content_view_core_); |
| 53 } | 54 } |
| 54 } | 55 } |
| 55 | 56 |
| 56 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { | 57 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { |
| 57 return content_view_core_ ? content_view_core_->GetViewAndroid() : NULL; | 58 return content_view_core_ ? content_view_core_->GetViewAndroid() : NULL; |
| 58 } | 59 } |
| 59 | 60 |
| 60 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { | 61 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // This is called when we the renderer asks us to take focus back (i.e., it has | 207 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 207 // iterated past the last focusable element on the page). | 208 // iterated past the last focusable element on the page). |
| 208 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 209 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 209 if (web_contents_->GetDelegate() && | 210 if (web_contents_->GetDelegate() && |
| 210 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 211 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 211 return; | 212 return; |
| 212 web_contents_->GetRenderWidgetHostView()->Focus(); | 213 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 213 } | 214 } |
| 214 | 215 |
| 215 } // namespace content | 216 } // namespace content |
| OLD | NEW |