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

Side by Side Diff: chrome/browser/speech/tts_extension_loader_chromeos.h

Issue 361363003: Support onvoiceschanged for extension-based tts engines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
6 #define CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
7
8 #include "components/keyed_service/core/keyed_service.h"
9 #include "extensions/browser/event_router.h"
10
11 class Profile;
12
13 // Profile-keyed class that loads a built-in TTS component extension
14 // into a given profile on Chrome OS.
15 class TtsExtensionLoaderChromeOs : public KeyedService,
16 public extensions::EventRouter::Observer {
17 public:
18 static TtsExtensionLoaderChromeOs* GetInstance(Profile* profile);
19
20 // Returns true if the extension was not previously loaded and is now
21 // loading. This class will call
22 // ExtensionTtsController::RetrySpeakingQueuedUtterances when the
23 // extension finishes loading.
24 bool LoadTtsExtension();
25
26 // Implementation of KeyedService.
27 virtual void Shutdown() OVERRIDE;
28
29 // Implementation of extensions::EventRouter::Observer.
30 virtual void OnListenerAdded(const extensions::EventListenerInfo& details)
31 OVERRIDE;
32
33 private:
34 // The state of TTS for this profile.
35 enum TtsState {
36 TTS_NOT_LOADED,
37 TTS_LOAD_REQUESTED,
38 TTS_LOADING,
39 TTS_LOADED
40 };
41
42 explicit TtsExtensionLoaderChromeOs(Profile* profile);
43 virtual ~TtsExtensionLoaderChromeOs() {}
44
45 bool IsTtsLoadedInThisProfile();
46
47 Profile* profile_;
48 TtsState tts_state_;
49
50 friend class TtsExtensionLoaderChromeOsFactory;
51
52 DISALLOW_COPY_AND_ASSIGN(TtsExtensionLoaderChromeOs);
53 };
54
55 #endif // CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_
OLDNEW
« no previous file with comments | « chrome/browser/speech/tts_chromeos.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