OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
6 #include <atlbase.h> | 6 #include <atlbase.h> |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <objbase.h> | 8 #include <objbase.h> |
9 #include <shlwapi.h> | 9 #include <shlwapi.h> |
10 #include <wininet.h> | 10 #include <wininet.h> |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // we want process and thread IDs because we may have multiple processes | 196 // we want process and thread IDs because we may have multiple processes |
197 logging::SetLogItems(true, true, false, true); | 197 logging::SetLogItems(true, true, false, true); |
198 } | 198 } |
199 | 199 |
200 // static | 200 // static |
201 void TestShell::CleanupLogging() { | 201 void TestShell::CleanupLogging() { |
202 logging::CloseLogFile(); | 202 logging::CloseLogFile(); |
203 } | 203 } |
204 | 204 |
205 // static | 205 // static |
| 206 void TestShell::SetAllowScriptsToCloseWindows() { |
| 207 if (web_prefs_) |
| 208 web_prefs_->allow_scripts_to_close_windows = true; |
| 209 } |
| 210 |
| 211 // static |
206 void TestShell::InitializeTestShell(bool interactive) { | 212 void TestShell::InitializeTestShell(bool interactive) { |
207 // Start COM stuff. | 213 // Start COM stuff. |
208 HRESULT res = OleInitialize(NULL); | 214 HRESULT res = OleInitialize(NULL); |
209 DCHECK(SUCCEEDED(res)); | 215 DCHECK(SUCCEEDED(res)); |
210 | 216 |
211 window_list_ = new WindowList; | 217 window_list_ = new WindowList; |
212 instance_handle_ = ::GetModuleHandle(NULL); | 218 instance_handle_ = ::GetModuleHandle(NULL); |
213 interactive_ = interactive; | 219 interactive_ = interactive; |
214 | 220 |
215 web_prefs_ = new WebPreferences; | 221 web_prefs_ = new WebPreferences; |
(...skipping 21 matching lines...) Expand all Loading... |
237 web_prefs_->minimum_logical_font_size = 9; | 243 web_prefs_->minimum_logical_font_size = 9; |
238 web_prefs_->javascript_can_open_windows_automatically = true; | 244 web_prefs_->javascript_can_open_windows_automatically = true; |
239 web_prefs_->dom_paste_enabled = true; | 245 web_prefs_->dom_paste_enabled = true; |
240 web_prefs_->developer_extras_enabled = interactive_; | 246 web_prefs_->developer_extras_enabled = interactive_; |
241 web_prefs_->shrinks_standalone_images_to_fit = false; | 247 web_prefs_->shrinks_standalone_images_to_fit = false; |
242 web_prefs_->uses_universal_detector = false; | 248 web_prefs_->uses_universal_detector = false; |
243 web_prefs_->text_areas_are_resizable = false; | 249 web_prefs_->text_areas_are_resizable = false; |
244 web_prefs_->user_agent = webkit_glue::GetDefaultUserAgent(); | 250 web_prefs_->user_agent = webkit_glue::GetDefaultUserAgent(); |
245 web_prefs_->dashboard_compatibility_mode = false; | 251 web_prefs_->dashboard_compatibility_mode = false; |
246 web_prefs_->java_enabled = true; | 252 web_prefs_->java_enabled = true; |
| 253 web_prefs_->allow_scripts_to_close_windows = false; |
247 } | 254 } |
248 } | 255 } |
249 | 256 |
250 // static | 257 // static |
251 void TestShell::ShutdownTestShell() { | 258 void TestShell::ShutdownTestShell() { |
252 delete window_list_; | 259 delete window_list_; |
253 SimpleResourceLoaderBridge::Shutdown(); | 260 SimpleResourceLoaderBridge::Shutdown(); |
254 delete TestShell::web_prefs_; | 261 delete TestShell::web_prefs_; |
255 OleUninitialize(); | 262 OleUninitialize(); |
256 } | 263 } |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 bool IsDefaultPluginEnabled() { | 1115 bool IsDefaultPluginEnabled() { |
1109 return false; | 1116 return false; |
1110 } | 1117 } |
1111 | 1118 |
1112 std::wstring GetWebKitLocale() { | 1119 std::wstring GetWebKitLocale() { |
1113 return L"en-US"; | 1120 return L"en-US"; |
1114 } | 1121 } |
1115 | 1122 |
1116 } // namespace webkit_glue | 1123 } // namespace webkit_glue |
1117 | 1124 |
OLD | NEW |