Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

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

Issue 22964005: Remove NOTIFICATION_USER_STYLE_SHEET_UPDATED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: If-defs... 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/files/file_path.h" 9 #include "base/files/file_path.h"
9 #include "base/files/file_path_watcher.h" 10 #include "base/files/file_path_watcher.h"
10 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/sequenced_task_runner_helpers.h" 13 #include "base/sequenced_task_runner_helpers.h"
13 #include "components/browser_context_keyed_service/refcounted_browser_context_ke yed_service.h" 14 #include "components/browser_context_keyed_service/refcounted_browser_context_ke yed_service.h"
14 #include "content/public/browser/notification_observer.h" 15 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h" 16 #include "content/public/browser/notification_registrar.h"
16 #include "url/gurl.h" 17 #include "url/gurl.h"
17 18
18 class Profile; 19 class Profile;
19 class UserStyleSheetLoader; 20 class UserStyleSheetLoader;
20 21
21 // Watches the user style sheet file and triggers reloads on the file thread 22 // Watches the user style sheet file and triggers reloads on the file thread
22 // whenever the file changes. 23 // whenever the file changes.
23 class UserStyleSheetWatcher 24 class UserStyleSheetWatcher
24 : public content::NotificationObserver, 25 : public content::NotificationObserver,
25 public RefcountedBrowserContextKeyedService { 26 public RefcountedBrowserContextKeyedService {
26 public: 27 public:
27 UserStyleSheetWatcher(Profile* profile, const base::FilePath& profile_path); 28 UserStyleSheetWatcher(Profile* profile, const base::FilePath& profile_path);
28 29
29 void Init(); 30 void Init();
30 31
31 GURL user_style_sheet() const; 32 GURL user_style_sheet() const;
32 33
34 void RegisterOnLoadedCallback(const base::Closure& callback);
battre 2013/08/19 08:32:19 Can you add a comment on what "Loaded" meant? When
Cait (Slow) 2013/08/19 14:56:39 Done.
35
33 // content::NotificationObserver interface 36 // content::NotificationObserver interface
34 virtual void Observe(int type, 37 virtual void Observe(int type,
35 const content::NotificationSource& source, 38 const content::NotificationSource& source,
36 const content::NotificationDetails& details) OVERRIDE; 39 const content::NotificationDetails& details) OVERRIDE;
37 40
38 // RefCountedProfileKeyedBase method override. 41 // RefCountedProfileKeyedBase method override.
39 virtual void ShutdownOnUIThread() OVERRIDE; 42 virtual void ShutdownOnUIThread() OVERRIDE;
40 43
41 private: 44 private:
42 friend class base::DeleteHelper<UserStyleSheetWatcher>; 45 friend class base::DeleteHelper<UserStyleSheetWatcher>;
(...skipping 11 matching lines...) Expand all
54 57
55 // Watches for changes to the css file so we can reload the style sheet. 58 // Watches for changes to the css file so we can reload the style sheet.
56 scoped_ptr<base::FilePathWatcher> file_watcher_; 59 scoped_ptr<base::FilePathWatcher> file_watcher_;
57 60
58 content::NotificationRegistrar registrar_; 61 content::NotificationRegistrar registrar_;
59 62
60 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher); 63 DISALLOW_COPY_AND_ASSIGN(UserStyleSheetWatcher);
61 }; 64 };
62 65
63 #endif // CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_H_ 66 #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