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

Unified Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 2634333003: Convert SearchTabHelper to use the new navigation callbacks. (Closed)
Patch Set: closer to original Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index e9c6395d792d358fcd93017efa883c43e6c109a0..edb8c5750b9be27be34dc0dc7345e3cb101dfbc9 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -38,6 +38,7 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/render_frame_host.h"
@@ -215,10 +216,12 @@ void SearchTabHelper::OnTabDeactivated() {
ipc_router_.OnTabDeactivated();
}
-void SearchTabHelper::DidStartNavigationToPendingEntry(
- const GURL& url,
- content::ReloadType /* reload_type */) {
- if (search::IsNTPURL(url, profile())) {
+void SearchTabHelper::DidStartNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSamePage())
+ return;
+
+ if (search::IsNTPURL(navigation_handle->GetURL(), profile())) {
// Set the title on any pending entry corresponding to the NTP. This
// prevents any flickering of the tab title.
content::NavigationEntry* entry =
@@ -230,9 +233,11 @@ void SearchTabHelper::DidStartNavigationToPendingEntry(
}
}
-void SearchTabHelper::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void SearchTabHelper::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSamePage())
+ return;
+
if (IsCacheableNTP(web_contents_)) {
UMA_HISTOGRAM_ENUMERATION("InstantExtended.CacheableNTPLoad",
search::CACHEABLE_NTP_LOAD_SUCCEEDED,
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.h ('k') | chrome/browser/ui/search/search_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698