Skip to content

Commit

Permalink
Revert "Add metadata to frame_caption_button"
Browse files Browse the repository at this point in the history
This reverts commit be6b472.

Reason for revert: introduced flaky timeouts in tests per crbug.com/1171778

Original change's description:
> Add metadata to frame_caption_button
>
> Bug: 1159562
> Change-Id: I0439e1f1d1956f5a7bccc165d47a02a16283050c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644347
> Commit-Queue: Elaine Chien <elainechien@chromium.org>
> Reviewed-by: James Cook <jamescook@chromium.org>
> Reviewed-by: Wei Li <weili@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#847957}

TBR=jamescook@chromium.org,sky@chromium.org,weili@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,elainechien@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1159562, 1171778
Change-Id: I81701de3e721960dc8952730b052db4b4cd4b83c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2659245
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#848767}
  • Loading branch information
kenrussell authored and Chromium LUCI CQ committed Jan 29, 2021
1 parent adb4adb commit 0b79b22
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 128 deletions.
66 changes: 28 additions & 38 deletions ash/frame/caption_buttons/frame_size_button_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ TEST_F(FrameSizeButtonTest, CancelSnapTest) {
// - The state of all the caption buttons is reset.
// - The icon displayed by all of the caption buttons is reset.
TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_TRUE(AllButtonsInNormalState());

// Pressing the size button should result in the size button being pressed and
Expand All @@ -341,21 +341,17 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->GetState());
EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->GetState());
EXPECT_EQ(views::Button::STATE_NORMAL, close_button()->GetState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());

// Dragging the mouse over the minimize button should hover the minimize
// button and the minimize and close button icons should stay changed.
generator->MoveMouseTo(CenterPointInScreen(minimize_button()));
EXPECT_EQ(views::Button::STATE_HOVERED, minimize_button()->GetState());
EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->GetState());
EXPECT_EQ(views::Button::STATE_NORMAL, close_button()->GetState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());

// Release the mouse, snapping the window left.
generator->ReleaseLeftButton();
Expand All @@ -365,8 +361,8 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
// None of the buttons should stay pressed and the buttons should have their
// regular icons.
EXPECT_TRUE(AllButtonsInNormalState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());

// Repeat test but release button where it does not affect the window's state
// because the code path is different.
Expand All @@ -375,10 +371,8 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->GetState());
EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->GetState());
EXPECT_EQ(views::Button::STATE_NORMAL, close_button()->GetState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());

const gfx::Rect work_area_bounds_in_screen =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
Expand All @@ -388,10 +382,8 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
// any of the caption buttons. The minimize and close button icons should
// be changed because the mouse is pressed.
EXPECT_TRUE(AllButtonsInNormalState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());

// Release the mouse. The window should stay snapped left.
generator->ReleaseLeftButton();
Expand All @@ -401,15 +393,15 @@ TEST_F(FrameSizeButtonTest, ResetButtonsAfterClick) {
// The buttons should stay unpressed and the buttons should now have their
// regular icons.
EXPECT_TRUE(AllButtonsInNormalState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
}

// Test that the size button is pressed whenever the snap left/right buttons
// are hovered.
TEST_F(FrameSizeButtonTest, SizeButtonPressedWhenSnapButtonHovered) {
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_TRUE(AllButtonsInNormalState());

// Pressing the size button should result in the size button being pressed and
Expand All @@ -420,10 +412,8 @@ TEST_F(FrameSizeButtonTest, SizeButtonPressedWhenSnapButtonHovered) {
EXPECT_EQ(views::Button::STATE_NORMAL, minimize_button()->GetState());
EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->GetState());
EXPECT_EQ(views::Button::STATE_NORMAL, close_button()->GetState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());

// Dragging the mouse over the minimize button (snap left button) should hover
// the minimize button and keep the size button pressed.
Expand Down Expand Up @@ -481,8 +471,8 @@ TEST_F(FrameSizeButtonTestRTL, ButtonDrag) {
// Test initial state.
EXPECT_TRUE(window_state()->IsNormalStateType());
EXPECT_TRUE(AllButtonsInNormalState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());

// Pressing the size button should swap the icons of the minimize and close
// buttons to icons for snapping right and for snapping left respectively.
Expand All @@ -493,8 +483,8 @@ TEST_F(FrameSizeButtonTestRTL, ButtonDrag) {
EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->GetState());
EXPECT_EQ(views::Button::STATE_NORMAL, close_button()->GetState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, close_button()->GetIcon());
minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, close_button()->icon());

// Dragging over to the minimize button should press it.
generator->MoveMouseTo(CenterPointInScreen(minimize_button()));
Expand All @@ -510,8 +500,8 @@ TEST_F(FrameSizeButtonTestRTL, ButtonDrag) {
// None of the buttons should stay pressed and the buttons should have their
// regular icons.
EXPECT_TRUE(AllButtonsInNormalState());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
}

namespace {
Expand All @@ -528,8 +518,8 @@ class FrameSizeButtonNonResizableTest : public FrameSizeButtonTest {
} // namespace

TEST_F(FrameSizeButtonNonResizableTest, NoSnap) {
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_TRUE(AllButtonsInNormalState());

// Pressing the size button should result in the size button being pressed and
Expand All @@ -541,8 +531,8 @@ TEST_F(FrameSizeButtonNonResizableTest, NoSnap) {
EXPECT_EQ(views::Button::STATE_PRESSED, size_button()->GetState());
EXPECT_EQ(views::Button::STATE_NORMAL, close_button()->GetState());

EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
}

} // namespace ash
4 changes: 2 additions & 2 deletions ash/frame/non_client_frame_view_ash_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ TEST_F(NonClientFrameViewAshTest, ActiveStateOfButtonMatchesWidget) {
EXPECT_TRUE(widget->IsActive());
// The paint state doesn't change till the next paint.
ui::DrawWaiterForTest::WaitForCommit(widget->GetLayer()->GetCompositor());
EXPECT_TRUE(test_api.size_button()->GetPaintAsActive());
EXPECT_TRUE(test_api.size_button()->paint_as_active());

// Activate a different widget so the original one loses activation.
std::unique_ptr<views::Widget> widget2 =
Expand All @@ -187,7 +187,7 @@ TEST_F(NonClientFrameViewAshTest, ActiveStateOfButtonMatchesWidget) {
ui::DrawWaiterForTest::WaitForCommit(widget->GetLayer()->GetCompositor());

EXPECT_FALSE(widget->IsActive());
EXPECT_FALSE(test_api.size_button()->GetPaintAsActive());
EXPECT_FALSE(test_api.size_button()->paint_as_active());
}

// Verify that NonClientFrameViewAsh returns the correct minimum and maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1254,11 +1254,11 @@ IN_PROC_BROWSER_TEST_P(WebAppNonClientFrameViewAshTest,
SetUpWebApp();
chromeos::FrameCaptionButtonContainerView::TestApi test(
GetFrameViewAsh(browser_view_)->caption_button_container_);
EXPECT_TRUE(test.size_button()->GetPaintAsActive());
EXPECT_TRUE(test.size_button()->paint_as_active());
EXPECT_TRUE(GetPaintingAsActive());

browser_view_->GetWidget()->Deactivate();
EXPECT_FALSE(test.size_button()->GetPaintAsActive());
EXPECT_FALSE(test.size_button()->paint_as_active());
EXPECT_FALSE(GetPaintingAsActive());
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ void OpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
button->GetClassName());
views::FrameCaptionButton* frame_caption_button =
static_cast<views::FrameCaptionButton*>(button);
frame_caption_button->SetPaintAsActive(active);
frame_caption_button->set_paint_as_active(active);
frame_caption_button->SetBackgroundColor(frame_color);
}
}
Expand Down Expand Up @@ -541,7 +541,7 @@ views::Button* OpaqueBrowserFrameView::CreateFrameCaptionButton(
const gfx::VectorIcon& icon_image) {
views::FrameCaptionButton* button = new views::FrameCaptionButton(
views::Button::PressedCallback(), icon_type, ht_component);
button->SetImage(button->GetIcon(), views::FrameCaptionButton::ANIMATE_NO,
button->SetImage(button->icon(), views::FrameCaptionButton::ANIMATE_NO,
icon_image);
return button;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void OpaqueBrowserFrameViewLayout::SetBoundsForButton(
views::kCaptionButtonInkDropDefaultCornerRadius);
button_size = gfx::Size(views::kCaptionButtonWidth, height);
button->SetPreferredSize(button_size);
static_cast<views::FrameCaptionButton*>(button)->SetInkDropCornerRadius(
static_cast<views::FrameCaptionButton*>(button)->set_ink_drop_corner_radius(
corner_radius);
} else if (delegate_->GetFrameButtonStyle() ==
OpaqueBrowserFrameViewLayoutDelegate::FrameButtonStyle::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,17 @@ void FrameCaptionButtonContainerView::SetButtonImage(
views::FrameCaptionButton* buttons[] = {menu_button_, minimize_button_,
size_button_, close_button_};
for (size_t i = 0; i < base::size(buttons); ++i) {
if (buttons[i]->GetIcon() == icon)
if (buttons[i]->icon() == icon)
buttons[i]->SetImage(icon, views::FrameCaptionButton::ANIMATE_NO,
icon_definition);
}
}

void FrameCaptionButtonContainerView::SetPaintAsActive(bool paint_as_active) {
menu_button_->SetPaintAsActive(paint_as_active);
minimize_button_->SetPaintAsActive(paint_as_active);
size_button_->SetPaintAsActive(paint_as_active);
close_button_->SetPaintAsActive(paint_as_active);
menu_button_->set_paint_as_active(paint_as_active);
minimize_button_->set_paint_as_active(paint_as_active);
size_button_->set_paint_as_active(paint_as_active);
close_button_->set_paint_as_active(paint_as_active);
SchedulePaint();
}

Expand Down Expand Up @@ -389,7 +389,7 @@ void FrameCaptionButtonContainerView::SetButtonIcon(
// The early return is dependent on |animate| because callers use
// SetButtonIcon() with ANIMATE_NO to progress |button|'s crossfade animation
// to the end.
if (button->GetIcon() == icon &&
if (button->icon() == icon &&
(animate == ANIMATE_YES || !button->IsAnimatingImageSwap())) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions chromeos/ui/frame/caption_buttons/frame_size_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool HitTestButton(const views::FrameCaptionButton* button,

SnapDirection GetSnapDirection(const views::FrameCaptionButton* to_hover) {
if (to_hover) {
switch (to_hover->GetIcon()) {
switch (to_hover->icon()) {
case views::CAPTION_BUTTON_ICON_LEFT_SNAPPED:
return SnapDirection::kLeft;
case views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED:
Expand Down Expand Up @@ -272,8 +272,8 @@ const views::FrameCaptionButton* FrameSizeButton::GetButtonToHover(
views::View::ConvertPointToScreen(this, &event_location_in_screen);
const views::FrameCaptionButton* closest_button =
delegate_->GetButtonClosestTo(event_location_in_screen);
if ((closest_button->GetIcon() == views::CAPTION_BUTTON_ICON_LEFT_SNAPPED ||
closest_button->GetIcon() == views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED) &&
if ((closest_button->icon() == views::CAPTION_BUTTON_ICON_LEFT_SNAPPED ||
closest_button->icon() == views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED) &&
HitTestButton(closest_button, event_location_in_screen)) {
return closest_button;
}
Expand Down
2 changes: 1 addition & 1 deletion chromeos/ui/frame/frame_header.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void FrameHeader::SetPaintAsActive(bool paint_as_active) {

caption_button_container_->SetPaintAsActive(paint_as_active);
if (back_button_)
back_button_->SetPaintAsActive(paint_as_active);
back_button_->set_paint_as_active(paint_as_active);
UpdateCaptionButtonColors();
}

Expand Down
64 changes: 8 additions & 56 deletions ui/views/window/frame_caption_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "ui/views/animation/ink_drop_ripple.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/window/caption_button_layout_constants.h"
#include "ui/views/window/hit_test_utils.h"

Expand Down Expand Up @@ -58,13 +57,16 @@ class FrameCaptionButton::HighlightPathGenerator
gfx::Rect bounds = gfx::ToRoundedRect(rect);
bounds.Inset(frame_caption_button_->GetInkdropInsets(bounds.size()));
return gfx::RRectF(gfx::RectF(bounds),
frame_caption_button_->GetInkDropCornerRadius());
frame_caption_button_->ink_drop_corner_radius());
}

private:
FrameCaptionButton* const frame_caption_button_;
};

// static
const char FrameCaptionButton::kViewClassName[] = "FrameCaptionButton";

FrameCaptionButton::FrameCaptionButton(PressedCallback callback,
CaptionButtonIcon icon,
int hit_test_type)
Expand Down Expand Up @@ -164,6 +166,10 @@ void FrameCaptionButton::SetAlpha(int alpha) {
}
}

const char* FrameCaptionButton::GetClassName() const {
return kViewClassName;
}

void FrameCaptionButton::OnGestureEvent(ui::GestureEvent* event) {
// Button does not become pressed when the user drags off and then back
// onto the button. Make FrameCaptionButton pressed in this case because this
Expand Down Expand Up @@ -218,30 +224,6 @@ void FrameCaptionButton::SetBackgroundColor(SkColor background_color) {
UpdateInkDropBaseColor();
}

SkColor FrameCaptionButton::GetBackgroundColor() const {
return background_color_;
}

void FrameCaptionButton::SetPaintAsActive(bool paint_as_active) {
paint_as_active_ = paint_as_active;
OnPropertyChanged(&paint_as_active, kPropertyEffectsPaint);
}

bool FrameCaptionButton::GetPaintAsActive() const {
return paint_as_active_;
}

void FrameCaptionButton::SetInkDropCornerRadius(int ink_drop_corner_radius) {
ink_drop_corner_radius_ = ink_drop_corner_radius;
// Changes to |ink_drop_corner_radius| will affect the ink drop. Therefore
// this effect is handled by the ink drop.
OnPropertyChanged(&ink_drop_corner_radius_, kPropertyEffectsNone);
}

int FrameCaptionButton::GetInkDropCornerRadius() const {
return ink_drop_corner_radius_;
}

void FrameCaptionButton::PaintButtonContents(gfx::Canvas* canvas) {
constexpr SkAlpha kHighlightVisibleOpacity = 0x14;
SkAlpha highlight_alpha = SK_AlphaTRANSPARENT;
Expand Down Expand Up @@ -339,34 +321,4 @@ void FrameCaptionButton::UpdateInkDropBaseColor() {
GetColorWithMaxContrast(GetColorWithMaxContrast(button_color)));
}

DEFINE_ENUM_CONVERTERS(
views::CaptionButtonIcon,
{{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_MINIMIZE,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_MINIMIZE")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_MAXIMIZE_RESTORE,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_MAXIMIZE_RESTORE")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_CLOSE,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_CLOSE")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_LEFT_SNAPPED")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_RIGHT_SNAPPED")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_BACK,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_BACK")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_LOCATION,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_LOCATION")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_MENU,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_MENU")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_ZOOM,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_ZOOM")},
{views::CaptionButtonIcon::CAPTION_BUTTON_ICON_COUNT,
base::ASCIIToUTF16("CAPTION_BUTTON_ICON_COUNT")}})

BEGIN_METADATA(FrameCaptionButton, Button)
ADD_PROPERTY_METADATA(SkColor, BackgroundColor)
ADD_PROPERTY_METADATA(bool, PaintAsActive)
ADD_PROPERTY_METADATA(int, InkDropCornerRadius)
ADD_READONLY_PROPERTY_METADATA(CaptionButtonIcon, Icon)
END_METADATA

} // namespace views
Loading

0 comments on commit 0b79b22

Please sign in to comment.