OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DECORATED_TEXTFIELD_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_DECORATED_TEXTFIELD_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_DECORATED_TEXTFIELD_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_DECORATED_TEXTFIELD_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
12 #include "ui/views/controls/textfield/textfield.h" | 13 #include "ui/views/controls/textfield/textfield.h" |
13 #include "ui/views/view_targeter_delegate.h" | 14 #include "ui/views/view_targeter_delegate.h" |
14 | 15 |
15 namespace views { | 16 namespace views { |
16 class ImageView; | 17 class ImageView; |
17 class TextfieldController; | 18 class TextfieldController; |
18 } | 19 } |
19 | 20 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Updates the background after its color may have changed. | 62 // Updates the background after its color may have changed. |
62 void UpdateBackground(); | 63 void UpdateBackground(); |
63 | 64 |
64 // Updates the border after its color or insets may have changed. | 65 // Updates the border after its color or insets may have changed. |
65 void UpdateBorder(); | 66 void UpdateBorder(); |
66 | 67 |
67 // Called to update the layout after SetIcon or SetTooltipIcon was called. | 68 // Called to update the layout after SetIcon or SetTooltipIcon was called. |
68 void IconChanged(); | 69 void IconChanged(); |
69 | 70 |
70 // The view that holds the icon at the end of the textfield. | 71 // The view that holds the icon at the end of the textfield. |
71 scoped_ptr<views::ImageView> icon_view_; | 72 std::unique_ptr<views::ImageView> icon_view_; |
72 | 73 |
73 // Whether the text contents are "invalid" (i.e. should special markers be | 74 // Whether the text contents are "invalid" (i.e. should special markers be |
74 // shown to indicate invalidness). | 75 // shown to indicate invalidness). |
75 bool invalid_; | 76 bool invalid_; |
76 | 77 |
77 // Whether the user can edit the field. When not editable, many of the | 78 // Whether the user can edit the field. When not editable, many of the |
78 // pieces of the textfield disappear (border, background, icon, placeholder | 79 // pieces of the textfield disappear (border, background, icon, placeholder |
79 // text) and it can't receive focus. | 80 // text) and it can't receive focus. |
80 bool editable_; | 81 bool editable_; |
81 | 82 |
82 DISALLOW_COPY_AND_ASSIGN(DecoratedTextfield); | 83 DISALLOW_COPY_AND_ASSIGN(DecoratedTextfield); |
83 }; | 84 }; |
84 | 85 |
85 } // namespace autofill | 86 } // namespace autofill |
86 | 87 |
87 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_DECORATED_TEXTFIELD_H_ | 88 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_DECORATED_TEXTFIELD_H_ |
OLD | NEW |