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

Side by Side Diff: chrome/browser/speech/tts_controller.h

Issue 625503002: Get rid of src_extension_id from TtsController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, address nit Created 6 years, 2 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
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_
6 #define CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ 6 #define CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // Finish an utterance without sending an event to the delegate. 144 // Finish an utterance without sending an event to the delegate.
145 void Finish(); 145 void Finish();
146 146
147 // Getters and setters for the text to speak and other speech options. 147 // Getters and setters for the text to speak and other speech options.
148 void set_text(const std::string& text) { text_ = text; } 148 void set_text(const std::string& text) { text_ = text; }
149 const std::string& text() const { return text_; } 149 const std::string& text() const { return text_; }
150 150
151 void set_options(const base::Value* options); 151 void set_options(const base::Value* options);
152 const base::Value* options() const { return options_.get(); } 152 const base::Value* options() const { return options_.get(); }
153 153
154 void set_src_extension_id(const std::string& src_extension_id) {
155 src_extension_id_ = src_extension_id;
156 }
157 const std::string& src_extension_id() { return src_extension_id_; }
158
159 void set_src_id(int src_id) { src_id_ = src_id; } 154 void set_src_id(int src_id) { src_id_ = src_id; }
160 int src_id() { return src_id_; } 155 int src_id() { return src_id_; }
161 156
162 void set_src_url(const GURL& src_url) { src_url_ = src_url; } 157 void set_src_url(const GURL& src_url) { src_url_ = src_url; }
163 const GURL& src_url() { return src_url_; } 158 const GURL& src_url() { return src_url_; }
164 159
165 void set_voice_name(const std::string& voice_name) { 160 void set_voice_name(const std::string& voice_name) {
166 voice_name_ = voice_name; 161 voice_name_ = voice_name;
167 } 162 }
168 const std::string& voice_name() const { return voice_name_; } 163 const std::string& voice_name() const { return voice_name_; }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 // responses. 230 // responses.
236 static int next_utterance_id_; 231 static int next_utterance_id_;
237 232
238 // The text to speak. 233 // The text to speak.
239 std::string text_; 234 std::string text_;
240 235
241 // The full options arg passed to tts.speak, which may include fields 236 // The full options arg passed to tts.speak, which may include fields
242 // other than the ones we explicitly parse, below. 237 // other than the ones we explicitly parse, below.
243 scoped_ptr<base::Value> options_; 238 scoped_ptr<base::Value> options_;
244 239
245 // The extension ID of the extension that called speak() and should
246 // receive events.
247 std::string src_extension_id_;
248
249 // The source extension's ID of this utterance, so that it can associate 240 // The source extension's ID of this utterance, so that it can associate
250 // events with the appropriate callback. 241 // events with the appropriate callback.
251 int src_id_; 242 int src_id_;
252 243
253 // The URL of the page where the source extension called speak. 244 // The URL of the page where the source extension called speak.
254 GURL src_url_; 245 GURL src_url_;
255 246
256 // The delegate to be called when an utterance event is fired. 247 // The delegate to be called when an utterance event is fired.
257 base::WeakPtr<UtteranceEventDelegate> event_delegate_; 248 base::WeakPtr<UtteranceEventDelegate> event_delegate_;
258 249
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 325
335 // For unit testing. 326 // For unit testing.
336 virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) = 0; 327 virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) = 0;
337 virtual int QueueSize() = 0; 328 virtual int QueueSize() = 0;
338 329
339 protected: 330 protected:
340 virtual ~TtsController() {} 331 virtual ~TtsController() {}
341 }; 332 };
342 333
343 #endif // CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_ 334 #endif // CHROME_BROWSER_SPEECH_TTS_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698