| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/background_mode_manager_factory.h" | 5 #include "chrome/browser/background_mode_manager_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/background_mode_manager.h" | 8 #include "chrome/browser/background_mode_manager.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/profiles/profile_dependency_manager.h" | 10 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 BackgroundModeManager* BackgroundModeManagerFactory::GetForProfile( | 13 BackgroundModeManager* BackgroundModeManagerFactory::GetForProfile( |
| 14 Profile* profile) { | 14 Profile* profile) { |
| 15 return static_cast<BackgroundModeManager*>( | 15 return static_cast<BackgroundModeManager*>( |
| 16 GetInstance()->GetServiceForProfile(profile)); | 16 GetInstance()->GetServiceForProfile(profile, true)); |
| 17 } | 17 } |
| 18 | 18 |
| 19 // static | 19 // static |
| 20 BackgroundModeManagerFactory* BackgroundModeManagerFactory::GetInstance() { | 20 BackgroundModeManagerFactory* BackgroundModeManagerFactory::GetInstance() { |
| 21 return Singleton<BackgroundModeManagerFactory>::get(); | 21 return Singleton<BackgroundModeManagerFactory>::get(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 BackgroundModeManagerFactory::BackgroundModeManagerFactory() | 24 BackgroundModeManagerFactory::BackgroundModeManagerFactory() |
| 25 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { | 25 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
| 26 } | 26 } |
| 27 | 27 |
| 28 BackgroundModeManagerFactory::~BackgroundModeManagerFactory() { | 28 BackgroundModeManagerFactory::~BackgroundModeManagerFactory() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 ProfileKeyedService* BackgroundModeManagerFactory::BuildServiceInstanceFor( | 31 ProfileKeyedService* BackgroundModeManagerFactory::BuildServiceInstanceFor( |
| 32 Profile* profile) const { | 32 Profile* profile) const { |
| 33 return new BackgroundModeManager(profile, CommandLine::ForCurrentProcess()); | 33 return new BackgroundModeManager(profile, CommandLine::ForCurrentProcess()); |
| 34 } | 34 } |
| OLD | NEW |