OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/gtk_util.h" | 5 #include "chrome/browser/ui/gtk/gtk_util.h" |
6 | 6 |
7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cstdarg> | 10 #include <cstdarg> |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 gtk_window_get_size(GTK_WINDOW(dialog), &width, &height); | 940 gtk_window_get_size(GTK_WINDOW(dialog), &width, &height); |
941 | 941 |
942 return gfx::Rect(x, y, width, height); | 942 return gfx::Rect(x, y, width, height); |
943 } | 943 } |
944 | 944 |
945 string16 GetStockPreferencesMenuLabel() { | 945 string16 GetStockPreferencesMenuLabel() { |
946 GtkStockItem stock_item; | 946 GtkStockItem stock_item; |
947 string16 preferences; | 947 string16 preferences; |
948 if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) { | 948 if (gtk_stock_lookup(GTK_STOCK_PREFERENCES, &stock_item)) { |
949 const char16 kUnderscore[] = { '_', 0 }; | 949 const char16 kUnderscore[] = { '_', 0 }; |
950 RemoveChars(UTF8ToUTF16(stock_item.label), kUnderscore, &preferences); | 950 base::RemoveChars(UTF8ToUTF16(stock_item.label), kUnderscore, &preferences); |
951 } | 951 } |
952 return preferences; | 952 return preferences; |
953 } | 953 } |
954 | 954 |
955 bool IsWidgetAncestryVisible(GtkWidget* widget) { | 955 bool IsWidgetAncestryVisible(GtkWidget* widget) { |
956 GtkWidget* parent = widget; | 956 GtkWidget* parent = widget; |
957 while (parent && gtk_widget_get_visible(parent)) | 957 while (parent && gtk_widget_get_visible(parent)) |
958 parent = gtk_widget_get_parent(parent); | 958 parent = gtk_widget_get_parent(parent); |
959 return !parent; | 959 return !parent; |
960 } | 960 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { | 992 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { |
993 // Work around a KDE 3 window manager bug. | 993 // Work around a KDE 3 window manager bug. |
994 scoped_ptr<base::Environment> env(base::Environment::Create()); | 994 scoped_ptr<base::Environment> env(base::Environment::Create()); |
995 if (base::nix::DESKTOP_ENVIRONMENT_KDE3 == | 995 if (base::nix::DESKTOP_ENVIRONMENT_KDE3 == |
996 base::nix::GetDesktopEnvironment(env.get())) | 996 base::nix::GetDesktopEnvironment(env.get())) |
997 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); | 997 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); |
998 } | 998 } |
999 } | 999 } |
1000 | 1000 |
1001 } // namespace gtk_util | 1001 } // namespace gtk_util |
OLD | NEW |