Add network provider for google geolocation api.
This commit is contained in:
parent
0ca9e8ee82
commit
adb8fb59bd
2 changed files with 17 additions and 1 deletions
|
@ -7,8 +7,23 @@
|
||||||
#include "atom/browser/atom_browser_context.h"
|
#include "atom/browser/atom_browser_context.h"
|
||||||
#include "atom/browser/net/atom_url_request_context_getter.h"
|
#include "atom/browser/net/atom_url_request_context_getter.h"
|
||||||
|
|
||||||
|
#ifndef GOOGLEAPIS_API_KEY
|
||||||
|
#define GOOGLEAPIS_API_KEY "AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace atom {
|
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() {
|
AtomAccessTokenStore::AtomAccessTokenStore() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +33,7 @@ AtomAccessTokenStore::~AtomAccessTokenStore() {
|
||||||
void AtomAccessTokenStore::LoadAccessTokens(
|
void AtomAccessTokenStore::LoadAccessTokens(
|
||||||
const LoadAccessTokensCallbackType& callback) {
|
const LoadAccessTokensCallbackType& callback) {
|
||||||
AccessTokenSet access_token_set;
|
AccessTokenSet access_token_set;
|
||||||
|
access_token_set[GURL(kGeolocationProviderUrl)];
|
||||||
callback.Run(access_token_set,
|
callback.Run(access_token_set,
|
||||||
AtomBrowserContext::Get()->url_request_context_getter());
|
AtomBrowserContext::Get()->url_request_context_getter());
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,4 @@ class AtomAccessTokenStore : public content::AccessTokenStore {
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_ATOWSER_ATOM_ACCESS_TOKEN_STORE_H_
|
#endif // ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue