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

Unified Diff: chrome/browser/speech/tts_extension_loader_chromeos.h

Issue 149233004: Revert "Automatically trigger installation of high-quality speech synthesis extension." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Don't remove WillSpeakUtteranceWithVoice, it is dependent upon by a test now. Created 6 years, 10 months 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
« no previous file with comments | « chrome/browser/speech/tts_controller.cc ('k') | chrome/browser/speech/tts_extension_loader_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/tts_extension_loader_chromeos.h
diff --git a/chrome/browser/speech/tts_extension_loader_chromeos.h b/chrome/browser/speech/tts_extension_loader_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..febe2e6eddd53e122faee602e084ed8c5ee215e0
--- /dev/null
+++ b/chrome/browser/speech/tts_extension_loader_chromeos.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
+#define CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
+
+#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+#include "extensions/browser/event_router.h"
+
+class Profile;
+
+// Profile-keyed class that loads a built-in TTS component extension
+// into a given profile on Chrome OS.
+class TtsExtensionLoaderChromeOs
+ : public BrowserContextKeyedService,
+ public extensions::EventRouter::Observer {
+ public:
+ static TtsExtensionLoaderChromeOs* GetInstance(Profile* profile);
+
+ // Returns true if the extension was not previously loaded and is now
+ // loading. This class will call
+ // ExtensionTtsController::RetrySpeakingQueuedUtterances when the
+ // extension finishes loading.
+ bool LoadTtsExtension();
+
+ // Implementation of BrowserContextKeyedService.
+ virtual void Shutdown() OVERRIDE;
+
+ // Implementation of extensions::EventRouter::Observer.
+ virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
+ OVERRIDE;
+
+ private:
+ // The state of TTS for this profile.
+ enum TtsState {
+ TTS_NOT_LOADED,
+ TTS_LOAD_REQUESTED,
+ TTS_LOADING,
+ TTS_LOADED
+ };
+
+ explicit TtsExtensionLoaderChromeOs(Profile* profile);
+ virtual ~TtsExtensionLoaderChromeOs() {}
+
+ bool IsTtsLoadedInThisProfile();
+
+ Profile* profile_;
+ TtsState tts_state_;
+
+ friend class TtsExtensionLoaderChromeOsFactory;
+
+ DISALLOW_COPY_AND_ASSIGN(TtsExtensionLoaderChromeOs);
+};
+
+#endif // CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
« no previous file with comments | « chrome/browser/speech/tts_controller.cc ('k') | chrome/browser/speech/tts_extension_loader_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698