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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/win/win_util.h" | 13 #include "base/win/win_util.h" |
14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/app/chrome_dll_resource.h" | 15 #include "chrome/app/chrome_dll_resource.h" |
16 #include "chrome/browser/automation/automation_provider.h" | 16 #include "chrome/browser/automation/automation_provider.h" |
17 #include "chrome/browser/debugger/devtools_manager.h" | 17 #include "chrome/browser/debugger/devtools_manager.h" |
18 #include "chrome/browser/debugger/devtools_toggle_action.h" | 18 #include "chrome/browser/debugger/devtools_toggle_action.h" |
19 #include "chrome/browser/google/google_util.h" | 19 #include "chrome/browser/google/google_util.h" |
20 #include "chrome/browser/history/history_types.h" | 20 #include "chrome/browser/history/history_types.h" |
21 #include "chrome/browser/history/history_tab_helper.h" | 21 #include "chrome/browser/history/history_tab_helper.h" |
22 #include "chrome/browser/page_info_window.h" | 22 #include "chrome/browser/page_info_window.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
24 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 25 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
26 #include "chrome/browser/ui/browser_window.h" | 27 #include "chrome/browser/ui/browser_window.h" |
27 #include "chrome/browser/ui/download/download_tab_helper.h" | 28 #include "chrome/browser/ui/download/download_tab_helper.h" |
28 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 29 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
29 #include "chrome/browser/ui/views/browser_dialogs.h" | 30 #include "chrome/browser/ui/views/browser_dialogs.h" |
30 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 31 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
31 #include "chrome/browser/ui/views/page_info_bubble_view.h" | 32 #include "chrome/browser/ui/views/page_info_bubble_view.h" |
32 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" | 33 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" |
33 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 34 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 RenderViewHost* render_view_host) { | 587 RenderViewHost* render_view_host) { |
587 // Undo the resource automation registration performed in | 588 // Undo the resource automation registration performed in |
588 // ExternalTabContainer::RegisterRenderViewHost. | 589 // ExternalTabContainer::RegisterRenderViewHost. |
589 if (render_view_host) { | 590 if (render_view_host) { |
590 AutomationResourceMessageFilter::UnRegisterRenderView( | 591 AutomationResourceMessageFilter::UnRegisterRenderView( |
591 render_view_host->process()->id(), | 592 render_view_host->process()->id(), |
592 render_view_host->routing_id()); | 593 render_view_host->routing_id()); |
593 } | 594 } |
594 } | 595 } |
595 | 596 |
| 597 content::JavaScriptDialogCreator* |
| 598 ExternalTabContainer::GetJavaScriptDialogCreator() { |
| 599 return GetJavaScriptDialogCreatorInstance(); |
| 600 } |
| 601 |
596 bool ExternalTabContainer::HandleContextMenu(const ContextMenuParams& params) { | 602 bool ExternalTabContainer::HandleContextMenu(const ContextMenuParams& params) { |
597 if (!automation_) { | 603 if (!automation_) { |
598 NOTREACHED(); | 604 NOTREACHED(); |
599 return false; | 605 return false; |
600 } | 606 } |
601 external_context_menu_.reset( | 607 external_context_menu_.reset( |
602 new RenderViewContextMenuViews(tab_contents(), params)); | 608 new RenderViewContextMenuViews(tab_contents(), params)); |
603 external_context_menu_->SetExternal(); | 609 external_context_menu_->SetExternal(); |
604 external_context_menu_->Init(); | 610 external_context_menu_->Init(); |
605 external_context_menu_->UpdateMenuItemStates(); | 611 external_context_menu_->UpdateMenuItemStates(); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 | 1145 |
1140 if (disposition == CURRENT_TAB) { | 1146 if (disposition == CURRENT_TAB) { |
1141 DCHECK(route_all_top_level_navigations_); | 1147 DCHECK(route_all_top_level_navigations_); |
1142 disposition = NEW_FOREGROUND_TAB; | 1148 disposition = NEW_FOREGROUND_TAB; |
1143 } | 1149 } |
1144 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, | 1150 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, |
1145 transition); | 1151 transition); |
1146 // support only one navigation for a dummy tab before it is killed. | 1152 // support only one navigation for a dummy tab before it is killed. |
1147 ::DestroyWindow(GetNativeView()); | 1153 ::DestroyWindow(GetNativeView()); |
1148 } | 1154 } |
OLD | NEW |