Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
index 58ad3aa3b5521cf04063896a21b5937ab7ec5df3..bb92ddae9cc074a1836ce9ce8d7e2f05ee8113d1 100644 |
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc |
@@ -559,7 +559,8 @@ scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( |
if (owning_button->GetNativeTheme() != NativeThemeGtk2::instance()) |
return border.Pass(); |
- return scoped_ptr<views::Border>(new Gtk2Border(this, owning_button)); |
+ return scoped_ptr<views::Border>( |
+ new Gtk2Border(this, owning_button, border.Pass())); |
} |
void Gtk2UI::AddWindowButtonOrderObserver( |
@@ -940,9 +941,6 @@ void Gtk2UI::LoadGtkValues() { |
GdkColorToSkColor(entry_style->base[GTK_STATE_ACTIVE]); |
inactive_selection_fg_color_ = |
GdkColorToSkColor(entry_style->text[GTK_STATE_ACTIVE]); |
- |
- // Update the insets that we hand to Gtk2Border. |
- UpdateButtonInsets(); |
} |
GdkColor Gtk2UI::BuildFrameColors(GtkStyle* frame_style) { |
@@ -1359,34 +1357,6 @@ SkBitmap Gtk2UI::DrawGtkButtonBorder(int gtk_state, |
return border; |
} |
-gfx::Insets Gtk2UI::GetButtonInsets() const { |
- return button_insets_; |
-} |
- |
-void Gtk2UI::UpdateButtonInsets() { |
- GtkWidget* window = gtk_offscreen_window_new(); |
- GtkWidget* button = gtk_button_new(); |
- gtk_container_add(GTK_CONTAINER(window), button); |
- |
- GtkBorder* border = NULL; |
- gtk_widget_style_get(GTK_WIDGET(button), |
msw
2014/05/21 22:57:14
Why isn't code like this needed at all anymore? It
Elliot Glaysher
2014/05/21 23:16:57
This code is flat out wrong. This code grabs the "
|
- "default-border", |
- &border, |
- NULL); |
- |
- gfx::Insets insets; |
- if (border) { |
- button_insets_ = gfx::Insets(border->top, border->left, |
- border->bottom, border->right); |
- gtk_border_free(border); |
- } else { |
- // Defined in gtkbutton.c: |
- button_insets_ = gfx::Insets(1, 1, 1, 1); |
- } |
- |
- gtk_widget_destroy(window); |
-} |
- |
void Gtk2UI::ClearAllThemeData() { |
gtk_images_.clear(); |
} |