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

Side by Side Diff: chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc

Issue 356383002: Remove flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add author to AUTHORS Created 6 years, 5 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 | « AUTHORS ('k') | chrome/common/chrome_switches.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 (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/ui/webui/ntp/suggestions_source_top_sites.h" 5 #include "chrome/browser/ui/webui/ntp/suggestions_source_top_sites.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 } 118 }
119 items_.push_back(page_value); 119 items_.push_back(page_value);
120 } 120 }
121 121
122 combiner_->OnItemsReady(); 122 combiner_->OnItemsReady();
123 } 123 }
124 124
125 // static 125 // static
126 base::TimeDelta SuggestionsSourceTopSites::GetFilterWidth() { 126 base::TimeDelta SuggestionsSourceTopSites::GetFilterWidth() {
127 const CommandLine* cli = CommandLine::ForCurrentProcess();
128 const std::string filter_width_switch =
129 cli->GetSwitchValueASCII(switches::kSuggestionNtpFilterWidth);
130 unsigned int filter_width;
131 if (base::StringToUint(filter_width_switch, &filter_width))
132 return base::TimeDelta::FromMinutes(filter_width);
133 return base::TimeDelta::FromHours(1); 127 return base::TimeDelta::FromHours(1);
134 } 128 }
135 129
136 // static 130 // static
137 history::VisitFilter::SortingOrder 131 history::VisitFilter::SortingOrder
138 SuggestionsSourceTopSites::GetSortingOrder() { 132 SuggestionsSourceTopSites::GetSortingOrder() {
139 const CommandLine* cli = CommandLine::ForCurrentProcess();
140 if (cli->HasSwitch(switches::kSuggestionNtpGaussianFilter))
141 return history::VisitFilter::ORDER_BY_TIME_GAUSSIAN;
142 if (cli->HasSwitch(switches::kSuggestionNtpLinearFilter))
143 return history::VisitFilter::ORDER_BY_TIME_LINEAR;
144 return history::VisitFilter::ORDER_BY_RECENCY; 133 return history::VisitFilter::ORDER_BY_RECENCY;
145 } 134 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698