2757472: Reland "Reland "[LSC] Remove base::string16 alias""

2757472
This commit is contained in:
John Kleinschmidt 2021-03-16 12:18:45 -04:00
parent 86d23cee40
commit 22d8f22cfb
100 changed files with 417 additions and 417 deletions

View file

@ -549,7 +549,7 @@ void OnClientCertificateSelected(
#if defined(USE_NSS_CERTS)
int ImportIntoCertStore(CertificateManagerModel* model, base::Value options) {
std::string file_data, cert_path;
base::string16 password;
std::u16string password;
net::ScopedCERTCertificateList imported_certs;
int rv = -1;

View file

@ -1089,11 +1089,11 @@ bool BaseWindow::SetThumbnailToolTip(const std::string& tooltip) {
}
void BaseWindow::SetAppDetails(const gin_helper::Dictionary& options) {
base::string16 app_id;
std::u16string app_id;
base::FilePath app_icon_path;
int app_icon_index = 0;
base::string16 relaunch_command;
base::string16 relaunch_display_name;
std::u16string relaunch_command;
std::u16string relaunch_display_name;
options.Get("appId", &app_id);
options.Get("appIconPath", &app_icon_path);

View file

@ -210,7 +210,7 @@ void BrowserWindow::OnActivateContents() {
#endif
}
void BrowserWindow::OnPageTitleUpdated(const base::string16& title,
void BrowserWindow::OnPageTitleUpdated(const std::u16string& title,
bool explicit_set) {
// Change window title to page title.
auto self = GetWeakPtr();

View file

@ -62,7 +62,7 @@ class BrowserWindow : public BaseWindow,
const std::vector<mojom::DraggableRegionPtr>& regions) override;
void OnSetContentBounds(const gfx::Rect& rect) override;
void OnActivateContents() override;
void OnPageTitleUpdated(const base::string16& title,
void OnPageTitleUpdated(const std::u16string& title,
bool explicit_set) override;
#if defined(OS_MAC)
void OnDevToolsResized() override;

View file

@ -163,7 +163,7 @@ base::OnceClosure Menu::BindSelfToClosure(base::OnceClosure callback) {
void Menu::InsertItemAt(int index,
int command_id,
const base::string16& label) {
const std::u16string& label) {
model_->InsertItemAt(index, command_id, label);
}
@ -173,20 +173,20 @@ void Menu::InsertSeparatorAt(int index) {
void Menu::InsertCheckItemAt(int index,
int command_id,
const base::string16& label) {
const std::u16string& label) {
model_->InsertCheckItemAt(index, command_id, label);
}
void Menu::InsertRadioItemAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
int group_id) {
model_->InsertRadioItemAt(index, command_id, label, group_id);
}
void Menu::InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
Menu* menu) {
menu->parent_ = this;
model_->InsertSubMenuAt(index, command_id, label, menu->model_.get());
@ -196,15 +196,15 @@ void Menu::SetIcon(int index, const gfx::Image& image) {
model_->SetIcon(index, ui::ImageModel::FromImage(image));
}
void Menu::SetSublabel(int index, const base::string16& sublabel) {
void Menu::SetSublabel(int index, const std::u16string& sublabel) {
model_->SetSecondaryLabel(index, sublabel);
}
void Menu::SetToolTip(int index, const base::string16& toolTip) {
void Menu::SetToolTip(int index, const std::u16string& toolTip) {
model_->SetToolTip(index, toolTip);
}
void Menu::SetRole(int index, const base::string16& role) {
void Menu::SetRole(int index, const std::u16string& role) {
model_->SetRole(index, role);
}
@ -224,19 +224,19 @@ int Menu::GetCommandIdAt(int index) const {
return model_->GetCommandIdAt(index);
}
base::string16 Menu::GetLabelAt(int index) const {
std::u16string Menu::GetLabelAt(int index) const {
return model_->GetLabelAt(index);
}
base::string16 Menu::GetSublabelAt(int index) const {
std::u16string Menu::GetSublabelAt(int index) const {
return model_->GetSecondaryLabelAt(index);
}
base::string16 Menu::GetToolTipAt(int index) const {
std::u16string Menu::GetToolTipAt(int index) const {
return model_->GetToolTipAt(index);
}
base::string16 Menu::GetAcceleratorTextAt(int index) const {
std::u16string Menu::GetAcceleratorTextAt(int index) const {
ui::Accelerator accelerator;
model_->GetAcceleratorAtWithParams(index, true, &accelerator);
return accelerator.GetShortcutText();

View file

@ -87,31 +87,31 @@ class Menu : public gin::Wrappable<Menu>,
void OnMenuWillShow() override;
private:
void InsertItemAt(int index, int command_id, const base::string16& label);
void InsertItemAt(int index, int command_id, const std::u16string& label);
void InsertSeparatorAt(int index);
void InsertCheckItemAt(int index,
int command_id,
const base::string16& label);
const std::u16string& label);
void InsertRadioItemAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
int group_id);
void InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
Menu* menu);
void SetIcon(int index, const gfx::Image& image);
void SetSublabel(int index, const base::string16& sublabel);
void SetToolTip(int index, const base::string16& toolTip);
void SetRole(int index, const base::string16& role);
void SetSublabel(int index, const std::u16string& sublabel);
void SetToolTip(int index, const std::u16string& toolTip);
void SetRole(int index, const std::u16string& role);
void Clear();
int GetIndexOfCommandId(int command_id);
int GetItemCount() const;
int GetCommandIdAt(int index) const;
base::string16 GetLabelAt(int index) const;
base::string16 GetSublabelAt(int index) const;
base::string16 GetToolTipAt(int index) const;
base::string16 GetAcceleratorTextAt(int index) const;
std::u16string GetLabelAt(int index) const;
std::u16string GetSublabelAt(int index) const;
std::u16string GetToolTipAt(int index) const;
std::u16string GetAcceleratorTextAt(int index) const;
bool IsItemCheckedAt(int index) const;
bool IsEnabledAt(int index) const;
bool IsVisibleAt(int index) const;

View file

@ -92,15 +92,15 @@ gin::Handle<Notification> Notification::New(gin_helper::ErrorThrower thrower,
}
// Getters
base::string16 Notification::GetTitle() const {
std::u16string Notification::GetTitle() const {
return title_;
}
base::string16 Notification::GetSubtitle() const {
std::u16string Notification::GetSubtitle() const {
return subtitle_;
}
base::string16 Notification::GetBody() const {
std::u16string Notification::GetBody() const {
return body_;
}
@ -112,19 +112,19 @@ bool Notification::GetHasReply() const {
return has_reply_;
}
base::string16 Notification::GetTimeoutType() const {
std::u16string Notification::GetTimeoutType() const {
return timeout_type_;
}
base::string16 Notification::GetReplyPlaceholder() const {
std::u16string Notification::GetReplyPlaceholder() const {
return reply_placeholder_;
}
base::string16 Notification::GetSound() const {
std::u16string Notification::GetSound() const {
return sound_;
}
base::string16 Notification::GetUrgency() const {
std::u16string Notification::GetUrgency() const {
return urgency_;
}
@ -132,24 +132,24 @@ std::vector<electron::NotificationAction> Notification::GetActions() const {
return actions_;
}
base::string16 Notification::GetCloseButtonText() const {
std::u16string Notification::GetCloseButtonText() const {
return close_button_text_;
}
base::string16 Notification::GetToastXml() const {
std::u16string Notification::GetToastXml() const {
return toast_xml_;
}
// Setters
void Notification::SetTitle(const base::string16& new_title) {
void Notification::SetTitle(const std::u16string& new_title) {
title_ = new_title;
}
void Notification::SetSubtitle(const base::string16& new_subtitle) {
void Notification::SetSubtitle(const std::u16string& new_subtitle) {
subtitle_ = new_subtitle;
}
void Notification::SetBody(const base::string16& new_body) {
void Notification::SetBody(const std::u16string& new_body) {
body_ = new_body;
}
@ -161,19 +161,19 @@ void Notification::SetHasReply(bool new_has_reply) {
has_reply_ = new_has_reply;
}
void Notification::SetTimeoutType(const base::string16& new_timeout_type) {
void Notification::SetTimeoutType(const std::u16string& new_timeout_type) {
timeout_type_ = new_timeout_type;
}
void Notification::SetReplyPlaceholder(const base::string16& new_placeholder) {
void Notification::SetReplyPlaceholder(const std::u16string& new_placeholder) {
reply_placeholder_ = new_placeholder;
}
void Notification::SetSound(const base::string16& new_sound) {
void Notification::SetSound(const std::u16string& new_sound) {
sound_ = new_sound;
}
void Notification::SetUrgency(const base::string16& new_urgency) {
void Notification::SetUrgency(const std::u16string& new_urgency) {
urgency_ = new_urgency;
}
@ -182,11 +182,11 @@ void Notification::SetActions(
actions_ = actions;
}
void Notification::SetCloseButtonText(const base::string16& text) {
void Notification::SetCloseButtonText(const std::u16string& text) {
close_button_text_ = text;
}
void Notification::SetToastXml(const base::string16& new_toast_xml) {
void Notification::SetToastXml(const std::u16string& new_toast_xml) {
toast_xml_ = new_toast_xml;
}

View file

@ -65,49 +65,49 @@ class Notification : public gin::Wrappable<Notification>,
void Close();
// Prop Getters
base::string16 GetTitle() const;
base::string16 GetSubtitle() const;
base::string16 GetBody() const;
std::u16string GetTitle() const;
std::u16string GetSubtitle() const;
std::u16string GetBody() const;
bool GetSilent() const;
bool GetHasReply() const;
base::string16 GetTimeoutType() const;
base::string16 GetReplyPlaceholder() const;
base::string16 GetUrgency() const;
base::string16 GetSound() const;
std::u16string GetTimeoutType() const;
std::u16string GetReplyPlaceholder() const;
std::u16string GetUrgency() const;
std::u16string GetSound() const;
std::vector<electron::NotificationAction> GetActions() const;
base::string16 GetCloseButtonText() const;
base::string16 GetToastXml() const;
std::u16string GetCloseButtonText() const;
std::u16string GetToastXml() const;
// Prop Setters
void SetTitle(const base::string16& new_title);
void SetSubtitle(const base::string16& new_subtitle);
void SetBody(const base::string16& new_body);
void SetTitle(const std::u16string& new_title);
void SetSubtitle(const std::u16string& new_subtitle);
void SetBody(const std::u16string& new_body);
void SetSilent(bool new_silent);
void SetHasReply(bool new_has_reply);
void SetUrgency(const base::string16& new_urgency);
void SetTimeoutType(const base::string16& new_timeout_type);
void SetReplyPlaceholder(const base::string16& new_reply_placeholder);
void SetSound(const base::string16& sound);
void SetUrgency(const std::u16string& new_urgency);
void SetTimeoutType(const std::u16string& new_timeout_type);
void SetReplyPlaceholder(const std::u16string& new_reply_placeholder);
void SetSound(const std::u16string& sound);
void SetActions(const std::vector<electron::NotificationAction>& actions);
void SetCloseButtonText(const base::string16& text);
void SetToastXml(const base::string16& new_toast_xml);
void SetCloseButtonText(const std::u16string& text);
void SetToastXml(const std::u16string& new_toast_xml);
private:
base::string16 title_;
base::string16 subtitle_;
base::string16 body_;
std::u16string title_;
std::u16string subtitle_;
std::u16string body_;
gfx::Image icon_;
base::string16 icon_path_;
std::u16string icon_path_;
bool has_icon_ = false;
bool silent_ = false;
bool has_reply_ = false;
base::string16 timeout_type_;
base::string16 reply_placeholder_;
base::string16 sound_;
base::string16 urgency_;
std::u16string timeout_type_;
std::u16string reply_placeholder_;
std::u16string sound_;
std::u16string urgency_;
std::vector<electron::NotificationAction> actions_;
base::string16 close_button_text_;
base::string16 toast_xml_;
std::u16string close_button_text_;
std::u16string toast_xml_;
electron::NotificationPresenter* presenter_;

View file

@ -343,7 +343,7 @@ void SimpleURLLoaderWrapper::OnAuthRequired(
auto cb = base::BindOnce(
[](mojo::Remote<network::mojom::AuthChallengeResponder> auth_responder,
gin::Arguments* args) {
base::string16 username_str, password_str;
std::u16string username_str, password_str;
if (!args->GetNext(&username_str) || !args->GetNext(&password_str)) {
auth_responder->OnAuthCredentials(base::nullopt);
return;

View file

@ -408,7 +408,7 @@ base::Optional<base::TimeDelta> GetCursorBlinkInterval() {
// This will return false if no printer with the provided device_name can be
// found on the network. We need to check this because Chromium does not do
// sanity checking of device_name validity and so will crash on invalid names.
bool IsDeviceNameValid(const base::string16& device_name) {
bool IsDeviceNameValid(const std::u16string& device_name) {
#if defined(OS_MAC)
base::ScopedCFTypeRef<CFStringRef> new_printer_id(
base::SysUTF16ToCFStringRef(device_name));
@ -423,7 +423,7 @@ bool IsDeviceNameValid(const base::string16& device_name) {
return true;
}
base::string16 GetDefaultPrinterAsync() {
std::u16string GetDefaultPrinterAsync() {
#if defined(OS_WIN)
// Blocking is needed here because Windows printer drivers are oftentimes
// not thread-safe and have to be accessed on the UI thread.
@ -958,9 +958,9 @@ void WebContents::Destroy() {
bool WebContents::DidAddMessageToConsole(
content::WebContents* source,
blink::mojom::ConsoleMessageLevel level,
const base::string16& message,
const std::u16string& message,
int32_t line_no,
const base::string16& source_id) {
const std::u16string& source_id) {
return Emit("console-message", static_cast<int32_t>(level), message, line_no,
source_id);
}
@ -1717,7 +1717,7 @@ void WebContents::DidFinishNavigation(
}
void WebContents::TitleWasSet(content::NavigationEntry* entry) {
base::string16 final_title;
std::u16string final_title;
bool explicit_set = true;
if (entry) {
auto title = entry->GetTitle();
@ -1983,7 +1983,7 @@ GURL WebContents::GetURL() const {
return web_contents()->GetURL();
}
base::string16 WebContents::GetTitle() const {
std::u16string WebContents::GetTitle() const {
return web_contents()->GetTitle();
}
@ -2292,9 +2292,9 @@ bool WebContents::IsCurrentlyAudible() {
void WebContents::OnGetDefaultPrinter(
base::Value print_settings,
printing::CompletionCallback print_callback,
base::string16 device_name,
std::u16string device_name,
bool silent,
base::string16 default_printer) {
std::u16string default_printer) {
// The content::WebContents might be already deleted at this point, and the
// PrintViewManagerBasic class does not do null check.
if (!web_contents()) {
@ -2303,7 +2303,7 @@ void WebContents::OnGetDefaultPrinter(
return;
}
base::string16 printer_name =
std::u16string printer_name =
device_name.empty() ? default_printer : device_name;
// If there are no valid printers available on the network, we bail.
@ -2401,7 +2401,7 @@ void WebContents::Print(gin::Arguments* args) {
// We set the default to the system's default printer and only update
// if at the Chromium level if the user overrides.
// Printer device name as opened by the OS.
base::string16 device_name;
std::u16string device_name;
options.Get("deviceName", &device_name);
if (!device_name.empty() && !IsDeviceNameValid(device_name)) {
gin_helper::ErrorThrower(args->isolate())
@ -2570,16 +2570,16 @@ void WebContents::Unselect() {
web_contents()->CollapseSelection();
}
void WebContents::Replace(const base::string16& word) {
void WebContents::Replace(const std::u16string& word) {
web_contents()->Replace(word);
}
void WebContents::ReplaceMisspelling(const base::string16& word) {
void WebContents::ReplaceMisspelling(const std::u16string& word) {
web_contents()->ReplaceMisspelling(word);
}
uint32_t WebContents::FindInPage(gin::Arguments* args) {
base::string16 search_text;
std::u16string search_text;
if (!args->GetNext(&search_text) || search_text.empty()) {
gin_helper::ErrorThrower(args->isolate())
.ThrowError("Must provide a non-empty search content");

View file

@ -156,7 +156,7 @@ class WebContents : public gin::Wrappable<WebContents>,
void LoadURL(const GURL& url, const gin_helper::Dictionary& options);
void DownloadURL(const GURL& url);
GURL GetURL() const;
base::string16 GetTitle() const;
std::u16string GetTitle() const;
bool IsLoading() const;
bool IsLoadingMainFrame() const;
bool IsWaitingForResponse() const;
@ -201,9 +201,9 @@ class WebContents : public gin::Wrappable<WebContents>,
#if BUILDFLAG(ENABLE_PRINTING)
void OnGetDefaultPrinter(base::Value print_settings,
printing::CompletionCallback print_callback,
base::string16 device_name,
std::u16string device_name,
bool silent,
base::string16 default_printer);
std::u16string default_printer);
void Print(gin::Arguments* args);
// Print current page as PDF.
v8::Local<v8::Promise> PrintToPDF(base::DictionaryValue settings);
@ -225,8 +225,8 @@ class WebContents : public gin::Wrappable<WebContents>,
void Delete();
void SelectAll();
void Unselect();
void Replace(const base::string16& word);
void ReplaceMisspelling(const base::string16& word);
void Replace(const std::u16string& word);
void ReplaceMisspelling(const std::u16string& word);
uint32_t FindInPage(gin::Arguments* args);
void StopFindInPage(content::StopFindAction action);
void ShowDefinitionForSelection();
@ -444,9 +444,9 @@ class WebContents : public gin::Wrappable<WebContents>,
// content::WebContentsDelegate:
bool DidAddMessageToConsole(content::WebContents* source,
blink::mojom::ConsoleMessageLevel level,
const base::string16& message,
const std::u16string& message,
int32_t line_no,
const base::string16& source_id) override;
const std::u16string& source_id) override;
bool IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,

View file

@ -78,7 +78,7 @@ bool WebFrameMain::CheckRenderFrame() const {
v8::Local<v8::Promise> WebFrameMain::ExecuteJavaScript(
gin::Arguments* args,
const base::string16& code) {
const std::u16string& code) {
gin_helper::Promise<base::Value> promise(args->isolate());
v8::Local<v8::Promise> handle = promise.GetHandle();

View file

@ -78,7 +78,7 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
void Connect();
v8::Local<v8::Promise> ExecuteJavaScript(gin::Arguments* args,
const base::string16& code);
const std::u16string& code);
bool Reload();
void Send(v8::Isolate* isolate,
bool internal,