| 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 return; | 727 return; |
| 728 | 728 |
| 729 static const int kHttpClientErrorStart = 400; | 729 static const int kHttpClientErrorStart = 400; |
| 730 static const int kHttpServerErrorEnd = 510; | 730 static const int kHttpServerErrorEnd = 510; |
| 731 | 731 |
| 732 switch (type.value) { | 732 switch (type.value) { |
| 733 case NotificationType::LOAD_STOP: { | 733 case NotificationType::LOAD_STOP: { |
| 734 const LoadNotificationDetails* load = | 734 const LoadNotificationDetails* load = |
| 735 Details<LoadNotificationDetails>(details).ptr(); | 735 Details<LoadNotificationDetails>(details).ptr(); |
| 736 if (load != NULL && PageTransition::IsMainFrame(load->origin())) { | 736 if (load != NULL && PageTransition::IsMainFrame(load->origin())) { |
| 737 TRACE_EVENT_END("ExternalTabContainer::Navigate", 0, | 737 TRACE_EVENT_END_LEGACY("ExternalTabContainer::Navigate", 0, |
| 738 load->url().spec()); | 738 load->url().spec().c_str()); |
| 739 automation_->Send(new AutomationMsg_TabLoaded(tab_handle_, | 739 automation_->Send(new AutomationMsg_TabLoaded(tab_handle_, |
| 740 load->url())); | 740 load->url())); |
| 741 } | 741 } |
| 742 break; | 742 break; |
| 743 } | 743 } |
| 744 case NotificationType::NAV_ENTRY_COMMITTED: { | 744 case NotificationType::NAV_ENTRY_COMMITTED: { |
| 745 if (ignore_next_load_notification_) { | 745 if (ignore_next_load_notification_) { |
| 746 ignore_next_load_notification_ = false; | 746 ignore_next_load_notification_ = false; |
| 747 return; | 747 return; |
| 748 } | 748 } |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 } | 983 } |
| 984 return true; | 984 return true; |
| 985 } | 985 } |
| 986 | 986 |
| 987 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { | 987 void ExternalTabContainer::Navigate(const GURL& url, const GURL& referrer) { |
| 988 if (!tab_contents_.get()) { | 988 if (!tab_contents_.get()) { |
| 989 NOTREACHED(); | 989 NOTREACHED(); |
| 990 return; | 990 return; |
| 991 } | 991 } |
| 992 | 992 |
| 993 TRACE_EVENT_BEGIN("ExternalTabContainer::Navigate", 0, url.spec()); | 993 TRACE_EVENT_BEGIN_LEGACY("ExternalTabContainer::Navigate", 0, |
| 994 url.spec().c_str()); |
| 994 | 995 |
| 995 tab_contents_->controller().LoadURL(url, referrer, | 996 tab_contents_->controller().LoadURL(url, referrer, |
| 996 PageTransition::START_PAGE); | 997 PageTransition::START_PAGE); |
| 997 } | 998 } |
| 998 | 999 |
| 999 bool ExternalTabContainer::OnGoToEntryOffset(int offset) { | 1000 bool ExternalTabContainer::OnGoToEntryOffset(int offset) { |
| 1000 if (load_requests_via_automation_) { | 1001 if (load_requests_via_automation_) { |
| 1001 automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( | 1002 automation_->Send(new AutomationMsg_RequestGoToHistoryEntryOffset( |
| 1002 tab_handle_, offset)); | 1003 tab_handle_, offset)); |
| 1003 return false; | 1004 return false; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 | 1123 |
| 1123 if (disposition == CURRENT_TAB) { | 1124 if (disposition == CURRENT_TAB) { |
| 1124 DCHECK(route_all_top_level_navigations_); | 1125 DCHECK(route_all_top_level_navigations_); |
| 1125 disposition = NEW_FOREGROUND_TAB; | 1126 disposition = NEW_FOREGROUND_TAB; |
| 1126 } | 1127 } |
| 1127 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, | 1128 ExternalTabContainer::OpenURLFromTab(source, url, referrer, disposition, |
| 1128 transition); | 1129 transition); |
| 1129 // support only one navigation for a dummy tab before it is killed. | 1130 // support only one navigation for a dummy tab before it is killed. |
| 1130 ::DestroyWindow(GetNativeView()); | 1131 ::DestroyWindow(GetNativeView()); |
| 1131 } | 1132 } |
| OLD | NEW |