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/history/history_tab_helper.h" | 5 #include "chrome/browser/history/history_tab_helper.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 void HistoryTabHelper::UpdateHistoryForNavigation( | 41 void HistoryTabHelper::UpdateHistoryForNavigation( |
42 const history::HistoryAddPageArgs& add_page_args) { | 42 const history::HistoryAddPageArgs& add_page_args) { |
43 history::HistoryService* hs = GetHistoryService(); | 43 history::HistoryService* hs = GetHistoryService(); |
44 if (hs) | 44 if (hs) |
45 GetHistoryService()->AddPage(add_page_args); | 45 GetHistoryService()->AddPage(add_page_args); |
46 } | 46 } |
47 | 47 |
48 void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { | 48 void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { |
49 history::HistoryService* hs = GetHistoryService(); | 49 history::HistoryService* hs = GetHistoryService(); |
50 if (hs) | 50 if (hs) |
51 hs->SetPageTitle(entry.GetVirtualURL(), | 51 hs->SetPageTitle(entry.GetVirtualURL(), entry.GetTitleForDisplay()); |
52 entry.GetTitleForDisplay(std::string())); | |
53 } | 52 } |
54 | 53 |
55 history::HistoryAddPageArgs | 54 history::HistoryAddPageArgs |
56 HistoryTabHelper::CreateHistoryAddPageArgs( | 55 HistoryTabHelper::CreateHistoryAddPageArgs( |
57 const GURL& virtual_url, | 56 const GURL& virtual_url, |
58 base::Time timestamp, | 57 base::Time timestamp, |
59 bool did_replace_entry, | 58 bool did_replace_entry, |
60 int nav_entry_id, | 59 int nav_entry_id, |
61 const content::FrameNavigateParams& params) { | 60 const content::FrameNavigateParams& params) { |
62 history::HistoryAddPageArgs add_page_args( | 61 history::HistoryAddPageArgs add_page_args( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (hs) { | 158 if (hs) { |
160 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); | 159 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); |
161 history::ContextID context_id = history::ContextIDForWebContents(tab); | 160 history::ContextID context_id = history::ContextIDForWebContents(tab); |
162 if (entry) { | 161 if (entry) { |
163 hs->UpdateWithPageEndTime(context_id, entry->GetUniqueID(), tab->GetURL(), | 162 hs->UpdateWithPageEndTime(context_id, entry->GetUniqueID(), tab->GetURL(), |
164 base::Time::Now()); | 163 base::Time::Now()); |
165 } | 164 } |
166 hs->ClearCachedDataForContextID(context_id); | 165 hs->ClearCachedDataForContextID(context_id); |
167 } | 166 } |
168 } | 167 } |
OLD | NEW |