| Index: blimp/engine/app/blimp_content_browser_client.cc
|
| diff --git a/blimp/engine/app/blimp_content_browser_client.cc b/blimp/engine/app/blimp_content_browser_client.cc
|
| index 90ea2f52e4c78637305c63ea9346ec75d5085f3b..30c8c14e5a8893c86f204760dd40d7e63b11f0ba 100644
|
| --- a/blimp/engine/app/blimp_content_browser_client.cc
|
| +++ b/blimp/engine/app/blimp_content_browser_client.cc
|
| @@ -2,11 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/memory/weak_ptr.h"
|
| #include "blimp/engine/app/blimp_content_browser_client.h"
|
| #include "blimp/engine/app/blimp_browser_main_parts.h"
|
| #include "blimp/engine/app/settings_manager.h"
|
| #include "blimp/engine/feature/geolocation/blimp_location_provider.h"
|
| +#include "blimp/engine/feature/geolocation/engine_geolocation_feature.h"
|
| #include "blimp/engine/mojo/blob_channel_service.h"
|
| +#include "blimp/engine/session/blimp_engine_session.h"
|
| #include "content/public/browser/geolocation_delegate.h"
|
| #include "services/shell/public/cpp/interface_registry.h"
|
|
|
| @@ -17,16 +20,23 @@ namespace {
|
| // A provider of services needed by Geolocation.
|
| class BlimpGeolocationDelegate : public content::GeolocationDelegate {
|
| public:
|
| - BlimpGeolocationDelegate() = default;
|
| + explicit BlimpGeolocationDelegate(
|
| + base::WeakPtr<BlimpLocationProvider::Delegate> feature_delegate) {
|
| + feature_delegate_ = feature_delegate;
|
| + }
|
|
|
| bool UseNetworkLocationProviders() final { return false; }
|
|
|
| std::unique_ptr<content::LocationProvider> OverrideSystemLocationProvider()
|
| final {
|
| - return base::WrapUnique(new BlimpLocationProvider());
|
| + BlimpLocationProvider* location_provider = new BlimpLocationProvider();
|
| + location_provider->SetDelegate(feature_delegate_);
|
| + return base::WrapUnique(location_provider);
|
| }
|
|
|
| private:
|
| + base::WeakPtr<BlimpLocationProvider::Delegate> feature_delegate_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(BlimpGeolocationDelegate);
|
| };
|
|
|
| @@ -62,7 +72,12 @@ BlimpBrowserContext* BlimpContentBrowserClient::GetBrowserContext() {
|
|
|
| content::GeolocationDelegate*
|
| BlimpContentBrowserClient::CreateGeolocationDelegate() {
|
| - return new BlimpGeolocationDelegate();
|
| + EngineGeolocationFeature* geolocation_feature = blimp_browser_main_parts()
|
| + ->GetBlimpEngineSession()
|
| + ->GetGeolocationFeature();
|
| + BlimpGeolocationDelegate* delegate =
|
| + new BlimpGeolocationDelegate(geolocation_feature->GetWeakPtr());
|
| + return delegate;
|
| }
|
|
|
| void BlimpContentBrowserClient::ExposeInterfacesToRenderer(
|
|
|