| 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 #include "chrome_frame/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 SRCCOPY); | 1156 SRCCOPY); |
| 1157 | 1157 |
| 1158 ::ReleaseDC(tab_window_, window_dc); | 1158 ::ReleaseDC(tab_window_, window_dc); |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 void ChromeFrameAutomationClient::PrintTab() { | 1161 void ChromeFrameAutomationClient::PrintTab() { |
| 1162 if (tab_) | 1162 if (tab_) |
| 1163 tab_->PrintAsync(); | 1163 tab_->PrintAsync(); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 bool ChromeFrameAutomationClient::Reinitialize( | |
| 1167 ChromeFrameDelegate* delegate, | |
| 1168 PluginUrlRequestManager* url_fetcher) { | |
| 1169 if (url_fetcher_) { | |
| 1170 // Clean up any outstanding requests | |
| 1171 url_fetcher_->StopAllRequests(); | |
| 1172 url_fetcher_ = NULL; | |
| 1173 } | |
| 1174 | |
| 1175 if (!tab_.get() || !::IsWindow(chrome_window_)) { | |
| 1176 NOTREACHED(); | |
| 1177 DLOG(WARNING) << "ChromeFrameAutomationClient instance reused " | |
| 1178 << "with invalid tab"; | |
| 1179 return false; | |
| 1180 } | |
| 1181 | |
| 1182 if (!delegate) { | |
| 1183 NOTREACHED(); | |
| 1184 return false; | |
| 1185 } | |
| 1186 | |
| 1187 chrome_frame_delegate_ = delegate; | |
| 1188 DeleteAllPendingTasks(); | |
| 1189 SetUrlFetcher(url_fetcher); | |
| 1190 SetParentWindow(NULL); | |
| 1191 return true; | |
| 1192 } | |
| 1193 | |
| 1194 void ChromeFrameAutomationClient::AttachExternalTab( | 1166 void ChromeFrameAutomationClient::AttachExternalTab( |
| 1195 uint64 external_tab_cookie) { | 1167 uint64 external_tab_cookie) { |
| 1196 DCHECK_EQ(static_cast<TabProxy*>(NULL), tab_.get()); | 1168 DCHECK_EQ(static_cast<TabProxy*>(NULL), tab_.get()); |
| 1197 DCHECK_EQ(-1, tab_handle_); | 1169 DCHECK_EQ(-1, tab_handle_); |
| 1198 | 1170 |
| 1199 external_tab_cookie_ = external_tab_cookie; | 1171 external_tab_cookie_ = external_tab_cookie; |
| 1200 } | 1172 } |
| 1201 | 1173 |
| 1202 void ChromeFrameAutomationClient::BlockExternalTab(uint64 cookie) { | 1174 void ChromeFrameAutomationClient::BlockExternalTab(uint64 cookie) { |
| 1203 // The host does not want this tab to be shown (due popup blocker). | 1175 // The host does not want this tab to be shown (due popup blocker). |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1287 const net::URLRequestStatus& status) { | 1259 const net::URLRequestStatus& status) { |
| 1288 automation_server_->Send(new AutomationMsg_RequestEnd( | 1260 automation_server_->Send(new AutomationMsg_RequestEnd( |
| 1289 tab_->handle(), request_id, status)); | 1261 tab_->handle(), request_id, status)); |
| 1290 } | 1262 } |
| 1291 | 1263 |
| 1292 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1264 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1293 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1265 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1294 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1266 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
| 1295 tab_->handle(), success, url, cookie_string, cookie_id)); | 1267 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1296 } | 1268 } |
| OLD | NEW |