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

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

Issue 600043004: Add render_frame_host to WebContentsObserver::DidNavigateAnyFrame(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 months 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
« no previous file with comments | « chrome/browser/history/history_tab_helper.h ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 void HistoryTabHelper::DidNavigateMainFrame( 79 void HistoryTabHelper::DidNavigateMainFrame(
80 const content::LoadCommittedDetails& details, 80 const content::LoadCommittedDetails& details,
81 const content::FrameNavigateParams& params) { 81 const content::FrameNavigateParams& params) {
82 // Allow the new page to set the title again. 82 // Allow the new page to set the title again.
83 received_page_title_ = false; 83 received_page_title_ = false;
84 } 84 }
85 85
86 void HistoryTabHelper::DidNavigateAnyFrame( 86 void HistoryTabHelper::DidNavigateAnyFrame(
87 content::RenderFrameHost* render_frame_host,
87 const content::LoadCommittedDetails& details, 88 const content::LoadCommittedDetails& details,
88 const content::FrameNavigateParams& params) { 89 const content::FrameNavigateParams& params) {
89 // 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,
90 // 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.
91 if (!params.should_update_history) 92 if (!params.should_update_history)
92 return; 93 return;
93 94
94 // 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:
95 // 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
96 // 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); 154 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
154 if (hs) { 155 if (hs) {
155 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); 156 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
156 if (entry) { 157 if (entry) {
157 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), 158 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(),
158 base::Time::Now()); 159 base::Time::Now());
159 } 160 }
160 hs->ClearCachedDataForContextID(tab); 161 hs->ClearCachedDataForContextID(tab);
161 } 162 }
162 } 163 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_tab_helper.h ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698