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
3 // found in the LICENSE file.
5 #ifndef UI_NATIVE_THEME_NATIVE_THEME_AURA_H_
6 #define UI_NATIVE_THEME_NATIVE_THEME_AURA_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/native_theme/fallback_theme.h"
13 class NineImagePainter
;
18 // Aura implementation of native theme support.
19 class NATIVE_THEME_EXPORT NativeThemeAura
: public FallbackTheme
{
21 static NativeThemeAura
* instance();
25 virtual ~NativeThemeAura();
27 // Overridden from NativeThemeBase:
28 virtual void PaintMenuPopupBackground(
30 const gfx::Size
& size
,
31 const MenuBackgroundExtraParams
& menu_background
) const OVERRIDE
;
32 virtual void PaintMenuItemBackground(
35 const gfx::Rect
& rect
,
36 const MenuListExtraParams
& menu_list
) const OVERRIDE
;
37 virtual void PaintArrowButton(SkCanvas
* gc
,
38 const gfx::Rect
& rect
,
40 State state
) const OVERRIDE
;
41 virtual void PaintScrollbarTrack(
45 const ScrollbarTrackExtraParams
& extra_params
,
46 const gfx::Rect
& rect
) const OVERRIDE
;
47 virtual void PaintScrollbarThumb(SkCanvas
* sk_canvas
,
50 const gfx::Rect
& rect
) const OVERRIDE
;
51 virtual void PaintScrollbarCorner(SkCanvas
* canvas
,
53 const gfx::Rect
& rect
) const OVERRIDE
;
55 // Returns the NineImagePainter used to paint the specified state, creating if
56 // necessary. If no image is provided for the specified state the normal state
58 gfx::NineImagePainter
* GetOrCreatePainter(
59 const int image_ids
[kMaxState
][9],
61 scoped_ptr
<gfx::NineImagePainter
> painters
[kMaxState
]) const;
63 // Paints |painter| into the canvas using |rect|.
64 void PaintPainter(gfx::NineImagePainter
* painter
,
66 const gfx::Rect
& rect
) const;
68 mutable scoped_ptr
<gfx::NineImagePainter
> scrollbar_track_painter_
;
70 mutable scoped_ptr
<gfx::NineImagePainter
>
71 scrollbar_thumb_painters_
[kMaxState
];
73 mutable scoped_ptr
<gfx::NineImagePainter
>
74 scrollbar_arrow_button_painters_
[kMaxState
];
77 DISALLOW_COPY_AND_ASSIGN(NativeThemeAura
);
82 #endif // UI_NATIVE_THEME_NATIVE_THEME_AURA_H_