| 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, nullptr, nullptr, previousSibling, |
| 181 properties, nullptr)); |
| 181 | 182 |
| 182 if (!widgetClient) | 183 if (!widgetClient) |
| 183 widgetClient = defaultWebWidgetClient(); | 184 widgetClient = defaultWebWidgetClient(); |
| 184 WebFrameWidget::create(widgetClient, frame); | 185 WebFrameWidget::create(widgetClient, frame); |
| 185 | 186 |
| 186 return frame; | 187 return frame; |
| 187 } | 188 } |
| 188 | 189 |
| 189 WebRemoteFrameImpl* createRemoteChild(WebRemoteFrame* parent, | 190 WebRemoteFrameImpl* createRemoteChild(WebRemoteFrame* parent, |
| 190 WebRemoteFrameClient* client, | 191 WebRemoteFrameClient* client, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // | 226 // |
| 226 // Consequently, all external image resources must be mocked. | 227 // Consequently, all external image resources must be mocked. |
| 227 m_webView->settings()->setLoadsImagesAutomatically(true); | 228 m_webView->settings()->setLoadsImagesAutomatically(true); |
| 228 if (updateSettingsFunc) | 229 if (updateSettingsFunc) |
| 229 updateSettingsFunc(m_webView->settings()); | 230 updateSettingsFunc(m_webView->settings()); |
| 230 if (m_settingOverrider) | 231 if (m_settingOverrider) |
| 231 m_settingOverrider->overrideSettings(m_webView->settings()); | 232 m_settingOverrider->overrideSettings(m_webView->settings()); |
| 232 m_webView->setDeviceScaleFactor( | 233 m_webView->setDeviceScaleFactor( |
| 233 webViewClient->screenInfo().deviceScaleFactor); | 234 webViewClient->screenInfo().deviceScaleFactor); |
| 234 m_webView->setDefaultPageScaleLimits(1, 4); | 235 m_webView->setDefaultPageScaleLimits(1, 4); |
| 235 WebLocalFrame* frame = WebLocalFrameImpl::create(WebTreeScopeType::Document, | 236 WebLocalFrame* frame = WebLocalFrameImpl::create( |
| 236 webFrameClient, opener); | 237 WebTreeScopeType::Document, webFrameClient, |
| 238 webFrameClient->interfaceProvider(), nullptr, opener); |
| 237 m_webView->setMainFrame(frame); | 239 m_webView->setMainFrame(frame); |
| 238 // TODO(dcheng): The main frame widget currently has a special case. | 240 // TODO(dcheng): The main frame widget currently has a special case. |
| 239 // Eliminate this once WebView is no longer a WebWidget. | 241 // Eliminate this once WebView is no longer a WebWidget. |
| 240 blink::WebFrameWidget::create(webWidgetClient, m_webView, frame); | 242 blink::WebFrameWidget::create(webWidgetClient, m_webView, frame); |
| 241 | 243 |
| 242 m_testWebViewClient = webViewClient; | 244 m_testWebViewClient = webViewClient; |
| 243 | 245 |
| 244 return m_webView; | 246 return m_webView; |
| 245 } | 247 } |
| 246 | 248 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 frame->close(); | 311 frame->close(); |
| 310 } | 312 } |
| 311 | 313 |
| 312 WebLocalFrame* TestWebFrameClient::createChildFrame( | 314 WebLocalFrame* TestWebFrameClient::createChildFrame( |
| 313 WebLocalFrame* parent, | 315 WebLocalFrame* parent, |
| 314 WebTreeScopeType scope, | 316 WebTreeScopeType scope, |
| 315 const WebString& name, | 317 const WebString& name, |
| 316 const WebString& uniqueName, | 318 const WebString& uniqueName, |
| 317 WebSandboxFlags sandboxFlags, | 319 WebSandboxFlags sandboxFlags, |
| 318 const WebFrameOwnerProperties& frameOwnerProperties) { | 320 const WebFrameOwnerProperties& frameOwnerProperties) { |
| 319 WebLocalFrame* frame = WebLocalFrame::create(scope, this); | 321 WebLocalFrame* frame = |
| 322 WebLocalFrame::create(scope, this, interfaceProvider(), nullptr); |
| 320 parent->appendChild(frame); | 323 parent->appendChild(frame); |
| 321 return frame; | 324 return frame; |
| 322 } | 325 } |
| 323 | 326 |
| 324 void TestWebFrameClient::didStartLoading(bool) { | 327 void TestWebFrameClient::didStartLoading(bool) { |
| 325 ++m_loadsInProgress; | 328 ++m_loadsInProgress; |
| 326 } | 329 } |
| 327 | 330 |
| 328 void TestWebFrameClient::didStopLoading() { | 331 void TestWebFrameClient::didStopLoading() { |
| 329 DCHECK_GT(m_loadsInProgress, 0); | 332 DCHECK_GT(m_loadsInProgress, 0); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 354 m_testWebViewClient->scheduleAnimation(); | 357 m_testWebViewClient->scheduleAnimation(); |
| 355 } | 358 } |
| 356 | 359 |
| 357 void TestWebViewWidgetClient::didMeaningfulLayout( | 360 void TestWebViewWidgetClient::didMeaningfulLayout( |
| 358 WebMeaningfulLayout layoutType) { | 361 WebMeaningfulLayout layoutType) { |
| 359 m_testWebViewClient->didMeaningfulLayout(layoutType); | 362 m_testWebViewClient->didMeaningfulLayout(layoutType); |
| 360 } | 363 } |
| 361 | 364 |
| 362 } // namespace FrameTestHelpers | 365 } // namespace FrameTestHelpers |
| 363 } // namespace blink | 366 } // namespace blink |
| OLD | NEW |