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

Unified Diff: ash/app_list/drop_shadow_label.cc

Issue 10388032: Move app list from ash to ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix win_aura bot and comments in #5 Created 8 years, 7 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 | « ash/app_list/drop_shadow_label.h ('k') | ash/app_list/icon_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/drop_shadow_label.cc
===================================================================
--- ash/app_list/drop_shadow_label.cc (revision 135932)
+++ ash/app_list/drop_shadow_label.cc (working copy)
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/app_list/drop_shadow_label.h"
-
-#include "base/utf_string_conversions.h"
-#include "third_party/skia/include/effects/SkGradientShader.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/color_utils.h"
-#include "ui/gfx/insets.h"
-#include "ui/gfx/skbitmap_operations.h"
-
-using views::Label;
-
-namespace ash {
-
-DropShadowLabel::DropShadowLabel() {
-}
-
-DropShadowLabel::~DropShadowLabel() {
-}
-
-void DropShadowLabel::SetTextShadows(int shadow_count,
- const gfx::ShadowValue* shadows) {
- text_shadows_.clear();
-
- if (shadow_count && shadows) {
- for (int i = 0; i < shadow_count; ++i)
- text_shadows_.push_back(shadows[i]);
- }
-}
-
-gfx::Insets DropShadowLabel::GetInsets() const {
- gfx::Insets insets = views::Label::GetInsets();
- gfx::Insets shadow_margin = gfx::ShadowValue::GetMargin(text_shadows_);
- // Negate |shadow_margin| to convert it to a padding insets needed inside
- // the bounds and combine with label's insets.
- insets += -shadow_margin;
- return insets;
-}
-
-void DropShadowLabel::PaintText(gfx::Canvas* canvas,
- const string16& text,
- const gfx::Rect& text_bounds,
- int flags) {
- SkColor text_color = enabled() ? enabled_color() : disabled_color();
- canvas->DrawStringWithShadows(text,
- font(),
- text_color,
- text_bounds,
- flags,
- text_shadows_);
-
- if (HasFocus() || paint_as_focused()) {
- gfx::Rect focus_bounds = text_bounds;
- focus_bounds.Inset(-Label::kFocusBorderPadding,
- -Label::kFocusBorderPadding);
- canvas->DrawFocusRect(focus_bounds);
- }
-}
-
-} // namespace ash
« no previous file with comments | « ash/app_list/drop_shadow_label.h ('k') | ash/app_list/icon_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698