OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/speech/tts_extension_loader_chromeos.h" | 5 #include "chrome/browser/speech/tts_extension_loader_chromeos.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "chrome/browser/extensions/component_loader.h" | 9 #include "chrome/browser/extensions/component_loader.h" |
10 #include "chrome/browser/extensions/event_router.h" | 10 #include "chrome/browser/extensions/event_router.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 private: | 34 private: |
35 friend struct DefaultSingletonTraits<TtsExtensionLoaderChromeOsFactory>; | 35 friend struct DefaultSingletonTraits<TtsExtensionLoaderChromeOsFactory>; |
36 | 36 |
37 TtsExtensionLoaderChromeOsFactory() : ProfileKeyedServiceFactory( | 37 TtsExtensionLoaderChromeOsFactory() : ProfileKeyedServiceFactory( |
38 "TtsExtensionLoaderChromeOs", | 38 "TtsExtensionLoaderChromeOs", |
39 ProfileDependencyManager::GetInstance()) | 39 ProfileDependencyManager::GetInstance()) |
40 {} | 40 {} |
41 | 41 |
42 ~TtsExtensionLoaderChromeOsFactory() {} | 42 virtual ~TtsExtensionLoaderChromeOsFactory() {} |
43 | 43 |
44 bool ServiceRedirectedInIncognito() const OVERRIDE { | 44 virtual bool ServiceRedirectedInIncognito() const OVERRIDE { |
45 // If given an incognito profile (including the Chrome OS login | 45 // If given an incognito profile (including the Chrome OS login |
46 // profile), share the service with the original profile. | 46 // profile), share the service with the original profile. |
47 return true; | 47 return true; |
48 } | 48 } |
49 | 49 |
50 ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) const | 50 virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) const |
51 OVERRIDE { | 51 OVERRIDE { |
52 return new TtsExtensionLoaderChromeOs(profile); | 52 return new TtsExtensionLoaderChromeOs(profile); |
53 } | 53 } |
54 }; | 54 }; |
55 | 55 |
56 TtsExtensionLoaderChromeOs* | 56 TtsExtensionLoaderChromeOs* |
57 TtsExtensionLoaderChromeOs::GetInstance(Profile* profile) { | 57 TtsExtensionLoaderChromeOs::GetInstance(Profile* profile) { |
58 return TtsExtensionLoaderChromeOsFactory::GetInstance() | 58 return TtsExtensionLoaderChromeOsFactory::GetInstance() |
59 ->GetForProfile(profile); | 59 ->GetForProfile(profile); |
60 } | 60 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 if (!IsTtsLoadedInThisProfile()) | 114 if (!IsTtsLoadedInThisProfile()) |
115 return; | 115 return; |
116 | 116 |
117 if (tts_state_ == TTS_LOADING) { | 117 if (tts_state_ == TTS_LOADING) { |
118 LOG(INFO) << "TTS component extension loaded, retrying queued utterances."; | 118 LOG(INFO) << "TTS component extension loaded, retrying queued utterances."; |
119 tts_state_ = TTS_LOADED; | 119 tts_state_ = TTS_LOADED; |
120 TtsController::GetInstance()->RetrySpeakingQueuedUtterances(); | 120 TtsController::GetInstance()->RetrySpeakingQueuedUtterances(); |
121 } | 121 } |
122 } | 122 } |
OLD | NEW |