| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 - (id)initWithUtterance:(NSString*)utterance; | 45 - (id)initWithUtterance:(NSString*)utterance; |
| 46 - (bool)startSpeakingRetainedUtterance; | 46 - (bool)startSpeakingRetainedUtterance; |
| 47 - (bool)startSpeakingString:(NSString*)utterance; | 47 - (bool)startSpeakingString:(NSString*)utterance; |
| 48 | 48 |
| 49 @end | 49 @end |
| 50 | 50 |
| 51 class TtsPlatformImplMac : public TtsPlatformImpl { | 51 class TtsPlatformImplMac : public TtsPlatformImpl { |
| 52 public: | 52 public: |
| 53 virtual bool PlatformImplAvailable() OVERRIDE { | 53 virtual bool PlatformImplAvailable() override { |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual bool Speak( | 57 virtual bool Speak( |
| 58 int utterance_id, | 58 int utterance_id, |
| 59 const std::string& utterance, | 59 const std::string& utterance, |
| 60 const std::string& lang, | 60 const std::string& lang, |
| 61 const VoiceData& voice, | 61 const VoiceData& voice, |
| 62 const UtteranceContinuousParameters& params) OVERRIDE; | 62 const UtteranceContinuousParameters& params) override; |
| 63 | 63 |
| 64 virtual bool StopSpeaking() OVERRIDE; | 64 virtual bool StopSpeaking() override; |
| 65 | 65 |
| 66 virtual void Pause() OVERRIDE; | 66 virtual void Pause() override; |
| 67 | 67 |
| 68 virtual void Resume() OVERRIDE; | 68 virtual void Resume() override; |
| 69 | 69 |
| 70 virtual bool IsSpeaking() OVERRIDE; | 70 virtual bool IsSpeaking() override; |
| 71 | 71 |
| 72 virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE; | 72 virtual void GetVoices(std::vector<VoiceData>* out_voices) override; |
| 73 | 73 |
| 74 // Called by ChromeTtsDelegate when we get a callback from the | 74 // Called by ChromeTtsDelegate when we get a callback from the |
| 75 // native speech engine. | 75 // native speech engine. |
| 76 void OnSpeechEvent(NSSpeechSynthesizer* sender, | 76 void OnSpeechEvent(NSSpeechSynthesizer* sender, |
| 77 TtsEventType event_type, | 77 TtsEventType event_type, |
| 78 int char_index, | 78 int char_index, |
| 79 const std::string& error_message); | 79 const std::string& error_message); |
| 80 | 80 |
| 81 // Get the single instance of this class. | 81 // Get the single instance of this class. |
| 82 static TtsPlatformImplMac* GetInstance(); | 82 static TtsPlatformImplMac* GetInstance(); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 didSpeak_ = true; | 344 didSpeak_ = true; |
| 345 return [super startSpeakingString:utterance_]; | 345 return [super startSpeakingString:utterance_]; |
| 346 } | 346 } |
| 347 | 347 |
| 348 - (bool)startSpeakingString:(NSString*)utterance { | 348 - (bool)startSpeakingString:(NSString*)utterance { |
| 349 CHECK(false); | 349 CHECK(false); |
| 350 return false; | 350 return false; |
| 351 } | 351 } |
| 352 | 352 |
| 353 @end | 353 @end |
| OLD | NEW |