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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) | 298 void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) |
299 { | 299 { |
300 if (devToolsClient) | 300 if (devToolsClient) |
301 m_devToolsAgent = adoptPtr(new WebDevToolsAgentImpl(this, devToolsClient
)); | 301 m_devToolsAgent = adoptPtr(new WebDevToolsAgentImpl(this, devToolsClient
)); |
302 else | 302 else |
303 m_devToolsAgent.clear(); | 303 m_devToolsAgent.clear(); |
304 } | 304 } |
305 | 305 |
306 void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) | 306 void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) |
307 { | 307 { |
308 providePrerendererClientTo(m_page.get(), new PrerendererClientImpl(prerender
erClient)); | 308 ASSERT(m_page); |
| 309 providePrerendererClientTo(*m_page, new PrerendererClientImpl(prerendererCli
ent)); |
309 } | 310 } |
310 | 311 |
311 void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) | 312 void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) |
312 { | 313 { |
313 m_spellCheckClient = spellCheckClient; | 314 m_spellCheckClient = spellCheckClient; |
314 } | 315 } |
315 | 316 |
316 void WebViewImpl::setPasswordGeneratorClient(WebPasswordGeneratorClient* client) | 317 void WebViewImpl::setPasswordGeneratorClient(WebPasswordGeneratorClient* client) |
317 { | 318 { |
318 m_passwordGeneratorClient = client; | 319 m_passwordGeneratorClient = client; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 pageClients.chromeClient = &m_chromeClientImpl; | 388 pageClients.chromeClient = &m_chromeClientImpl; |
388 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 389 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
389 pageClients.editorClient = &m_editorClientImpl; | 390 pageClients.editorClient = &m_editorClientImpl; |
390 pageClients.dragClient = &m_dragClientImpl; | 391 pageClients.dragClient = &m_dragClientImpl; |
391 pageClients.inspectorClient = &m_inspectorClientImpl; | 392 pageClients.inspectorClient = &m_inspectorClientImpl; |
392 pageClients.backForwardClient = &m_backForwardClientImpl; | 393 pageClients.backForwardClient = &m_backForwardClientImpl; |
393 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 394 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
394 pageClients.storageClient = &m_storageClientImpl; | 395 pageClients.storageClient = &m_storageClientImpl; |
395 | 396 |
396 m_page = adoptPtr(new Page(pageClients)); | 397 m_page = adoptPtr(new Page(pageClients)); |
397 provideUserMediaTo(m_page.get(), &m_userMediaClientImpl); | 398 provideUserMediaTo(*m_page, &m_userMediaClientImpl); |
398 provideMIDITo(m_page.get(), m_midiClientProxy.get()); | 399 provideMIDITo(*m_page, m_midiClientProxy.get()); |
399 #if ENABLE(INPUT_SPEECH) | 400 #if ENABLE(INPUT_SPEECH) |
400 provideSpeechInputTo(m_page.get(), m_speechInputClient.get()); | 401 provideSpeechInputTo(*m_page, m_speechInputClient.get()); |
401 #endif | 402 #endif |
402 provideSpeechRecognitionTo(m_page.get(), m_speechRecognitionClient.get()); | 403 provideSpeechRecognitionTo(*m_page, m_speechRecognitionClient.get()); |
403 provideNotification(m_page.get(), notificationPresenterImpl()); | 404 provideNotification(*m_page, notificationPresenterImpl()); |
404 provideNavigatorContentUtilsTo(m_page.get(), m_navigatorContentUtilsClient.g
et()); | 405 provideNavigatorContentUtilsTo(*m_page, m_navigatorContentUtilsClient.get())
; |
405 | 406 |
406 provideContextFeaturesTo(m_page.get(), m_featureSwitchClient.get()); | 407 provideContextFeaturesTo(*m_page, m_featureSwitchClient.get()); |
407 if (RuntimeEnabledFeatures::deviceOrientationEnabled()) | 408 if (RuntimeEnabledFeatures::deviceOrientationEnabled()) |
408 DeviceOrientationInspectorAgent::provideTo(m_page.get()); | 409 DeviceOrientationInspectorAgent::provideTo(*m_page); |
409 provideGeolocationTo(m_page.get(), m_geolocationClientProxy.get()); | 410 provideGeolocationTo(*m_page, m_geolocationClientProxy.get()); |
410 m_geolocationClientProxy->setController(GeolocationController::from(m_page.g
et())); | 411 m_geolocationClientProxy->setController(GeolocationController::from(m_page.g
et())); |
411 | 412 |
412 provideLocalFileSystemTo(m_page.get(), LocalFileSystemClient::create()); | 413 provideLocalFileSystemTo(*m_page, LocalFileSystemClient::create()); |
413 provideDatabaseClientTo(m_page.get(), DatabaseClientImpl::create()); | 414 provideDatabaseClientTo(*m_page, DatabaseClientImpl::create()); |
414 InspectorIndexedDBAgent::provideTo(m_page.get()); | 415 InspectorIndexedDBAgent::provideTo(m_page.get()); |
415 provideStorageQuotaClientTo(m_page.get(), StorageQuotaClientImpl::create()); | 416 provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create()); |
416 m_validationMessage = ValidationMessageClientImpl::create(*this); | 417 m_validationMessage = ValidationMessageClientImpl::create(*this); |
417 m_page->setValidationMessageClient(m_validationMessage.get()); | 418 m_page->setValidationMessageClient(m_validationMessage.get()); |
418 provideWorkerGlobalScopeProxyProviderTo(m_page.get(), WorkerGlobalScopeProxy
ProviderImpl::create()); | 419 provideWorkerGlobalScopeProxyProviderTo(*m_page, WorkerGlobalScopeProxyProvi
derImpl::create()); |
419 | 420 |
420 m_page->setGroupType(Page::SharedPageGroup); | 421 m_page->setGroupType(Page::SharedPageGroup); |
421 | 422 |
422 if (m_client) { | 423 if (m_client) { |
423 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); | 424 setDeviceScaleFactor(m_client->screenInfo().deviceScaleFactor); |
424 setVisibilityState(m_client->visibilityState(), true); | 425 setVisibilityState(m_client->visibilityState(), true); |
425 } | 426 } |
426 | 427 |
427 m_inspectorSettingsMap = adoptPtr(new SettingsMap); | 428 m_inspectorSettingsMap = adoptPtr(new SettingsMap); |
428 } | 429 } |
(...skipping 971 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 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3990 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3993 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
3991 | 3994 |
3992 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3995 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
3993 return false; | 3996 return false; |
3994 | 3997 |
3995 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 3998 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
3996 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 3999 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
3997 } | 4000 } |
3998 | 4001 |
3999 } // namespace blink | 4002 } // namespace blink |
OLD | NEW |