| 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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 } | 1119 } |
| 1119 | 1120 |
| 1120 bool TestWebViewDelegate::allowScript(WebFrame* frame, | 1121 bool TestWebViewDelegate::allowScript(WebFrame* frame, |
| 1121 bool enabled_per_settings) { | 1122 bool enabled_per_settings) { |
| 1122 return enabled_per_settings && shell_->allow_scripts(); | 1123 return enabled_per_settings && shell_->allow_scripts(); |
| 1123 } | 1124 } |
| 1124 | 1125 |
| 1125 void TestWebViewDelegate::openFileSystem( | 1126 void TestWebViewDelegate::openFileSystem( |
| 1126 WebFrame* frame, WebFileSystem::Type type, long long size, bool create, | 1127 WebFrame* frame, WebFileSystem::Type type, long long size, bool create, |
| 1127 WebFileSystemCallbacks* callbacks) { | 1128 WebFileSystemCallbacks* callbacks) { |
| 1128 if (shell_->file_system_root().empty()) { | 1129 SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( |
| 1129 // The FileSystem temp directory was not initialized successfully. | 1130 WebKit::webKitClient()->fileSystem()); |
| 1130 callbacks->didFail(WebKit::WebFileErrorSecurity); | 1131 fileSystem->OpenFileSystem(frame, type, size, create, callbacks); |
| 1131 } else { | |
| 1132 // TODO(michaeln): need to put origin/type in the path. | |
| 1133 callbacks->didOpenFileSystem( | |
| 1134 "TestShellFileSystem", | |
| 1135 webkit_glue::FilePathToWebString(shell_->file_system_root())); | |
| 1136 } | |
| 1137 } | 1132 } |
| 1138 | 1133 |
| 1139 // WebPluginPageDelegate ----------------------------------------------------- | 1134 // WebPluginPageDelegate ----------------------------------------------------- |
| 1140 | 1135 |
| 1141 WebCookieJar* TestWebViewDelegate::GetCookieJar() { | 1136 WebCookieJar* TestWebViewDelegate::GetCookieJar() { |
| 1142 return WebKit::webKitClient()->cookieJar(); | 1137 return WebKit::webKitClient()->cookieJar(); |
| 1143 } | 1138 } |
| 1144 | 1139 |
| 1145 // Public methods ------------------------------------------------------------ | 1140 // Public methods ------------------------------------------------------------ |
| 1146 | 1141 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 } | 1342 } |
| 1348 | 1343 |
| 1349 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1344 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1350 fake_rect_ = rect; | 1345 fake_rect_ = rect; |
| 1351 using_fake_rect_ = true; | 1346 using_fake_rect_ = true; |
| 1352 } | 1347 } |
| 1353 | 1348 |
| 1354 WebRect TestWebViewDelegate::fake_window_rect() { | 1349 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1355 return fake_rect_; | 1350 return fake_rect_; |
| 1356 } | 1351 } |
| OLD | NEW |