OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_BORDER_H_ |
| 6 #define UI_VIEWS_BORDER_H_ |
| 7 |
| 8 #include "base/logging.h" |
| 9 #include "gfx/insets.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 |
| 12 namespace gfx { |
| 13 class Canvas; |
| 14 } |
| 15 |
| 16 namespace ui { |
| 17 |
| 18 class View; |
| 19 |
| 20 //////////////////////////////////////////////////////////////////////////////// |
| 21 // Border class |
| 22 // |
| 23 // A class that provides padding for a View. Subclass to provide custom |
| 24 // rendering of the Border. Insets determine the size of border. |
| 25 // |
| 26 class Border { |
| 27 public: |
| 28 virtual ~Border(); |
| 29 |
| 30 // Create various common border types. |
| 31 static Border* CreateSolidBorder(int thickness, SkColor color); |
| 32 static Border* CreateTransparentBorder(const gfx::Insets& insets); |
| 33 |
| 34 gfx::Insets insets() const { return insets_; } |
| 35 void set_insets(const gfx::Insets& insets) { insets_ = insets; } |
| 36 |
| 37 virtual void Paint(const View* view, gfx::Canvas* canvas) const; |
| 38 |
| 39 protected: |
| 40 Border(); |
| 41 |
| 42 private: |
| 43 gfx::Insets insets_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(Border); |
| 46 }; |
| 47 |
| 48 } // namespace ui |
| 49 |
| 50 #endif // UI_VIEWS_BORDER_H_ |
OLD | NEW |