| OLD | NEW |
| 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/android/ntp/most_visited_sites.h" | 5 #include "chrome/browser/android/ntp/most_visited_sites.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "chrome/browser/supervised_user/supervised_user_service.h" | |
| 20 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | |
| 21 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | |
| 22 #include "components/history/core/browser/top_sites.h" | 19 #include "components/history/core/browser/top_sites.h" |
| 23 #include "components/ntp_tiles/pref_names.h" | 20 #include "components/ntp_tiles/pref_names.h" |
| 24 #include "components/ntp_tiles/switches.h" | 21 #include "components/ntp_tiles/switches.h" |
| 25 #include "components/pref_registry/pref_registry_syncable.h" | 22 #include "components/pref_registry/pref_registry_syncable.h" |
| 26 #include "components/prefs/pref_service.h" | 23 #include "components/prefs/pref_service.h" |
| 27 #include "components/variations/variations_associated_data.h" | 24 #include "components/variations/variations_associated_data.h" |
| 28 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 29 #include "third_party/skia/include/core/SkBitmap.h" | 26 #include "third_party/skia/include/core/SkBitmap.h" |
| 30 #include "ui/gfx/codec/jpeg_codec.h" | 27 #include "ui/gfx/codec/jpeg_codec.h" |
| 31 #include "url/gurl.h" | 28 #include "url/gurl.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 MostVisitedSites::Suggestion::operator=(Suggestion&&) = default; | 169 MostVisitedSites::Suggestion::operator=(Suggestion&&) = default; |
| 173 | 170 |
| 174 MostVisitedSites::MostVisitedSites( | 171 MostVisitedSites::MostVisitedSites( |
| 175 PrefService* prefs, | 172 PrefService* prefs, |
| 176 const TemplateURLService* template_url_service, | 173 const TemplateURLService* template_url_service, |
| 177 variations::VariationsService* variations_service, | 174 variations::VariationsService* variations_service, |
| 178 net::URLRequestContextGetter* download_context, | 175 net::URLRequestContextGetter* download_context, |
| 179 const base::FilePath& popular_sites_directory, | 176 const base::FilePath& popular_sites_directory, |
| 180 scoped_refptr<history::TopSites> top_sites, | 177 scoped_refptr<history::TopSites> top_sites, |
| 181 SuggestionsService* suggestions, | 178 SuggestionsService* suggestions, |
| 182 bool is_child_profile, | 179 MostVisitedSitesSupervisor* supervisor) |
| 183 Profile* profile) | 180 : prefs_(prefs), |
| 184 : profile_(profile), | |
| 185 prefs_(prefs), | |
| 186 template_url_service_(template_url_service), | 181 template_url_service_(template_url_service), |
| 187 variations_service_(variations_service), | 182 variations_service_(variations_service), |
| 188 download_context_(download_context), | 183 download_context_(download_context), |
| 189 popular_sites_directory_(popular_sites_directory), | 184 popular_sites_directory_(popular_sites_directory), |
| 190 top_sites_(top_sites), | 185 top_sites_(top_sites), |
| 191 suggestions_service_(suggestions), | 186 suggestions_service_(suggestions), |
| 192 is_child_profile_(is_child_profile), | 187 supervisor_(supervisor), |
| 193 observer_(nullptr), | 188 observer_(nullptr), |
| 194 num_sites_(0), | 189 num_sites_(0), |
| 195 received_most_visited_sites_(false), | 190 received_most_visited_sites_(false), |
| 196 received_popular_sites_(false), | 191 received_popular_sites_(false), |
| 197 recorded_uma_(false), | 192 recorded_uma_(false), |
| 198 scoped_observer_(this), | 193 scoped_observer_(this), |
| 199 mv_source_(SUGGESTIONS_SERVICE), | 194 mv_source_(SUGGESTIONS_SERVICE), |
| 200 weak_ptr_factory_(this) { | 195 weak_ptr_factory_(this) { |
| 201 SupervisedUserService* supervised_user_service = | 196 supervisor_->SetObserver(this); |
| 202 SupervisedUserServiceFactory::GetForProfile(profile_); | |
| 203 supervised_user_service->AddObserver(this); | |
| 204 } | 197 } |
| 205 | 198 |
| 206 MostVisitedSites::~MostVisitedSites() { | 199 MostVisitedSites::~MostVisitedSites() { |
| 207 SupervisedUserService* supervised_user_service = | 200 supervisor_->SetObserver(nullptr); |
| 208 SupervisedUserServiceFactory::GetForProfile(profile_); | |
| 209 supervised_user_service->RemoveObserver(this); | |
| 210 } | 201 } |
| 211 | 202 |
| 212 void MostVisitedSites::SetMostVisitedURLsObserver( | 203 void MostVisitedSites::SetMostVisitedURLsObserver( |
| 213 MostVisitedSites::Observer* observer, int num_sites) { | 204 MostVisitedSites::Observer* observer, int num_sites) { |
| 214 DCHECK(observer); | 205 DCHECK(observer); |
| 215 observer_ = observer; | 206 observer_ = observer; |
| 216 num_sites_ = num_sites; | 207 num_sites_ = num_sites; |
| 217 | 208 |
| 218 if (ShouldShowPopularSites() && | 209 if (ShouldShowPopularSites() && |
| 219 NeedPopularSites(prefs_, num_sites_)) { | 210 NeedPopularSites(prefs_, num_sites_)) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 "NewTabPage.MostVisited.%s", | 340 "NewTabPage.MostVisited.%s", |
| 350 GetSourceHistogramName(current_suggestions_[index]).c_str()); | 341 GetSourceHistogramName(current_suggestions_[index]).c_str()); |
| 351 LogHistogramEvent(histogram, index, num_sites_); | 342 LogHistogramEvent(histogram, index, num_sites_); |
| 352 | 343 |
| 353 histogram = base::StringPrintf( | 344 histogram = base::StringPrintf( |
| 354 "NewTabPage.TileTypeClicked.%s", | 345 "NewTabPage.TileTypeClicked.%s", |
| 355 GetSourceHistogramName(current_suggestions_[index]).c_str()); | 346 GetSourceHistogramName(current_suggestions_[index]).c_str()); |
| 356 LogHistogramEvent(histogram, tile_type, NUM_TILE_TYPES); | 347 LogHistogramEvent(histogram, tile_type, NUM_TILE_TYPES); |
| 357 } | 348 } |
| 358 | 349 |
| 359 void MostVisitedSites::OnURLFilterChanged() { | 350 void MostVisitedSites::OnBlockedSitesChanged() { |
| 360 BuildCurrentSuggestions(); | 351 BuildCurrentSuggestions(); |
| 361 } | 352 } |
| 362 | 353 |
| 363 // static | 354 // static |
| 364 void MostVisitedSites::RegisterProfilePrefs( | 355 void MostVisitedSites::RegisterProfilePrefs( |
| 365 user_prefs::PrefRegistrySyncable* registry) { | 356 user_prefs::PrefRegistrySyncable* registry) { |
| 366 registry->RegisterListPref(ntp_tiles::prefs::kNTPSuggestionsURL); | 357 registry->RegisterListPref(ntp_tiles::prefs::kNTPSuggestionsURL); |
| 367 registry->RegisterListPref(ntp_tiles::prefs::kNTPSuggestionsIsPersonal); | 358 registry->RegisterListPref(ntp_tiles::prefs::kNTPSuggestionsIsPersonal); |
| 368 } | 359 } |
| 369 | 360 |
| 370 void MostVisitedSites::BuildCurrentSuggestions() { | 361 void MostVisitedSites::BuildCurrentSuggestions() { |
| 371 // Get the current suggestions from cache. If the cache is empty, this will | 362 // Get the current suggestions from cache. If the cache is empty, this will |
| 372 // fall back to TopSites. | 363 // fall back to TopSites. |
| 373 OnSuggestionsProfileAvailable( | 364 OnSuggestionsProfileAvailable( |
| 374 suggestions_service_->GetSuggestionsDataFromCache()); | 365 suggestions_service_->GetSuggestionsDataFromCache()); |
| 375 } | 366 } |
| 376 | 367 |
| 377 void MostVisitedSites::InitiateTopSitesQuery() { | 368 void MostVisitedSites::InitiateTopSitesQuery() { |
| 378 if (!top_sites_) | 369 if (!top_sites_) |
| 379 return; | 370 return; |
| 380 | 371 |
| 381 top_sites_->GetMostVisitedURLs( | 372 top_sites_->GetMostVisitedURLs( |
| 382 base::Bind(&MostVisitedSites::OnMostVisitedURLsAvailable, | 373 base::Bind(&MostVisitedSites::OnMostVisitedURLsAvailable, |
| 383 weak_ptr_factory_.GetWeakPtr()), | 374 weak_ptr_factory_.GetWeakPtr()), |
| 384 false); | 375 false); |
| 385 } | 376 } |
| 386 | 377 |
| 387 base::FilePath MostVisitedSites::GetWhitelistLargeIconPath(const GURL& url) { | 378 base::FilePath MostVisitedSites::GetWhitelistLargeIconPath(const GURL& url) { |
| 388 SupervisedUserService* supervised_user_service = | 379 for (const auto& whitelist : supervisor_->whitelists()) { |
| 389 SupervisedUserServiceFactory::GetForProfile(profile_); | 380 if (AreURLsEquivalent(whitelist.entry_point, url)) |
| 390 | 381 return whitelist.large_icon_path; |
| 391 for (const auto& whitelist : supervised_user_service->whitelists()) { | |
| 392 if (AreURLsEquivalent(whitelist->entry_point(), url)) | |
| 393 return whitelist->large_icon_path(); | |
| 394 } | 382 } |
| 395 return base::FilePath(); | 383 return base::FilePath(); |
| 396 } | 384 } |
| 397 | 385 |
| 398 void MostVisitedSites::OnMostVisitedURLsAvailable( | 386 void MostVisitedSites::OnMostVisitedURLsAvailable( |
| 399 const history::MostVisitedURLList& visited_list) { | 387 const history::MostVisitedURLList& visited_list) { |
| 400 SupervisedUserURLFilter* url_filter = | |
| 401 SupervisedUserServiceFactory::GetForProfile(profile_) | |
| 402 ->GetURLFilterForUIThread(); | |
| 403 | |
| 404 MostVisitedSites::SuggestionsPtrVector suggestions; | 388 MostVisitedSites::SuggestionsPtrVector suggestions; |
| 405 size_t num_tiles = | 389 size_t num_tiles = |
| 406 std::min(visited_list.size(), static_cast<size_t>(num_sites_)); | 390 std::min(visited_list.size(), static_cast<size_t>(num_sites_)); |
| 407 for (size_t i = 0; i < num_tiles; ++i) { | 391 for (size_t i = 0; i < num_tiles; ++i) { |
| 408 const history::MostVisitedURL& visited = visited_list[i]; | 392 const history::MostVisitedURL& visited = visited_list[i]; |
| 409 if (visited.url.is_empty()) { | 393 if (visited.url.is_empty()) { |
| 410 num_tiles = i; | 394 num_tiles = i; |
| 411 break; // This is the signal that there are no more real visited sites. | 395 break; // This is the signal that there are no more real visited sites. |
| 412 } | 396 } |
| 413 if (url_filter->GetFilteringBehaviorForURL(visited.url) == | 397 if (supervisor_->IsBlocked(visited.url)) |
| 414 SupervisedUserURLFilter::FilteringBehavior::BLOCK) { | |
| 415 continue; | 398 continue; |
| 416 } | |
| 417 | 399 |
| 418 std::unique_ptr<Suggestion> suggestion(new Suggestion()); | 400 std::unique_ptr<Suggestion> suggestion(new Suggestion()); |
| 419 suggestion->title = visited.title; | 401 suggestion->title = visited.title; |
| 420 suggestion->url = visited.url; | 402 suggestion->url = visited.url; |
| 421 suggestion->source = TOP_SITES; | 403 suggestion->source = TOP_SITES; |
| 422 suggestion->whitelist_icon_path = GetWhitelistLargeIconPath(visited.url); | 404 suggestion->whitelist_icon_path = GetWhitelistLargeIconPath(visited.url); |
| 423 | 405 |
| 424 suggestions.push_back(std::move(suggestion)); | 406 suggestions.push_back(std::move(suggestion)); |
| 425 } | 407 } |
| 426 | 408 |
| 427 received_most_visited_sites_ = true; | 409 received_most_visited_sites_ = true; |
| 428 mv_source_ = TOP_SITES; | 410 mv_source_ = TOP_SITES; |
| 429 SaveNewNTPSuggestions(&suggestions); | 411 SaveNewNTPSuggestions(&suggestions); |
| 430 NotifyMostVisitedURLsObserver(); | 412 NotifyMostVisitedURLsObserver(); |
| 431 } | 413 } |
| 432 | 414 |
| 433 void MostVisitedSites::OnSuggestionsProfileAvailable( | 415 void MostVisitedSites::OnSuggestionsProfileAvailable( |
| 434 const SuggestionsProfile& suggestions_profile) { | 416 const SuggestionsProfile& suggestions_profile) { |
| 435 int num_tiles = suggestions_profile.suggestions_size(); | 417 int num_tiles = suggestions_profile.suggestions_size(); |
| 436 // With no server suggestions, fall back to local TopSites. | 418 // With no server suggestions, fall back to local TopSites. |
| 437 if (num_tiles == 0) { | 419 if (num_tiles == 0) { |
| 438 InitiateTopSitesQuery(); | 420 InitiateTopSitesQuery(); |
| 439 return; | 421 return; |
| 440 } | 422 } |
| 441 if (num_sites_ < num_tiles) | 423 if (num_sites_ < num_tiles) |
| 442 num_tiles = num_sites_; | 424 num_tiles = num_sites_; |
| 443 | 425 |
| 444 SupervisedUserURLFilter* url_filter = | |
| 445 SupervisedUserServiceFactory::GetForProfile(profile_) | |
| 446 ->GetURLFilterForUIThread(); | |
| 447 MostVisitedSites::SuggestionsPtrVector suggestions; | 426 MostVisitedSites::SuggestionsPtrVector suggestions; |
| 448 for (int i = 0; i < num_tiles; ++i) { | 427 for (int i = 0; i < num_tiles; ++i) { |
| 449 const ChromeSuggestion& suggestion = suggestions_profile.suggestions(i); | 428 const ChromeSuggestion& suggestion = suggestions_profile.suggestions(i); |
| 450 if (url_filter->GetFilteringBehaviorForURL(GURL(suggestion.url())) == | 429 if (supervisor_->IsBlocked(GURL(suggestion.url()))) |
| 451 SupervisedUserURLFilter::FilteringBehavior::BLOCK) { | |
| 452 continue; | 430 continue; |
| 453 } | |
| 454 | 431 |
| 455 std::unique_ptr<Suggestion> generated_suggestion(new Suggestion()); | 432 std::unique_ptr<Suggestion> generated_suggestion(new Suggestion()); |
| 456 generated_suggestion->title = base::UTF8ToUTF16(suggestion.title()); | 433 generated_suggestion->title = base::UTF8ToUTF16(suggestion.title()); |
| 457 generated_suggestion->url = GURL(suggestion.url()); | 434 generated_suggestion->url = GURL(suggestion.url()); |
| 458 generated_suggestion->source = SUGGESTIONS_SERVICE; | 435 generated_suggestion->source = SUGGESTIONS_SERVICE; |
| 459 generated_suggestion->whitelist_icon_path = GetWhitelistLargeIconPath( | 436 generated_suggestion->whitelist_icon_path = GetWhitelistLargeIconPath( |
| 460 GURL(suggestion.url())); | 437 GURL(suggestion.url())); |
| 461 if (suggestion.providers_size() > 0) | 438 if (suggestion.providers_size() > 0) |
| 462 generated_suggestion->provider_index = suggestion.providers(0); | 439 generated_suggestion->provider_index = suggestion.providers(0); |
| 463 | 440 |
| 464 suggestions.push_back(std::move(generated_suggestion)); | 441 suggestions.push_back(std::move(generated_suggestion)); |
| 465 } | 442 } |
| 466 | 443 |
| 467 received_most_visited_sites_ = true; | 444 received_most_visited_sites_ = true; |
| 468 mv_source_ = SUGGESTIONS_SERVICE; | 445 mv_source_ = SUGGESTIONS_SERVICE; |
| 469 SaveNewNTPSuggestions(&suggestions); | 446 SaveNewNTPSuggestions(&suggestions); |
| 470 NotifyMostVisitedURLsObserver(); | 447 NotifyMostVisitedURLsObserver(); |
| 471 } | 448 } |
| 472 | 449 |
| 473 MostVisitedSites::SuggestionsPtrVector | 450 MostVisitedSites::SuggestionsPtrVector |
| 474 MostVisitedSites::CreateWhitelistEntryPointSuggestions( | 451 MostVisitedSites::CreateWhitelistEntryPointSuggestions( |
| 475 const MostVisitedSites::SuggestionsPtrVector& personal_suggestions) { | 452 const MostVisitedSites::SuggestionsPtrVector& personal_suggestions) { |
| 476 size_t num_personal_suggestions = personal_suggestions.size(); | 453 size_t num_personal_suggestions = personal_suggestions.size(); |
| 477 DCHECK_LE(num_personal_suggestions, static_cast<size_t>(num_sites_)); | 454 DCHECK_LE(num_personal_suggestions, static_cast<size_t>(num_sites_)); |
| 478 | 455 |
| 479 size_t num_whitelist_suggestions = num_sites_ - num_personal_suggestions; | 456 size_t num_whitelist_suggestions = num_sites_ - num_personal_suggestions; |
| 480 MostVisitedSites::SuggestionsPtrVector whitelist_suggestions; | 457 MostVisitedSites::SuggestionsPtrVector whitelist_suggestions; |
| 481 | 458 |
| 482 SupervisedUserService* supervised_user_service = | |
| 483 SupervisedUserServiceFactory::GetForProfile(profile_); | |
| 484 SupervisedUserURLFilter* url_filter = | |
| 485 supervised_user_service->GetURLFilterForUIThread(); | |
| 486 | |
| 487 std::set<std::string> personal_hosts; | 459 std::set<std::string> personal_hosts; |
| 488 for (const auto& suggestion : personal_suggestions) | 460 for (const auto& suggestion : personal_suggestions) |
| 489 personal_hosts.insert(suggestion->url.host()); | 461 personal_hosts.insert(suggestion->url.host()); |
| 490 | 462 |
| 491 for (const auto& whitelist : supervised_user_service->whitelists()) { | 463 for (const auto& whitelist : supervisor_->whitelists()) { |
| 492 // Skip blacklisted sites. | 464 // Skip blacklisted sites. |
| 493 if (top_sites_ && top_sites_->IsBlacklisted(whitelist->entry_point())) | 465 if (top_sites_ && top_sites_->IsBlacklisted(whitelist.entry_point)) |
| 494 continue; | 466 continue; |
| 495 | 467 |
| 496 // Skip suggestions already present. | 468 // Skip suggestions already present. |
| 497 if (personal_hosts.find(whitelist->entry_point().host()) != | 469 if (personal_hosts.find(whitelist.entry_point.host()) != |
| 498 personal_hosts.end()) | 470 personal_hosts.end()) |
| 499 continue; | 471 continue; |
| 500 | 472 |
| 501 // Skip whitelist entry points that are manually blocked. | 473 // Skip whitelist entry points that are manually blocked. |
| 502 if (url_filter->GetFilteringBehaviorForURL(whitelist->entry_point()) == | 474 if (supervisor_->IsBlocked(whitelist.entry_point)) |
| 503 SupervisedUserURLFilter::FilteringBehavior::BLOCK) { | |
| 504 continue; | 475 continue; |
| 505 } | |
| 506 | 476 |
| 507 std::unique_ptr<Suggestion> suggestion(new Suggestion()); | 477 std::unique_ptr<Suggestion> suggestion(new Suggestion()); |
| 508 suggestion->title = whitelist->title(); | 478 suggestion->title = whitelist.title; |
| 509 suggestion->url = whitelist->entry_point(); | 479 suggestion->url = whitelist.entry_point; |
| 510 suggestion->source = WHITELIST; | 480 suggestion->source = WHITELIST; |
| 511 suggestion->whitelist_icon_path = whitelist->large_icon_path(); | 481 suggestion->whitelist_icon_path = whitelist.large_icon_path; |
| 512 | 482 |
| 513 whitelist_suggestions.push_back(std::move(suggestion)); | 483 whitelist_suggestions.push_back(std::move(suggestion)); |
| 514 if (whitelist_suggestions.size() >= num_whitelist_suggestions) | 484 if (whitelist_suggestions.size() >= num_whitelist_suggestions) |
| 515 break; | 485 break; |
| 516 } | 486 } |
| 517 | 487 |
| 518 return whitelist_suggestions; | 488 return whitelist_suggestions; |
| 519 } | 489 } |
| 520 | 490 |
| 521 MostVisitedSites::SuggestionsPtrVector | 491 MostVisitedSites::SuggestionsPtrVector |
| 522 MostVisitedSites::CreatePopularSitesSuggestions( | 492 MostVisitedSites::CreatePopularSitesSuggestions( |
| 523 const MostVisitedSites::SuggestionsPtrVector& personal_suggestions, | 493 const MostVisitedSites::SuggestionsPtrVector& personal_suggestions, |
| 524 const MostVisitedSites::SuggestionsPtrVector& whitelist_suggestions) { | 494 const MostVisitedSites::SuggestionsPtrVector& whitelist_suggestions) { |
| 525 // For child accounts popular sites suggestions will not be added. | 495 // For child accounts popular sites suggestions will not be added. |
| 526 if (is_child_profile_) | 496 if (supervisor_->IsChildProfile()) |
| 527 return MostVisitedSites::SuggestionsPtrVector(); | 497 return MostVisitedSites::SuggestionsPtrVector(); |
| 528 | 498 |
| 529 size_t num_suggestions = | 499 size_t num_suggestions = |
| 530 personal_suggestions.size() + whitelist_suggestions.size(); | 500 personal_suggestions.size() + whitelist_suggestions.size(); |
| 531 DCHECK_LE(num_suggestions, static_cast<size_t>(num_sites_)); | 501 DCHECK_LE(num_suggestions, static_cast<size_t>(num_sites_)); |
| 532 | 502 |
| 533 // Collect non-blacklisted popular suggestions, skipping those already present | 503 // Collect non-blacklisted popular suggestions, skipping those already present |
| 534 // in the personal suggestions. | 504 // in the personal suggestions. |
| 535 size_t num_popular_sites_suggestions = num_sites_ - num_suggestions; | 505 size_t num_popular_sites_suggestions = num_sites_ - num_suggestions; |
| 536 MostVisitedSites::SuggestionsPtrVector popular_sites_suggestions; | 506 MostVisitedSites::SuggestionsPtrVector popular_sites_suggestions; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 | 748 |
| 779 void MostVisitedSites::TopSitesLoaded(TopSites* top_sites) {} | 749 void MostVisitedSites::TopSitesLoaded(TopSites* top_sites) {} |
| 780 | 750 |
| 781 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, | 751 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, |
| 782 ChangeReason change_reason) { | 752 ChangeReason change_reason) { |
| 783 if (mv_source_ == TOP_SITES) { | 753 if (mv_source_ == TOP_SITES) { |
| 784 // The displayed suggestions are invalidated. | 754 // The displayed suggestions are invalidated. |
| 785 InitiateTopSitesQuery(); | 755 InitiateTopSitesQuery(); |
| 786 } | 756 } |
| 787 } | 757 } |
| OLD | NEW |