From 14bfa1bf47088f9173e461e776027cdd921329cb Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 13 Sep 2021 16:39:52 +0200 Subject: [PATCH] fix: iwyu --- shell/browser/ui/gtk_util.cc | 18 +++++++++++++++++- shell/browser/ui/gtk_util.h | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/shell/browser/ui/gtk_util.cc b/shell/browser/ui/gtk_util.cc index 2c9e3992d1df1..ba6d6472a37bf 100644 --- a/shell/browser/ui/gtk_util.cc +++ b/shell/browser/ui/gtk_util.cc @@ -8,12 +8,14 @@ #include #include +#include + #include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkUnPreMultiply.h" -#include "ui/gtk/gtk_compat.h" +#include "ui/gtk/gtk_compat.h" // nogncheck namespace gtk_util { @@ -37,6 +39,20 @@ const char* GetCancelLabel() { return cancel; } +const char* GetOpenLabel() { + if (!gtk::GtkCheckVersion(4)) + return "gtk-open"; // In GTK3, this is GTK_STOCK_OPEN. + static const char* open = GtkGettext("_Open"); + return open; +} + +const char* GetSaveLabel() { + if (!gtk::GtkCheckVersion(4)) + return "gtk-save"; // In GTK3, this is GTK_STOCK_SAVE. + static const char* save = GtkGettext("_Save"); + return save; +} + const char* GetOkLabel() { if (!gtk::GtkCheckVersion(4)) return "gtk-ok"; // In GTK3, this is GTK_STOCK_OK. diff --git a/shell/browser/ui/gtk_util.h b/shell/browser/ui/gtk_util.h index de2e2ed66e6f3..5d77ec668aab8 100644 --- a/shell/browser/ui/gtk_util.h +++ b/shell/browser/ui/gtk_util.h @@ -15,6 +15,8 @@ const char* GettextPackage(); const char* GtkGettext(const char* str); const char* GetCancelLabel(); +const char* GetOpenLabel(); +const char* GetSaveLabel(); const char* GetOkLabel(); const char* GetNoLabel(); const char* GetYesLabel();