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

Side by Side Diff: chrome/browser/autofill/autofill-inl.h

Issue 6903091: Autofill Multi-Value: Additional profiles with same name and address not added to DOM UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits. Created 9 years, 8 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 | « no previous file | chrome/browser/autofill/credit_card.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
7 #pragma once 7 #pragma once
8 8
9 template<typename T> 9 template<typename T>
10 class FormGroupMatchesByCompareFunctor { 10 class FormGroupMatchesByCompareFunctor {
11 public: 11 public:
12 explicit FormGroupMatchesByCompareFunctor(const T& form_group) 12 explicit FormGroupMatchesByCompareFunctor(const T& form_group)
13 : form_group_(form_group) { 13 : form_group_(form_group) {
14 } 14 }
15 15
16 bool operator()(const T* form_group) { 16 bool operator()(const T* form_group) {
17 return form_group->Compare(form_group_) == 0; 17 return form_group->CompareMulti(form_group_) == 0;
18 } 18 }
19 19
20 bool operator()(const T& form_group) { 20 bool operator()(const T& form_group) {
21 return form_group.Compare(form_group_) == 0; 21 return form_group.CompareMulti(form_group_) == 0;
22 } 22 }
23 23
24 private: 24 private:
25 const T& form_group_; 25 const T& form_group_;
26 }; 26 };
27 27
28 template<typename C, typename T> 28 template<typename C, typename T>
29 bool FindByContents(const C& container, const T& form_group) { 29 bool FindByContents(const C& container, const T& form_group) {
30 return std::find_if( 30 return std::find_if(
31 container.begin(), 31 container.begin(),
32 container.end(), 32 container.end(),
33 FormGroupMatchesByCompareFunctor<T>(form_group)) != container.end(); 33 FormGroupMatchesByCompareFunctor<T>(form_group)) != container.end();
34 } 34 }
35 35
36 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_ 36 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/credit_card.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698