Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/toolbar_button.cc |
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| index 7a285d39e02a23c3b1990408d2886dfa953b8195..7cafc299d66835fde0f0a449d9d453e11070ba8b 100644 |
| --- a/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| +++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| @@ -11,6 +11,7 @@ |
| #include "ui/accessibility/ax_view_state.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/models/menu_model.h" |
| +#include "ui/base/theme_provider.h" |
| #include "ui/gfx/display.h" |
| #include "ui/gfx/screen.h" |
| #include "ui/views/controls/button/label_button_border.h" |
| @@ -128,6 +129,20 @@ void ToolbarButton::GetAccessibleState(ui::AXViewState* state) { |
| state->AddStateFlag(ui::AX_STATE_HASPOPUP); |
| } |
| +void ToolbarButton::SetDefaultBorderInsets(views::LabelButtonBorder* border) { |
| + ui::ThemeProvider* provider = GetThemeProvider(); |
| + if (provider && provider->UsingSystemTheme()) { |
| + // These values have no real justification. Because of a mistake in how we |
|
msw
2014/05/21 23:22:57
nit: this paragraph doesn't add much, I think the
|
| + // were using GTK, we were using these values, which we thought were |
| + // insets, but were actually the size of the focus border on the default |
| + // activatable widget. This just happened to work. |
| + // |
| + // We set smaller insets here to accommodate the slightly larger GTK+ |
| + // icons. |
| + border->set_insets(gfx::Insets(2, 2, 2, 2)); |
| + } |
| +} |
| + |
| void ToolbarButton::ShowContextMenuForView(View* source, |
| const gfx::Point& point, |
| ui::MenuSourceType source_type) { |