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

Unified Diff: chrome/browser/speech/tts_controller.h

Issue 692203002: Stop utterances from a tab when that tab is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't hold lock during destruction Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api.cc ('k') | chrome/browser/speech/tts_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698