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

Unified Diff: ui/arc/notification/arc_custom_notification_view.cc

Issue 2269143004: arc: Update notification close button image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | ui/resources/default_100_percent/common/arc_notification_close.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_custom_notification_view.cc
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc
index 7c171d135e83284eb7e9c0fb9552c9c629cf99d3..5b28eecf02b84efc61a8839d1d198c7b4ab1ee9b 100644
--- a/ui/arc/notification/arc_custom_notification_view.cc
+++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -125,19 +125,19 @@ void ArcCustomNotificationView::CreateFloatingCloseButton() {
floating_close_button_ = new views::ImageButton(this);
floating_close_button_->set_background(
views::Background::CreateSolidBackground(SK_ColorTRANSPARENT));
- floating_close_button_->SetBorder(
- views::Border::CreateEmptyBorder(5, 5, 5, 5));
+
+ constexpr int kPaddingFromBorder = 4;
+ constexpr int kImageSize = 16;
+ constexpr int kTouchExtendedPadding =
yoshiki 2016/08/24 09:24:32 nit: could you mention about units in comment? I a
xiyuan 2016/08/24 15:26:50 Done.
+ message_center::kControlButtonSize - kImageSize - kPaddingFromBorder;
+ floating_close_button_->SetBorder(views::Border::CreateEmptyBorder(
+ kPaddingFromBorder, kTouchExtendedPadding, kTouchExtendedPadding,
+ kPaddingFromBorder));
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
floating_close_button_->SetImage(
views::CustomButton::STATE_NORMAL,
- rb.GetImageSkiaNamed(IDR_NOTIFICATION_CLOSE));
- floating_close_button_->SetImage(
- views::CustomButton::STATE_HOVERED,
- rb.GetImageSkiaNamed(IDR_NOTIFICATION_CLOSE_HOVER));
- floating_close_button_->SetImage(
- views::CustomButton::STATE_PRESSED,
- rb.GetImageSkiaNamed(IDR_NOTIFICATION_CLOSE_PRESSED));
+ rb.GetImageSkiaNamed(IDR_ARC_NOTIFICATION_CLOSE));
floating_close_button_->set_animate_on_state_change(false);
floating_close_button_->SetAccessibleName(l10n_util::GetStringUTF16(
IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME));
@@ -257,11 +257,23 @@ void ArcCustomNotificationView::Layout() {
}
void ArcCustomNotificationView::OnKeyEvent(ui::KeyEvent* event) {
+ // Do not handle event targeted to the floating close button.
+ if (floating_close_button_widget_ && event->target() &&
+ floating_close_button_widget_->GetNativeWindow() == event->target()) {
+ return;
+ }
+
// Forward to parent CustomNotificationView to handle keyboard dismissal.
parent()->OnKeyEvent(event);
}
void ArcCustomNotificationView::OnGestureEvent(ui::GestureEvent* event) {
+ // Do not handle event targeted to the floating close button.
+ if (floating_close_button_widget_ && event->target() &&
+ floating_close_button_widget_->GetNativeWindow() == event->target()) {
+ return;
+ }
+
// Forward to parent CustomNotificationView to handle sliding out.
parent()->OnGestureEvent(event);
slide_helper_->Update();
« no previous file with comments | « no previous file | ui/resources/default_100_percent/common/arc_notification_close.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698