| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/libgtkui/gtk_ui.h" | 5 #include "chrome/browser/ui/libgtkui/gtk_ui.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 #include <X11/Xcursor/Xcursor.h> | 9 #include <X11/Xcursor/Xcursor.h> |
| 10 | 10 |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 { | 680 { |
| 681 "IDR_BUTTON_DISABLED", "IDR_BLUE_BUTTON_DISABLED", true, | 681 "IDR_BUTTON_DISABLED", "IDR_BLUE_BUTTON_DISABLED", true, |
| 682 views::Button::STATE_DISABLED, | 682 views::Button::STATE_DISABLED, |
| 683 }, | 683 }, |
| 684 }; | 684 }; |
| 685 | 685 |
| 686 bool is_blue = | 686 bool is_blue = |
| 687 owning_button->GetClassName() == views::BlueButton::kViewClassName; | 687 owning_button->GetClassName() == views::BlueButton::kViewClassName; |
| 688 | 688 |
| 689 for (unsigned i = 0; i < arraysize(paintstate); i++) { | 689 for (unsigned i = 0; i < arraysize(paintstate); i++) { |
| 690 if (border->PaintsButtonState(paintstate[i].focus, paintstate[i].state)) { | 690 std::string idr = is_blue ? paintstate[i].idr_blue : paintstate[i].idr; |
| 691 std::string idr = is_blue ? paintstate[i].idr_blue : paintstate[i].idr; | 691 gtk_border->SetPainter( |
| 692 gtk_border->SetPainter(paintstate[i].focus, paintstate[i].state, | 692 paintstate[i].focus, paintstate[i].state, |
| 693 base::MakeUnique<GtkButtonPainter>(idr)); | 693 border->PaintsButtonState(paintstate[i].focus, paintstate[i].state) |
| 694 } | 694 ? base::MakeUnique<GtkButtonPainter>(idr) |
| 695 : nullptr); |
| 695 } | 696 } |
| 696 | 697 |
| 697 return gtk_border; | 698 return gtk_border; |
| 698 } | 699 } |
| 699 | 700 |
| 700 void GtkUi::AddWindowButtonOrderObserver( | 701 void GtkUi::AddWindowButtonOrderObserver( |
| 701 views::WindowButtonOrderObserver* observer) { | 702 views::WindowButtonOrderObserver* observer) { |
| 702 if (!leading_buttons_.empty() || !trailing_buttons_.empty()) { | 703 if (!leading_buttons_.empty() || !trailing_buttons_.empty()) { |
| 703 observer->OnWindowButtonOrderingChange(leading_buttons_, trailing_buttons_); | 704 observer->OnWindowButtonOrderingChange(leading_buttons_, trailing_buttons_); |
| 704 } | 705 } |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 | 1051 |
| 1051 float GtkUi::GetDeviceScaleFactor() const { | 1052 float GtkUi::GetDeviceScaleFactor() const { |
| 1052 return device_scale_factor_; | 1053 return device_scale_factor_; |
| 1053 } | 1054 } |
| 1054 | 1055 |
| 1055 } // namespace libgtkui | 1056 } // namespace libgtkui |
| 1056 | 1057 |
| 1057 views::LinuxUI* BuildGtkUi() { | 1058 views::LinuxUI* BuildGtkUi() { |
| 1058 return new libgtkui::GtkUi; | 1059 return new libgtkui::GtkUi; |
| 1059 } | 1060 } |
| OLD | NEW |