Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2854783003: Remove the last references from production code to WebViewImpl. (Closed)
Patch Set: Remove TODO(). Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 093c5a1cc6fac6339ba94bb542ac444086f4c763..c76526eef169c48cd487cb34bc97f9bc881066fe 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -39,6 +39,7 @@
#include "core/editing/FrameSelection.h"
#include "core/editing/InputMethodController.h"
#include "core/editing/PlainTextRange.h"
+#include "core/exported/WebViewBase.h"
#include "core/frame/FrameView.h"
#include "core/frame/RemoteFrame.h"
#include "core/frame/Settings.h"
@@ -93,7 +94,7 @@ WebFrameWidget* WebFrameWidget::Create(WebWidgetClient* client,
WebView* web_view,
WebLocalFrame* main_frame) {
DCHECK(client) << "A valid WebWidgetClient must be supplied.";
- return new WebViewFrameWidget(*client, ToWebViewImpl(*web_view),
+ return new WebViewFrameWidget(*client, static_cast<WebViewBase&>(*web_view),
ToWebLocalFrameImpl(*main_frame));
}
@@ -787,15 +788,13 @@ void WebFrameWidgetImpl::HandleMouseLeave(LocalFrame& main_frame,
void WebFrameWidgetImpl::HandleMouseDown(LocalFrame& main_frame,
const WebMouseEvent& event) {
- // TODO(slangley): Remove this downcast to WebViewImpl once we lift this
- // code into core.
- WebViewImpl* view_impl = ToWebViewImpl(View());
+ WebViewBase* view_impl = View();
// If there is a popup open, close it as the user is clicking on the page
// (outside of the popup). We also save it so we can prevent a click on an
// element from immediately reopening the same popup.
RefPtr<WebPagePopupImpl> page_popup;
if (event.button == WebMouseEvent::Button::kLeft) {
- page_popup = view_impl->GetPagePopup();
+ page_popup = ToWebPagePopupImpl(view_impl->GetPagePopup());
view_impl->HidePopups();
}
@@ -824,7 +823,8 @@ void WebFrameWidgetImpl::HandleMouseDown(LocalFrame& main_frame,
main_frame.GetEventHandler().TakeLastMouseDownGestureToken();
if (view_impl->GetPagePopup() && page_popup &&
- view_impl->GetPagePopup()->HasSamePopupClient(page_popup.Get())) {
+ ToWebPagePopupImpl(view_impl->GetPagePopup())
+ ->HasSamePopupClient(page_popup.Get())) {
// That click triggered a page popup that is the same as the one we just
// closed. It needs to be closed.
view_impl->HidePopups();
@@ -902,9 +902,8 @@ WebInputEventResult WebFrameWidgetImpl::HandleGestureEvent(
DCHECK(client_);
WebInputEventResult event_result = WebInputEventResult::kNotHandled;
bool event_cancelled = false;
- // TODO(slangley): Remove this downcast to WebViewImpl once we lift this
- // code into core.
- WebViewImpl* view_impl = ToWebViewImpl(View());
+
+ WebViewBase* view_impl = View();
switch (event.GetType()) {
case WebInputEvent::kGestureScrollBegin:
case WebInputEvent::kGestureScrollEnd:
@@ -918,7 +917,8 @@ WebInputEventResult WebFrameWidgetImpl::HandleGestureEvent(
// When we close a popup because of a GestureTapDown, we also save it so
// we can prevent the following GestureTap from immediately reopening the
// same popup.
- view_impl->SetLastHiddenPagePopup(view_impl->GetPagePopup());
+ view_impl->SetLastHiddenPagePopup(
+ ToWebPagePopupImpl(view_impl->GetPagePopup()));
View()->HidePopups();
case WebInputEvent::kGestureTapCancel:
View()->SetLastHiddenPagePopup(nullptr);
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698