Index: ash/accelerators/exit_warning_handler.cc |
diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc |
index 7b8f3c5ac2a2cd4abffff98876e3ba5e3038df9f..f5d70abeb718b5f21f1204c3b0f536381bc9a9e0 100644 |
--- a/ash/accelerators/exit_warning_handler.cc |
+++ b/ash/accelerators/exit_warning_handler.cc |
@@ -45,15 +45,14 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { |
: text_(l10n_util::GetStringUTF16(IDS_ASH_SIGN_OUT_WARNING_POPUP_TEXT)), |
accessible_name_(l10n_util::GetStringUTF16( |
IDS_ASH_SIGN_OUT_WARNING_POPUP_TEXT_ACCESSIBLE)), |
- text_width_(0), |
- width_(0), |
- height_(0) { |
+ text_width_(0) { |
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
const gfx::FontList& font_list = |
rb.GetFontList(ui::ResourceBundle::LargeFont); |
text_width_ = gfx::GetStringWidth(text_, font_list); |
- width_ = text_width_ + kHorizontalMarginAroundText; |
- height_ = font_list.GetHeight() + kVerticalMarginAroundText; |
+ set_preferred_size( |
+ gfx::Size(text_width_ + kHorizontalMarginAroundText, |
+ font_list.GetHeight() + kVerticalMarginAroundText)); |
views::Label* label = new views::Label(); |
label->SetText(text_); |
label->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
@@ -66,10 +65,6 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { |
SetLayoutManager(new views::FillLayout); |
} |
- gfx::Size GetPreferredSize() const override { |
- return gfx::Size(width_, height_); |
- } |
- |
void OnPaint(gfx::Canvas* canvas) override { |
cc::PaintFlags flags; |
flags.setStyle(cc::PaintFlags::kFill_Style); |
@@ -87,8 +82,6 @@ class ExitWarningWidgetDelegateView : public views::WidgetDelegateView { |
base::string16 text_; |
base::string16 accessible_name_; |
int text_width_; |
- int width_; |
- int height_; |
DISALLOW_COPY_AND_ASSIGN(ExitWarningWidgetDelegateView); |
}; |