Add network provider for google geolocation api.

This commit is contained in:
Cheng Zhao 2014-08-13 13:28:05 +08:00
parent 0ca9e8ee82
commit adb8fb59bd
2 changed files with 17 additions and 1 deletions

View file

@ -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());
}

View file

@ -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_