Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1925)

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 10963018: Rework arguments of HistoryService::AddPage() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/top_sites_unittest.cc ('k') | chrome/browser/instant/instant_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_controller.cc
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 55859df6b14542cf2d6d77dee1ada9134df15680..2f2f50b3921c31cfb78a0aa8e9df5c795beda794 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/i18n/case_conversion.h"
#include "base/metrics/histogram.h"
+#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_provider.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
@@ -346,12 +347,12 @@ TabContents* InstantController::ReleasePreviewContents(InstantCommitType type) {
// If the preview page has navigated since the last Update(), we need to add
// the navigation to history ourselves. Else, the page will navigate after
// commit, and it will be added to history in the usual manner.
- scoped_refptr<history::HistoryAddPageArgs> last_navigation =
+ const history::HistoryAddPageArgs& last_navigation =
loader_->last_navigation();
- if (last_navigation != NULL) {
+ if (!last_navigation.url.is_empty()) {
content::NavigationEntry* entry =
preview->web_contents()->GetController().GetActiveEntry();
- DCHECK_EQ(last_navigation->url, entry->GetURL());
+ DCHECK_EQ(last_navigation.url, entry->GetURL());
// Add the page to history.
preview->history_tab_helper()->UpdateHistoryForNavigation(last_navigation);
@@ -374,8 +375,9 @@ TabContents* InstantController::ReleasePreviewContents(InstantCommitType type) {
HistoryService* history = HistoryServiceFactory::GetForProfile(
preview->profile(), Profile::EXPLICIT_ACCESS);
if (history) {
- history->AddPage(url_for_history_, NULL, 0, GURL(), last_transition_type_,
- history::RedirectList(), history::SOURCE_BROWSED, false);
+ history->AddPage(url_for_history_, base::Time::Now(), NULL, 0, GURL(),
+ history::RedirectList(), last_transition_type_,
+ history::SOURCE_BROWSED, false);
}
AddPreviewUsageForHistogram(mode_, PREVIEW_COMMITTED);
« no previous file with comments | « chrome/browser/history/top_sites_unittest.cc ('k') | chrome/browser/instant/instant_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698