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

Unified Diff: content/browser/devtools/protocol/emulation_handler.cc

Issue 1411063007: Add mojo::StrongBindingSet and use it in GeolocationServiceContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
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();
}
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/frame_host/render_frame_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698