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

Side by Side Diff: chrome/browser/speech/tts_win.cc

Issue 120983002: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
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 <math.h> 5 #include <math.h>
6 #include <sapi.h> 6 #include <sapi.h>
7 7
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 suffix = L"</pitch>"; 100 suffix = L"</pitch>";
101 } 101 }
102 102
103 if (params.volume >= 0.0) { 103 if (params.volume >= 0.0) {
104 // The TTS api allows a range of 0 to 100 for speech volume. 104 // The TTS api allows a range of 0 to 100 for speech volume.
105 speech_synthesizer_->SetVolume(static_cast<uint16>(params.volume * 100)); 105 speech_synthesizer_->SetVolume(static_cast<uint16>(params.volume * 100));
106 } 106 }
107 107
108 // TODO(dmazzoni): convert SSML to SAPI xml. http://crbug.com/88072 108 // TODO(dmazzoni): convert SSML to SAPI xml. http://crbug.com/88072
109 109
110 utterance_ = UTF8ToWide(src_utterance); 110 utterance_ = base::UTF8ToWide(src_utterance);
111 utterance_id_ = utterance_id; 111 utterance_id_ = utterance_id;
112 char_position_ = 0; 112 char_position_ = 0;
113 std::wstring merged_utterance = prefix + utterance_ + suffix; 113 std::wstring merged_utterance = prefix + utterance_ + suffix;
114 prefix_len_ = prefix.size(); 114 prefix_len_ = prefix.size();
115 115
116 HRESULT result = speech_synthesizer_->Speak( 116 HRESULT result = speech_synthesizer_->Speak(
117 merged_utterance.c_str(), 117 merged_utterance.c_str(),
118 SPF_ASYNC, 118 SPF_ASYNC,
119 &stream_number_); 119 &stream_number_);
120 return (result == S_OK); 120 return (result == S_OK);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 TtsPlatformImplWin* TtsPlatformImplWin::GetInstance() { 248 TtsPlatformImplWin* TtsPlatformImplWin::GetInstance() {
249 return Singleton<TtsPlatformImplWin, 249 return Singleton<TtsPlatformImplWin,
250 LeakySingletonTraits<TtsPlatformImplWin> >::get(); 250 LeakySingletonTraits<TtsPlatformImplWin> >::get();
251 } 251 }
252 252
253 // static 253 // static
254 void TtsPlatformImplWin::SpeechEventCallback( 254 void TtsPlatformImplWin::SpeechEventCallback(
255 WPARAM w_param, LPARAM l_param) { 255 WPARAM w_param, LPARAM l_param) {
256 GetInstance()->OnSpeechEvent(); 256 GetInstance()->OnSpeechEvent();
257 } 257 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc ('k') | chrome/browser/spellchecker/feedback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698