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

Side by Side Diff: content/shell/renderer/layout_test/layout_test_content_renderer_client.cc

Issue 1918183004: Switch the inheritance of WebView from WebWidget to protected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/shell/renderer/layout_test/layout_test_content_renderer_client .h" 5 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/debugger.h" 9 #include "base/debug/debugger.h"
10 #include "components/test_runner/mock_credential_manager_client.h" 10 #include "components/test_runner/mock_credential_manager_client.h"
(...skipping 18 matching lines...) Expand all
29 #include "content/test/mock_webclipboard_impl.h" 29 #include "content/test/mock_webclipboard_impl.h"
30 #include "ppapi/shared_impl/ppapi_switches.h" 30 #include "ppapi/shared_impl/ppapi_switches.h"
31 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" 31 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
32 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClie nt.h" 32 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClie nt.h"
33 #include "third_party/WebKit/public/web/WebPluginParams.h" 33 #include "third_party/WebKit/public/web/WebPluginParams.h"
34 #include "third_party/WebKit/public/web/WebView.h" 34 #include "third_party/WebKit/public/web/WebView.h"
35 #include "v8/include/v8.h" 35 #include "v8/include/v8.h"
36 36
37 using blink::WebAudioDevice; 37 using blink::WebAudioDevice;
38 using blink::WebClipboard; 38 using blink::WebClipboard;
39 using blink::WebFrame;
39 using blink::WebLocalFrame; 40 using blink::WebLocalFrame;
40 using blink::WebMIDIAccessor; 41 using blink::WebMIDIAccessor;
41 using blink::WebMIDIAccessorClient; 42 using blink::WebMIDIAccessorClient;
42 using blink::WebMediaStreamCenter; 43 using blink::WebMediaStreamCenter;
43 using blink::WebMediaStreamCenterClient; 44 using blink::WebMediaStreamCenterClient;
44 using blink::WebPlugin; 45 using blink::WebPlugin;
45 using blink::WebPluginParams; 46 using blink::WebPluginParams;
46 using blink::WebRTCPeerConnectionHandler; 47 using blink::WebRTCPeerConnectionHandler;
47 using blink::WebRTCPeerConnectionHandlerClient; 48 using blink::WebRTCPeerConnectionHandlerClient;
48 using blink::WebThemeEngine; 49 using blink::WebThemeEngine;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 LayoutTestContentRendererClient::~LayoutTestContentRendererClient() { 98 LayoutTestContentRendererClient::~LayoutTestContentRendererClient() {
98 } 99 }
99 100
100 void LayoutTestContentRendererClient::RenderThreadStarted() { 101 void LayoutTestContentRendererClient::RenderThreadStarted() {
101 ShellContentRendererClient::RenderThreadStarted(); 102 ShellContentRendererClient::RenderThreadStarted();
102 shell_observer_.reset(new LayoutTestRenderThreadObserver()); 103 shell_observer_.reset(new LayoutTestRenderThreadObserver());
103 } 104 }
104 105
105 void LayoutTestContentRendererClient::RenderFrameCreated( 106 void LayoutTestContentRendererClient::RenderFrameCreated(
106 RenderFrame* render_frame) { 107 RenderFrame* render_frame) {
107 test_runner::WebFrameTestProxyBase* proxy = 108 test_runner::WebFrameTestProxyBase* frame_proxy =
108 GetWebFrameTestProxyBase(render_frame); 109 GetWebFrameTestProxyBase(render_frame);
109 proxy->set_web_frame(render_frame->GetWebFrame()); 110 frame_proxy->set_web_frame(render_frame->GetWebFrame());
110 new LayoutTestRenderFrameObserver(render_frame); 111 new LayoutTestRenderFrameObserver(render_frame);
112
113 // TODO(lfg): We should fix the TestProxy to track the WebWidgets on every
114 // local root in WebFrameTestProxy instead of having only the WebWidget for
115 // the main frame in WebTestProxy.
116 test_runner::WebTestProxyBase* proxy =
117 GetWebTestProxyBase(render_frame->GetRenderView());
118 WebLocalFrame* frame = render_frame->GetWebFrame();
119 if (!frame->parent())
120 proxy->set_web_widget(frame->frameWidget());
111 } 121 }
112 122
113 void LayoutTestContentRendererClient::RenderViewCreated( 123 void LayoutTestContentRendererClient::RenderViewCreated(
114 RenderView* render_view) { 124 RenderView* render_view) {
115 new ShellRenderViewObserver(render_view); 125 new ShellRenderViewObserver(render_view);
116 126
117 test_runner::WebTestProxyBase* proxy = GetWebTestProxyBase(render_view); 127 test_runner::WebTestProxyBase* proxy = GetWebTestProxyBase(render_view);
118 proxy->set_web_widget(render_view->GetWebView());
119 proxy->set_web_view(render_view->GetWebView()); 128 proxy->set_web_view(render_view->GetWebView());
120 proxy->Reset(); 129 proxy->Reset();
121 proxy->SetSendWheelGestures(UseGestureBasedWheelScrolling()); 130 proxy->SetSendWheelGestures(UseGestureBasedWheelScrolling());
122 131
123 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view); 132 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view);
124 test_runner->Reset(false /* for_new_test */); 133 test_runner->Reset(false /* for_new_test */);
125 134
126 LayoutTestRenderThreadObserver::GetInstance() 135 LayoutTestRenderThreadObserver::GetInstance()
127 ->test_interfaces() 136 ->test_interfaces()
128 ->TestRunner() 137 ->TestRunner()
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { 202 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() {
194 #if defined(ENABLE_WEBRTC) 203 #if defined(ENABLE_WEBRTC)
195 return std::unique_ptr<MediaStreamRendererFactory>( 204 return std::unique_ptr<MediaStreamRendererFactory>(
196 new TestMediaStreamRendererFactory()); 205 new TestMediaStreamRendererFactory());
197 #else 206 #else
198 return nullptr; 207 return nullptr;
199 #endif 208 #endif
200 } 209 }
201 210
202 } // namespace content 211 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698