1 // Copyright 2013 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_AUTOFILL_INL_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_INL_H_
11 class FormGroupMatchesByCompareFunctor
{
13 explicit FormGroupMatchesByCompareFunctor(const T
& form_group
)
14 : form_group_(form_group
) {
17 bool operator()(const T
* form_group
) {
18 return form_group
->Compare(form_group_
) == 0;
21 bool operator()(const T
& form_group
) {
22 return form_group
.Compare(form_group_
) == 0;
29 template<typename C
, typename T
>
30 bool FindByContents(const C
& container
, const T
& form_group
) {
34 FormGroupMatchesByCompareFunctor
<T
>(form_group
)) != container
.end();
37 } // namespace autofill
39 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_INL_H_