OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/autofill/core/common/autofill_util.h" | 5 #include "components/autofill/core/common/autofill_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 | 99 |
100 bool IsDesktopPlatform() { | 100 bool IsDesktopPlatform() { |
101 #if defined(OS_ANDROID) || defined(OS_IOS) | 101 #if defined(OS_ANDROID) || defined(OS_IOS) |
102 return false; | 102 return false; |
103 #else | 103 #else |
104 return true; | 104 return true; |
105 #endif | 105 #endif |
106 } | 106 } |
107 | 107 |
| 108 bool ShouldSkipField(const FormFieldData& field) { |
| 109 return IsCheckable(field.check_status); |
| 110 } |
| 111 |
| 112 bool IsCheckable(const FormFieldData::CheckStatus& check_status) { |
| 113 return check_status != FormFieldData::CheckStatus::NOT_CHECKABLE; |
| 114 } |
| 115 |
| 116 bool IsChecked(const FormFieldData::CheckStatus& check_status) { |
| 117 return check_status == FormFieldData::CheckStatus::CHECKED; |
| 118 } |
| 119 |
| 120 void SetCheckStatus(FormFieldData* form_field_data, |
| 121 bool isCheckable, |
| 122 bool isChecked) { |
| 123 if (isChecked) { |
| 124 form_field_data->check_status = FormFieldData::CheckStatus::CHECKED; |
| 125 } else { |
| 126 if (isCheckable) { |
| 127 form_field_data->check_status = |
| 128 FormFieldData::CheckStatus::CHECKABLE_BUT_UNCHECKED; |
| 129 } else { |
| 130 form_field_data->check_status = FormFieldData::CheckStatus::NOT_CHECKABLE; |
| 131 } |
| 132 } |
| 133 } |
| 134 |
108 } // namespace autofill | 135 } // namespace autofill |
OLD | NEW |