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 "base/basictypes.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/gfx/insets.h" | 10 #include "ui/gfx/insets.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 | 61 |
| 62 // Creates a Border from the specified Painter. The border owns the painter, | 62 // Creates a Border from the specified Painter. The border owns the painter, |
| 63 // thus the painter is deleted when the Border is deleted. | 63 // thus the painter is deleted when the Border is deleted. |
| 64 // |insets| define size of an area allocated for a Border. | 64 // |insets| define size of an area allocated for a Border. |
| 65 static Border* CreateBorderPainter(Painter* painter, | 65 static Border* CreateBorderPainter(Painter* painter, |
| 66 const gfx::Insets& insets); | 66 const gfx::Insets& insets); |
| 67 | 67 |
| 68 // Renders the border for the specified view. | 68 // Renders the border for the specified view. |
| 69 virtual void Paint(const View& view, gfx::Canvas* canvas) = 0; | 69 virtual void Paint(const View& view, gfx::Canvas* canvas) = 0; |
| 70 | 70 |
| 71 // Sets the specified insets to the the border insets. | 71 // Returns the border insets. |
| 72 virtual gfx::Insets GetInsets() const = 0; | 72 virtual gfx::Insets GetInsets() const = 0; |
| 73 | 73 |
| 74 // Returns the minimum size this border requires. Note that this may not be | |
|
msw
2013/11/22 18:00:25
Would it make sense to have the default Border::Ge
Peter Kasting
2013/11/22 22:07:55
That's not the intent of GetMinimumSize() from Bor
| |
| 75 // the same as the insets. For example, a Border may paint images to draw | |
| 76 // some graphical border around a view, and this would return the minimum size | |
| 77 // such that these images would not be clipped or overlapping -- but the | |
| 78 // insets may be larger or smaller, depending on how the view wanted its | |
| 79 // content laid out relative to these images. | |
| 80 virtual gfx::Size GetMinimumSize() const = 0; | |
| 81 | |
| 74 // Manual RTTI for text buttons. | 82 // Manual RTTI for text buttons. |
| 75 virtual TextButtonBorder* AsTextButtonBorder(); | 83 virtual TextButtonBorder* AsTextButtonBorder(); |
| 76 virtual const TextButtonBorder* AsTextButtonBorder() const; | 84 virtual const TextButtonBorder* AsTextButtonBorder() const; |
| 77 | 85 |
| 78 private: | 86 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(Border); | 87 DISALLOW_COPY_AND_ASSIGN(Border); |
| 80 }; | 88 }; |
| 81 | 89 |
| 82 } // namespace views | 90 } // namespace views |
| 83 | 91 |
| 84 #endif // UI_VIEWS_BORDER_H_ | 92 #endif // UI_VIEWS_BORDER_H_ |
| OLD | NEW |