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

Unified Diff: components/autofill/core/browser/suggestion.cc

Issue 772253003: Create an autofill Suggestion class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/suggestion.cc
diff --git a/components/autofill/core/browser/suggestion.cc b/components/autofill/core/browser/suggestion.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e8aba9177eded2a31c97da0538b0d0662cdb585f
--- /dev/null
+++ b/components/autofill/core/browser/suggestion.cc
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/autofill/core/browser/suggestion.h"
+
+#include "base/strings/utf_string_conversions.h"
+
+namespace autofill {
+
+SuggestionBackendID::SuggestionBackendID()
+ : variant(0) {
+}
+
+SuggestionBackendID::SuggestionBackendID(const std::string& g, size_t v)
+ : guid(g),
+ variant(v) {
+}
+
+SuggestionBackendID::~SuggestionBackendID() {
+}
+
+bool SuggestionBackendID::operator<(const SuggestionBackendID& other) const {
+ if (variant != other.variant)
+ return variant < other.variant;
+ return guid < other.guid;
+}
+
+Suggestion::Suggestion(const base::string16& v)
+ : frontend_id(0),
+ value(v),
+ is_masked(false) {
+}
+
+Suggestion::Suggestion(const std::string& v,
+ const std::string& l,
+ const std::string& i,
+ int fid)
+ : frontend_id(fid),
+ value(base::UTF8ToUTF16(v)),
+ label(base::UTF8ToUTF16(l)),
+ icon(base::UTF8ToUTF16(i)),
+ is_masked(false) {
+}
+
+Suggestion::Suggestion()
+ : frontend_id(0),
+ is_masked(false) {
+}
+
+Suggestion::~Suggestion() {
+}
+
+} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/suggestion.h ('k') | components/autofill/core/browser/suggestion_test_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698