Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: chrome/browser/themes/theme_service_factory.cc

Issue 1744483002: Monitor the system native frame color on Win 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/themes/theme_service_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/themes/theme_service.h" 11 #include "chrome/browser/themes/theme_service.h"
12 #include "chrome/common/pref_names.h" 12 #include "chrome/common/pref_names.h"
13 #include "components/keyed_service/content/browser_context_dependency_manager.h" 13 #include "components/keyed_service/content/browser_context_dependency_manager.h"
14 #include "components/pref_registry/pref_registry_syncable.h" 14 #include "components/pref_registry/pref_registry_syncable.h"
15 #include "components/prefs/pref_service.h" 15 #include "components/prefs/pref_service.h"
16 #include "extensions/browser/extension_registry.h" 16 #include "extensions/browser/extension_registry.h"
17 #include "extensions/browser/extension_registry_factory.h" 17 #include "extensions/browser/extension_registry_factory.h"
18 18
19 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_CHROMEOS) 19 #if defined(OS_WIN)
20 #include "chrome/browser/themes/theme_service_win.h"
21 #elif defined(USE_AURA) && defined(USE_X11) && !defined(OS_CHROMEOS)
20 #include "chrome/browser/themes/theme_service_aurax11.h" 22 #include "chrome/browser/themes/theme_service_aurax11.h"
21 #include "ui/views/linux_ui/linux_ui.h" 23 #include "ui/views/linux_ui/linux_ui.h"
22 #endif 24 #endif
23 25
24 // static 26 // static
25 ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) { 27 ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) {
26 return static_cast<ThemeService*>( 28 return static_cast<ThemeService*>(
27 GetInstance()->GetServiceForBrowserContext(profile, true)); 29 GetInstance()->GetServiceForBrowserContext(profile, true));
28 } 30 }
29 31
(...skipping 18 matching lines...) Expand all
48 "ThemeService", 50 "ThemeService",
49 BrowserContextDependencyManager::GetInstance()) { 51 BrowserContextDependencyManager::GetInstance()) {
50 DependsOn(extensions::ExtensionRegistryFactory::GetInstance()); 52 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
51 } 53 }
52 54
53 ThemeServiceFactory::~ThemeServiceFactory() {} 55 ThemeServiceFactory::~ThemeServiceFactory() {}
54 56
55 KeyedService* ThemeServiceFactory::BuildServiceInstanceFor( 57 KeyedService* ThemeServiceFactory::BuildServiceInstanceFor(
56 content::BrowserContext* profile) const { 58 content::BrowserContext* profile) const {
57 ThemeService* provider = NULL; 59 ThemeService* provider = NULL;
58 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_CHROMEOS) 60 #if defined(OS_WIN)
61 provider = new ThemeServiceWin;
62 #elif defined(USE_AURA) && defined(USE_X11) && !defined(OS_CHROMEOS)
59 provider = new ThemeServiceAuraX11; 63 provider = new ThemeServiceAuraX11;
60 #else 64 #else
61 provider = new ThemeService; 65 provider = new ThemeService;
62 #endif 66 #endif
63 provider->Init(static_cast<Profile*>(profile)); 67 provider->Init(static_cast<Profile*>(profile));
64 68
65 return provider; 69 return provider;
66 } 70 }
67 71
68 void ThemeServiceFactory::RegisterProfilePrefs( 72 void ThemeServiceFactory::RegisterProfilePrefs(
(...skipping 21 matching lines...) Expand all
90 } 94 }
91 95
92 content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse( 96 content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse(
93 content::BrowserContext* context) const { 97 content::BrowserContext* context) const {
94 return chrome::GetBrowserContextRedirectedInIncognito(context); 98 return chrome::GetBrowserContextRedirectedInIncognito(context);
95 } 99 }
96 100
97 bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const { 101 bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const {
98 return true; 102 return true;
99 } 103 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service.cc ('k') | chrome/browser/themes/theme_service_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698