Commit 30eed42c authored by kinaba@chromium.org's avatar kinaba@chromium.org

Drop DriveIntegrationService::{Get,Find}ForProfileRegardlessOfStates.

They are doing the same thing as the samely named methods without
RegardlessOfStates.

BUG=none

Review URL: https://codereview.chromium.org/390183006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283249 0039d316-1c4b-4281-b951-d872f2087c98
parent dbec85ef
...@@ -598,13 +598,6 @@ DriveIntegrationServiceFactory::ScopedFactoryForTest::~ScopedFactoryForTest() { ...@@ -598,13 +598,6 @@ DriveIntegrationServiceFactory::ScopedFactoryForTest::~ScopedFactoryForTest() {
// static // static
DriveIntegrationService* DriveIntegrationServiceFactory::GetForProfile( DriveIntegrationService* DriveIntegrationServiceFactory::GetForProfile(
Profile* profile) { Profile* profile) {
return GetForProfileRegardlessOfStates(profile);
}
// static
DriveIntegrationService*
DriveIntegrationServiceFactory::GetForProfileRegardlessOfStates(
Profile* profile) {
return static_cast<DriveIntegrationService*>( return static_cast<DriveIntegrationService*>(
GetInstance()->GetServiceForBrowserContext(profile, true)); GetInstance()->GetServiceForBrowserContext(profile, true));
} }
...@@ -612,13 +605,6 @@ DriveIntegrationServiceFactory::GetForProfileRegardlessOfStates( ...@@ -612,13 +605,6 @@ DriveIntegrationServiceFactory::GetForProfileRegardlessOfStates(
// static // static
DriveIntegrationService* DriveIntegrationServiceFactory::FindForProfile( DriveIntegrationService* DriveIntegrationServiceFactory::FindForProfile(
Profile* profile) { Profile* profile) {
return FindForProfileRegardlessOfStates(profile);
}
// static
DriveIntegrationService*
DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates(
Profile* profile) {
return static_cast<DriveIntegrationService*>( return static_cast<DriveIntegrationService*>(
GetInstance()->GetServiceForBrowserContext(profile, false)); GetInstance()->GetServiceForBrowserContext(profile, false));
} }
......
...@@ -211,18 +211,10 @@ class DriveIntegrationServiceFactory ...@@ -211,18 +211,10 @@ class DriveIntegrationServiceFactory
// not yet created. // not yet created.
static DriveIntegrationService* GetForProfile(Profile* profile); static DriveIntegrationService* GetForProfile(Profile* profile);
// Same as GetForProfile. TODO(hidehiko): Remove this.
static DriveIntegrationService* GetForProfileRegardlessOfStates(
Profile* profile);
// Returns the DriveIntegrationService that is already associated with // Returns the DriveIntegrationService that is already associated with
// |profile|, if it is not yet created it will return NULL. // |profile|, if it is not yet created it will return NULL.
static DriveIntegrationService* FindForProfile(Profile* profile); static DriveIntegrationService* FindForProfile(Profile* profile);
// Same as FindForProfile. TODO(hidehiko): Remove this.
static DriveIntegrationService* FindForProfileRegardlessOfStates(
Profile* profile);
// Returns the DriveIntegrationServiceFactory instance. // Returns the DriveIntegrationServiceFactory instance.
static DriveIntegrationServiceFactory* GetInstance(); static DriveIntegrationServiceFactory* GetInstance();
......
...@@ -370,8 +370,7 @@ void EventRouter::Shutdown() { ...@@ -370,8 +370,7 @@ void EventRouter::Shutdown() {
} }
DriveIntegrationService* integration_service = DriveIntegrationService* integration_service =
DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates( DriveIntegrationServiceFactory::FindForProfile(profile_);
profile_);
if (integration_service) { if (integration_service) {
integration_service->file_system()->RemoveObserver(this); integration_service->file_system()->RemoveObserver(this);
integration_service->drive_service()->RemoveObserver(this); integration_service->drive_service()->RemoveObserver(this);
...@@ -411,8 +410,7 @@ void EventRouter::ObserveEvents() { ...@@ -411,8 +410,7 @@ void EventRouter::ObserveEvents() {
volume_manager->AddObserver(this); volume_manager->AddObserver(this);
DriveIntegrationService* integration_service = DriveIntegrationService* integration_service =
DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates( DriveIntegrationServiceFactory::FindForProfile(profile_);
profile_);
if (integration_service) { if (integration_service) {
integration_service->drive_service()->AddObserver(this); integration_service->drive_service()->AddObserver(this);
integration_service->file_system()->AddObserver(this); integration_service->file_system()->AddObserver(this);
......
...@@ -327,8 +327,7 @@ void SetupProfileFileAccessPermissions(int render_view_process_id, ...@@ -327,8 +327,7 @@ void SetupProfileFileAccessPermissions(int render_view_process_id,
drive::EventLogger* GetLogger(Profile* profile) { drive::EventLogger* GetLogger(Profile* profile) {
drive::DriveIntegrationService* service = drive::DriveIntegrationService* service =
drive::DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates( drive::DriveIntegrationServiceFactory::FindForProfile(profile);
profile);
return service ? service->event_logger() : NULL; return service ? service->event_logger() : NULL;
} }
......
...@@ -60,8 +60,7 @@ void WaitUntilDriveMountPointIsAdded(Profile* profile) { ...@@ -60,8 +60,7 @@ void WaitUntilDriveMountPointIsAdded(Profile* profile) {
// drive file system is observed for FileSystemMounted event (by // drive file system is observed for FileSystemMounted event (by
// |mount_point_waiter|) and test continues once the event is encountered. // |mount_point_waiter|) and test continues once the event is encountered.
drive::DriveIntegrationService* integration_service = drive::DriveIntegrationService* integration_service =
drive::DriveIntegrationServiceFactory::FindForProfileRegardlessOfStates( drive::DriveIntegrationServiceFactory::FindForProfile(profile);
profile);
DCHECK(integration_service); DCHECK(integration_service);
DCHECK(integration_service->is_enabled()); DCHECK(integration_service->is_enabled());
......
...@@ -41,15 +41,14 @@ bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const { ...@@ -41,15 +41,14 @@ bool VolumeManagerFactory::ServiceIsNULLWhileTesting() const {
} }
KeyedService* VolumeManagerFactory::BuildServiceInstanceFor( KeyedService* VolumeManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const { content::BrowserContext* context) const {
Profile* const profile = Profile::FromBrowserContext(context);
VolumeManager* instance = new VolumeManager( VolumeManager* instance = new VolumeManager(
Profile::FromBrowserContext(profile), profile,
drive::DriveIntegrationServiceFactory::GetForProfileRegardlessOfStates( drive::DriveIntegrationServiceFactory::GetForProfile(profile),
Profile::FromBrowserContext(profile)),
chromeos::DBusThreadManager::Get()->GetPowerManagerClient(), chromeos::DBusThreadManager::Get()->GetPowerManagerClient(),
chromeos::disks::DiskMountManager::GetInstance(), chromeos::disks::DiskMountManager::GetInstance(),
chromeos::file_system_provider::ServiceFactory::Get( chromeos::file_system_provider::ServiceFactory::Get(context));
Profile::FromBrowserContext(profile)));
instance->Initialize(); instance->Initialize();
return instance; return instance;
} }
......
...@@ -35,7 +35,7 @@ class VolumeManagerFactory : public BrowserContextKeyedServiceFactory { ...@@ -35,7 +35,7 @@ class VolumeManagerFactory : public BrowserContextKeyedServiceFactory {
// BrowserContextKeyedServiceFactory overrides: // BrowserContextKeyedServiceFactory overrides:
virtual KeyedService* BuildServiceInstanceFor( virtual KeyedService* BuildServiceInstanceFor(
content::BrowserContext* profile) const OVERRIDE; content::BrowserContext* context) const OVERRIDE;
private: private:
// For Singleton. // For Singleton.
......
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