| 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/views/autofill/autofill_popup_view_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_popup_view_views.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 7 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
| 8 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" | 8 #include "chrome/browser/ui/autofill/autofill_popup_layout_model.h" |
| 9 #include "chrome/browser/ui/autofill/popup_constants.h" | 9 #include "chrome/browser/ui/autofill/popup_constants.h" |
| 10 #include "components/autofill/core/browser/popup_item_ids.h" | 10 #include "components/autofill/core/browser/popup_item_ids.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 canvas->FillRect(entry_rect, controller_->GetBackgroundColorForRow(index)); | 74 canvas->FillRect(entry_rect, controller_->GetBackgroundColorForRow(index)); |
| 75 | 75 |
| 76 const bool is_rtl = controller_->IsRTL(); | 76 const bool is_rtl = controller_->IsRTL(); |
| 77 const int text_align = | 77 const int text_align = |
| 78 is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT; | 78 is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT; |
| 79 gfx::Rect value_rect = entry_rect; | 79 gfx::Rect value_rect = entry_rect; |
| 80 value_rect.Inset(AutofillPopupLayoutModel::kEndPadding, 0); | 80 value_rect.Inset(AutofillPopupLayoutModel::kEndPadding, 0); |
| 81 canvas->DrawStringRectWithFlags( | 81 canvas->DrawStringRectWithFlags( |
| 82 controller_->GetElidedValueAt(index), | 82 controller_->GetElidedValueAt(index), |
| 83 controller_->layout_model().GetValueFontListForRow(index), | 83 controller_->layout_model().GetValueFontListForRow(index), |
| 84 controller_->IsWarning(index) ? kWarningTextColor : kValueTextColor, | 84 controller_->IsWarning(index) ? kLabelTextColor : kValueTextColor, |
| 85 value_rect, text_align); | 85 value_rect, text_align); |
| 86 | 86 |
| 87 // Use this to figure out where all the other Autofill items should be placed. | 87 // Use this to figure out where all the other Autofill items should be placed. |
| 88 int x_align_left = | 88 int x_align_left = |
| 89 is_rtl ? AutofillPopupLayoutModel::kEndPadding | 89 is_rtl ? AutofillPopupLayoutModel::kEndPadding |
| 90 : entry_rect.right() - AutofillPopupLayoutModel::kEndPadding; | 90 : entry_rect.right() - AutofillPopupLayoutModel::kEndPadding; |
| 91 | 91 |
| 92 // Draw the Autofill icon, if one exists | 92 // Draw the Autofill icon, if one exists |
| 93 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 93 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 94 int row_height = controller_->layout_model().GetRowBounds(index).height(); | 94 int row_height = controller_->layout_model().GetRowBounds(index).height(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 // If the top level widget can't be found, cancel the popup since we can't | 131 // If the top level widget can't be found, cancel the popup since we can't |
| 132 // fully set it up. | 132 // fully set it up. |
| 133 if (!observing_widget) | 133 if (!observing_widget) |
| 134 return NULL; | 134 return NULL; |
| 135 | 135 |
| 136 return new AutofillPopupViewViews(controller, observing_widget); | 136 return new AutofillPopupViewViews(controller, observing_widget); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace autofill | 139 } // namespace autofill |
| OLD | NEW |