Commit 1d5a4c80 authored by danakj's avatar danakj Committed by Commit bot

views: Make the LogoutButton not visible instead of early out in Paint

The button is still used for layout, the size of the user name text
remains resized according to the button, but this way we don't have
to override the Paint() function which helps us make Paint() no longer
virtual.

R=pkotwicz, skuhne,sky
BUG=466426

Review URL: https://codereview.chromium.org/1037443003

Cr-Commit-Position: refs/heads/master@{#322093}
parent c99c9384
......@@ -89,18 +89,12 @@ class LogoutButton : public TrayPopupLabelButton {
const base::string16& text,
bool placeholder)
: TrayPopupLabelButton(listener, text), placeholder_(placeholder) {
SetEnabled(!placeholder_);
SetVisible(!placeholder_);
}
~LogoutButton() override {}
private:
void Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) override {
// Just skip paint if this button used as a placeholder.
if (!placeholder_)
TrayPopupLabelButton::Paint(canvas, cull_set);
}
bool placeholder_;
DISALLOW_COPY_AND_ASSIGN(LogoutButton);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment