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

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

Issue 1014143003: Change set_continuous_parameters() for removing duplicated behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_message_filter.h" 5 #include "chrome/browser/speech/tts_message_filter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 113 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
114 if (!browser_context_) 114 if (!browser_context_)
115 return; 115 return;
116 116
117 scoped_ptr<Utterance> utterance(new Utterance(browser_context_)); 117 scoped_ptr<Utterance> utterance(new Utterance(browser_context_));
118 utterance->set_src_id(request.id); 118 utterance->set_src_id(request.id);
119 utterance->set_text(request.text); 119 utterance->set_text(request.text);
120 utterance->set_lang(request.lang); 120 utterance->set_lang(request.lang);
121 utterance->set_voice_name(request.voice); 121 utterance->set_voice_name(request.voice);
122 utterance->set_can_enqueue(true); 122 utterance->set_can_enqueue(true);
123 123 utterance->set_continuous_parameters(request.rate,
124 UtteranceContinuousParameters params; 124 request.pitch,
dmazzoni 2015/03/30 16:04:11 nit: fix the indentation
deejay 2015/03/30 16:29:45 Done.
125 params.rate = request.rate; 125 request.volume);
126 params.pitch = request.pitch;
127 params.volume = request.volume;
128 utterance->set_continuous_parameters(params);
129 126
130 utterance->set_event_delegate(this); 127 utterance->set_event_delegate(this);
131 128
132 TtsController::GetInstance()->SpeakOrEnqueue(utterance.release()); 129 TtsController::GetInstance()->SpeakOrEnqueue(utterance.release());
133 } 130 }
134 131
135 void TtsMessageFilter::OnPause() { 132 void TtsMessageFilter::OnPause() {
136 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 133 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
137 TtsController::GetInstance()->Pause(); 134 TtsController::GetInstance()->Pause();
138 } 135 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 TtsController::GetInstance()->RemoveUtteranceEventDelegate(this); 206 TtsController::GetInstance()->RemoveUtteranceEventDelegate(this);
210 } 207 }
211 208
212 void TtsMessageFilter::Observe( 209 void TtsMessageFilter::Observe(
213 int type, 210 int type,
214 const content::NotificationSource& source, 211 const content::NotificationSource& source,
215 const content::NotificationDetails& details) { 212 const content::NotificationDetails& details) {
216 browser_context_ = nullptr; 213 browser_context_ = nullptr;
217 notification_registrar_.RemoveAll(); 214 notification_registrar_.RemoveAll();
218 } 215 }
OLDNEW
« chrome/browser/speech/tts_controller.h ('K') | « chrome/browser/speech/tts_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698