Changeset 54883 in webkit
- Timestamp:
- Feb 17, 2010 4:00:15 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54881 r54883 1 2010-02-17 Marcus Bulach <bulach@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Implements GeolocationServices for Chromium. 6 https://bugs.webkit.org/show_bug.cgi?id=32068 7 8 This is part of implementing Geolocation framework for Chromium. Existing layout tests should pass. 9 10 * WebCore.gypi: 11 * page/Geolocation.h: 12 * platform/GeolocationService.h: 13 1 14 2010-02-17 Steve Block <steveblock@google.com> 2 15 -
trunk/WebCore/WebCore.gypi
r54820 r54883 1926 1926 'platform/chromium/FramelessScrollViewClient.h', 1927 1927 'platform/chromium/GeolocationServiceChromium.cpp', 1928 'platform/chromium/GeolocationServiceChromium.h', 1928 1929 'platform/chromium/KeyCodeConversion.h', 1929 1930 'platform/chromium/KeyCodeConversionGtk.cpp', -
trunk/WebCore/page/Geolocation.h
r54079 r54883 79 79 void setShouldClearCache(bool shouldClearCache) { m_shouldClearCache = shouldClearCache; } 80 80 bool shouldClearCache() const { return m_shouldClearCache; } 81 Frame* frame() const { return m_frame; } 81 82 82 83 #if ENABLE(CLIENT_BASED_GEOLOCATION) 83 84 void setPosition(GeolocationPosition*); 84 85 void setError(GeolocationError*); 86 #else 87 GeolocationService* getGeolocationService() const { return m_service.get(); } 85 88 #endif 86 89 -
trunk/WebCore/platform/GeolocationService.cpp
r53751 r54883 26 26 #include "config.h" 27 27 #include "GeolocationService.h" 28 29 #include "GeolocationServiceMock.h" 28 30 #include "Geoposition.h" 29 #include "GeolocationServiceMock.h"30 31 #include "PositionError.h" 31 32 33 #include <wtf/Assertions.h> 32 34 #include <wtf/CurrentTime.h> 33 #include <wtf/Assertions.h>34 35 35 36 namespace WebCore { -
trunk/WebCore/platform/GeolocationService.h
r48144 r54883 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 … … 47 47 static GeolocationService* create(GeolocationServiceClient*); 48 48 virtual ~GeolocationService() { } 49 49 50 50 virtual bool startUpdating(PositionOptions*) { return false; } 51 51 virtual void stopUpdating() { } 52 52 53 53 virtual void suspend() { } 54 54 virtual void resume() { } … … 64 64 protected: 65 65 GeolocationService(GeolocationServiceClient*); 66 GeolocationServiceClient* geolocationServiceClient() const { return m_geolocationServiceClient; } 66 67 67 68 private: -
trunk/WebCore/platform/chromium/ChromiumBridge.h
r54742 r54883 54 54 class Document; 55 55 class Frame; 56 class GeolocationServiceBridge; 57 class GeolocationServiceChromium; 56 58 class GraphicsContext; 57 59 class Image; … … 118 120 static void notifyFormStateChanged(const Document*); 119 121 122 // Geolocation -------------------------------------------------------- 123 static GeolocationServiceBridge* createGeolocationServiceBridge(GeolocationServiceChromium*); 124 120 125 // HTML5 DB ----------------------------------------------------------- 121 126 #if ENABLE(DATABASE) -
trunk/WebCore/platform/chromium/GeolocationServiceChromium.cpp
r51660 r54883 1 1 /* 2 * Copyright (c) 20 09, Google Inc. All rights reserved.2 * Copyright (c) 2010, Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "config.h" 32 #include "GeolocationService.h" 32 #include "GeolocationServiceChromium.h" 33 34 #include "ChromiumBridge.h" 33 35 34 36 namespace WebCore { 35 37 36 class GeolocationServiceChromium : public GeolocationService { 37 public: 38 GeolocationServiceChromium(GeolocationServiceClient* c)39 : GeolocationService(c)40 {41 }42 // FIXME: Implement. https://bugs.webkit.org/show_bug.cgi?id=32068 43 } ;38 GeolocationServiceChromium::GeolocationServiceChromium(GeolocationServiceClient* c) 39 : GeolocationService(c), 40 m_geolocation(reinterpret_cast<Geolocation*>(c)), 41 m_lastPosition(Geoposition::create(Coordinates::create(0.0, 0.0, false, 0.0, 0.0, false, 0.0, false, 0.0, false, 0.0), 0)), 42 m_lastError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "")), 43 m_geolocationServiceBridge(ChromiumBridge::createGeolocationServiceBridge(this)) 44 { 45 } 44 46 45 // This guard is the counterpart of the one in WebCore/platform/GeolocationService.cpp 46 #if ENABLE(GEOLOCATION) 47 static GeolocationService* createGeolocationService(GeolocationServiceClient* c) 47 void GeolocationServiceChromium::setIsAllowed(bool allowed) 48 { 49 m_geolocation->setIsAllowed(allowed); 50 } 51 52 void GeolocationServiceChromium::setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp) 53 { 54 m_lastPosition = Geoposition::create(Coordinates::create(latitude, longitude, providesAltitude, altitude, accuracy, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed), timestamp); 55 positionChanged(); 56 } 57 58 void GeolocationServiceChromium::setLastError(int errorCode, const String& message) 59 { 60 m_lastError = PositionError::create(static_cast<PositionError::ErrorCode>(errorCode), message); 61 errorOccurred(); 62 } 63 64 Frame* GeolocationServiceChromium::frame() 65 { 66 return m_geolocation->frame(); 67 } 68 69 bool GeolocationServiceChromium::startUpdating(PositionOptions* options) 70 { 71 return m_geolocationServiceBridge->startUpdating(options); 72 } 73 74 void GeolocationServiceChromium::stopUpdating() 75 { 76 return m_geolocationServiceBridge->stopUpdating(); 77 } 78 79 void GeolocationServiceChromium::suspend() 80 { 81 return m_geolocationServiceBridge->suspend(); 82 } 83 84 void GeolocationServiceChromium::resume() 85 { 86 return m_geolocationServiceBridge->resume(); 87 } 88 89 Geoposition* GeolocationServiceChromium::lastPosition() const 90 { 91 return m_lastPosition.get(); 92 } 93 94 PositionError* GeolocationServiceChromium::lastError() const 95 { 96 return m_lastError.get(); 97 } 98 99 static GeolocationService* createGeolocationServiceChromium(GeolocationServiceClient* c) 48 100 { 49 101 return new GeolocationServiceChromium(c); 50 102 } 51 103 52 GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &createGeolocationService; 53 #endif 104 // Sets up the factory function for GeolocationService. 105 GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &createGeolocationServiceChromium; 54 106 55 107 } // namespace WebCore -
trunk/WebKit/chromium/WebKit.gyp
r54742 r54883 69 69 ], 70 70 'sources': [ 71 'public/GeolocationServiceBridgeChromium.h', 71 72 'public/gtk/WebInputEventFactory.h', 72 73 'public/linux/WebFontRendering.h', … … 233 234 'src/FrameLoaderClientImpl.cpp', 234 235 'src/FrameLoaderClientImpl.h', 236 'src/GeolocationServiceBridgeChromium.cpp', 235 237 'src/gtk/WebFontInfo.cpp', 236 238 'src/gtk/WebFontInfo.h', -
trunk/WebKit/chromium/public/WebViewClient.h
r54584 r54883 47 47 class WebFileChooserCompletion; 48 48 class WebFrame; 49 class WebGeolocationServiceInterface; 49 50 class WebNode; 50 51 class WebNotificationPresenter; … … 278 279 const WebString& value) { } 279 280 281 // Geolocation --------------------------------------------------------- 282 283 // Access the embedder API for geolocation services. 284 virtual WebKit::WebGeolocationServiceInterface* getGeolocationService() { return 0; } 285 280 286 protected: 281 287 ~WebViewClient() { } -
trunk/WebKit/chromium/src/ChromeClientImpl.cpp
r54584 r54883 44 44 #include "FrameLoadRequest.h" 45 45 #include "FrameView.h" 46 #include "Geolocation.h" 47 #include "GeolocationService.h" 48 #include "GeolocationServiceBridgeChromium.h" 49 #include "GeolocationServiceChromium.h" 46 50 #include "HitTestResult.h" 47 51 #include "IntRect.h" … … 675 679 #endif 676 680 681 void ChromeClientImpl::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation) 682 { 683 GeolocationServiceChromium* geolocationService = reinterpret_cast<GeolocationServiceChromium*>(geolocation->getGeolocationService()); 684 m_webView->client()->getGeolocationService()->requestPermissionForFrame(geolocationService->geolocationServiceBridge()->getBridgeId(), frame->document()->url()); 685 } 686 677 687 } // namespace WebKit -
trunk/WebKit/chromium/src/ChromeClientImpl.h
r54584 r54883 122 122 virtual WebCore::NotificationPresenter* notificationPresenter() const; 123 123 #endif 124 virtual void requestGeolocationPermissionForFrame( 125 WebCore::Frame*, WebCore::Geolocation*) { } 124 virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*); 126 125 virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); 127 126 virtual bool setCursor(WebCore::PlatformCursorHandle) { return false; } -
trunk/WebKit/chromium/src/ChromiumBridge.cpp
r54742 r54883 75 75 #include "Cookie.h" 76 76 #include "FrameView.h" 77 #include "GeolocationServiceBridgeChromium.h" 77 78 #include "GraphicsContext.h" 78 79 #include "KURL.h" … … 358 359 #endif 359 360 361 // Geolocation ---------------------------------------------------------------- 362 363 GeolocationServiceBridge* ChromiumBridge::createGeolocationServiceBridge(GeolocationServiceChromium* geolocationServiceChromium) 364 { 365 return createGeolocationServiceBridgeImpl(geolocationServiceChromium); 366 } 367 360 368 // HTML5 DB ------------------------------------------------------------------- 361 369
Note: See TracChangeset
for help on using the changeset viewer.