| 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/browser/external_tab_container_win.h" | 5 #include "chrome/browser/external_tab_container_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 | 555 |
| 556 bool ExternalTabContainer::CanDownload(WebContents* source, int request_id) { | 556 bool ExternalTabContainer::CanDownload(WebContents* source, int request_id) { |
| 557 if (load_requests_via_automation_) { | 557 if (load_requests_via_automation_) { |
| 558 if (automation_) { | 558 if (automation_) { |
| 559 // In case the host needs to show UI that needs to take the focus. | 559 // In case the host needs to show UI that needs to take the focus. |
| 560 ::AllowSetForegroundWindow(ASFW_ANY); | 560 ::AllowSetForegroundWindow(ASFW_ANY); |
| 561 | 561 |
| 562 BrowserThread::PostTask( | 562 BrowserThread::PostTask( |
| 563 BrowserThread::IO, FROM_HERE, | 563 BrowserThread::IO, FROM_HERE, |
| 564 base::IgnoreReturn<bool>(base::Bind( | 564 base::Bind( |
| 565 &AutomationResourceMessageFilter::SendDownloadRequestToHost, | 565 base::IgnoreResult( |
| 566 automation_resource_message_filter_.get(), 0, tab_handle_, | 566 &AutomationResourceMessageFilter::SendDownloadRequestToHost), |
| 567 request_id))); | 567 automation_resource_message_filter_.get(), 0, tab_handle_, |
| 568 request_id)); |
| 568 } | 569 } |
| 569 } else { | 570 } else { |
| 570 DLOG(WARNING) << "Downloads are only supported with host browser network " | 571 DLOG(WARNING) << "Downloads are only supported with host browser network " |
| 571 "stack enabled."; | 572 "stack enabled."; |
| 572 } | 573 } |
| 573 | 574 |
| 574 // Never allow downloads. | 575 // Never allow downloads. |
| 575 return false; | 576 return false; |
| 576 } | 577 } |
| 577 | 578 |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 if (params.disposition == CURRENT_TAB) { | 1198 if (params.disposition == CURRENT_TAB) { |
| 1198 DCHECK(route_all_top_level_navigations_); | 1199 DCHECK(route_all_top_level_navigations_); |
| 1199 forward_params.disposition = NEW_FOREGROUND_TAB; | 1200 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1200 } | 1201 } |
| 1201 WebContents* new_contents = | 1202 WebContents* new_contents = |
| 1202 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1203 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
| 1203 // support only one navigation for a dummy tab before it is killed. | 1204 // support only one navigation for a dummy tab before it is killed. |
| 1204 ::DestroyWindow(GetNativeView()); | 1205 ::DestroyWindow(GetNativeView()); |
| 1205 return new_contents; | 1206 return new_contents; |
| 1206 } | 1207 } |
| OLD | NEW |