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 "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/incognito_helpers.h" | 10 #include "chrome/browser/profiles/incognito_helpers.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 59 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
60 provider = new ThemeServiceAuraX11; | 60 provider = new ThemeServiceAuraX11; |
61 #else | 61 #else |
62 provider = new ThemeService; | 62 provider = new ThemeService; |
63 #endif | 63 #endif |
64 provider->Init(static_cast<Profile*>(profile)); | 64 provider->Init(static_cast<Profile*>(profile)); |
65 | 65 |
66 return provider; | 66 return provider; |
67 } | 67 } |
68 | 68 |
69 void ThemeServiceFactory::RegisterUserPrefs( | 69 void ThemeServiceFactory::RegisterProfilePrefs( |
70 user_prefs::PrefRegistrySyncable* registry) { | 70 user_prefs::PrefRegistrySyncable* registry) { |
71 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 71 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
72 bool default_uses_system_theme = false; | 72 bool default_uses_system_theme = false; |
73 | 73 |
74 #if defined(TOOLKIT_GTK) | 74 #if defined(TOOLKIT_GTK) |
75 default_uses_system_theme = GtkThemeService::DefaultUsesSystemTheme(); | 75 default_uses_system_theme = GtkThemeService::DefaultUsesSystemTheme(); |
76 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 76 #elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
77 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance(); | 77 const ui::LinuxUI* linux_ui = ui::LinuxUI::instance(); |
78 if (linux_ui) | 78 if (linux_ui) |
79 default_uses_system_theme = linux_ui->GetDefaultUsesSystemTheme(); | 79 default_uses_system_theme = linux_ui->GetDefaultUsesSystemTheme(); |
(...skipping 27 matching lines...) Expand all Loading... |
107 } | 107 } |
108 | 108 |
109 content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse( | 109 content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse( |
110 content::BrowserContext* context) const { | 110 content::BrowserContext* context) const { |
111 return chrome::GetBrowserContextRedirectedInIncognito(context); | 111 return chrome::GetBrowserContextRedirectedInIncognito(context); |
112 } | 112 } |
113 | 113 |
114 bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 114 bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
115 return true; | 115 return true; |
116 } | 116 } |
OLD | NEW |