OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browsing_data/core/browsing_data_utils.h" | 5 #include "components/browsing_data/core/browsing_data_utils.h" |
6 | 6 |
7 #include "components/browsing_data/core/counters/autofill_counter.h" | 7 #include "components/browsing_data/core/counters/autofill_counter.h" |
8 #include "components/browsing_data/core/counters/history_counter.h" | 8 #include "components/browsing_data/core/counters/history_counter.h" |
9 #include "components/browsing_data/core/counters/passwords_counter.h" | 9 #include "components/browsing_data/core/counters/passwords_counter.h" |
10 #include "components/browsing_data/core/pref_names.h" | 10 #include "components/browsing_data/core/pref_names.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 displayed_strings[1], displayed_strings[2]); | 134 displayed_strings[1], displayed_strings[2]); |
135 break; | 135 break; |
136 default: | 136 default: |
137 NOTREACHED(); | 137 NOTREACHED(); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 return text; | 141 return text; |
142 } | 142 } |
143 | 143 |
| 144 bool GetDeletionPreferenceFromDataType( |
| 145 BrowsingDataType data_type, |
| 146 std::string* out_pref) { |
| 147 switch (data_type) { |
| 148 case HISTORY: |
| 149 *out_pref = prefs::kDeleteBrowsingHistory; |
| 150 return true; |
| 151 case CACHE: |
| 152 *out_pref = prefs::kDeleteCache; |
| 153 return true; |
| 154 case COOKIES: |
| 155 *out_pref = prefs::kDeleteCookies; |
| 156 return true; |
| 157 case PASSWORDS: |
| 158 *out_pref = prefs::kDeletePasswords; |
| 159 return true; |
| 160 case FORM_DATA: |
| 161 *out_pref = prefs::kDeleteFormData; |
| 162 return true; |
| 163 case BOOKMARKS: |
| 164 // Bookmarks are deleted on the Android side. No corresponding deletion |
| 165 // preference. |
| 166 return false; |
| 167 case NUM_TYPES: |
| 168 // This is not an actual type. |
| 169 NOTREACHED(); |
| 170 return false; |
| 171 } |
| 172 NOTREACHED(); |
| 173 return false; |
| 174 } |
| 175 |
144 } // namespace browsing_data | 176 } // namespace browsing_data |
OLD | NEW |