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 // 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 |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "media/base/filter_collection.h" | 19 #include "media/base/filter_collection.h" |
20 #include "media/base/media_log.h" | 20 #include "media/base/media_log.h" |
21 #include "media/base/message_loop_factory_impl.h" | 21 #include "media/base/message_loop_factory.h" |
22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC
lientMock.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC
lientMock.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.
h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.
h" |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 } | 644 } |
645 #endif // defined (OS_MACOSX) | 645 #endif // defined (OS_MACOSX) |
646 | 646 |
647 return new webkit::npapi::WebPluginImpl( | 647 return new webkit::npapi::WebPluginImpl( |
648 frame, params, plugins.front().path, AsWeakPtr()); | 648 frame, params, plugins.front().path, AsWeakPtr()); |
649 } | 649 } |
650 | 650 |
651 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( | 651 WebMediaPlayer* TestWebViewDelegate::createMediaPlayer( |
652 WebFrame* frame, WebMediaPlayerClient* client) { | 652 WebFrame* frame, WebMediaPlayerClient* client) { |
653 scoped_ptr<media::MessageLoopFactory> message_loop_factory( | 653 scoped_ptr<media::MessageLoopFactory> message_loop_factory( |
654 new media::MessageLoopFactoryImpl()); | 654 new media::MessageLoopFactory()); |
655 | 655 |
656 scoped_ptr<media::FilterCollection> collection( | 656 scoped_ptr<media::FilterCollection> collection( |
657 new media::FilterCollection()); | 657 new media::FilterCollection()); |
658 | 658 |
659 return new webkit_media::WebMediaPlayerImpl( | 659 return new webkit_media::WebMediaPlayerImpl( |
660 frame, | 660 frame, |
661 client, | 661 client, |
662 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), | 662 base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(), |
663 collection.release(), | 663 collection.release(), |
664 NULL, | 664 NULL, |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 } | 1159 } |
1160 | 1160 |
1161 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1161 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1162 fake_rect_ = rect; | 1162 fake_rect_ = rect; |
1163 using_fake_rect_ = true; | 1163 using_fake_rect_ = true; |
1164 } | 1164 } |
1165 | 1165 |
1166 WebRect TestWebViewDelegate::fake_window_rect() { | 1166 WebRect TestWebViewDelegate::fake_window_rect() { |
1167 return fake_rect_; | 1167 return fake_rect_; |
1168 } | 1168 } |
OLD | NEW |