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/environment.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
13 #include "base/xdg_util.h" | 13 #include "base/xdg_util.h" |
14 | 14 |
15 namespace gtk_util { | 15 namespace gtk_util { |
16 | 16 |
17 void GetWidgetSizeFromResources( | 17 void GetWidgetSizeFromResources( |
18 GtkWidget* widget, int width_chars, int height_lines, | 18 GtkWidget* widget, int width_chars, int height_lines, |
19 int* width, int* height) { | 19 int* width, int* height) { |
20 DCHECK(GTK_WIDGET_REALIZED(widget)) | 20 DCHECK(GTK_WIDGET_REALIZED(widget)) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 pango_font_metrics_get_descent(metrics)) * | 70 pango_font_metrics_get_descent(metrics)) * |
71 height_lines / PANGO_SCALE); | 71 height_lines / PANGO_SCALE); |
72 } | 72 } |
73 pango_font_metrics_unref(metrics); | 73 pango_font_metrics_unref(metrics); |
74 g_object_unref(context); | 74 g_object_unref(context); |
75 } | 75 } |
76 | 76 |
77 void ApplyMessageDialogQuirks(GtkWidget* dialog) { | 77 void ApplyMessageDialogQuirks(GtkWidget* dialog) { |
78 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { | 78 if (gtk_window_get_modal(GTK_WINDOW(dialog))) { |
79 // Work around a KDE 3 window manager bug. | 79 // Work around a KDE 3 window manager bug. |
80 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); | 80 scoped_ptr<base::Environment> env(base::Environment::Create()); |
81 if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) | 81 if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) |
82 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); | 82 gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 } // namespace gtk_util | 86 } // namespace gtk_util |
OLD | NEW |