| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/custom_button.h" | 5 #include "chrome/browser/gtk/custom_button.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/gtk/nine_box.h" | 9 #include "chrome/browser/gtk/nine_box.h" |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 // static | 88 // static |
| 89 gboolean CustomDrawButton::OnExpose(GtkWidget* widget, | 89 gboolean CustomDrawButton::OnExpose(GtkWidget* widget, |
| 90 GdkEventExpose* e, | 90 GdkEventExpose* e, |
| 91 CustomDrawButton* button) { | 91 CustomDrawButton* button) { |
| 92 return button->button_base_.OnExpose(widget, e); | 92 return button->button_base_.OnExpose(widget, e); |
| 93 } | 93 } |
| 94 | 94 |
| 95 // static | 95 // static |
| 96 CustomDrawButton* CustomDrawButton::AddBarCloseButton(GtkWidget* hbox, | 96 CustomDrawButton* CustomDrawButton::CloseButton() { |
| 97 int padding) { | 97 return new CustomDrawButton(IDR_CLOSE_BAR, IDR_CLOSE_BAR_P, |
| 98 CustomDrawButton* rv = new CustomDrawButton(IDR_CLOSE_BAR, IDR_CLOSE_BAR_P, | 98 IDR_CLOSE_BAR_H, 0); |
| 99 IDR_CLOSE_BAR_H, 0); | |
| 100 GTK_WIDGET_UNSET_FLAGS(rv->widget(), GTK_CAN_FOCUS); | |
| 101 GtkWidget* centering_vbox = gtk_vbox_new(FALSE, 0); | |
| 102 gtk_box_pack_start(GTK_BOX(centering_vbox), rv->widget(), TRUE, FALSE, 0); | |
| 103 gtk_box_pack_end(GTK_BOX(hbox), centering_vbox, FALSE, FALSE, padding); | |
| 104 return rv; | |
| 105 } | 99 } |
| OLD | NEW |