| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 const WebString& name, | 170 const WebString& name, |
| 171 WebFrameClient* client, | 171 WebFrameClient* client, |
| 172 WebWidgetClient* widgetClient, | 172 WebWidgetClient* widgetClient, |
| 173 WebFrame* previousSibling, | 173 WebFrame* previousSibling, |
| 174 const WebFrameOwnerProperties& properties) { | 174 const WebFrameOwnerProperties& properties) { |
| 175 if (!client) | 175 if (!client) |
| 176 client = defaultWebFrameClient(); | 176 client = defaultWebFrameClient(); |
| 177 | 177 |
| 178 WebLocalFrameImpl* frame = toWebLocalFrameImpl(parent->createLocalChild( | 178 WebLocalFrameImpl* frame = toWebLocalFrameImpl(parent->createLocalChild( |
| 179 WebTreeScopeType::Document, name, nameToUniqueName(name), | 179 WebTreeScopeType::Document, name, nameToUniqueName(name), |
| 180 WebSandboxFlags::None, client, previousSibling, properties, nullptr)); | 180 WebSandboxFlags::None, client, |
| 181 static_cast<TestWebFrameClient*>(client)->interfaceProvider(), nullptr, |
| 182 previousSibling, properties, nullptr)); |
| 181 | 183 |
| 182 if (!widgetClient) | 184 if (!widgetClient) |
| 183 widgetClient = defaultWebWidgetClient(); | 185 widgetClient = defaultWebWidgetClient(); |
| 184 WebFrameWidget::create(widgetClient, frame); | 186 WebFrameWidget::create(widgetClient, frame); |
| 185 | 187 |
| 186 return frame; | 188 return frame; |
| 187 } | 189 } |
| 188 | 190 |
| 189 WebRemoteFrameImpl* createRemoteChild(WebRemoteFrame* parent, | 191 WebRemoteFrameImpl* createRemoteChild(WebRemoteFrame* parent, |
| 190 WebRemoteFrameClient* client, | 192 WebRemoteFrameClient* client, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // | 227 // |
| 226 // Consequently, all external image resources must be mocked. | 228 // Consequently, all external image resources must be mocked. |
| 227 m_webView->settings()->setLoadsImagesAutomatically(true); | 229 m_webView->settings()->setLoadsImagesAutomatically(true); |
| 228 if (updateSettingsFunc) | 230 if (updateSettingsFunc) |
| 229 updateSettingsFunc(m_webView->settings()); | 231 updateSettingsFunc(m_webView->settings()); |
| 230 if (m_settingOverrider) | 232 if (m_settingOverrider) |
| 231 m_settingOverrider->overrideSettings(m_webView->settings()); | 233 m_settingOverrider->overrideSettings(m_webView->settings()); |
| 232 m_webView->setDeviceScaleFactor( | 234 m_webView->setDeviceScaleFactor( |
| 233 webViewClient->screenInfo().deviceScaleFactor); | 235 webViewClient->screenInfo().deviceScaleFactor); |
| 234 m_webView->setDefaultPageScaleLimits(1, 4); | 236 m_webView->setDefaultPageScaleLimits(1, 4); |
| 235 WebLocalFrame* frame = WebLocalFrameImpl::create(WebTreeScopeType::Document, | 237 WebLocalFrame* frame = WebLocalFrameImpl::create( |
| 236 webFrameClient, opener); | 238 WebTreeScopeType::Document, webFrameClient, |
| 239 webFrameClient->interfaceProvider(), nullptr, opener); |
| 237 m_webView->setMainFrame(frame); | 240 m_webView->setMainFrame(frame); |
| 238 // TODO(dcheng): The main frame widget currently has a special case. | 241 // TODO(dcheng): The main frame widget currently has a special case. |
| 239 // Eliminate this once WebView is no longer a WebWidget. | 242 // Eliminate this once WebView is no longer a WebWidget. |
| 240 blink::WebFrameWidget::create(webWidgetClient, m_webView, frame); | 243 blink::WebFrameWidget::create(webWidgetClient, m_webView, frame); |
| 241 | 244 |
| 242 m_testWebViewClient = webViewClient; | 245 m_testWebViewClient = webViewClient; |
| 243 | 246 |
| 244 return m_webView; | 247 return m_webView; |
| 245 } | 248 } |
| 246 | 249 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 frame->close(); | 312 frame->close(); |
| 310 } | 313 } |
| 311 | 314 |
| 312 WebLocalFrame* TestWebFrameClient::createChildFrame( | 315 WebLocalFrame* TestWebFrameClient::createChildFrame( |
| 313 WebLocalFrame* parent, | 316 WebLocalFrame* parent, |
| 314 WebTreeScopeType scope, | 317 WebTreeScopeType scope, |
| 315 const WebString& name, | 318 const WebString& name, |
| 316 const WebString& uniqueName, | 319 const WebString& uniqueName, |
| 317 WebSandboxFlags sandboxFlags, | 320 WebSandboxFlags sandboxFlags, |
| 318 const WebFrameOwnerProperties& frameOwnerProperties) { | 321 const WebFrameOwnerProperties& frameOwnerProperties) { |
| 319 WebLocalFrame* frame = WebLocalFrame::create(scope, this); | 322 WebLocalFrame* frame = |
| 323 WebLocalFrame::create(scope, this, interfaceProvider(), nullptr); |
| 320 parent->appendChild(frame); | 324 parent->appendChild(frame); |
| 321 return frame; | 325 return frame; |
| 322 } | 326 } |
| 323 | 327 |
| 324 void TestWebFrameClient::didStartLoading(bool) { | 328 void TestWebFrameClient::didStartLoading(bool) { |
| 325 ++m_loadsInProgress; | 329 ++m_loadsInProgress; |
| 326 } | 330 } |
| 327 | 331 |
| 328 void TestWebFrameClient::didStopLoading() { | 332 void TestWebFrameClient::didStopLoading() { |
| 329 DCHECK_GT(m_loadsInProgress, 0); | 333 DCHECK_GT(m_loadsInProgress, 0); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 359 m_testWebViewClient->scheduleAnimation(); | 363 m_testWebViewClient->scheduleAnimation(); |
| 360 } | 364 } |
| 361 | 365 |
| 362 void TestWebViewWidgetClient::didMeaningfulLayout( | 366 void TestWebViewWidgetClient::didMeaningfulLayout( |
| 363 WebMeaningfulLayout layoutType) { | 367 WebMeaningfulLayout layoutType) { |
| 364 m_testWebViewClient->didMeaningfulLayout(layoutType); | 368 m_testWebViewClient->didMeaningfulLayout(layoutType); |
| 365 } | 369 } |
| 366 | 370 |
| 367 } // namespace FrameTestHelpers | 371 } // namespace FrameTestHelpers |
| 368 } // namespace blink | 372 } // namespace blink |
| OLD | NEW |