summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webthemeengine_impl_linux.cc
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 03:43:27 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 03:43:27 +0000
commit94e840ab0edbcb8c0bfc092c72171423bad4b2f8 (patch)
tree61fc94858f31b5c9d1c35371ccadee56ae587e11 /webkit/glue/webthemeengine_impl_linux.cc
parent7281e4cf77a6ebcd7c79db4f87629c7565ff4289 (diff)
downloadchromium_src-94e840ab0edbcb8c0bfc092c72171423bad4b2f8.zip
chromium_src-94e840ab0edbcb8c0bfc092c72171423bad4b2f8.tar.gz
chromium_src-94e840ab0edbcb8c0bfc092c72171423bad4b2f8.tar.bz2
Revert 62068 - Move implementation of linux scrollbars from webkit using new
WebThemeEngine api. Also implement chromeos specific version. BUG=chromium-os:6857 TEST=Verify that both linux and chromeos scrollbars look right. Review URL: http://codereview.chromium.org/3618014 TBR=davemoore@chromium.org Review URL: http://codereview.chromium.org/3678003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webthemeengine_impl_linux.cc')
-rw-r--r--webkit/glue/webthemeengine_impl_linux.cc100
1 files changed, 0 insertions, 100 deletions
diff --git a/webkit/glue/webthemeengine_impl_linux.cc b/webkit/glue/webthemeengine_impl_linux.cc
deleted file mode 100644
index d5cc9b4..0000000
--- a/webkit/glue/webthemeengine_impl_linux.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// 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.
-
-#include "webkit/glue/webthemeengine_impl_linux.h"
-
-#include "gfx/native_theme_linux.h"
-#include "skia/ext/platform_canvas.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
-
-using WebKit::WebCanvas;
-using WebKit::WebColor;
-using WebKit::WebRect;
-
-namespace webkit_glue {
-
-static gfx::Rect WebRectToRect(const WebRect& rect) {
- return gfx::Rect(rect.x, rect.y, rect.width, rect.height);
-}
-
-static gfx::NativeThemeLinux::Part NativeThemePart(
- WebKit::WebThemeEngine::Part part) {
- switch (part) {
- case WebKit::WebThemeEngine::PartScrollbarDownArrow:
- return gfx::NativeThemeLinux::kScrollbarDownArrow;
- case WebKit::WebThemeEngine::PartScrollbarLeftArrow:
- return gfx::NativeThemeLinux::kScrollbarLeftArrow;
- case WebKit::WebThemeEngine::PartScrollbarRightArrow:
- return gfx::NativeThemeLinux::kScrollbarRightArrow;
- case WebKit::WebThemeEngine::PartScrollbarUpArrow:
- return gfx::NativeThemeLinux::kScrollbarUpArrow;
- case WebKit::WebThemeEngine::PartScrollbarHorizontalThumb:
- return gfx::NativeThemeLinux::kScrollbarHorizontalThumb;
- case WebKit::WebThemeEngine::PartScrollbarVerticalThumb:
- return gfx::NativeThemeLinux::kScrollbarVerticalThumb;
- case WebKit::WebThemeEngine::PartScrollbarHoriztonalTrack:
- return gfx::NativeThemeLinux::kScrollbarHorizontalTrack;
- case WebKit::WebThemeEngine::PartScrollbarVerticalTrack:
- return gfx::NativeThemeLinux::kScrollbarVerticalTrack;
- default:
- return gfx::NativeThemeLinux::kScrollbarDownArrow;
- }
-}
-
-static gfx::NativeThemeLinux::State NativeThemeState(
- WebKit::WebThemeEngine::State state) {
- switch (state) {
- case WebKit::WebThemeEngine::StateDisabled:
- return gfx::NativeThemeLinux::kDisabled;
- case WebKit::WebThemeEngine::StateHover:
- return gfx::NativeThemeLinux::kHover;
- case WebKit::WebThemeEngine::StateNormal:
- return gfx::NativeThemeLinux::kNormal;
- case WebKit::WebThemeEngine::StatePressed:
- return gfx::NativeThemeLinux::kPressed;
- default:
- return gfx::NativeThemeLinux::kDisabled;
- }
-}
-
-static void GetNativeThemeExtraParams(
- WebKit::WebThemeEngine::Part part,
- WebKit::WebThemeEngine::State state,
- const WebKit::WebThemeEngine::ExtraParams* extra_params,
- gfx::NativeThemeLinux::ExtraParams* native_theme_extra_params) {
- if (part == WebKit::WebThemeEngine::PartScrollbarHoriztonalTrack ||
- part == WebKit::WebThemeEngine::PartScrollbarVerticalTrack) {
- native_theme_extra_params->scrollbar_track.track_x =
- extra_params->scrollbarTrack.trackX;
- native_theme_extra_params->scrollbar_track.track_y =
- extra_params->scrollbarTrack.trackY;
- native_theme_extra_params->scrollbar_track.track_width =
- extra_params->scrollbarTrack.trackWidth;
- native_theme_extra_params->scrollbar_track.track_height =
- extra_params->scrollbarTrack.trackHeight;
- }
-}
-
-WebKit::WebSize WebThemeEngineImpl::getSize(WebKit::WebThemeEngine::Part part) {
- return gfx::NativeThemeLinux::instance()->GetSize(NativeThemePart(part));
-}
-
-void WebThemeEngineImpl::paint(
- WebKit::WebCanvas* canvas,
- WebKit::WebThemeEngine::Part part,
- WebKit::WebThemeEngine::State state,
- const WebKit::WebRect& rect,
- const WebKit::WebThemeEngine::ExtraParams* extra_params) {
- gfx::NativeThemeLinux::ExtraParams native_theme_extra_params;
- GetNativeThemeExtraParams(
- part, state, extra_params, &native_theme_extra_params);
- gfx::NativeThemeLinux::instance()->Paint(
- canvas,
- NativeThemePart(part),
- NativeThemeState(state),
- WebRectToRect(rect),
- native_theme_extra_params);
-}
-} // namespace webkit_glue