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

Side by Side Diff: Source/modules/geolocation/testing/InternalsGeolocation.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/web/SpellCheckerClientImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 #include "modules/geolocation/testing/GeolocationClientMock.h" 40 #include "modules/geolocation/testing/GeolocationClientMock.h"
41 #include "wtf/CurrentTime.h" 41 #include "wtf/CurrentTime.h"
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 void InternalsGeolocation::setGeolocationClientMock(Internals&, Document* docume nt) 45 void InternalsGeolocation::setGeolocationClientMock(Internals&, Document* docume nt)
46 { 46 {
47 ASSERT(document && document->frame()); 47 ASSERT(document && document->frame());
48 GeolocationClientMock* client = new GeolocationClientMock(); 48 GeolocationClientMock* client = new GeolocationClientMock();
49 49
50 for (LocalFrame* childFrame = document->page()->mainFrame(); childFrame; chi ldFrame = childFrame->tree().traverseNext()) 50 for (Frame* childFrame = document->page()->mainFrame(); childFrame; childFra me = childFrame->tree().traverseNext()) {
51 GeolocationController::from(childFrame)->setClientForTest(client); 51 if (childFrame->isLocalFrame())
52 GeolocationController::from(toLocalFrame(childFrame))->setClientForT est(client);
53 }
52 } 54 }
53 55
54 void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document , double latitude, double longitude, double accuracy) 56 void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document , double latitude, double longitude, double accuracy)
55 { 57 {
56 ASSERT(document && document->frame()); 58 ASSERT(document && document->frame());
57 GeolocationClientMock* client = geolocationClient(document); 59 GeolocationClientMock* client = geolocationClient(document);
58 if (!client) 60 if (!client)
59 return; 61 return;
60 client->setPosition(GeolocationPosition::create(currentTime(), latitude, lon gitude, accuracy)); 62 client->setPosition(GeolocationPosition::create(currentTime(), latitude, lon gitude, accuracy));
61 } 63 }
(...skipping 27 matching lines...) Expand all
89 91
90 GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* documen t) 92 GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* documen t)
91 { 93 {
92 GeolocationController* controller = GeolocationController::from(document->fr ame()); 94 GeolocationController* controller = GeolocationController::from(document->fr ame());
93 if (!controller->hasClientForTest()) 95 if (!controller->hasClientForTest())
94 return 0; 96 return 0;
95 return static_cast<GeolocationClientMock*>(controller->client()); 97 return static_cast<GeolocationClientMock*>(controller->client());
96 } 98 }
97 99
98 } // namespace WebCore 100 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/web/SpellCheckerClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698