| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
| 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
| 7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
| 8 | 8 |
| 9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 63 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
| 64 #include "webkit/glue/webdropdata.h" | 64 #include "webkit/glue/webdropdata.h" |
| 65 #include "webkit/glue/webkit_glue.h" | 65 #include "webkit/glue/webkit_glue.h" |
| 66 #include "webkit/glue/webmediaplayer_impl.h" | 66 #include "webkit/glue/webmediaplayer_impl.h" |
| 67 #include "webkit/glue/webpreferences.h" | 67 #include "webkit/glue/webpreferences.h" |
| 68 #include "webkit/glue/window_open_disposition.h" | 68 #include "webkit/glue/window_open_disposition.h" |
| 69 #include "webkit/tools/test_shell/accessibility_controller.h" | 69 #include "webkit/tools/test_shell/accessibility_controller.h" |
| 70 #include "webkit/tools/test_shell/mock_spellcheck.h" | 70 #include "webkit/tools/test_shell/mock_spellcheck.h" |
| 71 #include "webkit/tools/test_shell/notification_presenter.h" | 71 #include "webkit/tools/test_shell/notification_presenter.h" |
| 72 #include "webkit/tools/test_shell/simple_appcache_system.h" | 72 #include "webkit/tools/test_shell/simple_appcache_system.h" |
| 73 #include "webkit/tools/test_shell/simple_file_system.h" |
| 73 #include "webkit/tools/test_shell/test_geolocation_service.h" | 74 #include "webkit/tools/test_shell/test_geolocation_service.h" |
| 74 #include "webkit/tools/test_shell/test_navigation_controller.h" | 75 #include "webkit/tools/test_shell/test_navigation_controller.h" |
| 75 #include "webkit/tools/test_shell/test_shell.h" | 76 #include "webkit/tools/test_shell/test_shell.h" |
| 76 #include "webkit/tools/test_shell/test_web_worker.h" | 77 #include "webkit/tools/test_shell/test_web_worker.h" |
| 77 | 78 |
| 78 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
| 79 // TODO(port): make these files work everywhere. | 80 // TODO(port): make these files work everywhere. |
| 80 #include "webkit/tools/test_shell/drag_delegate.h" | 81 #include "webkit/tools/test_shell/drag_delegate.h" |
| 81 #include "webkit/tools/test_shell/drop_delegate.h" | 82 #include "webkit/tools/test_shell/drop_delegate.h" |
| 82 #endif | 83 #endif |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 } | 1120 } |
| 1120 | 1121 |
| 1121 bool TestWebViewDelegate::allowScript(WebFrame* frame, | 1122 bool TestWebViewDelegate::allowScript(WebFrame* frame, |
| 1122 bool enabled_per_settings) { | 1123 bool enabled_per_settings) { |
| 1123 return enabled_per_settings && shell_->allow_scripts(); | 1124 return enabled_per_settings && shell_->allow_scripts(); |
| 1124 } | 1125 } |
| 1125 | 1126 |
| 1126 void TestWebViewDelegate::openFileSystem( | 1127 void TestWebViewDelegate::openFileSystem( |
| 1127 WebFrame* frame, WebFileSystem::Type type, long long size, bool create, | 1128 WebFrame* frame, WebFileSystem::Type type, long long size, bool create, |
| 1128 WebFileSystemCallbacks* callbacks) { | 1129 WebFileSystemCallbacks* callbacks) { |
| 1129 if (shell_->file_system_root().empty()) { | 1130 SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( |
| 1130 // The FileSystem temp directory was not initialized successfully. | 1131 WebKit::webKitClient()->fileSystem()); |
| 1131 callbacks->didFail(WebKit::WebFileErrorSecurity); | 1132 fileSystem->OpenFileSystem(frame, type, size, create, callbacks); |
| 1132 } else { | |
| 1133 // TODO(michaeln): need to put origin/type in the path. | |
| 1134 callbacks->didOpenFileSystem( | |
| 1135 "TestShellFileSystem", | |
| 1136 webkit_glue::FilePathToWebString(shell_->file_system_root())); | |
| 1137 } | |
| 1138 } | 1133 } |
| 1139 | 1134 |
| 1140 // WebPluginPageDelegate ----------------------------------------------------- | 1135 // WebPluginPageDelegate ----------------------------------------------------- |
| 1141 | 1136 |
| 1142 WebCookieJar* TestWebViewDelegate::GetCookieJar() { | 1137 WebCookieJar* TestWebViewDelegate::GetCookieJar() { |
| 1143 return WebKit::webKitClient()->cookieJar(); | 1138 return WebKit::webKitClient()->cookieJar(); |
| 1144 } | 1139 } |
| 1145 | 1140 |
| 1146 // Public methods ------------------------------------------------------------ | 1141 // Public methods ------------------------------------------------------------ |
| 1147 | 1142 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 } | 1343 } |
| 1349 | 1344 |
| 1350 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1345 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1351 fake_rect_ = rect; | 1346 fake_rect_ = rect; |
| 1352 using_fake_rect_ = true; | 1347 using_fake_rect_ = true; |
| 1353 } | 1348 } |
| 1354 | 1349 |
| 1355 WebRect TestWebViewDelegate::fake_window_rect() { | 1350 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1356 return fake_rect_; | 1351 return fake_rect_; |
| 1357 } | 1352 } |
| OLD | NEW |