| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/browser_thread.h" | 12 #include "chrome/browser/browser_thread.h" |
| 13 #include "chrome/browser/file_path_watcher.h" | 13 #include "chrome/browser/file_path_watcher/file_path_watcher.h" |
| 14 #include "chrome/common/notification_observer.h" | 14 #include "chrome/common/notification_observer.h" |
| 15 #include "chrome/common/notification_registrar.h" | 15 #include "chrome/common/notification_registrar.h" |
| 16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 17 | 17 |
| 18 class UserStyleSheetLoader; | 18 class UserStyleSheetLoader; |
| 19 | 19 |
| 20 // Watches the user style sheet file and triggers reloads on the file thread | 20 // Watches the user style sheet file and triggers reloads on the file thread |
| 21 // whenever the file changes. | 21 // whenever the file changes. |
| 22 class UserStyleSheetWatcher | 22 class UserStyleSheetWatcher |
| 23 : public base::RefCountedThreadSafe<UserStyleSheetWatcher, | 23 : public base::RefCountedThreadSafe<UserStyleSheetWatcher, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 | 45 |
| 46 // Watches for changes to the css file so we can reload the style sheet. | 46 // Watches for changes to the css file so we can reload the style sheet. |
| 47 scoped_ptr<FilePathWatcher> file_watcher_; | 47 scoped_ptr<FilePathWatcher> file_watcher_; |
| 48 | 48 |
| 49 NotificationRegistrar registrar_; | 49 NotificationRegistrar registrar_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); | 51 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ | 54 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ |
| OLD | NEW |