#ifndef CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_
#define CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_
#include "base/file_path.h"
#include "base/files/file_path_watcher.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/sequenced_task_runner_helpers.h"
#include "chrome/browser/profiles/refcounted_profile_keyed_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "googleurl/src/gurl.h"
class Profile;
class UserStyleSheetLoader;
class UserStyleSheetWatcher
: public content::NotificationObserver,
public RefcountedProfileKeyedService {
public:
UserStyleSheetWatcher(Profile* profile, const FilePath& profile_path);
void Init();
GURL user_style_sheet() const;
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
virtual void ShutdownOnUIThread() OVERRIDE;
private:
friend class base::DeleteHelper<UserStyleSheetWatcher>;
virtual ~UserStyleSheetWatcher();
Profile* profile_;
FilePath profile_path_;
scoped_refptr<UserStyleSheetLoader> loader_;
scoped_ptr<base::files::FilePathWatcher> file_watcher_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher);
};
#endif