OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_CHROMEOS_LOGIN_TEXTFIELD_WITH_MARGIN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEXTFIELD_WITH_MARGIN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEXTFIELD_WITH_MARGIN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEXTFIELD_WITH_MARGIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/compiler_specific.h" |
9 #include "views/controls/textfield/textfield.h" | 10 #include "views/controls/textfield/textfield.h" |
10 | 11 |
11 namespace chromeos { | 12 namespace chromeos { |
12 | 13 |
13 // Class that represents textfield with margin that is proportional to the text | 14 // Class that represents textfield with margin that is proportional to the text |
14 // height. | 15 // height. |
15 class TextfieldWithMargin : public views::Textfield { | 16 class TextfieldWithMargin : public views::Textfield { |
16 public: | 17 public: |
17 TextfieldWithMargin(); | 18 TextfieldWithMargin(); |
18 explicit TextfieldWithMargin(views::Textfield::StyleFlags style); | 19 explicit TextfieldWithMargin(views::Textfield::StyleFlags style); |
19 | 20 |
20 protected: | 21 protected: |
21 // Overridden from views::View: | 22 // Overridden from views::View: |
22 virtual void Layout(); | 23 virtual void Layout() OVERRIDE; |
23 virtual bool OnKeyPressed(const views::KeyEvent& e); | 24 virtual bool OnKeyPressed(const views::KeyEvent& e) OVERRIDE; |
24 | 25 |
25 private: | 26 private: |
26 DISALLOW_COPY_AND_ASSIGN(TextfieldWithMargin); | 27 DISALLOW_COPY_AND_ASSIGN(TextfieldWithMargin); |
27 }; | 28 }; |
28 | 29 |
29 } // namespace chromeos | 30 } // namespace chromeos |
30 | 31 |
31 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEXTFIELD_WITH_MARGIN_H_ | 32 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEXTFIELD_WITH_MARGIN_H_ |
OLD | NEW |