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

Side by Side Diff: chrome/browser/prefs/pref_notifier.h

Issue 3517004: Revert 60997 - o Add user customizable launch type for apps by adding options... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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/extensions/extension_prefs.cc ('k') | chrome/browser/prefs/pref_service.h » ('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) 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_PREFS_PREF_NOTIFIER_H_ 5 #ifndef CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_
6 #define CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ 6 #define CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 // Convenience method to be called when a preference is set in the 65 // Convenience method to be called when a preference is set in the
66 // USER_STORE. See OnPreferenceSet(). 66 // USER_STORE. See OnPreferenceSet().
67 void OnUserPreferenceSet(const char* pref_name); 67 void OnUserPreferenceSet(const char* pref_name);
68 68
69 // For the given pref_name, fire any observer of the pref. Virtual so it can 69 // For the given pref_name, fire any observer of the pref. Virtual so it can
70 // be mocked for unit testing. 70 // be mocked for unit testing.
71 virtual void FireObservers(const char* path); 71 virtual void FireObservers(const char* path);
72 72
73 // If the pref at the given path changes, we call the observer's Observe 73 // If the pref at the given path changes, we call the observer's Observe
74 // method with PREF_CHANGED. 74 // method with NOTIFY_PREF_CHANGED.
75 void AddPrefObserver(const char* path, NotificationObserver* obs); 75 void AddPrefObserver(const char* path, NotificationObserver* obs);
76 void RemovePrefObserver(const char* path, NotificationObserver* obs); 76 void RemovePrefObserver(const char* path, NotificationObserver* obs);
77 77
78 protected: 78 protected:
79 // A map from pref names to a list of observers. Observers get fired in the 79 // A map from pref names to a list of observers. Observers get fired in the
80 // order they are added. These should only be accessed externally for unit 80 // order they are added. These should only be accessed externally for unit
81 // testing. 81 // testing.
82 typedef ObserverList<NotificationObserver> NotificationObserverList; 82 typedef ObserverList<NotificationObserver> NotificationObserverList;
83 typedef base::hash_map<std::string, NotificationObserverList*> 83 typedef base::hash_map<std::string, NotificationObserverList*>
84 PrefObserverMap; 84 PrefObserverMap;
(...skipping 19 matching lines...) Expand all
104 104
105 // NotificationObserver methods: 105 // NotificationObserver methods:
106 virtual void Observe(NotificationType type, 106 virtual void Observe(NotificationType type,
107 const NotificationSource& source, 107 const NotificationSource& source,
108 const NotificationDetails& details); 108 const NotificationDetails& details);
109 109
110 DISALLOW_COPY_AND_ASSIGN(PrefNotifier); 110 DISALLOW_COPY_AND_ASSIGN(PrefNotifier);
111 }; 111 };
112 112
113 #endif // CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_ 113 #endif // CHROME_BROWSER_PREFS_PREF_NOTIFIER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/prefs/pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698