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 11434074: browser: Move FindBrowserWithWebContents() into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 InstantLoader* instant_loader = 130 InstantLoader* instant_loader =
131 InstantLoader::FromWebContents(web_contents()); 131 InstantLoader::FromWebContents(web_contents());
132 if (instant_loader) { 132 if (instant_loader) {
133 instant_loader->DidNavigate(add_page_args); 133 instant_loader->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 = browser::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
144 UpdateHistoryForNavigation(add_page_args); 144 UpdateHistoryForNavigation(add_page_args);
145 } 145 }
146 146
147 void HistoryTabHelper::Observe(int type, 147 void HistoryTabHelper::Observe(int type,
148 const content::NotificationSource& source, 148 const content::NotificationSource& source,
149 const content::NotificationDetails& details) { 149 const content::NotificationDetails& details) {
(...skipping 52 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
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/managed_mode/managed_mode_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698