| 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 void ExternalTabContainer::WebIntentDispatch(TabContents* tab, | 768 void ExternalTabContainer::WebIntentDispatch(TabContents* tab, |
| 769 int routing_id, | 769 int routing_id, |
| 770 const string16& action, | 770 const string16& action, |
| 771 const string16& type, | 771 const string16& type, |
| 772 const string16& data, | 772 const string16& data, |
| 773 int intent_id) { | 773 int intent_id) { |
| 774 Browser::WebIntentDispatchHelper(tab, routing_id, action, type, data, | 774 Browser::WebIntentDispatchHelper(tab, routing_id, action, type, data, |
| 775 intent_id); | 775 intent_id); |
| 776 } | 776 } |
| 777 | 777 |
| 778 void ExternalTabContainer::FindReply(TabContents* tab, |
| 779 int request_id, |
| 780 int number_of_matches, |
| 781 const gfx::Rect& selection_rect, |
| 782 int active_match_ordinal, |
| 783 bool final_update) { |
| 784 Browser::FindReplyHelper(tab, request_id, number_of_matches, selection_rect, |
| 785 active_match_ordinal, final_update); |
| 786 } |
| 787 |
| 778 bool ExternalTabContainer::OnMessageReceived(const IPC::Message& message) { | 788 bool ExternalTabContainer::OnMessageReceived(const IPC::Message& message) { |
| 779 bool handled = true; | 789 bool handled = true; |
| 780 IPC_BEGIN_MESSAGE_MAP(ExternalTabContainer, message) | 790 IPC_BEGIN_MESSAGE_MAP(ExternalTabContainer, message) |
| 781 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ForwardMessageToExternalHost, | 791 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ForwardMessageToExternalHost, |
| 782 OnForwardMessageToExternalHost) | 792 OnForwardMessageToExternalHost) |
| 783 IPC_MESSAGE_UNHANDLED(handled = false) | 793 IPC_MESSAGE_UNHANDLED(handled = false) |
| 784 IPC_END_MESSAGE_MAP() | 794 IPC_END_MESSAGE_MAP() |
| 785 return handled; | 795 return handled; |
| 786 } | 796 } |
| 787 | 797 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 // Grab a reference here which will be released in OnFinalMessage | 894 // Grab a reference here which will be released in OnFinalMessage |
| 885 AddRef(); | 895 AddRef(); |
| 886 } | 896 } |
| 887 return result; | 897 return result; |
| 888 } | 898 } |
| 889 | 899 |
| 890 void ExternalTabContainer::OnDestroy() { | 900 void ExternalTabContainer::OnDestroy() { |
| 891 prop_.reset(); | 901 prop_.reset(); |
| 892 Uninitialize(); | 902 Uninitialize(); |
| 893 NativeWidgetWin::OnDestroy(); | 903 NativeWidgetWin::OnDestroy(); |
| 894 if (browser_.get()) { | |
| 895 ::DestroyWindow(browser_->window()->GetNativeHandle()); | |
| 896 } | |
| 897 } | 904 } |
| 898 | 905 |
| 899 void ExternalTabContainer::OnFinalMessage(HWND window) { | 906 void ExternalTabContainer::OnFinalMessage(HWND window) { |
| 900 // Release the reference which we grabbed in WM_CREATE. | 907 // Release the reference which we grabbed in WM_CREATE. |
| 901 Release(); | 908 Release(); |
| 902 } | 909 } |
| 903 | 910 |
| 904 void ExternalTabContainer::RunUnloadHandlers(IPC::Message* reply_message) { | 911 void ExternalTabContainer::RunUnloadHandlers(IPC::Message* reply_message) { |
| 905 if (!automation_) { | 912 if (!automation_) { |
| 906 delete reply_message; | 913 delete reply_message; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 if (params.disposition == CURRENT_TAB) { | 1204 if (params.disposition == CURRENT_TAB) { |
| 1198 DCHECK(route_all_top_level_navigations_); | 1205 DCHECK(route_all_top_level_navigations_); |
| 1199 forward_params.disposition = NEW_FOREGROUND_TAB; | 1206 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1200 } | 1207 } |
| 1201 TabContents* new_contents = | 1208 TabContents* new_contents = |
| 1202 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1209 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
| 1203 // support only one navigation for a dummy tab before it is killed. | 1210 // support only one navigation for a dummy tab before it is killed. |
| 1204 ::DestroyWindow(GetNativeView()); | 1211 ::DestroyWindow(GetNativeView()); |
| 1205 return new_contents; | 1212 return new_contents; |
| 1206 } | 1213 } |
| OLD | NEW |