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

Unified Diff: chrome/browser/history/history_tab_helper.cc

Issue 10014007: Change 9789001: attempt #3 after fixing the problems with linux Created by Wei Li: https://chromium… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/history_tab_helper.h ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_tab_helper.cc
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 83a5356145c986ef548755e346d5231582900b39..180db5435b5af7af9dba572c657a16c341cd1c44 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -171,3 +171,21 @@ HistoryService* HistoryTabHelper::GetHistoryService() {
return profile->GetHistoryService(Profile::IMPLICIT_ACCESS);
}
+
+void HistoryTabHelper::WebContentsDestroyed(WebContents* tab) {
+ // We update the history for this URL.
+ // The content returned from web_contents() has been destroyed by now.
+ // We need to use tab value directly.
+ Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
+ if (profile->IsOffTheRecord())
+ return;
+
+ HistoryService* hs = profile->GetHistoryService(Profile::IMPLICIT_ACCESS);
+ if (hs) {
+ NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
+ if (entry) {
+ hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(),
+ base::Time::Now());
+ }
+ }
+}
« no previous file with comments | « chrome/browser/history/history_tab_helper.h ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698