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

Unified Diff: chrome/browser/ui/webui/ntp/most_visited_handler.cc

Issue 437803003: [Most Visited] Removing Most Visited Tiles experiment code, which is obsolete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 6 years, 4 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
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/most_visited_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/most_visited_handler.cc b/chrome/browser/ui/webui/ntp/most_visited_handler.cc
index 351edb285d41bb5ddee69117253c1a6226147181..bdaf321efcd6476832373850311923e6fb7183c4 100644
--- a/chrome/browser/ui/webui/ntp/most_visited_handler.cc
+++ b/chrome/browser/ui/webui/ntp/most_visited_handler.cc
@@ -21,8 +21,6 @@
#include "base/threading/thread.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/most_visited_tiles_experiment.h"
-#include "chrome/browser/history/page_usage_data.h"
#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/thumbnails/thumbnail_list_source.h"
@@ -144,12 +142,9 @@ void MostVisitedHandler::SendPagesValue() {
profile->GetPrefs()->GetDictionary(prefs::kNtpMostVisitedURLsBlacklist);
bool has_blacklisted_urls = !url_blacklist->empty();
history::TopSites* ts = profile->GetTopSites();
- if (ts) {
+ if (ts)
has_blacklisted_urls = ts->HasBlacklistedItems();
- MaybeRemovePageValues();
- }
-
base::FundamentalValue has_blacklisted_urls_value(has_blacklisted_urls);
web_ui()->CallJavascriptFunction("ntp.setMostVisitedPages",
*pages_value_,
@@ -223,8 +218,6 @@ void MostVisitedHandler::SetPagesValueFromTopSites(
pages_value_.reset(new base::ListValue);
history::MostVisitedURLList top_sites(data);
- history::MostVisitedTilesExperiment::MaybeShuffle(&top_sites);
-
for (size_t i = 0; i < top_sites.size(); i++) {
const history::MostVisitedURL& url = top_sites[i];
base::DictionaryValue* page_value = new base::DictionaryValue();
@@ -269,25 +262,6 @@ std::string MostVisitedHandler::GetDictionaryKeyForUrl(const std::string& url) {
return base::MD5String(url);
}
-void MostVisitedHandler::MaybeRemovePageValues() {
- if (!history::MostVisitedTilesExperiment::IsDontShowOpenURLsEnabled())
- return;
-
- TabStripModel* tab_strip_model = chrome::FindBrowserWithWebContents(
- web_ui()->GetWebContents())->tab_strip_model();
- history::TopSites* top_sites = Profile::FromWebUI(web_ui())->GetTopSites();
- if (!tab_strip_model || !top_sites) {
- NOTREACHED();
- return;
- }
-
- std::set<std::string> open_urls;
- chrome::GetOpenUrls(*tab_strip_model, *top_sites, &open_urls);
- history::MostVisitedTilesExperiment::RemovePageValuesMatchingOpenTabs(
- open_urls,
- pages_value_.get());
-}
-
// static
void MostVisitedHandler::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698