Commit 39e35ad3 authored by Andre Le's avatar Andre Le Committed by Commit Bot

[CrOS PhoneHub] Remove "Cancel" button from CrOS PhoneHub Notification.

BUG=1106937,1126208

Change-Id: I8dde09f28cee1c1390f32ebf9ec200d9ecd8f4ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2492740
Commit-Queue: Andre Le <leandre@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821096}
parent f878d2a2
...@@ -1112,9 +1112,6 @@ This file contains the strings for ash. ...@@ -1112,9 +1112,6 @@ This file contains the strings for ash.
<message name="IDS_ASH_PHONE_HUB_NOTIFICATION_INLINE_REPLY_BUTTON" desc="Label for the inline reply button inside a PhoneHub notification."> <message name="IDS_ASH_PHONE_HUB_NOTIFICATION_INLINE_REPLY_BUTTON" desc="Label for the inline reply button inside a PhoneHub notification.">
Reply Reply
</message> </message>
<message name="IDS_ASH_PHONE_HUB_NOTIFICATION_INLINE_CANCEL_BUTTON" desc="Label for the cancel button inside a PhoneHub notification.">
Cancel
</message>
<message name="IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_DESCRIPTION" desc="Description for the notification opt in view."> <message name="IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_DESCRIPTION" desc="Description for the notification opt in view.">
Turn on Notifications from your Android phone Turn on Notifications from your Android phone
</message> </message>
......
eec76ed30accc851aabc95d10badb610413c3b57
\ No newline at end of file
...@@ -33,7 +33,6 @@ const char kNotifierId[] = "chrome://phonehub"; ...@@ -33,7 +33,6 @@ const char kNotifierId[] = "chrome://phonehub";
const char kNotifierIdSeparator[] = "-"; const char kNotifierIdSeparator[] = "-";
const char kNotificationCustomViewType[] = "phonehub"; const char kNotificationCustomViewType[] = "phonehub";
const int kReplyButtonIndex = 0; const int kReplyButtonIndex = 0;
const int kCancelButtonIndex = 1;
// The amount of time the reply button is disabled after sending an inline // The amount of time the reply button is disabled after sending an inline
// reply. This is used to make sure that all the replies are received by the // reply. This is used to make sure that all the replies are received by the
...@@ -153,9 +152,6 @@ class PhoneHubNotificationController::NotificationDelegate ...@@ -153,9 +152,6 @@ class PhoneHubNotificationController::NotificationDelegate
controller_->SendInlineReply(phone_hub_id_, reply.value()); controller_->SendInlineReply(phone_hub_id_, reply.value());
return; return;
} }
if (button_index.value() == kCancelButtonIndex)
Remove();
} }
void SettingsClick() override { void SettingsClick() override {
...@@ -326,11 +322,6 @@ PhoneHubNotificationController::CreateNotification( ...@@ -326,11 +322,6 @@ PhoneHubNotificationController::CreateNotification(
reply_button.placeholder = base::string16(); reply_button.placeholder = base::string16();
optional_fields.buttons.push_back(reply_button); optional_fields.buttons.push_back(reply_button);
message_center::ButtonInfo cancel_button;
cancel_button.title = l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_NOTIFICATION_INLINE_CANCEL_BUTTON);
optional_fields.buttons.push_back(cancel_button);
if (TrayPopupUtils::CanOpenWebUISettings()) { if (TrayPopupUtils::CanOpenWebUISettings()) {
optional_fields.settings_button_handler = optional_fields.settings_button_handler =
message_center::SettingsButtonHandler::DELEGATE; message_center::SettingsButtonHandler::DELEGATE;
......
...@@ -192,26 +192,6 @@ TEST_F(PhoneHubNotificationControllerTest, ClickSettings) { ...@@ -192,26 +192,6 @@ TEST_F(PhoneHubNotificationControllerTest, ClickSettings) {
EXPECT_EQ(1, GetSystemTrayClient()->show_connected_devices_settings_count()); EXPECT_EQ(1, GetSystemTrayClient()->show_connected_devices_settings_count());
} }
TEST_F(PhoneHubNotificationControllerTest, CancelReply) {
chromeos::phonehub::Notification fake_notification(
kPhoneHubNotificationId0,
chromeos::phonehub::Notification::AppMetadata(base::UTF8ToUTF16(kAppName),
kPackageName,
/*icon=*/gfx::Image()),
base::Time::Now(), chromeos::phonehub::Notification::Importance::kDefault,
/*inline_reply_id=*/1, base::UTF8ToUTF16(kTitle),
base::UTF8ToUTF16(kTextContent));
notification_manager_.SetNotification(fake_notification);
auto* cros_notification =
message_center_->FindVisibleNotificationById(kCrOSNotificationId0);
ASSERT_TRUE(cros_notification);
EXPECT_EQ(2u, cros_notification->buttons().size());
message_center_->ClickOnNotificationButton(kCrOSNotificationId0, 1);
EXPECT_EQ(0u, message_center_->NotificationCount());
}
TEST_F(PhoneHubNotificationControllerTest, NotificationDataAndImages) { TEST_F(PhoneHubNotificationControllerTest, NotificationDataAndImages) {
base::Time timestamp = base::Time::FromJsTime(12345); base::Time timestamp = base::Time::FromJsTime(12345);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment