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 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 display_text, base::string16(1, kRangeSeparator), | 35 display_text, base::string16(1, kRangeSeparator), |
36 base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); | 36 base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); |
37 if (pieces.size() > 1) { | 37 if (pieces.size() > 1) { |
38 size_t start = pieces[0].size(); | 38 size_t start = pieces[0].size(); |
39 size_t end = start + pieces[1].size(); | 39 size_t end = start + pieces[1].size(); |
40 link_range_ = gfx::Range(start, end); | 40 link_range_ = gfx::Range(start, end); |
41 display_text_ = base::JoinString(pieces, base::StringPiece16()); | 41 display_text_ = base::JoinString(pieces, base::StringPiece16()); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
| 45 DialogNotification::DialogNotification(const DialogNotification& other) = |
| 46 default; |
| 47 |
45 DialogNotification::~DialogNotification() {} | 48 DialogNotification::~DialogNotification() {} |
46 | 49 |
47 SkColor DialogNotification::GetBackgroundColor() const { | 50 SkColor DialogNotification::GetBackgroundColor() const { |
48 switch (type_) { | 51 switch (type_) { |
49 case DialogNotification::WALLET_USAGE_CONFIRMATION: | 52 case DialogNotification::WALLET_USAGE_CONFIRMATION: |
50 return SkColorSetRGB(0xf5, 0xf5, 0xf5); | 53 return SkColorSetRGB(0xf5, 0xf5, 0xf5); |
51 case DialogNotification::REQUIRED_ACTION: | 54 case DialogNotification::REQUIRED_ACTION: |
52 case DialogNotification::WALLET_ERROR: | 55 case DialogNotification::WALLET_ERROR: |
53 return SkColorSetRGB(0xfc, 0xf3, 0xbf); | 56 return SkColorSetRGB(0xfc, 0xf3, 0xbf); |
54 case DialogNotification::DEVELOPER_WARNING: | 57 case DialogNotification::DEVELOPER_WARNING: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 const base::string16& horizontally_compact_text, | 119 const base::string16& horizontally_compact_text, |
117 const gfx::Image& icon, | 120 const gfx::Image& icon, |
118 const base::string16& extra_text, | 121 const base::string16& extra_text, |
119 const gfx::Image& extra_icon) | 122 const gfx::Image& extra_icon) |
120 : visible(visible), | 123 : visible(visible), |
121 vertically_compact_text(vertically_compact_text), | 124 vertically_compact_text(vertically_compact_text), |
122 horizontally_compact_text(horizontally_compact_text), | 125 horizontally_compact_text(horizontally_compact_text), |
123 icon(icon), | 126 icon(icon), |
124 extra_text(extra_text), | 127 extra_text(extra_text), |
125 extra_icon(extra_icon) {} | 128 extra_icon(extra_icon) {} |
| 129 SuggestionState::SuggestionState(const SuggestionState& other) = default; |
126 SuggestionState::~SuggestionState() {} | 130 SuggestionState::~SuggestionState() {} |
127 | 131 |
128 DialogOverlayString::DialogOverlayString() {} | 132 DialogOverlayString::DialogOverlayString() {} |
129 DialogOverlayString::~DialogOverlayString() {} | 133 DialogOverlayString::~DialogOverlayString() {} |
130 | 134 |
131 DialogOverlayState::DialogOverlayState() {} | 135 DialogOverlayState::DialogOverlayState() {} |
132 DialogOverlayState::~DialogOverlayState() {} | 136 DialogOverlayState::~DialogOverlayState() {} |
133 | 137 |
134 ValidityMessage::ValidityMessage(const base::string16& text, bool sure) | 138 ValidityMessage::ValidityMessage(const base::string16& text, bool sure) |
135 : text(text), sure(sure) {} | 139 : text(text), sure(sure) {} |
136 ValidityMessage::~ValidityMessage() {} | 140 ValidityMessage::~ValidityMessage() {} |
137 | 141 |
138 ValidityMessages::ValidityMessages() | 142 ValidityMessages::ValidityMessages() |
139 : default_message_(ValidityMessage(base::string16(), false)) {} | 143 : default_message_(ValidityMessage(base::string16(), false)) {} |
| 144 ValidityMessages::ValidityMessages(const ValidityMessages& other) = default; |
140 ValidityMessages::~ValidityMessages() {} | 145 ValidityMessages::~ValidityMessages() {} |
141 | 146 |
142 void ValidityMessages::Set( | 147 void ValidityMessages::Set( |
143 ServerFieldType field, const ValidityMessage& message) { | 148 ServerFieldType field, const ValidityMessage& message) { |
144 MessageMap::iterator iter = messages_.find(field); | 149 MessageMap::iterator iter = messages_.find(field); |
145 if (iter != messages_.end()) { | 150 if (iter != messages_.end()) { |
146 if (!iter->second.text.empty()) | 151 if (!iter->second.text.empty()) |
147 return; | 152 return; |
148 | 153 |
149 messages_.erase(iter); | 154 messages_.erase(iter); |
(...skipping 24 matching lines...) Expand all Loading... |
174 bool ValidityMessages::HasSureErrors() const { | 179 bool ValidityMessages::HasSureErrors() const { |
175 for (MessageMap::const_iterator iter = messages_.begin(); | 180 for (MessageMap::const_iterator iter = messages_.begin(); |
176 iter != messages_.end(); ++iter) { | 181 iter != messages_.end(); ++iter) { |
177 if (IsSureError(iter->second)) | 182 if (IsSureError(iter->second)) |
178 return true; | 183 return true; |
179 } | 184 } |
180 return false; | 185 return false; |
181 } | 186 } |
182 | 187 |
183 } // namespace autofill | 188 } // namespace autofill |
OLD | NEW |