| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/shell_content_browser_client.h" | 5 #include "content/shell/shell_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 91 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 92 command_line->AppendSwitch(switches::kDumpRenderTree); | 92 command_line->AppendSwitch(switches::kDumpRenderTree); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ShellContentBrowserClient::OverrideWebkitPrefs( | 95 void ShellContentBrowserClient::OverrideWebkitPrefs( |
| 96 RenderViewHost* render_view_host, | 96 RenderViewHost* render_view_host, |
| 97 const GURL& url, | 97 const GURL& url, |
| 98 webkit_glue::WebPreferences* prefs) { | 98 webkit_glue::WebPreferences* prefs) { |
| 99 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 99 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 100 return; | 100 return; |
| 101 prefs->dom_paste_enabled = true; | 101 WebKitTestController::Get()->web_preferences().Apply(prefs); |
| 102 prefs->javascript_can_access_clipboard = true; | |
| 103 prefs->allow_universal_access_from_file_urls = true; | |
| 104 } | 102 } |
| 105 | 103 |
| 106 void ShellContentBrowserClient::ResourceDispatcherHostCreated() { | 104 void ShellContentBrowserClient::ResourceDispatcherHostCreated() { |
| 107 resource_dispatcher_host_delegate_.reset( | 105 resource_dispatcher_host_delegate_.reset( |
| 108 new ShellResourceDispatcherHostDelegate()); | 106 new ShellResourceDispatcherHostDelegate()); |
| 109 ResourceDispatcherHost::Get()->SetDelegate( | 107 ResourceDispatcherHost::Get()->SetDelegate( |
| 110 resource_dispatcher_host_delegate_.get()); | 108 resource_dispatcher_host_delegate_.get()); |
| 111 } | 109 } |
| 112 | 110 |
| 113 std::string ShellContentBrowserClient::GetDefaultDownloadName() { | 111 std::string ShellContentBrowserClient::GetDefaultDownloadName() { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 ShellBrowserContext* | 152 ShellBrowserContext* |
| 155 ShellContentBrowserClient::off_the_record_browser_context() { | 153 ShellContentBrowserClient::off_the_record_browser_context() { |
| 156 return shell_browser_main_parts_->off_the_record_browser_context(); | 154 return shell_browser_main_parts_->off_the_record_browser_context(); |
| 157 } | 155 } |
| 158 | 156 |
| 159 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { | 157 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { |
| 160 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); | 158 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); |
| 161 } | 159 } |
| 162 | 160 |
| 163 } // namespace content | 161 } // namespace content |
| OLD | NEW |