diff options
author | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-03 03:09:24 +0000 |
---|---|---|
committer | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-03 03:09:24 +0000 |
commit | cc643fd82eceeae19797daa0e09bb8b9bde54c81 (patch) | |
tree | 017775620e75b8a4c22619a2bbeacb237b23a064 /views/controls/textfield/native_textfield_views.h | |
parent | f3086a40d46f8e20577c7db6e1d3ffb2801be8ba (diff) | |
download | chromium_src-cc643fd82eceeae19797daa0e09bb8b9bde54c81.zip chromium_src-cc643fd82eceeae19797daa0e09bb8b9bde54c81.tar.gz chromium_src-cc643fd82eceeae19797daa0e09bb8b9bde54c81.tar.bz2 |
Factored code drawing the focusable border used in some Views controls
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6910009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83849 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/textfield/native_textfield_views.h')
-rw-r--r-- | views/controls/textfield/native_textfield_views.h | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/views/controls/textfield/native_textfield_views.h b/views/controls/textfield/native_textfield_views.h index 1803e21..69385049c 100644 --- a/views/controls/textfield/native_textfield_views.h +++ b/views/controls/textfield/native_textfield_views.h @@ -26,6 +26,7 @@ class Canvas; namespace views { +class FocusableBorder; class KeyEvent; class Menu2; @@ -127,30 +128,6 @@ class NativeTextfieldViews : public views::View, private: friend class NativeTextfieldViewsTest; - // A Border class to draw focus border for the text field. - class TextfieldBorder : public Border { - public: - TextfieldBorder(); - - // Border implementation. - virtual void Paint(const View& view, gfx::Canvas* canvas) const; - virtual void GetInsets(gfx::Insets* insets) const; - - // Sets the insets of the border. - void SetInsets(int top, int left, int bottom, int right); - - // Sets the focus state. - void set_has_focus(bool has_focus) { - has_focus_ = has_focus; - } - - private: - bool has_focus_; - gfx::Insets insets_; - - DISALLOW_COPY_AND_ASSIGN(TextfieldBorder); - }; - // Overridden from TextInputClient: virtual void SetCompositionText( const ui::CompositionText& composition) OVERRIDE; @@ -245,7 +222,7 @@ class NativeTextfieldViews : public views::View, scoped_ptr<TextfieldViewsModel> model_; // The reference to the border class. The object is owned by View::border_. - TextfieldBorder* text_border_; + FocusableBorder* text_border_; // The x offset for the text to be drawn, without insets; int text_offset_; |