mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium revision 1ae106db (#414607)
This commit is contained in:
@@ -32,6 +32,9 @@
|
||||
#include "content/public/browser/gpu_data_manager.h"
|
||||
#include "content/public/browser/web_ui_controller_factory.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "device/geolocation/access_token_store.h"
|
||||
#include "device/geolocation/geolocation_delegate.h"
|
||||
#include "device/geolocation/geolocation_provider.h"
|
||||
#include "extensions/browser/extension_system.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "net/base/net_module.h"
|
||||
@@ -56,6 +59,50 @@
|
||||
#include "libcef/browser/printing/print_dialog_linux.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// In-memory store for access tokens used by geolocation.
|
||||
class CefAccessTokenStore : public device::AccessTokenStore {
|
||||
public:
|
||||
// |system_context| is used by NetworkLocationProvider to communicate with a
|
||||
// remote geolocation service.
|
||||
explicit CefAccessTokenStore(net::URLRequestContextGetter* system_context)
|
||||
: system_context_(system_context) {}
|
||||
|
||||
void LoadAccessTokens(const LoadAccessTokensCallback& callback) override {
|
||||
callback.Run(access_token_map_, system_context_);
|
||||
}
|
||||
|
||||
void SaveAccessToken(
|
||||
const GURL& server_url, const base::string16& access_token) override {
|
||||
access_token_map_[server_url] = access_token;
|
||||
}
|
||||
|
||||
private:
|
||||
net::URLRequestContextGetter* system_context_;
|
||||
AccessTokenMap access_token_map_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefAccessTokenStore);
|
||||
};
|
||||
|
||||
// A provider of services for geolocation.
|
||||
class CefGeolocationDelegate : public device::GeolocationDelegate {
|
||||
public:
|
||||
explicit CefGeolocationDelegate(net::URLRequestContextGetter* system_context)
|
||||
: system_context_(system_context) {}
|
||||
|
||||
scoped_refptr<device::AccessTokenStore> CreateAccessTokenStore() override {
|
||||
return new CefAccessTokenStore(system_context_);
|
||||
}
|
||||
|
||||
private:
|
||||
net::URLRequestContextGetter* system_context_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefGeolocationDelegate);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
CefBrowserMainParts::CefBrowserMainParts(
|
||||
const content::MainFunctionParams& parameters)
|
||||
: BrowserMainParts(),
|
||||
@@ -163,6 +210,10 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
|
||||
|
||||
// Triggers initialization of the singleton instance on UI thread.
|
||||
PluginFinder::GetInstance()->Init();
|
||||
|
||||
device::GeolocationProvider::SetGeolocationDelegate(
|
||||
new CefGeolocationDelegate(
|
||||
global_browser_context_->request_context().get()));
|
||||
}
|
||||
|
||||
void CefBrowserMainParts::PostMainMessageLoopRun() {
|
||||
|
Reference in New Issue
Block a user