| 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_FOCUS_BORDER_H_ | 5 #ifndef UI_VIEWS_FOCUS_BORDER_H_ |
| 6 #define UI_VIEWS_FOCUS_BORDER_H_ | 6 #define UI_VIEWS_FOCUS_BORDER_H_ |
| 7 | 7 |
| 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/gfx/insets.h" |
| 8 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 | 12 |
| 11 namespace gfx { | 13 namespace gfx { |
| 12 class Canvas; | 14 class Canvas; |
| 13 } | 15 } |
| 14 | 16 |
| 15 namespace views { | 17 namespace views { |
| 16 class View; | 18 class View; |
| 17 | 19 |
| 18 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
| 19 // | 21 // |
| 20 // Focus border class. | 22 // Focus border class. |
| 21 // | 23 // |
| 22 // The focus border class is used to display an indication of focus on a view. | 24 // The focus border class is used to display an indication of focus on a view. |
| 23 // To set a focus border on a view, call SetFocusBorder on the view. Once set | 25 // To set a focus border on a view, call SetFocusBorder on the view. Once set |
| 24 // on a view, the focus border is owned by the view. | 26 // on a view, the focus border is owned by the view. |
| 25 // | 27 // |
| 26 //////////////////////////////////////////////////////////////////////////////// | 28 //////////////////////////////////////////////////////////////////////////////// |
| 27 | 29 |
| 28 class VIEWS_EXPORT FocusBorder { | 30 class VIEWS_EXPORT FocusBorder { |
| 29 public: | 31 public: |
| 30 virtual ~FocusBorder(); | 32 virtual ~FocusBorder(); |
| 31 | 33 |
| 32 // Creates the default inset dashed line focus border. | 34 // Creates the default inset dashed line focus border. |
| 33 static FocusBorder* CreateDashedFocusBorder(); | 35 static FocusBorder* CreateDashedFocusBorder(); |
| 34 static FocusBorder* CreateDashedFocusBorder( | 36 static FocusBorder* CreateDashedFocusBorder( |
| 35 int left, int top, int right, int bottom); | 37 int left, int top, int right, int bottom); |
| 36 | 38 |
| 39 // Creates a focus border with a given |inset| and |focus_color| which is one |
| 40 // pixel thick. |
| 41 static FocusBorder* CreateSolidFocusBorder( |
| 42 SkColor focus_color, const gfx::Insets& insets); |
| 43 |
| 37 // Renders the focus border for the specified view. | 44 // Renders the focus border for the specified view. |
| 38 virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0; | 45 virtual void Paint(const View& view, gfx::Canvas* canvas) const = 0; |
| 39 | 46 |
| 40 protected: | 47 protected: |
| 41 FocusBorder(); | 48 FocusBorder(); |
| 42 | 49 |
| 43 private: | 50 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(FocusBorder); | 51 DISALLOW_COPY_AND_ASSIGN(FocusBorder); |
| 45 }; | 52 }; |
| 46 | 53 |
| 47 } // namespace views | 54 } // namespace views |
| 48 | 55 |
| 49 #endif // UI_VIEWS_FOCUS_BORDER_H_ | 56 #endif // UI_VIEWS_FOCUS_BORDER_H_ |
| OLD | NEW |