Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / components / autofill / core / browser / suggestion.h
blobebf16073b8abf965eb581cfdb58692cc7ec7f965
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.
5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string16.h"
13 namespace autofill {
15 class AutofillProfile;
16 class CreditCard;
18 struct Suggestion {
19 public:
20 enum MatchMode {
21 PREFIX_MATCH, // for prefix matched suggestions;
22 SUBSTRING_MATCH // for substring matched suggestions;
25 Suggestion();
27 // Copy constructor for STL containers.
28 Suggestion(const Suggestion& other);
30 explicit Suggestion(const base::string16& value);
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);
39 ~Suggestion();
41 // GUID generated by the backend layer. This identifies the exact autofill
42 // profile that generated this suggestion.
43 std::string backend_id;
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;
51 base::string16 value;
52 base::string16 label;
53 base::string16 icon;
54 MatchMode match;
57 } // namespace autofill
59 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_