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

Unified Diff: ui/app_list/views/start_page_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/search_box_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/start_page_view.cc
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc
index d9d41d288423b2b8833f6becbd4479a1297eebe5..95640b97ec5fbf0dc6562aa1c7adb1c2a0efd16f 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -36,55 +36,26 @@ const int kWebViewHeight = 105;
// DummySearchBoxView constants.
const int kDummySearchBoxWidth = 490;
-const int kDummySearchBoxHeight = 40;
-const int kDummySearchBoxBorderWidth = 1;
-const int kDummySearchBoxBorderBottomWidth = 2;
-const int kDummySearchBoxBorderCornerRadius = 2;
// Tile container constants.
const size_t kNumStartPageTiles = 5;
const int kTileSpacing = 10;
-// A background that paints a solid white rounded rect with a thin grey border.
-class DummySearchBoxBackground : public views::Background {
- public:
- DummySearchBoxBackground() {}
- virtual ~DummySearchBoxBackground() {}
-
- private:
- // views::Background overrides:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
- gfx::Rect bounds = view->GetContentsBounds();
-
- SkPaint paint;
- paint.setFlags(SkPaint::kAntiAlias_Flag);
- paint.setColor(kStartPageBorderColor);
- canvas->DrawRoundRect(bounds, kDummySearchBoxBorderCornerRadius, paint);
- bounds.Inset(kDummySearchBoxBorderWidth,
- kDummySearchBoxBorderWidth,
- kDummySearchBoxBorderWidth,
- kDummySearchBoxBorderBottomWidth);
- paint.setColor(SK_ColorWHITE);
- canvas->DrawRoundRect(bounds, kDummySearchBoxBorderCornerRadius, paint);
- }
-
- DISALLOW_COPY_AND_ASSIGN(DummySearchBoxBackground);
-};
-
// A placeholder search box which is sized to fit within the start page view.
class DummySearchBoxView : public SearchBoxView {
public:
DummySearchBoxView(SearchBoxViewDelegate* delegate,
AppListViewDelegate* view_delegate)
: SearchBoxView(delegate, view_delegate) {
- set_background(new DummySearchBoxBackground());
}
virtual ~DummySearchBoxView() {}
// Overridden from views::View:
virtual gfx::Size GetPreferredSize() const OVERRIDE {
- return gfx::Size(kDummySearchBoxWidth, kDummySearchBoxHeight);
+ gfx::Size size(SearchBoxView::GetPreferredSize());
+ size.set_width(kDummySearchBoxWidth);
+ return size;
}
private:
« no previous file with comments | « ui/app_list/views/search_box_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698