OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/speech/speech_input_bubble.h" | 5 #include "chrome/browser/speech/speech_input_bubble.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
9 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" | 9 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
10 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } else { | 189 } else { |
190 gtk_label_set_text(GTK_LABEL(label_), | 190 gtk_label_set_text(GTK_LABEL(label_), |
191 l10n_util::GetStringUTF8(IDS_SPEECH_INPUT_BUBBLE_WORKING).c_str()); | 191 l10n_util::GetStringUTF8(IDS_SPEECH_INPUT_BUBBLE_WORKING).c_str()); |
192 } | 192 } |
193 gtk_widget_show(icon_); | 193 gtk_widget_show(icon_); |
194 gtk_widget_hide(try_again_button_); | 194 gtk_widget_hide(try_again_button_); |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 void SpeechInputBubbleGtk::SetImage(const SkBitmap& image) { | 198 void SpeechInputBubbleGtk::SetImage(const SkBitmap& image) { |
199 if (image.isNull()) | 199 if (image.isNull() || !info_bubble_) |
200 return; | 200 return; |
201 | 201 |
202 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&image); | 202 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&image); |
203 gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf); | 203 gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf); |
204 g_object_unref(pixbuf); | 204 g_object_unref(pixbuf); |
205 } | 205 } |
206 | 206 |
207 } // namespace | 207 } // namespace |
208 | 208 |
209 SpeechInputBubble* SpeechInputBubble::CreateNativeBubble( | 209 SpeechInputBubble* SpeechInputBubble::CreateNativeBubble( |
210 TabContents* tab_contents, | 210 TabContents* tab_contents, |
211 Delegate* delegate, | 211 Delegate* delegate, |
212 const gfx::Rect& element_rect) { | 212 const gfx::Rect& element_rect) { |
213 return new SpeechInputBubbleGtk(tab_contents, delegate, element_rect); | 213 return new SpeechInputBubbleGtk(tab_contents, delegate, element_rect); |
214 } | 214 } |
215 | |
OLD | NEW |