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 11 matching lines...) Expand all Loading... |
22 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" |
23 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
24 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" | 24 #include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" |
25 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebDragData.h" |
26 #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" | 26 #include "third_party/WebKit/WebKit/chromium/public/WebHistoryItem.h" |
27 #include "third_party/WebKit/WebKit/chromium/public/WebImage.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebImage.h" |
28 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 28 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
29 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 29 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
30 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" | 30 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" |
31 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" | 31 #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" |
| 32 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" |
32 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" |
33 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebPopupMenu.h" |
34 #include "third_party/WebKit/WebKit/chromium/public/WebRange.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebRange.h" |
35 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
36 #include "third_party/WebKit/WebKit/chromium/public/WebStorageNamespace.h" | 37 #include "third_party/WebKit/WebKit/chromium/public/WebStorageNamespace.h" |
37 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 38 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
38 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
39 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" | 40 #include "third_party/WebKit/WebKit/chromium/public/WebURLError.h" |
40 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 41 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
41 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 42 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
42 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
43 #include "webkit/appcache/web_application_cache_host_impl.h" | 44 #include "webkit/appcache/web_application_cache_host_impl.h" |
44 #include "webkit/glue/glue_serialize.h" | 45 #include "webkit/glue/glue_serialize.h" |
45 #include "webkit/glue/plugins/webplugin_impl.h" | 46 #include "webkit/glue/plugins/webplugin_impl.h" |
46 #include "webkit/glue/plugins/plugin_list.h" | 47 #include "webkit/glue/plugins/plugin_list.h" |
47 #include "webkit/glue/plugins/webplugin_delegate_impl.h" | 48 #include "webkit/glue/plugins/webplugin_delegate_impl.h" |
48 #include "webkit/glue/webdropdata.h" | 49 #include "webkit/glue/webdropdata.h" |
49 #include "webkit/glue/webpreferences.h" | 50 #include "webkit/glue/webpreferences.h" |
50 #include "webkit/glue/webkit_glue.h" | 51 #include "webkit/glue/webkit_glue.h" |
51 #include "webkit/glue/window_open_disposition.h" | 52 #include "webkit/glue/window_open_disposition.h" |
52 #include "webkit/support/webkit_support.h" | 53 #include "webkit/support/webkit_support.h" |
53 #include "webkit/tools/test_shell/accessibility_controller.h" | 54 #include "webkit/tools/test_shell/accessibility_controller.h" |
54 #include "webkit/tools/test_shell/mock_spellcheck.h" | 55 #include "webkit/tools/test_shell/mock_spellcheck.h" |
| 56 #include "webkit/tools/test_shell/notification_presenter.h" |
55 #include "webkit/tools/test_shell/simple_appcache_system.h" | 57 #include "webkit/tools/test_shell/simple_appcache_system.h" |
56 #include "webkit/tools/test_shell/test_navigation_controller.h" | 58 #include "webkit/tools/test_shell/test_navigation_controller.h" |
57 #include "webkit/tools/test_shell/test_shell.h" | 59 #include "webkit/tools/test_shell/test_shell.h" |
58 #include "webkit/tools/test_shell/test_web_worker.h" | 60 #include "webkit/tools/test_shell/test_web_worker.h" |
59 | 61 |
60 #if defined(OS_WIN) | 62 #if defined(OS_WIN) |
61 // TODO(port): make these files work everywhere. | 63 // TODO(port): make these files work everywhere. |
62 #include "webkit/tools/test_shell/drag_delegate.h" | 64 #include "webkit/tools/test_shell/drag_delegate.h" |
63 #include "webkit/tools/test_shell/drop_delegate.h" | 65 #include "webkit/tools/test_shell/drop_delegate.h" |
64 #endif | 66 #endif |
(...skipping 12 matching lines...) Expand all Loading... |
77 using WebKit::WebEditingAction; | 79 using WebKit::WebEditingAction; |
78 using WebKit::WebFormElement; | 80 using WebKit::WebFormElement; |
79 using WebKit::WebFrame; | 81 using WebKit::WebFrame; |
80 using WebKit::WebHistoryItem; | 82 using WebKit::WebHistoryItem; |
81 using WebKit::WebImage; | 83 using WebKit::WebImage; |
82 using WebKit::WebMediaPlayer; | 84 using WebKit::WebMediaPlayer; |
83 using WebKit::WebMediaPlayerClient; | 85 using WebKit::WebMediaPlayerClient; |
84 using WebKit::WebNavigationType; | 86 using WebKit::WebNavigationType; |
85 using WebKit::WebNavigationPolicy; | 87 using WebKit::WebNavigationPolicy; |
86 using WebKit::WebNode; | 88 using WebKit::WebNode; |
| 89 using WebKit::WebNotificationPresenter; |
87 using WebKit::WebPlugin; | 90 using WebKit::WebPlugin; |
88 using WebKit::WebPluginParams; | 91 using WebKit::WebPluginParams; |
89 using WebKit::WebPoint; | 92 using WebKit::WebPoint; |
90 using WebKit::WebPopupMenu; | 93 using WebKit::WebPopupMenu; |
91 using WebKit::WebPopupType; | 94 using WebKit::WebPopupType; |
92 using WebKit::WebRange; | 95 using WebKit::WebRange; |
93 using WebKit::WebRect; | 96 using WebKit::WebRect; |
94 using WebKit::WebScreenInfo; | 97 using WebKit::WebScreenInfo; |
95 using WebKit::WebSecurityOrigin; | 98 using WebKit::WebSecurityOrigin; |
96 using WebKit::WebSize; | 99 using WebKit::WebSize; |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 int current_index = | 605 int current_index = |
603 shell_->navigation_controller()->GetLastCommittedEntryIndex(); | 606 shell_->navigation_controller()->GetLastCommittedEntryIndex(); |
604 return shell_->navigation_controller()->GetEntryCount() - current_index - 1; | 607 return shell_->navigation_controller()->GetEntryCount() - current_index - 1; |
605 } | 608 } |
606 | 609 |
607 void TestWebViewDelegate::focusAccessibilityObject( | 610 void TestWebViewDelegate::focusAccessibilityObject( |
608 const WebAccessibilityObject& object) { | 611 const WebAccessibilityObject& object) { |
609 shell_->accessibility_controller()->SetFocusedElement(object); | 612 shell_->accessibility_controller()->SetFocusedElement(object); |
610 } | 613 } |
611 | 614 |
| 615 WebNotificationPresenter* TestWebViewDelegate::notificationPresenter() { |
| 616 return shell_->notification_presenter(); |
| 617 } |
| 618 |
612 // WebWidgetClient ----------------------------------------------------------- | 619 // WebWidgetClient ----------------------------------------------------------- |
613 | 620 |
614 void TestWebViewDelegate::didInvalidateRect(const WebRect& rect) { | 621 void TestWebViewDelegate::didInvalidateRect(const WebRect& rect) { |
615 if (WebWidgetHost* host = GetWidgetHost()) | 622 if (WebWidgetHost* host = GetWidgetHost()) |
616 host->DidInvalidateRect(rect); | 623 host->DidInvalidateRect(rect); |
617 } | 624 } |
618 | 625 |
619 void TestWebViewDelegate::didScrollRect(int dx, int dy, | 626 void TestWebViewDelegate::didScrollRect(int dx, int dy, |
620 const WebRect& clip_rect) { | 627 const WebRect& clip_rect) { |
621 if (WebWidgetHost* host = GetWidgetHost()) | 628 if (WebWidgetHost* host = GetWidgetHost()) |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 } | 1225 } |
1219 | 1226 |
1220 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1227 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1221 fake_rect_ = rect; | 1228 fake_rect_ = rect; |
1222 using_fake_rect_ = true; | 1229 using_fake_rect_ = true; |
1223 } | 1230 } |
1224 | 1231 |
1225 WebRect TestWebViewDelegate::fake_window_rect() { | 1232 WebRect TestWebViewDelegate::fake_window_rect() { |
1226 return fake_rect_; | 1233 return fake_rect_; |
1227 } | 1234 } |
OLD | NEW |