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

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

Issue 493293003: Use a background for the main search box in the experimental app list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments 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 | « ui/app_list/views/app_list_background.cc ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_main_view.cc
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index 70c926c5e63c7a16f3097affa0e45d18b8d0948c..37e55b1001ddd1c0bc207d5a0ac79bbd2c378a9d 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -26,6 +26,7 @@
#include "ui/app_list/views/contents_switcher_view.h"
#include "ui/app_list/views/contents_view.h"
#include "ui/app_list/views/search_box_view.h"
+#include "ui/views/border.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
@@ -41,6 +42,10 @@ const int kInnerPadding = 1;
// The maximum allowed time to wait for icon loading in milliseconds.
const int kMaxIconLoadingWaitTimeInMs = 50;
+// The padding around the search box in the experimental app list.
+const int kSearchBoxViewPadding = 24;
+const int kSearchBoxViewPaddingBottom = 12;
+
// A view that holds another view and takes its preferred size. This is used for
// wrapping the search box view so it still gets laid out while hidden. This is
// a separate class so it can notify the main view on search box visibility
@@ -124,7 +129,15 @@ AppListMainView::AppListMainView(AppListViewDelegate* delegate,
kInnerPadding));
search_box_view_ = new SearchBoxView(this, delegate);
- AddChildView(new SearchBoxContainerView(this, search_box_view_));
+ views::View* container = new SearchBoxContainerView(this, search_box_view_);
+ if (switches::IsExperimentalAppListEnabled()) {
+ container->SetBorder(
+ views::Border::CreateEmptyBorder(kSearchBoxViewPadding,
+ kSearchBoxViewPadding,
+ kSearchBoxViewPaddingBottom,
+ kSearchBoxViewPadding));
+ }
+ AddChildView(container);
AddContentsViews();
// Switch the apps grid view to the specified page.
« no previous file with comments | « ui/app_list/views/app_list_background.cc ('k') | ui/app_list/views/search_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698