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

Unified Diff: ui/app_list/views/search_result_list_view.cc

Issue 307333002: Add search results to experimental app list start page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments, fix for breaking a test Created 6 years, 6 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 | « ui/app_list/views/contents_view.cc ('k') | ui/app_list/views/start_page_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/search_result_list_view.cc
diff --git a/ui/app_list/views/search_result_list_view.cc b/ui/app_list/views/search_result_list_view.cc
index 19fb584607fb3c7fcf665fc3e3d3584f7bc7c692..c844ef2359b9149d69bfea23939a377d7e2e81f1 100644
--- a/ui/app_list/views/search_result_list_view.cc
+++ b/ui/app_list/views/search_result_list_view.cc
@@ -10,6 +10,7 @@
#include "base/message_loop/message_loop.h"
#include "base/time/time.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/views/search_result_list_view_delegate.h"
#include "ui/app_list/views/search_result_view.h"
@@ -21,6 +22,7 @@
namespace {
const int kMaxResults = 6;
+const int kExperimentAppListMaxResults = 3;
const int kTimeoutIndicatorHeight = 2;
const int kTimeoutFramerate = 60;
const SkColor kTimeoutIndicatorColor = SkColorSetRGB(30, 144, 255);
@@ -43,7 +45,11 @@ SearchResultListView::SearchResultListView(
results_container_->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
- for (int i = 0; i < kMaxResults; ++i)
+ int max_results = kMaxResults;
+ if (app_list::switches::IsExperimentalAppListEnabled())
+ max_results = kExperimentAppListMaxResults;
+
+ for (int i = 0; i < max_results; ++i)
results_container_->AddChildView(new SearchResultView(this));
AddChildView(results_container_);
« no previous file with comments | « ui/app_list/views/contents_view.cc ('k') | ui/app_list/views/start_page_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698