1 // Copyright (c) 2012 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 "chrome/browser/extensions/event_router.h"
9 #include "chrome/browser/profiles/profile_keyed_service.h"
11 // Profile-keyed class that loads a built-in TTS component extension
12 // into a given profile on Chrome OS.
13 class TtsExtensionLoaderChromeOs
14 : public ProfileKeyedService
,
15 public extensions::EventRouter::Observer
{
17 static TtsExtensionLoaderChromeOs
* GetInstance(Profile
* profile
);
19 // Returns true if the extension was not previously loaded and is now
20 // loading. This class will call
21 // ExtensionTtsController::RetrySpeakingQueuedUtterances when the
22 // extension finishes loading.
23 bool LoadTtsExtension();
25 // Implementation of extensions::EventRouter::Observer.
26 virtual void OnListenerAdded(const extensions::EventListenerInfo
& details
)
30 // The state of TTS for this profile.
38 explicit TtsExtensionLoaderChromeOs(Profile
* profile
);
39 virtual ~TtsExtensionLoaderChromeOs() {}
41 bool IsTtsLoadedInThisProfile();
46 friend class TtsExtensionLoaderChromeOsFactory
;
48 DISALLOW_COPY_AND_ASSIGN(TtsExtensionLoaderChromeOs
);
51 #endif // CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_