| 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 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_ |
| 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/image/image_skia.h" | 8 #include "ui/gfx/image/image_skia.h" |
| 9 #include "ui/views/border.h" | 9 #include "ui/views/border.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class Canvas; | 12 class Canvas; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class CustomButton; | 16 class CustomButton; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace libgtk2ui { | 19 namespace libgtk2ui { |
| 20 class Gtk2UI; | 20 class Gtk2UI; |
| 21 | 21 |
| 22 // Draws a gtk button border, and manages the memory of the resulting pixbufs. | 22 // Draws a gtk button border, and manages the memory of the resulting pixbufs. |
| 23 class Gtk2Border : public views::Border { | 23 class Gtk2Border : public views::Border { |
| 24 public: | 24 public: |
| 25 Gtk2Border(Gtk2UI* gtk2_ui, | 25 Gtk2Border(Gtk2UI* gtk2_ui, |
| 26 views::CustomButton* owning_button, | 26 views::CustomButton* owning_button, |
| 27 views::Border* border); | 27 scoped_ptr<views::Border> border); |
| 28 virtual ~Gtk2Border(); | 28 virtual ~Gtk2Border(); |
| 29 | 29 |
| 30 // Called on theme changes. We invalidate the layout, drop our cached images, | 30 // Called on theme changes. We invalidate the layout, drop our cached images, |
| 31 // and update our GTK state. | 31 // and update our GTK state. |
| 32 void InvalidateAndSetUsesGtk(bool use_gtk); | 32 void InvalidateAndSetUsesGtk(bool use_gtk); |
| 33 | 33 |
| 34 // Overridden from views::Border: | 34 // Overridden from views::Border: |
| 35 virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE; | 35 virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE; |
| 36 virtual gfx::Insets GetInsets() const OVERRIDE; | 36 virtual gfx::Insets GetInsets() const OVERRIDE; |
| 37 virtual gfx::Size GetMinimumSize() const OVERRIDE; | 37 virtual gfx::Size GetMinimumSize() const OVERRIDE; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 // theme down to the cross platform views layer, we keep a normal Border and | 51 // theme down to the cross platform views layer, we keep a normal Border and |
| 52 // delegate to it whenever we aren't in GTK theme mode. | 52 // delegate to it whenever we aren't in GTK theme mode. |
| 53 scoped_ptr<views::Border> border_; | 53 scoped_ptr<views::Border> border_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(Gtk2Border); | 55 DISALLOW_COPY_AND_ASSIGN(Gtk2Border); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace libgtk2ui | 58 } // namespace libgtk2ui |
| 59 | 59 |
| 60 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_ | 60 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_ |
| OLD | NEW |