| OLD | NEW |
| 1 // Copyright (c) 2011 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/cocoa_protocols.h" | 7 #include "base/mac/cocoa_protocols.h" |
| 8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
| 13 #include "chrome/browser/extensions/extension_tts_api_constants.h" | 13 #include "chrome/browser/speech/extension_api/tts_extension_api_constants.h" |
| 14 #include "chrome/browser/extensions/extension_tts_api_controller.h" | 14 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" |
| 15 #include "chrome/browser/extensions/extension_tts_api_platform.h" | 15 #include "chrome/browser/speech/extension_api/tts_extension_api_platform.h" |
| 16 | 16 |
| 17 #import <Cocoa/Cocoa.h> | 17 #import <Cocoa/Cocoa.h> |
| 18 | 18 |
| 19 class ExtensionTtsPlatformImplMac; | 19 class ExtensionTtsPlatformImplMac; |
| 20 | 20 |
| 21 @interface ChromeTtsDelegate : NSObject <NSSpeechSynthesizerDelegate> { | 21 @interface ChromeTtsDelegate : NSObject <NSSpeechSynthesizerDelegate> { |
| 22 @private | 22 @private |
| 23 ExtensionTtsPlatformImplMac* ttsImplMac_; // weak. | 23 ExtensionTtsPlatformImplMac* ttsImplMac_; // weak. |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 - (void)speechSynthesizer:(NSSpeechSynthesizer*)sender | 202 - (void)speechSynthesizer:(NSSpeechSynthesizer*)sender |
| 203 didEncounterErrorAtIndex:(NSUInteger)character_index | 203 didEncounterErrorAtIndex:(NSUInteger)character_index |
| 204 ofString:(NSString*)string | 204 ofString:(NSString*)string |
| 205 message:(NSString*)message { | 205 message:(NSString*)message { |
| 206 std::string message_utf8 = base::SysNSStringToUTF8(message); | 206 std::string message_utf8 = base::SysNSStringToUTF8(message); |
| 207 ttsImplMac_->OnSpeechEvent(sender, TTS_EVENT_ERROR, character_index, | 207 ttsImplMac_->OnSpeechEvent(sender, TTS_EVENT_ERROR, character_index, |
| 208 message_utf8); | 208 message_utf8); |
| 209 } | 209 } |
| 210 | 210 |
| 211 @end | 211 @end |
| OLD | NEW |