Browse Source

opt into location service on main thread

deepak1556 7 years ago
parent
commit
ee80313666

+ 0 - 1
atom/browser/atom_access_token_store.cc

@@ -54,7 +54,6 @@ class GeoURLRequestContextGetter : public net::URLRequestContextGetter {
 
 AtomAccessTokenStore::AtomAccessTokenStore()
     : request_context_getter_(new internal::GeoURLRequestContextGetter) {
-  device::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices();
 }
 
 AtomAccessTokenStore::~AtomAccessTokenStore() {

+ 4 - 1
atom/browser/atom_browser_main_parts.cc

@@ -39,7 +39,10 @@ namespace {
 // A provider of Geolocation services to override AccessTokenStore.
 class AtomGeolocationDelegate : public device::GeolocationDelegate {
  public:
-  AtomGeolocationDelegate() = default;
+  AtomGeolocationDelegate() {
+    device::GeolocationProvider::GetInstance()
+        ->UserDidOptIntoLocationServices();
+  }
 
   scoped_refptr<device::AccessTokenStore> CreateAccessTokenStore() final {
     return new AtomAccessTokenStore();