Index: chrome/browser/speech/tts_controller.h |
diff --git a/chrome/browser/speech/tts_controller.h b/chrome/browser/speech/tts_controller.h |
index 45690c941f9f03aa26bb978f4d1a1caa05429925..8f32cd93c152b47125a7bc6751e541088fba41db 100644 |
--- a/chrome/browser/speech/tts_controller.h |
+++ b/chrome/browser/speech/tts_controller.h |
@@ -202,10 +202,9 @@ class Utterance { |
} |
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; |
} |
@@ -245,7 +244,7 @@ class Utterance { |
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_; |
@@ -315,6 +314,12 @@ class TtsController { |
// 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; |