| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/history/history.h" | 7 #include "chrome/browser/history/history.h" |
| 8 #include "chrome/browser/history/top_sites.h" | 8 #include "chrome/browser/history/top_sites.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 void HistoryTabHelper::UpdateHistoryForNavigation( | 29 void HistoryTabHelper::UpdateHistoryForNavigation( |
| 30 scoped_refptr<history::HistoryAddPageArgs> add_page_args) { | 30 scoped_refptr<history::HistoryAddPageArgs> add_page_args) { |
| 31 HistoryService* hs = GetHistoryService(); | 31 HistoryService* hs = GetHistoryService(); |
| 32 if (hs) | 32 if (hs) |
| 33 GetHistoryService()->AddPage(*add_page_args); | 33 GetHistoryService()->AddPage(*add_page_args); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { | 36 void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { |
| 37 HistoryService* hs = GetHistoryService(); | 37 HistoryService* hs = GetHistoryService(); |
| 38 if (hs) | 38 if (hs) |
| 39 hs->SetPageTitle(entry.virtual_url(), entry.title()); | 39 hs->SetPageTitle(entry.virtual_url(), entry.GetTitleForDisplay("")); |
| 40 } | 40 } |
| 41 | 41 |
| 42 scoped_refptr<history::HistoryAddPageArgs> | 42 scoped_refptr<history::HistoryAddPageArgs> |
| 43 HistoryTabHelper::CreateHistoryAddPageArgs( | 43 HistoryTabHelper::CreateHistoryAddPageArgs( |
| 44 const GURL& virtual_url, | 44 const GURL& virtual_url, |
| 45 const content::LoadCommittedDetails& details, | 45 const content::LoadCommittedDetails& details, |
| 46 const ViewHostMsg_FrameNavigate_Params& params) { | 46 const ViewHostMsg_FrameNavigate_Params& params) { |
| 47 scoped_refptr<history::HistoryAddPageArgs> add_page_args( | 47 scoped_refptr<history::HistoryAddPageArgs> add_page_args( |
| 48 new history::HistoryAddPageArgs( | 48 new history::HistoryAddPageArgs( |
| 49 params.url, base::Time::Now(), tab_contents(), params.page_id, | 49 params.url, base::Time::Now(), tab_contents(), params.page_id, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 HistoryService* HistoryTabHelper::GetHistoryService() { | 157 HistoryService* HistoryTabHelper::GetHistoryService() { |
| 158 Profile* profile = | 158 Profile* profile = |
| 159 Profile::FromBrowserContext(tab_contents()->browser_context()); | 159 Profile::FromBrowserContext(tab_contents()->browser_context()); |
| 160 if (profile->IsOffTheRecord()) | 160 if (profile->IsOffTheRecord()) |
| 161 return NULL; | 161 return NULL; |
| 162 | 162 |
| 163 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); | 163 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); |
| 164 } | 164 } |
| OLD | NEW |