Chromium Code Reviews| Index: chrome/browser/extensions/extension_prefs.h |
| diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h |
| index 8c8be82e15eb3db056902a833e593fe705c2bad3..872529b2c443d5856a9e4c373cdc58a4ebc04e5b 100644 |
| --- a/chrome/browser/extensions/extension_prefs.h |
| +++ b/chrome/browser/extensions/extension_prefs.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -11,7 +11,9 @@ |
| #include <vector> |
| #include "base/linked_ptr.h" |
| +#include "base/ref_counted.h" |
|
Mattias Nissler (ping if slow)
2011/01/07 10:12:58
No need for this header.
battre
2011/01/10 16:55:47
Done.
|
| #include "base/time.h" |
| +#include "chrome/browser/extensions/extension_pref_value_map.h" |
|
Mattias Nissler (ping if slow)
2011/01/07 10:12:58
I think a forward declaration would suffice.
battre
2011/01/10 16:55:47
Done.
|
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/common/extensions/extension.h" |
| #include "googleurl/src/gurl.h" |
| @@ -59,9 +61,10 @@ class ExtensionPrefs { |
| LAUNCH_WINDOW |
| }; |
| + // Does not assume ownership of |prefs| and |incognito_prefs|. |
| explicit ExtensionPrefs(PrefService* prefs, |
| const FilePath& root_dir, |
| - ExtensionPrefStore* extension_pref_store); |
| + ExtensionPrefValueMap* extension_pref_value_map); |
| ~ExtensionPrefs(); |
| // Returns a copy of the Extensions prefs. |
| @@ -102,8 +105,8 @@ class ExtensionPrefs { |
| // Called to change the extension's state when it is enabled/disabled. |
| void SetExtensionState(const Extension* extension, Extension::State); |
| - // Returns all installed and enabled extensions |
| - void GetEnabledExtensions(ExtensionIdSet* out) const; |
| + // Returns all installed extensions |
| + void GetExtensions(ExtensionIdSet* out) const; |
| // Getter and setter for browser action visibility. |
| bool GetBrowserActionVisibility(const Extension* extension); |
| @@ -263,6 +266,7 @@ class ExtensionPrefs { |
| // global the extension wants to override. |
| void SetExtensionControlledPref(const std::string& extension_id, |
| const std::string& pref_key, |
| + bool incognito, |
| Value* value); |
| static void RegisterUserPrefs(PrefService* prefs); |
| @@ -335,7 +339,7 @@ class ExtensionPrefs { |
| DictionaryValue* GetExtensionPref(const std::string& id) const; |
| // Returns the dictionary of preferences controlled by the specified extension |
| - // or NULL if unknown. All entries in the dictionary contain non-expanded |
| + // or creates a new one. All entries in the dictionary contain non-expanded |
| // paths. |
| DictionaryValue* GetExtensionControlledPrefs(const std::string& id) const; |
| @@ -367,32 +371,14 @@ class ExtensionPrefs { |
| // pref store. |
| void InitPrefStore(); |
| - // Returns the extension controlled preference value of the extension that was |
| - // installed most recently. |
| - const Value* GetWinningExtensionControlledPrefValue( |
| - const std::string& key) const; |
| - |
| - // Executes UpdatePrefStore for all |pref_keys|. |
| - void UpdatePrefStore(const PrefKeySet& pref_keys); |
| - |
| - // Finds the most recently installed extension that defines a preference |
| - // for |pref_key|, then stores its value in the PrefValueStore's extension |
| - // pref store and sends notifications to observers in case the value changed. |
| - void UpdatePrefStore(const std::string& pref_key); |
| - |
| - // Retrieves a list of preference keys that the specified extension |
| - // intends to manage. Keys are always appended, |out| is not cleared. |
| - void GetExtensionControlledPrefKeys(const std::string& extension_id, |
| - PrefKeySet *out) const; |
| - |
| - // The pref service specific to this set of extension prefs. |
| + // The pref service specific to this set of extension prefs. Owned by profile. |
| PrefService* prefs_; |
| // Base extensions install directory. |
| FilePath install_directory_; |
| - // Used to manipulate extension preferences. |
| - ExtensionPrefStore* pref_store_; |
| + // Weak pointer, owned by Profile. |
| + ExtensionPrefValueMap* extension_pref_value_map_; |
| // The URLs of all of the toolstrips. |
| URLList shelf_order_; |