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

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

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mobile specific infobar delegate. Created 4 years, 11 months 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
gone 2016/01/12 19:04:23 nit: 2016
please use gerrit instead 2016/01/12 22:58:56 Hm, technically this s almost copy-pasta. However,
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_
7
8 #include <vector>
9
10 #include "base/gtest_prod_util.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string16.h"
14 #include "ui/gfx/range/range.h"
15 #include "url/gurl.h"
16
17 namespace base {
18 class DictionaryValue;
19 }
20
21 namespace autofill {
22
23 class LegalMessageLine {
24 public:
25 struct Link {
26 gfx::Range range;
27 GURL url;
28 };
29
30 // Parses |line|. Returns false on failure.
31 static bool Parse(const base::DictionaryValue& legal_message,
32 std::vector<scoped_ptr<LegalMessageLine>>* out);
33
34 LegalMessageLine();
35 ~LegalMessageLine();
36
37 const base::string16& text() const { return text_; }
38 const std::vector<Link>& links() const { return links_; }
39
40 private:
41 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, NoParameters);
Peter Kasting 2016/01/12 23:09:37 If you have this many friend declarations, conside
please use gerrit instead 2016/01/13 21:22:09 Done.
42 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, SingleParameter);
43 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, MissingUrl);
44 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, MissingDisplayText);
45 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, EscapeCharacters);
46 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, ConsecutiveDollarSigns);
47 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, DollarAndParenthesis);
48 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, MultipleParameters);
49 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, MultipleLineElements);
50 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, EmbeddedNewlines);
51 FRIEND_TEST_ALL_PREFIXES(LegalMessageLineTest, MaximumPlaceholders);
52
53 bool ParseLine(const base::DictionaryValue& line);
54
55 base::string16 text_;
56 std::vector<Link> links_;
57
58 DISALLOW_COPY_AND_ASSIGN(LegalMessageLine);
59 };
60
61 typedef std::vector<scoped_ptr<LegalMessageLine>> LegalMessageLines;
Peter Kasting 2016/01/12 23:09:37 Nit: Chromium style prefers "using" to "typedef" f
please use gerrit instead 2016/01/13 21:22:09 Done.
62
63 } // namespace autofill
64
65 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_LEGAL_MESSAGE_LINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698