Changeset 112553 in webkit
- Timestamp:
- Mar 29, 2012 11:32:32 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112551 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation now uses the Supplement interface instead of 9 keeping an instance variable on Page. This allows us to 10 remove all geolocation-related functions, variables, and 11 ifdefs out of Page and into Modules/geolocation/. 12 13 * Modules/geolocation/Geolocation.cpp: 14 (WebCore::Geolocation::stop): 15 (WebCore::Geolocation::lastPosition): 16 (WebCore::Geolocation::requestPermission): 17 (WebCore::Geolocation::startUpdating): 18 (WebCore::Geolocation::stopUpdating): 19 * Modules/geolocation/Geolocation.h: 20 (WebCore): 21 * Modules/geolocation/GeolocationController.cpp: 22 (WebCore::GeolocationController::supplementName): 23 (WebCore): 24 (WebCore::provideGeolocationTo): 25 * Modules/geolocation/GeolocationController.h: 26 (GeolocationController): 27 (WebCore::GeolocationController::from): 28 * WebCore.exp.in: 29 * page/GeolocationClient.h: 30 (WebCore): 31 (GeolocationClient): 32 * page/Page.cpp: 33 (WebCore::Page::Page): 34 (WebCore::Page::PageClients::PageClients): 35 * page/Page.h: 36 (WebCore): 37 (PageClients): 38 (Page): 39 1 40 2012-03-29 John Bates <jbates@google.com> 2 41 -
trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp
r112347 r112553 276 276 Page* page = this->page(); 277 277 if (page && m_allowGeolocation == InProgress) 278 page->geolocationController()->cancelPermissionRequest(this);278 GeolocationController::from(page)->cancelPermissionRequest(this); 279 279 // The frame may be moving to a new page and we want to get the permissions from the new page's client. 280 280 m_allowGeolocation = Unknown; … … 292 292 return 0; 293 293 294 m_lastPosition = createGeoposition( page->geolocationController()->lastPosition());294 m_lastPosition = createGeoposition(GeolocationController::from(page)->lastPosition()); 295 295 296 296 return m_lastPosition.get(); … … 615 615 616 616 // Ask the embedder: it maintains the geolocation challenge policy itself. 617 page->geolocationController()->requestPermission(this);617 GeolocationController::from(page)->requestPermission(this); 618 618 } 619 619 … … 677 677 return false; 678 678 679 page->geolocationController()->addObserver(this, notifier->options()->enableHighAccuracy());679 GeolocationController::from(page)->addObserver(this, notifier->options()->enableHighAccuracy()); 680 680 return true; 681 681 } … … 687 687 return; 688 688 689 page->geolocationController()->removeObserver(this);689 GeolocationController::from(page)->removeObserver(this); 690 690 } 691 691 -
trunk/Source/WebCore/Modules/geolocation/Geolocation.h
r112347 r112553 42 42 class Document; 43 43 class Frame; 44 class GeolocationController; 45 class GeolocationError; 44 46 class GeolocationPosition; 45 class GeolocationError;46 47 class Page; 47 48 class ScriptExecutionContext; -
trunk/Source/WebCore/Modules/geolocation/GeolocationController.cpp
r110595 r112553 126 126 } 127 127 128 const AtomicString& GeolocationController::supplementName() 129 { 130 DEFINE_STATIC_LOCAL(AtomicString, name, ("GeolocationController")); 131 return name; 132 } 133 134 void provideGeolocationTo(Page* page, GeolocationClient* client) 135 { 136 Supplement<Page>::provideTo(page, GeolocationController::supplementName(), GeolocationController::create(page, client)); 137 } 138 128 139 } // namespace WebCore 129 140 -
trunk/Source/WebCore/Modules/geolocation/GeolocationController.h
r110595 r112553 30 30 31 31 #include "Geolocation.h" 32 #include "Page.h" 32 33 #include <wtf/HashSet.h> 33 34 #include <wtf/Noncopyable.h> … … 41 42 class Page; 42 43 43 class GeolocationController {44 class GeolocationController : public Supplement<Page> { 44 45 WTF_MAKE_NONCOPYABLE(GeolocationController); 45 46 public: … … 61 62 GeolocationClient* client() { return m_client; } 62 63 64 static const AtomicString& supplementName(); 65 static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); } 66 63 67 private: 64 68 GeolocationController(Page*, GeolocationClient*); -
trunk/Source/WebCore/WebCore.exp.in
r112055 r112553 1722 1722 __ZN7WebCore11GeolocationD1Ev 1723 1723 __ZNK7WebCore11Geolocation5frameEv 1724 __ZN7WebCore20provideGeolocationToEPNS_4PageEPNS_17GeolocationClientE 1724 1725 __ZN7WebCore21GeolocationClientMock13setPermissionEb 1725 1726 __ZN7WebCore21GeolocationController13errorOccurredEPNS_16GeolocationErrorE 1727 __ZN7WebCore21GeolocationController14supplementNameEv 1726 1728 __ZN7WebCore21GeolocationController15positionChangedEPNS_19GeolocationPositionE 1729 __ZN7WebCore21GeolocationController4fromEPNS_4PageE 1727 1730 #endif 1728 1731 -
trunk/Source/WebCore/page/GeolocationClient.h
r95901 r112553 31 31 class Geolocation; 32 32 class GeolocationPosition; 33 class Page; 33 34 34 35 class GeolocationClient { … … 48 49 virtual void cancelPermissionRequest(Geolocation*) = 0; 49 50 51 void provideGeolocationTo(Page*, GeolocationClient*); 52 50 53 protected: 51 54 virtual ~GeolocationClient() { } 52 55 }; 53 56 57 void provideGeolocationTo(Page*, GeolocationClient*); 58 54 59 } // namespace WebCore 55 60 -
trunk/Source/WebCore/page/Page.cpp
r112178 r112553 44 44 #include "FrameTree.h" 45 45 #include "FrameView.h" 46 #include "GeolocationController.h"47 46 #include "HTMLElement.h" 48 47 #include "HistoryItem.h" … … 123 122 , m_inspectorController(InspectorController::create(this, pageClients.inspectorClient)) 124 123 #endif 125 #if ENABLE(GEOLOCATION)126 , m_geolocationController(GeolocationController::create(this, pageClients.geolocationClient))127 #endif128 124 #if ENABLE(POINTER_LOCK) 129 125 , m_pointerLockController(PointerLockController::create(this)) … … 1121 1117 , dragClient(0) 1122 1118 , inspectorClient(0) 1123 , geolocationClient(0)1124 1119 { 1125 1120 } -
trunk/Source/WebCore/page/Page.h
r112178 r112553 64 64 class Frame; 65 65 class FrameSelection; 66 class GeolocationClient;67 class GeolocationController;68 66 class HaltablePlugin; 69 67 class HistoryItem; … … 109 107 DragClient* dragClient; 110 108 InspectorClient* inspectorClient; 111 GeolocationClient* geolocationClient;112 109 RefPtr<BackForwardList> backForwardClient; 113 110 }; … … 167 164 #if ENABLE(INSPECTOR) 168 165 InspectorController* inspectorController() const { return m_inspectorController.get(); } 169 #endif170 #if ENABLE(GEOLOCATION)171 GeolocationController* geolocationController() const { return m_geolocationController.get(); }172 166 #endif 173 167 #if ENABLE(POINTER_LOCK) … … 363 357 OwnPtr<InspectorController> m_inspectorController; 364 358 #endif 365 #if ENABLE(GEOLOCATION)366 OwnPtr<GeolocationController> m_geolocationController;367 #endif368 359 #if ENABLE(POINTER_LOCK) 369 360 OwnPtr<PointerLockController> m_pointerLockController; -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r112385 r112553 326 326 , m_pluginMouseButtonPressed(false) 327 327 , m_pluginMayOpenNewTab(false) 328 , m_geolocationClient(0)329 328 , m_inRegionScrollStartingNode(0) 330 329 #if USE(ACCELERATED_COMPOSITING) … … 429 428 pageClients.inspectorClient = inspectorClient; 430 429 431 // Note the object will be destroyed when the page is destroyed.430 m_page = new Page(pageClients); 432 431 #if ENABLE_DRT 433 if (getenv("drtRun")) 434 pageClients.geolocationClient = new GeolocationClientMock(); 435 else 436 #endif 437 pageClients.geolocationClient = m_geolocationClient = new GeolocationControllerClientBlackBerry(this); 432 if (getenv("drtRun")) { 433 // In case running in DumpRenderTree mode set the controller to mock provider. 434 GeolocationClientMock* mock = new GeolocationClientMock(); 435 WebCore::provideGeolocationTo(m_page, mock); 436 mock->setController(WebCore::GeolocationController::from(m_page)); 437 } else 438 438 #else 439 pageClients.geolocationClient = m_geolocationClient; 440 441 m_page = new Page(pageClients); 439 WebCore::provideGeolocationTo(m_page, new GeolocationControllerClientBlackBerry(this)); 440 #endif 442 441 WebCore::provideDeviceOrientationTo(m_page, new DeviceOrientationClientBlackBerry(this)); 443 442 WebCore::provideDeviceMotionTo(m_page, new DeviceMotionClientBlackBerry(this)); … … 445 444 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 446 445 WebCore::provideNotification(m_page, NotificationPresenterImpl::instance()); 447 #endif448 449 #if ENABLE_DRT450 // In case running in DumpRenderTree mode set the controller to mock provider.451 if (getenv("drtRun"))452 static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(m_page->geolocationController());453 446 #endif 454 447 -
trunk/Source/WebKit/blackberry/ChangeLog
r112474 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * Api/WebPage.cpp: 13 (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): 14 (BlackBerry::WebKit::WebPagePrivate::init): 15 * WebCoreSupport/GeolocationControllerClientBlackBerry.cpp: 16 (GeolocationControllerClientBlackBerry::onLocationUpdate): 17 (GeolocationControllerClientBlackBerry::onLocationError): 18 * WebKitSupport/DumpRenderTreeSupport.cpp: 19 (DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests): 20 (DumpRenderTreeSupport::resetGeolocationMock): 21 (DumpRenderTreeSupport::setMockGeolocationError): 22 (DumpRenderTreeSupport::setMockGeolocationPermission): 23 (DumpRenderTreeSupport::setMockGeolocationPosition): 24 1 25 2012-03-28 Nate Chapin <japhet@chromium.org> 2 26 -
trunk/Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp
r111050 r112553 83 83 m_lastPosition = GeolocationPosition::create(timestamp, latitude, longitude, accuracy, altitudeValid, altitude, altitudeAccuracyValid, 84 84 altitudeAccuracy, headingValid, heading, speedValid, speed); 85 m_webPagePrivate->m_page->geolocationController()->positionChanged(m_lastPosition.get());85 GeolocationController::from(m_webPagePrivate->m_page)->positionChanged(m_lastPosition.get()); 86 86 } 87 87 … … 89 89 { 90 90 RefPtr<GeolocationError> error = GeolocationError::create(GeolocationError::PositionUnavailable, String::fromUTF8(errorStr)); 91 m_webPagePrivate->m_page->geolocationController()->errorOccurred(error.get());91 GeolocationController::from(m_webPagePrivate->m_page)->errorOccurred(error.get()); 92 92 } 93 93 -
trunk/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
r111087 r112553 97 97 int DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(WebPage* webPage) 98 98 { 99 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage(webPage)->geolocationController()->client());99 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController(corePage(webPage))->client()); 100 100 return mockClient->numberOfPendingPermissionRequests(); 101 101 } … … 103 103 void DumpRenderTreeSupport::resetGeolocationMock(WebPage* webPage) 104 104 { 105 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage(webPage)->geolocationController()->client());105 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); 106 106 mockClient->reset(); 107 107 } … … 119 119 } 120 120 121 GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>( corePage(webPage)->geolocationController()->client());121 GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage(webPage))->client()); 122 122 mockClient->setError(GeolocationError::create(code, message)); 123 123 } … … 125 125 void DumpRenderTreeSupport::setMockGeolocationPermission(WebPage* webPage, bool allowed) 126 126 { 127 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage(webPage)->geolocationController()->client());127 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); 128 128 mockClient->setPermission(allowed); 129 129 } … … 131 131 void DumpRenderTreeSupport::setMockGeolocationPosition(WebPage* webPage, double latitude, double longitude, double accuracy) 132 132 { 133 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage(webPage)->geolocationController()->client());133 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); 134 134 mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy)); 135 135 } -
trunk/Source/WebKit/chromium/ChangeLog
r112550 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * src/WebViewImpl.cpp: 13 (WebKit::WebViewImpl::WebViewImpl): 14 1 15 2012-03-29 Dana Jansens <danakj@chromium.org> 2 16 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r112417 r112553 64 64 #include "FrameView.h" 65 65 #include "GeolocationClientProxy.h" 66 #include "GeolocationController.h" 66 67 #include "GraphicsContext.h" 67 68 #include "GraphicsContext3D.h" … … 386 387 pageClients.dragClient = &m_dragClientImpl; 387 388 pageClients.inspectorClient = &m_inspectorClientImpl; 388 pageClients.geolocationClient = m_geolocationClientProxy.get();389 389 pageClients.backForwardClient = BackForwardListChromium::create(this); 390 390 … … 404 404 405 405 provideDeviceOrientationTo(m_page.get(), m_deviceOrientationClientProxy.get()); 406 m_geolocationClientProxy->setController(m_page->geolocationController()); 407 406 provideGeolocationTo(m_page.get(), m_geolocationClientProxy.get()); 407 m_geolocationClientProxy->setController(GeolocationController::from(m_page.get())); 408 408 409 m_page->setGroupName(pageGroupName); 409 410 -
trunk/Source/WebKit/gtk/ChangeLog
r112474 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: 13 (DumpRenderTreeSupportGtk::resetGeolocationClientMock): 14 (DumpRenderTreeSupportGtk::setMockGeolocationPermission): 15 (DumpRenderTreeSupportGtk::setMockGeolocationPosition): 16 (DumpRenderTreeSupportGtk::setMockGeolocationError): 17 (DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests): 18 * WebCoreSupport/GeolocationClientGtk.cpp: 19 (WebKit::GeolocationClient::updatePosition): 20 (WebKit::GeolocationClient::errorOccured): 21 * webkit/webkitwebview.cpp: 22 (webkit_web_view_init): 23 1 24 2012-03-28 Nate Chapin <japhet@chromium.org> 2 25 -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r111405 r112553 795 795 { 796 796 #if ENABLE(GEOLOCATION) 797 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>( core(webView)->geolocationController()->client());797 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client()); 798 798 mock->reset(); 799 799 #endif … … 803 803 { 804 804 #if ENABLE(GEOLOCATION) 805 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>( core(webView)->geolocationController()->client());805 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client()); 806 806 mock->setPermission(allowed); 807 807 #endif … … 811 811 { 812 812 #if ENABLE(GEOLOCATION) 813 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>( core(webView)->geolocationController()->client());813 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client()); 814 814 815 815 double timestamp = g_get_real_time() / 1000000.0; … … 821 821 { 822 822 #if ENABLE(GEOLOCATION) 823 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>( core(webView)->geolocationController()->client());823 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client()); 824 824 825 825 GeolocationError::ErrorCode code; … … 841 841 { 842 842 #if ENABLE(GEOLOCATION) 843 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>( core(webView)->geolocationController()->client());843 GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client()); 844 844 return mock->numberOfPendingPermissionRequests(); 845 845 #endif -
trunk/Source/WebKit/gtk/WebCoreSupport/GeolocationClientGtk.cpp
r110595 r112553 176 176 m_lastPosition = WebCore::GeolocationPosition::create(static_cast<double>(m_timestamp), m_latitude, m_longitude, m_accuracy, 177 177 true, m_altitude, true, m_altitudeAccuracy, false, 0, false, 0); 178 core(m_webView)->geolocationController()->positionChanged(m_lastPosition.get());178 WebCore::GeolocationController::from(core(m_webView))->positionChanged(m_lastPosition.get()); 179 179 } 180 180 … … 182 182 { 183 183 RefPtr<WebCore::GeolocationError> error = WebCore::GeolocationError::create(WebCore::GeolocationError::PositionUnavailable, message); 184 core(m_webView)->geolocationController()->errorOccurred(error.get());184 WebCore::GeolocationController::from(core(m_webView))->errorOccurred(error.get()); 185 185 } 186 186 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r112111 r112553 60 60 #include "FrameLoaderTypes.h" 61 61 #include "FrameView.h" 62 #include "GOwnPtrGtk.h" 62 63 #include "GeolocationClientGtk.h" 63 64 #include "GeolocationClientMock.h" 64 #include "G OwnPtrGtk.h"65 #include "GeolocationController.h" 65 66 #include "GraphicsContext.h" 66 67 #include "GtkUtilities.h" … … 3568 3569 pageClients.dragClient = new WebKit::DragClient(webView); 3569 3570 pageClients.inspectorClient = new WebKit::InspectorClient(webView); 3571 3572 priv->corePage = new Page(pageClients); 3573 3570 3574 #if ENABLE(GEOLOCATION) 3571 if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) 3572 pageClients.geolocationClient = new GeolocationClientMock; 3573 else 3574 pageClients.geolocationClient = new WebKit::GeolocationClient(webView); 3575 if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) { 3576 GeolocationClientMock* mock = new GeolocationClientMock; 3577 WebCore::provideGeolocationTo(priv->corePage, mock); 3578 mock->setController(GeolocationController::from(priv->corePage)); 3579 } else 3580 WebCore::provideGeolocationTo(priv->corePage, new WebKit::GeolocationClient(webView)); 3575 3581 #endif 3576 3577 priv->corePage = new Page(pageClients);3578 3579 3582 #if ENABLE(DEVICE_ORIENTATION) 3580 3583 WebCore::provideDeviceMotionTo(priv->corePage, new DeviceMotionClientGtk); … … 3587 3590 3588 3591 if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) { 3589 #if ENABLE(GEOLOCATION)3590 static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController());3591 #endif3592 3592 // Set some testing-specific settings 3593 3593 priv->corePage->settings()->setInteractiveFormValidationEnabled(true); -
trunk/Source/WebKit/mac/ChangeLog
r112474 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * WebView/WebView.mm: 13 (-[WebView _commonInitializationWithFrameName:groupName:]): 14 (-[WebView _geolocationDidChangePosition:]): 15 (-[WebView _geolocationDidFailWithError:]): 16 1 17 2012-03-28 Nate Chapin <japhet@chromium.org> 2 18 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r111268 r112553 737 737 pageClients.dragClient = new WebDragClient(self); 738 738 pageClients.inspectorClient = new WebInspectorClient(self); 739 _private->page = new Page(pageClients); 739 740 #if ENABLE(GEOLOCATION) 740 pageClients.geolocationClient = new WebGeolocationClient(self); 741 #endif 742 _private->page = new Page(pageClients); 741 WebCore::provideGeolocationTo(_private->page, new WebGeolocationClient(self)); 742 #endif 743 743 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 744 744 WebCore::provideNotification(_private->page, new WebNotificationClient(self)); … … 6383 6383 #if ENABLE(GEOLOCATION) 6384 6384 if (_private && _private->page) 6385 _private->page->geolocationController()->positionChanged(core(position));6385 WebCore::GeolocationController::from(_private->page)->positionChanged(core(position)); 6386 6386 #endif // ENABLE(GEOLOCATION) 6387 6387 } … … 6392 6392 if (_private && _private->page) { 6393 6393 RefPtr<GeolocationError> geolocatioError = GeolocationError::create(GeolocationError::PositionUnavailable, [error localizedDescription]); 6394 _private->page->geolocationController()->errorOccurred(geolocatioError.get());6394 WebCore::GeolocationController::from(_private->page)->errorOccurred(geolocatioError.get()); 6395 6395 } 6396 6396 #endif // ENABLE(GEOLOCATION) -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r111002 r112553 68 68 #include "GeolocationClientMock.h" 69 69 #include "GeolocationClientQt.h" 70 #include "GeolocationController.h" 70 71 #endif 71 72 #include "GeolocationPermissionClientQt.h" … … 327 328 pageClients.dragClient = new DragClientQt(q); 328 329 pageClients.inspectorClient = new InspectorClientQt(q); 330 page = new Page(pageClients); 329 331 #if ENABLE(GEOLOCATION) 330 if (useMock) 331 pageClients.geolocationClient = new GeolocationClientMock; 332 else 333 pageClients.geolocationClient = new GeolocationClientQt(q); 334 #endif 335 page = new Page(pageClients); 332 if (useMock) { 333 // In case running in DumpRenderTree mode set the controller to mock provider. 334 GeolocationClientMock* mock = new GeolocationClientMock; 335 WebCore::provideGeolocationTo(page, mock); 336 mock->setController(WebCore::GeolocationController::from(page)); 337 } else 338 WebCore::provideGeolocationTo(page, new GeolocationClientQt(q)); 339 #endif 336 340 #if ENABLE(DEVICE_ORIENTATION) 337 341 if (useMock) … … 352 356 page->setGroupName("Default Group"); 353 357 354 // In case running in DumpRenderTree mode set the controller to mock provider.355 #if ENABLE(GEOLOCATION)356 if (QWebPagePrivate::drtRun)357 static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(page->geolocationController());358 #endif359 358 settings = new QWebSettings(page->settings()); 360 359 -
trunk/Source/WebKit/qt/ChangeLog
r112474 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * Api/qwebpage.cpp: 13 (QWebPagePrivate::QWebPagePrivate): 14 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 15 (DumpRenderTreeSupportQt::resetGeolocationMock): 16 (DumpRenderTreeSupportQt::setMockGeolocationPermission): 17 (DumpRenderTreeSupportQt::setMockGeolocationPosition): 18 (DumpRenderTreeSupportQt::setMockGeolocationError): 19 (DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests): 20 * WebCoreSupport/GeolocationClientQt.cpp: 21 (WebCore::GeolocationClientQt::positionUpdated): 22 (WebCore::GeolocationClientQt::startUpdating): 23 1 24 2012-03-28 Nate Chapin <japhet@chromium.org> 2 25 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r110784 r112553 841 841 #if ENABLE(GEOLOCATION) 842 842 Page* corePage = QWebPagePrivate::core(page); 843 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage->geolocationController()->client());843 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client()); 844 844 mockClient->reset(); 845 845 #endif … … 850 850 #if ENABLE(GEOLOCATION) 851 851 Page* corePage = QWebPagePrivate::core(page); 852 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage->geolocationController()->client());852 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client()); 853 853 mockClient->setPermission(allowed); 854 854 #endif … … 859 859 #if ENABLE(GEOLOCATION) 860 860 Page* corePage = QWebPagePrivate::core(page); 861 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage->geolocationController()->client());861 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client()); 862 862 mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy)); 863 863 #endif … … 879 879 } 880 880 881 GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>( corePage->geolocationController()->client());881 GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage)->client()); 882 882 mockClient->setError(GeolocationError::create(code, message)); 883 883 #endif … … 888 888 #if ENABLE(GEOLOCATION) 889 889 Page* corePage = QWebPagePrivate::core(page); 890 GeolocationClientMock* mockClient = toGeolocationClientMock( corePage->geolocationController()->client());890 GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client()); 891 891 return mockClient->numberOfPendingPermissionRequests(); 892 892 #else -
trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
r97409 r112553 95 95 96 96 WebCore::Page* page = QWebPagePrivate::core(m_page); 97 page->geolocationController()->positionChanged(m_lastPosition.get());97 GeolocationController::from(page)->positionChanged(m_lastPosition.get()); 98 98 } 99 99 … … 106 106 WebCore::Page* page = QWebPagePrivate::core(m_page); 107 107 RefPtr<WebCore::GeolocationError> error = GeolocationError::create(GeolocationError::PositionUnavailable, failedToStartServiceErrorMessage); 108 page->geolocationController()->errorOccurred(error.get());108 GeolocationController::from(page)->errorOccurred(error.get()); 109 109 return; 110 110 } -
trunk/Source/WebKit/win/ChangeLog
r112474 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * WebView.cpp: 13 (WebView::initWithFrame): 14 (WebView::geolocationDidChangePosition): 15 (WebView::geolocationDidFailWithError): 16 1 17 2012-03-28 Nate Chapin <japhet@chromium.org> 2 18 -
trunk/Source/WebKit/win/WebView.cpp
r110595 r112553 2667 2667 pageClients.dragClient = new WebDragClient(this); 2668 2668 pageClients.inspectorClient = m_inspectorClient; 2669 pageClients.geolocationClient = new WebGeolocationClient(this);2670 2669 m_page = new Page(pageClients); 2670 provideGeolocationTo(m_page, new WebGeolocationClient(this)); 2671 2671 2672 2672 BSTR localStoragePath; … … 6567 6567 if (!m_page) 6568 6568 return E_FAIL; 6569 m_page->geolocationController()->positionChanged(core(position));6569 GeolocationController::from(m_page)->positionChanged(core(position)); 6570 6570 return S_OK; 6571 6571 } … … 6585 6585 6586 6586 RefPtr<GeolocationError> geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, descriptionString); 6587 m_page->geolocationController()->errorOccurred(geolocationError.get());6587 GeolocationController::from(m_page)->errorOccurred(geolocationError.get()); 6588 6588 return S_OK; 6589 6589 } -
trunk/Source/WebKit2/ChangeLog
r112491 r112553 1 2012-03-29 Mark Pilgrim <pilgrim@chromium.org> 2 3 GEOLOCATION should be implemented as Page Supplement 4 https://bugs.webkit.org/show_bug.cgi?id=82228 5 6 Reviewed by Adam Barth. 7 8 Geolocation is now a Supplement in Page so the interface 9 has changed for setting up the page's geolocation client 10 initially and accessing the controller later. 11 12 * WebProcess/Geolocation/WebGeolocationManager.cpp: 13 (WebKit::WebGeolocationManager::didChangePosition): 14 (WebKit::WebGeolocationManager::didFailToDeterminePosition): 15 * WebProcess/InjectedBundle/InjectedBundle.cpp: 16 (WebKit::InjectedBundle::setGeoLocationPermission): 17 * WebProcess/WebPage/WebPage.cpp: 18 (WebKit::WebPage::WebPage): 19 1 20 2012-03-28 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp
r110595 r112553 82 82 WebPage* page = *it; 83 83 if (page->corePage()) 84 page->corePage()->geolocationController()->positionChanged(position.get());84 GeolocationController::from(page->corePage())->positionChanged(position.get()); 85 85 } 86 86 #endif // ENABLE(GEOLOCATION) … … 98 98 WebPage* page = *it; 99 99 if (page->corePage()) 100 page->corePage()->geolocationController()->errorOccurred(error.get());100 GeolocationController::from(page->corePage())->errorOccurred(error.get()); 101 101 } 102 102 #endif // ENABLE(GEOLOCATION) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r110595 r112553 199 199 const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages(); 200 200 for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter) 201 static_cast<GeolocationClientMock*>( (*iter)->geolocationController()->client())->setPermission(enabled);201 static_cast<GeolocationClientMock*>(GeolocationController::from(*iter)->client())->setPermission(enabled); 202 202 #endif // ENABLE(GEOLOCATION) 203 203 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r112338 r112553 233 233 pageClients.backForwardClient = WebBackForwardListProxy::create(this); 234 234 #if ENABLE(GEOLOCATION) 235 pageClients.geolocationClient = new WebGeolocationClient(this);235 WebCore::provideGeolocationTo(m_page.get(), new WebGeolocationClient(this)); 236 236 #endif 237 237 #if ENABLE(INSPECTOR)
Note: See TracChangeset
for help on using the changeset viewer.