Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: Source/modules/geolocation/Geolocation.cpp

Issue 256843004: Get the WebGeolocationClient from WebFrameClient instead of WebViewClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix linking errors Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/geolocation/Geolocation.cpp
diff --git a/Source/modules/geolocation/Geolocation.cpp b/Source/modules/geolocation/Geolocation.cpp
index a52de3abe6321016005909e1ec141462866e20f0..eaacf5ebe8976f034d40071826cdb2c60d804b3b 100644
--- a/Source/modules/geolocation/Geolocation.cpp
+++ b/Source/modules/geolocation/Geolocation.cpp
@@ -281,16 +281,11 @@ LocalFrame* Geolocation::frame() const
return document() ? document()->frame() : 0;
}
-Page* Geolocation::page() const
-{
- return document() ? document()->page() : 0;
-}
-
void Geolocation::stop()
{
- Page* page = this->page();
- if (page && m_allowGeolocation == InProgress)
- GeolocationController::from(page)->cancelPermissionRequest(this);
+ LocalFrame* frame = this->frame();
+ if (frame && m_allowGeolocation == InProgress)
+ GeolocationController::from(frame)->cancelPermissionRequest(this);
// The frame may be moving to a new page and we want to get the permissions from the new page's client.
m_allowGeolocation = Unknown;
cancelAllRequests();
@@ -300,11 +295,11 @@ void Geolocation::stop()
Geoposition* Geolocation::lastPosition()
{
- Page* page = this->page();
- if (!page)
+ LocalFrame* frame = this->frame();
+ if (!frame)
return 0;
- m_lastPosition = createGeoposition(GeolocationController::from(page)->lastPosition());
+ m_lastPosition = createGeoposition(GeolocationController::from(frame)->lastPosition());
return m_lastPosition.get();
}
@@ -605,14 +600,14 @@ void Geolocation::requestPermission()
if (m_allowGeolocation > Unknown)
return;
- Page* page = this->page();
- if (!page)
+ LocalFrame* frame = this->frame();
+ if (!frame)
return;
m_allowGeolocation = InProgress;
// Ask the embedder: it maintains the geolocation challenge policy itself.
- GeolocationController::from(page)->requestPermission(this);
+ GeolocationController::from(frame)->requestPermission(this);
}
void Geolocation::makeSuccessCallbacks()
@@ -661,21 +656,21 @@ void Geolocation::setError(GeolocationError* error)
bool Geolocation::startUpdating(GeoNotifier* notifier)
{
- Page* page = this->page();
- if (!page)
+ LocalFrame* frame = this->frame();
+ if (!frame)
return false;
- GeolocationController::from(page)->addObserver(this, notifier->options()->enableHighAccuracy());
+ GeolocationController::from(frame)->addObserver(this, notifier->options()->enableHighAccuracy());
return true;
}
void Geolocation::stopUpdating()
{
- Page* page = this->page();
- if (!page)
+ LocalFrame* frame = this->frame();
+ if (!frame)
return;
- GeolocationController::from(page)->removeObserver(this);
+ GeolocationController::from(frame)->removeObserver(this);
}
void Geolocation::handlePendingPermissionNotifiers()

Powered by Google App Engine
This is Rietveld 408576698