Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: ui/message_center/views/padded_button.cc

Issue 2729533002: Adjust behavior of control buttons of notifications. (Closed)
Patch Set: Add unimplemented method to TestContentViewDelegate Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/views/padded_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/padded_button.cc
diff --git a/ui/message_center/views/padded_button.cc b/ui/message_center/views/padded_button.cc
index a0c6a448923583f477fe03a3b74da4db73cba27e..619dcd514cfedc80ddb5d675a410fe20be0688be 100644
--- a/ui/message_center/views/padded_button.cc
+++ b/ui/message_center/views/padded_button.cc
@@ -7,6 +7,9 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/message_center/message_center_style.h"
+#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
+#include "ui/views/animation/ink_drop_impl.h"
+#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/painter.h"
@@ -19,12 +22,28 @@ PaddedButton::PaddedButton(views::ButtonListener* listener)
SetFocusPainter(views::Painter::CreateSolidFocusPainter(
kFocusBorderColor,
gfx::Insets(1, 2, 2, 2)));
+ set_background(views::Background::CreateSolidBackground(
+ SkColorSetA(SK_ColorWHITE, 0.9 * 0xff)));
SetBorder(
views::CreateEmptyBorder(gfx::Insets(kControlButtonPaddingFromBorder)));
set_animate_on_state_change(false);
+
+ SetInkDropMode(InkDropMode::ON);
+ set_ink_drop_base_color(SkColorSetA(SK_ColorBLACK, 0.6 * 0xff));
+}
+
+std::unique_ptr<views::InkDrop> PaddedButton::CreateInkDrop() {
+ auto ink_drop = CreateDefaultInkDropImpl();
+ ink_drop->SetShowHighlightOnHover(false);
+ ink_drop->SetShowHighlightOnFocus(false);
+ return std::move(ink_drop);
}
-PaddedButton::~PaddedButton() {
+std::unique_ptr<views::InkDropRipple> PaddedButton::CreateInkDropRipple()
+ const {
+ return base::MakeUnique<views::FloodFillInkDropRipple>(
+ size(), GetInkDropCenterBasedOnLastEvent(),
+ SkColorSetA(SK_ColorBLACK, 0.6 * 255), ink_drop_visible_opacity());
}
} // namespace message_center
« no previous file with comments | « ui/message_center/views/padded_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698