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

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

Issue 6272018: Fix speech input bubble in GTK to avoid setting images when not visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: applying changes suggested by Satish. Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698