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