| 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/platform_util.h" | 8 #include "chrome/browser/platform_util.h" |
| 9 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 9 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 10 #include "chrome/browser/ui/gtk/custom_button.h" | 10 #include "chrome/browser/ui/gtk/custom_button.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 G_CALLBACK(OnCloseButtonThunk), this); | 84 G_CALLBACK(OnCloseButtonThunk), this); |
| 85 | 85 |
| 86 widget_.Own(gtk_expanded_container_new()); | 86 widget_.Own(gtk_expanded_container_new()); |
| 87 gtk_container_add(GTK_CONTAINER(widget_.get()), bg_box_); | 87 gtk_container_add(GTK_CONTAINER(widget_.get()), bg_box_); |
| 88 gtk_widget_set_size_request(widget_.get(), -1, 0); | 88 gtk_widget_set_size_request(widget_.get(), -1, 0); |
| 89 | 89 |
| 90 g_signal_connect(widget_.get(), "child-size-request", | 90 g_signal_connect(widget_.get(), "child-size-request", |
| 91 G_CALLBACK(OnChildSizeRequestThunk), | 91 G_CALLBACK(OnChildSizeRequestThunk), |
| 92 this); | 92 this); |
| 93 | 93 |
| 94 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 94 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 95 Source<ThemeService>(theme_service_)); | 95 Source<ThemeService>(theme_service_)); |
| 96 UpdateBorderColor(); | 96 UpdateBorderColor(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 InfoBarGtk::~InfoBarGtk() { | 99 InfoBarGtk::~InfoBarGtk() { |
| 100 } | 100 } |
| 101 | 101 |
| 102 GtkWidget* InfoBarGtk::widget() { | 102 GtkWidget* InfoBarGtk::widget() { |
| 103 return widget_.get(); | 103 return widget_.get(); |
| 104 } | 104 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 void InfoBarGtk::PlatformSpecificOnHeightsRecalculated() { | 244 void InfoBarGtk::PlatformSpecificOnHeightsRecalculated() { |
| 245 GtkRequisition req; | 245 GtkRequisition req; |
| 246 gtk_widget_size_request(bg_box_, &req); | 246 gtk_widget_size_request(bg_box_, &req); |
| 247 gtk_expanded_container_move(GTK_EXPANDED_CONTAINER(widget_.get()), | 247 gtk_expanded_container_move(GTK_EXPANDED_CONTAINER(widget_.get()), |
| 248 bg_box_, 0, bar_height() - req.height); | 248 bg_box_, 0, bar_height() - req.height); |
| 249 | 249 |
| 250 gtk_widget_set_size_request(widget_.get(), -1, bar_height()); | 250 gtk_widget_set_size_request(widget_.get(), -1, bar_height()); |
| 251 gtk_widget_queue_draw(widget_.get()); | 251 gtk_widget_queue_draw(widget_.get()); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void InfoBarGtk::Observe(NotificationType type, | 254 void InfoBarGtk::Observe(int type, |
| 255 const NotificationSource& source, | 255 const NotificationSource& source, |
| 256 const NotificationDetails& details) { | 256 const NotificationDetails& details) { |
| 257 UpdateBorderColor(); | 257 UpdateBorderColor(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, | 260 void InfoBarGtk::OnChildSizeRequest(GtkWidget* expanded, |
| 261 GtkWidget* child, | 261 GtkWidget* child, |
| 262 GtkRequisition* requisition) { | 262 GtkRequisition* requisition) { |
| 263 requisition->height = -1; | 263 requisition->height = -1; |
| 264 } | 264 } |
| OLD | NEW |