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

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: Fixed conflicts 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
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().nextSibling()) 50 for (Frame* childFrame = document->page()->mainFrame(); childFrame; childFra me = childFrame->tree().nextSibling())
dcheng 2014/06/04 18:06:37 I think you can just delete the for statement alto
kenrb 2014/06/04 20:34:47 This landed less than a day ago. I put a question
51 GeolocationController::from(document->frame())->setClientForTest(client) ; 51 GeolocationController::from(document->frame())->setClientForTest(client) ;
52 } 52 }
53 53
54 void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document , double latitude, double longitude, double accuracy) 54 void InternalsGeolocation::setGeolocationPosition(Internals&, Document* document , double latitude, double longitude, double accuracy)
55 { 55 {
56 ASSERT(document && document->frame()); 56 ASSERT(document && document->frame());
57 GeolocationClientMock* client = geolocationClient(document); 57 GeolocationClientMock* client = geolocationClient(document);
58 if (!client) 58 if (!client)
59 return; 59 return;
60 client->setPosition(GeolocationPosition::create(currentTime(), latitude, lon gitude, accuracy)); 60 client->setPosition(GeolocationPosition::create(currentTime(), latitude, lon gitude, accuracy));
(...skipping 28 matching lines...) Expand all
89 89
90 GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* documen t) 90 GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* documen t)
91 { 91 {
92 GeolocationController* controller = GeolocationController::from(document->fr ame()); 92 GeolocationController* controller = GeolocationController::from(document->fr ame());
93 if (!controller->hasClientForTest()) 93 if (!controller->hasClientForTest())
94 return 0; 94 return 0;
95 return static_cast<GeolocationClientMock*>(controller->client()); 95 return static_cast<GeolocationClientMock*>(controller->client());
96 } 96 }
97 97
98 } // namespace WebCore 98 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698