| 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/media/android/browser_media_player_manager.h" | 10 #include "content/browser/media/android/browser_media_player_manager.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 if (web_contents_->ShowingInterstitialPage()) { | 47 if (web_contents_->ShowingInterstitialPage()) { |
| 48 rwhv = static_cast<RenderWidgetHostViewAndroid*>( | 48 rwhv = static_cast<RenderWidgetHostViewAndroid*>( |
| 49 static_cast<InterstitialPageImpl*>( | 49 static_cast<InterstitialPageImpl*>( |
| 50 web_contents_->GetInterstitialPage())-> | 50 web_contents_->GetInterstitialPage())-> |
| 51 GetRenderViewHost()->GetView()); | 51 GetRenderViewHost()->GetView()); |
| 52 if (rwhv) | 52 if (rwhv) |
| 53 rwhv->SetContentViewCore(content_view_core_); | 53 rwhv->SetContentViewCore(content_view_core_); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 #if defined(VIDEO_HOLE) | |
| 58 void WebContentsViewAndroid::NotifyExternalSurface( | |
| 59 int player_id, bool is_request, const gfx::RectF& rect) { | |
| 60 if (content_view_core_) | |
| 61 content_view_core_->NotifyExternalSurface(player_id, is_request, rect); | |
| 62 } | |
| 63 #endif // defined(VIDEO_HOLE) | |
| 64 | |
| 65 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { | 57 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { |
| 66 return content_view_core_ ? content_view_core_->GetViewAndroid() : NULL; | 58 return content_view_core_ ? content_view_core_->GetViewAndroid() : NULL; |
| 67 } | 59 } |
| 68 | 60 |
| 69 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { | 61 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { |
| 70 return content_view_core_ ? content_view_core_->GetViewAndroid() : NULL; | 62 return content_view_core_ ? content_view_core_->GetViewAndroid() : NULL; |
| 71 } | 63 } |
| 72 | 64 |
| 73 gfx::NativeWindow WebContentsViewAndroid::GetTopLevelNativeWindow() const { | 65 gfx::NativeWindow WebContentsViewAndroid::GetTopLevelNativeWindow() const { |
| 74 return content_view_core_ ? content_view_core_->GetWindowAndroid() : NULL; | 66 return content_view_core_ ? content_view_core_->GetWindowAndroid() : NULL; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // This is called when we the renderer asks us to take focus back (i.e., it has | 210 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 219 // iterated past the last focusable element on the page). | 211 // iterated past the last focusable element on the page). |
| 220 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 212 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 221 if (web_contents_->GetDelegate() && | 213 if (web_contents_->GetDelegate() && |
| 222 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 214 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 223 return; | 215 return; |
| 224 web_contents_->GetRenderWidgetHostView()->Focus(); | 216 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 225 } | 217 } |
| 226 | 218 |
| 227 } // namespace content | 219 } // namespace content |
| OLD | NEW |