| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "chrome/browser/extensions/external_extension_provider.h" | 12 #include "chrome/browser/extensions/external_extension_provider.h" |
| 13 | 13 |
| 14 class DictionaryValue; | 14 class DictionaryValue; |
| 15 class ValueSerializer; |
| 15 class Version; | 16 class Version; |
| 16 | 17 |
| 17 // A specialization of the ExternalExtensionProvider that uses a json file to | 18 // A specialization of the ExternalExtensionProvider that uses a json file to |
| 18 // look up which external extensions are registered. | 19 // look up which external extensions are registered. |
| 19 class ExternalPrefExtensionProvider : public ExternalExtensionProvider { | 20 class ExternalPrefExtensionProvider : public ExternalExtensionProvider { |
| 20 public: | 21 public: |
| 21 explicit ExternalPrefExtensionProvider(); | 22 explicit ExternalPrefExtensionProvider(); |
| 22 virtual ~ExternalPrefExtensionProvider(); | 23 virtual ~ExternalPrefExtensionProvider(); |
| 23 | 24 |
| 24 // Used only during testing to not use the json file for external extensions, | 25 // Used only during testing to not use the json file for external extensions, |
| 25 // but instead parse a json file specified by the test. | 26 // but instead parse a json file specified by the test. |
| 26 void SetPreferencesForTesting(const std::string& json_data_for_testing); | 27 void SetPreferencesForTesting(const std::string& json_data_for_testing); |
| 27 | 28 |
| 28 // ExternalExtensionProvider implementation: | 29 // ExternalExtensionProvider implementation: |
| 29 virtual void VisitRegisteredExtension( | 30 virtual void VisitRegisteredExtension( |
| 30 Visitor* visitor, const std::set<std::string>& ids_to_ignore) const; | 31 Visitor* visitor, const std::set<std::string>& ids_to_ignore) const; |
| 31 | 32 |
| 32 virtual Version* RegisteredVersion(const std::string& id, | 33 virtual Version* RegisteredVersion(const std::string& id, |
| 33 Extension::Location* location) const; | 34 Extension::Location* location) const; |
| 34 protected: | 35 protected: |
| 35 scoped_ptr<DictionaryValue> prefs_; | 36 scoped_ptr<DictionaryValue> prefs_; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 void SetPreferences(ValueSerializer* serializer); | 39 void SetPreferences(ValueSerializer* serializer); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ | 42 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PREF_EXTENSION_PROVIDER_H_ |
| OLD | NEW |