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

Unified Diff: content/child/geofencing/web_geofencing_provider_impl.cc

Issue 476293002: Pass through geofencing API calls to the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/child/geofencing/web_geofencing_provider_impl.cc
diff --git a/content/child/geofencing/web_geofencing_provider_impl.cc b/content/child/geofencing/web_geofencing_provider_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d058ffeb8da384b91976753bd1bab175796a36b2
--- /dev/null
+++ b/content/child/geofencing/web_geofencing_provider_impl.cc
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/child/geofencing/web_geofencing_provider_impl.h"
+
+#include "content/child/geofencing/geofencing_dispatcher.h"
+#include "content/child/thread_safe_sender.h"
+
+namespace content {
+
+WebGeofencingProviderImpl::WebGeofencingProviderImpl(
+ ThreadSafeSender* thread_safe_sender)
+ : thread_safe_sender_(thread_safe_sender) {
+}
+
+WebGeofencingProviderImpl::~WebGeofencingProviderImpl() {
+}
+
+void WebGeofencingProviderImpl::registerRegion(
+ const blink::WebString& regionId,
+ const blink::WebCircularGeofencingRegion& region,
+ blink::WebGeofencingCallbacks* callbacks) {
+ GetDispatcher()->RegisterRegion(regionId, region, callbacks);
+}
+
+void WebGeofencingProviderImpl::unregisterRegion(
+ const blink::WebString& regionId,
+ blink::WebGeofencingCallbacks* callbacks) {
+ GetDispatcher()->UnregisterRegion(regionId, callbacks);
+}
+
+void WebGeofencingProviderImpl::getRegisteredRegions(
+ blink::WebGeofencingRegionsCallbacks* callbacks) {
+ GetDispatcher()->GetRegisteredRegions(callbacks);
+}
+
+GeofencingDispatcher* WebGeofencingProviderImpl::GetDispatcher() {
+ return GeofencingDispatcher::GetOrCreateThreadSpecificInstance(
+ thread_safe_sender_.get());
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698