Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BORDER_H_ | 5 #ifndef UI_VIEWS_BORDER_H_ |
| 6 #define UI_VIEWS_BORDER_H_ | 6 #define UI_VIEWS_BORDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | |
| 8 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/gfx/insets.h" | 10 #include "ui/gfx/insets.h" |
|
tfarina
2012/09/14 14:54:49
We can remove this include and view.h and just for
| |
| 10 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 12 #include "ui/views/views_export.h" | |
| 11 | 13 |
| 12 namespace gfx{ | 14 namespace gfx{ |
| 13 class Canvas; | 15 class Canvas; |
| 14 } | 16 } |
| 15 | 17 |
| 16 namespace views { | 18 namespace views { |
| 17 | 19 |
| 18 class Painter; | 20 class Painter; |
| 19 class View; | 21 class View; |
| 20 | 22 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 42 // Creates a border that is a simple line of the specified thickness and | 44 // Creates a border that is a simple line of the specified thickness and |
| 43 // color. | 45 // color. |
| 44 static Border* CreateSolidBorder(int thickness, SkColor color); | 46 static Border* CreateSolidBorder(int thickness, SkColor color); |
| 45 | 47 |
| 46 // Creates a border for reserving space. The returned border does not | 48 // Creates a border for reserving space. The returned border does not |
| 47 // paint anything. | 49 // paint anything. |
| 48 static Border* CreateEmptyBorder(int top, int left, int bottom, int right); | 50 static Border* CreateEmptyBorder(int top, int left, int bottom, int right); |
| 49 | 51 |
| 50 // Creates a border of the specified color, and specified thickness on each | 52 // Creates a border of the specified color, and specified thickness on each |
| 51 // side. | 53 // side. |
| 52 static Border* CreateSolidSidedBorder(int top, int left, | 54 static Border* CreateSolidSidedBorder(int top, int left, |
|
sky
2012/09/17 14:10:27
each param on its own line.
| |
| 53 int bottom, int right, | 55 int bottom, int right, |
| 54 SkColor color); | 56 SkColor color); |
| 55 | 57 |
| 56 // Creates a Border from the specified Painter. The border owns the painter, | 58 // Creates a Border from the specified Painter. The border owns the painter, |
| 57 // thus the painter is deleted when the Border is deleted. | 59 // thus the painter is deleted when the Border is deleted. |
| 58 static Border* CreateBorderPainter(Painter* painter); | 60 static Border* CreateBorderPainter(Painter* painter); |
| 59 | 61 |
| 60 // Renders the border for the specified view. | 62 // Renders the border for the specified view. |
| 61 virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0; | 63 virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0; |
| 62 | 64 |
| 63 // Sets the specified insets to the the border insets. | 65 // Sets the specified insets to the the border insets. |
| 64 virtual void GetInsets(gfx::Insets* insets) const = 0; | 66 virtual void GetInsets(gfx::Insets* insets) const = 0; |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 DISALLOW_COPY_AND_ASSIGN(Border); | 69 DISALLOW_COPY_AND_ASSIGN(Border); |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace views | 72 } // namespace views |
| 71 | 73 |
| 72 #endif // UI_VIEWS_BORDER_H_ | 74 #endif // UI_VIEWS_BORDER_H_ |
| OLD | NEW |