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

Unified Diff: chrome/browser/extensions/api/notifications/notifications_api.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: chrome/browser/extensions/api/notifications/notifications_api.cc
diff --git a/chrome/browser/extensions/api/notifications/notifications_api.cc b/chrome/browser/extensions/api/notifications/notifications_api.cc
index d26317e05e32900c39bfd2a4140efce24472d743..215c9833793066d22cb29bd74b11d70567bd762f 100644
--- a/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -158,7 +158,7 @@ class NotificationsApiDelegate : public NotificationDelegate {
by_user ? EventRouter::USER_GESTURE_ENABLED
: EventRouter::USER_GESTURE_NOT_ENABLED;
std::unique_ptr<base::ListValue> args(CreateBaseEventArgs());
- args->Append(new base::FundamentalValue(by_user));
+ args->AppendBoolean(by_user);
SendEvent(events::NOTIFICATIONS_ON_CLOSED,
notifications::OnClosed::kEventName, gesture, std::move(args));
}
@@ -180,7 +180,7 @@ class NotificationsApiDelegate : public NotificationDelegate {
void ButtonClick(int index) override {
std::unique_ptr<base::ListValue> args(CreateBaseEventArgs());
- args->Append(new base::FundamentalValue(index));
+ args->AppendInteger(index);
SendEvent(events::NOTIFICATIONS_ON_BUTTON_CLICKED,
notifications::OnButtonClicked::kEventName,
EventRouter::USER_GESTURE_ENABLED, std::move(args));
@@ -211,7 +211,7 @@ class NotificationsApiDelegate : public NotificationDelegate {
std::unique_ptr<base::ListValue> CreateBaseEventArgs() {
std::unique_ptr<base::ListValue> args(new base::ListValue());
- args->Append(new base::StringValue(id_));
+ args->AppendString(id_);
return args;
}

Powered by Google App Engine
This is Rietveld 408576698