| 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/themes/theme_service_factory.h" | 5 #include "chrome/browser/themes/theme_service_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.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 #include "chrome/browser/themes/theme_service.h" | 11 #include "chrome/browser/themes/theme_service.h" |
| 12 | 12 |
| 13 #if defined(TOOLKIT_USES_GTK) | 13 #if defined(TOOLKIT_USES_GTK) |
| 14 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 14 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 // static | 17 // static |
| 18 ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) { | 18 ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) { |
| 19 return static_cast<ThemeService*>( | 19 return static_cast<ThemeService*>( |
| 20 GetInstance()->GetServiceForProfile(profile, true)); | 20 GetInstance()->GetServiceForProfile(profile, true)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 const Extension* ThemeServiceFactory::GetThemeForProfile(Profile* profile) { | 24 const Extension* ThemeServiceFactory::GetThemeForProfile(Profile* profile) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 : ProfileKeyedServiceFactory("ThemeService", | 38 : ProfileKeyedServiceFactory("ThemeService", |
| 39 ProfileDependencyManager::GetInstance()) | 39 ProfileDependencyManager::GetInstance()) |
| 40 {} | 40 {} |
| 41 | 41 |
| 42 ThemeServiceFactory::~ThemeServiceFactory() {} | 42 ThemeServiceFactory::~ThemeServiceFactory() {} |
| 43 | 43 |
| 44 ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( | 44 ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( |
| 45 Profile* profile) const { | 45 Profile* profile) const { |
| 46 ThemeService* provider = NULL; | 46 ThemeService* provider = NULL; |
| 47 #if defined(TOOLKIT_USES_GTK) | 47 #if defined(TOOLKIT_USES_GTK) |
| 48 provider = new GtkThemeService; | 48 provider = new ThemeServiceGtk; |
| 49 #else | 49 #else |
| 50 provider = new ThemeService; | 50 provider = new ThemeService; |
| 51 #endif | 51 #endif |
| 52 provider->Init(profile); | 52 provider->Init(profile); |
| 53 | 53 |
| 54 return provider; | 54 return provider; |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool ThemeServiceFactory::ServiceRedirectedInIncognito() { | 57 bool ThemeServiceFactory::ServiceRedirectedInIncognito() { |
| 58 return true; | 58 return true; |
| 59 } | 59 } |
| OLD | NEW |