Chromium Code Reviews| Index: chrome/browser/ui/libgtk2ui/gtk2_border.cc |
| diff --git a/chrome/browser/ui/libgtk2ui/gtk2_border.cc b/chrome/browser/ui/libgtk2ui/gtk2_border.cc |
| index bf16de79a09ffb36adddaab05ccc0054a8a624f7..7e14e7d98afa2a9fb862a5931b1c381fc5b126c1 100644 |
| --- a/chrome/browser/ui/libgtk2ui/gtk2_border.cc |
| +++ b/chrome/browser/ui/libgtk2ui/gtk2_border.cc |
| @@ -33,14 +33,10 @@ const int kNumberOfFocusedStates = 2; |
| class ButtonImageSkiaSource : public gfx::ImageSkiaSource { |
| public: |
| ButtonImageSkiaSource(const Gtk2UI* gtk2_ui, |
| - const GtkStateType state, |
| - const bool focused, |
| - const bool call_to_action, |
| + const GtkStateFlags state, |
| const gfx::Size& size) |
| : gtk2_ui_(gtk2_ui), |
| state_(state), |
| - focused_(focused), |
| - call_to_action_(call_to_action), |
| size_(size) { |
| } |
| @@ -50,15 +46,13 @@ class ButtonImageSkiaSource : public gfx::ImageSkiaSource { |
| int w = size_.width() * scale; |
| int h = size_.height() * scale; |
| return gfx::ImageSkiaRep( |
| - gtk2_ui_->DrawGtkButtonBorder(state_, focused_, call_to_action_, w, h), |
| + gtk2_ui_->DrawGtkButtonBorder(state_, w, h), |
| scale); |
| } |
| private: |
| const Gtk2UI* gtk2_ui_; |
| - const GtkStateType state_; |
| - const bool focused_; |
| - const bool call_to_action_; |
| + const GtkStateFlags state_; |
| const gfx::Size size_; |
| DISALLOW_COPY_AND_ASSIGN(ButtonImageSkiaSource); |
| @@ -142,14 +136,13 @@ void Gtk2Border::PaintState(const ui::NativeTheme::State state, |
| gfx::ImageSkia* image = &button_images_[focused][views_state]; |
| if (image->isNull() || image->size() != rect.size()) { |
| - bool call_to_action = owning_button_->GetClassName() == |
| - views::BlueButton::kViewClassName; |
|
Elliot Glaysher
2015/07/20 19:31:40
So while I personally don't like this feature, thi
knthzh
2015/07/21 15:48:27
Okay. Where are the BlueButtons on the Chrome UI?
|
| - GtkStateType gtk_state = GetGtkState(state); |
| + int gtk_state = GetGtkState(state); |
| + if (focused) |
| + gtk_state |= GTK_STATE_FLAG_FOCUSED; |
| + |
| *image = gfx::ImageSkia( |
| new ButtonImageSkiaSource(gtk2_ui_, |
| - gtk_state, |
| - focused, |
| - call_to_action, |
| + (GtkStateFlags)gtk_state, |
| rect.size()), |
| rect.size()); |
| } |