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

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

Issue 492153002: Remove TileItemBackground from experimental app list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove include 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/tile_item_view.h ('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/tile_item_view.cc
diff --git a/ui/app_list/views/tile_item_view.cc b/ui/app_list/views/tile_item_view.cc
index 029df192478145d9ea55550621bee8bd2f548870..c12ed2e4812f623e84e95d458b899c33cd91fbb1 100644
--- a/ui/app_list/views/tile_item_view.cc
+++ b/ui/app_list/views/tile_item_view.cc
@@ -14,7 +14,6 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_analysis.h"
#include "ui/gfx/color_utils.h"
-#include "ui/views/background.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
@@ -24,61 +23,15 @@ namespace {
const int kTileSize = 90;
const int kTileHorizontalPadding = 10;
-const SkColor kTileBackgroundColor = SK_ColorWHITE;
-const int kTileColorStripHeight = 2;
-const SkAlpha kTileColorStripOpacity = 0X5F;
-const int kTileCornerRadius = 2;
-
} // namespace
namespace app_list {
-// A background for the start page item view which consists of a rounded rect
-// with a dominant color strip at the bottom.
-class TileItemView::TileItemBackground : public views::Background {
- public:
- TileItemBackground() : strip_color_(SK_ColorBLACK) {}
- virtual ~TileItemBackground() {}
-
- void set_strip_color(SkColor strip_color) { strip_color_ = strip_color; }
-
- // Overridden from views::Background:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE {
- SkPaint paint;
- paint.setFlags(SkPaint::kAntiAlias_Flag);
-
- // Paint the border.
- paint.setColor(kStartPageBorderColor);
- canvas->DrawRoundRect(view->GetContentsBounds(), kTileCornerRadius, paint);
-
- // Paint a rectangle for the color strip.
- gfx::Rect color_strip_rect(view->GetContentsBounds());
- color_strip_rect.Inset(1, 1, 1, 1);
- paint.setColor(SkColorSetA(strip_color_, kTileColorStripOpacity));
- canvas->DrawRoundRect(color_strip_rect, kTileCornerRadius, paint);
-
- // Paint the main background rectangle, leaving part of the color strip
- // unobscured.
- gfx::Rect static_background_rect(color_strip_rect);
- static_background_rect.Inset(0, 0, 0, kTileColorStripHeight);
- paint.setColor(kTileBackgroundColor);
- canvas->DrawRoundRect(static_background_rect, kTileCornerRadius, paint);
- }
-
- private:
- SkColor strip_color_;
-
- DISALLOW_COPY_AND_ASSIGN(TileItemBackground);
-};
-
TileItemView::TileItemView()
: views::CustomButton(this),
item_(NULL),
icon_(new views::ImageView),
- title_(new views::Label),
- background_(new TileItemBackground()) {
- set_background(background_);
-
+ title_(new views::Label) {
views::BoxLayout* layout_manager = new views::BoxLayout(
views::BoxLayout::kVertical, kTileHorizontalPadding, 0, 0);
layout_manager->set_main_axis_alignment(
@@ -141,9 +94,6 @@ void TileItemView::ButtonPressed(views::Button* sender,
void TileItemView::OnIconChanged() {
icon_->SetImage(item_->icon());
- background_->set_strip_color(
- color_utils::CalculateKMeanColorOfBitmap(*item_->icon().bitmap()));
- SchedulePaint();
}
void TileItemView::OnResultDestroying() {
« no previous file with comments | « ui/app_list/views/tile_item_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698