| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media_gallery/media_galleries_preferences_factory.h" | 5 #include "chrome/browser/media_gallery/media_galleries_preferences_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/media_gallery/media_galleries_preferences.h" | 7 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
| 8 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 8 #include "chrome/browser/profiles/profile_dependency_manager.h" | 9 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 9 | 10 |
| 10 // static | 11 // static |
| 11 chrome::MediaGalleriesPreferences* | 12 chrome::MediaGalleriesPreferences* |
| 12 MediaGalleriesPreferencesFactory::GetForProfile(Profile* profile) { | 13 MediaGalleriesPreferencesFactory::GetForProfile(Profile* profile) { |
| 13 return static_cast<chrome::MediaGalleriesPreferences*>( | 14 return static_cast<chrome::MediaGalleriesPreferences*>( |
| 14 GetInstance()->GetServiceForProfile(profile, true)); | 15 GetInstance()->GetServiceForProfile(profile, true)); |
| 15 } | 16 } |
| 16 | 17 |
| 17 // static | 18 // static |
| 18 MediaGalleriesPreferencesFactory* | 19 MediaGalleriesPreferencesFactory* |
| 19 MediaGalleriesPreferencesFactory::GetInstance() { | 20 MediaGalleriesPreferencesFactory::GetInstance() { |
| 20 return Singleton<MediaGalleriesPreferencesFactory>::get(); | 21 return Singleton<MediaGalleriesPreferencesFactory>::get(); |
| 21 } | 22 } |
| 22 | 23 |
| 23 MediaGalleriesPreferencesFactory::MediaGalleriesPreferencesFactory() | 24 MediaGalleriesPreferencesFactory::MediaGalleriesPreferencesFactory() |
| 24 : ProfileKeyedServiceFactory("MediaGalleriesPreferences", | 25 : ProfileKeyedServiceFactory("MediaGalleriesPreferences", |
| 25 ProfileDependencyManager::GetInstance()) {} | 26 ProfileDependencyManager::GetInstance()) {} |
| 26 | 27 |
| 27 MediaGalleriesPreferencesFactory::~MediaGalleriesPreferencesFactory() {} | 28 MediaGalleriesPreferencesFactory::~MediaGalleriesPreferencesFactory() {} |
| 28 | 29 |
| 29 ProfileKeyedService* MediaGalleriesPreferencesFactory::BuildServiceInstanceFor( | 30 ProfileKeyedService* MediaGalleriesPreferencesFactory::BuildServiceInstanceFor( |
| 30 Profile* profile) const { | 31 Profile* profile) const { |
| 31 return new chrome::MediaGalleriesPreferences(profile); | 32 return new chrome::MediaGalleriesPreferences(profile); |
| 32 } | 33 } |
| 33 | 34 |
| 34 void MediaGalleriesPreferencesFactory::RegisterUserPrefs( | 35 void MediaGalleriesPreferencesFactory::RegisterUserPrefs( |
| 35 PrefServiceSyncable* prefs) { | 36 PrefRegistrySyncable* prefs) { |
| 36 chrome::MediaGalleriesPreferences::RegisterUserPrefs(prefs); | 37 chrome::MediaGalleriesPreferences::RegisterUserPrefs(prefs); |
| 37 } | 38 } |
| 38 | 39 |
| 39 bool MediaGalleriesPreferencesFactory::ServiceRedirectedInIncognito() const { | 40 bool MediaGalleriesPreferencesFactory::ServiceRedirectedInIncognito() const { |
| 40 return true; | 41 return true; |
| 41 } | 42 } |
| OLD | NEW |