| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/autofill/autofill_popup_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 if (!delegate_->RemoveSuggestion(suggestions_[list_index].value, | 352 if (!delegate_->RemoveSuggestion(suggestions_[list_index].value, |
| 353 suggestions_[list_index].frontend_id)) { | 353 suggestions_[list_index].frontend_id)) { |
| 354 return false; | 354 return false; |
| 355 } | 355 } |
| 356 | 356 |
| 357 // Remove the deleted element. | 357 // Remove the deleted element. |
| 358 suggestions_.erase(suggestions_.begin() + list_index); | 358 suggestions_.erase(suggestions_.begin() + list_index); |
| 359 elided_values_.erase(elided_values_.begin() + list_index); | 359 elided_values_.erase(elided_values_.begin() + list_index); |
| 360 elided_labels_.erase(elided_labels_.begin() + list_index); | 360 elided_labels_.erase(elided_labels_.begin() + list_index); |
| 361 | 361 |
| 362 SetSelectedLine(base::nullopt); | 362 selected_line_.reset(); |
| 363 | 363 |
| 364 if (HasSuggestions()) { | 364 if (HasSuggestions()) { |
| 365 delegate_->ClearPreviewedForm(); | 365 delegate_->ClearPreviewedForm(); |
| 366 OnSuggestionsChanged(); | 366 OnSuggestionsChanged(); |
| 367 } else { | 367 } else { |
| 368 Hide(); | 368 Hide(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 return true; | 371 return true; |
| 372 } | 372 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // Don't clear view_, because otherwise the popup will have to get regenerated | 512 // Don't clear view_, because otherwise the popup will have to get regenerated |
| 513 // and this will cause flickering. | 513 // and this will cause flickering. |
| 514 suggestions_.clear(); | 514 suggestions_.clear(); |
| 515 elided_values_.clear(); | 515 elided_values_.clear(); |
| 516 elided_labels_.clear(); | 516 elided_labels_.clear(); |
| 517 | 517 |
| 518 selected_line_.reset(); | 518 selected_line_.reset(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 } // namespace autofill | 521 } // namespace autofill |
| OLD | NEW |