MacViews: Use Mac's "Constrained Window Button" style for Button::STYLE_BUTTON LabelB...
commit671838ecb0fdbd27a1f501b91146d0834101b7fe
authortapted <tapted@chromium.org>
Sat, 25 Jul 2015 09:27:54 +0000 (25 02:27 -0700)
committerCommit bot <commit-bot@chromium.org>
Sat, 25 Jul 2015 09:28:58 +0000 (25 09:28 +0000)
tree4108525094dc673ffd691770afd20e1ef1d0769c
parentbb47f88b41de78fd6e9ba21c09e8597bbe3f9a06
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}
25 files changed:
ash/system/chromeos/session/logout_button_tray.cc
ash/system/tray/tray_popup_label_button_border.cc
ash/system/tray/tray_popup_label_button_border.h
chrome/browser/ui/libgtk2ui/gtk2_border.cc
chrome/browser/ui/views/infobars/infobar_view.cc
chrome/browser/ui/views/profiles/new_avatar_button.cc
chrome/browser/ui/views/profiles/profile_chooser_view.cc
chrome/browser/ui/views/toolbar/toolbar_button.cc
ui/message_center/views/notifier_settings_view.cc
ui/views/controls/button/blue_button.cc
ui/views/controls/button/blue_button_unittest.cc
ui/views/controls/button/checkbox.cc
ui/views/controls/button/label_button.cc
ui/views/controls/button/label_button.h
ui/views/controls/button/label_button_border.cc
ui/views/controls/button/label_button_border.h
ui/views/examples/button_example.cc
ui/views/style/mac/dialog_button_border_mac.cc [new file with mode: 0644]
ui/views/style/mac/dialog_button_border_mac.h [new file with mode: 0644]
ui/views/style/mac/dialog_button_border_mac_unittest.cc [new file with mode: 0644]
ui/views/style/platform_style.cc [new file with mode: 0644]
ui/views/style/platform_style.h [new file with mode: 0644]
ui/views/style/platform_style_linux.cc [new file with mode: 0644]
ui/views/style/platform_style_mac.cc [new file with mode: 0644]
ui/views/views.gyp