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

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

Issue 2727233003: Uses child views in Autofill Popup so we can trigger (Closed)
Patch Set: Removes static_cast to AutofillPopupChildView and class name check. 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
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"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/optional.h"
13 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "chrome/browser/ui/autofill/autofill_popup_view.h" 16 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
16 #include "components/autofill/core/browser/autofill_popup_delegate.h" 17 #include "components/autofill/core/browser/autofill_popup_delegate.h"
17 #include "components/autofill/core/browser/popup_item_ids.h" 18 #include "components/autofill/core/browser/popup_item_ids.h"
18 #include "components/autofill/core/browser/suggestion.h" 19 #include "components/autofill/core/browser/suggestion.h"
19 #include "content/public/browser/native_web_keyboard_event.h" 20 #include "content/public/browser/native_web_keyboard_event.h"
20 #include "ui/events/event.h" 21 #include "ui/events/event.h"
21 #include "ui/gfx/canvas.h" 22 #include "ui/gfx/canvas.h"
22 #include "ui/gfx/text_elider.h" 23 #include "ui/gfx/text_elider.h"
23 #include "ui/gfx/text_utils.h" 24 #include "ui/gfx/text_utils.h"
24 25
25 using base::WeakPtr; 26 using base::WeakPtr;
26 27
27 namespace autofill { 28 namespace autofill {
28 namespace {
29
30 // Used to indicate that no line is currently selected by the user.
31 const int kNoSelection = -1;
32
33 } // namespace
34 29
35 // static 30 // static
36 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetOrCreate( 31 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetOrCreate(
37 WeakPtr<AutofillPopupControllerImpl> previous, 32 WeakPtr<AutofillPopupControllerImpl> previous,
38 WeakPtr<AutofillPopupDelegate> delegate, 33 WeakPtr<AutofillPopupDelegate> delegate,
39 content::WebContents* web_contents, 34 content::WebContents* web_contents,
40 gfx::NativeView container_view, 35 gfx::NativeView container_view,
41 const gfx::RectF& element_bounds, 36 const gfx::RectF& element_bounds,
42 base::i18n::TextDirection text_direction) { 37 base::i18n::TextDirection text_direction) {
43 if (previous.get() && previous->web_contents() == web_contents && 38 if (previous.get() && previous->web_contents() == web_contents &&
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Elide the name and label strings so that the popup fits in the available 102 // Elide the name and label strings so that the popup fits in the available
108 // space. 103 // space.
109 for (size_t i = 0; i < suggestions_.size(); ++i) { 104 for (size_t i = 0; i < suggestions_.size(); ++i) {
110 bool has_label = !suggestions_[i].label.empty(); 105 bool has_label = !suggestions_[i].label.empty();
111 ElideValueAndLabelForRow( 106 ElideValueAndLabelForRow(
112 i, layout_model_.GetAvailableWidthForRow(i, has_label)); 107 i, layout_model_.GetAvailableWidthForRow(i, has_label));
113 } 108 }
114 #endif 109 #endif
115 110
116 if (just_created) { 111 if (just_created) {
117 ShowView(); 112 view_->Show();
118 } else { 113 } else {
119 UpdateBoundsAndRedrawPopup(); 114 OnSuggestionsChanged();
120 } 115 }
121 116
122 controller_common_->RegisterKeyPressCallback(); 117 controller_common_->RegisterKeyPressCallback();
123 delegate_->OnPopupShown(); 118 delegate_->OnPopupShown();
124 119
125 DCHECK_EQ(suggestions_.size(), elided_values_.size()); 120 DCHECK_EQ(suggestions_.size(), elided_values_.size());
126 DCHECK_EQ(suggestions_.size(), elided_labels_.size()); 121 DCHECK_EQ(suggestions_.size(), elided_labels_.size());
127 } 122 }
128 123
129 void AutofillPopupControllerImpl::UpdateDataListValues( 124 void AutofillPopupControllerImpl::UpdateDataListValues(
(...skipping 16 matching lines...) Expand all
146 if (values.empty()) { 141 if (values.empty()) {
147 if (!suggestions_.empty() && 142 if (!suggestions_.empty() &&
148 suggestions_[0].frontend_id == POPUP_ITEM_ID_SEPARATOR) { 143 suggestions_[0].frontend_id == POPUP_ITEM_ID_SEPARATOR) {
149 suggestions_.erase(suggestions_.begin()); 144 suggestions_.erase(suggestions_.begin());
150 elided_values_.erase(elided_values_.begin()); 145 elided_values_.erase(elided_values_.begin());
151 elided_labels_.erase(elided_labels_.begin()); 146 elided_labels_.erase(elided_labels_.begin());
152 } 147 }
153 148
154 // The popup contents have changed, so either update the bounds or hide it. 149 // The popup contents have changed, so either update the bounds or hide it.
155 if (HasSuggestions()) 150 if (HasSuggestions())
156 UpdateBoundsAndRedrawPopup(); 151 OnSuggestionsChanged();
157 else 152 else
158 Hide(); 153 Hide();
159 154
160 return; 155 return;
161 } 156 }
162 157
163 // Add a separator if there are any other values. 158 // Add a separator if there are any other values.
164 if (!suggestions_.empty() && 159 if (!suggestions_.empty() &&
165 suggestions_[0].frontend_id != POPUP_ITEM_ID_SEPARATOR) { 160 suggestions_[0].frontend_id != POPUP_ITEM_ID_SEPARATOR) {
166 suggestions_.insert(suggestions_.begin(), autofill::Suggestion()); 161 suggestions_.insert(suggestions_.begin(), autofill::Suggestion());
(...skipping 11 matching lines...) Expand all
178 for (size_t i = 0; i < values.size(); i++) { 173 for (size_t i = 0; i < values.size(); i++) {
179 suggestions_[i].value = values[i]; 174 suggestions_[i].value = values[i];
180 suggestions_[i].label = labels[i]; 175 suggestions_[i].label = labels[i];
181 suggestions_[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY; 176 suggestions_[i].frontend_id = POPUP_ITEM_ID_DATALIST_ENTRY;
182 177
183 // TODO(brettw) it looks like these should be elided. 178 // TODO(brettw) it looks like these should be elided.
184 elided_values_[i] = values[i]; 179 elided_values_[i] = values[i];
185 elided_labels_[i] = labels[i]; 180 elided_labels_[i] = labels[i];
186 } 181 }
187 182
188 UpdateBoundsAndRedrawPopup(); 183 OnSuggestionsChanged();
189 DCHECK_EQ(suggestions_.size(), elided_values_.size()); 184 DCHECK_EQ(suggestions_.size(), elided_values_.size());
190 DCHECK_EQ(suggestions_.size(), elided_labels_.size()); 185 DCHECK_EQ(suggestions_.size(), elided_labels_.size());
191 } 186 }
192 187
193 void AutofillPopupControllerImpl::Hide() { 188 void AutofillPopupControllerImpl::Hide() {
194 controller_common_->RemoveKeyPressCallback(); 189 controller_common_->RemoveKeyPressCallback();
195 if (delegate_) 190 if (delegate_)
196 delegate_->OnPopupHidden(); 191 delegate_->OnPopupHidden();
197 192
198 if (view_) 193 if (view_)
(...skipping 14 matching lines...) Expand all
213 switch (event.windowsKeyCode) { 208 switch (event.windowsKeyCode) {
214 case ui::VKEY_UP: 209 case ui::VKEY_UP:
215 SelectPreviousLine(); 210 SelectPreviousLine();
216 return true; 211 return true;
217 case ui::VKEY_DOWN: 212 case ui::VKEY_DOWN:
218 SelectNextLine(); 213 SelectNextLine();
219 return true; 214 return true;
220 case ui::VKEY_PRIOR: // Page up. 215 case ui::VKEY_PRIOR: // Page up.
221 // Set no line and then select the next line in case the first line is not 216 // Set no line and then select the next line in case the first line is not
222 // selectable. 217 // selectable.
223 SetSelectedLine(kNoSelection); 218 SetSelectedLine(base::nullopt);
224 SelectNextLine(); 219 SelectNextLine();
225 return true; 220 return true;
226 case ui::VKEY_NEXT: // Page down. 221 case ui::VKEY_NEXT: // Page down.
227 SetSelectedLine(GetLineCount() - 1); 222 SetSelectedLine(GetLineCount() - 1);
228 return true; 223 return true;
229 case ui::VKEY_ESCAPE: 224 case ui::VKEY_ESCAPE:
230 Hide(); 225 Hide();
231 return true; 226 return true;
232 case ui::VKEY_DELETE: 227 case ui::VKEY_DELETE:
233 return (event.modifiers() & content::NativeWebKeyboardEvent::ShiftKey) && 228 return (event.modifiers() & content::NativeWebKeyboardEvent::ShiftKey) &&
234 RemoveSelectedLine(); 229 RemoveSelectedLine();
235 case ui::VKEY_TAB: 230 case ui::VKEY_TAB:
236 // A tab press should cause the selected line to be accepted, but still 231 // A tab press should cause the selected line to be accepted, but still
237 // return false so the tab key press propagates and changes the cursor 232 // return false so the tab key press propagates and changes the cursor
238 // location. 233 // location.
239 AcceptSelectedLine(); 234 AcceptSelectedLine();
240 return false; 235 return false;
241 case ui::VKEY_RETURN: 236 case ui::VKEY_RETURN:
242 return AcceptSelectedLine(); 237 return AcceptSelectedLine();
243 default: 238 default:
244 return false; 239 return false;
245 } 240 }
246 } 241 }
247 242
248 void AutofillPopupControllerImpl::UpdateBoundsAndRedrawPopup() { 243 void AutofillPopupControllerImpl::OnSuggestionsChanged() {
249 #if !defined(OS_ANDROID) 244 #if !defined(OS_ANDROID)
250 // TODO(csharp): Since UpdatePopupBounds can change the position of the popup, 245 // TODO(csharp): Since UpdatePopupBounds can change the position of the popup,
251 // the popup could end up jumping from above the element to below it. 246 // the popup could end up jumping from above the element to below it.
252 // It is unclear if it is better to keep the popup where it was, or if it 247 // It is unclear if it is better to keep the popup where it was, or if it
253 // should try and move to its desired position. 248 // should try and move to its desired position.
254 layout_model_.UpdatePopupBounds(); 249 layout_model_.UpdatePopupBounds();
255 #endif 250 #endif
256 251
257 // Platform-specific draw call. 252 // Platform-specific draw call.
258 view_->UpdateBoundsAndRedrawPopup(); 253 view_->OnSuggestionsChanged();
259 } 254 }
260 255
261 void AutofillPopupControllerImpl::SetSelectionAtPoint(const gfx::Point& point) { 256 void AutofillPopupControllerImpl::SetSelectionAtPoint(const gfx::Point& point) {
262 SetSelectedLine(layout_model_.LineFromY(point.y())); 257 SetSelectedLine(layout_model_.LineFromY(point.y()));
263 } 258 }
264 259
265 bool AutofillPopupControllerImpl::AcceptSelectedLine() { 260 bool AutofillPopupControllerImpl::AcceptSelectedLine() {
266 if (selected_line_ == kNoSelection) 261 if (!selected_line_)
267 return false; 262 return false;
268 263
269 DCHECK_GE(selected_line_, 0); 264 DCHECK_LT(*selected_line_, GetLineCount());
270 DCHECK_LT(selected_line_, static_cast<int>(GetLineCount()));
271 265
272 if (!CanAccept(suggestions_[selected_line_].frontend_id)) 266 if (!CanAccept(suggestions_[*selected_line_].frontend_id))
273 return false; 267 return false;
274 268
275 AcceptSuggestion(selected_line_); 269 AcceptSuggestion(*selected_line_);
276 return true; 270 return true;
277 } 271 }
278 272
279 void AutofillPopupControllerImpl::SelectionCleared() { 273 void AutofillPopupControllerImpl::SelectionCleared() {
280 SetSelectedLine(kNoSelection); 274 SetSelectedLine(base::nullopt);
281 } 275 }
282 276
283 void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) { 277 void AutofillPopupControllerImpl::AcceptSuggestion(size_t index) {
284 const autofill::Suggestion& suggestion = suggestions_[index]; 278 const autofill::Suggestion& suggestion = suggestions_[index];
285 delegate_->DidAcceptSuggestion(suggestion.value, suggestion.frontend_id, 279 delegate_->DidAcceptSuggestion(suggestion.value, suggestion.frontend_id,
286 index); 280 index);
287 } 281 }
288 282
289 gfx::Rect AutofillPopupControllerImpl::popup_bounds() const { 283 gfx::Rect AutofillPopupControllerImpl::popup_bounds() const {
290 return layout_model_.popup_bounds(); 284 return layout_model_.popup_bounds();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (!delegate_->RemoveSuggestion(suggestions_[list_index].value, 349 if (!delegate_->RemoveSuggestion(suggestions_[list_index].value,
356 suggestions_[list_index].frontend_id)) { 350 suggestions_[list_index].frontend_id)) {
357 return false; 351 return false;
358 } 352 }
359 353
360 // Remove the deleted element. 354 // Remove the deleted element.
361 suggestions_.erase(suggestions_.begin() + list_index); 355 suggestions_.erase(suggestions_.begin() + list_index);
362 elided_values_.erase(elided_values_.begin() + list_index); 356 elided_values_.erase(elided_values_.begin() + list_index);
363 elided_labels_.erase(elided_labels_.begin() + list_index); 357 elided_labels_.erase(elided_labels_.begin() + list_index);
364 358
365 SetSelectedLine(kNoSelection); 359 SetSelectedLine(base::nullopt);
366 360
367 if (HasSuggestions()) { 361 if (HasSuggestions()) {
368 delegate_->ClearPreviewedForm(); 362 delegate_->ClearPreviewedForm();
369 UpdateBoundsAndRedrawPopup(); 363 OnSuggestionsChanged();
370 } else { 364 } else {
371 Hide(); 365 Hide();
372 } 366 }
373 367
374 return true; 368 return true;
375 } 369 }
376 370
377 ui::NativeTheme::ColorId 371 ui::NativeTheme::ColorId
378 AutofillPopupControllerImpl::GetBackgroundColorIDForRow(int index) const { 372 AutofillPopupControllerImpl::GetBackgroundColorIDForRow(int index) const {
379 return index == selected_line_ ? 373 return selected_line_ && index == static_cast<int>(*selected_line_)
380 ui::NativeTheme::kColorId_ResultsTableHoveredBackground : 374 ? ui::NativeTheme::kColorId_ResultsTableHoveredBackground
381 ui::NativeTheme::kColorId_ResultsTableNormalBackground; 375 : ui::NativeTheme::kColorId_ResultsTableNormalBackground;
382 } 376 }
383 377
384 int AutofillPopupControllerImpl::selected_line() const { 378 base::Optional<size_t> AutofillPopupControllerImpl::selected_line() const {
385 return selected_line_; 379 return selected_line_;
386 } 380 }
387 381
388 const AutofillPopupLayoutModel& AutofillPopupControllerImpl::layout_model() 382 const AutofillPopupLayoutModel& AutofillPopupControllerImpl::layout_model()
389 const { 383 const {
390 return layout_model_; 384 return layout_model_;
391 } 385 }
392 386
393 void AutofillPopupControllerImpl::SetSelectedLine(int selected_line) { 387 void AutofillPopupControllerImpl::SetSelectedLine(
388 base::Optional<size_t> selected_line) {
394 if (selected_line_ == selected_line) 389 if (selected_line_ == selected_line)
395 return; 390 return;
396 391
397 if (selected_line_ != kNoSelection && 392 if (selected_line) {
398 static_cast<size_t>(selected_line_) < suggestions_.size()) 393 DCHECK_LT(*selected_line, suggestions_.size());
399 InvalidateRow(selected_line_); 394 if (!CanAccept(suggestions_[*selected_line].frontend_id))
400 395 selected_line = base::nullopt;
401 if (selected_line != kNoSelection) {
402 InvalidateRow(selected_line);
403
404 if (!CanAccept(suggestions_[selected_line].frontend_id))
405 selected_line = kNoSelection;
406 } 396 }
407 397
398 const base::Optional<size_t> previous_selected_line(selected_line_);
Evan Stade 2017/03/17 19:08:54 auto previous_selected_line = selected_line_;
408 selected_line_ = selected_line; 399 selected_line_ = selected_line;
400 view_->OnSelectedRowChanged(previous_selected_line, selected_line_);
409 401
410 if (selected_line_ != kNoSelection) { 402 if (selected_line_) {
411 delegate_->DidSelectSuggestion(suggestions_[selected_line_].value, 403 delegate_->DidSelectSuggestion(suggestions_[*selected_line_].value,
412 suggestions_[selected_line_].frontend_id); 404 suggestions_[*selected_line_].frontend_id);
413 } else { 405 } else {
414 delegate_->ClearPreviewedForm(); 406 delegate_->ClearPreviewedForm();
415 } 407 }
416 } 408 }
417 409
418 void AutofillPopupControllerImpl::SelectNextLine() { 410 void AutofillPopupControllerImpl::SelectNextLine() {
419 int new_selected_line = selected_line_ + 1; 411 size_t new_selected_line = selected_line_ ? *selected_line_ + 1 : 0;
420 412
421 // Skip over any lines that can't be selected. 413 // Skip over any lines that can't be selected.
422 while (static_cast<size_t>(new_selected_line) < GetLineCount() && 414 while (new_selected_line < GetLineCount() &&
423 !CanAccept(suggestions_[new_selected_line].frontend_id)) { 415 !CanAccept(suggestions_[new_selected_line].frontend_id)) {
424 ++new_selected_line; 416 ++new_selected_line;
425 } 417 }
426 418
427 if (new_selected_line >= static_cast<int>(GetLineCount())) 419 if (new_selected_line >= GetLineCount())
428 new_selected_line = 0; 420 new_selected_line = 0;
429 421
430 SetSelectedLine(new_selected_line); 422 SetSelectedLine(new_selected_line);
431 } 423 }
432 424
433 void AutofillPopupControllerImpl::SelectPreviousLine() { 425 void AutofillPopupControllerImpl::SelectPreviousLine() {
434 int new_selected_line = selected_line_ - 1; 426 int new_selected_line;
427 if (selected_line_) {
428 new_selected_line = *selected_line_ - 1;
435 429
436 // Skip over any lines that can't be selected. 430 // Skip over any lines that can't be selected.
437 while (new_selected_line > kNoSelection && 431 while (new_selected_line >= 0 &&
438 !CanAccept(GetSuggestionAt(new_selected_line).frontend_id)) { 432 !CanAccept(GetSuggestionAt(new_selected_line).frontend_id)) {
439 --new_selected_line; 433 --new_selected_line;
434 }
435
436 if (new_selected_line < 0)
437 new_selected_line = GetLineCount() - 1;
438 } else {
439 new_selected_line = GetLineCount() - 1;
440 } 440 }
441 441
442 if (new_selected_line <= kNoSelection)
443 new_selected_line = GetLineCount() - 1;
444
445 SetSelectedLine(new_selected_line); 442 SetSelectedLine(new_selected_line);
446 } 443 }
447 444
448 bool AutofillPopupControllerImpl::RemoveSelectedLine() { 445 bool AutofillPopupControllerImpl::RemoveSelectedLine() {
449 if (selected_line_ == kNoSelection) 446 if (!selected_line_)
450 return false; 447 return false;
451 448
452 DCHECK_GE(selected_line_, 0); 449 DCHECK_LT(*selected_line_, GetLineCount());
453 DCHECK_LT(selected_line_, static_cast<int>(GetLineCount())); 450 return RemoveSuggestion(*selected_line_);
454 return RemoveSuggestion(selected_line_);
455 } 451 }
456 452
457 bool AutofillPopupControllerImpl::CanAccept(int id) { 453 bool AutofillPopupControllerImpl::CanAccept(int id) {
458 return id != POPUP_ITEM_ID_SEPARATOR && 454 return id != POPUP_ITEM_ID_SEPARATOR &&
459 id != POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE && 455 id != POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE &&
460 id != POPUP_ITEM_ID_TITLE; 456 id != POPUP_ITEM_ID_TITLE;
461 } 457 }
462 458
463 bool AutofillPopupControllerImpl::HasSuggestions() { 459 bool AutofillPopupControllerImpl::HasSuggestions() {
464 if (suggestions_.empty()) 460 if (suggestions_.empty())
(...skipping 10 matching lines...) Expand all
475 const std::vector<autofill::Suggestion>& suggestions) { 471 const std::vector<autofill::Suggestion>& suggestions) {
476 suggestions_ = suggestions; 472 suggestions_ = suggestions;
477 elided_values_.resize(suggestions.size()); 473 elided_values_.resize(suggestions.size());
478 elided_labels_.resize(suggestions.size()); 474 elided_labels_.resize(suggestions.size());
479 for (size_t i = 0; i < suggestions.size(); i++) { 475 for (size_t i = 0; i < suggestions.size(); i++) {
480 elided_values_[i] = suggestions[i].value; 476 elided_values_[i] = suggestions[i].value;
481 elided_labels_[i] = suggestions[i].label; 477 elided_labels_[i] = suggestions[i].label;
482 } 478 }
483 } 479 }
484 480
485 void AutofillPopupControllerImpl::ShowView() {
486 view_->Show();
487 }
488
489 void AutofillPopupControllerImpl::InvalidateRow(size_t row) {
490 DCHECK(0 <= row);
491 DCHECK(row < suggestions_.size());
492 view_->InvalidateRow(row);
493 }
494
495 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetWeakPtr() { 481 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetWeakPtr() {
496 return weak_ptr_factory_.GetWeakPtr(); 482 return weak_ptr_factory_.GetWeakPtr();
497 } 483 }
498 484
499 #if !defined(OS_ANDROID) 485 #if !defined(OS_ANDROID)
500 void AutofillPopupControllerImpl::ElideValueAndLabelForRow( 486 void AutofillPopupControllerImpl::ElideValueAndLabelForRow(
501 size_t row, 487 size_t row,
502 int available_width) { 488 int available_width) {
503 int value_width = gfx::GetStringWidth( 489 int value_width = gfx::GetStringWidth(
504 suggestions_[row].value, layout_model_.GetValueFontListForRow(row)); 490 suggestions_[row].value, layout_model_.GetValueFontListForRow(row));
(...skipping 19 matching lines...) Expand all
524 } 510 }
525 #endif 511 #endif
526 512
527 void AutofillPopupControllerImpl::ClearState() { 513 void AutofillPopupControllerImpl::ClearState() {
528 // Don't clear view_, because otherwise the popup will have to get regenerated 514 // Don't clear view_, because otherwise the popup will have to get regenerated
529 // and this will cause flickering. 515 // and this will cause flickering.
530 suggestions_.clear(); 516 suggestions_.clear();
531 elided_values_.clear(); 517 elided_values_.clear();
532 elided_labels_.clear(); 518 elided_labels_.clear();
533 519
534 selected_line_ = kNoSelection; 520 selected_line_.reset();
535 } 521 }
536 522
537 } // namespace autofill 523 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698