Chromium Code Reviews| 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..4562d43990171bfb81c3af532db2845352f94eff 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. |
|
GeorgeY
2012/03/27 21:15:57
May be
// We need to use tab value directly as a h
Wei Li
2012/03/27 23:01:50
It is not used as a hash, but a pointer as it pass
|
| + 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->UpdateDBWithPageInfo(tab, entry->GetPageID(), tab->GetURL(), |
| + base::Time::Now()); |
| + } |
| + } |
| +} |