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 "app/gtk_util.h" | 5 #include "app/gtk_util.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/env_var.h" |
10 #include "base/linux_util.h" | 11 #include "base/linux_util.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
13 | 14 |
14 namespace gtk_util { | 15 namespace gtk_util { |
15 | 16 |
16 void GetWidgetSizeFromResources( | 17 void GetWidgetSizeFromResources( |
17 GtkWidget* widget, int width_chars, int height_lines, | 18 GtkWidget* widget, int width_chars, int height_lines, |
18 int* width, int* height) { | 19 int* width, int* height) { |
19 DCHECK(GTK_WIDGET_REALIZED(widget)) | 20 DCHECK(GTK_WIDGET_REALIZED(widget)) |
(...skipping 29 matching lines...) Expand all Loading... |
49 pango_font_metrics_get_descent(metrics)) * | 50 pango_font_metrics_get_descent(metrics)) * |
50 height_lines / PANGO_SCALE); | 51 height_lines / PANGO_SCALE); |
51 } | 52 } |
52 pango_font_metrics_unref(metrics); | 53 pango_font_metrics_unref(metrics); |
53 g_object_unref(context); | 54 g_object_unref(context); |
54 } | 55 } |
55 | 56 |
56 void ApplyMessageDialogQuirks(GtkWidget* dialog) { | 57 void ApplyMessageDialogQuirks(GtkWidget* dialog) { |
57 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { | 58 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { |
58 // Work around a KDE 3 window manager bug. | 59 // Work around a KDE 3 window manager bug. |
59 scoped_ptr<base::EnvironmentVariableGetter> env( | 60 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); |
60 base::EnvironmentVariableGetter::Create()); | |
61 if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) | 61 if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) |
62 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); | 62 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 } // namespace gtk_util | 66 } // namespace gtk_util |
OLD | NEW |