OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/native_theme_painter.h" | 5 #include "ui/views/native_theme_painter.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/animation/animation.h" | 8 #include "ui/base/animation/animation.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/gfx/canvas_skia.h" | 10 #include "ui/gfx/canvas_skia.h" |
11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
12 #include "views/native_theme_delegate.h" | 12 #include "ui/views/native_theme_delegate.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 NativeThemePainter::NativeThemePainter(NativeThemeDelegate* delegate) | 16 NativeThemePainter::NativeThemePainter(NativeThemeDelegate* delegate) |
17 : delegate_(delegate) { | 17 : delegate_(delegate) { |
18 DCHECK(delegate_); | 18 DCHECK(delegate_); |
19 } | 19 } |
20 | 20 |
21 gfx::Size NativeThemePainter::GetPreferredSize() { | 21 gfx::Size NativeThemePainter::GetPreferredSize() { |
22 const gfx::NativeTheme* theme = gfx::NativeTheme::instance(); | 22 const gfx::NativeTheme* theme = gfx::NativeTheme::instance(); |
(...skipping 24 matching lines...) Expand all Loading... |
47 native_theme->Paint(canvas->GetSkCanvas(), part, state, rect, extra); | 47 native_theme->Paint(canvas->GetSkCanvas(), part, state, rect, extra); |
48 canvas->Restore(); | 48 canvas->Restore(); |
49 } else { | 49 } else { |
50 gfx::NativeTheme::ExtraParams extra; | 50 gfx::NativeTheme::ExtraParams extra; |
51 gfx::NativeTheme::State state = delegate_->GetThemeState(&extra); | 51 gfx::NativeTheme::State state = delegate_->GetThemeState(&extra); |
52 native_theme->Paint(canvas->GetSkCanvas(), part, state, rect, extra); | 52 native_theme->Paint(canvas->GetSkCanvas(), part, state, rect, extra); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 } // namespace views | 56 } // namespace views |
OLD | NEW |