| OLD | NEW |
| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 35 #include "core/page/Page.h" | 35 #include "core/page/Page.h" |
| 36 #include "core/testing/Internals.h" | 36 #include "core/testing/Internals.h" |
| 37 #include "modules/geolocation/GeolocationController.h" | 37 #include "modules/geolocation/GeolocationController.h" |
| 38 #include "modules/geolocation/GeolocationError.h" | 38 #include "modules/geolocation/GeolocationError.h" |
| 39 #include "modules/geolocation/GeolocationPosition.h" | 39 #include "modules/geolocation/GeolocationPosition.h" |
| 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 blink { |
| 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 (Frame* childFrame = document->page()->mainFrame(); childFrame; childFra
me = childFrame->tree().traverseNext()) { | 50 for (Frame* childFrame = document->page()->mainFrame(); childFrame; childFra
me = childFrame->tree().traverseNext()) { |
| 51 if (childFrame->isLocalFrame()) | 51 if (childFrame->isLocalFrame()) |
| 52 GeolocationController::from(toLocalFrame(childFrame))->setClientForT
est(client); | 52 GeolocationController::from(toLocalFrame(childFrame))->setClientForT
est(client); |
| 53 } | 53 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* documen
t) | 92 GeolocationClientMock* InternalsGeolocation::geolocationClient(Document* documen
t) |
| 93 { | 93 { |
| 94 GeolocationController* controller = GeolocationController::from(document->fr
ame()); | 94 GeolocationController* controller = GeolocationController::from(document->fr
ame()); |
| 95 if (!controller->hasClientForTest()) | 95 if (!controller->hasClientForTest()) |
| 96 return 0; | 96 return 0; |
| 97 return static_cast<GeolocationClientMock*>(controller->client()); | 97 return static_cast<GeolocationClientMock*>(controller->client()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace WebCore | 100 } // namespace blink |
| OLD | NEW |