OLD | NEW |
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 #include "chrome/browser/autocomplete_history_manager.h" | 5 #include "chrome/browser/autocomplete_history_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 DCHECK(result); | 177 DCHECK(result); |
178 // Returning early here if |result| is NULL. We've seen this happen on | 178 // Returning early here if |result| is NULL. We've seen this happen on |
179 // Linux due to NFS dismounting and causing sql failures. | 179 // Linux due to NFS dismounting and causing sql failures. |
180 // See http://crbug.com/68783. | 180 // See http://crbug.com/68783. |
181 if (!result) { | 181 if (!result) { |
182 SendSuggestions(NULL); | 182 SendSuggestions(NULL); |
183 return; | 183 return; |
184 } | 184 } |
185 | 185 |
186 DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT); | 186 DCHECK_EQ(result->GetType(), AUTOFILL_VALUE_RESULT); |
187 const WDResult<std::vector<string16> >* autofill_result = | 187 const WDResult<std::vector<string16> >* autofill_result = |
188 static_cast<const WDResult<std::vector<string16> >*>(result); | 188 static_cast<const WDResult<std::vector<string16> >*>(result); |
189 std::vector<string16> suggestions = autofill_result->GetValue(); | 189 std::vector<string16> suggestions = autofill_result->GetValue(); |
190 SendSuggestions(&suggestions); | 190 SendSuggestions(&suggestions); |
191 } | 191 } |
192 | 192 |
193 AutocompleteHistoryManager::AutocompleteHistoryManager( | 193 AutocompleteHistoryManager::AutocompleteHistoryManager( |
194 TabContents* tab_contents, | 194 TabContents* tab_contents, |
195 Profile* profile, | 195 Profile* profile, |
196 WebDataService* wds) | 196 WebDataService* wds) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 autofill_labels_, | 241 autofill_labels_, |
242 autofill_icons_, | 242 autofill_icons_, |
243 autofill_unique_ids_)); | 243 autofill_unique_ids_)); |
244 | 244 |
245 query_id_ = 0; | 245 query_id_ = 0; |
246 autofill_values_.clear(); | 246 autofill_values_.clear(); |
247 autofill_labels_.clear(); | 247 autofill_labels_.clear(); |
248 autofill_icons_.clear(); | 248 autofill_icons_.clear(); |
249 autofill_unique_ids_.clear(); | 249 autofill_unique_ids_.clear(); |
250 } | 250 } |
OLD | NEW |