[M85 Dev][EFL] Fix errors to generate ninja files
[platform/framework/web/chromium-efl.git] / chrome / browser / font_pref_change_notifier_factory.cc
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/font_pref_change_notifier_factory.h"
6
7 #include "chrome/browser/font_pref_change_notifier.h"
8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11
12 FontPrefChangeNotifierFactory::FontPrefChangeNotifierFactory()
13     : BrowserContextKeyedServiceFactory(
14           "FontPrefChangeNotifier",
15           BrowserContextDependencyManager::GetInstance()) {}
16
17 FontPrefChangeNotifierFactory::~FontPrefChangeNotifierFactory() = default;
18
19 // static
20 FontPrefChangeNotifier* FontPrefChangeNotifierFactory::GetForProfile(
21     Profile* profile) {
22   return static_cast<FontPrefChangeNotifier*>(
23       GetInstance()->GetServiceForBrowserContext(profile, true));
24 }
25
26 // static
27 FontPrefChangeNotifierFactory* FontPrefChangeNotifierFactory::GetInstance() {
28   return base::Singleton<FontPrefChangeNotifierFactory>::get();
29 }
30
31 KeyedService* FontPrefChangeNotifierFactory::BuildServiceInstanceFor(
32     content::BrowserContext* context) const {
33   return new FontPrefChangeNotifier(
34       Profile::FromBrowserContext(context)->GetPrefs());
35 }
36
37 content::BrowserContext* FontPrefChangeNotifierFactory::GetBrowserContextToUse(
38     content::BrowserContext* context) const {
39   return chrome::GetBrowserContextRedirectedInIncognito(context);
40 }