| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } else { | 375 } else { |
| 376 Hide(); | 376 Hide(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 return true; | 379 return true; |
| 380 } | 380 } |
| 381 | 381 |
| 382 SkColor AutofillPopupControllerImpl::GetBackgroundColorForRow(int index) const { | 382 SkColor AutofillPopupControllerImpl::GetBackgroundColorForRow(int index) const { |
| 383 if (index == selected_line_) | 383 if (index == selected_line_) |
| 384 return kHoveredBackgroundColor; | 384 return kHoveredBackgroundColor; |
| 385 if (suggestions_[index].frontend_id == | |
| 386 POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) { | |
| 387 return kPromoPopupBackground; | |
| 388 } | |
| 389 | 385 |
| 390 return SK_ColorTRANSPARENT; | 386 return SK_ColorTRANSPARENT; |
| 391 } | 387 } |
| 392 | 388 |
| 393 int AutofillPopupControllerImpl::selected_line() const { | 389 int AutofillPopupControllerImpl::selected_line() const { |
| 394 return selected_line_; | 390 return selected_line_; |
| 395 } | 391 } |
| 396 | 392 |
| 397 const AutofillPopupLayoutModel& AutofillPopupControllerImpl::layout_model() | 393 const AutofillPopupLayoutModel& AutofillPopupControllerImpl::layout_model() |
| 398 const { | 394 const { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 // Don't clear view_, because otherwise the popup will have to get regenerated | 532 // Don't clear view_, because otherwise the popup will have to get regenerated |
| 537 // and this will cause flickering. | 533 // and this will cause flickering. |
| 538 suggestions_.clear(); | 534 suggestions_.clear(); |
| 539 elided_values_.clear(); | 535 elided_values_.clear(); |
| 540 elided_labels_.clear(); | 536 elided_labels_.clear(); |
| 541 | 537 |
| 542 selected_line_ = kNoSelection; | 538 selected_line_ = kNoSelection; |
| 543 } | 539 } |
| 544 | 540 |
| 545 } // namespace autofill | 541 } // namespace autofill |
| OLD | NEW |