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

Side by Side Diff: chrome/browser/ui/gtk/rounded_window.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/rounded_window.h" 5 #include "chrome/browser/ui/gtk/rounded_window.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <math.h> 8 #include <math.h>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "chrome/browser/ui/gtk/gtk_util.h" 12 #include "chrome/browser/ui/gtk/gtk_util.h"
13 #include "ui/base/gtk/gtk_compat.h"
13 #include "ui/base/gtk/gtk_signal_registrar.h" 14 #include "ui/base/gtk/gtk_signal_registrar.h"
14 15
15 namespace gtk_util { 16 namespace gtk_util {
16 17
17 namespace { 18 namespace {
18 19
19 const char* kRoundedData = "rounded-window-data"; 20 const char* kRoundedData = "rounded-window-data";
20 21
21 // If the border radius is less than |kMinRoundedBorderSize|, we don't actually 22 // If the border radius is less than |kMinRoundedBorderSize|, we don't actually
22 // round the corners, we just truncate the corner. 23 // round the corners, we just truncate the corner.
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 g_object_set_data_full(G_OBJECT(widget), kRoundedData, 280 g_object_set_data_full(G_OBJECT(widget), kRoundedData,
280 data, FreeRoundedWindowData); 281 data, FreeRoundedWindowData);
281 282
282 if (gtk_widget_get_visible(widget)) 283 if (gtk_widget_get_visible(widget))
283 gtk_widget_queue_draw(widget); 284 gtk_widget_queue_draw(widget);
284 } 285 }
285 286
286 void StopActingAsRoundedWindow(GtkWidget* widget) { 287 void StopActingAsRoundedWindow(GtkWidget* widget) {
287 g_object_set_data(G_OBJECT(widget), kRoundedData, NULL); 288 g_object_set_data(G_OBJECT(widget), kRoundedData, NULL);
288 289
289 if (GTK_WIDGET_REALIZED(widget)) 290 if (gtk_widget_get_realized(widget))
290 gdk_window_shape_combine_mask(widget->window, NULL, 0, 0); 291 gdk_window_shape_combine_mask(widget->window, NULL, 0, 0);
291 292
292 if (gtk_widget_get_visible(widget)) 293 if (gtk_widget_get_visible(widget))
293 gtk_widget_queue_draw(widget); 294 gtk_widget_queue_draw(widget);
294 } 295 }
295 296
296 bool IsActingAsRoundedWindow(GtkWidget* widget) { 297 bool IsActingAsRoundedWindow(GtkWidget* widget) {
297 return g_object_get_data(G_OBJECT(widget), kRoundedData) != NULL; 298 return g_object_get_data(G_OBJECT(widget), kRoundedData) != NULL;
298 } 299 }
299 300
(...skipping 12 matching lines...) Expand all
312 313
313 void SetRoundedWindowBorderColor(GtkWidget* widget, GdkColor color) { 314 void SetRoundedWindowBorderColor(GtkWidget* widget, GdkColor color) {
314 DCHECK(widget); 315 DCHECK(widget);
315 RoundedWindowData* data = static_cast<RoundedWindowData*>( 316 RoundedWindowData* data = static_cast<RoundedWindowData*>(
316 g_object_get_data(G_OBJECT(widget), kRoundedData)); 317 g_object_get_data(G_OBJECT(widget), kRoundedData));
317 DCHECK(data); 318 DCHECK(data);
318 data->border_color = color; 319 data->border_color = color;
319 } 320 }
320 321
321 } // namespace gtk_util 322 } // namespace gtk_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc ('k') | chrome/browser/ui/gtk/ssl_client_certificate_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698