OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_recognition_bubble.h" | 5 #include "chrome/browser/speech/speech_recognition_bubble.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" | 10 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 gtk_widget_show(cancel_button_); | 271 gtk_widget_show(cancel_button_); |
272 } | 272 } |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 void SpeechRecognitionBubbleGtk::UpdateImage() { | 276 void SpeechRecognitionBubbleGtk::UpdateImage() { |
277 SkBitmap image = icon_image(); | 277 SkBitmap image = icon_image(); |
278 if (image.isNull() || !bubble_) | 278 if (image.isNull() || !bubble_) |
279 return; | 279 return; |
280 | 280 |
281 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&image); | 281 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(image); |
282 gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf); | 282 gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf); |
283 g_object_unref(pixbuf); | 283 g_object_unref(pixbuf); |
284 } | 284 } |
285 | 285 |
286 void SpeechRecognitionBubbleGtk::BubbleClosing(BubbleGtk* bubble, | 286 void SpeechRecognitionBubbleGtk::BubbleClosing(BubbleGtk* bubble, |
287 bool closed_by_escape) { | 287 bool closed_by_escape) { |
288 bubble_ = NULL; | 288 bubble_ = NULL; |
289 if (!did_invoke_close_) | 289 if (!did_invoke_close_) |
290 delegate_->InfoBubbleFocusChanged(); | 290 delegate_->InfoBubbleFocusChanged(); |
291 } | 291 } |
292 | 292 |
293 } // namespace | 293 } // namespace |
294 | 294 |
295 SpeechRecognitionBubble* SpeechRecognitionBubble::CreateNativeBubble( | 295 SpeechRecognitionBubble* SpeechRecognitionBubble::CreateNativeBubble( |
296 WebContents* web_contents, | 296 WebContents* web_contents, |
297 Delegate* delegate, | 297 Delegate* delegate, |
298 const gfx::Rect& element_rect) { | 298 const gfx::Rect& element_rect) { |
299 return new SpeechRecognitionBubbleGtk(web_contents, delegate, element_rect); | 299 return new SpeechRecognitionBubbleGtk(web_contents, delegate, element_rect); |
300 } | 300 } |
OLD | NEW |