Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 2766263007: Verify that previous_selected_line is within bounds before passing to (Closed)
Patch Set: Removes extra newline. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698