diff options
author | allanwoj@chromium.org <allanwoj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 15:13:01 +0000 |
---|---|---|
committer | allanwoj@chromium.org <allanwoj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 15:13:01 +0000 |
commit | 8238dd6190819daade7ee98f669e23a5a56ee4fa (patch) | |
tree | 09debefb10323f762ccdf5b94c5722ea77b60d5d /content/shell | |
parent | 8cc6e41efa5af14f403cbb14b15e3af8ea686c93 (diff) | |
download | chromium_src-8238dd6190819daade7ee98f669e23a5a56ee4fa.zip chromium_src-8238dd6190819daade7ee98f669e23a5a56ee4fa.tar.gz chromium_src-8238dd6190819daade7ee98f669e23a5a56ee4fa.tar.bz2 |
Remove use of default request context and fix use of speech censor flag
Now gets the request context and censor preference in BrowserRenderProcessHost and passes them through to the SpeechInputDispatcherHost. Each time a speech request is made, the SpeechInputDispatcherHost passes through these values to the SpeechInputManager. Also each time the censor preference changes, RenderViewContextMenu updates the current profile's SpeechInputPreferences.
BUG=92366
TEST=Speech recognition works.
Review URL: http://codereview.chromium.org/7989001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/shell_browser_context.cc | 24 | ||||
-rw-r--r-- | content/shell/shell_browser_context.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index 91c51c8..33d88f9 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -18,6 +18,7 @@ #include "content/browser/host_zoom_map.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/browser/ssl/ssl_host_state.h" +#include "content/browser/speech/speech_input_preferences.h" #include "content/shell/shell_browser_main.h" #include "content/shell/shell_resource_context.h" #include "content/shell/shell_url_request_context_getter.h" @@ -56,6 +57,23 @@ class ShellGeolocationPermissionContext : public GeolocationPermissionContext { DISALLOW_COPY_AND_ASSIGN(ShellGeolocationPermissionContext); }; +class ShellSpeechInputPreferences : public SpeechInputPreferences { + public: + ShellSpeechInputPreferences() { + } + + // SpeechInputPreferences implementation. + virtual bool censor_results() const OVERRIDE { + return false; + } + + virtual void set_censor_results(bool censor_results) OVERRIDE { + } + + private: + DISALLOW_COPY_AND_ASSIGN(ShellSpeechInputPreferences); +}; + } // namespace namespace content { @@ -160,6 +178,12 @@ GeolocationPermissionContext* return geolocation_permission_context_; } +SpeechInputPreferences* ShellBrowserContext::GetSpeechInputPreferences() { + if (!speech_input_preferences_.get()) + speech_input_preferences_ = new ShellSpeechInputPreferences(); + return speech_input_preferences_.get(); +} + bool ShellBrowserContext::DidLastSessionExitCleanly() { return true; } diff --git a/content/shell/shell_browser_context.h b/content/shell/shell_browser_context.h index b5806c5..7de6528 100644 --- a/content/shell/shell_browser_context.h +++ b/content/shell/shell_browser_context.h @@ -43,6 +43,7 @@ class ShellBrowserContext : public BrowserContext { virtual HostZoomMap* GetHostZoomMap() OVERRIDE; virtual GeolocationPermissionContext* GetGeolocationPermissionContext() OVERRIDE; + virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; virtual bool DidLastSessionExitCleanly() OVERRIDE; virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; virtual WebKitContext* GetWebKitContext() OVERRIDE; @@ -63,6 +64,7 @@ class ShellBrowserContext : public BrowserContext { scoped_refptr<net::URLRequestContextGetter> url_request_getter_; scoped_refptr<HostZoomMap> host_zoom_map_; scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; + scoped_refptr<SpeechInputPreferences> speech_input_preferences_; scoped_refptr<WebKitContext> webkit_context_; scoped_refptr<ChromeAppCacheService> appcache_service_; scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |