diff options
author | tapted <tapted@chromium.org> | 2015-07-25 02:27:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-25 09:28:58 +0000 |
commit | 671838ecb0fdbd27a1f501b91146d0834101b7fe (patch) | |
tree | 4108525094dc673ffd691770afd20e1ef1d0769c /ash/system/chromeos/session/logout_button_tray.cc | |
parent | bb47f88b41de78fd6e9ba21c09e8597bbe3f9a06 (diff) | |
download | chromium_src-671838ecb0fdbd27a1f501b91146d0834101b7fe.zip chromium_src-671838ecb0fdbd27a1f501b91146d0834101b7fe.tar.gz chromium_src-671838ecb0fdbd27a1f501b91146d0834101b7fe.tar.bz2 |
MacViews: Use Mac's "Constrained Window Button" style for Button::STYLE_BUTTON LabelButtons
STYLE_BUTTON is typically the button used for dialog buttons
(OK/Cancel/etc.). On Chrome Mac, dialogs have switched from Cocoa
buttons to a "Constrained Window" button style. This is a button with a
gradient and lots of shadows. Use it as the default dialog button style
for MacViews, by porting the current Quartz implementation to Skia.
To integrate into toolkit-views, the approach is similar to how
libgtk2ui::Gtk2Border is used for LabelButtons on Linux Aura. However,
unlike Gtk2Border, we don't want to replace the asset-based `BlueButton`
style with a themed style. (On Mac, the `BlueLabelButton` currently used
for Cocoa dialgos is a port of the toolkit-views BlueButton).
Introduce ui/views/style/platform_style.h. Currently with:
CreateLabelButtonBorder(ButtonStyle) -> LabelButtonBorder
CreateThemedLabelButtonBorder(LabelButton*) -> Border
The first provides the default style as a LabelButtonBorder, which
subclasses of LabelButton can use to customize border insets.
The second provides a way for Gtk2Border to entirely re-theme the button
border provided by a subclass, the way it currently does for BlueButton.
Then, since LabelButtonBorder can paint either with assets or vector
drawing routines, a subclass `LabelButtonAssetBorder` is added to
encapsulate borders drawn with assets.
Screenshots at http://crbug.com/506150#c3
BUG=506150
Review URL: https://codereview.chromium.org/1217163002
Cr-Commit-Position: refs/heads/master@{#340407}
Diffstat (limited to 'ash/system/chromeos/session/logout_button_tray.cc')
-rw-r--r-- | ash/system/chromeos/session/logout_button_tray.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ash/system/chromeos/session/logout_button_tray.cc b/ash/system/chromeos/session/logout_button_tray.cc index 084af0a..1b7addc 100644 --- a/ash/system/chromeos/session/logout_button_tray.cc +++ b/ash/system/chromeos/session/logout_button_tray.cc @@ -71,8 +71,8 @@ LogoutButton::LogoutButton(views::ButtonListener* listener) for (size_t state = 0; state < views::Button::STATE_COUNT; ++state) SetTextColor(static_cast<views::Button::ButtonState>(state), SK_ColorWHITE); - scoped_ptr<views::LabelButtonBorder> border( - new views::LabelButtonBorder(views::Button::STYLE_TEXTBUTTON)); + scoped_ptr<views::LabelButtonAssetBorder> border( + new views::LabelButtonAssetBorder(views::Button::STYLE_TEXTBUTTON)); border->SetPainter(false, views::Button::STATE_NORMAL, views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); border->SetPainter(false, views::Button::STATE_HOVERED, |