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 "chrome/browser/history/history_service.h" | 9 #include "chrome/browser/history/history_service.h" |
10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void HistoryTabHelper::UpdateHistoryForNavigation( | 46 void HistoryTabHelper::UpdateHistoryForNavigation( |
47 const history::HistoryAddPageArgs& add_page_args) { | 47 const history::HistoryAddPageArgs& add_page_args) { |
48 HistoryService* hs = GetHistoryService(); | 48 HistoryService* hs = GetHistoryService(); |
49 if (hs) | 49 if (hs) |
50 GetHistoryService()->AddPage(add_page_args); | 50 GetHistoryService()->AddPage(add_page_args); |
51 } | 51 } |
52 | 52 |
53 void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { | 53 void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { |
54 HistoryService* hs = GetHistoryService(); | 54 HistoryService* hs = GetHistoryService(); |
55 if (hs) | 55 if (hs) |
56 hs->SetPageTitle(entry.GetVirtualURL(), entry.GetTitleForDisplay("")); | 56 hs->SetPageTitle(entry.GetVirtualURL(), |
| 57 entry.GetTitleForDisplay(std::string())); |
57 } | 58 } |
58 | 59 |
59 history::HistoryAddPageArgs | 60 history::HistoryAddPageArgs |
60 HistoryTabHelper::CreateHistoryAddPageArgs( | 61 HistoryTabHelper::CreateHistoryAddPageArgs( |
61 const GURL& virtual_url, | 62 const GURL& virtual_url, |
62 base::Time timestamp, | 63 base::Time timestamp, |
63 bool did_replace_entry, | 64 bool did_replace_entry, |
64 const content::FrameNavigateParams& params) { | 65 const content::FrameNavigateParams& params) { |
65 history::HistoryAddPageArgs add_page_args( | 66 history::HistoryAddPageArgs add_page_args( |
66 params.url, timestamp, web_contents(), params.page_id, | 67 params.url, timestamp, web_contents(), params.page_id, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 HistoryService* hs = | 206 HistoryService* hs = |
206 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); | 207 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); |
207 if (hs) { | 208 if (hs) { |
208 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); | 209 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); |
209 if (entry) { | 210 if (entry) { |
210 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), | 211 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), |
211 base::Time::Now()); | 212 base::Time::Now()); |
212 } | 213 } |
213 } | 214 } |
214 } | 215 } |
OLD | NEW |