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

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

Issue 11824050: InstantExtended: Committed NTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 7 years, 11 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
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"
11 #include "chrome/browser/instant/instant_loader.h" 11 #include "chrome/browser/instant/instant_overlay.h"
12 #include "chrome/browser/prerender/prerender_contents.h" 12 #include "chrome/browser/prerender/prerender_contents.h"
13 #include "chrome/browser/prerender/prerender_manager.h" 13 #include "chrome/browser/prerender/prerender_manager.h"
14 #include "chrome/browser/prerender/prerender_manager_factory.h" 14 #include "chrome/browser/prerender/prerender_manager_factory.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/common/render_messages.h" 16 #include "chrome/common/render_messages.h"
17 #include "content/public/browser/navigation_details.h" 17 #include "content/public/browser/navigation_details.h"
18 #include "content/public/browser/navigation_entry.h" 18 #include "content/public/browser/navigation_entry.h"
19 #include "content/public/browser/notification_details.h" 19 #include "content/public/browser/notification_details.h"
20 #include "content/public/browser/notification_source.h" 20 #include "content/public/browser/notification_source.h"
21 #include "content/public/browser/notification_types.h" 21 #include "content/public/browser/notification_types.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); 120 Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
121 if (prerender_manager) { 121 if (prerender_manager) {
122 prerender::PrerenderContents* prerender_contents = 122 prerender::PrerenderContents* prerender_contents =
123 prerender_manager->GetPrerenderContents(web_contents()); 123 prerender_manager->GetPrerenderContents(web_contents());
124 if (prerender_contents) { 124 if (prerender_contents) {
125 prerender_contents->DidNavigate(add_page_args); 125 prerender_contents->DidNavigate(add_page_args);
126 return; 126 return;
127 } 127 }
128 } 128 }
129 129
130 InstantLoader* instant_loader = 130 InstantOverlay* instant_overlay =
131 InstantLoader::FromWebContents(web_contents()); 131 InstantOverlay::FromWebContents(web_contents());
132 if (instant_loader) { 132 if (instant_overlay) {
133 instant_loader->DidNavigate(add_page_args); 133 instant_overlay->DidNavigate(add_page_args);
134 return; 134 return;
135 } 135 }
136 136
137 #if !defined(OS_ANDROID) 137 #if !defined(OS_ANDROID)
138 // Don't update history if this web contents isn't associatd with a tab. 138 // Don't update history if this web contents isn't associatd with a tab.
139 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); 139 Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
140 if (!browser || browser->is_app()) 140 if (!browser || browser->is_app())
141 return; 141 return;
142 #endif 142 #endif
143 143
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 HistoryService* hs = 202 HistoryService* hs =
203 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); 203 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
204 if (hs) { 204 if (hs) {
205 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); 205 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
206 if (entry) { 206 if (entry) {
207 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), 207 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(),
208 base::Time::Now()); 208 base::Time::Now());
209 } 209 }
210 } 210 }
211 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698