Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Side by Side Diff: components/autofill/core/browser/legal_message_line.h

Issue 2348433002: Make styled-label trimming less agressive, allowing whitespace (Closed)
Patch Set: Code style fixes - part 2 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/controls/styled_label.cc » ('j') | ui/views/controls/styled_label.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // } ] 56 // } ]
57 // } 57 // }
58 // 58 //
59 // Caveats: 59 // Caveats:
60 // 1. '{' and '}' may be displayed by escaping them with an apostrophe in the 60 // 1. '{' and '}' may be displayed by escaping them with an apostrophe in the
61 // template string, e.g. template "Here is a literal '{'". 61 // template string, e.g. template "Here is a literal '{'".
62 // 2. Two or more consecutive dollar signs in the template string will not 62 // 2. Two or more consecutive dollar signs in the template string will not
63 // expand correctly. 63 // expand correctly.
64 // 3. "${" anywhere in the template string is invalid. 64 // 3. "${" anywhere in the template string is invalid.
65 // 4. "\n" embedded anywhere in the template string, or an empty template 65 // 4. "\n" embedded anywhere in the template string, or an empty template
66 // string, can be used to separate paragraphs. It is not possible to create 66 // string, can be used to separate paragraphs.
67 // a completely blank line by using two consecutive newlines (they will be
68 // treated as a single newline by views::StyledLabel).
69 static bool Parse(const base::DictionaryValue& legal_message, 67 static bool Parse(const base::DictionaryValue& legal_message,
70 LegalMessageLines* out); 68 LegalMessageLines* out);
71 69
72 const base::string16& text() const { return text_; } 70 const base::string16& text() const { return text_; }
73 const std::vector<Link>& links() const { return links_; } 71 const std::vector<Link>& links() const { return links_; }
74 72
75 private: 73 private:
76 friend class TestLegalMessageLine; 74 friend class TestLegalMessageLine;
77 75
78 bool ParseLine(const base::DictionaryValue& line); 76 bool ParseLine(const base::DictionaryValue& line);
79 77
80 base::string16 text_; 78 base::string16 text_;
81 std::vector<Link> links_; 79 std::vector<Link> links_;
82 }; 80 };
83 81
84 } // namespace autofill 82 } // namespace autofill
85 83
86 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_ 84 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/styled_label.cc » ('j') | ui/views/controls/styled_label.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698