Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 return; | 212 return; |
| 213 } | 213 } |
| 214 | 214 |
| 215 DCHECK_EQ(AUTOFILL_VALUE_RESULT, result->GetType()); | 215 DCHECK_EQ(AUTOFILL_VALUE_RESULT, result->GetType()); |
| 216 const WDResult<std::vector<string16> >* autofill_result = | 216 const WDResult<std::vector<string16> >* autofill_result = |
| 217 static_cast<const WDResult<std::vector<string16> >*>(result); | 217 static_cast<const WDResult<std::vector<string16> >*>(result); |
| 218 std::vector<string16> suggestions = autofill_result->GetValue(); | 218 std::vector<string16> suggestions = autofill_result->GetValue(); |
| 219 SendSuggestions(&suggestions); | 219 SendSuggestions(&suggestions); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void AutocompleteHistoryManager::SetExternalDelegate( | |
| 223 AutofillExternalDelegate* delegate) { | |
| 224 void SetExternalDelegate(AutofillExternalDelegate* delegate); | |
|
John Grabowski
2011/11/08 20:46:02
This doesn't look like valid code.
Ilya Sherman
2011/11/08 21:06:16
I don't think this is quite the change you wanted
csharp
2011/11/09 16:18:37
Fixed. Surprisingly this code did compile without
| |
| 225 } | |
| 226 | |
| 222 AutocompleteHistoryManager::AutocompleteHistoryManager( | 227 AutocompleteHistoryManager::AutocompleteHistoryManager( |
| 223 TabContents* tab_contents, | 228 TabContents* tab_contents, |
| 224 Profile* profile, | 229 Profile* profile, |
| 225 WebDataService* wds) | 230 WebDataService* wds) |
| 226 : TabContentsObserver(tab_contents), | 231 : TabContentsObserver(tab_contents), |
| 227 profile_(profile), | 232 profile_(profile), |
| 228 web_data_service_(wds), | 233 web_data_service_(wds), |
| 229 pending_query_handle_(0), | 234 pending_query_handle_(0), |
| 230 query_id_(0) { | 235 query_id_(0) { |
| 231 autofill_enabled_.Init( | 236 autofill_enabled_.Init( |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 258 if (unique) { | 263 if (unique) { |
| 259 autofill_values_.push_back((*suggestions)[i]); | 264 autofill_values_.push_back((*suggestions)[i]); |
| 260 autofill_labels_.push_back(string16()); | 265 autofill_labels_.push_back(string16()); |
| 261 autofill_icons_.push_back(string16()); | 266 autofill_icons_.push_back(string16()); |
| 262 autofill_unique_ids_.push_back(0); // 0 means no profile. | 267 autofill_unique_ids_.push_back(0); // 0 means no profile. |
| 263 } | 268 } |
| 264 } | 269 } |
| 265 } | 270 } |
| 266 | 271 |
| 267 if (external_delegate_) { | 272 if (external_delegate_) { |
| 273 Send(new AutofillMsg_SetHasExternalDelegate(routing_id(), true)); | |
|
John Grabowski
2011/11/08 20:46:02
You probably want to make this call at SetExternal
csharp
2011/11/09 16:18:37
We no longer make SetExternalDelegate calls, so pr
| |
| 268 external_delegate_->OnSuggestionsReturned( | 274 external_delegate_->OnSuggestionsReturned( |
| 269 query_id_, | 275 query_id_, |
| 270 autofill_values_, | 276 autofill_values_, |
| 271 autofill_labels_, | 277 autofill_labels_, |
| 272 autofill_icons_, | 278 autofill_icons_, |
| 273 autofill_unique_ids_); | 279 autofill_unique_ids_); |
| 274 } | 280 } |
| 275 | 281 |
| 276 Send(new AutofillMsg_SuggestionsReturned(routing_id(), | 282 Send(new AutofillMsg_SuggestionsReturned(routing_id(), |
| 277 query_id_, | 283 query_id_, |
| 278 autofill_values_, | 284 autofill_values_, |
| 279 autofill_labels_, | 285 autofill_labels_, |
| 280 autofill_icons_, | 286 autofill_icons_, |
| 281 autofill_unique_ids_)); | 287 autofill_unique_ids_)); |
| 282 | 288 |
| 283 query_id_ = 0; | 289 query_id_ = 0; |
| 284 autofill_values_.clear(); | 290 autofill_values_.clear(); |
| 285 autofill_labels_.clear(); | 291 autofill_labels_.clear(); |
| 286 autofill_icons_.clear(); | 292 autofill_icons_.clear(); |
| 287 autofill_unique_ids_.clear(); | 293 autofill_unique_ids_.clear(); |
| 288 } | 294 } |
| OLD | NEW |