[M120][Tizen][Onscreen] Fix build errors for TV profile
[platform/framework/web/chromium-efl.git] / chrome / browser / font_pref_change_notifier_factory.cc
1 // Copyright 2017 The Chromium Authors
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/profile.h"
9
10 FontPrefChangeNotifierFactory::FontPrefChangeNotifierFactory()
11     : ProfileKeyedServiceFactory(
12           "FontPrefChangeNotifier",
13           ProfileSelections::Builder()
14               .WithRegular(ProfileSelection::kRedirectedToOriginal)
15               // TODO(crbug.com/1418376): Check if this service is needed in
16               // Guest mode.
17               .WithGuest(ProfileSelection::kRedirectedToOriginal)
18               .Build()) {}
19
20 FontPrefChangeNotifierFactory::~FontPrefChangeNotifierFactory() = default;
21
22 // static
23 FontPrefChangeNotifier* FontPrefChangeNotifierFactory::GetForProfile(
24     Profile* profile) {
25   return static_cast<FontPrefChangeNotifier*>(
26       GetInstance()->GetServiceForBrowserContext(profile, true));
27 }
28
29 // static
30 FontPrefChangeNotifierFactory* FontPrefChangeNotifierFactory::GetInstance() {
31   static base::NoDestructor<FontPrefChangeNotifierFactory> instance;
32   return instance.get();
33 }
34
35 std::unique_ptr<KeyedService>
36 FontPrefChangeNotifierFactory::BuildServiceInstanceForBrowserContext(
37     content::BrowserContext* context) const {
38   return std::make_unique<FontPrefChangeNotifier>(
39       Profile::FromBrowserContext(context)->GetPrefs());
40 }