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

Side by Side Diff: chrome/browser/search/instant_service.cc

Issue 2651763002: Cleanup in components/search and chrome/browser/search (Closed)
Patch Set: for each Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/search/search.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/search/instant_service.h" 5 #include "chrome/browser/search/instant_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 DCHECK_EQ(top_sites_.get(), top_sites); 495 DCHECK_EQ(top_sites_.get(), top_sites);
496 // As forced urls already come from tiles, we can safely ignore those updates. 496 // As forced urls already come from tiles, we can safely ignore those updates.
497 if (change_reason == history::TopSitesObserver::ChangeReason::FORCED_URL) 497 if (change_reason == history::TopSitesObserver::ChangeReason::FORCED_URL)
498 return; 498 return;
499 top_sites_->GetMostVisitedURLs(base::Bind(&InstantService::OnTopSitesReceived, 499 top_sites_->GetMostVisitedURLs(base::Bind(&InstantService::OnTopSitesReceived,
500 weak_ptr_factory_.GetWeakPtr()), 500 weak_ptr_factory_.GetWeakPtr()),
501 false); 501 false);
502 } 502 }
503 503
504 void InstantService::ResetInstantSearchPrerendererIfNecessary() { 504 void InstantService::ResetInstantSearchPrerendererIfNecessary() {
505 if (!search::ShouldPrefetchSearchResults()) 505 if (!search::IsInstantExtendedAPIEnabled())
506 return; 506 return;
507 507
508 GURL url(search::GetSearchResultPrefetchBaseURL(profile_)); 508 GURL url(search::GetSearchResultPrefetchBaseURL(profile_));
509 if (!instant_prerenderer_ || instant_prerenderer_->prerender_url() != url) { 509 if (!instant_prerenderer_ || instant_prerenderer_->prerender_url() != url) {
510 instant_prerenderer_.reset( 510 instant_prerenderer_.reset(
511 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : nullptr); 511 url.is_valid() ? new InstantSearchPrerenderer(profile_, url) : nullptr);
512 } 512 }
513 } 513 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/search/search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698