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

Unified Diff: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc

Issue 2498503002: Http Bad: Add icons to the http warning message (Closed)
Patch Set: rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
index b3ce678f84b03b47d62cb491a4ef1fa3a95eec14..44cb516869e0c3c887a38410464d108fc1485350 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/ui/autofill/popup_constants.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/point.h"
@@ -90,22 +89,19 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
: entry_rect.right() - AutofillPopupLayoutModel::kEndPadding;
// Draw the Autofill icon, if one exists
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
int row_height = controller_->layout_model().GetRowBounds(index).height();
if (!controller_->GetSuggestionAt(index).icon.empty()) {
- int icon = controller_->layout_model().GetIconResourceID(
- controller_->GetSuggestionAt(index).icon);
- DCHECK_NE(-1, icon);
- const gfx::ImageSkia* image = rb.GetImageSkiaNamed(icon);
- int icon_y = entry_rect.y() + (row_height - image->height()) / 2;
+ const gfx::ImageSkia image =
+ controller_->layout_model().GetIconImage(index);
+ int icon_y = entry_rect.y() + (row_height - image.height()) / 2;
- x_align_left += is_rtl ? 0 : -image->width();
+ x_align_left += is_rtl ? 0 : -image.width();
- canvas->DrawImageInt(*image, x_align_left, icon_y);
+ canvas->DrawImageInt(image, x_align_left, icon_y);
- x_align_left +=
- is_rtl ? image->width() + AutofillPopupLayoutModel::kIconPadding
- : -AutofillPopupLayoutModel::kIconPadding;
+ x_align_left += is_rtl
+ ? image.width() + AutofillPopupLayoutModel::kIconPadding
+ : -AutofillPopupLayoutModel::kIconPadding;
}
// Draw the label text.
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_layout_model.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698