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

Unified Diff: Source/modules/geolocation/testing/InternalsGeolocation.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
« no previous file with comments | « Source/modules/geolocation/testing/GeolocationClientMock.cpp ('k') | Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/geolocation/testing/InternalsGeolocation.cpp
diff --git a/Source/modules/geolocation/testing/InternalsGeolocation.cpp b/Source/modules/geolocation/testing/InternalsGeolocation.cpp
index ff1f1b099563782fb9fe48432e63b86895229851..4de6488e9f88d72f6ee60b3fb7ce715f4ccd8be6 100644
--- a/Source/modules/geolocation/testing/InternalsGeolocation.cpp
+++ b/Source/modules/geolocation/testing/InternalsGeolocation.cpp
@@ -32,6 +32,7 @@
#include "InternalsGeolocation.h"
#include "core/dom/Document.h"
+#include "core/page/Page.h"
#include "core/testing/Internals.h"
#include "modules/geolocation/GeolocationController.h"
#include "modules/geolocation/GeolocationError.h"
@@ -43,16 +44,16 @@ namespace WebCore {
void InternalsGeolocation::setGeolocationClientMock(Internals&, Document* document)
{
- ASSERT(document && document->page());
- GeolocationController* controller = GeolocationController::from(document->page());
+ ASSERT(document && document->frame());
GeolocationClientMock* client = new GeolocationClientMock();
- controller->setClientForTest(client);
- client->setController(controller);
+
+ for (LocalFrame* childFrame = document->page()->mainFrame(); childFrame; childFrame = childFrame->tree().nextSibling())
kenrb 2014/06/04 20:28:49 This loop looks to be entirely redundant, since ch
+ GeolocationController::from(document->frame())->setClientForTest(client);
}
void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document, double latitude, double longitude, double accuracy)
{
- ASSERT(document && document->page());
+ ASSERT(document && document->frame());
GeolocationClientMock* client = geolocationClient(document);
if (!client)
return;
@@ -61,7 +62,7 @@ void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document
void InternalsGeolocation::setGeolocationPositionUnavailableError(Internals&, Document* document, const String& message)
{
- ASSERT(document && document->page());
+ ASSERT(document && document->frame());
GeolocationClientMock* client = geolocationClient(document);
if (!client)
return;
@@ -70,7 +71,7 @@ void InternalsGeolocation::setGeolocationPositionUnavailableError(Internals&, Do
void InternalsGeolocation::setGeolocationPermission(Internals&, Document* document, bool allowed)
{
- ASSERT(document && document->page());
+ ASSERT(document && document->frame());
GeolocationClientMock* client = geolocationClient(document);
if (!client)
return;
@@ -79,7 +80,7 @@ void InternalsGeolocation::setGeolocationPermission(Internals&, Document* docume
int InternalsGeolocation::numberOfPendingGeolocationPermissionRequests(Internals&, Document* document)
{
- ASSERT(document && document->page());
+ ASSERT(document && document->frame());
GeolocationClientMock* client = geolocationClient(document);
if (!client)
return -1;
@@ -88,7 +89,7 @@ int InternalsGeolocation::numberOfPendingGeolocationPermissionRequests(Internals
GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* document)
{
- GeolocationController* controller = GeolocationController::from(document->page());
+ GeolocationController* controller = GeolocationController::from(document->frame());
if (!controller->hasClientForTest())
return 0;
return static_cast<GeolocationClientMock*>(controller->client());
« no previous file with comments | « Source/modules/geolocation/testing/GeolocationClientMock.cpp ('k') | Source/web/WebLocalFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698