[go: up one dir, main page]

[M96 Sheriff] RELAND:notifications-refresh: Update the actions buttons

Compilation failures seen in M96. M96 had branched before revert was
submitted. https://ci.chromium.org/ui/p/chrome-m96/builders/ci/linux-chromeos-chrome/965/overview

Fixed the assistant browser test compilation error. Everything else is
unchanged.

Chrome UI and CrOS UI both need actions buttons that are also input
buttons.
Both need the ability to set a placeholder string for text input, and
a custom color.

The chrome button uses inheritance to enforce the styling of their
button (via MdTextButton).

NotificationTextButton -> MdTextButton -> LabelButton

Meanwhile AshNotificationView does not want the MD styling. So we want a
basic LabelButton.

Since the NotificationTextButton interface just facilitates the input
label button, implement the placeholder information into a map in
NotificationViewBase, and use the pre-existing LabelButton custom colors
instead of re-implementing it.

This way, NotificationViewBase can refer to these buttons as just
LabelButton, and we can extend the buttons in NotificationView and
AshNotificationView.

(cherry picked from commit 926106cb4036be20c167075943ffa8ff27bcc2c2)

Bug: 1233660
Change-Id: Ia975acf7f970b79fdfd31c3d6178c061a8e43de0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3214896
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#931255}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3296177
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: Katie Dektar <katie@chromium.org>
Owners-Override: Katie Dektar <katie@chromium.org>
Commit-Queue: Elaine Chien <elainechien@chromium.org>
Cr-Commit-Position: refs/branch-heads/4664@{#1127}
Cr-Branched-From: 24dc4ee75e01a29d390d43c9c264372a169273a7-refs/heads/main@{#929512}
diff --git a/chrome/browser/ui/ash/assistant/assistant_timers_browsertest.cc b/chrome/browser/ui/ash/assistant/assistant_timers_browsertest.cc
index 7f9396a2..7ef5924 100644
--- a/chrome/browser/ui/ash/assistant/assistant_timers_browsertest.cc
+++ b/chrome/browser/ui/ash/assistant/assistant_timers_browsertest.cc
@@ -30,6 +30,7 @@
 #include "ui/message_center/message_center_observer.h"
 #include "ui/message_center/public/cpp/notification.h"
 #include "ui/message_center/views/notification_view.h"
+#include "ui/views/controls/button/label_button.h"
 
 namespace chromeos {
 namespace assistant {
@@ -121,12 +122,11 @@
 }
 
 // Returns the action buttons for the specified |notification|.
-std::vector<message_center::NotificationTextButton*>
-FindActionButtonsForNotification(
+std::vector<views::LabelButton*> FindActionButtonsForNotification(
     const message_center::Notification* notification) {
   auto* notification_view = FindViewForNotification(notification);
 
-  std::vector<message_center::NotificationTextButton*> action_buttons;
+  std::vector<views::LabelButton*> action_buttons;
   FindDescendentsOfClass(notification_view, &action_buttons);
 
   return action_buttons;