Skip to content

Commit

Permalink
[CodeHealth] Convert base::Bind( in chrome/browser/notifications
Browse files Browse the repository at this point in the history
The methods that are being called have already been converted from
base::Callback to {Once,Repeating}, this cleans up a few base::Bind
calls to match the underlying function argument explicitly so that the
base::Bind alias can be deprecated.

This is a code health change which should not introduce any behavior
change.

Fixed: 1170952
Change-Id: Id0c023d6adb816464dfd6bf3a6c839e22a47cacb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2657846
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#849205}
  • Loading branch information
alcooper91 authored and Chromium LUCI CQ committed Feb 1, 2021
1 parent 956319b commit 8d31944
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@
'^chrome/browser/history/android/android_history_provider_service_unittest.cc', # pylint: disable=line-too-long
'^chrome/browser/media_galleries/',
'^chrome/browser/net/websocket_browsertest.cc',
'^chrome/browser/notifications/',
'^chrome/browser/ntp_tiles/ntp_tiles_browsertest.cc',
'^chrome/browser/page_load_metrics/observers/data_saver_site_breakdown_metrics_observer_browsertest.cc', # pylint: disable=line-too-long
'^chrome/browser/payments/payment_manifest_parser_browsertest.cc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,14 @@ class NotificationPlatformBridgeLinuxImpl
this, ConnectionInitializationStatusCode::SUCCESS));
notification_proxy_->ConnectToSignal(
kFreedesktopNotificationsName, kSignalActionInvoked,
base::Bind(&NotificationPlatformBridgeLinuxImpl::OnActionInvoked, this),
base::BindRepeating(
&NotificationPlatformBridgeLinuxImpl::OnActionInvoked, this),
base::BindOnce(&NotificationPlatformBridgeLinuxImpl::OnSignalConnected,
this));
notification_proxy_->ConnectToSignal(
kFreedesktopNotificationsName, kSignalNotificationClosed,
base::Bind(&NotificationPlatformBridgeLinuxImpl::OnNotificationClosed,
this),
base::BindRepeating(
&NotificationPlatformBridgeLinuxImpl::OnNotificationClosed, this),
base::BindOnce(&NotificationPlatformBridgeLinuxImpl::OnSignalConnected,
this));
}
Expand Down Expand Up @@ -1020,7 +1021,7 @@ class NotificationPlatformBridgeLinuxImpl
if (!product_logo_file_watcher_->Watch(
product_logo_file_->file_path(),
base::FilePathWatcher::Type::kNonRecursive,
base::Bind(
base::BindRepeating(
&NotificationPlatformBridgeLinuxImpl::OnProductLogoFileChanged,
this))) {
product_logo_file_.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ new NotificationPlatformBridgeMac(notification_center(),

int notification_count = -1;
bridge->GetDisplayed(
profile(), base::Bind(&StoreNotificationCount, &notification_count));
profile(), base::BindOnce(&StoreNotificationCount, &notification_count));
base::RunLoop().RunUntilIdle();
EXPECT_EQ(1, notification_count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ void DoProcessMacNotificationResponse(

profileManager->LoadProfile(
profileId, incognito,
base::Bind(&NotificationDisplayServiceImpl::ProfileLoadedCallback,
operation, type, origin, notificationId, actionIndex, reply,
byUser));
base::BindOnce(&NotificationDisplayServiceImpl::ProfileLoadedCallback,
operation, type, origin, notificationId, actionIndex,
reply, byUser));
}

// Implements the version check to determine if alerts are supported. Do not
Expand Down

0 comments on commit 8d31944

Please sign in to comment.