summaryrefslogtreecommitdiffstats
path: root/ui/gfx/native_theme_chromeos.h
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 17:49:40 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-28 17:49:40 +0000
commitd2ceb4e7fe001e55d540784abac24620dc6b4a4a (patch)
tree3e426f088d0d6a2e774bff9cf81429614b2bea98 /ui/gfx/native_theme_chromeos.h
parentdc8e44a27106d13d8605ccfa2ca0dd8ef3959bef (diff)
downloadchromium_src-d2ceb4e7fe001e55d540784abac24620dc6b4a4a.zip
chromium_src-d2ceb4e7fe001e55d540784abac24620dc6b4a4a.tar.gz
chromium_src-d2ceb4e7fe001e55d540784abac24620dc6b4a4a.tar.bz2
Move NativeThemeChromeOS into gfx.
This should fix test_shell/DRT build on ChromeOS. BUG=chromium-os:13511 TEST=Verify test_shell/DRT builds fine on ChromeOS per chromium-os:13511. Review URL: http://codereview.chromium.org/6745009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/native_theme_chromeos.h')
-rw-r--r--ui/gfx/native_theme_chromeos.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/ui/gfx/native_theme_chromeos.h b/ui/gfx/native_theme_chromeos.h
new file mode 100644
index 0000000..4b9f19b
--- /dev/null
+++ b/ui/gfx/native_theme_chromeos.h
@@ -0,0 +1,92 @@
+// Copyright (c) 2011 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 UI_GFX_NATIVE_THEME_CHROMEOS_H_
+#define UI_GFX_NATIVE_THEME_CHROMEOS_H_
+
+#include <map>
+#include "base/compiler_specific.h"
+#include "ui/gfx/native_theme_linux.h"
+
+class SkBitmap;
+
+class NativeThemeChromeos : public gfx::NativeThemeLinux {
+ private:
+ friend class NativeThemeLinux;
+ NativeThemeChromeos();
+ virtual ~NativeThemeChromeos();
+
+ // Scrollbar painting overrides
+ virtual gfx::Size GetPartSize(Part part) const OVERRIDE;
+ virtual void PaintScrollbarTrack(skia::PlatformCanvas* canvas,
+ Part part, State state,
+ const ScrollbarTrackExtraParams& extra_params,
+ const gfx::Rect& rect) OVERRIDE;
+ virtual void PaintArrowButton(skia::PlatformCanvas* canvas,
+ const gfx::Rect& rect, Part direction, State state) OVERRIDE;
+ virtual void PaintScrollbarThumb(skia::PlatformCanvas* canvas,
+ Part part, State state, const gfx::Rect& rect) OVERRIDE;
+
+ // Draw the checkbox.
+ virtual void PaintCheckbox(skia::PlatformCanvas* canvas,
+ State state, const gfx::Rect& rect,
+ const ButtonExtraParams& button) OVERRIDE;
+
+ // Draw the radio.
+ virtual void PaintRadio(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const ButtonExtraParams& button) OVERRIDE;
+
+ // Draw the push button.
+ virtual void PaintButton(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const ButtonExtraParams& button) OVERRIDE;
+
+ // Draw the text field.
+ virtual void PaintTextField(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const TextFieldExtraParams& text) OVERRIDE;
+
+ // Draw the slider track.
+ virtual void PaintSliderTrack(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const SliderExtraParams& slider) OVERRIDE;
+
+ // Draw the slider thumb.
+ virtual void PaintSliderThumb(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const SliderExtraParams& slider) OVERRIDE;
+
+ // Draw the inner spin button.
+ virtual void PaintInnerSpinButton(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const InnerSpinButtonExtraParams& spin_button) OVERRIDE;
+
+ // Draw the progress bar.
+ virtual void PaintProgressBar(skia::PlatformCanvas* canvas,
+ State state,
+ const gfx::Rect& rect,
+ const ProgressBarExtraParams& progress_bar) OVERRIDE;
+
+ SkBitmap* GetHorizontalBitmapNamed(int resource_id);
+
+ // Paint a button like rounded rect with gradient background and stroke.
+ void PaintButtonLike(skia::PlatformCanvas* canvas,
+ State state, const gfx::Rect& rect, bool stroke_border);
+
+ // Cached images. Resource loader caches all retrieved bitmaps and keeps
+ // ownership of the pointers.
+ typedef std::map<int, SkBitmap*> SkImageMap;
+ SkImageMap horizontal_bitmaps_;
+
+ DISALLOW_COPY_AND_ASSIGN(NativeThemeChromeos);
+};
+
+#endif // UI_GFX_NATIVE_THEME_CHROMEOS_H_