| 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" |
| 11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "base/win/win_util.h" | 16 #include "base/win/win_util.h" |
| 17 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
| 18 #include "chrome/app/chrome_dll_resource.h" | 18 #include "chrome/app/chrome_dll_resource.h" |
| 19 #include "chrome/browser/automation/automation_provider.h" | 19 #include "chrome/browser/automation/automation_provider.h" |
| 20 #include "chrome/browser/debugger/devtools_toggle_action.h" | 20 #include "chrome/browser/debugger/devtools_toggle_action.h" |
| 21 #include "chrome/browser/debugger/devtools_window.h" | 21 #include "chrome/browser/debugger/devtools_window.h" |
| 22 #include "chrome/browser/history/history_tab_helper.h" | 22 #include "chrome/browser/history/history_tab_helper.h" |
| 23 #include "chrome/browser/history/history_types.h" | 23 #include "chrome/browser/history/history_types.h" |
| 24 #include "chrome/browser/infobars/infobar_tab_helper.h" | 24 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 26 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
| 27 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 27 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| 28 #include "chrome/browser/ui/browser.h" | 28 #include "chrome/browser/ui/browser.h" |
| 29 #include "chrome/browser/ui/browser_dialogs.h" |
| 29 #include "chrome/browser/ui/browser_window.h" | 30 #include "chrome/browser/ui/browser_window.h" |
| 30 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 31 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 31 #include "chrome/browser/ui/views/browser_dialogs.h" | 32 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 32 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 33 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
| 33 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" | 34 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" |
| 34 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 35 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
| 35 #include "chrome/common/automation_messages.h" | 36 #include "chrome/common/automation_messages.h" |
| 36 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
| 37 #include "chrome/common/chrome_notification_types.h" | 38 #include "chrome/common/chrome_notification_types.h" |
| 38 #include "chrome/common/render_messages.h" | 39 #include "chrome/common/render_messages.h" |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 | 685 |
| 685 if (!proceed) { | 686 if (!proceed) { |
| 686 AutomationMsg_RunUnloadHandlers::WriteReplyParams(unload_reply_message_, | 687 AutomationMsg_RunUnloadHandlers::WriteReplyParams(unload_reply_message_, |
| 687 false); | 688 false); |
| 688 automation_->Send(unload_reply_message_); | 689 automation_->Send(unload_reply_message_); |
| 689 unload_reply_message_ = NULL; | 690 unload_reply_message_ = NULL; |
| 690 *proceed_to_fire_unload = false; | 691 *proceed_to_fire_unload = false; |
| 691 } | 692 } |
| 692 } | 693 } |
| 693 | 694 |
| 694 void ExternalTabContainer::ShowRepostFormWarningDialog( | |
| 695 TabContents* tab_contents) { | |
| 696 browser::ShowRepostFormWarningDialog(GetNativeView(), tab_contents); | |
| 697 } | |
| 698 | |
| 699 void ExternalTabContainer::RunFileChooser( | 695 void ExternalTabContainer::RunFileChooser( |
| 700 TabContents* tab, const content::FileChooserParams& params) { | 696 TabContents* tab, const content::FileChooserParams& params) { |
| 701 Browser::RunFileChooserHelper(tab, params); | 697 Browser::RunFileChooserHelper(tab, params); |
| 702 } | 698 } |
| 703 | 699 |
| 704 void ExternalTabContainer::EnumerateDirectory(TabContents* tab, int request_id, | 700 void ExternalTabContainer::EnumerateDirectory(TabContents* tab, int request_id, |
| 705 const FilePath& path) { | 701 const FilePath& path) { |
| 706 Browser::EnumerateDirectoryHelper(tab, request_id, path); | 702 Browser::EnumerateDirectoryHelper(tab, request_id, path); |
| 707 } | 703 } |
| 708 | 704 |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 if (params.disposition == CURRENT_TAB) { | 1167 if (params.disposition == CURRENT_TAB) { |
| 1172 DCHECK(route_all_top_level_navigations_); | 1168 DCHECK(route_all_top_level_navigations_); |
| 1173 forward_params.disposition = NEW_FOREGROUND_TAB; | 1169 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1174 } | 1170 } |
| 1175 TabContents* new_contents = | 1171 TabContents* new_contents = |
| 1176 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1172 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
| 1177 // support only one navigation for a dummy tab before it is killed. | 1173 // support only one navigation for a dummy tab before it is killed. |
| 1178 ::DestroyWindow(GetNativeView()); | 1174 ::DestroyWindow(GetNativeView()); |
| 1179 return new_contents; | 1175 return new_contents; |
| 1180 } | 1176 } |
| OLD | NEW |