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

Side by Side Diff: chrome/browser/speech/speech_input_bubble.cc

Issue 3352018: Show error messages in speech bubble allowing user to retry as well. (Closed)
Patch Set: Address joth's comments. Created 10 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 #include "chrome/browser/speech/speech_input_bubble.h" 6 #include "chrome/browser/speech/speech_input_bubble.h"
7 #include "gfx/rect.h" 7 #include "gfx/rect.h"
8 8
9 SpeechInputBubble::FactoryMethod SpeechInputBubble::factory_ = NULL; 9 SpeechInputBubble::FactoryMethod SpeechInputBubble::factory_ = NULL;
10 const int SpeechInputBubble::kBubbleTargetOffsetX = 5; 10 const int SpeechInputBubble::kBubbleTargetOffsetX = 5;
11 11
12 SpeechInputBubble* SpeechInputBubble::Create(TabContents* tab_contents, 12 SpeechInputBubble* SpeechInputBubble::Create(TabContents* tab_contents,
13 Delegate* delegate, 13 Delegate* delegate,
14 const gfx::Rect& element_rect) { 14 const gfx::Rect& element_rect) {
15 if (factory_) 15 if (factory_)
16 return (*factory_)(tab_contents, delegate, element_rect); 16 return (*factory_)(tab_contents, delegate, element_rect);
17 17
18 // Has the tab already closed before bubble create request was processed? 18 // Has the tab already closed before bubble create request was processed?
19 if (!tab_contents) 19 if (!tab_contents)
20 return NULL; 20 return NULL;
21 21
22 return CreateNativeBubble(tab_contents, delegate, element_rect); 22 return CreateNativeBubble(tab_contents, delegate, element_rect);
23 } 23 }
24
25 SpeechInputBubbleBase::SpeechInputBubbleBase()
26 : display_mode_(DISPLAY_MODE_RECORDING) {
27 }
28
29 void SpeechInputBubbleBase::SetRecordingMode() {
30 display_mode_ = DISPLAY_MODE_RECORDING;
31 UpdateLayout();
32 }
33
34 void SpeechInputBubbleBase::SetRecognizingMode() {
35 display_mode_ = DISPLAY_MODE_RECOGNIZING;
36 UpdateLayout();
37 }
38
39 void SpeechInputBubbleBase::SetMessage(const string16& text) {
40 message_text_ = text;
41 display_mode_ = DISPLAY_MODE_MESSAGE;
42 UpdateLayout();
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698