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"
12 scoped_refptr
<UserStyleSheetWatcher
>
13 UserStyleSheetWatcherFactory::GetForProfile(
15 return static_cast<UserStyleSheetWatcher
*>(
16 GetInstance()->GetServiceForProfile(profile
, true).get());
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 {
44 bool UserStyleSheetWatcherFactory::ServiceIsNULLWhileTesting() const {