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/about_chrome_dialog.h" | 5 #include "chrome/browser/ui/gtk/about_chrome_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 const char* GetChromiumUrl() { | 77 const char* GetChromiumUrl() { |
78 CR_DEFINE_STATIC_LOCAL(GURL, url, (google_util::AppendGoogleLocaleParam( | 78 CR_DEFINE_STATIC_LOCAL(GURL, url, (google_util::AppendGoogleLocaleParam( |
79 GURL(chrome::kChromiumProjectURL)))); | 79 GURL(chrome::kChromiumProjectURL)))); |
80 return url.spec().c_str(); | 80 return url.spec().c_str(); |
81 } | 81 } |
82 | 82 |
83 gboolean OnEventBoxExpose(GtkWidget* event_box, | 83 gboolean OnEventBoxExpose(GtkWidget* event_box, |
84 GdkEventExpose* expose, | 84 GdkEventExpose* expose, |
85 gboolean user_data) { | 85 gboolean user_data) { |
86 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(event_box->window)); | 86 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE( |
| 87 gtk_widget_get_window(event_box))); |
87 gdk_cairo_rectangle(cr, &expose->area); | 88 gdk_cairo_rectangle(cr, &expose->area); |
88 cairo_clip(cr); | 89 cairo_clip(cr); |
89 | 90 |
90 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 91 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
91 gfx::CairoCachedSurface* background = | 92 gfx::CairoCachedSurface* background = |
92 rb.GetNativeImageNamed(IDR_ABOUT_BACKGROUND_COLOR).ToCairo(); | 93 rb.GetNativeImageNamed(IDR_ABOUT_BACKGROUND_COLOR).ToCairo(); |
93 background->SetSource(cr, event_box, 0, 0); | 94 background->SetSource(cr, event_box, 0, 0); |
94 | 95 |
95 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); | 96 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); |
96 gdk_cairo_rectangle(cr, &expose->area); | 97 gdk_cairo_rectangle(cr, &expose->area); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 ui::kContentAreaBorder, 0, | 275 ui::kContentAreaBorder, 0, |
275 ui::kContentAreaBorder, ui::kContentAreaBorder); | 276 ui::kContentAreaBorder, ui::kContentAreaBorder); |
276 gtk_container_add(GTK_CONTAINER(alignment), vbox); | 277 gtk_container_add(GTK_CONTAINER(alignment), vbox); |
277 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); | 278 gtk_box_pack_start(GTK_BOX(content_area), alignment, FALSE, FALSE, 0); |
278 | 279 |
279 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); | 280 g_signal_connect(dialog, "response", G_CALLBACK(OnResponse), NULL); |
280 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | 281 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); |
281 gtk_widget_show_all(dialog); | 282 gtk_widget_show_all(dialog); |
282 gtk_widget_grab_focus(close_button); | 283 gtk_widget_grab_focus(close_button); |
283 } | 284 } |
OLD | NEW |