Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/history/history_tab_helper.cc

Issue 8469015: Switch BackgroundContents to use TabContents instead of RenderViewHost. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unittest Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool handled = true; 70 bool handled = true;
71 IPC_BEGIN_MESSAGE_MAP(HistoryTabHelper, message) 71 IPC_BEGIN_MESSAGE_MAP(HistoryTabHelper, message)
72 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageContents, OnPageContents) 72 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_PageContents, OnPageContents)
73 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_Thumbnail, OnThumbnail) 73 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_Thumbnail, OnThumbnail)
74 IPC_MESSAGE_UNHANDLED(handled = false) 74 IPC_MESSAGE_UNHANDLED(handled = false)
75 IPC_END_MESSAGE_MAP() 75 IPC_END_MESSAGE_MAP()
76 76
77 return handled; 77 return handled;
78 } 78 }
79 79
80 void HistoryTabHelper::DidNavigateMainFramePostCommit( 80 void HistoryTabHelper::DidNavigateMainFrame(
81 const content::LoadCommittedDetails& details, 81 const content::LoadCommittedDetails& details,
82 const ViewHostMsg_FrameNavigate_Params& params) { 82 const ViewHostMsg_FrameNavigate_Params& params) {
83 // Allow the new page to set the title again. 83 // Allow the new page to set the title again.
84 received_page_title_ = false; 84 received_page_title_ = false;
85 } 85 }
86 86
87 void HistoryTabHelper::DidNavigateAnyFramePostCommit( 87 void HistoryTabHelper::DidNavigateAnyFrame(
88 const content::LoadCommittedDetails& details, 88 const content::LoadCommittedDetails& details,
89 const ViewHostMsg_FrameNavigate_Params& params) { 89 const ViewHostMsg_FrameNavigate_Params& params) {
90 // Update history. Note that this needs to happen after the entry is complete, 90 // Update history. Note that this needs to happen after the entry is complete,
91 // which WillNavigate[Main,Sub]Frame will do before this function is called. 91 // which WillNavigate[Main,Sub]Frame will do before this function is called.
92 if (!params.should_update_history) 92 if (!params.should_update_history)
93 return; 93 return;
94 94
95 // Most of the time, the displayURL matches the loaded URL, but for about: 95 // Most of the time, the displayURL matches the loaded URL, but for about:
96 // URLs, we use a data: URL as the real value. We actually want to save the 96 // URLs, we use a data: URL as the real value. We actually want to save the
97 // about: URL to the history db and keep the data: URL hidden. This is what 97 // about: URL to the history db and keep the data: URL hidden. This is what
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 161
162 HistoryService* HistoryTabHelper::GetHistoryService() { 162 HistoryService* HistoryTabHelper::GetHistoryService() {
163 Profile* profile = 163 Profile* profile =
164 Profile::FromBrowserContext(tab_contents()->browser_context()); 164 Profile::FromBrowserContext(tab_contents()->browser_context());
165 if (profile->IsOffTheRecord()) 165 if (profile->IsOffTheRecord())
166 return NULL; 166 return NULL;
167 167
168 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS); 168 return profile->GetHistoryService(Profile::IMPLICIT_ACCESS);
169 } 169 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_tab_helper.h ('k') | chrome/browser/password_manager/password_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698