| Index: Source/modules/geolocation/GeolocationInspectorAgent.cpp
|
| diff --git a/Source/modules/geolocation/GeolocationInspectorAgent.cpp b/Source/modules/geolocation/GeolocationInspectorAgent.cpp
|
| index 902ca14abd37ae6951f892da8a8c7b79e0e8a5ba..aee328e59e988ddb4b2ccb61cf6b43fa27554a2f 100644
|
| --- a/Source/modules/geolocation/GeolocationInspectorAgent.cpp
|
| +++ b/Source/modules/geolocation/GeolocationInspectorAgent.cpp
|
| @@ -35,25 +35,24 @@
|
|
|
| namespace WebCore {
|
|
|
| -PassOwnPtr<GeolocationInspectorAgent> GeolocationInspectorAgent::create(GeolocationController* controller)
|
| +PassOwnPtr<GeolocationInspectorAgent> GeolocationInspectorAgent::create()
|
| {
|
| - return adoptPtr(new GeolocationInspectorAgent(controller));
|
| + return adoptPtr(new GeolocationInspectorAgent());
|
| }
|
|
|
| GeolocationInspectorAgent::~GeolocationInspectorAgent()
|
| {
|
| }
|
|
|
| -GeolocationInspectorAgent::GeolocationInspectorAgent(GeolocationController* controller)
|
| +GeolocationInspectorAgent::GeolocationInspectorAgent()
|
| : InspectorBaseAgent<GeolocationInspectorAgent>("Geolocation")
|
| - , m_controller(controller)
|
| , m_geolocationOverridden(false)
|
| {
|
| }
|
|
|
| void GeolocationInspectorAgent::setGeolocationOverride(ErrorString* error, const double* latitude, const double* longitude, const double* accuracy)
|
| {
|
| - GeolocationPosition* position = m_controller->lastPosition();
|
| + GeolocationPosition* position = (*m_controllers.begin())->lastPosition();
|
| if (!m_geolocationOverridden && position)
|
| m_platformGeolocationPosition = position;
|
|
|
| @@ -63,7 +62,8 @@ void GeolocationInspectorAgent::setGeolocationOverride(ErrorString* error, const
|
| else
|
| m_geolocationPosition.clear();
|
|
|
| - m_controller->positionChanged(0); // Kick location update.
|
| + for (WTF::HashSet<GeolocationController*>::iterator it = m_controllers.begin(); it != m_controllers.end(); ++it)
|
| + (*it)->positionChanged(0); // Kick location update.
|
| }
|
|
|
| void GeolocationInspectorAgent::clearGeolocationOverride(ErrorString*)
|
| @@ -73,8 +73,10 @@ void GeolocationInspectorAgent::clearGeolocationOverride(ErrorString*)
|
| m_geolocationOverridden = false;
|
| m_geolocationPosition.clear();
|
|
|
| - if (m_platformGeolocationPosition.get())
|
| - m_controller->positionChanged(m_platformGeolocationPosition.get());
|
| + if (m_platformGeolocationPosition.get()) {
|
| + for (WTF::HashSet<GeolocationController*>::iterator it = m_controllers.begin(); it != m_controllers.end(); ++it)
|
| + (*it)->positionChanged(m_platformGeolocationPosition.get());
|
| + }
|
| }
|
|
|
| GeolocationPosition* GeolocationInspectorAgent::overrideGeolocationPosition(GeolocationPosition* position)
|
| @@ -87,4 +89,14 @@ GeolocationPosition* GeolocationInspectorAgent::overrideGeolocationPosition(Geol
|
| return position;
|
| }
|
|
|
| +void GeolocationInspectorAgent::AddController(GeolocationController* controller)
|
| +{
|
| + m_controllers.add(controller);
|
| +}
|
| +
|
| +void GeolocationInspectorAgent::RemoveController(GeolocationController* controller)
|
| +{
|
| + m_controllers.remove(controller);
|
| +}
|
| +
|
| } // namespace WebCore
|
|
|