void set_options(const base::Value* options);
const base::Value* options() const { return options_.get(); }
- void set_src_extension_id(const std::string& src_extension_id) {
- src_extension_id_ = src_extension_id;
- }
- const std::string& src_extension_id() { return src_extension_id_; }
-
void set_src_id(int src_id) { src_id_ = src_id; }
int src_id() { return src_id_; }
}
UtteranceEventDelegate* event_delegate() const {
- return event_delegate_.get();
+ return event_delegate_;
}
- void set_event_delegate(
- base::WeakPtr<UtteranceEventDelegate> event_delegate) {
+ void set_event_delegate(UtteranceEventDelegate* event_delegate) {
event_delegate_ = event_delegate;
}
// other than the ones we explicitly parse, below.
scoped_ptr<base::Value> options_;
- // The extension ID of the extension that called speak() and should
- // receive events.
- std::string src_extension_id_;
-
// The source extension's ID of this utterance, so that it can associate
// events with the appropriate callback.
int src_id_;
GURL src_url_;
// The delegate to be called when an utterance event is fired.
- base::WeakPtr<UtteranceEventDelegate> event_delegate_;
+ UtteranceEventDelegate* event_delegate_;
// The parsed options.
std::string voice_name_;
// Remove delegate that wants to be notified when the set of voices changes.
virtual void RemoveVoicesChangedDelegate(VoicesChangedDelegate* delegate) = 0;
+ // Remove delegate that wants to be notified when an utterance fires an event.
+ // Note: this cancels speech from any utterance with this delegate, and
+ // removes any utterances with this delegate from the queue.
+ virtual void RemoveUtteranceEventDelegate(UtteranceEventDelegate* delegate)
+ = 0;
+
// Set the delegate that processes TTS requests with user-installed
// extensions.
virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) = 0;