summaryrefslogtreecommitdiffstats
path: root/ash/system
diff options
context:
space:
mode:
authortapted <tapted@chromium.org>2015-07-25 02:27:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-25 09:28:58 +0000
commit671838ecb0fdbd27a1f501b91146d0834101b7fe (patch)
tree4108525094dc673ffd691770afd20e1ef1d0769c /ash/system
parentbb47f88b41de78fd6e9ba21c09e8597bbe3f9a06 (diff)
downloadchromium_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')
-rw-r--r--ash/system/chromeos/session/logout_button_tray.cc4
-rw-r--r--ash/system/tray/tray_popup_label_button_border.cc2
-rw-r--r--ash/system/tray/tray_popup_label_button_border.h2
3 files changed, 4 insertions, 4 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,
diff --git a/ash/system/tray/tray_popup_label_button_border.cc b/ash/system/tray/tray_popup_label_button_border.cc
index bcbf39f..693fce1 100644
--- a/ash/system/tray/tray_popup_label_button_border.cc
+++ b/ash/system/tray/tray_popup_label_button_border.cc
@@ -15,7 +15,7 @@
namespace ash {
TrayPopupLabelButtonBorder::TrayPopupLabelButtonBorder()
- : LabelButtonBorder(views::Button::STYLE_TEXTBUTTON) {
+ : LabelButtonAssetBorder(views::Button::STYLE_TEXTBUTTON) {
const int kTrayPopupLabelButtonBorderImagesNormal[] = {
IDR_AURA_TRAY_POPUP_LABEL_BUTTON_BORDER,
IDR_AURA_TRAY_POPUP_LABEL_BUTTON_NORMAL_BACKGROUND,
diff --git a/ash/system/tray/tray_popup_label_button_border.h b/ash/system/tray/tray_popup_label_button_border.h
index bb06444..1afca11 100644
--- a/ash/system/tray/tray_popup_label_button_border.h
+++ b/ash/system/tray/tray_popup_label_button_border.h
@@ -13,7 +13,7 @@ namespace ash {
// A border for label buttons that paints a vertical separator in normal state
// and a custom hover effect in hovered or pressed state.
-class TrayPopupLabelButtonBorder : public views::LabelButtonBorder {
+class TrayPopupLabelButtonBorder : public views::LabelButtonAssetBorder {
public:
TrayPopupLabelButtonBorder();
~TrayPopupLabelButtonBorder() override;