File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434#include " content/nw/src/shell_browser_main_parts.h"
3535#include " geolocation/shell_access_token_store.h"
3636#include " googleurl/src/gurl.h"
37+ #include " webkit/glue/webpreferences.h"
3738
3839namespace content {
3940
@@ -88,4 +89,20 @@ AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() {
8889 return new ShellAccessTokenStore (browser_context ()->GetRequestContext ());
8990}
9091
92+ void ShellContentBrowserClient::OverrideWebkitPrefs (
93+ RenderViewHost* render_view_host,
94+ const GURL & url,
95+ webkit_glue::WebPreferences* prefs) {
96+ // Disable web security
97+ prefs->web_security_enabled = false ;
98+ prefs->allow_file_access_from_file_urls = true ;
99+
100+ // Disable plugins to speed up (TODO provide flag to enable them)
101+ prefs->plugins_enabled = false ;
102+ prefs->java_enabled = false ;
103+
104+ // No caches
105+ prefs->uses_page_cache = false ;
106+ }
107+
91108} // namespace content
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ class ShellContentBrowserClient : public ContentBrowserClient {
2929 virtual void RenderProcessHostCreated (RenderProcessHost* host) OVERRIDE;
3030 virtual void ResourceDispatcherHostCreated () OVERRIDE;
3131 virtual AccessTokenStore* CreateAccessTokenStore () OVERRIDE;
32+ virtual void OverrideWebkitPrefs (
33+ RenderViewHost* render_view_host,
34+ const GURL & url,
35+ webkit_glue::WebPreferences* prefs) OVERRIDE;
3236 virtual std::string GetDefaultDownloadName () OVERRIDE;
3337 virtual MediaObserver* GetMediaObserver () OVERRIDE;
3438 virtual void BrowserURLHandlerCreated (BrowserURLHandler* handler) OVERRIDE;
Original file line number Diff line number Diff line change @@ -99,17 +99,12 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
9999 logging::LogEventProvider::Initialize (kContentShellProviderName );
100100#endif
101101
102- // Disable web security
103- CommandLine* command_line = CommandLine::ForCurrentProcess ();
104- command_line->AppendSwitch (switches::kAllowFileAccessFromFiles );
105- command_line->AppendSwitch (switches::kDisableWebSecurity );
106-
107102 // Enforce single process
108- command_line->AppendSwitch (switches::kSingleProcess );
103+ // command_line->AppendSwitch(switches::kSingleProcess);
109104
110105 // Fix navigator.language in single process mode
111106 std::string locale = l10n_util::GetApplicationLocale (" en-US" );
112- command_line ->AppendSwitchASCII (switches::kLang , locale);
107+ CommandLine::ForCurrentProcess () ->AppendSwitchASCII (switches::kLang , locale);
113108
114109 InitLogging ();
115110
You can’t perform that action at this time.
0 commit comments