Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chrome/browser/user_style_sheet_watcher.h

Issue 22859034: WIP CallbackList in action (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.cc ('k') | chrome/browser/user_style_sheet_watcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_path_watcher.h" 10 #include "base/files/file_path_watcher.h"
(...skipping 14 matching lines...) Expand all
25 : public content::NotificationObserver, 25 : public content::NotificationObserver,
26 public RefcountedBrowserContextKeyedService { 26 public RefcountedBrowserContextKeyedService {
27 public: 27 public:
28 UserStyleSheetWatcher(Profile* profile, const base::FilePath& profile_path); 28 UserStyleSheetWatcher(Profile* profile, const base::FilePath& profile_path);
29 29
30 void Init(); 30 void Init();
31 31
32 GURL user_style_sheet() const; 32 GURL user_style_sheet() const;
33 33
34 // Register a callback to be called whenever the stylesheet gets updated. 34 // Register a callback to be called whenever the stylesheet gets updated.
35 void RegisterOnStyleSheetUpdatedCallback(const base::Closure& callback); 35 base::Closure RegisterOnStyleSheetUpdatedCallback(
36 const base::Closure& callback);
36 37
37 // content::NotificationObserver interface 38 // content::NotificationObserver interface
38 virtual void Observe(int type, 39 virtual void Observe(int type,
39 const content::NotificationSource& source, 40 const content::NotificationSource& source,
40 const content::NotificationDetails& details) OVERRIDE; 41 const content::NotificationDetails& details) OVERRIDE;
41 42
42 // RefCountedProfileKeyedBase method override. 43 // RefCountedProfileKeyedBase method override.
43 virtual void ShutdownOnUIThread() OVERRIDE; 44 virtual void ShutdownOnUIThread() OVERRIDE;
44 45
45 private: 46 private:
(...skipping 12 matching lines...) Expand all
58 59
59 // Watches for changes to the css file so we can reload the style sheet. 60 // Watches for changes to the css file so we can reload the style sheet.
60 scoped_ptr<base::FilePathWatcher> file_watcher_; 61 scoped_ptr<base::FilePathWatcher> file_watcher_;
61 62
62 content::NotificationRegistrar registrar_; 63 content::NotificationRegistrar registrar_;
63 64
64 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); 65 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher);
65 }; 66 };
66 67
67 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ 68 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.cc ('k') | chrome/browser/user_style_sheet_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698