linux_aura: Use GTK button borders in GTK theme mode.

Up until recently, the icons for back/forward/home/reload all used
borders drawn on the image resources. Then this was changed to use a
views::Border to draw on top of the icon. Gtk2UI wasn't similarly
changed. This patch adds a Gtk2Border, along with machinery for having
the views::LinuxUI vend instances of them to the views layer.

This border should theoretically be usable for other buttons, like the
bookmark buttons, which are still using the chrome theme resources even
in GTK theme mode.

BUG=333404

Review URL: https://codereview.chromium.org/131513005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246444 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index 4fd7751..95ec2141 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -17,6 +17,10 @@
 #include "ui/views/painter.h"
 #include "ui/views/window/dialog_delegate.h"
 
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#include "ui/views/linux_ui/linux_ui.h"
+#endif
+
 namespace {
 
 // The spacing between the icon and text.
@@ -155,8 +159,9 @@
 
   ResetColorsFromNativeTheme();
 
-  // Set the border and invalidate the layout to pickup its new insets.
-  set_border(new LabelButtonBorder(style));
+  UpdateThemedBorder(new LabelButtonBorder(style_));
+
+  // Invalidate the layout to pickup the new insets from the border.
   InvalidateLayout();
 }
 
@@ -334,6 +339,18 @@
   image_->SetImage(GetImage(state()));
 }
 
+void LabelButton::UpdateThemedBorder(LabelButtonBorder* label_button_border) {
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+  views::LinuxUI* linux_ui = views::LinuxUI::instance();
+  if (linux_ui) {
+    set_border(linux_ui->CreateNativeBorder(this, label_button_border));
+  } else
+#endif
+  {
+    set_border(label_button_border);
+  }
+}
+
 void LabelButton::StateChanged() {
   const gfx::Size previous_image_size(image_->GetPreferredSize());
   UpdateImage();