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

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

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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 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"
11 #include "chrome/browser/instant/instant_overlay.h"
12 #include "chrome/browser/prerender/prerender_contents.h" 11 #include "chrome/browser/prerender/prerender_contents.h"
13 #include "chrome/browser/prerender/prerender_manager.h" 12 #include "chrome/browser/prerender/prerender_manager.h"
14 #include "chrome/browser/prerender/prerender_manager_factory.h" 13 #include "chrome/browser/prerender/prerender_manager_factory.h"
15 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/common/render_messages.h" 15 #include "chrome/common/render_messages.h"
17 #include "content/public/browser/navigation_details.h" 16 #include "content/public/browser/navigation_details.h"
18 #include "content/public/browser/navigation_entry.h" 17 #include "content/public/browser/navigation_entry.h"
19 #include "content/public/browser/notification_details.h" 18 #include "content/public/browser/notification_details.h"
20 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
21 #include "content/public/browser/notification_types.h" 20 #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())); 119 Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
121 if (prerender_manager) { 120 if (prerender_manager) {
122 prerender::PrerenderContents* prerender_contents = 121 prerender::PrerenderContents* prerender_contents =
123 prerender_manager->GetPrerenderContents(web_contents()); 122 prerender_manager->GetPrerenderContents(web_contents());
124 if (prerender_contents) { 123 if (prerender_contents) {
125 prerender_contents->DidNavigate(add_page_args); 124 prerender_contents->DidNavigate(add_page_args);
126 return; 125 return;
127 } 126 }
128 } 127 }
129 128
130 InstantOverlay* instant_overlay =
131 InstantOverlay::FromWebContents(web_contents());
132 if (instant_overlay) {
133 instant_overlay->DidNavigate(add_page_args);
134 return;
135 }
136
137 #if !defined(OS_ANDROID) 129 #if !defined(OS_ANDROID)
138 // Don't update history if this web contents isn't associatd with a tab. 130 // Don't update history if this web contents isn't associatd with a tab.
139 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); 131 Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
140 if (!browser || browser->is_app()) 132 if (!browser || browser->is_app())
141 return; 133 return;
142 #endif 134 #endif
143 135
144 UpdateHistoryForNavigation(add_page_args); 136 UpdateHistoryForNavigation(add_page_args);
145 } 137 }
146 138
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 HistoryService* hs = 197 HistoryService* hs =
206 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS); 198 HistoryServiceFactory::GetForProfile(profile, Profile::IMPLICIT_ACCESS);
207 if (hs) { 199 if (hs) {
208 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); 200 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
209 if (entry) { 201 if (entry) {
210 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(), 202 hs->UpdateWithPageEndTime(tab, entry->GetPageID(), tab->GetURL(),
211 base::Time::Now()); 203 base::Time::Now());
212 } 204 }
213 } 205 }
214 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698