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

Side by Side Diff: ui/views/shadow_border.h

Issue 900163002: Make ShadowBorder use ShadowValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_animations
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/shadow_border.cc » ('j') | ui/views/shadow_border.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_SHADOW_BORDER_H_ 5 #ifndef UI_VIEWS_SHADOW_BORDER_H_
6 #define UI_VIEWS_SHADOW_BORDER_H_ 6 #define UI_VIEWS_SHADOW_BORDER_H_
7 7
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/gfx/shadow_value.h"
9 #include "ui/views/border.h" 10 #include "ui/views/border.h"
10 #include "ui/views/views_export.h" 11 #include "ui/views/views_export.h"
11 12
12 namespace views { 13 namespace views {
13 14
14 // Creates a css box-shadow like border which fades into SK_ColorTRANSPARENT. 15 // Creates a css box-shadow like border which fades into SK_ColorTRANSPARENT.
15 class VIEWS_EXPORT ShadowBorder : public views::Border { 16 class VIEWS_EXPORT ShadowBorder : public views::Border {
16 public: 17 public:
17 ShadowBorder(int blur, 18 ShadowBorder(int blur,
18 SkColor color, 19 SkColor color,
19 int vertical_offset, 20 int vertical_offset,
20 int horizontal_offset); 21 int horizontal_offset);
22 ShadowBorder(const gfx::ShadowValue& shadow);
sky 2015/02/05 17:33:32 I don't want another constructor that effectively
calamity 2015/02/06 05:29:53 Yeah, I'll just add it to this CL. Only a couple o
21 ~ShadowBorder() override; 23 ~ShadowBorder() override;
22 24
23 protected: 25 protected:
24 // Overridden from views::Border: 26 // Overridden from views::Border:
25 void Paint(const views::View& view, gfx::Canvas* canvas) override; 27 void Paint(const views::View& view, gfx::Canvas* canvas) override;
26 gfx::Insets GetInsets() const override; 28 gfx::Insets GetInsets() const override;
27 gfx::Size GetMinimumSize() const override; 29 gfx::Size GetMinimumSize() const override;
28 30
29 private: 31 private:
30 // Blur amount of the shadow in pixels. For details on how blur is defined see 32 // The shadow value to use for this border.
31 // comments for blur_ in class ShadowValue. 33 const gfx::ShadowValue shadow_value_;
32 const int blur_;
33
34 // Shadow color.
35 const SkColor color_;
36
37 // Number of pixels to shift shadow to bottom.
38 const int vertical_offset_;
39
40 // Number of pixels to shift shadow to right.
41 const int horizontal_offset_;
42 34
43 DISALLOW_COPY_AND_ASSIGN(ShadowBorder); 35 DISALLOW_COPY_AND_ASSIGN(ShadowBorder);
44 }; 36 };
45 37
46 } // namespace views 38 } // namespace views
47 39
48 #endif // UI_VIEWS_SHADOW_BORDER_H_ 40 #endif // UI_VIEWS_SHADOW_BORDER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/shadow_border.cc » ('j') | ui/views/shadow_border.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698