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

@ -89,8 +89,8 @@ void AutofillPopup::Hide() {
}
}
void AutofillPopup::SetItems(const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
void AutofillPopup::SetItems(const std::vector<std::u16string>& values,
const std::vector<std::u16string>& labels) {
DCHECK(view_);
values_ = values;
labels_ = labels;
@ -184,11 +184,11 @@ int AutofillPopup::GetLineCount() {
return values_.size();
}
base::string16 AutofillPopup::GetValueAt(int i) {
std::u16string AutofillPopup::GetValueAt(int i) {
return values_.at(i);
}
base::string16 AutofillPopup::GetLabelAt(int i) {
std::u16string AutofillPopup::GetLabelAt(int i) {
return labels_.at(i);
}

View file

@ -30,8 +30,8 @@ class AutofillPopup : public views::ViewObserver {
const gfx::RectF& bounds);
void Hide();
void SetItems(const std::vector<base::string16>& values,
const std::vector<base::string16>& labels);
void SetItems(const std::vector<std::u16string>& values,
const std::vector<std::u16string>& labels);
void UpdatePopupBounds();
gfx::Rect popup_bounds_in_view();
@ -53,8 +53,8 @@ class AutofillPopup : public views::ViewObserver {
ui::NativeTheme::ColorId GetBackgroundColorIDForRow(int index) const;
int GetLineCount();
base::string16 GetValueAt(int i);
base::string16 GetLabelAt(int i);
std::u16string GetValueAt(int i);
std::u16string GetLabelAt(int i);
int LineFromY(int y) const;
int selected_index_;
@ -66,8 +66,8 @@ class AutofillPopup : public views::ViewObserver {
gfx::Rect element_bounds_;
// Datalist suggestions
std::vector<base::string16> values_;
std::vector<base::string16> labels_;
std::vector<std::u16string> values_;
std::vector<std::u16string> labels_;
// Font lists for the suggestions
gfx::FontList smaller_font_list_;

View file

@ -197,7 +197,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Locate & retain the recent documents menu item
if (!recentDocumentsMenuItem_) {
base::string16 title = base::ASCIIToUTF16("Open Recent");
std::u16string title = base::ASCIIToUTF16("Open Recent");
NSString* openTitle = l10n_util::FixUpWindowsStyleLabel(title);
recentDocumentsMenuItem_.reset([[[[[NSApp mainMenu]
@ -320,7 +320,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
- (void)addItemToMenu:(NSMenu*)menu
atIndex:(NSInteger)index
fromModel:(electron::ElectronMenuModel*)model {
base::string16 label16 = model->GetLabelAt(index);
std::u16string label16 = model->GetLabelAt(index);
NSString* label = l10n_util::FixUpWindowsStyleLabel(label16);
base::scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc]
@ -333,14 +333,14 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
if (icon.IsImage())
[item setImage:icon.GetImage().ToNSImage()];
base::string16 toolTip = model->GetToolTipAt(index);
std::u16string toolTip = model->GetToolTipAt(index);
[item setToolTip:base::SysUTF16ToNSString(toolTip)];
base::string16 role = model->GetRoleAt(index);
std::u16string role = model->GetRoleAt(index);
electron::ElectronMenuModel::ItemType type = model->GetTypeAt(index);
if (role == base::ASCIIToUTF16("services")) {
base::string16 title = base::ASCIIToUTF16("Services");
std::u16string title = base::ASCIIToUTF16("Services");
NSString* label = l10n_util::FixUpWindowsStyleLabel(title);
[item setTarget:nil];

View file

@ -27,38 +27,38 @@ ElectronMenuModel::ElectronMenuModel(Delegate* delegate)
ElectronMenuModel::~ElectronMenuModel() = default;
void ElectronMenuModel::SetToolTip(int index, const base::string16& toolTip) {
void ElectronMenuModel::SetToolTip(int index, const std::u16string& toolTip) {
int command_id = GetCommandIdAt(index);
toolTips_[command_id] = toolTip;
}
base::string16 ElectronMenuModel::GetToolTipAt(int index) {
std::u16string ElectronMenuModel::GetToolTipAt(int index) {
const int command_id = GetCommandIdAt(index);
const auto iter = toolTips_.find(command_id);
return iter == std::end(toolTips_) ? base::string16() : iter->second;
return iter == std::end(toolTips_) ? std::u16string() : iter->second;
}
void ElectronMenuModel::SetRole(int index, const base::string16& role) {
void ElectronMenuModel::SetRole(int index, const std::u16string& role) {
int command_id = GetCommandIdAt(index);
roles_[command_id] = role;
}
base::string16 ElectronMenuModel::GetRoleAt(int index) {
std::u16string ElectronMenuModel::GetRoleAt(int index) {
const int command_id = GetCommandIdAt(index);
const auto iter = roles_.find(command_id);
return iter == std::end(roles_) ? base::string16() : iter->second;
return iter == std::end(roles_) ? std::u16string() : iter->second;
}
void ElectronMenuModel::SetSecondaryLabel(int index,
const base::string16& sublabel) {
const std::u16string& sublabel) {
int command_id = GetCommandIdAt(index);
sublabels_[command_id] = sublabel;
}
base::string16 ElectronMenuModel::GetSecondaryLabelAt(int index) const {
std::u16string ElectronMenuModel::GetSecondaryLabelAt(int index) const {
int command_id = GetCommandIdAt(index);
const auto iter = sublabels_.find(command_id);
return iter == std::end(sublabels_) ? base::string16() : iter->second;
return iter == std::end(sublabels_) ? std::u16string() : iter->second;
}
bool ElectronMenuModel::GetAcceleratorAtWithParams(

View file

@ -77,12 +77,12 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
void AddObserver(Observer* obs) { observers_.AddObserver(obs); }
void RemoveObserver(Observer* obs) { observers_.RemoveObserver(obs); }
void SetToolTip(int index, const base::string16& toolTip);
base::string16 GetToolTipAt(int index);
void SetRole(int index, const base::string16& role);
base::string16 GetRoleAt(int index);
void SetSecondaryLabel(int index, const base::string16& sublabel);
base::string16 GetSecondaryLabelAt(int index) const override;
void SetToolTip(int index, const std::u16string& toolTip);
std::u16string GetToolTipAt(int index);
void SetRole(int index, const std::u16string& role);
std::u16string GetRoleAt(int index);
void SetSecondaryLabel(int index, const std::u16string& sublabel);
std::u16string GetSecondaryLabelAt(int index) const override;
bool GetAcceleratorAtWithParams(int index,
bool use_default_accelerator,
ui::Accelerator* accelerator) const;
@ -114,9 +114,9 @@ class ElectronMenuModel : public ui::SimpleMenuModel {
base::Optional<SharingItem> sharing_item_;
#endif
std::map<int, base::string16> toolTips_; // command id -> tooltip
std::map<int, base::string16> roles_; // command id -> role
std::map<int, base::string16> sublabels_; // command id -> sublabel
std::map<int, std::u16string> toolTips_; // command id -> tooltip
std::map<int, std::u16string> roles_; // command id -> role
std::map<int, std::u16string> sublabels_; // command id -> sublabel
base::ObserverList<Observer> observers_;
base::WeakPtrFactory<ElectronMenuModel> weak_factory_{this};

View file

@ -157,7 +157,7 @@ namespace gtkui {
AppIndicatorIcon::AppIndicatorIcon(std::string id,
const gfx::ImageSkia& image,
const base::string16& tool_tip)
const std::u16string& tool_tip)
: id_(id) {
std::unique_ptr<base::Environment> env(base::Environment::Create());
desktop_env_ = base::nix::GetDesktopEnvironment(env.get());
@ -215,7 +215,7 @@ void AppIndicatorIcon::SetIcon(const gfx::ImageSkia& image) {
}
}
void AppIndicatorIcon::SetToolTip(const base::string16& tool_tip) {
void AppIndicatorIcon::SetToolTip(const std::u16string& tool_tip) {
DCHECK(!tool_tip_.empty());
tool_tip_ = base::UTF16ToUTF8(tool_tip);
UpdateClickActionReplacementMenuItem();

View file

@ -41,7 +41,7 @@ class AppIndicatorIcon : public views::StatusIconLinux {
// icons.
AppIndicatorIcon(std::string id,
const gfx::ImageSkia& image,
const base::string16& tool_tip);
const std::u16string& tool_tip);
~AppIndicatorIcon() override;
// Indicates whether libappindicator so could be opened.
@ -49,7 +49,7 @@ class AppIndicatorIcon : public views::StatusIconLinux {
// Overridden from views::StatusIconLinux:
void SetIcon(const gfx::ImageSkia& image) override;
void SetToolTip(const base::string16& tool_tip) override;
void SetToolTip(const std::u16string& tool_tip) override;
void UpdatePlatformContextMenu(ui::MenuModel* menu) override;
void RefreshPlatformContextMenu() override;

View file

@ -20,7 +20,7 @@ namespace electron {
namespace gtkui {
GtkStatusIcon::GtkStatusIcon(const gfx::ImageSkia& image,
const base::string16& tool_tip) {
const std::u16string& tool_tip) {
GdkPixbuf* pixbuf = gtk_util::GdkPixbufFromSkBitmap(*image.bitmap());
{
// GTK has a bug that leaks 384 bytes when creating a GtkStatusIcon. It
@ -50,7 +50,7 @@ void GtkStatusIcon::SetIcon(const gfx::ImageSkia& image) {
g_object_unref(pixbuf);
}
void GtkStatusIcon::SetToolTip(const base::string16& tool_tip) {
void GtkStatusIcon::SetToolTip(const std::u16string& tool_tip) {
gtk_status_icon_set_tooltip_text(gtk_status_icon_,
base::UTF16ToUTF8(tool_tip).c_str());
}

View file

@ -32,12 +32,12 @@ class AppIndicatorIconMenu;
// GtkStatusIcon).
class GtkStatusIcon : public views::StatusIconLinux {
public:
GtkStatusIcon(const gfx::ImageSkia& image, const base::string16& tool_tip);
GtkStatusIcon(const gfx::ImageSkia& image, const std::u16string& tool_tip);
~GtkStatusIcon() override;
// Overridden from views::StatusIconLinux:
void SetIcon(const gfx::ImageSkia& image) override;
void SetToolTip(const base::string16& tool_tip) override;
void SetToolTip(const std::u16string& tool_tip) override;
void UpdatePlatformContextMenu(ui::MenuModel* menu) override;
void RefreshPlatformContextMenu() override;

View file

@ -37,7 +37,7 @@ bool IsStatusIconSupported() {
std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
const gfx::ImageSkia& image,
const base::string16& tool_tip,
const std::u16string& tool_tip,
const char* id_prefix) {
#if GTK_CHECK_VERSION(3, 90, 0)
NOTIMPLEMENTED();

View file

@ -22,7 +22,7 @@ namespace gtkui {
bool IsStatusIconSupported();
std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
const gfx::ImageSkia& image,
const base::string16& tool_tip,
const std::u16string& tool_tip,
const char* id_prefix);
} // namespace gtkui

View file

@ -567,7 +567,7 @@ void InspectableWebContents::LoadCompleted() {
prefs->GetString("currentDockState", &current_dock_state);
base::RemoveChars(current_dock_state, "\"", &dock_state_);
}
base::string16 javascript = base::UTF8ToUTF16(
std::u16string javascript = base::UTF8ToUTF16(
"UI.DockController.instance().setDockSide(\"" + dock_state_ + "\");");
GetDevToolsWebContents()->GetMainFrame()->ExecuteJavaScript(
javascript, base::NullCallback());
@ -902,7 +902,7 @@ void InspectableWebContents::DispatchProtocolMessage(
if (str_message.size() < kMaxMessageChunkSize) {
std::string param;
base::EscapeJSONString(str_message, true, &param);
base::string16 javascript =
std::u16string javascript =
base::UTF8ToUTF16("DevToolsAPI.dispatchMessage(" + param + ");");
GetDevToolsWebContents()->GetMainFrame()->ExecuteJavaScript(
javascript, base::NullCallback());
@ -949,9 +949,9 @@ void InspectableWebContents::WebContentsDestroyed() {
bool InspectableWebContents::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) {
logging::LogMessage("CONSOLE", line_no,
blink::ConsoleMessageLevelToLogSeverity(level))
.stream()

View file

@ -177,9 +177,9 @@ class InspectableWebContents
// 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 HandleKeyboardEvent(content::WebContents*,
const content::NativeWebKeyboardEvent&) override;
void CloseContents(content::WebContents* source) override;

View file

@ -51,7 +51,7 @@ class InspectableWebContentsView {
virtual void SetIsDocked(bool docked, bool activate) = 0;
virtual void SetContentsResizingStrategy(
const DevToolsContentsResizingStrategy& strategy) = 0;
virtual void SetTitle(const base::string16& title) = 0;
virtual void SetTitle(const std::u16string& title) = 0;
private:
InspectableWebContentsViewDelegate* delegate_ = nullptr; // weak references.

View file

@ -33,7 +33,7 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView {
void SetIsDocked(bool docked, bool activate) override;
void SetContentsResizingStrategy(
const DevToolsContentsResizingStrategy& strategy) override;
void SetTitle(const base::string16& title) override;
void SetTitle(const std::u16string& title) override;
InspectableWebContents* inspectable_web_contents() {
return inspectable_web_contents_;

View file

@ -58,7 +58,7 @@ void InspectableWebContentsViewMac::SetContentsResizingStrategy(
[view_ setContentsResizingStrategy:strategy];
}
void InspectableWebContentsViewMac::SetTitle(const base::string16& title) {
void InspectableWebContentsViewMac::SetTitle(const std::u16string& title) {
[view_ setTitle:base::SysUTF16ToNSString(title)];
}

View file

@ -56,7 +56,7 @@ void ShowMessageBox(const MessageBoxSettings& settings,
// Like ShowMessageBox with simplest settings, but safe to call at very early
// stage of application.
void ShowErrorBox(const base::string16& title, const base::string16& content);
void ShowErrorBox(const std::u16string& title, const std::u16string& content);
} // namespace electron

View file

@ -220,7 +220,7 @@ void ShowMessageBox(const MessageBoxSettings& settings,
(new GtkMessageBox(settings))->RunAsynchronous(std::move(callback));
}
void ShowErrorBox(const base::string16& title, const base::string16& content) {
void ShowErrorBox(const std::u16string& title, const std::u16string& content) {
if (Browser::Get()->is_ready()) {
electron::MessageBoxSettings settings;
settings.type = electron::MessageBoxType::kError;

View file

@ -146,7 +146,7 @@ void ShowMessageBox(const MessageBoxSettings& settings,
}
}
void ShowErrorBox(const base::string16& title, const base::string16& content) {
void ShowErrorBox(const std::u16string& title, const std::u16string& content) {
NSAlert* alert = [[NSAlert alloc] init];
[alert setMessageText:base::SysUTF16ToNSString(title)];
[alert setInformativeText:base::SysUTF16ToNSString(content)];

View file

@ -39,8 +39,8 @@ struct CommonButtonID {
int button;
int id;
};
CommonButtonID GetCommonID(const base::string16& button) {
base::string16 lower = base::ToLowerASCII(button);
CommonButtonID GetCommonID(const std::u16string& button) {
std::u16string lower = base::ToLowerASCII(button);
if (lower == L"ok")
return {TDCBF_OK_BUTTON, IDOK};
else if (lower == L"yes")
@ -58,7 +58,7 @@ CommonButtonID GetCommonID(const base::string16& button) {
// Determine whether the buttons are common buttons, if so map common ID
// to button ID.
void MapToCommonID(const std::vector<base::string16>& buttons,
void MapToCommonID(const std::vector<std::u16string>& buttons,
std::map<int, int>* id_map,
TASKDIALOG_COMMON_BUTTON_FLAGS* button_flags,
std::vector<TASKDIALOG_BUTTON>* dialog_buttons) {
@ -78,14 +78,14 @@ void MapToCommonID(const std::vector<base::string16>& buttons,
DialogResult ShowTaskDialogUTF16(NativeWindow* parent,
MessageBoxType type,
const std::vector<base::string16>& buttons,
const std::vector<std::u16string>& buttons,
int default_id,
int cancel_id,
bool no_link,
const base::string16& title,
const base::string16& message,
const base::string16& detail,
const base::string16& checkbox_label,
const std::u16string& title,
const std::u16string& message,
const std::u16string& detail,
const std::u16string& checkbox_label,
bool checkbox_checked,
const gfx::ImageSkia& icon) {
TASKDIALOG_FLAGS flags =
@ -107,7 +107,7 @@ DialogResult ShowTaskDialogUTF16(NativeWindow* parent,
// TaskDialogIndirect doesn't allow empty name, if we set empty title it
// will show "electron.exe" in title.
base::string16 app_name = base::UTF8ToUTF16(Browser::Get()->GetName());
std::u16string app_name = base::UTF8ToUTF16(Browser::Get()->GetName());
if (title.empty())
config.pszWindowTitle = app_name.c_str();
else
@ -185,14 +185,14 @@ DialogResult ShowTaskDialogUTF16(NativeWindow* parent,
}
DialogResult ShowTaskDialogUTF8(const MessageBoxSettings& settings) {
std::vector<base::string16> utf16_buttons;
std::vector<std::u16string> utf16_buttons;
for (const auto& button : settings.buttons)
utf16_buttons.push_back(base::UTF8ToUTF16(button));
const base::string16 title_16 = base::UTF8ToUTF16(settings.title);
const base::string16 message_16 = base::UTF8ToUTF16(settings.message);
const base::string16 detail_16 = base::UTF8ToUTF16(settings.detail);
const base::string16 checkbox_label_16 =
const std::u16string title_16 = base::UTF8ToUTF16(settings.title);
const std::u16string message_16 = base::UTF8ToUTF16(settings.message);
const std::u16string detail_16 = base::UTF8ToUTF16(settings.detail);
const std::u16string checkbox_label_16 =
base::UTF8ToUTF16(settings.checkbox_label);
return ShowTaskDialogUTF16(
@ -219,7 +219,7 @@ void ShowMessageBox(const MessageBoxSettings& settings,
std::move(callback)));
}
void ShowErrorBox(const base::string16& title, const base::string16& content) {
void ShowErrorBox(const std::u16string& title, const std::u16string& content) {
electron::UnresponsiveSuppressor suppressor;
ShowTaskDialogUTF16(nullptr, MessageBoxType::kError, {}, -1, 0, false,
L"Error", title, content, L"", false, gfx::ImageSkia());

View file

@ -64,8 +64,8 @@ class TrayIcon {
#else
gfx::Image icon;
#endif
base::string16 title;
base::string16 content;
std::u16string title;
std::u16string content;
bool large_icon = true;
bool no_sound = false;
bool respect_quiet_time = false;

View file

@ -47,7 +47,7 @@ const gfx::ImageSkia& TrayIconGtk::GetImage() const {
return image_;
}
const base::string16& TrayIconGtk::GetToolTip() const {
const std::u16string& TrayIconGtk::GetToolTip() const {
return tool_tip_;
}

View file

@ -33,14 +33,14 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
// The following four methods are only used by StatusIconLinuxDbus, which we
// aren't yet using, so they are given stub implementations.
const gfx::ImageSkia& GetImage() const override;
const base::string16& GetToolTip() const override;
const std::u16string& GetToolTip() const override;
ui::MenuModel* GetMenuModel() const override;
void OnImplInitializationFailed() override;
private:
std::unique_ptr<views::StatusIconLinux> icon_;
gfx::ImageSkia image_;
base::string16 tool_tip_;
std::u16string tool_tip_;
ui::MenuModel* menu_model_;
DISALLOW_COPY_AND_ASSIGN(TrayIconGtk);

View file

@ -37,7 +37,7 @@ class AutofillPopup;
// by |AutofillPopupViewViews|.
class AutofillPopupChildView : public views::View {
public:
explicit AutofillPopupChildView(const base::string16& suggestion)
explicit AutofillPopupChildView(const std::u16string& suggestion)
: suggestion_(suggestion) {
SetFocusBehavior(FocusBehavior::ALWAYS);
}
@ -48,7 +48,7 @@ class AutofillPopupChildView : public views::View {
// views::Views implementation
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
base::string16 suggestion_;
std::u16string suggestion_;
DISALLOW_COPY_AND_ASSIGN(AutofillPopupChildView);
};

View file

@ -47,8 +47,8 @@ bool ViewsDelegate::GetSavedWindowPlacement(
return false;
}
void ViewsDelegate::NotifyMenuItemFocused(const base::string16& menu_name,
const base::string16& menu_item_name,
void ViewsDelegate::NotifyMenuItemFocused(const std::u16string& menu_name,
const std::u16string& menu_item_name,
int item_index,
int item_count,
bool has_submenu) {}

View file

@ -29,8 +29,8 @@ class ViewsDelegate : public views::ViewsDelegate {
const std::string& window_name,
gfx::Rect* bounds,
ui::WindowShowState* show_state) const override;
void NotifyMenuItemFocused(const base::string16& menu_name,
const base::string16& menu_item_name,
void NotifyMenuItemFocused(const std::u16string& menu_name,
const std::u16string& menu_item_name,
int item_index,
int item_count,
bool has_submenu) override;

View file

@ -297,7 +297,7 @@ void GlobalMenuBarX11::RegisterAccelerator(DbusmenuMenuitem* item,
NOTIMPLEMENTED();
return;
}
std::string name = base::UTF16ToUTF8(base::string16(1, keysym));
std::string name = base::UTF16ToUTF8(std::u16string(1, keysym));
g_variant_builder_add(&builder, "s", name.c_str());
GVariant* inside_array = g_variant_builder_end(&builder);

View file

@ -46,7 +46,7 @@ class DevToolsWindowDelegate : public views::ClientView,
bool CanResize() const override { return true; }
bool CanMaximize() const override { return true; }
bool CanMinimize() const override { return true; }
base::string16 GetWindowTitle() const override { return shell_->GetTitle(); }
std::u16string GetWindowTitle() const override { return shell_->GetTitle(); }
gfx::ImageSkia GetWindowAppIcon() override { return GetWindowIcon(); }
gfx::ImageSkia GetWindowIcon() override { return icon_; }
views::Widget* GetWidget() override { return widget_; }
@ -202,7 +202,7 @@ void InspectableWebContentsViewViews::SetContentsResizingStrategy(
Layout();
}
void InspectableWebContentsViewViews::SetTitle(const base::string16& title) {
void InspectableWebContentsViewViews::SetTitle(const std::u16string& title) {
if (devtools_window_) {
title_ = title;
devtools_window_->UpdateWindowTitle();

View file

@ -39,13 +39,13 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
void SetIsDocked(bool docked, bool activate) override;
void SetContentsResizingStrategy(
const DevToolsContentsResizingStrategy& strategy) override;
void SetTitle(const base::string16& title) override;
void SetTitle(const std::u16string& title) override;
InspectableWebContents* inspectable_web_contents() {
return inspectable_web_contents_;
}
const base::string16& GetTitle() const { return title_; }
const std::u16string& GetTitle() const { return title_; }
private:
// views::View:
@ -62,7 +62,7 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
DevToolsContentsResizingStrategy strategy_;
bool devtools_visible_ = false;
views::WidgetDelegate* devtools_window_delegate_ = nullptr;
base::string16 title_;
std::u16string title_;
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewViews);
};

View file

@ -70,7 +70,7 @@ bool MenuDelegate::GetAccelerator(int id, ui::Accelerator* accelerator) const {
return adapter_->GetAccelerator(id, accelerator);
}
base::string16 MenuDelegate::GetLabel(int id) const {
std::u16string MenuDelegate::GetLabel(int id) const {
return adapter_->GetLabel(id);
}

View file

@ -46,7 +46,7 @@ class MenuDelegate : public views::MenuDelegate {
bool IsTriggerableEvent(views::MenuItemView* source,
const ui::Event& e) override;
bool GetAccelerator(int id, ui::Accelerator* accelerator) const override;
base::string16 GetLabel(int id) const override;
std::u16string GetLabel(int id) const override;
void GetLabelStyle(int id, LabelStyle* style) const override;
bool IsCommandEnabled(int id) const override;
bool IsCommandVisible(int id) const override;

View file

@ -21,7 +21,7 @@
namespace electron {
SubmenuButton::SubmenuButton(PressedCallback callback,
const base::string16& title,
const std::u16string& title,
const SkColor& background_color)
: views::MenuButton(callback, gfx::RemoveAccelerator(title)),
background_color_(background_color) {
@ -89,12 +89,12 @@ void SubmenuButton::PaintButtonContents(gfx::Canvas* canvas) {
}
}
bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
bool SubmenuButton::GetUnderlinePosition(const std::u16string& text,
char16_t* accelerator,
int* start,
int* end) const {
int pos, span;
base::string16 trimmed =
std::u16string trimmed =
gfx::LocateAndRemoveAcceleratorChar(text, &pos, &span);
if (pos > -1 && span != 0) {
*accelerator = base::ToUpperASCII(trimmed[pos]);
@ -106,7 +106,7 @@ bool SubmenuButton::GetUnderlinePosition(const base::string16& text,
return false;
}
void SubmenuButton::GetCharacterPosition(const base::string16& text,
void SubmenuButton::GetCharacterPosition(const std::u16string& text,
int index,
int* pos) const {
int height = 0;

View file

@ -17,7 +17,7 @@ namespace electron {
class SubmenuButton : public views::MenuButton {
public:
SubmenuButton(PressedCallback callback,
const base::string16& title,
const std::u16string& title,
const SkColor& background_color);
~SubmenuButton() override;
@ -36,11 +36,11 @@ class SubmenuButton : public views::MenuButton {
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
private:
bool GetUnderlinePosition(const base::string16& text,
bool GetUnderlinePosition(const std::u16string& text,
char16_t* accelerator,
int* start,
int* end) const;
void GetCharacterPosition(const base::string16& text,
void GetCharacterPosition(const std::u16string& text,
int index,
int* pos) const;

View file

@ -158,7 +158,7 @@ JumpListCategory::JumpListCategory() = default;
JumpListCategory::JumpListCategory(const JumpListCategory&) = default;
JumpListCategory::~JumpListCategory() = default;
JumpList::JumpList(const base::string16& app_id) : app_id_(app_id) {
JumpList::JumpList(const std::u16string& app_id) : app_id_(app_id) {
destinations_.CoCreateInstance(CLSID_DestinationList);
}

View file

@ -46,9 +46,9 @@ struct JumpListItem {
// For tasks this is the path to the program executable, for file links this
// is the full filename.
base::FilePath path;
base::string16 arguments;
base::string16 title;
base::string16 description;
std::u16string arguments;
std::u16string title;
std::u16string description;
base::FilePath working_dir;
base::FilePath icon_path;
int icon_index = 0;
@ -73,7 +73,7 @@ struct JumpListCategory {
};
Type type = Type::kTasks;
base::string16 name;
std::u16string name;
std::vector<JumpListItem> items;
JumpListCategory();
@ -88,7 +88,7 @@ class JumpList {
// |app_id| must be the Application User Model ID of the app for which the
// custom Jump List should be created/removed, it's usually obtained by
// calling GetCurrentProcessExplicitAppUserModelID().
explicit JumpList(const base::string16& app_id);
explicit JumpList(const std::u16string& app_id);
~JumpList();
// Starts a new transaction, must be called before appending any categories,
@ -111,7 +111,7 @@ class JumpList {
const std::vector<JumpListCategory>& categories);
private:
base::string16 app_id_;
std::u16string app_id_;
CComPtr<ICustomDestinationList> destinations_;
DISALLOW_COPY_AND_ASSIGN(JumpList);