summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 07:55:03 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 07:55:03 +0000
commit21e0cbf6bf480671aef2b3e07502bf665627f4ab (patch)
tree0c30a09d2f25c7a24d1407bb7bf9092ecc6104d9 /chrome
parentbf96f533df6515f9ddea3278515a77ab81c00263 (diff)
downloadchromium_src-21e0cbf6bf480671aef2b3e07502bf665627f4ab.zip
chromium_src-21e0cbf6bf480671aef2b3e07502bf665627f4ab.tar.gz
chromium_src-21e0cbf6bf480671aef2b3e07502bf665627f4ab.tar.bz2
Enable speech input by default and remove unused code.
This CL is the same as what I submitted for M10 in http://codereview.chromium.org/6133006/, but rolled back then. We are now enabling the feature for M11. BUG=61677 TEST=browser_tests --gtest_filter="SpeechInputBrowserTest.*" Review URL: http://codereview.chromium.org/6610022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc7
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.h4
-rw-r--r--chrome/browser/speech/speech_input_manager.cc21
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/render_messages_internal.h4
-rw-r--r--chrome/renderer/render_thread.cc11
-rw-r--r--chrome/renderer/render_thread.h6
8 files changed, 2 insertions, 55 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 2648751..374d5c3 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -89,7 +89,6 @@
#include "content/browser/renderer_host/resource_message_filter.h"
#include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
#include "content/browser/speech/speech_input_dispatcher_host.h"
-#include "content/browser/speech/speech_input_manager.h"
#include "content/browser/worker_host/worker_message_filter.h"
#include "grit/generated_resources.h"
#include "ipc/ipc_logging.h"
@@ -824,11 +823,6 @@ void BrowserRenderProcessHost::InitExtensions() {
}
}
-void BrowserRenderProcessHost::InitSpeechInput() {
- Send(new ViewMsg_SpeechInput_SetFeatureEnabled(
- speech_input::SpeechInputManager::IsFeatureEnabled()));
-}
-
void BrowserRenderProcessHost::SendUserScriptsUpdate(
base::SharedMemory *shared_memory) {
// Process is being started asynchronously. We'll end up calling
@@ -1162,7 +1156,6 @@ void BrowserRenderProcessHost::OnProcessLaunched() {
Send(new ViewMsg_SetIsIncognitoProcess(profile()->IsOffTheRecord()));
- InitSpeechInput();
InitVisitedLinks();
InitUserScripts();
InitExtensions();
diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h
index 6ef691d..e70263e 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.h
+++ b/chrome/browser/renderer_host/browser_render_process_host.h
@@ -116,10 +116,6 @@ class BrowserRenderProcessHost : public RenderProcessHost,
// functions to thre renderer process.
void InitExtensions();
- // Initialize support for speech input API. Informs the renderer if the API
- // is enabled or not.
- void InitSpeechInput();
-
// Sends the renderer process a new set of user scripts.
void SendUserScriptsUpdate(base::SharedMemory* shared_memory);
diff --git a/chrome/browser/speech/speech_input_manager.cc b/chrome/browser/speech/speech_input_manager.cc
index cbc6f12..5f65e02 100644
--- a/chrome/browser/speech/speech_input_manager.cc
+++ b/chrome/browser/speech/speech_input_manager.cc
@@ -7,7 +7,6 @@
#include <map>
#include <string>
-#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/ref_counted.h"
#include "base/synchronization/lock.h"
@@ -163,26 +162,6 @@ SpeechInputManager* SpeechInputManager::Get() {
return g_speech_input_manager_impl.Pointer();
}
-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.
- 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;
-}
-
void SpeechInputManager::ShowAudioInputSettings() {
// Since AudioManager::ShowAudioInputSettings can potentially launch external
// processes, do that in the FILE thread to not block the calling threads.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c6febe0..079335a 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -543,9 +543,6 @@ const char kEnableSearchProviderApiV2[] = "enable-search-provider-api-v2";
// Enables 0-RTT HTTPS handshakes.
const char kEnableSnapStart[] = "enable-snap-start";
-// Enables speech input.
-const char kEnableSpeechInput[] = "enable-speech-input";
-
// Enable syncing browser data to a Google Account.
const char kEnableSync[] = "enable-sync";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 5eafff2..1fd8a08 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -161,7 +161,6 @@ extern const char kEnableRemoting[];
extern const char kEnableResourceContentSettings[];
extern const char kEnableSearchProviderApiV2[];
extern const char kEnableSnapStart[];
-extern const char kEnableSpeechInput[];
extern const char kEnableSync[];
extern const char kEnableSyncAutofill[];
extern const char kEnableSyncPreferences[];
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 47b2f6e..cd13198 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1068,10 +1068,6 @@ IPC_MESSAGE_ROUTED1(ViewMsg_StartPhishingDetection, GURL)
IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
int /* selected index, -1 means no selection */)
-// Indicate whether speech input API is enabled or not.
-IPC_MESSAGE_CONTROL1(ViewMsg_SpeechInput_SetFeatureEnabled,
- bool /* enabled */)
-
// Sent in response to a ViewHostMsg_ContextMenu to let the renderer know that
// the menu has been closed.
IPC_MESSAGE_ROUTED1(ViewMsg_ContextMenuClosed,
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 49da6e2..d1eeaf1 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -246,7 +246,6 @@ void RenderThread::Init() {
is_extension_process_ = type_str == switches::kExtensionProcess ||
CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
is_incognito_process_ = false;
- is_speech_input_enabled_ = false;
suspend_webkit_shared_timer_ = true;
notify_webkit_of_modal_loop_ = true;
plugin_refresh_allowed_ = true;
@@ -645,18 +644,11 @@ bool RenderThread::OnControlMessageReceived(const IPC::Message& msg) {
OnSpellCheckEnableAutoSpellCorrect)
IPC_MESSAGE_HANDLER(ViewMsg_GpuChannelEstablished, OnGpuChannelEstablished)
IPC_MESSAGE_HANDLER(ViewMsg_SetPhishingModel, OnSetPhishingModel)
- IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_SetFeatureEnabled,
- OnSetSpeechInputEnabled)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
-void RenderThread::OnSetSpeechInputEnabled(bool enabled) {
- DCHECK(!webkit_client_.get());
- is_speech_input_enabled_ = enabled;
-}
-
void RenderThread::OnSetNextPageID(int32 next_page_id) {
// This should only be called at process initialization time, so we shouldn't
// have to worry about thread-safety.
@@ -959,7 +951,8 @@ void RenderThread::EnsureWebKitInitialized() {
WebRuntimeFeatures::enableDeviceOrientation(
!command_line.HasSwitch(switches::kDisableDeviceOrientation));
- WebRuntimeFeatures::enableSpeechInput(is_speech_input_enabled_);
+ WebRuntimeFeatures::enableSpeechInput(
+ !command_line.HasSwitch(switches::kDisableSpeechInput));
WebRuntimeFeatures::enableFileSystem(
!command_line.HasSwitch(switches::kDisableFileSystem));
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h
index d4bcbaf..02a2fa1 100644
--- a/chrome/renderer/render_thread.h
+++ b/chrome/renderer/render_thread.h
@@ -324,8 +324,6 @@ class RenderThread : public RenderThreadBase,
void OnGetAccessibilityTree();
- void OnSetSpeechInputEnabled(bool enabled);
-
// Gather usage statistics from the in-memory cache and inform our host.
// These functions should be call periodically so that the host can make
// decisions about how to allocation resources using current information.
@@ -391,10 +389,6 @@ class RenderThread : public RenderThreadBase,
bool suspend_webkit_shared_timer_;
bool notify_webkit_of_modal_loop_;
- // True if this renderer has speech input enabled, set once during thread
- // initialization.
- bool is_speech_input_enabled_;
-
// Timer that periodically calls IdleHandler.
base::RepeatingTimer<RenderThread> idle_timer_;