| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 add_page_args->url = virtual_url; | 60 add_page_args->url = virtual_url; |
| 61 if (!add_page_args->redirects.empty()) | 61 if (!add_page_args->redirects.empty()) |
| 62 add_page_args->redirects.back() = virtual_url; | 62 add_page_args->redirects.back() = virtual_url; |
| 63 } | 63 } |
| 64 return add_page_args; | 64 return add_page_args; |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool HistoryTabHelper::OnMessageReceived(const IPC::Message& message) { | 67 bool HistoryTabHelper::OnMessageReceived(const IPC::Message& message) { |
| 68 bool handled = true; | 68 bool handled = true; |
| 69 IPC_BEGIN_MESSAGE_MAP(HistoryTabHelper, message) | 69 IPC_BEGIN_MESSAGE_MAP(HistoryTabHelper, message) |
| 70 IPC_MESSAGE_HANDLER(ViewHostMsg_PageContents, OnPageContents) | 70 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageContents, OnPageContents) |
| 71 IPC_MESSAGE_HANDLER(ViewHostMsg_Thumbnail, OnThumbnail) | 71 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_Thumbnail, OnThumbnail) |
| 72 IPC_MESSAGE_UNHANDLED(handled = false) | 72 IPC_MESSAGE_UNHANDLED(handled = false) |
| 73 IPC_END_MESSAGE_MAP() | 73 IPC_END_MESSAGE_MAP() |
| 74 | 74 |
| 75 return handled; | 75 return handled; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void HistoryTabHelper::DidNavigateMainFramePostCommit( | 78 void HistoryTabHelper::DidNavigateMainFramePostCommit( |
| 79 const content::LoadCommittedDetails& details, | 79 const content::LoadCommittedDetails& details, |
| 80 const ViewHostMsg_FrameNavigate_Params& params) { | 80 const ViewHostMsg_FrameNavigate_Params& params) { |
| 81 // Allow the new page to set the title again. | 81 // Allow the new page to set the title again. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 HistoryService* HistoryTabHelper::GetHistoryService() { | 159 HistoryService* HistoryTabHelper::GetHistoryService() { |
| 160 Profile* profile = | 160 Profile* profile = |
| 161 Profile::FromBrowserContext(tab_contents()->browser_context()); | 161 Profile::FromBrowserContext(tab_contents()->browser_context()); |
| 162 if (profile->IsOffTheRecord()) | 162 if (profile->IsOffTheRecord()) |
| 163 return NULL; | 163 return NULL; |
| 164 | 164 |
| 165 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); | 165 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); |
| 166 } | 166 } |
| OLD | NEW |