| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/external_tab_container_win.h" | 5 #include "chrome/browser/ui/views/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/string16.h" | 15 #include "base/string16.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "base/win/win_util.h" | 18 #include "base/win/win_util.h" |
| 19 #include "chrome/app/chrome_command_ids.h" | 19 #include "chrome/app/chrome_command_ids.h" |
| 20 #include "chrome/app/chrome_dll_resource.h" | 20 #include "chrome/app/chrome_dll_resource.h" |
| 21 #include "chrome/browser/api/infobars/infobar_service.h" | 21 #include "chrome/browser/api/infobars/infobar_service.h" |
| 22 #include "chrome/browser/automation/automation_provider.h" | 22 #include "chrome/browser/automation/automation_provider.h" |
| 23 #include "chrome/browser/devtools/devtools_toggle_action.h" | 23 #include "chrome/browser/devtools/devtools_toggle_action.h" |
| 24 #include "chrome/browser/devtools/devtools_window.h" | 24 #include "chrome/browser/devtools/devtools_window.h" |
| 25 #include "chrome/browser/file_select_helper.h" | 25 #include "chrome/browser/file_select_helper.h" |
| 26 #include "chrome/browser/history/history_tab_helper.h" | 26 #include "chrome/browser/history/history_tab_helper.h" |
| 27 #include "chrome/browser/history/history_types.h" | 27 #include "chrome/browser/history/history_types.h" |
| 28 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" | |
| 29 #include "chrome/browser/pepper_broker_infobar_delegate.h" | 28 #include "chrome/browser/pepper_broker_infobar_delegate.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/repost_form_warning_controller.h" | 30 #include "chrome/browser/repost_form_warning_controller.h" |
| 32 #include "chrome/browser/themes/theme_service.h" | 31 #include "chrome/browser/themes/theme_service.h" |
| 33 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" | 32 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
| 34 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 33 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| 35 #include "chrome/browser/ui/browser.h" | 34 #include "chrome/browser/ui/browser.h" |
| 36 #include "chrome/browser/ui/browser_tab_contents.h" | 35 #include "chrome/browser/ui/browser_tab_contents.h" |
| 37 #include "chrome/browser/ui/browser_window.h" | 36 #include "chrome/browser/ui/browser_window.h" |
| 38 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 37 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
| 39 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" | 38 #include "chrome/browser/ui/tab_modal_confirm_dialog.h" |
| 40 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" | 39 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" |
| 41 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_win.h" | 40 #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_win.h" |
| 42 #include "chrome/common/automation_messages.h" | 41 #include "chrome/common/automation_messages.h" |
| 43 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
| 44 #include "chrome/common/chrome_notification_types.h" | 43 #include "chrome/common/chrome_notification_types.h" |
| 45 #include "chrome/common/render_messages.h" | 44 #include "chrome/common/render_messages.h" |
| 46 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 47 #include "content/public/browser/load_notification_details.h" | 46 #include "content/public/browser/load_notification_details.h" |
| 48 #include "content/public/browser/native_web_keyboard_event.h" | 47 #include "content/public/browser/native_web_keyboard_event.h" |
| 49 #include "content/public/browser/navigation_details.h" | 48 #include "content/public/browser/navigation_details.h" |
| 50 #include "content/public/browser/navigation_entry.h" | 49 #include "content/public/browser/navigation_entry.h" |
| 51 #include "content/public/browser/notification_service.h" | 50 #include "content/public/browser/notification_service.h" |
| 52 #include "content/public/browser/render_process_host.h" | 51 #include "content/public/browser/render_process_host.h" |
| 53 #include "content/public/browser/render_view_host.h" | 52 #include "content/public/browser/render_view_host.h" |
| 54 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
| 55 #include "content/public/browser/web_intents_dispatcher.h" | |
| 56 #include "content/public/common/bindings_policy.h" | 54 #include "content/public/common/bindings_policy.h" |
| 57 #include "content/public/common/frame_navigate_params.h" | 55 #include "content/public/common/frame_navigate_params.h" |
| 58 #include "content/public/common/page_transition_types.h" | 56 #include "content/public/common/page_transition_types.h" |
| 59 #include "content/public/common/page_zoom.h" | 57 #include "content/public/common/page_zoom.h" |
| 60 #include "content/public/common/renderer_preferences.h" | 58 #include "content/public/common/renderer_preferences.h" |
| 61 #include "content/public/common/ssl_status.h" | 59 #include "content/public/common/ssl_status.h" |
| 62 #include "grit/generated_resources.h" | 60 #include "grit/generated_resources.h" |
| 63 #include "grit/locale_settings.h" | 61 #include "grit/locale_settings.h" |
| 64 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" | 62 #include "third_party/WebKit/Source/Platform/chromium/public/WebCString.h" |
| 65 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" | 63 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 void ExternalTabContainerWin::RegisterProtocolHandler( | 802 void ExternalTabContainerWin::RegisterProtocolHandler( |
| 805 WebContents* tab, | 803 WebContents* tab, |
| 806 const std::string& protocol, | 804 const std::string& protocol, |
| 807 const GURL& url, | 805 const GURL& url, |
| 808 const string16& title, | 806 const string16& title, |
| 809 bool user_gesture) { | 807 bool user_gesture) { |
| 810 Browser::RegisterProtocolHandlerHelper(tab, protocol, url, title, | 808 Browser::RegisterProtocolHandlerHelper(tab, protocol, url, title, |
| 811 user_gesture, NULL); | 809 user_gesture, NULL); |
| 812 } | 810 } |
| 813 | 811 |
| 814 #if defined(ENABLE_WEB_INTENTS) | |
| 815 void ExternalTabContainerWin::RegisterIntentHandler( | |
| 816 WebContents* tab, | |
| 817 const webkit_glue::WebIntentServiceData& data, | |
| 818 bool user_gesture) { | |
| 819 RegisterIntentHandlerInfoBarDelegate::Create(tab, data); | |
| 820 } | |
| 821 | |
| 822 void ExternalTabContainerWin::WebIntentDispatch( | |
| 823 WebContents* tab, | |
| 824 content::WebIntentsDispatcher* intents_dispatcher) { | |
| 825 // TODO(binji) How do we want to display the WebIntentPicker bubble if there | |
| 826 // is no BrowserWindow? | |
| 827 delete intents_dispatcher; | |
| 828 } | |
| 829 #endif | |
| 830 | |
| 831 void ExternalTabContainerWin::FindReply(WebContents* tab, | 812 void ExternalTabContainerWin::FindReply(WebContents* tab, |
| 832 int request_id, | 813 int request_id, |
| 833 int number_of_matches, | 814 int number_of_matches, |
| 834 const gfx::Rect& selection_rect, | 815 const gfx::Rect& selection_rect, |
| 835 int active_match_ordinal, | 816 int active_match_ordinal, |
| 836 bool final_update) { | 817 bool final_update) { |
| 837 Browser::FindReplyHelper(tab, request_id, number_of_matches, selection_rect, | 818 Browser::FindReplyHelper(tab, request_id, number_of_matches, selection_rect, |
| 838 active_match_ordinal, final_update); | 819 active_match_ordinal, final_update); |
| 839 } | 820 } |
| 840 | 821 |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 if (params.disposition == CURRENT_TAB) { | 1277 if (params.disposition == CURRENT_TAB) { |
| 1297 DCHECK(route_all_top_level_navigations_); | 1278 DCHECK(route_all_top_level_navigations_); |
| 1298 forward_params.disposition = NEW_FOREGROUND_TAB; | 1279 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1299 } | 1280 } |
| 1300 WebContents* new_contents = | 1281 WebContents* new_contents = |
| 1301 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); | 1282 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); |
| 1302 // support only one navigation for a dummy tab before it is killed. | 1283 // support only one navigation for a dummy tab before it is killed. |
| 1303 ::DestroyWindow(GetNativeView()); | 1284 ::DestroyWindow(GetNativeView()); |
| 1304 return new_contents; | 1285 return new_contents; |
| 1305 } | 1286 } |
| OLD | NEW |