| 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/file_path_watcher/file_path_watcher.h" | |
| 13 #include "chrome/common/notification_observer.h" | 12 #include "chrome/common/notification_observer.h" |
| 14 #include "chrome/common/notification_registrar.h" | 13 #include "chrome/common/notification_registrar.h" |
| 15 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
| 15 #include "content/common/file_path_watcher/file_path_watcher.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, |
| 24 BrowserThread::DeleteOnUIThread>, | 24 BrowserThread::DeleteOnUIThread>, |
| 25 public NotificationObserver { | 25 public NotificationObserver { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 // Watches for changes to the css file so we can reload the style sheet. | 50 // Watches for changes to the css file so we can reload the style sheet. |
| 51 scoped_ptr<FilePathWatcher> file_watcher_; | 51 scoped_ptr<FilePathWatcher> file_watcher_; |
| 52 | 52 |
| 53 NotificationRegistrar registrar_; | 53 NotificationRegistrar registrar_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); | 55 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ | 58 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ |
| OLD | NEW |