Chromium Code Reviews| Index: chrome/browser/speech/speech_input_manager.cc |
| =================================================================== |
| --- chrome/browser/speech/speech_input_manager.cc (revision 70616) |
| +++ chrome/browser/speech/speech_input_manager.cc (working copy) |
| @@ -5,9 +5,14 @@ |
| #include "chrome/browser/speech/speech_input_manager.h" |
| #include "app/l10n_util.h" |
| +#include "base/command_line.h" |
| +#include "base/lock.h" |
|
Satish
2011/01/06 21:49:41
is this required?
|
| #include "base/ref_counted.h" |
| -#include "base/singleton.h" |
| -#include "chrome/browser/chrome_thread.h" |
| +#include "base/lazy_instance.h" |
|
Satish
2011/01/06 21:49:41
are these 2 lines required?
|
| +#include "base/utf_string_conversions.h" |
| +#include "chrome/browser/browser_thread.h" |
| +#include "chrome/common/chrome_switches.h" |
| +#include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/speech/speech_input_bubble_controller.h" |
| #include "chrome/browser/speech/speech_recognizer.h" |
| #include "chrome/browser/tab_contents/infobar_delegate.h" |
| @@ -78,6 +83,26 @@ |
| return Singleton<SpeechInputManagerImpl>::get(); |
| } |
| +bool SpeechInputManager::IsFeatureEnabled() { |
| + bool enabled = true; |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + |
| + if (command_line.HasSwitch(switches::kDisableSpeechInput)) { |
| + enabled = false; |
| +#if defined(GOOGLE_CHROME_BUILD) |
| + } else if (!command_line.HasSwitch(switches::kEnableSpeechInput)) { |
| + // We need to evaluate whether IO is OK here. http://crbug.com/63335. |
|
Satish
2011/01/06 21:49:41
since are only rolling out stable channel from thi
|
| + base::ThreadRestrictions::ScopedAllowIO allow_io; |
| + // Official Chrome builds have speech input enabled by default only in the |
| + // dev channel. |
| + std::string channel = platform_util::GetVersionStringModifier(); |
| + enabled = (channel == "dev"); |
| +#endif |
| + } |
| + |
| + return enabled; |
| +} |
| + |
| SpeechInputManagerImpl::SpeechInputManagerImpl() |
| : recording_caller_id_(0), |
| bubble_controller_(new SpeechInputBubbleController( |