| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) | 292 void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) |
| 293 { | 293 { |
| 294 if (devToolsClient) | 294 if (devToolsClient) |
| 295 m_devToolsAgent = adoptPtr(new WebDevToolsAgentImpl(this, devToolsClient
)); | 295 m_devToolsAgent = adoptPtr(new WebDevToolsAgentImpl(this, devToolsClient
)); |
| 296 else | 296 else |
| 297 m_devToolsAgent.clear(); | 297 m_devToolsAgent.clear(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) | 300 void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) |
| 301 { | 301 { |
| 302 providePrerendererClientTo(m_page.get(), new PrerendererClientImpl(prerender
erClient)); | 302 ASSERT(m_page); |
| 303 providePrerendererClientTo(*m_page, new PrerendererClientImpl(prerendererCli
ent)); |
| 303 } | 304 } |
| 304 | 305 |
| 305 void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) | 306 void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) |
| 306 { | 307 { |
| 307 m_spellCheckClient = spellCheckClient; | 308 m_spellCheckClient = spellCheckClient; |
| 308 } | 309 } |
| 309 | 310 |
| 310 void WebViewImpl::setPasswordGeneratorClient(WebPasswordGeneratorClient* client) | 311 void WebViewImpl::setPasswordGeneratorClient(WebPasswordGeneratorClient* client) |
| 311 { | 312 { |
| 312 m_passwordGeneratorClient = client; | 313 m_passwordGeneratorClient = client; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 pageClients.chromeClient = &m_chromeClientImpl; | 382 pageClients.chromeClient = &m_chromeClientImpl; |
| 382 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 383 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
| 383 pageClients.editorClient = &m_editorClientImpl; | 384 pageClients.editorClient = &m_editorClientImpl; |
| 384 pageClients.dragClient = &m_dragClientImpl; | 385 pageClients.dragClient = &m_dragClientImpl; |
| 385 pageClients.inspectorClient = &m_inspectorClientImpl; | 386 pageClients.inspectorClient = &m_inspectorClientImpl; |
| 386 pageClients.backForwardClient = &m_backForwardClientImpl; | 387 pageClients.backForwardClient = &m_backForwardClientImpl; |
| 387 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 388 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
| 388 pageClients.storageClient = &m_storageClientImpl; | 389 pageClients.storageClient = &m_storageClientImpl; |
| 389 | 390 |
| 390 m_page = adoptPtr(new Page(pageClients)); | 391 m_page = adoptPtr(new Page(pageClients)); |
| 391 provideUserMediaTo(m_page.get(), &m_userMediaClientImpl); | 392 provideUserMediaTo(*m_page, &m_userMediaClientImpl); |
| 392 provideMIDITo(m_page.get(), m_midiClientProxy.get()); | 393 provideMIDITo(*m_page, m_midiClientProxy.get()); |
| 393 #if ENABLE(INPUT_SPEECH) | 394 #if ENABLE(INPUT_SPEECH) |
| 394 provideSpeechInputTo(m_page.get(), m_speechInputClient.get()); | 395 provideSpeechInputTo(*m_page, m_speechInputClient.get()); |
| 395 #endif | 396 #endif |
| 396 provideSpeechRecognitionTo(m_page.get(), m_speechRecognitionClient.get()); | 397 provideSpeechRecognitionTo(*m_page, m_speechRecognitionClient.get()); |
| 397 provideNotification(m_page.get(), notificationPresenterImpl()); | 398 provideNotification(*m_page, notificationPresenterImpl()); |
| 398 provideNavigatorContentUtilsTo(m_page.get(), m_navigatorContentUtilsClient.g
et()); | 399 provideNavigatorContentUtilsTo(*m_page, m_navigatorContentUtilsClient.get())
; |
| 399 | 400 |
| 400 provideContextFeaturesTo(m_page.get(), m_featureSwitchClient.get()); | 401 provideContextFeaturesTo(*m_page, m_featureSwitchClient.get()); |
| 401 if (RuntimeEnabledFeatures::deviceOrientationEnabled()) | 402 if (RuntimeEnabledFeatures::deviceOrientationEnabled()) |
| 402 DeviceOrientationInspectorAgent::provideTo(m_page.get()); | 403 DeviceOrientationInspectorAgent::provideTo(*m_page); |
| 403 provideGeolocationTo(m_page.get(), m_geolocationClientProxy.get()); | 404 provideGeolocationTo(*m_page, m_geolocationClientProxy.get()); |
| 404 m_geolocationClientProxy->setController(GeolocationController::from(m_page.g
et())); | 405 m_geolocationClientProxy->setController(GeolocationController::from(m_page.g
et())); |
| 405 | 406 |
| 406 provideLocalFileSystemTo(m_page.get(), LocalFileSystemClient::create()); | 407 provideLocalFileSystemTo(*m_page, LocalFileSystemClient::create()); |
| 407 provideDatabaseClientTo(m_page.get(), DatabaseClientImpl::create()); | 408 provideDatabaseClientTo(*m_page, DatabaseClientImpl::create()); |
| 408 InspectorIndexedDBAgent::provideTo(m_page.get()); | 409 InspectorIndexedDBAgent::provideTo(m_page.get()); |
| 409 provideStorageQuotaClientTo(m_page.get(), StorageQuotaClientImpl::create()); | 410 provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create()); |
| 410 m_validationMessage = ValidationMessageClientImpl::create(*this); | 411 m_validationMessage = ValidationMessageClientImpl::create(*this); |
| 411 m_page->setValidationMessageClient(m_validationMessage.get()); | 412 m_page->setValidationMessageClient(m_validationMessage.get()); |
| 412 provideWorkerGlobalScopeProxyProviderTo(m_page.get(), WorkerGlobalScopeProxy
ProviderImpl::create()); | 413 provideWorkerGlobalScopeProxyProviderTo(*m_page, WorkerGlobalScopeProxyProvi
derImpl::create()); |
| 413 | 414 |
| 414 m_page->setGroupType(Page::SharedPageGroup); | 415 m_page->setGroupType(Page::SharedPageGroup); |
| 415 | 416 |
| 416 if (m_client) { | 417 if (m_client) { |
| 417 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); | 418 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); |
| 418 setVisibilityState(m_client->visibilityState(), true); | 419 setVisibilityState(m_client->visibilityState(), true); |
| 419 } | 420 } |
| 420 | 421 |
| 421 m_inspectorSettingsMap = adoptPtr(new SettingsMap); | 422 m_inspectorSettingsMap = adoptPtr(new SettingsMap); |
| 422 } | 423 } |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 if (!frame) | 1401 if (!frame) |
| 1401 return false; | 1402 return false; |
| 1402 | 1403 |
| 1403 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari
ty); | 1404 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari
ty); |
| 1404 } | 1405 } |
| 1405 | 1406 |
| 1406 void WebViewImpl::popupOpened(PopupContainer* popupContainer) | 1407 void WebViewImpl::popupOpened(PopupContainer* popupContainer) |
| 1407 { | 1408 { |
| 1408 ASSERT(!m_selectPopup); | 1409 ASSERT(!m_selectPopup); |
| 1409 m_selectPopup = popupContainer; | 1410 m_selectPopup = popupContainer; |
| 1410 Document* document = mainFrameImpl()->frame()->document(); | 1411 ASSERT(mainFrameImpl()->frame()->document()); |
| 1412 Document& document = *mainFrameImpl()->frame()->document(); |
| 1411 WheelController::from(document)->didAddWheelEventHandler(document); | 1413 WheelController::from(document)->didAddWheelEventHandler(document); |
| 1412 } | 1414 } |
| 1413 | 1415 |
| 1414 void WebViewImpl::popupClosed(PopupContainer* popupContainer) | 1416 void WebViewImpl::popupClosed(PopupContainer* popupContainer) |
| 1415 { | 1417 { |
| 1416 ASSERT(m_selectPopup); | 1418 ASSERT(m_selectPopup); |
| 1417 m_selectPopup = 0; | 1419 m_selectPopup = 0; |
| 1418 Document* document = mainFrameImpl()->frame()->document(); | 1420 ASSERT(mainFrameImpl()->frame()->document()); |
| 1421 Document& document = *mainFrameImpl()->frame()->document(); |
| 1419 WheelController::from(document)->didRemoveWheelEventHandler(document); | 1422 WheelController::from(document)->didRemoveWheelEventHandler(document); |
| 1420 } | 1423 } |
| 1421 | 1424 |
| 1422 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or
iginBoundsInRootView) | 1425 PagePopup* WebViewImpl::openPagePopup(PagePopupClient* client, const IntRect& or
iginBoundsInRootView) |
| 1423 { | 1426 { |
| 1424 ASSERT(client); | 1427 ASSERT(client); |
| 1425 if (hasOpenedPopup()) | 1428 if (hasOpenedPopup()) |
| 1426 hidePopups(); | 1429 hidePopups(); |
| 1427 ASSERT(!m_pagePopup); | 1430 ASSERT(!m_pagePopup); |
| 1428 | 1431 |
| (...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4002 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4005 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4003 | 4006 |
| 4004 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4007 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4005 return false; | 4008 return false; |
| 4006 | 4009 |
| 4007 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4010 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4008 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4011 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4009 } | 4012 } |
| 4010 | 4013 |
| 4011 } // namespace blink | 4014 } // namespace blink |
| OLD | NEW |