From 061c740bf01098700818a116eda2abac66ba2ee1 Mon Sep 17 00:00:00 2001 From: "satish@chromium.org" Date: Fri, 7 Jan 2011 12:14:44 +0000 Subject: 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 --- chrome/browser/speech/speech_input_bubble_mac.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'chrome/browser/speech/speech_input_bubble_mac.mm') 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 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]); -- cgit v1.1