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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 152343006: Clean-up: Replaces obsolete Font/FontList methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index adb4e014b1422a84f74dc64ccaa02b60cd106aa5..5ddec2a4073db7effebfd44c6ec10fcf3ff98ed1 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -17,7 +17,7 @@
#include "content/public/browser/web_contents_view.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/canvas.h"
+#include "ui/gfx/text_utils.h"
#include "ui/views/controls/button/blue_button.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/grid_layout.h"
@@ -34,13 +34,13 @@ void UpdateBiggestWidth(const autofill::PasswordForm& password_form,
bool username,
int* biggest_width) {
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
- gfx::FontList font_list(rb->GetFontList(ui::ResourceBundle::BaseFont));
+ const gfx::FontList& font_list(rb->GetFontList(ui::ResourceBundle::BaseFont));
msw 2014/02/04 00:58:20 Isn't this equivalent to the FontList default ctor
Yuki 2014/02/04 03:03:07 Done.
base::string16 display_string(username ?
password_form.username_value :
ManagePasswordItemView::GetPasswordDisplayString(
password_form.password_value));
- *biggest_width = std::max(
- gfx::Canvas::GetStringWidth(display_string, font_list), *biggest_width);
+ *biggest_width = std::max(gfx::GetStringWidth(display_string, font_list),
+ *biggest_width);
}
} // namespace
@@ -165,7 +165,7 @@ void ManagePasswordsBubbleView::Init() {
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
const int predefined_username_field_max_width =
- rb->GetFont(ui::ResourceBundle::BaseFont).GetAverageCharacterWidth() * 22;
+ rb->GetFontList(ui::ResourceBundle::BaseFont).GetExpectedTextWidth(22);
const int max_username_or_password_width =
std::min(GetMaximumUsernameOrPasswordWidth(true),
predefined_username_field_max_width);

Powered by Google App Engine
This is Rietveld 408576698