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

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

Issue 772253003: Create an autofill Suggestion class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review 2 Created 6 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
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_SUGGESTION_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_
7
8 #include <string>
9
10 #include "base/strings/string16.h"
11
12 namespace autofill {
13
14 // Represents a single FormGroup and a specific data variant. This is assigned
15 // by the storage layer to uniquely identify the profile this came from.
16 struct SuggestionBackendID {
17 SuggestionBackendID();
18 SuggestionBackendID(const std::string& guid, size_t variant);
19 ~SuggestionBackendID();
20
21 std::string guid;
22 size_t variant;
23
24 // For using as a key in a map.
25 bool operator<(const SuggestionBackendID& other) const;
26 };
27
28 struct Suggestion {
29 Suggestion();
30 explicit Suggestion(const base::string16& value);
31
32 // Constructor for unit tests. It will convert the strings from UTF-8 to
33 // UTF-16.
34 Suggestion(const std::string& value,
35 const std::string& label,
36 const std::string& icon,
37 int frontend_id);
38
39 ~Suggestion();
40
41 // ID generated by the backend layer. This identifies the exact autofill
42 // profile that generated this suggestion.
43 SuggestionBackendID backend_id;
44
45 // ID for the frontend to use in identifying the particular result. Positive
46 // values are sent over IPC to identify the item selected. Negative values
47 // (see popup_item_ids.h) have special built-in meanings. Default initialized
48 // to 0.
49 int frontend_id;
50
51 base::string16 value;
Evan Stade 2014/12/10 23:11:14 can we take this opportunity to call this somethin
52 base::string16 label;
53 base::string16 icon;
54
55 bool is_masked;
56 };
57
58 } // namespace autofill
59
60 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698