| 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 29 matching lines...) Expand all Loading... |
| 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 virtual ~ButtonImageSkiaSource() { |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual gfx::ImageSkiaRep GetImageForScale(float scale) OVERRIDE { | 50 virtual gfx::ImageSkiaRep GetImageForScale(float scale) override { |
| 51 int w = size_.width() * scale; | 51 int w = size_.width() * scale; |
| 52 int h = size_.height() * scale; | 52 int h = size_.height() * scale; |
| 53 return gfx::ImageSkiaRep( | 53 return gfx::ImageSkiaRep( |
| 54 gtk2_ui_->DrawGtkButtonBorder(state_, focused_, call_to_action_, w, h), | 54 gtk2_ui_->DrawGtkButtonBorder(state_, focused_, call_to_action_, w, h), |
| 55 scale); | 55 scale); |
| 56 } | 56 } |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 const Gtk2UI* gtk2_ui_; | 59 const Gtk2UI* gtk2_ui_; |
| 60 const GtkStateType state_; | 60 const GtkStateType state_; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 focused, | 152 focused, |
| 153 call_to_action, | 153 call_to_action, |
| 154 rect.size()), | 154 rect.size()), |
| 155 rect.size()); | 155 rect.size()); |
| 156 } | 156 } |
| 157 canvas->DrawImageInt(*image, rect.x(), rect.y()); | 157 canvas->DrawImageInt(*image, rect.x(), rect.y()); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace libgtk2ui | 161 } // namespace libgtk2ui |
| OLD | NEW |