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

Unified Diff: chrome/browser/speech/speech_input_bubble_views.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/speech/speech_input_bubble_views.cc
diff --git a/chrome/browser/speech/speech_input_bubble_views.cc b/chrome/browser/speech/speech_input_bubble_views.cc
index cea80e279639b32699d1ea4e2168b9ac3d0741bd..640f585fb9e7babdc7ef38c431cab8c92103cc0e 100644
--- a/chrome/browser/speech/speech_input_bubble_views.cc
+++ b/chrome/browser/speech/speech_input_bubble_views.cc
@@ -84,7 +84,7 @@ void ContentView::SetRecognizingMode() {
void ContentView::ButtonPressed(views::Button* source,
const views::Event& event) {
if (source == cancel_) {
- delegate_->RecognitionCancelled();
+ delegate_->InfoBubbleButtonClicked(SpeechInputBubble::BUTTON_CANCEL);
} else {
NOTREACHED() << "Unknown view";
}
@@ -126,7 +126,7 @@ void ContentView::Layout() {
// Implementation of SpeechInputBubble.
class SpeechInputBubbleImpl
- : public SpeechInputBubble,
+ : public SpeechInputBubbleBase,
public InfoBubbleDelegate,
public NotificationObserver {
public:
@@ -137,6 +137,11 @@ class SpeechInputBubbleImpl
virtual void SetRecognizingMode();
+ // SpeechInputBubble methods.
+ virtual void Show();
+ virtual void Hide();
+ virtual void UpdateLayout();
+
// Returns the screen rectangle to use as the info bubble's target.
// |element_rect| is the html element's bounds in page coordinates.
gfx::Rect GetInfoBubbleTarget(const gfx::Rect& element_rect);
@@ -220,7 +225,7 @@ void SpeechInputBubbleImpl::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
if (type == NotificationType::TAB_CONTENTS_DESTROYED) {
- delegate_->RecognitionCancelled();
+ delegate_->InfoBubbleButtonClicked(BUTTON_CANCEL);
} else {
NOTREACHED() << "Unknown notification";
}
@@ -233,7 +238,7 @@ void SpeechInputBubbleImpl::InfoBubbleClosing(InfoBubble* info_bubble,
info_bubble_ = NULL;
bubble_content_ = NULL;
if (!did_invoke_close_)
- delegate_->InfoBubbleClosed();
+ delegate_->InfoBubbleFocusChanged();
}
bool SpeechInputBubbleImpl::CloseOnEscape() {
@@ -244,6 +249,21 @@ bool SpeechInputBubbleImpl::FadeInOnShow() {
return false;
}
+void SpeechInputBubbleImpl::Show() {
+ // TODO(satish): Implement.
+ NOTREACHED();
+}
+
+void SpeechInputBubbleImpl::Hide() {
+ // TODO(satish): Implement.
+ NOTREACHED();
+}
+
+void SpeechInputBubbleImpl::UpdateLayout() {
+ // TODO: Implement.
+ NOTREACHED();
+}
+
} // namespace
SpeechInputBubble* SpeechInputBubble::CreateNativeBubble(

Powered by Google App Engine
This is Rietveld 408576698