Commit df094150 authored by Felipe Andrade's avatar Felipe Andrade Committed by Commit Bot

Fix presubmit warnings on authpolicy credentials manager

Replaces the usage of banned method (std::to_string) on authpolicy
credentials manager files by the appropriated one. In this case, since
the notification_id is not an user-visible string, the
locale-independent method base::NumberToString will be used.


Bug: 1027241
Change-Id: I7884f0dbeabefa315d4b1c096c89654d4f5e9719
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1929811
Commit-Queue: Felipe Andrade <fsandrade@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719116}
parent 13cf6417
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/location.h" #include "base/location.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -260,7 +261,7 @@ void AuthPolicyCredentialsManager::ShowNotification(int message_id) { ...@@ -260,7 +261,7 @@ void AuthPolicyCredentialsManager::ShowNotification(int message_id) {
const std::string notification_id = kProfileSigninNotificationId + const std::string notification_id = kProfileSigninNotificationId +
profile_->GetProfileUserName() + profile_->GetProfileUserName() +
std::to_string(message_id); base::NumberToString(message_id);
message_center::NotifierId notifier_id( message_center::NotifierId notifier_id(
message_center::NotifierType::SYSTEM_COMPONENT, message_center::NotifierType::SYSTEM_COMPONENT,
kProfileSigninNotificationId); kProfileSigninNotificationId);
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/login/users/mock_user_manager.h" #include "chrome/browser/chromeos/login/users/mock_user_manager.h"
...@@ -111,7 +112,7 @@ class AuthPolicyCredentialsManagerTest : public testing::Test { ...@@ -111,7 +112,7 @@ class AuthPolicyCredentialsManagerTest : public testing::Test {
void CancelNotificationById(int message_id) { void CancelNotificationById(int message_id) {
const std::string notification_id = kProfileSigninNotificationId + const std::string notification_id = kProfileSigninNotificationId +
profile()->GetProfileUserName() + profile()->GetProfileUserName() +
std::to_string(message_id); base::NumberToString(message_id);
EXPECT_TRUE(display_service_->GetNotification(notification_id)); EXPECT_TRUE(display_service_->GetNotification(notification_id));
display_service_->RemoveNotification(NotificationHandler::Type::TRANSIENT, display_service_->RemoveNotification(NotificationHandler::Type::TRANSIENT,
notification_id, false); notification_id, false);
......
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