Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / browser / user_style_sheet_watcher_factory.cc
blobf0f6b9299467ed272f83b1272874bce373c1c89f
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
3 // found in the LICENSE file.
5 #include "chrome/browser/user_style_sheet_watcher_factory.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/profiles/profile_dependency_manager.h"
9 #include "chrome/browser/user_style_sheet_watcher.h"
11 // static
12 scoped_refptr<UserStyleSheetWatcher>
13 UserStyleSheetWatcherFactory::GetForProfile(
14 Profile* profile) {
15 return static_cast<UserStyleSheetWatcher*>(
16 GetInstance()->GetServiceForProfile(profile, true).get());
19 // static
20 UserStyleSheetWatcherFactory* UserStyleSheetWatcherFactory::GetInstance() {
21 return Singleton<UserStyleSheetWatcherFactory>::get();
24 UserStyleSheetWatcherFactory::UserStyleSheetWatcherFactory()
25 : RefcountedProfileKeyedServiceFactory(
26 "UserStyleSheetWatcher", ProfileDependencyManager::GetInstance()) {
29 UserStyleSheetWatcherFactory::~UserStyleSheetWatcherFactory() {
32 scoped_refptr<RefcountedProfileKeyedService>
33 UserStyleSheetWatcherFactory::BuildServiceInstanceFor(Profile* profile) const {
34 scoped_refptr<UserStyleSheetWatcher> user_style_sheet_watcher(
35 new UserStyleSheetWatcher(profile, profile->GetPath()));
36 user_style_sheet_watcher->Init();
37 return user_style_sheet_watcher;
40 bool UserStyleSheetWatcherFactory::ServiceRedirectedInIncognito() const {
41 return true;
44 bool UserStyleSheetWatcherFactory::ServiceIsNULLWhileTesting() const {
45 return true;