| OLD | NEW |
| 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_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 |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" | 16 #include "chrome/browser/extensions/api/content_settings/content_settings_store.
h" |
| 17 #include "chrome/browser/extensions/extension_prefs_scope.h" | 17 #include "chrome/browser/extensions/extension_prefs_scope.h" |
| 18 #include "chrome/browser/extensions/extension_scoped_prefs.h" | 18 #include "chrome/browser/extensions/extension_scoped_prefs.h" |
| 19 #include "chrome/browser/media_gallery/media_galleries_preferences.h" | 19 #include "chrome/browser/media_gallery/media_galleries_preferences.h" |
| 20 #include "chrome/common/extensions/extension.h" | 20 #include "chrome/common/extensions/extension.h" |
| 21 #include "extensions/common/url_pattern_set.h" | 21 #include "extensions/common/url_pattern_set.h" |
| 22 #include "sync/api/string_ordinal.h" | 22 #include "sync/api/string_ordinal.h" |
| 23 | 23 |
| 24 class ExtensionPrefValueMap; | 24 class ExtensionPrefValueMap; |
| 25 class ExtensionSorting; | 25 class ExtensionSorting; |
| 26 class PrefService; | 26 class PrefService; |
| 27 class PrefServiceSyncable; |
| 27 | 28 |
| 28 namespace extensions { | 29 namespace extensions { |
| 29 class ExtensionPrefsUninstallExtension; | 30 class ExtensionPrefsUninstallExtension; |
| 30 class URLPatternSet; | 31 class URLPatternSet; |
| 31 struct ExtensionOmniboxSuggestion; | 32 struct ExtensionOmniboxSuggestion; |
| 32 | 33 |
| 33 // Class for managing global and per-extension preferences. | 34 // Class for managing global and per-extension preferences. |
| 34 // | 35 // |
| 35 // This class distinguishes the following kinds of preferences: | 36 // This class distinguishes the following kinds of preferences: |
| 36 // - global preferences: | 37 // - global preferences: |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 bool IsFromBookmark(const std::string& extension_id) const; | 479 bool IsFromBookmark(const std::string& extension_id) const; |
| 479 | 480 |
| 480 // Returns true if the extension was installed as a default app. | 481 // Returns true if the extension was installed as a default app. |
| 481 bool WasInstalledByDefault(const std::string& extension_id) const; | 482 bool WasInstalledByDefault(const std::string& extension_id) const; |
| 482 | 483 |
| 483 // Helper method to acquire the installation time of an extension. | 484 // Helper method to acquire the installation time of an extension. |
| 484 // Returns base::Time() if the installation time could not be parsed or | 485 // Returns base::Time() if the installation time could not be parsed or |
| 485 // found. | 486 // found. |
| 486 base::Time GetInstallTime(const std::string& extension_id) const; | 487 base::Time GetInstallTime(const std::string& extension_id) const; |
| 487 | 488 |
| 488 static void RegisterUserPrefs(PrefService* prefs); | 489 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 489 | 490 |
| 490 ContentSettingsStore* content_settings_store() { | 491 ContentSettingsStore* content_settings_store() { |
| 491 return content_settings_store_.get(); | 492 return content_settings_store_.get(); |
| 492 } | 493 } |
| 493 | 494 |
| 494 // The underlying PrefService. | 495 // The underlying PrefService. |
| 495 PrefService* pref_service() const { return prefs_; } | 496 PrefService* pref_service() const { return prefs_; } |
| 496 | 497 |
| 497 // The underlying ExtensionSorting. | 498 // The underlying ExtensionSorting. |
| 498 ExtensionSorting* extension_sorting() const { | 499 ExtensionSorting* extension_sorting() const { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 scoped_refptr<ContentSettingsStore> content_settings_store_; | 657 scoped_refptr<ContentSettingsStore> content_settings_store_; |
| 657 | 658 |
| 658 scoped_ptr<TimeProvider> time_provider_; | 659 scoped_ptr<TimeProvider> time_provider_; |
| 659 | 660 |
| 660 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 661 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
| 661 }; | 662 }; |
| 662 | 663 |
| 663 } // namespace extensions | 664 } // namespace extensions |
| 664 | 665 |
| 665 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ | 666 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ |
| OLD | NEW |