OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 WebFrame* frame, bool is_new_navigation) { | 828 WebFrame* frame, bool is_new_navigation) { |
829 UpdateForCommittedLoad(frame, is_new_navigation); | 829 UpdateForCommittedLoad(frame, is_new_navigation); |
830 } | 830 } |
831 | 831 |
832 void TestWebViewDelegate::didClearWindowObject(WebFrame* frame) { | 832 void TestWebViewDelegate::didClearWindowObject(WebFrame* frame) { |
833 shell_->BindJSObjectsToWindow(frame); | 833 shell_->BindJSObjectsToWindow(frame); |
834 } | 834 } |
835 | 835 |
836 void TestWebViewDelegate::didReceiveTitle( | 836 void TestWebViewDelegate::didReceiveTitle( |
837 WebFrame* frame, const WebString& title, WebTextDirection direction) { | 837 WebFrame* frame, const WebString& title, WebTextDirection direction) { |
838 std::wstring wtitle = UTF16ToWideHack(title); | 838 SetPageTitle(title); |
839 | |
840 SetPageTitle(wtitle); | |
841 } | 839 } |
842 | 840 |
843 void TestWebViewDelegate::didFinishDocumentLoad(WebFrame* frame) { | 841 void TestWebViewDelegate::didFinishDocumentLoad(WebFrame* frame) { |
844 unsigned pending_unload_events = frame->unloadListenerCount(); | 842 unsigned pending_unload_events = frame->unloadListenerCount(); |
845 if (pending_unload_events) { | 843 if (pending_unload_events) { |
846 printf("%S - has %u onunload handler(s)\n", | 844 printf("%S - has %u onunload handler(s)\n", |
847 GetFrameDescription(frame).c_str(), pending_unload_events); | 845 GetFrameDescription(frame).c_str(), pending_unload_events); |
848 } | 846 } |
849 } | 847 } |
850 | 848 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 } | 1156 } |
1159 | 1157 |
1160 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1158 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1161 fake_rect_ = rect; | 1159 fake_rect_ = rect; |
1162 using_fake_rect_ = true; | 1160 using_fake_rect_ = true; |
1163 } | 1161 } |
1164 | 1162 |
1165 WebRect TestWebViewDelegate::fake_window_rect() { | 1163 WebRect TestWebViewDelegate::fake_window_rect() { |
1166 return fake_rect_; | 1164 return fake_rect_; |
1167 } | 1165 } |
OLD | NEW |