| 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" |
| 11 #include "content/browser/tab_contents/navigation_details.h" | 11 #include "content/browser/tab_contents/navigation_details.h" |
| 12 #include "content/browser/tab_contents/navigation_entry.h" | 12 #include "content/browser/tab_contents/navigation_entry.h" |
| 13 #include "content/browser/tab_contents/tab_contents.h" | 13 #include "content/browser/tab_contents/tab_contents.h" |
| 14 #include "content/browser/tab_contents/tab_contents_delegate.h" | 14 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 15 #include "content/browser/tab_contents/title_updated_details.h" | 15 #include "content/browser/tab_contents/title_updated_details.h" |
| 16 #include "content/common/notification_service.h" | |
| 17 #include "content/common/view_messages.h" | 16 #include "content/common/view_messages.h" |
| 17 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/browser/notification_types.h" | 19 #include "content/public/browser/notification_types.h" |
| 19 | 20 |
| 20 HistoryTabHelper::HistoryTabHelper(TabContents* tab_contents) | 21 HistoryTabHelper::HistoryTabHelper(TabContents* tab_contents) |
| 21 : TabContentsObserver(tab_contents), | 22 : TabContentsObserver(tab_contents), |
| 22 received_page_title_(false) { | 23 received_page_title_(false) { |
| 23 registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_TITLE_UPDATED, | 24 registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_TITLE_UPDATED, |
| 24 content::Source<TabContents>(tab_contents)); | 25 content::Source<TabContents>(tab_contents)); |
| 25 } | 26 } |
| 26 | 27 |
| 27 HistoryTabHelper::~HistoryTabHelper() { | 28 HistoryTabHelper::~HistoryTabHelper() { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 160 } |
| 160 | 161 |
| 161 HistoryService* HistoryTabHelper::GetHistoryService() { | 162 HistoryService* HistoryTabHelper::GetHistoryService() { |
| 162 Profile* profile = | 163 Profile* profile = |
| 163 Profile::FromBrowserContext(tab_contents()->browser_context()); | 164 Profile::FromBrowserContext(tab_contents()->browser_context()); |
| 164 if (profile->IsOffTheRecord()) | 165 if (profile->IsOffTheRecord()) |
| 165 return NULL; | 166 return NULL; |
| 166 | 167 |
| 167 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); | 168 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); |
| 168 } | 169 } |
| OLD | NEW |