Index: content/browser/devtools/protocol/emulation_handler.cc |
diff --git a/content/browser/devtools/protocol/emulation_handler.cc b/content/browser/devtools/protocol/emulation_handler.cc |
index 7761ef6f6c943af6b00044927792154adc6d070e..b5acfd2b624e64858fc20bc7cc1ee9ed7938ffea 100644 |
--- a/content/browser/devtools/protocol/emulation_handler.cc |
+++ b/content/browser/devtools/protocol/emulation_handler.cc |
@@ -10,6 +10,7 @@ |
#include "content/browser/renderer_host/render_widget_host_impl.h" |
#include "content/browser/web_contents/web_contents_impl.h" |
#include "content/common/view_messages.h" |
+#include "content/public/common/geoposition.h" |
#include "content/public/common/url_constants.h" |
namespace content { |
@@ -68,7 +69,7 @@ Response EmulationHandler::SetGeolocationOverride( |
return Response::InternalError("Could not connect to view"); |
GeolocationServiceContext* geolocation_context = |
- GetWebContents()->GetGeolocationServiceContext(); |
+ GeolocationServiceContext::GetOrCreateForWebContents(GetWebContents()); |
scoped_ptr<Geoposition> geoposition(new Geoposition()); |
if (latitude && longitude && accuracy) { |
geoposition->latitude = *latitude; |
@@ -90,8 +91,9 @@ Response EmulationHandler::ClearGeolocationOverride() { |
return Response::InternalError("Could not connect to view"); |
GeolocationServiceContext* geolocation_context = |
- GetWebContents()->GetGeolocationServiceContext(); |
- geolocation_context->ClearOverride(); |
+ GeolocationServiceContext::FromWebContents(GetWebContents()); |
+ if (geolocation_context) |
+ geolocation_context->ClearOverride(); |
return Response::OK(); |
} |