| 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 "chrome/browser/prerender/prerender_manager.h" | 5 #include "chrome/browser/prerender/prerender_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 DCHECK(new_web_contents); | 626 DCHECK(new_web_contents); |
| 627 DCHECK(old_web_contents); | 627 DCHECK(old_web_contents); |
| 628 | 628 |
| 629 MarkWebContentsAsPrerendered(new_web_contents, prerender_contents->origin()); | 629 MarkWebContentsAsPrerendered(new_web_contents, prerender_contents->origin()); |
| 630 | 630 |
| 631 // Merge the browsing history. | 631 // Merge the browsing history. |
| 632 new_web_contents->GetController().CopyStateFromAndPrune( | 632 new_web_contents->GetController().CopyStateFromAndPrune( |
| 633 &old_web_contents->GetController(), | 633 &old_web_contents->GetController(), |
| 634 should_replace_current_entry); | 634 should_replace_current_entry); |
| 635 CoreTabHelper::FromWebContents(old_web_contents)->delegate()-> | 635 CoreTabHelper::FromWebContents(old_web_contents)->delegate()-> |
| 636 SwapTabContents(old_web_contents, new_web_contents); | 636 SwapTabContents(old_web_contents, |
| 637 new_web_contents, |
| 638 true, |
| 639 prerender_contents->has_finished_loading()); |
| 637 prerender_contents->CommitHistory(new_web_contents); | 640 prerender_contents->CommitHistory(new_web_contents); |
| 638 | 641 |
| 639 GURL icon_url = prerender_contents->icon_url(); | 642 GURL icon_url = prerender_contents->icon_url(); |
| 640 | 643 |
| 641 if (!icon_url.is_empty()) { | 644 if (!icon_url.is_empty()) { |
| 642 #if defined(OS_ANDROID) | 645 #if defined(OS_ANDROID) |
| 643 // Do the delayed icon fetch since we didn't download | 646 // Do the delayed icon fetch since we didn't download |
| 644 // the favicon during prerendering on mobile devices. | 647 // the favicon during prerendering on mobile devices. |
| 645 FaviconTabHelper * favicon_tap_helper = | 648 FaviconTabHelper * favicon_tap_helper = |
| 646 FaviconTabHelper::FromWebContents(new_web_contents); | 649 FaviconTabHelper::FromWebContents(new_web_contents); |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 Origin origin, | 1922 Origin origin, |
| 1920 uint8 experiment_id, | 1923 uint8 experiment_id, |
| 1921 CancelableRequestProvider::Handle handle, | 1924 CancelableRequestProvider::Handle handle, |
| 1922 bool success, | 1925 bool success, |
| 1923 const history::URLRow* url_row, | 1926 const history::URLRow* url_row, |
| 1924 history::VisitVector* visists) { | 1927 history::VisitVector* visists) { |
| 1925 histograms_->RecordPrerenderPageVisitedStatus(origin, experiment_id, success); | 1928 histograms_->RecordPrerenderPageVisitedStatus(origin, experiment_id, success); |
| 1926 } | 1929 } |
| 1927 | 1930 |
| 1928 } // namespace prerender | 1931 } // namespace prerender |
| OLD | NEW |