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

Side by Side Diff: third_party/WebKit/Source/web/LocalFrameClientImpl.cpp

Issue 2848513002: Introduce the abstract class WebViewBase, to decouple WebViewImpl. (Closed)
Patch Set: Fix typo. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 21 matching lines...) Expand all
32 #include "web/LocalFrameClientImpl.h" 32 #include "web/LocalFrameClientImpl.h"
33 33
34 #include "bindings/core/v8/ScriptController.h" 34 #include "bindings/core/v8/ScriptController.h"
35 #include "core/HTMLNames.h" 35 #include "core/HTMLNames.h"
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/Fullscreen.h" 37 #include "core/dom/Fullscreen.h"
38 #include "core/events/MessageEvent.h" 38 #include "core/events/MessageEvent.h"
39 #include "core/events/MouseEvent.h" 39 #include "core/events/MouseEvent.h"
40 #include "core/events/UIEventWithKeyState.h" 40 #include "core/events/UIEventWithKeyState.h"
41 #include "core/exported/WebDataSourceImpl.h" 41 #include "core/exported/WebDataSourceImpl.h"
42 #include "core/exported/WebViewBase.h"
42 #include "core/frame/FrameView.h" 43 #include "core/frame/FrameView.h"
43 #include "core/frame/Settings.h" 44 #include "core/frame/Settings.h"
44 #include "core/html/HTMLFrameElementBase.h" 45 #include "core/html/HTMLFrameElementBase.h"
45 #include "core/html/HTMLMediaElement.h" 46 #include "core/html/HTMLMediaElement.h"
46 #include "core/html/HTMLPlugInElement.h" 47 #include "core/html/HTMLPlugInElement.h"
47 #include "core/input/EventHandler.h" 48 #include "core/input/EventHandler.h"
48 #include "core/layout/HitTestResult.h" 49 #include "core/layout/HitTestResult.h"
49 #include "core/loader/DocumentLoader.h" 50 #include "core/loader/DocumentLoader.h"
50 #include "core/loader/FrameLoadRequest.h" 51 #include "core/loader/FrameLoadRequest.h"
51 #include "core/loader/FrameLoader.h" 52 #include "core/loader/FrameLoader.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 #include "public/web/WebPlugin.h" 100 #include "public/web/WebPlugin.h"
100 #include "public/web/WebPluginParams.h" 101 #include "public/web/WebPluginParams.h"
101 #include "public/web/WebViewClient.h" 102 #include "public/web/WebViewClient.h"
102 #include "v8/include/v8.h" 103 #include "v8/include/v8.h"
103 #include "web/DevToolsEmulator.h" 104 #include "web/DevToolsEmulator.h"
104 #include "web/SharedWorkerRepositoryClientImpl.h" 105 #include "web/SharedWorkerRepositoryClientImpl.h"
105 #include "web/WebDevToolsAgentImpl.h" 106 #include "web/WebDevToolsAgentImpl.h"
106 #include "web/WebDevToolsFrontendImpl.h" 107 #include "web/WebDevToolsFrontendImpl.h"
107 #include "web/WebLocalFrameImpl.h" 108 #include "web/WebLocalFrameImpl.h"
108 #include "web/WebPluginContainerImpl.h" 109 #include "web/WebPluginContainerImpl.h"
109 #include "web/WebViewImpl.h"
110 110
111 #include <memory> 111 #include <memory>
112 112
113 namespace blink { 113 namespace blink {
114 114
115 namespace { 115 namespace {
116 116
117 // Convenience helper for frame tree helpers in FrameClient to reduce the amount 117 // Convenience helper for frame tree helpers in FrameClient to reduce the amount
118 // of null-checking boilerplate code. Since the frame tree is maintained in the 118 // of null-checking boilerplate code. Since the frame tree is maintained in the
119 // web/ layer, the frame tree helpers often have to deal with null WebFrames: 119 // web/ layer, the frame tree helpers often have to deal with null WebFrames:
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void LocalFrameClientImpl::DispatchDidFinishLoad() { 417 void LocalFrameClientImpl::DispatchDidFinishLoad() {
418 web_frame_->DidFinish(); 418 web_frame_->DidFinish();
419 } 419 }
420 420
421 void LocalFrameClientImpl::DispatchDidChangeThemeColor() { 421 void LocalFrameClientImpl::DispatchDidChangeThemeColor() {
422 if (web_frame_->Client()) 422 if (web_frame_->Client())
423 web_frame_->Client()->DidChangeThemeColor(); 423 web_frame_->Client()->DidChangeThemeColor();
424 } 424 }
425 425
426 static bool AllowCreatingBackgroundTabs() { 426 static bool AllowCreatingBackgroundTabs() {
427 const WebInputEvent* input_event = WebViewImpl::CurrentInputEvent(); 427 const WebInputEvent* input_event = WebViewBase::CurrentInputEvent();
428 if (!input_event || (input_event->GetType() != WebInputEvent::kMouseUp && 428 if (!input_event || (input_event->GetType() != WebInputEvent::kMouseUp &&
429 (input_event->GetType() != WebInputEvent::kRawKeyDown && 429 (input_event->GetType() != WebInputEvent::kRawKeyDown &&
430 input_event->GetType() != WebInputEvent::kKeyDown) && 430 input_event->GetType() != WebInputEvent::kKeyDown) &&
431 input_event->GetType() != WebInputEvent::kGestureTap)) 431 input_event->GetType() != WebInputEvent::kGestureTap))
432 return false; 432 return false;
433 433
434 unsigned short button_number; 434 unsigned short button_number;
435 if (WebInputEvent::IsMouseEventType(input_event->GetType())) { 435 if (WebInputEvent::IsMouseEventType(input_event->GetType())) {
436 const WebMouseEvent* mouse_event = 436 const WebMouseEvent* mouse_event =
437 static_cast<const WebMouseEvent*>(input_event); 437 static_cast<const WebMouseEvent*>(input_event);
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 WrappedResourceRequest(request), static_cast<WebNavigationPolicy>(policy), 580 WrappedResourceRequest(request), static_cast<WebNavigationPolicy>(policy),
581 suggested_name, should_replace_current_entry); 581 suggested_name, should_replace_current_entry);
582 } 582 }
583 583
584 void LocalFrameClientImpl::LoadErrorPage(int reason) { 584 void LocalFrameClientImpl::LoadErrorPage(int reason) {
585 if (web_frame_->Client()) 585 if (web_frame_->Client())
586 web_frame_->Client()->LoadErrorPage(reason); 586 web_frame_->Client()->LoadErrorPage(reason);
587 } 587 }
588 588
589 bool LocalFrameClientImpl::NavigateBackForward(int offset) const { 589 bool LocalFrameClientImpl::NavigateBackForward(int offset) const {
590 WebViewImpl* webview = web_frame_->ViewImpl(); 590 WebViewBase* webview = web_frame_->ViewImpl();
591 if (!webview->Client()) 591 if (!webview->Client())
592 return false; 592 return false;
593 593
594 DCHECK(offset); 594 DCHECK(offset);
595 if (offset > webview->Client()->HistoryForwardListCount()) 595 if (offset > webview->Client()->HistoryForwardListCount())
596 return false; 596 return false;
597 if (offset < -webview->Client()->HistoryBackListCount()) 597 if (offset < -webview->Client()->HistoryBackListCount())
598 return false; 598 return false;
599 webview->Client()->NavigateBackForwardSoon(offset); 599 webview->Client()->NavigateBackForwardSoon(offset);
600 return true; 600 return true;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 return WTF::WrapUnique( 930 return WTF::WrapUnique(
931 web_frame_->Client()->CreateApplicationCacheHost(client)); 931 web_frame_->Client()->CreateApplicationCacheHost(client));
932 } 932 }
933 933
934 void LocalFrameClientImpl::DispatchDidChangeManifest() { 934 void LocalFrameClientImpl::DispatchDidChangeManifest() {
935 if (web_frame_->Client()) 935 if (web_frame_->Client())
936 web_frame_->Client()->DidChangeManifest(); 936 web_frame_->Client()->DidChangeManifest();
937 } 937 }
938 938
939 unsigned LocalFrameClientImpl::BackForwardLength() { 939 unsigned LocalFrameClientImpl::BackForwardLength() {
940 WebViewImpl* webview = web_frame_->ViewImpl(); 940 WebViewBase* webview = web_frame_->ViewImpl();
941 if (!webview || !webview->Client()) 941 if (!webview || !webview->Client())
942 return 0; 942 return 0;
943 return webview->Client()->HistoryBackListCount() + 1 + 943 return webview->Client()->HistoryBackListCount() + 1 +
944 webview->Client()->HistoryForwardListCount(); 944 webview->Client()->HistoryForwardListCount();
945 } 945 }
946 946
947 void LocalFrameClientImpl::SuddenTerminationDisablerChanged( 947 void LocalFrameClientImpl::SuddenTerminationDisablerChanged(
948 bool present, 948 bool present,
949 SuddenTerminationDisablerType type) { 949 SuddenTerminationDisablerType type) {
950 if (web_frame_->Client()) { 950 if (web_frame_->Client()) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 void LocalFrameClientImpl::AbortClientNavigation() { 995 void LocalFrameClientImpl::AbortClientNavigation() {
996 if (web_frame_->Client()) 996 if (web_frame_->Client())
997 web_frame_->Client()->AbortClientNavigation(); 997 web_frame_->Client()->AbortClientNavigation();
998 } 998 }
999 999
1000 TextCheckerClient& LocalFrameClientImpl::GetTextCheckerClient() const { 1000 TextCheckerClient& LocalFrameClientImpl::GetTextCheckerClient() const {
1001 return web_frame_->GetTextCheckerClient(); 1001 return web_frame_->GetTextCheckerClient();
1002 } 1002 }
1003 1003
1004 } // namespace blink 1004 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/LinkHighlightImplTest.cpp ('k') | third_party/WebKit/Source/web/PageOverlayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698