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

Side by Side Diff: components/autofill/browser/form_group.cc

Issue 17392006: In components/autofill, move browser/ to core/browser/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to fix conflicts Created 7 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « components/autofill/browser/form_group.h ('k') | components/autofill/browser/form_structure.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 #include "components/autofill/browser/form_group.h"
6
7 namespace autofill {
8
9 void FormGroup::GetMatchingTypes(const base::string16& text,
10 const std::string& app_locale,
11 FieldTypeSet* matching_types) const {
12 if (text.empty()) {
13 matching_types->insert(EMPTY_TYPE);
14 return;
15 }
16
17 FieldTypeSet types;
18 GetSupportedTypes(&types);
19 for (FieldTypeSet::const_iterator type = types.begin();
20 type != types.end(); ++type) {
21 // TODO(isherman): Matches are case-sensitive for now. Let's keep an eye on
22 // this and decide whether there are compelling reasons to add case-
23 // insensitivity.
24 if (GetInfo(*type, app_locale) == text)
25 matching_types->insert(*type);
26 }
27 }
28
29 void FormGroup::GetNonEmptyTypes(const std::string& app_locale,
30 FieldTypeSet* non_empty_types) const {
31 FieldTypeSet types;
32 GetSupportedTypes(&types);
33 for (FieldTypeSet::const_iterator type = types.begin();
34 type != types.end(); ++type) {
35 if (!GetInfo(*type, app_locale).empty())
36 non_empty_types->insert(*type);
37 }
38 }
39
40 base::string16 FormGroup::GetInfo(AutofillFieldType type,
41 const std::string& app_locale) const {
42 return GetRawInfo(type);
43 }
44
45 bool FormGroup::SetInfo(AutofillFieldType type,
46 const base::string16& value,
47 const std::string& app_locale) {
48 SetRawInfo(type, value);
49 return true;
50 }
51
52 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/browser/form_group.h ('k') | components/autofill/browser/form_structure.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698