Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1116)

Unified Diff: chrome/browser/ui/gtk/gtk_util.cc

Issue 8588068: GTK: Create the start of a compatibility header wrapping deprecated methods. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to ToT and remove views/ cleanups. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/gtk_chrome_link_button.cc ('k') | chrome/browser/ui/gtk/hover_controller_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/gtk_util.cc
diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc
index b5fa9417040a47cee7d60df3a968a56e34475592..b00c0628ea410f1f2ed2a0e07a5e24e58bf53aba 100644
--- a/chrome/browser/ui/gtk/gtk_util.cc
+++ b/chrome/browser/ui/gtk/gtk_util.cc
@@ -37,6 +37,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/events.h"
+#include "ui/base/gtk/gtk_compat.h"
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -101,7 +102,7 @@ gboolean OnMouseButtonReleased(GtkWidget* widget, GdkEventButton* event,
// Returns the approximate number of characters that can horizontally fit in
// |pixel_width| pixels.
int GetCharacterWidthForPixels(GtkWidget* widget, int pixel_width) {
- DCHECK(GTK_WIDGET_REALIZED(widget))
+ DCHECK(gtk_widget_get_realized(widget))
<< " widget must be realized to compute font metrics correctly";
PangoContext* context = gtk_widget_create_pango_context(widget);
@@ -274,7 +275,7 @@ GtkWidget* CreateBoldLabel(const std::string& text) {
void GetWidgetSizeFromCharacters(
GtkWidget* widget, double width_chars, double height_lines,
int* width, int* height) {
- DCHECK(GTK_WIDGET_REALIZED(widget))
+ DCHECK(gtk_widget_get_realized(widget))
<< " widget must be realized to compute font metrics correctly";
PangoContext* context = gtk_widget_create_pango_context(widget);
PangoFontMetrics* metrics = pango_context_get_metrics(context,
@@ -297,7 +298,7 @@ void GetWidgetSizeFromCharacters(
void GetWidgetSizeFromResources(
GtkWidget* widget, int width_chars, int height_lines,
int* width, int* height) {
- DCHECK(GTK_WIDGET_REALIZED(widget))
+ DCHECK(gtk_widget_get_realized(widget))
<< " widget must be realized to compute font metrics correctly";
double chars = 0;
@@ -841,11 +842,11 @@ void SetAlwaysShowImage(GtkWidget* image_menu_item) {
}
gfx::Rect GetWidgetRectRelativeToToplevel(GtkWidget* widget) {
- DCHECK(GTK_WIDGET_REALIZED(widget));
+ DCHECK(gtk_widget_get_realized(widget));
GtkWidget* toplevel = gtk_widget_get_toplevel(widget);
DCHECK(toplevel);
- DCHECK(GTK_WIDGET_REALIZED(toplevel));
+ DCHECK(gtk_widget_get_realized(toplevel));
gint x = 0, y = 0;
gtk_widget_translate_coordinates(widget,
@@ -1145,7 +1146,7 @@ void SetLabelWidth(GtkWidget* label, int pixel_width) {
gtk_widget_set_size_request(label, pixel_width, -1);
} else {
// The label has to be realized before we can adjust its width.
- if (GTK_WIDGET_REALIZED(label)) {
+ if (gtk_widget_get_realized(label)) {
OnLabelRealize(label, GINT_TO_POINTER(pixel_width));
} else {
g_signal_connect(label, "realize", G_CALLBACK(OnLabelRealize),
« no previous file with comments | « chrome/browser/ui/gtk/gtk_chrome_link_button.cc ('k') | chrome/browser/ui/gtk/hover_controller_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698