summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech/speech_input_bubble_mac.mm
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 12:14:44 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 12:14:44 +0000
commit061c740bf01098700818a116eda2abac66ba2ee1 (patch)
treed9bdc45fe1cf06c45778bbbe0e1a4b2d73907bef /chrome/browser/speech/speech_input_bubble_mac.mm
parentf2593f76a25a0d327f7695e7eaf115e11a7da128 (diff)
downloadchromium_src-061c740bf01098700818a116eda2abac66ba2ee1.zip
chromium_src-061c740bf01098700818a116eda2abac66ba2ee1.tar.gz
chromium_src-061c740bf01098700818a116eda2abac66ba2ee1.tar.bz2
Listen for tab close notifications and cancel active speech sessions.
BUG=none TEST=Start speech input and close tab with keyboard before the UI comes up, check for crashes. Review URL: http://codereview.chromium.org/6115001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech/speech_input_bubble_mac.mm')
-rw-r--r--chrome/browser/speech/speech_input_bubble_mac.mm7
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/browser/speech/speech_input_bubble_mac.mm b/chrome/browser/speech/speech_input_bubble_mac.mm
index d4a54f2..912370e 100644
--- a/chrome/browser/speech/speech_input_bubble_mac.mm
+++ b/chrome/browser/speech/speech_input_bubble_mac.mm
@@ -30,7 +30,6 @@ class SpeechInputBubbleImpl : public SpeechInputBubbleBase {
private:
scoped_nsobject<SpeechInputWindowController> window_;
- TabContents* tab_contents_;
Delegate* delegate_;
gfx::Rect element_rect_;
};
@@ -38,7 +37,7 @@ class SpeechInputBubbleImpl : public SpeechInputBubbleBase {
SpeechInputBubbleImpl::SpeechInputBubbleImpl(TabContents* tab_contents,
Delegate* delegate,
const gfx::Rect& element_rect)
- : tab_contents_(tab_contents),
+ : SpeechInputBubbleBase(tab_contents),
delegate_(delegate),
element_rect_(element_rect) {
}
@@ -62,7 +61,7 @@ void SpeechInputBubbleImpl::Show() {
// Find the screen coordinates for the given tab and position the bubble's
// arrow anchor point inside that to point at the bottom-left of the html
// input element rect.
- gfx::NativeView view = tab_contents_->view()->GetNativeView();
+ gfx::NativeView view = tab_contents()->view()->GetNativeView();
NSRect tab_bounds = [view bounds];
NSPoint anchor = NSMakePoint(
tab_bounds.origin.x + element_rect_.x() + kBubbleTargetOffsetX,
@@ -72,7 +71,7 @@ void SpeechInputBubbleImpl::Show() {
anchor = [[view window] convertBaseToScreen:anchor];
window_.reset([[SpeechInputWindowController alloc]
- initWithParentWindow:tab_contents_->view()->GetTopLevelNativeWindow()
+ initWithParentWindow:tab_contents()->view()->GetTopLevelNativeWindow()
delegate:delegate_
anchoredAt:anchor]);