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

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

Issue 10605003: Fixing some more instances where I put in HistoryServiceFactory::GetForProfile which will force cre… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
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.h" 9 #include "chrome/browser/history/history.h"
10 #include "chrome/browser/history/history_service_factory.h" 10 #include "chrome/browser/history/history_service_factory.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 176
177 void HistoryTabHelper::WebContentsDestroyed(WebContents* tab) { 177 void HistoryTabHelper::WebContentsDestroyed(WebContents* tab) {
178 // We update the history for this URL. 178 // We update the history for this URL.
179 // The content returned from web_contents() has been destroyed by now. 179 // The content returned from web_contents() has been destroyed by now.
180 // We need to use tab value directly. 180 // We need to use tab value directly.
181 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); 181 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
182 if (profile->IsOffTheRecord()) 182 if (profile->IsOffTheRecord())
183 return; 183 return;
184 184
185 HistoryService* hs = 185 HistoryService* hs = HistoryServiceFactory::GetForProfileIfExists(
186 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); 186 profile, Profile::IMPLICIT_ACCESS);
187 if (hs) { 187 if (hs) {
188 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); 188 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
189 if (entry) { 189 if (entry) {
190 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), 190 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(),
191 base::Time::Now()); 191 base::Time::Now());
192 } 192 }
193 } 193 }
194 } 194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698