| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/libgtk2ui/gtk2_border.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_border.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" | 9 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
| 10 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" | 10 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 const bool focused, | 37 const bool focused, |
| 38 const bool call_to_action, | 38 const bool call_to_action, |
| 39 const gfx::Size& size) | 39 const gfx::Size& size) |
| 40 : gtk2_ui_(gtk2_ui), | 40 : gtk2_ui_(gtk2_ui), |
| 41 state_(state), | 41 state_(state), |
| 42 focused_(focused), | 42 focused_(focused), |
| 43 call_to_action_(call_to_action), | 43 call_to_action_(call_to_action), |
| 44 size_(size) { | 44 size_(size) { |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual ~ButtonImageSkiaSource() { | 47 ~ButtonImageSkiaSource() override {} |
| 48 } | |
| 49 | 48 |
| 50 virtual gfx::ImageSkiaRep GetImageForScale(float scale) override { | 49 gfx::ImageSkiaRep GetImageForScale(float scale) override { |
| 51 int w = size_.width() * scale; | 50 int w = size_.width() * scale; |
| 52 int h = size_.height() * scale; | 51 int h = size_.height() * scale; |
| 53 return gfx::ImageSkiaRep( | 52 return gfx::ImageSkiaRep( |
| 54 gtk2_ui_->DrawGtkButtonBorder(state_, focused_, call_to_action_, w, h), | 53 gtk2_ui_->DrawGtkButtonBorder(state_, focused_, call_to_action_, w, h), |
| 55 scale); | 54 scale); |
| 56 } | 55 } |
| 57 | 56 |
| 58 private: | 57 private: |
| 59 const Gtk2UI* gtk2_ui_; | 58 const Gtk2UI* gtk2_ui_; |
| 60 const GtkStateType state_; | 59 const GtkStateType state_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 focused, | 151 focused, |
| 153 call_to_action, | 152 call_to_action, |
| 154 rect.size()), | 153 rect.size()), |
| 155 rect.size()); | 154 rect.size()); |
| 156 } | 155 } |
| 157 canvas->DrawImageInt(*image, rect.x(), rect.y()); | 156 canvas->DrawImageInt(*image, rect.x(), rect.y()); |
| 158 } | 157 } |
| 159 } | 158 } |
| 160 | 159 |
| 161 } // namespace libgtk2ui | 160 } // namespace libgtk2ui |
| OLD | NEW |