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

Side by Side Diff: chrome/browser/extensions/extension_pref_value_map.h

Issue 10559052: Split mode incognito extension can get misleading pref changed events from regular mode (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed some callbacks, other nits Created 8 years, 5 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
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_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // PrefService::Preference::IsExtensionModifiable() returns true as well. 102 // PrefService::Preference::IsExtensionModifiable() returns true as well.
103 bool CanExtensionControlPref(const std::string& extension_id, 103 bool CanExtensionControlPref(const std::string& extension_id,
104 const std::string& pref_key, 104 const std::string& pref_key,
105 bool incognito) const; 105 bool incognito) const;
106 106
107 // Removes all "incognito session only" preference values. 107 // Removes all "incognito session only" preference values.
108 void ClearAllIncognitoSessionOnlyPreferences(); 108 void ClearAllIncognitoSessionOnlyPreferences();
109 109
110 // Returns true if an extension identified by |extension_id| controls the 110 // Returns true if an extension identified by |extension_id| controls the
111 // preference. This means this extension has set a preference value and no 111 // preference. This means this extension has set a preference value and no
112 // other extension with higher precedence overrides it. 112 // other extension with higher precedence overrides it. If |from_incognito|
113 // is not NULL, looks at incognito preferences first, and |from_incognito| is
114 // set to true if the effective pref value is coming from the incognito
115 // preferences, false if it is coming from the normal ones.
113 // Note that the this function does does not consider the existence of 116 // Note that the this function does does not consider the existence of
114 // policies. An extension is only really able to control a preference if 117 // policies. An extension is only really able to control a preference if
115 // PrefService::Preference::IsExtensionModifiable() returns true as well. 118 // PrefService::Preference::IsExtensionModifiable() returns true as well.
116 bool DoesExtensionControlPref(const std::string& extension_id, 119 bool DoesExtensionControlPref(const std::string& extension_id,
117 const std::string& pref_key, 120 const std::string& pref_key,
118 bool incognito) const; 121 bool* from_incognito) const;
119 122
120 // Tell the store it's now fully initialized. 123 // Tell the store it's now fully initialized.
121 void NotifyInitializationCompleted(); 124 void NotifyInitializationCompleted();
122 125
123 // Registers the time when an extension |ext_id| is installed. 126 // Registers the time when an extension |ext_id| is installed.
124 void RegisterExtension(const std::string& ext_id, 127 void RegisterExtension(const std::string& ext_id,
125 const base::Time& install_time, 128 const base::Time& install_time,
126 bool is_enabled); 129 bool is_enabled);
127 130
128 // Deletes all entries related to extension |ext_id|. 131 // Deletes all entries related to extension |ext_id|.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // being destroyed. In tests, it isn't called, so the notification must 185 // being destroyed. In tests, it isn't called, so the notification must
183 // be done in the destructor. This bit tracks whether it has been done yet. 186 // be done in the destructor. This bit tracks whether it has been done yet.
184 bool destroyed_; 187 bool destroyed_;
185 188
186 ObserverList<Observer, true> observers_; 189 ObserverList<Observer, true> observers_;
187 190
188 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap); 191 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefValueMap);
189 }; 192 };
190 193
191 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_ 194 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | chrome/browser/extensions/extension_pref_value_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698