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

Unified Diff: chrome/browser/speech/speech_input_bubble_gtk.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Made ResourceContext::audio_manager() abide the same rules as other accessors Created 9 years 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 side-by-side diff with in-line comments
Download patch
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,8 @@
}
void SpeechInputBubbleGtk::OnMicSettingsClicked(GtkWidget* widget) {
- AudioManager::GetAudioManager()->ShowAudioInputSettings();
+ speech_input::SpeechInputManager::ShowAudioInputSettingsFromUI(
+ &tab_contents_->browser_context()->GetResourceContext());
Hide();
}
@@ -133,7 +135,14 @@
gtk_box_pack_start(GTK_BOX(vbox), label_, FALSE, FALSE,
kBubbleControlVerticalSpacing);
- if (AudioManager::GetAudioManager()->CanShowAudioInputSettings()) {
+ Profile* profile = Profile::FromBrowserContext(
+ tab_contents()->browser_context());
+
+ // TODO(tommi): The audio_manager property can only be accessed from the
Satish 2011/12/09 11:46:19 We do this check only for linux because the code t
tommi (sloooow) - chröme 2011/12/09 13:24:07 OK, thanks for the background. I'll take care of i
+ // IO thread, so we can't call CanShowAudioInputSettings directly here if
+ // we can show the input settings. For now, we always show the link (like
+ // we do on other platforms).
+ if (true) {
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,
@@ -164,8 +173,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 +197,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);

Powered by Google App Engine
This is Rietveld 408576698