| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 } | 965 } |
| 966 return true; | 966 return true; |
| 967 } | 967 } |
| 968 | 968 |
| 969 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { | 969 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { |
| 970 if (!tab_contents_.get()) { | 970 if (!tab_contents_.get()) { |
| 971 NOTREACHED(); | 971 NOTREACHED(); |
| 972 return; | 972 return; |
| 973 } | 973 } |
| 974 | 974 |
| 975 TRACE_EVENT_BEGIN("ExternalTabContainer::Navigate", 0, url.spec()); | 975 TRACE_EVENT_BEGIN_ETW("ExternalTabContainer::Navigate", 0, url.spec()); |
| 976 | 976 |
| 977 tab_contents_->controller().LoadURL(url, referrer, | 977 tab_contents_->controller().LoadURL(url, referrer, |
| 978 PageTransition::START_PAGE); | 978 PageTransition::START_PAGE); |
| 979 } | 979 } |
| 980 | 980 |
| 981 bool ExternalTabContainer::OnGoToEntryOffset(int offset) { | 981 bool ExternalTabContainer::OnGoToEntryOffset(int offset) { |
| 982 if (load_requests_via_automation_) { | 982 if (load_requests_via_automation_) { |
| 983 automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( | 983 automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( |
| 984 tab_handle_, offset)); | 984 tab_handle_, offset)); |
| 985 return false; | 985 return false; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 | 1104 |
| 1105 if (disposition == CURRENT_TAB) { | 1105 if (disposition == CURRENT_TAB) { |
| 1106 DCHECK(route_all_top_level_navigations_); | 1106 DCHECK(route_all_top_level_navigations_); |
| 1107 disposition = NEW_FOREGROUND_TAB; | 1107 disposition = NEW_FOREGROUND_TAB; |
| 1108 } | 1108 } |
| 1109 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, | 1109 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, |
| 1110 transition); | 1110 transition); |
| 1111 // support only one navigation for a dummy tab before it is killed. | 1111 // support only one navigation for a dummy tab before it is killed. |
| 1112 ::DestroyWindow(GetNativeView()); | 1112 ::DestroyWindow(GetNativeView()); |
| 1113 } | 1113 } |
| OLD | NEW |