Skip to content

Commit

Permalink
fix: iwyu
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Sep 21, 2021
1 parent 3f76436 commit 14bfa1b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion shell/browser/ui/gtk_util.cc
Expand Up @@ -8,12 +8,14 @@
#include <gtk/gtk.h>
#include <stdint.h>

#include <string>

#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 {

Expand All @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions shell/browser/ui/gtk_util.h
Expand Up @@ -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();
Expand Down

0 comments on commit 14bfa1b

Please sign in to comment.