summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/list_background.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/list_background.h')
-rw-r--r--chrome/browser/views/list_background.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/views/list_background.h b/chrome/browser/views/list_background.h
new file mode 100644
index 0000000..ba8317a
--- /dev/null
+++ b/chrome/browser/views/list_background.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_
+#define CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_
+
+#include "gfx/canvas.h"
+#include "gfx/native_theme_win.h"
+#include "views/background.h"
+
+// A background object that paints the scrollable list background,
+// which may be rendered by the system visual styles system.
+class ListBackground : public views::Background {
+ public:
+ explicit ListBackground() {
+ SkColor list_color =
+ gfx::NativeTheme::instance()->GetThemeColorWithDefault(
+ gfx::NativeTheme::LIST, 1, TS_NORMAL, TMT_FILLCOLOR, COLOR_WINDOW);
+ SetNativeControlColor(list_color);
+ }
+ virtual ~ListBackground() {}
+
+ virtual void Paint(gfx::Canvas* canvas, views::View* view) const {
+ HDC dc = canvas->beginPlatformPaint();
+ RECT native_lb = view->GetLocalBounds(true).ToRECT();
+ gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb);
+ canvas->endPlatformPaint();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ListBackground);
+};
+
+#endif // CHROME_BROWSER_VIEWS_LIST_BACKGROUND_H_
+