OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_AUTOFILL_DIALOG_TYPES_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_TYPES_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_TYPES_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_TYPES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 NONE, | 32 NONE, |
33 DEVELOPER_WARNING, | 33 DEVELOPER_WARNING, |
34 REQUIRED_ACTION, | 34 REQUIRED_ACTION, |
35 SECURITY_WARNING, | 35 SECURITY_WARNING, |
36 WALLET_ERROR, | 36 WALLET_ERROR, |
37 WALLET_USAGE_CONFIRMATION, | 37 WALLET_USAGE_CONFIRMATION, |
38 }; | 38 }; |
39 | 39 |
40 DialogNotification(); | 40 DialogNotification(); |
41 DialogNotification(Type type, const base::string16& display_text); | 41 DialogNotification(Type type, const base::string16& display_text); |
| 42 DialogNotification(const DialogNotification& other); |
42 ~DialogNotification(); | 43 ~DialogNotification(); |
43 | 44 |
44 // Returns the appropriate background, border, or text color for the view's | 45 // Returns the appropriate background, border, or text color for the view's |
45 // notification area based on |type_|. | 46 // notification area based on |type_|. |
46 SkColor GetBackgroundColor() const; | 47 SkColor GetBackgroundColor() const; |
47 SkColor GetBorderColor() const; | 48 SkColor GetBorderColor() const; |
48 SkColor GetTextColor() const; | 49 SkColor GetTextColor() const; |
49 | 50 |
50 // Whether this notification has an arrow pointing up at the account chooser. | 51 // Whether this notification has an arrow pointing up at the account chooser. |
51 bool HasArrow() const; | 52 bool HasArrow() const; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 extern SkColor const kSubtleBorderColor; | 93 extern SkColor const kSubtleBorderColor; |
93 | 94 |
94 struct SuggestionState { | 95 struct SuggestionState { |
95 SuggestionState(); | 96 SuggestionState(); |
96 SuggestionState(bool visible, | 97 SuggestionState(bool visible, |
97 const base::string16& vertically_compact_text, | 98 const base::string16& vertically_compact_text, |
98 const base::string16& horizontally_compact_text, | 99 const base::string16& horizontally_compact_text, |
99 const gfx::Image& icon, | 100 const gfx::Image& icon, |
100 const base::string16& extra_text, | 101 const base::string16& extra_text, |
101 const gfx::Image& extra_icon); | 102 const gfx::Image& extra_icon); |
| 103 SuggestionState(const SuggestionState& other); |
102 ~SuggestionState(); | 104 ~SuggestionState(); |
103 | 105 |
104 // Whether a suggestion should be shown. | 106 // Whether a suggestion should be shown. |
105 bool visible; | 107 bool visible; |
106 | 108 |
107 // Text to be shown for the suggestion. This should be preferred over | 109 // Text to be shown for the suggestion. This should be preferred over |
108 // |horizontally_compact_text| when there's enough horizontal space available | 110 // |horizontally_compact_text| when there's enough horizontal space available |
109 // to display it. When there's not enough space, fall back to | 111 // to display it. When there's not enough space, fall back to |
110 // |horizontally_compact_text|. | 112 // |horizontally_compact_text|. |
111 base::string16 vertically_compact_text; | 113 base::string16 vertically_compact_text; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // If |sure| is true, always display message. If it is false, | 162 // If |sure| is true, always display message. If it is false, |
161 // only display on final validation (i.e. after the user has attempted to | 163 // only display on final validation (i.e. after the user has attempted to |
162 // submit). | 164 // submit). |
163 bool sure; | 165 bool sure; |
164 }; | 166 }; |
165 | 167 |
166 // A mapping of field types to their corresponding ValidityMessage results. | 168 // A mapping of field types to their corresponding ValidityMessage results. |
167 class ValidityMessages { | 169 class ValidityMessages { |
168 public: | 170 public: |
169 ValidityMessages(); | 171 ValidityMessages(); |
| 172 ValidityMessages(const ValidityMessages& other); |
170 ~ValidityMessages(); | 173 ~ValidityMessages(); |
171 | 174 |
172 // Sets the message for |field|, but will not overwrite a previous, invalid | 175 // Sets the message for |field|, but will not overwrite a previous, invalid |
173 // message. | 176 // message. |
174 void Set(ServerFieldType field, const ValidityMessage& message); | 177 void Set(ServerFieldType field, const ValidityMessage& message); |
175 const ValidityMessage& GetMessageOrDefault(ServerFieldType field) const; | 178 const ValidityMessage& GetMessageOrDefault(ServerFieldType field) const; |
176 | 179 |
177 bool HasSureError(ServerFieldType field) const; | 180 bool HasSureError(ServerFieldType field) const; |
178 bool HasErrors() const; | 181 bool HasErrors() const; |
179 bool HasSureErrors() const; | 182 bool HasSureErrors() const; |
180 | 183 |
181 private: | 184 private: |
182 typedef std::map<ServerFieldType, ValidityMessage> MessageMap; | 185 typedef std::map<ServerFieldType, ValidityMessage> MessageMap; |
183 MessageMap messages_; | 186 MessageMap messages_; |
184 ValidityMessage default_message_; | 187 ValidityMessage default_message_; |
185 }; | 188 }; |
186 | 189 |
187 } // namespace autofill | 190 } // namespace autofill |
188 | 191 |
189 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_TYPES_H_ | 192 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_TYPES_H_ |
OLD | NEW |