fix 'GTK_STOCK_*' deprecation warnings

This commit is contained in:
Charles Kerr 2018-02-09 17:45:34 -06:00
parent e5eeab6e29
commit ffff400236

View file

@ -16,6 +16,8 @@
#include "chrome/browser/ui/libgtkui/skia_utils_gtk.h" #include "chrome/browser/ui/libgtkui/skia_utils_gtk.h"
#include "ui/views/widget/desktop_aura/x11_desktop_handler.h" #include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
#include <glib/gi18n.h>
#define ANSI_FOREGROUND_RED "\x1b[31m" #define ANSI_FOREGROUND_RED "\x1b[31m"
#define ANSI_FOREGROUND_BLACK "\x1b[30m" #define ANSI_FOREGROUND_BLACK "\x1b[30m"
#define ANSI_TEXT_BOLD "\x1b[1m" #define ANSI_TEXT_BOLD "\x1b[1m"
@ -124,16 +126,15 @@ class GtkMessageBox : public NativeWindowObserver {
} }
const char* TranslateToStock(int id, const std::string& text) { const char* TranslateToStock(int id, const std::string& text) {
std::string lower = base::ToLowerASCII(text); const std::string lower = base::ToLowerASCII(text);
if (lower == "cancel") if (lower == "cancel")
return GTK_STOCK_CANCEL; return _("_Cancel");
else if (lower == "no") if (lower == "no")
return GTK_STOCK_NO; return _("_No");
else if (lower == "ok") if (lower == "ok")
return GTK_STOCK_OK; return _("_OK");
else if (lower == "yes") if (lower == "yes")
return GTK_STOCK_YES; return _("_Yes");
else
return text.c_str(); return text.c_str();
} }