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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 | 1296 |
1297 // Notify observers about the provisional change in the main frame URL. | 1297 // Notify observers about the provisional change in the main frame URL. |
1298 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 1298 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
1299 OnProvisionalChangeToMainFrameUrl(url)); | 1299 OnProvisionalChangeToMainFrameUrl(url)); |
1300 } | 1300 } |
1301 } | 1301 } |
1302 | 1302 |
1303 void TabContents::OnDidRedirectProvisionalLoad(int32 page_id, | 1303 void TabContents::OnDidRedirectProvisionalLoad(int32 page_id, |
1304 const GURL& source_url, | 1304 const GURL& source_url, |
1305 const GURL& target_url) { | 1305 const GURL& target_url) { |
| 1306 // TODO(creis): Remove this method and have the pre-rendering code listen to |
| 1307 // the ResourceDispatcherHost's RESOURCE_RECEIVED_REDIRECT notification |
| 1308 // instead. See http://crbug.com/78512. |
1306 NavigationEntry* entry; | 1309 NavigationEntry* entry; |
1307 if (page_id == -1) | 1310 if (page_id == -1) |
1308 entry = controller_.pending_entry(); | 1311 entry = controller_.pending_entry(); |
1309 else | 1312 else |
1310 entry = controller_.GetEntryWithPageID(GetSiteInstance(), page_id); | 1313 entry = controller_.GetEntryWithPageID(GetSiteInstance(), page_id); |
1311 if (!entry || entry->url() != source_url) | 1314 if (!entry || entry->url() != source_url) |
1312 return; | 1315 return; |
1313 entry->set_url(target_url); | |
1314 | 1316 |
1315 // Notify observers about the provisional change in the main frame URL. | 1317 // Notify observers about the provisional change in the main frame URL. |
1316 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 1318 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
1317 OnProvisionalChangeToMainFrameUrl(target_url)); | 1319 OnProvisionalChangeToMainFrameUrl(target_url)); |
1318 } | 1320 } |
1319 | 1321 |
1320 void TabContents::OnDidFailProvisionalLoadWithError( | 1322 void TabContents::OnDidFailProvisionalLoadWithError( |
1321 int64 frame_id, | 1323 int64 frame_id, |
1322 bool is_main_frame, | 1324 bool is_main_frame, |
1323 int error_code, | 1325 int error_code, |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 | 2651 |
2650 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2652 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2651 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2653 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
2652 rwh_view->SetSize(view()->GetContainerSize()); | 2654 rwh_view->SetSize(view()->GetContainerSize()); |
2653 } | 2655 } |
2654 | 2656 |
2655 void TabContents::OnOnlineStateChanged(bool online) { | 2657 void TabContents::OnOnlineStateChanged(bool online) { |
2656 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2658 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
2657 render_view_host()->routing_id(), online)); | 2659 render_view_host()->routing_id(), online)); |
2658 } | 2660 } |
OLD | NEW |