Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: chrome/browser/extensions/external_component_loader.h

Issue 102263005: Automatically trigger installation of high-quality speech synthesis extension. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix debug assertion Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « chrome/browser/extensions/component_loader.cc ('k') | chrome/browser/extensions/external_component_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698