refactor: replace base::StringPrintf() calls with absl::StrFormat() (#44552)
refactor: replace base::StringPrintf() calls with absl::StFormat()
The former is now a pass-through for the latter and is slated for removal
Xref: https://issues.chromium.org/issues/40241565
4907781
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
460fc9b452
commit
c0b914f6a6
15 changed files with 59 additions and 61 deletions
|
@ -10,7 +10,6 @@
|
|||
#include "base/command_line.h"
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/containers/map_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
|
@ -29,6 +28,7 @@
|
|||
#include "shell/common/gin_converters/hid_device_info_converter.h"
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "third_party/abseil-cpp/absl/strings/str_format.h"
|
||||
#include "third_party/blink/public/common/permissions/permission_utils.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
|
@ -59,7 +59,7 @@ std::u16string HidChooserContext::DisplayNameFromDeviceInfo(
|
|||
const device::mojom::HidDeviceInfo& device) {
|
||||
if (device.product_name.empty()) {
|
||||
auto device_id_string = base::ASCIIToUTF16(
|
||||
base::StringPrintf("%04X:%04X", device.vendor_id, device.product_id));
|
||||
absl::StrFormat("%04X:%04X", device.vendor_id, device.product_id));
|
||||
return l10n_util::GetStringFUTF16(IDS_HID_CHOOSER_ITEM_WITHOUT_NAME,
|
||||
device_id_string);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "shell/common/gin_converters/hid_device_info_converter.h"
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/node_util.h"
|
||||
#include "third_party/abseil-cpp/absl/strings/str_format.h"
|
||||
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
|
||||
#include "third_party/blink/public/mojom/hid/hid.mojom.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
@ -277,7 +278,7 @@ bool HidChooserController::DisplayDevice(
|
|||
|
||||
AddMessageToConsole(
|
||||
blink::mojom::ConsoleMessageLevel::kInfo,
|
||||
base::StringPrintf(
|
||||
absl::StrFormat(
|
||||
"Chooser dialog is not displaying a FIDO HID device: vendorId=%d, "
|
||||
"productId=%d, name='%s', serial='%s'",
|
||||
device.vendor_id, device.product_id, device.product_name.c_str(),
|
||||
|
@ -288,12 +289,12 @@ bool HidChooserController::DisplayDevice(
|
|||
if (device.is_excluded_by_blocklist) {
|
||||
AddMessageToConsole(
|
||||
blink::mojom::ConsoleMessageLevel::kInfo,
|
||||
base::StringPrintf(
|
||||
"Chooser dialog is not displaying a device excluded by "
|
||||
"the HID blocklist: vendorId=%d, "
|
||||
"productId=%d, name='%s', serial='%s'",
|
||||
device.vendor_id, device.product_id, device.product_name.c_str(),
|
||||
device.serial_number.c_str()));
|
||||
absl::StrFormat("Chooser dialog is not displaying a device excluded by "
|
||||
"the HID blocklist: vendorId=%d, "
|
||||
"productId=%d, name='%s', serial='%s'",
|
||||
device.vendor_id, device.product_id,
|
||||
device.product_name.c_str(),
|
||||
device.serial_number.c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue