Skip to content

Commit

Permalink
Add metadata to frame_caption_button
Browse files Browse the repository at this point in the history
This CL adds the metadata to frame_caption_button not including set_paint_as_active and paint_as_active. See this bug for why previous frame_caption_button metadata was reverted: https://bugs.chromium.org/p/chromium/issues/detail?id=1171778

Bug: 1159562
Change-Id: I37b5a9c499000f3d90556d1c31b9a21491f4fc1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2674348
Reviewed-by: Wei Li <weili@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Elaine Chien <elainechien@chromium.org>
Cr-Commit-Position: refs/heads/master@{#851181}
  • Loading branch information
Elaine Chien authored and Chromium LUCI CQ committed Feb 5, 2021
1 parent bcc8070 commit 5cf0e47
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 58 deletions.
66 changes: 38 additions & 28 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_TRUE(AllButtonsInNormalState());

// Pressing the size button should result in the size button being pressed and
Expand All @@ -341,17 +341,21 @@ 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());

// 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());

// Release the mouse, snapping the window left.
generator->ReleaseLeftButton();
Expand All @@ -361,8 +365,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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());

// Repeat test but release button where it does not affect the window's state
// because the code path is different.
Expand All @@ -371,8 +375,10 @@ 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());

const gfx::Rect work_area_bounds_in_screen =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
Expand All @@ -382,8 +388,10 @@ 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());

// Release the mouse. The window should stay snapped left.
generator->ReleaseLeftButton();
Expand All @@ -393,15 +401,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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
}

// 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
EXPECT_TRUE(AllButtonsInNormalState());

// Pressing the size button should result in the size button being pressed and
Expand All @@ -412,8 +420,10 @@ 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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED,
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED,
close_button()->GetIcon());

// 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 @@ -471,8 +481,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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());

// 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 @@ -483,8 +493,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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, close_button()->icon());
minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_LEFT_SNAPPED, close_button()->GetIcon());

// Dragging over to the minimize button should press it.
generator->MoveMouseTo(CenterPointInScreen(minimize_button()));
Expand All @@ -500,8 +510,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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
}

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

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

// Pressing the size button should result in the size button being pressed and
Expand All @@ -531,8 +541,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()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->GetIcon());
EXPECT_EQ(views::CAPTION_BUTTON_ICON_CLOSE, close_button()->GetIcon());
}

} // namespace ash
7 changes: 2 additions & 5 deletions chrome/browser/extensions/api/tabs/tabs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetCurrentWindow) {
EXPECT_GE(GetTabId(utils::ToDictionary(tab0)), 0);
}

// TODO(http://crbug.com/1172393): flaky on many bots
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_GetAllWindows) {
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetAllWindows) {
const size_t NUM_WINDOWS = 5;
std::set<int> window_ids;
std::set<int> result_ids;
Expand Down Expand Up @@ -347,9 +346,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_GetAllWindows) {
CloseAppWindow(app_window);
}

// Timeouts on multiple bots. MSan, Linux Dbg.
// https://crbug.com/1172186
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DISABLED_GetAllWindowsAllTypes) {
IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetAllWindowsAllTypes) {
const size_t NUM_WINDOWS = 5;
std::set<int> window_ids;
std::set<int> result_ids;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,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->icon(), views::FrameCaptionButton::ANIMATE_NO,
button->SetImage(button->GetIcon(), 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)->set_ink_drop_corner_radius(
static_cast<views::FrameCaptionButton*>(button)->SetInkDropCornerRadius(
corner_radius);
} else if (delegate_->GetFrameButtonStyle() ==
OpaqueBrowserFrameViewLayoutDelegate::FrameButtonStyle::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ 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]->icon() == icon)
if (buttons[i]->GetIcon() == icon)
buttons[i]->SetImage(icon, views::FrameCaptionButton::ANIMATE_NO,
icon_definition);
}
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->icon() == icon &&
if (button->GetIcon() == 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->icon()) {
switch (to_hover->GetIcon()) {
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->icon() == views::CAPTION_BUTTON_ICON_LEFT_SNAPPED ||
closest_button->icon() == views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED) &&
if ((closest_button->GetIcon() == views::CAPTION_BUTTON_ICON_LEFT_SNAPPED ||
closest_button->GetIcon() == views::CAPTION_BUTTON_ICON_RIGHT_SNAPPED) &&
HitTestButton(closest_button, event_location_in_screen)) {
return closest_button;
}
Expand Down
54 changes: 46 additions & 8 deletions ui/views/window/frame_caption_button.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#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 @@ -57,16 +58,13 @@ 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_->ink_drop_corner_radius());
frame_caption_button_->GetInkDropCornerRadius());
}

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 @@ -166,10 +164,6 @@ 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 @@ -224,6 +218,21 @@ void FrameCaptionButton::SetBackgroundColor(SkColor background_color) {
UpdateInkDropBaseColor();
}

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

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 @@ -321,4 +330,33 @@ 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(int, InkDropCornerRadius)
ADD_READONLY_PROPERTY_METADATA(CaptionButtonIcon, Icon)
END_METADATA

} // namespace views
18 changes: 8 additions & 10 deletions ui/views/window/frame_caption_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/focus_ring.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/views_export.h"
#include "ui/views/window/caption_button_types.h"

Expand All @@ -25,13 +26,14 @@ namespace views {
// close).
class VIEWS_EXPORT FrameCaptionButton : public views::Button {
public:
METADATA_HEADER(FrameCaptionButton);
enum Animate { ANIMATE_YES, ANIMATE_NO };

static const char kViewClassName[];

FrameCaptionButton(PressedCallback callback,
CaptionButtonIcon icon,
int hit_test_type);
FrameCaptionButton(const FrameCaptionButton&) = delete;
FrameCaptionButton& operator=(const FrameCaptionButton&) = delete;
~FrameCaptionButton() override;

// Gets the color to use for a frame caption button.
Expand All @@ -56,26 +58,24 @@ class VIEWS_EXPORT FrameCaptionButton : public views::Button {
void SetAlpha(int alpha);

// views::Button:
const char* GetClassName() const override;
void OnGestureEvent(ui::GestureEvent* event) override;
views::PaintInfo::ScaleType GetPaintScaleType() const override;
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;

void SetBackgroundColor(SkColor background_color);
SkColor GetBackgroundColor() const;

void set_paint_as_active(bool paint_as_active) {
paint_as_active_ = paint_as_active;
}

bool paint_as_active() const { return paint_as_active_; }

void set_ink_drop_corner_radius(int ink_drop_corner_radius) {
ink_drop_corner_radius_ = ink_drop_corner_radius;
}
int ink_drop_corner_radius() const { return ink_drop_corner_radius_; }
void SetInkDropCornerRadius(int ink_drop_corner_radius);
int GetInkDropCornerRadius() const;

CaptionButtonIcon icon() const { return icon_; }
CaptionButtonIcon GetIcon() const { return icon_; }

const gfx::ImageSkia& icon_image() const { return icon_image_; }

Expand Down Expand Up @@ -127,8 +127,6 @@ class VIEWS_EXPORT FrameCaptionButton : public views::Button {
// Crossfade animation started when the button's images are changed by
// SetImage().
std::unique_ptr<gfx::SlideAnimation> swap_images_animation_;

DISALLOW_COPY_AND_ASSIGN(FrameCaptionButton);
};

} // namespace views
Expand Down
Loading

0 comments on commit 5cf0e47

Please sign in to comment.