mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
2757472: Reland "Reland "[LSC] Remove base::string16 alias""
https://chromium-review.googlesource.com/c/chromium/src/+/2757472
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user