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

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: set webwidget on frame creation instead of view creation 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 95 }
95 96
96 void LayoutTestContentRendererClient::RenderThreadStarted() { 97 void LayoutTestContentRendererClient::RenderThreadStarted() {
97 ShellContentRendererClient::RenderThreadStarted(); 98 ShellContentRendererClient::RenderThreadStarted();
98 shell_observer_.reset(new LayoutTestRenderThreadObserver()); 99 shell_observer_.reset(new LayoutTestRenderThreadObserver());
99 } 100 }
100 101
101 void LayoutTestContentRendererClient::RenderFrameCreated( 102 void LayoutTestContentRendererClient::RenderFrameCreated(
102 RenderFrame* render_frame) { 103 RenderFrame* render_frame) {
103 new LayoutTestRenderFrameObserver(render_frame); 104 new LayoutTestRenderFrameObserver(render_frame);
105
106 test_runner::WebTestProxyBase* proxy =
dcheng 2016/05/03 09:27:13 The ultimate goal here is to associate the widget
Łukasz Anforowicz 2016/05/03 16:09:55 Would it make sense to pass web_local_frame->frame
lfg 2016/05/03 21:19:43 I think that does make sense, but there's also a l
dcheng 2016/05/04 04:55:29 OK. Might be worth adding a TODO, but I leave that
dcheng 2016/05/04 04:55:29 OK. Might be worth adding a TODO, but I leave that
107 GetWebTestProxyBase(render_frame->GetRenderView());
108 WebLocalFrame* frame = render_frame->GetWebFrame();
109 if (!frame->parent())
110 proxy->set_web_widget(frame->frameWidget());
104 } 111 }
105 112
106 void LayoutTestContentRendererClient::RenderViewCreated( 113 void LayoutTestContentRendererClient::RenderViewCreated(
107 RenderView* render_view) { 114 RenderView* render_view) {
108 new ShellRenderViewObserver(render_view); 115 new ShellRenderViewObserver(render_view);
109 116
110 test_runner::WebTestProxyBase* proxy = GetWebTestProxyBase(render_view); 117 test_runner::WebTestProxyBase* proxy = GetWebTestProxyBase(render_view);
111 proxy->set_web_widget(render_view->GetWebView());
112 proxy->set_web_view(render_view->GetWebView()); 118 proxy->set_web_view(render_view->GetWebView());
113 proxy->Reset(); 119 proxy->Reset();
114 proxy->SetSendWheelGestures(UseGestureBasedWheelScrolling()); 120 proxy->SetSendWheelGestures(UseGestureBasedWheelScrolling());
115 121
116 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view); 122 BlinkTestRunner* test_runner = BlinkTestRunner::Get(render_view);
117 test_runner->Reset(false /* for_new_test */); 123 test_runner->Reset(false /* for_new_test */);
118 124
119 LayoutTestRenderThreadObserver::GetInstance() 125 LayoutTestRenderThreadObserver::GetInstance()
120 ->test_interfaces() 126 ->test_interfaces()
121 ->TestRunner() 127 ->TestRunner()
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { 192 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() {
187 #if defined(ENABLE_WEBRTC) 193 #if defined(ENABLE_WEBRTC)
188 return std::unique_ptr<MediaStreamRendererFactory>( 194 return std::unique_ptr<MediaStreamRendererFactory>(
189 new TestMediaStreamRendererFactory()); 195 new TestMediaStreamRendererFactory());
190 #else 196 #else
191 return nullptr; 197 return nullptr;
192 #endif 198 #endif
193 } 199 }
194 200
195 } // namespace content 201 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698