Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_SUGGESTION_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 | 12 |
| 13 namespace autofill { | 13 namespace autofill { |
| 14 | 14 |
| 15 class AutofillProfile; | 15 class AutofillProfile; |
| 16 class CreditCard; | 16 class CreditCard; |
| 17 | 17 |
| 18 struct Suggestion { | 18 struct Suggestion { |
| 19 public: | 19 public: |
| 20 enum MatchMode { | |
| 21 PREFIX_MATCH, // for prefix matched suggestions; | |
| 22 SUBSTRING_MATCH // for substring matched suggestions; | |
| 23 }; | |
|
please use gerrit instead
2015/06/29 22:06:29
newline after };
Pritam Nikam
2015/06/30 15:05:50
Done.
| |
| 20 Suggestion(); | 24 Suggestion(); |
| 21 | 25 |
| 22 // Copy constructor for STL containers. | 26 // Copy constructor for STL containers. |
| 23 Suggestion(const Suggestion& other); | 27 Suggestion(const Suggestion& other); |
| 24 | 28 |
| 25 explicit Suggestion(const base::string16& value); | 29 explicit Suggestion(const base::string16& value); |
| 26 | 30 |
| 27 // Constructor for unit tests. It will convert the strings from UTF-8 to | 31 // Constructor for unit tests. It will convert the strings from UTF-8 to |
| 28 // UTF-16. | 32 // UTF-16. |
| 29 Suggestion(const std::string& value, | 33 Suggestion(const std::string& value, |
| 30 const std::string& label, | 34 const std::string& label, |
| 31 const std::string& icon, | 35 const std::string& icon, |
| 32 int frontend_id); | 36 int frontend_id); |
| 33 | 37 |
| 34 ~Suggestion(); | 38 ~Suggestion(); |
| 35 | 39 |
| 36 // GUID generated by the backend layer. This identifies the exact autofill | 40 // GUID generated by the backend layer. This identifies the exact autofill |
| 37 // profile that generated this suggestion. | 41 // profile that generated this suggestion. |
| 38 std::string backend_id; | 42 std::string backend_id; |
| 39 | 43 |
| 40 // ID for the frontend to use in identifying the particular result. Positive | 44 // ID for the frontend to use in identifying the particular result. Positive |
| 41 // values are sent over IPC to identify the item selected. Negative values | 45 // values are sent over IPC to identify the item selected. Negative values |
| 42 // (see popup_item_ids.h) have special built-in meanings. Default initialized | 46 // (see popup_item_ids.h) have special built-in meanings. Default initialized |
| 43 // to 0. | 47 // to 0. |
| 44 int frontend_id; | 48 int frontend_id; |
| 45 | 49 |
| 46 base::string16 value; | 50 base::string16 value; |
| 47 base::string16 label; | 51 base::string16 label; |
| 48 base::string16 icon; | 52 base::string16 icon; |
| 53 MatchMode match; | |
| 49 }; | 54 }; |
| 50 | 55 |
| 51 } // namespace autofill | 56 } // namespace autofill |
| 52 | 57 |
| 53 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_ | 58 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_H_ |
| OLD | NEW |