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

Unified Diff: third_party/WebKit/Source/modules/geolocation/testing/InternalsGeolocation.cpp

Issue 1367853002: Move GeolocationDispatcher into blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: third_party/WebKit/Source/modules/geolocation/testing/InternalsGeolocation.cpp
diff --git a/third_party/WebKit/Source/modules/geolocation/testing/InternalsGeolocation.cpp b/third_party/WebKit/Source/modules/geolocation/testing/InternalsGeolocation.cpp
index 54b624787e4e48504f67d32be54d33cca47d85c0..d593cad4df52b932b8820a0f0d15b50294396ea6 100644
--- a/third_party/WebKit/Source/modules/geolocation/testing/InternalsGeolocation.cpp
+++ b/third_party/WebKit/Source/modules/geolocation/testing/InternalsGeolocation.cpp
@@ -45,14 +45,7 @@ namespace blink {
void InternalsGeolocation::setGeolocationClientMock(Internals&, Document* document)
{
ASSERT(document);
- if (!document->frame())
- return;
-
- GeolocationClientMock* client = new GeolocationClientMock();
- for (Frame* childFrame = document->page()->mainFrame(); childFrame; childFrame = childFrame->tree().traverseNext()) {
- if (childFrame->isLocalFrame())
- GeolocationController::from(toLocalFrame(childFrame))->setClientForTest(client);
- }
+ GeolocationClientMock::from(document);
}
void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document, double latitude, double longitude, double accuracy)
@@ -106,13 +99,7 @@ int InternalsGeolocation::numberOfPendingGeolocationPermissionRequests(Internals
GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* document)
{
ASSERT(document);
- if (!document->frame())
- return nullptr;
-
- GeolocationController* controller = GeolocationController::from(document->frame());
- if (!controller->hasClientForTest())
- return nullptr;
- return static_cast<GeolocationClientMock*>(controller->client());
+ return GeolocationClientMock::from(document);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698