| 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 #include "webkit/support/webkit_support.h" | 5 #include "webkit/support/webkit_support.h" |
| 6 | 6 |
| 7 #include "app/gfx/gl/gl_implementation.h" | 7 #include "app/gfx/gl/gl_implementation.h" |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "net/base/escape.h" | 28 #include "net/base/escape.h" |
| 29 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
| 30 #include "net/base/net_util.h" | 30 #include "net/base/net_util.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 32 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" |
| 33 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
| 34 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" |
| 35 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
| 36 #include "webkit/appcache/web_application_cache_host_impl.h" | 36 #include "webkit/appcache/web_application_cache_host_impl.h" |
| 37 #include "webkit/glue/media/video_renderer_impl.h" | 37 #include "webkit/glue/media/video_renderer_impl.h" |
| 38 #include "webkit/glue/plugins/plugin_list.h" |
| 39 #include "webkit/glue/plugins/webplugin_impl.h" |
| 40 #include "webkit/glue/plugins/webplugin_page_delegate.h" |
| 41 #include "webkit/glue/plugins/webplugininfo.h" |
| 38 #include "webkit/glue/webkit_glue.h" | 42 #include "webkit/glue/webkit_glue.h" |
| 39 #include "webkit/glue/webkitclient_impl.h" | 43 #include "webkit/glue/webkitclient_impl.h" |
| 40 #include "webkit/glue/webmediaplayer_impl.h" | 44 #include "webkit/glue/webmediaplayer_impl.h" |
| 41 #include "webkit/plugins/npapi/plugin_list.h" | |
| 42 #include "webkit/plugins/npapi/webplugin_impl.h" | |
| 43 #include "webkit/plugins/npapi/webplugin_page_delegate.h" | |
| 44 #include "webkit/plugins/npapi/webplugininfo.h" | |
| 45 #include "webkit/support/platform_support.h" | 45 #include "webkit/support/platform_support.h" |
| 46 #include "webkit/support/test_webplugin_page_delegate.h" | 46 #include "webkit/support/test_webplugin_page_delegate.h" |
| 47 #include "webkit/support/test_webkit_client.h" | 47 #include "webkit/support/test_webkit_client.h" |
| 48 #include "webkit/tools/test_shell/simple_database_system.h" | 48 #include "webkit/tools/test_shell/simple_database_system.h" |
| 49 #include "webkit/tools/test_shell/simple_file_system.h" | 49 #include "webkit/tools/test_shell/simple_file_system.h" |
| 50 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 50 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
| 51 | 51 |
| 52 using WebKit::WebCString; | 52 using WebKit::WebCString; |
| 53 using WebKit::WebDevToolsAgentClient; | 53 using WebKit::WebDevToolsAgentClient; |
| 54 using WebKit::WebFileSystem; | 54 using WebKit::WebFileSystem; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 scoped_ptr<base::AtExitManager> at_exit_manager_; | 140 scoped_ptr<base::AtExitManager> at_exit_manager_; |
| 141 scoped_ptr<MessageLoopForUI> main_message_loop_; | 141 scoped_ptr<MessageLoopForUI> main_message_loop_; |
| 142 scoped_ptr<TestWebKitClient> webkit_client_; | 142 scoped_ptr<TestWebKitClient> webkit_client_; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 class WebPluginImplWithPageDelegate | 145 class WebPluginImplWithPageDelegate |
| 146 : public webkit_support::TestWebPluginPageDelegate, | 146 : public webkit_support::TestWebPluginPageDelegate, |
| 147 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>, | 147 public base::SupportsWeakPtr<WebPluginImplWithPageDelegate>, |
| 148 public webkit::npapi::WebPluginImpl { | 148 public webkit_glue::WebPluginImpl { |
| 149 public: | 149 public: |
| 150 WebPluginImplWithPageDelegate(WebFrame* frame, | 150 WebPluginImplWithPageDelegate(WebFrame* frame, |
| 151 const WebPluginParams& params, | 151 const WebPluginParams& params, |
| 152 const FilePath& path, | 152 const FilePath& path, |
| 153 const std::string& mime_type) | 153 const std::string& mime_type) |
| 154 : webkit_support::TestWebPluginPageDelegate(), | 154 : webkit_support::TestWebPluginPageDelegate(), |
| 155 webkit::npapi::WebPluginImpl( | 155 webkit_glue::WebPluginImpl( |
| 156 frame, params, path, mime_type, AsWeakPtr()) {} | 156 frame, params, path, mime_type, AsWeakPtr()) {} |
| 157 virtual ~WebPluginImplWithPageDelegate() {} | 157 virtual ~WebPluginImplWithPageDelegate() {} |
| 158 private: | 158 private: |
| 159 DISALLOW_COPY_AND_ASSIGN(WebPluginImplWithPageDelegate); | 159 DISALLOW_COPY_AND_ASSIGN(WebPluginImplWithPageDelegate); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 FilePath GetWebKitRootDirFilePath() { | 162 FilePath GetWebKitRootDirFilePath() { |
| 163 FilePath basePath; | 163 FilePath basePath; |
| 164 PathService::Get(base::DIR_SOURCE_ROOT, &basePath); | 164 PathService::Get(base::DIR_SOURCE_ROOT, &basePath); |
| 165 if (file_util::PathExists(basePath.Append(FILE_PATH_LITERAL("chrome")))) { | 165 if (file_util::PathExists(basePath.Append(FILE_PATH_LITERAL("chrome")))) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 WebKit::WebKitClient* GetWebKitClient() { | 245 WebKit::WebKitClient* GetWebKitClient() { |
| 246 DCHECK(test_environment); | 246 DCHECK(test_environment); |
| 247 return test_environment->webkit_client(); | 247 return test_environment->webkit_client(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 WebPlugin* CreateWebPlugin(WebFrame* frame, | 250 WebPlugin* CreateWebPlugin(WebFrame* frame, |
| 251 const WebPluginParams& params) { | 251 const WebPluginParams& params) { |
| 252 const bool kAllowWildcard = true; | 252 const bool kAllowWildcard = true; |
| 253 webkit::npapi::WebPluginInfo info; | 253 WebPluginInfo info; |
| 254 std::string actual_mime_type; | 254 std::string actual_mime_type; |
| 255 if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo( | 255 if (!NPAPI::PluginList::Singleton()->GetPluginInfo( |
| 256 params.url, params.mimeType.utf8(), kAllowWildcard, &info, | 256 params.url, params.mimeType.utf8(), kAllowWildcard, &info, |
| 257 &actual_mime_type) || !info.enabled) { | 257 &actual_mime_type) || !info.enabled) { |
| 258 return NULL; | 258 return NULL; |
| 259 } | 259 } |
| 260 | 260 |
| 261 return new WebPluginImplWithPageDelegate( | 261 return new WebPluginImplWithPageDelegate( |
| 262 frame, params, info.path, actual_mime_type); | 262 frame, params, info.path, actual_mime_type); |
| 263 } | 263 } |
| 264 | 264 |
| 265 WebKit::WebMediaPlayer* CreateMediaPlayer(WebFrame* frame, | 265 WebKit::WebMediaPlayer* CreateMediaPlayer(WebFrame* frame, |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 // FileSystem | 525 // FileSystem |
| 526 void OpenFileSystem(WebFrame* frame, WebFileSystem::Type type, | 526 void OpenFileSystem(WebFrame* frame, WebFileSystem::Type type, |
| 527 long long size, bool create, WebFileSystemCallbacks* callbacks) { | 527 long long size, bool create, WebFileSystemCallbacks* callbacks) { |
| 528 SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( | 528 SimpleFileSystem* fileSystem = static_cast<SimpleFileSystem*>( |
| 529 test_environment->webkit_client()->fileSystem()); | 529 test_environment->webkit_client()->fileSystem()); |
| 530 fileSystem->OpenFileSystem(frame, type, size, create, callbacks); | 530 fileSystem->OpenFileSystem(frame, type, size, create, callbacks); |
| 531 } | 531 } |
| 532 | 532 |
| 533 } // namespace webkit_support | 533 } // namespace webkit_support |
| OLD | NEW |