OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ | 5 #ifndef CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ |
6 #define CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ | 6 #define CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/files/file_path_watcher.h" | 10 #include "base/files/file_path_watcher.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 UserStyleSheetWatcher(Profile* profile, const FilePath& profile_path); | 29 UserStyleSheetWatcher(Profile* profile, const FilePath& profile_path); |
30 | 30 |
31 void Init(); | 31 void Init(); |
32 | 32 |
33 GURL user_style_sheet() const; | 33 GURL user_style_sheet() const; |
34 | 34 |
35 // content::NotificationObserver interface | 35 // content::NotificationObserver interface |
36 virtual void Observe(int type, | 36 virtual void Observe(int type, |
37 const content::NotificationSource& source, | 37 const content::NotificationSource& source, |
38 const content::NotificationDetails& details); | 38 const content::NotificationDetails& details) OVERRIDE; |
39 | 39 |
40 private: | 40 private: |
41 friend struct content::BrowserThread::DeleteOnThread< | 41 friend struct content::BrowserThread::DeleteOnThread< |
42 content::BrowserThread::UI>; | 42 content::BrowserThread::UI>; |
43 friend class DeleteTask<UserStyleSheetWatcher>; | 43 friend class DeleteTask<UserStyleSheetWatcher>; |
44 | 44 |
45 virtual ~UserStyleSheetWatcher(); | 45 virtual ~UserStyleSheetWatcher(); |
46 | 46 |
47 // The profile owning us. | 47 // The profile owning us. |
48 Profile* profile_; | 48 Profile* profile_; |
49 | 49 |
50 // The directory containing User StyleSheets/Custom.css. | 50 // The directory containing User StyleSheets/Custom.css. |
51 FilePath profile_path_; | 51 FilePath profile_path_; |
52 | 52 |
53 // The loader object. | 53 // The loader object. |
54 scoped_refptr<UserStyleSheetLoader> loader_; | 54 scoped_refptr<UserStyleSheetLoader> loader_; |
55 | 55 |
56 // Watches for changes to the css file so we can reload the style sheet. | 56 // Watches for changes to the css file so we can reload the style sheet. |
57 scoped_ptr<base::files::FilePathWatcher> file_watcher_; | 57 scoped_ptr<base::files::FilePathWatcher> file_watcher_; |
58 | 58 |
59 content::NotificationRegistrar registrar_; | 59 content::NotificationRegistrar registrar_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); | 61 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); |
62 }; | 62 }; |
63 | 63 |
64 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ | 64 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ |
OLD | NEW |