OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/gtk/gtk_util.h" | 5 #include "chrome/browser/gtk/gtk_util.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 | 9 |
10 #include <cstdarg> | 10 #include <cstdarg> |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 string16 GetStockPreferencesMenuLabel() { | 1052 string16 GetStockPreferencesMenuLabel() { |
1053 GtkStockItem stock_item; | 1053 GtkStockItem stock_item; |
1054 string16 preferences; | 1054 string16 preferences; |
1055 if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) { | 1055 if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) { |
1056 const char16 kUnderscore[] = { '_', 0 }; | 1056 const char16 kUnderscore[] = { '_', 0 }; |
1057 RemoveChars(UTF8ToUTF16(stock_item.label), kUnderscore, &preferences); | 1057 RemoveChars(UTF8ToUTF16(stock_item.label), kUnderscore, &preferences); |
1058 } | 1058 } |
1059 return preferences; | 1059 return preferences; |
1060 } | 1060 } |
1061 | 1061 |
| 1062 bool IsWidgetAncestryVisible(GtkWidget* widget) { |
| 1063 GtkWidget* parent = widget; |
| 1064 while (parent && GTK_WIDGET_VISIBLE(parent)) |
| 1065 parent = parent->parent; |
| 1066 return !parent; |
| 1067 } |
| 1068 |
1062 } // namespace gtk_util | 1069 } // namespace gtk_util |
OLD | NEW |