| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_VIEWS_AUTOFILL_EXPANDING_TEXTFIELD_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_EXPANDING_TEXTFIELD_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_EXPANDING_TEXTFIELD_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_EXPANDING_TEXTFIELD_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return textfields_.front()->editable(); | 52 return textfields_.front()->editable(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // DecoratedTextfield pass-throughs. | 55 // DecoratedTextfield pass-throughs. |
| 56 void SetDefaultWidthInCharacters(int chars); | 56 void SetDefaultWidthInCharacters(int chars); |
| 57 void SetPlaceholderText(const base::string16& placeholder); | 57 void SetPlaceholderText(const base::string16& placeholder); |
| 58 void SetIcon(const gfx::Image& icon); | 58 void SetIcon(const gfx::Image& icon); |
| 59 void SetTooltipIcon(const base::string16& text); | 59 void SetTooltipIcon(const base::string16& text); |
| 60 | 60 |
| 61 // View implementation. | 61 // View implementation. |
| 62 virtual const char* GetClassName() const OVERRIDE; | 62 virtual const char* GetClassName() const override; |
| 63 using views::View::needs_layout; | 63 using views::View::needs_layout; |
| 64 | 64 |
| 65 // TextfieldController implementation. | 65 // TextfieldController implementation. |
| 66 virtual void ContentsChanged(views::Textfield* sender, | 66 virtual void ContentsChanged(views::Textfield* sender, |
| 67 const base::string16& new_contents) OVERRIDE; | 67 const base::string16& new_contents) override; |
| 68 virtual bool HandleKeyEvent(views::Textfield* sender, | 68 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 69 const ui::KeyEvent& key_event) OVERRIDE; | 69 const ui::KeyEvent& key_event) override; |
| 70 virtual bool HandleMouseEvent(views::Textfield* sender, | 70 virtual bool HandleMouseEvent(views::Textfield* sender, |
| 71 const ui::MouseEvent& mouse_event) OVERRIDE; | 71 const ui::MouseEvent& mouse_event) override; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 // Calls a given function on every textfield. | 74 // Calls a given function on every textfield. |
| 75 template <typename BaseType, typename Param> | 75 template <typename BaseType, typename Param> |
| 76 void ForEachTextfield(void (BaseType::* f)(Param), Param p) const; | 76 void ForEachTextfield(void (BaseType::* f)(Param), Param p) const; |
| 77 | 77 |
| 78 // The list of textfields. Owned as child views. | 78 // The list of textfields. Owned as child views. |
| 79 std::list<DecoratedTextfield*> textfields_; | 79 std::list<DecoratedTextfield*> textfields_; |
| 80 | 80 |
| 81 TextfieldController* controller_; | 81 TextfieldController* controller_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(ExpandingTextfield); | 83 DISALLOW_COPY_AND_ASSIGN(ExpandingTextfield); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace autofill | 86 } // namespace autofill |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_EXPANDING_TEXTFIELD_H_ | 88 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_EXPANDING_TEXTFIELD_H_ |
| OLD | NEW |