diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 08:22:35 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 08:22:35 +0000 |
commit | b9e407df56473f81ccfec2d0136981e7a47ca62b (patch) | |
tree | 2e9b465e636b46eb370ec57ffc46b0d7cebfc8b3 /content/shell | |
parent | cc21f9a3095bb1cc5274806666b465731cc60e1f (diff) | |
download | chromium_src-b9e407df56473f81ccfec2d0136981e7a47ca62b.zip chromium_src-b9e407df56473f81ccfec2d0136981e7a47ca62b.tar.gz chromium_src-b9e407df56473f81ccfec2d0136981e7a47ca62b.tar.bz2 |
[content shell] Enable editing commands from javascript for tests and universal access from file urls
BUG=111316
TEST=more editing tests pass
Review URL: https://codereview.chromium.org/11147003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/shell_content_browser_client.cc | 12 | ||||
-rw-r--r-- | content/shell/shell_content_browser_client.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index 261e876..c455fa9 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -17,6 +17,7 @@ #include "content/shell/shell_web_contents_view_delegate_creator.h" #include "content/shell/webkit_test_runner_host.h" #include "googleurl/src/gurl.h" +#include "webkit/glue/webpreferences.h" #if defined(OS_ANDROID) #include "base/android/path_utils.h" @@ -53,6 +54,17 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches( command_line->AppendSwitch(switches::kDumpRenderTree); } +void ShellContentBrowserClient::OverrideWebkitPrefs( + RenderViewHost* render_view_host, + const GURL& url, + webkit_glue::WebPreferences* prefs) { + if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) + return; + prefs->dom_paste_enabled = true; + prefs->javascript_can_access_clipboard = true; + prefs->allow_universal_access_from_file_urls = true; +} + void ShellContentBrowserClient::ResourceDispatcherHostCreated() { resource_dispatcher_host_delegate_.reset( new ShellResourceDispatcherHostDelegate()); diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index 0a5ef05..45cf7a9 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -29,6 +29,9 @@ class ShellContentBrowserClient : public ContentBrowserClient { RenderViewHost* render_view_host) OVERRIDE; virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, int child_process_id) OVERRIDE; + virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host, + const GURL& url, + webkit_glue::WebPreferences* prefs) OVERRIDE; virtual void ResourceDispatcherHostCreated() OVERRIDE; virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE; virtual std::string GetDefaultDownloadName() OVERRIDE; |