Commit 634b5373 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios] Fix uses of ios::ChromeBrowserState in /ios/chrome/browser/gcm

The ChromeBrowserState has been moved from the "ios" namespace
to the global namespace by http://crrev.com/c/2014913. Fix the
uses from ios::ChromeBrowserState to ChromeBrowserState.

Also remove includes of chrome_browser_state_forward.h and use
a simple forward declaration instead (since the old name is no
longer necessary).

This CL was uploaded by git cl split.

R=peter@chromium.org

Bug: 1042208
Change-Id: I06cfd4c1857415875049030e7d7f5c262050a079
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017525Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735811}
parent a8ee0496
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// static // static
instance_id::InstanceIDProfileService* instance_id::InstanceIDProfileService*
IOSChromeInstanceIDProfileServiceFactory::GetForBrowserState( IOSChromeInstanceIDProfileServiceFactory::GetForBrowserState(
ios::ChromeBrowserState* browser_state) { ChromeBrowserState* browser_state) {
return static_cast<instance_id::InstanceIDProfileService*>( return static_cast<instance_id::InstanceIDProfileService*>(
GetInstance()->GetServiceForBrowserState(browser_state, true)); GetInstance()->GetServiceForBrowserState(browser_state, true));
} }
...@@ -43,8 +43,8 @@ IOSChromeInstanceIDProfileServiceFactory::BuildServiceInstanceFor( ...@@ -43,8 +43,8 @@ IOSChromeInstanceIDProfileServiceFactory::BuildServiceInstanceFor(
web::BrowserState* context) const { web::BrowserState* context) const {
DCHECK(!context->IsOffTheRecord()); DCHECK(!context->IsOffTheRecord());
ios::ChromeBrowserState* browser_state = ChromeBrowserState* browser_state =
ios::ChromeBrowserState::FromBrowserState(context); ChromeBrowserState::FromBrowserState(context);
return std::make_unique<instance_id::InstanceIDProfileService>( return std::make_unique<instance_id::InstanceIDProfileService>(
IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state) IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state)
->driver(), ->driver(),
......
...@@ -10,19 +10,20 @@ ...@@ -10,19 +10,20 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "components/keyed_service/ios/browser_state_keyed_service_factory.h" #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h"
class ChromeBrowserState;
namespace instance_id { namespace instance_id {
class InstanceIDProfileService; class InstanceIDProfileService;
} }
// Singleton that owns all InstanceIDProfileService and associates them with // Singleton that owns all InstanceIDProfileService and associates them with
// ios::ChromeBrowserState. // ChromeBrowserState.
class IOSChromeInstanceIDProfileServiceFactory class IOSChromeInstanceIDProfileServiceFactory
: public BrowserStateKeyedServiceFactory { : public BrowserStateKeyedServiceFactory {
public: public:
static instance_id::InstanceIDProfileService* GetForBrowserState( static instance_id::InstanceIDProfileService* GetForBrowserState(
ios::ChromeBrowserState* browser_state); ChromeBrowserState* browser_state);
static IOSChromeInstanceIDProfileServiceFactory* GetInstance(); static IOSChromeInstanceIDProfileServiceFactory* GetInstance();
......
...@@ -58,7 +58,7 @@ void RequestProxyResolvingSocketFactory( ...@@ -58,7 +58,7 @@ void RequestProxyResolvingSocketFactory(
// static // static
gcm::GCMProfileService* IOSChromeGCMProfileServiceFactory::GetForBrowserState( gcm::GCMProfileService* IOSChromeGCMProfileServiceFactory::GetForBrowserState(
ios::ChromeBrowserState* browser_state) { ChromeBrowserState* browser_state) {
return static_cast<gcm::GCMProfileService*>( return static_cast<gcm::GCMProfileService*>(
GetInstance()->GetServiceForBrowserState(browser_state, true)); GetInstance()->GetServiceForBrowserState(browser_state, true));
} }
...@@ -98,8 +98,8 @@ IOSChromeGCMProfileServiceFactory::BuildServiceInstanceFor( ...@@ -98,8 +98,8 @@ IOSChromeGCMProfileServiceFactory::BuildServiceInstanceFor(
{base::ThreadPool(), base::MayBlock(), {base::ThreadPool(), base::MayBlock(),
base::TaskPriority::BEST_EFFORT, base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
ios::ChromeBrowserState* browser_state = ChromeBrowserState* browser_state =
ios::ChromeBrowserState::FromBrowserState(context); ChromeBrowserState::FromBrowserState(context);
return std::make_unique<gcm::GCMProfileService>( return std::make_unique<gcm::GCMProfileService>(
browser_state->GetPrefs(), browser_state->GetStatePath(), browser_state->GetPrefs(), browser_state->GetStatePath(),
base::BindRepeating(&RequestProxyResolvingSocketFactory, context), base::BindRepeating(&RequestProxyResolvingSocketFactory, context),
......
...@@ -11,19 +11,20 @@ ...@@ -11,19 +11,20 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "components/keyed_service/ios/browser_state_keyed_service_factory.h" #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h"
class ChromeBrowserState;
namespace gcm { namespace gcm {
class GCMProfileService; class GCMProfileService;
} }
// Singleton that owns all GCMProfileService and associates them with // Singleton that owns all GCMProfileService and associates them with
// ios::ChromeBrowserState. // ChromeBrowserState.
class IOSChromeGCMProfileServiceFactory class IOSChromeGCMProfileServiceFactory
: public BrowserStateKeyedServiceFactory { : public BrowserStateKeyedServiceFactory {
public: public:
static gcm::GCMProfileService* GetForBrowserState( static gcm::GCMProfileService* GetForBrowserState(
ios::ChromeBrowserState* browser_state); ChromeBrowserState* browser_state);
static IOSChromeGCMProfileServiceFactory* GetInstance(); static IOSChromeGCMProfileServiceFactory* GetInstance();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment