OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/autofill/core/browser/legal_message_line.h" | 5 #include "components/autofill/core/browser/legal_message_line.h" |
6 | 6 |
7 #include "base/i18n/message_formatter.h" | 7 #include "base/i18n/message_formatter.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 LegalMessageLine::Link::Link(size_t start, | 67 LegalMessageLine::Link::Link(size_t start, |
68 size_t end, | 68 size_t end, |
69 const std::string& url_spec) | 69 const std::string& url_spec) |
70 : range(start, end), url(url_spec) {} | 70 : range(start, end), url(url_spec) {} |
71 | 71 |
72 LegalMessageLine::Link::~Link() {} | 72 LegalMessageLine::Link::~Link() {} |
73 | 73 |
74 LegalMessageLine::LegalMessageLine() {} | 74 LegalMessageLine::LegalMessageLine() {} |
75 | 75 |
| 76 LegalMessageLine::LegalMessageLine(const LegalMessageLine& other) = default; |
| 77 |
76 LegalMessageLine::~LegalMessageLine() {} | 78 LegalMessageLine::~LegalMessageLine() {} |
77 | 79 |
78 // static | 80 // static |
79 bool LegalMessageLine::Parse(const base::DictionaryValue& legal_message, | 81 bool LegalMessageLine::Parse(const base::DictionaryValue& legal_message, |
80 LegalMessageLines* out) { | 82 LegalMessageLines* out) { |
81 const base::ListValue* lines_list = nullptr; | 83 const base::ListValue* lines_list = nullptr; |
82 if (legal_message.GetList("line", &lines_list)) { | 84 if (legal_message.GetList("line", &lines_list)) { |
83 LegalMessageLines lines; | 85 LegalMessageLines lines; |
84 lines.reserve(lines_list->GetSize()); | 86 lines.reserve(lines_list->GetSize()); |
85 for (size_t i = 0; i < lines_list->GetSize(); ++i) { | 87 for (size_t i = 0; i < lines_list->GetSize(); ++i) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 for (size_t offset_index = 0; offset_index < offsets.size(); ++offset_index) { | 145 for (size_t offset_index = 0; offset_index < offsets.size(); ++offset_index) { |
144 size_t range_start = offsets[offset_index]; | 146 size_t range_start = offsets[offset_index]; |
145 links_[offset_index].range = gfx::Range( | 147 links_[offset_index].range = gfx::Range( |
146 range_start, range_start + display_texts[offset_index].size()); | 148 range_start, range_start + display_texts[offset_index].size()); |
147 } | 149 } |
148 | 150 |
149 return true; | 151 return true; |
150 } | 152 } |
151 | 153 |
152 } // namespace autofill | 154 } // namespace autofill |
OLD | NEW |