1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
6 #define CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
8 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
9 #include "extensions/browser/event_router.h"
13 // Profile-keyed class that loads a built-in TTS component extension
14 // into a given profile on Chrome OS.
15 class TtsExtensionLoaderChromeOs
16 : public BrowserContextKeyedService
,
17 public extensions::EventRouter::Observer
{
19 static TtsExtensionLoaderChromeOs
* GetInstance(Profile
* profile
);
21 // Returns true if the extension was not previously loaded and is now
22 // loading. This class will call
23 // ExtensionTtsController::RetrySpeakingQueuedUtterances when the
24 // extension finishes loading.
25 bool LoadTtsExtension();
27 // Implementation of BrowserContextKeyedService.
28 virtual void Shutdown() OVERRIDE
;
30 // Implementation of extensions::EventRouter::Observer.
31 virtual void OnListenerAdded(const extensions::EventListenerInfo
& details
)
35 // The state of TTS for this profile.
43 explicit TtsExtensionLoaderChromeOs(Profile
* profile
);
44 virtual ~TtsExtensionLoaderChromeOs() {}
46 bool IsTtsLoadedInThisProfile();
51 friend class TtsExtensionLoaderChromeOsFactory
;
53 DISALLOW_COPY_AND_ASSIGN(TtsExtensionLoaderChromeOs
);
56 #endif // CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_