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

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

Issue 6115001: Listen for tab close notifications and cancel active speech sessions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/speech/speech_input_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/speech_input_bubble.h
diff --git a/chrome/browser/speech/speech_input_bubble.h b/chrome/browser/speech/speech_input_bubble.h
index 3faabe091b97bfa0566a270a4c6da8d27d71d028..436e6bb6ec62e9d3c0cf1339936afd7b54a356b1 100644
--- a/chrome/browser/speech/speech_input_bubble.h
+++ b/chrome/browser/speech/speech_input_bubble.h
@@ -99,6 +99,9 @@ class SpeechInputBubble {
// Updates the current captured audio volume displayed on screen.
virtual void SetInputVolume(float volume) = 0;
+ // Returns the TabContents for which this bubble gets displayed.
+ virtual TabContents* tab_contents() = 0;
+
// The horizontal distance between the start of the html widget and the speech
// bubble's arrow.
static const int kBubbleTargetOffsetX;
@@ -119,7 +122,7 @@ class SpeechInputBubbleBase : public SpeechInputBubble {
DISPLAY_MODE_MESSAGE
};
- SpeechInputBubbleBase();
+ explicit SpeechInputBubbleBase(TabContents* tab_contents);
virtual ~SpeechInputBubbleBase();
// SpeechInputBubble methods
@@ -127,6 +130,7 @@ class SpeechInputBubbleBase : public SpeechInputBubble {
virtual void SetRecognizingMode();
virtual void SetMessage(const string16& text);
virtual void SetInputVolume(float volume);
+ virtual TabContents* tab_contents() { return tab_contents_; }
protected:
// Updates the platform specific UI layout for the current display mode.
@@ -159,6 +163,8 @@ class SpeechInputBubbleBase : public SpeechInputBubble {
scoped_ptr<SkBitmap> mic_image_;
// A temporary buffer image used in creating the above mic image.
scoped_ptr<SkBitmap> buffer_image_;
+ // TabContents in which this this bubble gets displayed.
+ TabContents* tab_contents_;
static SkBitmap* mic_full_; // Mic image with full volume.
static SkBitmap* mic_empty_; // Mic image with zero volume.
« no previous file with comments | « no previous file | chrome/browser/speech/speech_input_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698