summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp')
-rw-r--r--WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
index 07f09da..265ef4f 100644
--- a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
+++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp
@@ -73,6 +73,7 @@ public:
virtual void suspend();
virtual void resume();
virtual int getBridgeId() const;
+ virtual void attachBridgeIfNeeded();
// WebGeolocationServiceBridge
virtual void setIsAllowed(bool allowed);
@@ -94,12 +95,8 @@ GeolocationServiceBridge* createGeolocationServiceBridgeImpl(GeolocationServiceC
WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium)
: m_GeolocationServiceChromium(geolocationServiceChromium)
+ , m_bridgeId(0)
{
- // We need to attach ourselves here: Geolocation calls requestPermissionForFrame()
- // directly, and we need to be attached so that the embedder can call
- // our setIsAllowed().
- m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this);
- ASSERT(m_bridgeId);
}
WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl()
@@ -116,8 +113,7 @@ WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl()
bool WebGeolocationServiceBridgeImpl::startUpdating(PositionOptions* positionOptions)
{
- if (!m_bridgeId)
- m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this);
+ attachBridgeIfNeeded();
getWebViewClient()->geolocationService()->startUpdating(m_bridgeId, m_GeolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy());
return true;
}
@@ -148,6 +144,12 @@ int WebGeolocationServiceBridgeImpl::getBridgeId() const
return m_bridgeId;
}
+void WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded()
+{
+ if (!m_bridgeId)
+ m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this);
+}
+
void WebGeolocationServiceBridgeImpl::setIsAllowed(bool allowed)
{
m_GeolocationServiceChromium->setIsAllowed(allowed);