| 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 // Inform RendererMediaPlayerManager to release all video player resources. | 1313 // Inform RendererMediaPlayerManager to release all video player resources. |
| 1314 // If something is in progress the resource will not be freed, it will | 1314 // If something is in progress the resource will not be freed, it will |
| 1315 // only be freed once the tab is destroyed or if the user navigates away | 1315 // only be freed once the tab is destroyed or if the user navigates away |
| 1316 // via WebMediaPlayerAndroid::Destroy. | 1316 // via WebMediaPlayerAndroid::Destroy. |
| 1317 media_player_manager_->ReleaseVideoResources(); | 1317 media_player_manager_->ReleaseVideoResources(); |
| 1318 } | 1318 } |
| 1319 #endif | 1319 #endif |
| 1320 | 1320 |
| 1321 /////////////////////////////////////////////////////////////////////////////// | 1321 /////////////////////////////////////////////////////////////////////////////// |
| 1322 | 1322 |
| 1323 // Sends the last committed session history state to the browser so it will be | 1323 // Sends the current history state to the browser so it will be saved before we |
| 1324 // saved before we navigate to a new page. This must be called *before* the | 1324 // navigate to a new page. |
| 1325 // page ID has been updated so we know what it was. | |
| 1326 void RenderViewImpl::UpdateSessionHistory(WebFrame* frame) { | 1325 void RenderViewImpl::UpdateSessionHistory(WebFrame* frame) { |
| 1327 // If we have a valid page ID at this point, then it corresponds to the page | 1326 // If we have a valid page ID at this point, then it corresponds to the page |
| 1328 // we are navigating away from. Otherwise, this is the first navigation, so | 1327 // we are navigating away from. Otherwise, this is the first navigation, so |
| 1329 // there is no past session history to record. | 1328 // there is no past session history to record. |
| 1330 if (page_id_ == -1) | 1329 if (page_id_ == -1) |
| 1331 return; | 1330 return; |
| 1332 SendUpdateState(history_controller_->GetPreviousEntry()); | 1331 SendUpdateState(history_controller_->GetCurrentEntry()); |
| 1333 } | 1332 } |
| 1334 | 1333 |
| 1335 void RenderViewImpl::SendUpdateState(HistoryEntry* entry) { | 1334 void RenderViewImpl::SendUpdateState(HistoryEntry* entry) { |
| 1336 if (!entry) | 1335 if (!entry) |
| 1337 return; | 1336 return; |
| 1338 | 1337 |
| 1339 // Don't send state updates for kSwappedOutURL. | 1338 // Don't send state updates for kSwappedOutURL. |
| 1340 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) | 1339 if (entry->root().urlString() == WebString::fromUTF8(kSwappedOutURL)) |
| 1341 return; | 1340 return; |
| 1342 | 1341 |
| (...skipping 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4093 std::vector<gfx::Size> sizes; | 4092 std::vector<gfx::Size> sizes; |
| 4094 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4093 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4095 if (!url.isEmpty()) | 4094 if (!url.isEmpty()) |
| 4096 urls.push_back( | 4095 urls.push_back( |
| 4097 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4096 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4098 } | 4097 } |
| 4099 SendUpdateFaviconURL(urls); | 4098 SendUpdateFaviconURL(urls); |
| 4100 } | 4099 } |
| 4101 | 4100 |
| 4102 } // namespace content | 4101 } // namespace content |
| OLD | NEW |