| OLD | NEW |
| 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/infobars/infobar_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/infobar_gtk.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" |
| 7 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/infobars/infobar_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 11 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 11 #include "chrome/browser/ui/gtk/custom_button.h" | 12 #include "chrome/browser/ui/gtk/custom_button.h" |
| 12 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 13 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 13 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 14 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 14 #include "chrome/browser/ui/gtk/gtk_util.h" | 15 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 15 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" | 16 #include "chrome/browser/ui/gtk/infobars/infobar_container_gtk.h" |
| 16 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void InfoBarGtk::OnCloseButton(GtkWidget* button) { | 206 void InfoBarGtk::OnCloseButton(GtkWidget* button) { |
| 206 // If we're not owned, we're already closing, so don't call | 207 // If we're not owned, we're already closing, so don't call |
| 207 // InfoBarDismissed(), since this can lead to us double-recording dismissals. | 208 // InfoBarDismissed(), since this can lead to us double-recording dismissals. |
| 208 if (delegate() && owned()) | 209 if (delegate() && owned()) |
| 209 delegate()->InfoBarDismissed(); | 210 delegate()->InfoBarDismissed(); |
| 210 RemoveSelf(); | 211 RemoveSelf(); |
| 211 } | 212 } |
| 212 | 213 |
| 213 gboolean InfoBarGtk::OnBackgroundExpose(GtkWidget* sender, | 214 gboolean InfoBarGtk::OnBackgroundExpose(GtkWidget* sender, |
| 214 GdkEventExpose* event) { | 215 GdkEventExpose* event) { |
| 216 TRACE_EVENT0("ui::gtk", "InfoBarGtk::OnBackgroundExpose"); |
| 217 |
| 215 GtkAllocation allocation; | 218 GtkAllocation allocation; |
| 216 gtk_widget_get_allocation(sender, &allocation); | 219 gtk_widget_get_allocation(sender, &allocation); |
| 217 const int height = allocation.height; | 220 const int height = allocation.height; |
| 218 | 221 |
| 219 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(sender->window)); | 222 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(sender->window)); |
| 220 gdk_cairo_rectangle(cr, &event->area); | 223 gdk_cairo_rectangle(cr, &event->area); |
| 221 cairo_clip(cr); | 224 cairo_clip(cr); |
| 222 | 225 |
| 223 cairo_pattern_t* pattern = cairo_pattern_create_linear(0, 0, 0, height); | 226 cairo_pattern_t* pattern = cairo_pattern_create_linear(0, 0, 0, height); |
| 224 | 227 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 const content::NotificationSource& source, | 287 const content::NotificationSource& source, |
| 285 const content::NotificationDetails& details) { | 288 const content::NotificationDetails& details) { |
| 286 UpdateBorderColor(); | 289 UpdateBorderColor(); |
| 287 } | 290 } |
| 288 | 291 |
| 289 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, | 292 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, |
| 290 GtkWidget* child, | 293 GtkWidget* child, |
| 291 GtkRequisition* requisition) { | 294 GtkRequisition* requisition) { |
| 292 requisition->height = -1; | 295 requisition->height = -1; |
| 293 } | 296 } |
| OLD | NEW |