OLD | NEW |
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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/linked_ptr.h" | 13 #include "base/linked_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
| 19 class ExtensionPrefStore; |
| 20 |
19 // Class for managing global and per-extension preferences. | 21 // Class for managing global and per-extension preferences. |
20 // | 22 // |
21 // This class distinguishes the following kinds of preferences: | 23 // This class distinguishes the following kinds of preferences: |
22 // - global preferences: | 24 // - global preferences: |
23 // internal state for the extension system in general, not associated | 25 // internal state for the extension system in general, not associated |
24 // with an individual extension, such as lastUpdateTime. | 26 // with an individual extension, such as lastUpdateTime. |
25 // - per-extension preferences: | 27 // - per-extension preferences: |
26 // meta-preferences describing properties of the extension like | 28 // meta-preferences describing properties of the extension like |
27 // installation time, whether the extension is enabled, etc. | 29 // installation time, whether the extension is enabled, etc. |
28 // - extension controlled preferences: | 30 // - extension controlled preferences: |
(...skipping 21 matching lines...) Expand all Loading... |
50 // application. | 52 // application. |
51 // Do not remove items or re-order this enum as it is used in preferences | 53 // Do not remove items or re-order this enum as it is used in preferences |
52 // and histograms. | 54 // and histograms. |
53 enum LaunchType { | 55 enum LaunchType { |
54 LAUNCH_PINNED, | 56 LAUNCH_PINNED, |
55 LAUNCH_REGULAR, | 57 LAUNCH_REGULAR, |
56 LAUNCH_FULLSCREEN, | 58 LAUNCH_FULLSCREEN, |
57 LAUNCH_WINDOW | 59 LAUNCH_WINDOW |
58 }; | 60 }; |
59 | 61 |
60 explicit ExtensionPrefs(PrefService* prefs, const FilePath& root_dir); | 62 explicit ExtensionPrefs(PrefService* prefs, |
| 63 const FilePath& root_dir, |
| 64 ExtensionPrefStore* extension_pref_store); |
61 ~ExtensionPrefs(); | 65 ~ExtensionPrefs(); |
62 | 66 |
63 // Returns a copy of the Extensions prefs. | 67 // Returns a copy of the Extensions prefs. |
64 // TODO(erikkay) Remove this so that external consumers don't need to be | 68 // TODO(erikkay) Remove this so that external consumers don't need to be |
65 // aware of the internal structure of the preferences. | 69 // aware of the internal structure of the preferences. |
66 DictionaryValue* CopyCurrentExtensions(); | 70 DictionaryValue* CopyCurrentExtensions(); |
67 | 71 |
68 // Returns true if the specified extension has an entry in prefs | 72 // Returns true if the specified extension has an entry in prefs |
69 // and its killbit is on. | 73 // and its killbit is on. |
70 bool IsExtensionKilled(const std::string& id); | 74 bool IsExtensionKilled(const std::string& id); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // intends to manage. Keys are always appended, |out| is not cleared. | 384 // intends to manage. Keys are always appended, |out| is not cleared. |
381 void GetExtensionControlledPrefKeys(const std::string& extension_id, | 385 void GetExtensionControlledPrefKeys(const std::string& extension_id, |
382 PrefKeySet *out) const; | 386 PrefKeySet *out) const; |
383 | 387 |
384 // The pref service specific to this set of extension prefs. | 388 // The pref service specific to this set of extension prefs. |
385 PrefService* prefs_; | 389 PrefService* prefs_; |
386 | 390 |
387 // Base extensions install directory. | 391 // Base extensions install directory. |
388 FilePath install_directory_; | 392 FilePath install_directory_; |
389 | 393 |
| 394 // Used to manipulate extension preferences. |
| 395 ExtensionPrefStore* pref_store_; |
| 396 |
390 // The URLs of all of the toolstrips. | 397 // The URLs of all of the toolstrips. |
391 URLList shelf_order_; | 398 URLList shelf_order_; |
392 | 399 |
393 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 400 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
394 }; | 401 }; |
395 | 402 |
396 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 403 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
OLD | NEW |