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

Side by Side Diff: chrome/browser/views/list_background.h

Issue 2825018: Canvas refactoring part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_VIEWS_LIST_BACKGROUND_H_ 5 #ifndef CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_
6 #define CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_ 6 #define CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_
7 7
8 #include "gfx/canvas.h" 8 #include "gfx/canvas_skia.h"
9 #include "gfx/native_theme_win.h" 9 #include "gfx/native_theme_win.h"
10 #include "views/background.h" 10 #include "views/background.h"
11 11
12 // A background object that paints the scrollable list background, 12 // A background object that paints the scrollable list background,
13 // which may be rendered by the system visual styles system. 13 // which may be rendered by the system visual styles system.
14 class ListBackground : public views::Background { 14 class ListBackground : public views::Background {
15 public: 15 public:
16 explicit ListBackground() { 16 explicit ListBackground() {
17 SkColor list_color = 17 SkColor list_color =
18 gfx::NativeTheme::instance()->GetThemeColorWithDefault( 18 gfx::NativeTheme::instance()->GetThemeColorWithDefault(
19 gfx::NativeTheme::LIST, 1, TS_NORMAL, TMT_FILLCOLOR, COLOR_WINDOW); 19 gfx::NativeTheme::LIST, 1, TS_NORMAL, TMT_FILLCOLOR, COLOR_WINDOW);
20 SetNativeControlColor(list_color); 20 SetNativeControlColor(list_color);
21 } 21 }
22 virtual ~ListBackground() {} 22 virtual ~ListBackground() {}
23 23
24 virtual void Paint(gfx::Canvas* canvas, views::View* view) const { 24 virtual void Paint(gfx::Canvas* canvas, views::View* view) const {
25 HDC dc = canvas->beginPlatformPaint(); 25 HDC dc = canvas->AsCanvasSkia()->beginPlatformPaint();
26 RECT native_lb = view->GetLocalBounds(true).ToRECT(); 26 RECT native_lb = view->GetLocalBounds(true).ToRECT();
27 gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb); 27 gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb);
28 canvas->endPlatformPaint(); 28 canvas->AsCanvasSkia()->endPlatformPaint();
29 } 29 }
30 30
31 private: 31 private:
32 DISALLOW_COPY_AND_ASSIGN(ListBackground); 32 DISALLOW_COPY_AND_ASSIGN(ListBackground);
33 }; 33 };
34 34
35 #endif // CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_ 35 #endif // CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_
36 36
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698