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

Unified Diff: chrome/browser/chromeos/drop_shadow_label.cc

Issue 8890049: [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura Created 9 years 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
Index: chrome/browser/chromeos/drop_shadow_label.cc
diff --git a/chrome/browser/chromeos/drop_shadow_label.cc b/chrome/browser/chromeos/drop_shadow_label.cc
deleted file mode 100644
index 54243ec0206d8d2bab9e9934612db920905f9ebc..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/drop_shadow_label.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2011 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 "chrome/browser/chromeos/drop_shadow_label.h"
-
-#include "base/utf_string_conversions.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/color_utils.h"
-
-using views::Label;
-
-namespace chromeos {
-
-static const int kDefaultDropShadowSize = 2;
-
-DropShadowLabel::DropShadowLabel() : drop_shadow_size_(kDefaultDropShadowSize) {
-}
-
-void DropShadowLabel::SetDropShadowSize(int drop_shadow_size) {
- if (drop_shadow_size != drop_shadow_size_) {
- drop_shadow_size_ = drop_shadow_size;
- invalidate_text_size();
- SchedulePaint();
- }
-}
-
-void DropShadowLabel::PaintText(gfx::Canvas* canvas,
- const string16& text,
- const gfx::Rect& text_bounds,
- int flags) {
- SkColor text_color = enabled() ? enabled_color() : disabled_color();
- if (drop_shadow_size_ > 0) {
- const float kShadowOpacity = 0.2;
- const SkColor shadow_color =
- SkColorSetA(SK_ColorBLACK, kShadowOpacity * SkColorGetA(text_color));
- for (int i = 0; i < drop_shadow_size_; i++) {
- canvas->DrawStringInt(text, font(), shadow_color,
- text_bounds.x() + i, text_bounds.y(),
- text_bounds.width(), text_bounds.height(), flags);
- canvas->DrawStringInt(text, font(), shadow_color,
- text_bounds.x() + i, text_bounds.y() + i,
- text_bounds.width(), text_bounds.height(), flags);
- canvas->DrawStringInt(text, font(), shadow_color,
- text_bounds.x(), text_bounds.y() + i,
- text_bounds.width(), text_bounds.height(), flags);
- }
- }
-
- canvas->DrawStringInt(text, font(), text_color, text_bounds.x(),
- text_bounds.y(), text_bounds.width(), text_bounds.height(), flags);
-
- if (HasFocus() || paint_as_focused()) {
- gfx::Rect focus_bounds = text_bounds;
- focus_bounds.Inset(-Label::kFocusBorderPadding,
- -Label::kFocusBorderPadding);
- canvas->DrawFocusRect(focus_bounds);
- }
-}
-
-gfx::Size DropShadowLabel::GetTextSize() const {
- gfx::Size text_size = Label::GetTextSize();
- text_size.SetSize(text_size.width() + drop_shadow_size_,
- text_size.height() + drop_shadow_size_);
- return text_size;
-}
-
-} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/drop_shadow_label.h ('k') | chrome/browser/ui/views/aura/app_list/app_list_model_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698