From: Cheng Zhao Date: Wed, 13 Aug 2014 05:28:05 +0000 (+0800) Subject: Add network provider for google geolocation api. X-Git-Tag: v0.15.6~2^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=adb8fb59bde2fe529dde7c4aca93638a4b4168cf;p=electron.git Add network provider for google geolocation api. --- diff --git a/atom/browser/atom_access_token_store.cc b/atom/browser/atom_access_token_store.cc index 0018f77b..6555ac76 100644 --- a/atom/browser/atom_access_token_store.cc +++ b/atom/browser/atom_access_token_store.cc @@ -7,8 +7,23 @@ #include "atom/browser/atom_browser_context.h" #include "atom/browser/net/atom_url_request_context_getter.h" +#ifndef GOOGLEAPIS_API_KEY +#define GOOGLEAPIS_API_KEY "AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q" +#endif + namespace atom { +namespace { + +// Notice that we just combined the api key with the url together here, because +// if we use the standard {url: key} format Chromium would override our key with +// the predefined one in common.gypi of libchromiumcontent, which is empty. +const char* kGeolocationProviderUrl = + "https://www.googleapis.com/geolocation/v1/geolocate?key=" + GOOGLEAPIS_API_KEY; + +} // namespace + AtomAccessTokenStore::AtomAccessTokenStore() { } @@ -18,6 +33,7 @@ AtomAccessTokenStore::~AtomAccessTokenStore() { void AtomAccessTokenStore::LoadAccessTokens( const LoadAccessTokensCallbackType& callback) { AccessTokenSet access_token_set; + access_token_set[GURL(kGeolocationProviderUrl)]; callback.Run(access_token_set, AtomBrowserContext::Get()->url_request_context_getter()); } diff --git a/atom/browser/atom_access_token_store.h b/atom/browser/atom_access_token_store.h index 4f4f95fb..d1d080ac 100644 --- a/atom/browser/atom_access_token_store.h +++ b/atom/browser/atom_access_token_store.h @@ -28,4 +28,4 @@ class AtomAccessTokenStore : public content::AccessTokenStore { } // namespace atom -#endif // ATOM_BROWSER_ATOWSER_ATOM_ACCESS_TOKEN_STORE_H_ +#endif // ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_