| OLD | NEW |
| 1 // Copyright (c) 2011 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_CONTROLS_FOCUSABLE_BORDER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_FOCUSABLE_BORDER_H_ |
| 6 #define UI_VIEWS_CONTROLS_FOCUSABLE_BORDER_H_ | 6 #define UI_VIEWS_CONTROLS_FOCUSABLE_BORDER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "ui/views/border.h" | 11 #include "ui/views/border.h" |
| 12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Canvas; | 15 class CanvasSkia; |
| 16 class Insets; | 16 class Insets; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 | 20 |
| 21 // A Border class to draw a focused border around a field (e.g textfield). | 21 // A Border class to draw a focused border around a field (e.g textfield). |
| 22 class FocusableBorder : public Border { | 22 class FocusableBorder : public Border { |
| 23 public: | 23 public: |
| 24 FocusableBorder(); | 24 FocusableBorder(); |
| 25 | 25 |
| 26 // Sets the insets of the border. | 26 // Sets the insets of the border. |
| 27 void SetInsets(int top, int left, int bottom, int right); | 27 void SetInsets(int top, int left, int bottom, int right); |
| 28 | 28 |
| 29 // Sets the focus state. | 29 // Sets the focus state. |
| 30 void set_has_focus(bool has_focus) { | 30 void set_has_focus(bool has_focus) { |
| 31 has_focus_ = has_focus; | 31 has_focus_ = has_focus; |
| 32 } | 32 } |
| 33 | 33 |
| 34 // Overridden from Border: | 34 // Overridden from Border: |
| 35 virtual void Paint(const View& view, gfx::Canvas* canvas) const OVERRIDE; | 35 virtual void Paint(const View& view, gfx::CanvasSkia* canvas) const OVERRIDE; |
| 36 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; | 36 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 bool has_focus_; | 39 bool has_focus_; |
| 40 gfx::Insets insets_; | 40 gfx::Insets insets_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(FocusableBorder); | 42 DISALLOW_COPY_AND_ASSIGN(FocusableBorder); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace views | 45 } // namespace views |
| 46 | 46 |
| 47 #endif // UI_VIEWS_CONTROLS_FOCUSABLE_BORDER_H_ | 47 #endif // UI_VIEWS_CONTROLS_FOCUSABLE_BORDER_H_ |
| OLD | NEW |