| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 TtsPlatformImplMac(); | 82 TtsPlatformImplMac(); |
| 83 ~TtsPlatformImplMac() override; | 83 ~TtsPlatformImplMac() override; |
| 84 | 84 |
| 85 base::scoped_nsobject<SingleUseSpeechSynthesizer> speech_synthesizer_; | 85 base::scoped_nsobject<SingleUseSpeechSynthesizer> speech_synthesizer_; |
| 86 base::scoped_nsobject<ChromeTtsDelegate> delegate_; | 86 base::scoped_nsobject<ChromeTtsDelegate> delegate_; |
| 87 int utterance_id_; | 87 int utterance_id_; |
| 88 std::string utterance_; | 88 std::string utterance_; |
| 89 int last_char_index_; | 89 int last_char_index_; |
| 90 bool paused_; | 90 bool paused_; |
| 91 | 91 |
| 92 friend struct DefaultSingletonTraits<TtsPlatformImplMac>; | 92 friend struct base::DefaultSingletonTraits<TtsPlatformImplMac>; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplMac); | 94 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplMac); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // static | 97 // static |
| 98 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { | 98 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { |
| 99 return TtsPlatformImplMac::GetInstance(); | 99 return TtsPlatformImplMac::GetInstance(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool TtsPlatformImplMac::Speak( | 102 bool TtsPlatformImplMac::Speak( |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 paused_ = false; | 282 paused_ = false; |
| 283 | 283 |
| 284 delegate_.reset([[ChromeTtsDelegate alloc] initWithPlatformImplMac:this]); | 284 delegate_.reset([[ChromeTtsDelegate alloc] initWithPlatformImplMac:this]); |
| 285 } | 285 } |
| 286 | 286 |
| 287 TtsPlatformImplMac::~TtsPlatformImplMac() { | 287 TtsPlatformImplMac::~TtsPlatformImplMac() { |
| 288 } | 288 } |
| 289 | 289 |
| 290 // static | 290 // static |
| 291 TtsPlatformImplMac* TtsPlatformImplMac::GetInstance() { | 291 TtsPlatformImplMac* TtsPlatformImplMac::GetInstance() { |
| 292 return Singleton<TtsPlatformImplMac>::get(); | 292 return base::Singleton<TtsPlatformImplMac>::get(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 @implementation ChromeTtsDelegate | 295 @implementation ChromeTtsDelegate |
| 296 | 296 |
| 297 - (id)initWithPlatformImplMac:(TtsPlatformImplMac*)ttsImplMac { | 297 - (id)initWithPlatformImplMac:(TtsPlatformImplMac*)ttsImplMac { |
| 298 if ((self = [super init])) { | 298 if ((self = [super init])) { |
| 299 ttsImplMac_ = ttsImplMac; | 299 ttsImplMac_ = ttsImplMac; |
| 300 } | 300 } |
| 301 return self; | 301 return self; |
| 302 } | 302 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 didSpeak_ = true; | 341 didSpeak_ = true; |
| 342 return [super startSpeakingString:utterance_]; | 342 return [super startSpeakingString:utterance_]; |
| 343 } | 343 } |
| 344 | 344 |
| 345 - (bool)startSpeakingString:(NSString*)utterance { | 345 - (bool)startSpeakingString:(NSString*)utterance { |
| 346 CHECK(false); | 346 CHECK(false); |
| 347 return false; | 347 return false; |
| 348 } | 348 } |
| 349 | 349 |
| 350 @end | 350 @end |
| OLD | NEW |