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 #include "chrome/test/automation/tab_proxy.h" | 5 #include "chrome/test/automation/tab_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 sender_->SendWithTimeout( | 101 sender_->SendWithTimeout( |
102 new AutomationMsg_NavigateToURLBlockUntilNavigationsComplete( | 102 new AutomationMsg_NavigateToURLBlockUntilNavigationsComplete( |
103 0, handle_, url, number_of_navigations, &navigate_response), | 103 0, handle_, url, number_of_navigations, &navigate_response), |
104 timeout_ms, is_timeout); | 104 timeout_ms, is_timeout); |
105 } | 105 } |
106 | 106 |
107 return navigate_response; | 107 return navigate_response; |
108 } | 108 } |
109 | 109 |
110 AutomationMsg_NavigationResponseValues TabProxy::NavigateInExternalTab( | 110 AutomationMsg_NavigationResponseValues TabProxy::NavigateInExternalTab( |
111 const GURL& url) { | 111 const GURL& url, const GURL& referrer) { |
112 if (!is_valid()) | 112 if (!is_valid()) |
113 return AUTOMATION_MSG_NAVIGATION_ERROR; | 113 return AUTOMATION_MSG_NAVIGATION_ERROR; |
114 | 114 |
115 AutomationMsg_NavigationResponseValues rv = AUTOMATION_MSG_NAVIGATION_ERROR; | 115 AutomationMsg_NavigationResponseValues rv = AUTOMATION_MSG_NAVIGATION_ERROR; |
116 sender_->Send(new AutomationMsg_NavigateInExternalTab(0, handle_, url, &rv)); | 116 sender_->Send(new AutomationMsg_NavigateInExternalTab(0, handle_, url, |
| 117 referrer, &rv)); |
117 return rv; | 118 return rv; |
118 } | 119 } |
119 | 120 |
120 AutomationMsg_NavigationResponseValues TabProxy::NavigateExternalTabAtIndex( | 121 AutomationMsg_NavigationResponseValues TabProxy::NavigateExternalTabAtIndex( |
121 int index) { | 122 int index) { |
122 if (!is_valid()) | 123 if (!is_valid()) |
123 return AUTOMATION_MSG_NAVIGATION_ERROR; | 124 return AUTOMATION_MSG_NAVIGATION_ERROR; |
124 | 125 |
125 AutomationMsg_NavigationResponseValues rv = AUTOMATION_MSG_NAVIGATION_ERROR; | 126 AutomationMsg_NavigationResponseValues rv = AUTOMATION_MSG_NAVIGATION_ERROR; |
126 sender_->Send(new AutomationMsg_NavigateExternalTabAtIndex(0, handle_, index, | 127 sender_->Send(new AutomationMsg_NavigateExternalTabAtIndex(0, handle_, index, |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 AutoLock lock(list_lock_); | 722 AutoLock lock(list_lock_); |
722 observers_list_.RemoveObserver(observer); | 723 observers_list_.RemoveObserver(observer); |
723 } | 724 } |
724 | 725 |
725 // Called on Channel background thread, if TabMessages filter is installed. | 726 // Called on Channel background thread, if TabMessages filter is installed. |
726 void TabProxy::OnMessageReceived(const IPC::Message& message) { | 727 void TabProxy::OnMessageReceived(const IPC::Message& message) { |
727 AutoLock lock(list_lock_); | 728 AutoLock lock(list_lock_); |
728 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, | 729 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, |
729 OnMessageReceived(this, message)); | 730 OnMessageReceived(this, message)); |
730 } | 731 } |
OLD | NEW |