OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 9 #include "config.h" |
10 | 10 |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 | 787 |
788 void TestWebViewDelegate::UpdateAddressBar(WebView* webView) { | 788 void TestWebViewDelegate::UpdateAddressBar(WebView* webView) { |
789 WebFrame* mainFrame = webView->GetMainFrame(); | 789 WebFrame* mainFrame = webView->GetMainFrame(); |
790 | 790 |
791 WebDataSource* dataSource = mainFrame->GetDataSource(); | 791 WebDataSource* dataSource = mainFrame->GetDataSource(); |
792 if (!dataSource) | 792 if (!dataSource) |
793 dataSource = mainFrame->GetProvisionalDataSource(); | 793 dataSource = mainFrame->GetProvisionalDataSource(); |
794 if (!dataSource) | 794 if (!dataSource) |
795 return; | 795 return; |
796 | 796 |
797 SetAddressBarURL(dataSource->GetRequest().GetMainDocumentURL()); | 797 // TODO(abarth): This is wrong! |
| 798 SetAddressBarURL(dataSource->GetRequest().GetFirstPartyForCookies()); |
798 } | 799 } |
799 | 800 |
800 void TestWebViewDelegate::LocationChangeDone(WebFrame* frame) { | 801 void TestWebViewDelegate::LocationChangeDone(WebFrame* frame) { |
801 if (frame == top_loading_frame_) { | 802 if (frame == top_loading_frame_) { |
802 top_loading_frame_ = NULL; | 803 top_loading_frame_ = NULL; |
803 | 804 |
804 if (shell_->layout_test_mode()) | 805 if (shell_->layout_test_mode()) |
805 shell_->layout_test_controller()->LocationChangeDone(); | 806 shell_->layout_test_controller()->LocationChangeDone(); |
806 } | 807 } |
807 } | 808 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 return L"main frame \"" + name + L"\""; | 892 return L"main frame \"" + name + L"\""; |
892 else | 893 else |
893 return L"main frame"; | 894 return L"main frame"; |
894 } else { | 895 } else { |
895 if (name.length()) | 896 if (name.length()) |
896 return L"frame \"" + name + L"\""; | 897 return L"frame \"" + name + L"\""; |
897 else | 898 else |
898 return L"frame (anonymous)"; | 899 return L"frame (anonymous)"; |
899 } | 900 } |
900 } | 901 } |
OLD | NEW |