Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_border.h

Issue 131513005: linux_aura: Use GTK button borders in GTK theme mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgotten Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_
7
8 #include "ui/gfx/image/image_skia.h"
9 #include "ui/views/border.h"
10
11 namespace gfx {
12 class Canvas;
13 }
14
15 namespace views {
16 class CustomButton;
17 }
18
19 namespace libgtk2ui {
20 class Gtk2UI;
21
22 // Draws a gtk button border, and manages the memory of the resulting pixbufs.
23 class Gtk2Border : public views::Border {
24 public:
25 Gtk2Border(Gtk2UI* gtk2_ui,
26 views::CustomButton* owning_button,
27 views::Border* border);
28 virtual ~Gtk2Border();
29
30 // Called on theme changes. We invalidate the layout, drop our cached images,
31 // and update our GTK state.
32 void InvalidateAndSetUsesGtk(bool use_gtk);
33
34 // Overridden from views::Border:
35 virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE;
36 virtual gfx::Insets GetInsets() const OVERRIDE;
37 virtual gfx::Size GetMinimumSize() const OVERRIDE;
38
39 private:
40 Gtk2UI* gtk2_ui_;
41 bool use_gtk_;
42
43 gfx::ImageSkia hovered_;
44 gfx::ImageSkia pressed_;
45
46 // The view to which we are a border. We keep track of this so that we can
47 // force invalidate the layout on theme changes.
48 views::CustomButton* owning_button_;
49
50 // Since we don't want to expose the concept of whether we're using a GTK
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.
53 scoped_ptr<views::Border> border_;
54
55 DISALLOW_COPY_AND_ASSIGN(Gtk2Border);
56 };
57
58 } // namespace libgtk2ui
59
60 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_BORDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/gtk2_border.cc » ('j') | chrome/browser/ui/libgtk2ui/gtk2_border.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698