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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 return; | 723 return; |
724 | 724 |
725 static const int kHttpClientErrorStart = 400; | 725 static const int kHttpClientErrorStart = 400; |
726 static const int kHttpServerErrorEnd = 510; | 726 static const int kHttpServerErrorEnd = 510; |
727 | 727 |
728 switch (type.value) { | 728 switch (type.value) { |
729 case NotificationType::LOAD_STOP: { | 729 case NotificationType::LOAD_STOP: { |
730 const LoadNotificationDetails* load = | 730 const LoadNotificationDetails* load = |
731 Details<LoadNotificationDetails>(details).ptr(); | 731 Details<LoadNotificationDetails>(details).ptr(); |
732 if (load != NULL && PageTransition::IsMainFrame(load->origin())) { | 732 if (load != NULL && PageTransition::IsMainFrame(load->origin())) { |
733 TRACE_EVENT_END("ExternalTabContainer::Navigate", 0, | 733 TRACE_EVENT_END_ETW("ExternalTabContainer::Navigate", 0, |
734 load->url().spec()); | 734 load->url().spec()); |
735 automation_->Send(new AutomationMsg_TabLoaded(tab_handle_, | 735 automation_->Send(new AutomationMsg_TabLoaded(tab_handle_, |
736 load->url())); | 736 load->url())); |
737 } | 737 } |
738 break; | 738 break; |
739 } | 739 } |
740 case NotificationType::NAV_ENTRY_COMMITTED: { | 740 case NotificationType::NAV_ENTRY_COMMITTED: { |
741 if (ignore_next_load_notification_) { | 741 if (ignore_next_load_notification_) { |
742 ignore_next_load_notification_ = false; | 742 ignore_next_load_notification_ = false; |
743 return; | 743 return; |
744 } | 744 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 } | 973 } |
974 return true; | 974 return true; |
975 } | 975 } |
976 | 976 |
977 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { | 977 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { |
978 if (!tab_contents_.get()) { | 978 if (!tab_contents_.get()) { |
979 NOTREACHED(); | 979 NOTREACHED(); |
980 return; | 980 return; |
981 } | 981 } |
982 | 982 |
983 TRACE_EVENT_BEGIN("ExternalTabContainer::Navigate", 0, url.spec()); | 983 TRACE_EVENT_BEGIN_ETW("ExternalTabContainer::Navigate", 0, url.spec()); |
984 | 984 |
985 tab_contents_->controller().LoadURL(url, referrer, | 985 tab_contents_->controller().LoadURL(url, referrer, |
986 PageTransition::START_PAGE); | 986 PageTransition::START_PAGE); |
987 } | 987 } |
988 | 988 |
989 bool ExternalTabContainer::OnGoToEntryOffset(int offset) { | 989 bool ExternalTabContainer::OnGoToEntryOffset(int offset) { |
990 if (load_requests_via_automation_) { | 990 if (load_requests_via_automation_) { |
991 automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( | 991 automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( |
992 tab_handle_, offset)); | 992 tab_handle_, offset)); |
993 return false; | 993 return false; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 | 1112 |
1113 if (disposition == CURRENT_TAB) { | 1113 if (disposition == CURRENT_TAB) { |
1114 DCHECK(route_all_top_level_navigations_); | 1114 DCHECK(route_all_top_level_navigations_); |
1115 disposition = NEW_FOREGROUND_TAB; | 1115 disposition = NEW_FOREGROUND_TAB; |
1116 } | 1116 } |
1117 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, | 1117 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, |
1118 transition); | 1118 transition); |
1119 // support only one navigation for a dummy tab before it is killed. | 1119 // support only one navigation for a dummy tab before it is killed. |
1120 ::DestroyWindow(GetNativeView()); | 1120 ::DestroyWindow(GetNativeView()); |
1121 } | 1121 } |
OLD | NEW |