Commit d5228526 authored by Hesen Zhang's avatar Hesen Zhang Committed by Commit Bot

[Notification scheduler]: Add string resources for iNHR buttons.

- Rework on adding strings for helpful/unhelpful buttons.
- No need to create new grd file.
https://chromium-review.googlesource.com/c/chromium/src/+/1735525


Bug: 988117
Change-Id: Icfa104bbf176f2c9164200879393e8e8963881b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1739153Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Hesen Zhang <hesen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684477}
parent 0ab640c4
...@@ -9861,6 +9861,12 @@ Please help our engineers fix this problem. Tell us what happened right before y ...@@ -9861,6 +9861,12 @@ Please help our engineers fix this problem. Tell us what happened right before y
Your feedback is important to us. Your feedback is important to us.
</message> </message>
</if> </if>
<message name="IDS_NOTIFICATION_DEFAULT_HELPFUL_BUTTON_TEXT" desc="Text body for the helpful button in notifications sent from notification scheduler.">
Helpful
</message>
<message name="IDS_NOTIFICATION_DEFAULT_UNHELPFUL_BUTTON_TEXT" desc="Text body for the unhelpful button in notifications sent from notification scheduler.">
Not Helpful
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
...@@ -58,11 +58,13 @@ source_set("lib") { ...@@ -58,11 +58,13 @@ source_set("lib") {
# This target should not depend on anything in //chrome/* except the proto library. # This target should not depend on anything in //chrome/* except the proto library.
deps = [ deps = [
"//base", "//base",
"//chrome/app:generated_resources",
"//chrome/browser/notifications/proto", "//chrome/browser/notifications/proto",
"//chrome/browser/notifications/scheduler/public", "//chrome/browser/notifications/scheduler/public",
"//components/keyed_service/core", "//components/keyed_service/core",
"//components/leveldb_proto", "//components/leveldb_proto",
"//skia", "//skia",
"//ui/base",
"//ui/gfx/codec", "//ui/gfx/codec",
] ]
} }
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "chrome/browser/notifications/scheduler/internal/scheduler_utils.h" #include "chrome/browser/notifications/scheduler/internal/scheduler_utils.h"
#include "chrome/browser/notifications/scheduler/public/notification_params.h" #include "chrome/browser/notifications/scheduler/public/notification_params.h"
#include "chrome/browser/notifications/scheduler/public/notification_scheduler_constant.h" #include "chrome/browser/notifications/scheduler/public/notification_scheduler_constant.h"
#include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
namespace notifications { namespace notifications {
namespace { namespace {
...@@ -285,11 +287,15 @@ class ScheduledNotificationManagerImpl : public ScheduledNotificationManager { ...@@ -285,11 +287,15 @@ class ScheduledNotificationManagerImpl : public ScheduledNotificationManager {
NotificationData::Button helpful_button; NotificationData::Button helpful_button;
helpful_button.type = ActionButtonType::kHelpful; helpful_button.type = ActionButtonType::kHelpful;
helpful_button.id = notifications::kDefaultHelpfulButtonId; helpful_button.id = notifications::kDefaultHelpfulButtonId;
helpful_button.text =
l10n_util::GetStringUTF16(IDS_NOTIFICATION_DEFAULT_HELPFUL_BUTTON_TEXT);
buttons->emplace_back(std::move(helpful_button)); buttons->emplace_back(std::move(helpful_button));
NotificationData::Button unhelpful_button; NotificationData::Button unhelpful_button;
unhelpful_button.type = ActionButtonType::kUnhelpful; unhelpful_button.type = ActionButtonType::kUnhelpful;
unhelpful_button.id = notifications::kDefaultUnhelpfulButtonId; unhelpful_button.id = notifications::kDefaultUnhelpfulButtonId;
unhelpful_button.text = l10n_util::GetStringUTF16(
IDS_NOTIFICATION_DEFAULT_UNHELPFUL_BUTTON_TEXT);
buttons->emplace_back(std::move(unhelpful_button)); buttons->emplace_back(std::move(unhelpful_button));
} }
......
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