| 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());
|
| + }
|
| + }
|
| +}
|
|
|