Index: chrome/browser/speech/speech_input_bubble_gtk.cc |
=================================================================== |
--- chrome/browser/speech/speech_input_bubble_gtk.cc (revision 113173) |
+++ chrome/browser/speech/speech_input_bubble_gtk.cc (working copy) |
@@ -14,6 +14,7 @@ |
#include "chrome/browser/ui/gtk/gtk_theme_service.h" |
#include "chrome/browser/ui/gtk/gtk_util.h" |
#include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
+#include "content/browser/resource_context.h" |
#include "content/browser/tab_contents/tab_contents.h" |
#include "grit/generated_resources.h" |
#include "grit/theme_resources.h" |
@@ -107,7 +108,9 @@ |
} |
void SpeechInputBubbleGtk::OnMicSettingsClicked(GtkWidget* widget) { |
- AudioManager::GetAudioManager()->ShowAudioInputSettings(); |
+ Profile* profile = |
+ Profile::FromBrowserContext(tab_contents()->browser_context()); |
+ profile->GetResourceContext().audio_manager()->ShowAudioInputSettings(); |
Hide(); |
} |
@@ -133,7 +136,11 @@ |
gtk_box_pack_start(GTK_BOX(vbox), label_, FALSE, FALSE, |
kBubbleControlVerticalSpacing); |
- if (AudioManager::GetAudioManager()->CanShowAudioInputSettings()) { |
+ Profile* profile = Profile::FromBrowserContext( |
+ tab_contents()->browser_context()); |
+ scoped_refptr<AudioManager> audio_manager = |
+ profile->GetResourceContext().audio_manager(); |
+ if (audio_manager->CanShowAudioInputSettings()) { |
mic_settings_ = gtk_chrome_link_button_new( |
l10n_util::GetStringUTF8(IDS_SPEECH_INPUT_MIC_SETTINGS).c_str()); |
gtk_box_pack_start(GTK_BOX(vbox), mic_settings_, FALSE, FALSE, |
@@ -142,6 +149,7 @@ |
G_CALLBACK(&OnMicSettingsClickedThunk), this); |
} |
+ |
GtkWidget* button_bar = gtk_hbox_new(FALSE, kButtonBarHorizontalSpacing); |
gtk_box_pack_start(GTK_BOX(vbox), button_bar, FALSE, FALSE, |
kBubbleControlVerticalSpacing); |
@@ -164,8 +172,6 @@ |
kBubbleControlHorizontalSpacing, kBubbleControlHorizontalSpacing); |
gtk_container_add(GTK_CONTAINER(content), vbox); |
- Profile* profile = |
- Profile::FromBrowserContext(tab_contents()->browser_context()); |
GtkThemeService* theme_provider = GtkThemeService::GetFrom(profile); |
GtkWidget* reference_widget = tab_contents()->GetNativeView(); |
gfx::Rect container_rect; |
@@ -190,8 +196,8 @@ |
&target_rect, |
content, |
BubbleGtk::ARROW_LOCATION_TOP_LEFT, |
- false, // match_system_theme |
- true, // grab_input |
+ false, // match_system_theme |
+ true, // grab_input |
theme_provider, |
this); |