| 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/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 gtk_widget_show(cancel_button_); | 270 gtk_widget_show(cancel_button_); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 | 274 |
| 275 void SpeechRecognitionBubbleGtk::UpdateImage() { | 275 void SpeechRecognitionBubbleGtk::UpdateImage() { |
| 276 gfx::ImageSkia image = icon_image(); | 276 gfx::ImageSkia image = icon_image(); |
| 277 if (image.isNull() || !bubble_) | 277 if (image.isNull() || !bubble_) |
| 278 return; | 278 return; |
| 279 | 279 |
| 280 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(image); | 280 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(*image.bitmap()); |
| 281 gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf); | 281 gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf); |
| 282 g_object_unref(pixbuf); | 282 g_object_unref(pixbuf); |
| 283 } | 283 } |
| 284 | 284 |
| 285 void SpeechRecognitionBubbleGtk::BubbleClosing(BubbleGtk* bubble, | 285 void SpeechRecognitionBubbleGtk::BubbleClosing(BubbleGtk* bubble, |
| 286 bool closed_by_escape) { | 286 bool closed_by_escape) { |
| 287 bubble_ = NULL; | 287 bubble_ = NULL; |
| 288 if (!did_invoke_close_) | 288 if (!did_invoke_close_) |
| 289 delegate_->InfoBubbleFocusChanged(); | 289 delegate_->InfoBubbleFocusChanged(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace | 292 } // namespace |
| 293 | 293 |
| 294 SpeechRecognitionBubble* SpeechRecognitionBubble::CreateNativeBubble( | 294 SpeechRecognitionBubble* SpeechRecognitionBubble::CreateNativeBubble( |
| 295 WebContents* web_contents, | 295 WebContents* web_contents, |
| 296 Delegate* delegate, | 296 Delegate* delegate, |
| 297 const gfx::Rect& element_rect) { | 297 const gfx::Rect& element_rect) { |
| 298 return new SpeechRecognitionBubbleGtk(web_contents, delegate, element_rect); | 298 return new SpeechRecognitionBubbleGtk(web_contents, delegate, element_rect); |
| 299 } | 299 } |
| OLD | NEW |