ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / components / autofill / core / browser / suggestion.h
blobb9626449115e9fbf7dd2a2000c60b029ff2ae413
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 // Represents a single FormGroup and a specific data variant. This is assigned
19 // by the storage layer to uniquely identify the profile this came from.
20 struct SuggestionBackendID {
21 SuggestionBackendID();
22 SuggestionBackendID(const std::string& guid, size_t variant);
23 ~SuggestionBackendID();
25 std::string guid;
26 size_t variant;
28 // For using as a key in a map.
29 bool operator<(const SuggestionBackendID& other) const;
32 struct Suggestion {
33 public:
34 Suggestion();
36 // Copy constructor for STL containers.
37 Suggestion(const Suggestion& other);
39 explicit Suggestion(const base::string16& value);
41 // Constructor for unit tests. It will convert the strings from UTF-8 to
42 // UTF-16.
43 Suggestion(const std::string& value,
44 const std::string& label,
45 const std::string& icon,
46 int frontend_id);
48 ~Suggestion();
50 // ID generated by the backend layer. This identifies the exact autofill
51 // profile that generated this suggestion.
52 SuggestionBackendID backend_id;
54 // ID for the frontend to use in identifying the particular result. Positive
55 // values are sent over IPC to identify the item selected. Negative values
56 // (see popup_item_ids.h) have special built-in meanings. Default initialized
57 // to 0.
58 int frontend_id;
60 base::string16 value;
61 base::string16 label;
62 base::string16 icon;
65 } // namespace autofill
67 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_