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