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/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 web_contents_->GetInterstitialPage() | 104 web_contents_->GetInterstitialPage() |
| 105 ->GetMainFrame() | 105 ->GetMainFrame() |
| 106 ->GetRenderViewHost() | 106 ->GetRenderViewHost() |
| 107 ->GetWidget() | 107 ->GetWidget() |
| 108 ->GetView()); | 108 ->GetView()); |
| 109 if (rwhv) | 109 if (rwhv) |
| 110 rwhv->SetContentViewCore(content_view_core_); | 110 rwhv->SetContentViewCore(content_view_core_); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 void WebContentsViewAndroid::SetOverscrollRefreshHandler( | |
| 115 std::unique_ptr<ui::OverscrollRefreshHandler> overscroll_refresh_handler) { | |
| 116 overscroll_refresh_handler_ = std::move(overscroll_refresh_handler); | |
| 117 RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( | |
| 118 web_contents_->GetRenderWidgetHostView()); | |
|
boliu
2016/12/06 00:58:16
need to update interstitial as well, see the Showi
rlanday
2016/12/06 03:25:26
Ah, ok
| |
| 119 if (rwhv) { | |
| 120 rwhv->OnSetOverscrollRefreshHandler(); | |
| 121 } | |
| 122 } | |
| 123 | |
| 124 ui::OverscrollRefreshHandler* | |
| 125 WebContentsViewAndroid::GetOverscrollRefreshHandler() const { | |
| 126 return overscroll_refresh_handler_.get(); | |
| 127 } | |
| 128 | |
| 114 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { | 129 gfx::NativeView WebContentsViewAndroid::GetNativeView() const { |
| 115 return const_cast<gfx::NativeView>(&view_); | 130 return const_cast<gfx::NativeView>(&view_); |
| 116 } | 131 } |
| 117 | 132 |
| 118 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { | 133 gfx::NativeView WebContentsViewAndroid::GetContentNativeView() const { |
| 119 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 134 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
| 120 if (rwhv) | 135 if (rwhv) |
| 121 return rwhv->GetNativeView(); | 136 return rwhv->GetNativeView(); |
| 122 | 137 |
| 123 // TODO(sievers): This should return null. | 138 // TODO(sievers): This should return null. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 364 // This is called when we the renderer asks us to take focus back (i.e., it has | 379 // This is called when we the renderer asks us to take focus back (i.e., it has |
| 365 // iterated past the last focusable element on the page). | 380 // iterated past the last focusable element on the page). |
| 366 void WebContentsViewAndroid::TakeFocus(bool reverse) { | 381 void WebContentsViewAndroid::TakeFocus(bool reverse) { |
| 367 if (web_contents_->GetDelegate() && | 382 if (web_contents_->GetDelegate() && |
| 368 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) | 383 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) |
| 369 return; | 384 return; |
| 370 web_contents_->GetRenderWidgetHostView()->Focus(); | 385 web_contents_->GetRenderWidgetHostView()->Focus(); |
| 371 } | 386 } |
| 372 | 387 |
| 373 } // namespace content | 388 } // namespace content |
| OLD | NEW |