Index: chrome/browser/extensions/external_component_loader.h |
diff --git a/chrome/browser/extensions/external_component_loader.h b/chrome/browser/extensions/external_component_loader.h |
index 1bc75a04fc69faf2d89f180ab6b87adfe28accda..b27d50485bb6a3e8c44de31fb9c795f3d70313e2 100644 |
--- a/chrome/browser/extensions/external_component_loader.h |
+++ b/chrome/browser/extensions/external_component_loader.h |
@@ -8,7 +8,12 @@ |
#include <string> |
#include "base/compiler_specific.h" |
+#include "base/containers/hash_tables.h" |
+#include "base/memory/weak_ptr.h" |
#include "chrome/browser/extensions/external_loader.h" |
+#include "chrome/browser/profiles/profile.h" |
+ |
+class PrefChangeRegistrar; |
namespace extensions { |
@@ -18,12 +23,17 @@ namespace extensions { |
// and don't get access to component only APIs. |
// Instances of this class are expected to be created and destroyed on the UI |
// thread and they are expecting public method calls from the UI thread. |
-class ExternalComponentLoader : public ExternalLoader { |
+class ExternalComponentLoader |
+ : public ExternalLoader, |
+ public base::SupportsWeakPtr<ExternalComponentLoader> { |
public: |
- ExternalComponentLoader(); |
+ explicit ExternalComponentLoader(Profile* profile); |
static bool IsEnhancedBookmarksExperimentEnabled(); |
+ // Register speech synthesis prefs for a profile. |
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
+ |
protected: |
virtual void StartLoading() OVERRIDE; |
@@ -31,6 +41,20 @@ class ExternalComponentLoader : public ExternalLoader { |
friend class base::RefCountedThreadSafe<ExternalLoader>; |
virtual ~ExternalComponentLoader(); |
+ // The profile that this loader is associated with. It listens for |
+ // preference changes for that profile. |
+ Profile* profile_; |
+ |
+#if defined(OS_CHROMEOS) |
+ // The pref change registrar, so we can watch for pref changes. |
+ scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; |
+ |
+ // A map from language code to the extension id of the high-quality |
+ // extension for that language in the web store, if any - for loading |
+ // speech synthesis component extensions. |
+ base::hash_map<std::string, std::string> lang_to_extension_id_map_; |
+#endif |
+ |
DISALLOW_COPY_AND_ASSIGN(ExternalComponentLoader); |
}; |