OLD | NEW |
1 // Copyright (c) 2009 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_EXTENSIONS_EXTENSION_PREFS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Saves ExtensionInfo for each installed extension with the path to the | 108 // Saves ExtensionInfo for each installed extension with the path to the |
109 // version directory and the location. Blacklisted extensions won't be saved | 109 // version directory and the location. Blacklisted extensions won't be saved |
110 // and neither will external extensions the user has explicitly uninstalled. | 110 // and neither will external extensions the user has explicitly uninstalled. |
111 // Caller takes ownership of returned structure. | 111 // Caller takes ownership of returned structure. |
112 ExtensionsInfo* GetInstalledExtensionsInfo(); | 112 ExtensionsInfo* GetInstalledExtensionsInfo(); |
113 | 113 |
114 // Returns the ExtensionInfo from the prefs for the given extension. If the | 114 // Returns the ExtensionInfo from the prefs for the given extension. If the |
115 // extension is not present, NULL is returned. | 115 // extension is not present, NULL is returned. |
116 ExtensionInfo* GetInstalledExtensionInfo(const std::string& extension_id); | 116 ExtensionInfo* GetInstalledExtensionInfo(const std::string& extension_id); |
117 | 117 |
| 118 // We've downloaded an updated .crx file for the extension, but are waiting |
| 119 // for idle time to install it. |
| 120 void SetIdleInstallInfo(const std::string& extension_id, |
| 121 const FilePath& crx_path, |
| 122 const std::string& version, |
| 123 const base::Time& fetch_time); |
| 124 |
| 125 // Removes any idle install information we have for the given |extension_id|. |
| 126 // Returns true if there was info to remove; false otherwise. |
| 127 bool RemoveIdleInstallInfo(const std::string& extension_id); |
| 128 |
| 129 // If we have idle install information for |extension_id|, this puts it into |
| 130 // the out parameters and returns true. Otherwise returns false. |
| 131 bool GetIdleInstallInfo(const std::string& extension_id, |
| 132 FilePath* crx_path, |
| 133 std::string* version, |
| 134 base::Time* fetch_time); |
| 135 |
| 136 // Returns the extension id's that have idle install information. |
| 137 std::set<std::string> GetIdleInstallInfoIds(); |
| 138 |
118 static void RegisterUserPrefs(PrefService* prefs); | 139 static void RegisterUserPrefs(PrefService* prefs); |
119 | 140 |
120 // The underlying PrefService. | 141 // The underlying PrefService. |
121 PrefService* pref_service() const { return prefs_; } | 142 PrefService* pref_service() const { return prefs_; } |
122 | 143 |
123 private: | 144 private: |
124 | 145 |
125 // Converts absolute paths in the pref to paths relative to the | 146 // Converts absolute paths in the pref to paths relative to the |
126 // install_directory_. | 147 // install_directory_. |
127 void MakePathsRelative(); | 148 void MakePathsRelative(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Base extensions install directory. | 188 // Base extensions install directory. |
168 FilePath install_directory_; | 189 FilePath install_directory_; |
169 | 190 |
170 // The URLs of all of the toolstrips. | 191 // The URLs of all of the toolstrips. |
171 URLList shelf_order_; | 192 URLList shelf_order_; |
172 | 193 |
173 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 194 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
174 }; | 195 }; |
175 | 196 |
176 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 197 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |