summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorpeter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-20 20:24:32 +0000
committerpeter@chromium.org <peter@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-20 20:24:32 +0000
commit60734984de72a1ebbc8ad61557ac736b96906aac (patch)
tree89f464bbb4f9f970068067ee2720eae2f7ce1136 /webkit/glue
parentbf2caffe3d5638a46e86e9172a5cda30ffab7ec6 (diff)
downloadchromium_src-60734984de72a1ebbc8ad61557ac736b96906aac.zip
chromium_src-60734984de72a1ebbc8ad61557ac736b96906aac.tar.gz
chromium_src-60734984de72a1ebbc8ad61557ac736b96906aac.tar.bz2
Clean up the Linux WebThemeEngine impl according to the coding style rules
BUG= TEST= Review URL: http://codereview.chromium.org/8961013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/webthemeengine_impl_linux.cc89
-rw-r--r--webkit/glue/webthemeengine_impl_linux.h16
-rw-r--r--webkit/glue/webthemeengine_impl_mac.h12
-rw-r--r--webkit/glue/webthemeengine_impl_win.h44
4 files changed, 79 insertions, 82 deletions
diff --git a/webkit/glue/webthemeengine_impl_linux.cc b/webkit/glue/webthemeengine_impl_linux.cc
index 77b95d0..4a23959 100644
--- a/webkit/glue/webthemeengine_impl_linux.cc
+++ b/webkit/glue/webthemeengine_impl_linux.cc
@@ -12,49 +12,46 @@
using WebKit::WebCanvas;
using WebKit::WebColor;
using WebKit::WebRect;
+using WebKit::WebThemeEngine;
namespace webkit_glue {
-static gfx::Rect WebRectToRect(const WebRect& rect) {
- return gfx::Rect(rect.x, rect.y, rect.width, rect.height);
-}
-
static gfx::NativeTheme::Part NativeThemePart(
- WebKit::WebThemeEngine::Part part) {
+ WebThemeEngine::Part part) {
switch (part) {
- case WebKit::WebThemeEngine::PartScrollbarDownArrow:
+ case WebThemeEngine::PartScrollbarDownArrow:
return gfx::NativeTheme::kScrollbarDownArrow;
- case WebKit::WebThemeEngine::PartScrollbarLeftArrow:
+ case WebThemeEngine::PartScrollbarLeftArrow:
return gfx::NativeTheme::kScrollbarLeftArrow;
- case WebKit::WebThemeEngine::PartScrollbarRightArrow:
+ case WebThemeEngine::PartScrollbarRightArrow:
return gfx::NativeTheme::kScrollbarRightArrow;
- case WebKit::WebThemeEngine::PartScrollbarUpArrow:
+ case WebThemeEngine::PartScrollbarUpArrow:
return gfx::NativeTheme::kScrollbarUpArrow;
- case WebKit::WebThemeEngine::PartScrollbarHorizontalThumb:
+ case WebThemeEngine::PartScrollbarHorizontalThumb:
return gfx::NativeTheme::kScrollbarHorizontalThumb;
- case WebKit::WebThemeEngine::PartScrollbarVerticalThumb:
+ case WebThemeEngine::PartScrollbarVerticalThumb:
return gfx::NativeTheme::kScrollbarVerticalThumb;
- case WebKit::WebThemeEngine::PartScrollbarHorizontalTrack:
+ case WebThemeEngine::PartScrollbarHorizontalTrack:
return gfx::NativeTheme::kScrollbarHorizontalTrack;
- case WebKit::WebThemeEngine::PartScrollbarVerticalTrack:
+ case WebThemeEngine::PartScrollbarVerticalTrack:
return gfx::NativeTheme::kScrollbarVerticalTrack;
- case WebKit::WebThemeEngine::PartCheckbox:
+ case WebThemeEngine::PartCheckbox:
return gfx::NativeTheme::kCheckbox;
- case WebKit::WebThemeEngine::PartRadio:
+ case WebThemeEngine::PartRadio:
return gfx::NativeTheme::kRadio;
- case WebKit::WebThemeEngine::PartButton:
+ case WebThemeEngine::PartButton:
return gfx::NativeTheme::kPushButton;
- case WebKit::WebThemeEngine::PartTextField:
+ case WebThemeEngine::PartTextField:
return gfx::NativeTheme::kTextField;
- case WebKit::WebThemeEngine::PartMenuList:
+ case WebThemeEngine::PartMenuList:
return gfx::NativeTheme::kMenuList;
- case WebKit::WebThemeEngine::PartSliderTrack:
+ case WebThemeEngine::PartSliderTrack:
return gfx::NativeTheme::kSliderTrack;
- case WebKit::WebThemeEngine::PartSliderThumb:
+ case WebThemeEngine::PartSliderThumb:
return gfx::NativeTheme::kSliderThumb;
- case WebKit::WebThemeEngine::PartInnerSpinButton:
+ case WebThemeEngine::PartInnerSpinButton:
return gfx::NativeTheme::kInnerSpinButton;
- case WebKit::WebThemeEngine::PartProgressBar:
+ case WebThemeEngine::PartProgressBar:
return gfx::NativeTheme::kProgressBar;
default:
return gfx::NativeTheme::kScrollbarDownArrow;
@@ -62,15 +59,15 @@ static gfx::NativeTheme::Part NativeThemePart(
}
static gfx::NativeTheme::State NativeThemeState(
- WebKit::WebThemeEngine::State state) {
+ WebThemeEngine::State state) {
switch (state) {
- case WebKit::WebThemeEngine::StateDisabled:
+ case WebThemeEngine::StateDisabled:
return gfx::NativeTheme::kDisabled;
- case WebKit::WebThemeEngine::StateHover:
+ case WebThemeEngine::StateHover:
return gfx::NativeTheme::kHovered;
- case WebKit::WebThemeEngine::StateNormal:
+ case WebThemeEngine::StateNormal:
return gfx::NativeTheme::kNormal;
- case WebKit::WebThemeEngine::StatePressed:
+ case WebThemeEngine::StatePressed:
return gfx::NativeTheme::kPressed;
default:
return gfx::NativeTheme::kDisabled;
@@ -78,13 +75,13 @@ static gfx::NativeTheme::State NativeThemeState(
}
static void GetNativeThemeExtraParams(
- WebKit::WebThemeEngine::Part part,
- WebKit::WebThemeEngine::State state,
- const WebKit::WebThemeEngine::ExtraParams* extra_params,
+ WebThemeEngine::Part part,
+ WebThemeEngine::State state,
+ const WebThemeEngine::ExtraParams* extra_params,
gfx::NativeTheme::ExtraParams* native_theme_extra_params) {
switch (part) {
- case WebKit::WebThemeEngine::PartScrollbarHorizontalTrack:
- case WebKit::WebThemeEngine::PartScrollbarVerticalTrack:
+ case WebThemeEngine::PartScrollbarHorizontalTrack:
+ case WebThemeEngine::PartScrollbarVerticalTrack:
native_theme_extra_params->scrollbar_track.track_x =
extra_params->scrollbarTrack.trackX;
native_theme_extra_params->scrollbar_track.track_y =
@@ -94,15 +91,15 @@ static void GetNativeThemeExtraParams(
native_theme_extra_params->scrollbar_track.track_height =
extra_params->scrollbarTrack.trackHeight;
break;
- case WebKit::WebThemeEngine::PartCheckbox:
+ case WebThemeEngine::PartCheckbox:
native_theme_extra_params->button.checked = extra_params->button.checked;
native_theme_extra_params->button.indeterminate =
extra_params->button.indeterminate;
break;
- case WebKit::WebThemeEngine::PartRadio:
+ case WebThemeEngine::PartRadio:
native_theme_extra_params->button.checked = extra_params->button.checked;
break;
- case WebKit::WebThemeEngine::PartButton:
+ case WebThemeEngine::PartButton:
native_theme_extra_params->button.is_default =
extra_params->button.isDefault;
native_theme_extra_params->button.has_border =
@@ -110,7 +107,7 @@ static void GetNativeThemeExtraParams(
native_theme_extra_params->button.background_color =
extra_params->button.backgroundColor;
break;
- case WebKit::WebThemeEngine::PartTextField:
+ case WebThemeEngine::PartTextField:
native_theme_extra_params->text_field.is_text_area =
extra_params->textField.isTextArea;
native_theme_extra_params->text_field.is_listbox =
@@ -118,7 +115,7 @@ static void GetNativeThemeExtraParams(
native_theme_extra_params->text_field.background_color =
extra_params->textField.backgroundColor;
break;
- case WebKit::WebThemeEngine::PartMenuList:
+ case WebThemeEngine::PartMenuList:
native_theme_extra_params->menu_list.has_border =
extra_params->menuList.hasBorder;
native_theme_extra_params->menu_list.has_border_radius =
@@ -130,19 +127,19 @@ static void GetNativeThemeExtraParams(
native_theme_extra_params->menu_list.background_color =
extra_params->menuList.backgroundColor;
break;
- case WebKit::WebThemeEngine::PartSliderTrack:
- case WebKit::WebThemeEngine::PartSliderThumb:
+ case WebThemeEngine::PartSliderTrack:
+ case WebThemeEngine::PartSliderThumb:
native_theme_extra_params->slider.vertical =
extra_params->slider.vertical;
native_theme_extra_params->slider.in_drag = extra_params->slider.inDrag;
break;
- case WebKit::WebThemeEngine::PartInnerSpinButton:
+ case WebThemeEngine::PartInnerSpinButton:
native_theme_extra_params->inner_spin.spin_up =
extra_params->innerSpin.spinUp;
native_theme_extra_params->inner_spin.read_only =
extra_params->innerSpin.readOnly;
break;
- case WebKit::WebThemeEngine::PartProgressBar:
+ case WebThemeEngine::PartProgressBar:
native_theme_extra_params->progress_bar.determinate =
extra_params->progressBar.determinate;
native_theme_extra_params->progress_bar.value_rect_x =
@@ -159,7 +156,7 @@ static void GetNativeThemeExtraParams(
}
}
-WebKit::WebSize WebThemeEngineImpl::getSize(WebKit::WebThemeEngine::Part part) {
+WebKit::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) {
gfx::NativeTheme::ExtraParams extra;
return gfx::NativeTheme::instance()->GetPartSize(NativeThemePart(part),
gfx::NativeTheme::kNormal,
@@ -168,10 +165,10 @@ WebKit::WebSize WebThemeEngineImpl::getSize(WebKit::WebThemeEngine::Part part) {
void WebThemeEngineImpl::paint(
WebKit::WebCanvas* canvas,
- WebKit::WebThemeEngine::Part part,
- WebKit::WebThemeEngine::State state,
+ WebThemeEngine::Part part,
+ WebThemeEngine::State state,
const WebKit::WebRect& rect,
- const WebKit::WebThemeEngine::ExtraParams* extra_params) {
+ const WebThemeEngine::ExtraParams* extra_params) {
gfx::NativeTheme::ExtraParams native_theme_extra_params;
GetNativeThemeExtraParams(
part, state, extra_params, &native_theme_extra_params);
@@ -179,7 +176,7 @@ void WebThemeEngineImpl::paint(
canvas,
NativeThemePart(part),
NativeThemeState(state),
- WebRectToRect(rect),
+ gfx::Rect(rect),
native_theme_extra_params);
}
diff --git a/webkit/glue/webthemeengine_impl_linux.h b/webkit/glue/webthemeengine_impl_linux.h
index 539e170..2156f36 100644
--- a/webkit/glue/webthemeengine_impl_linux.h
+++ b/webkit/glue/webthemeengine_impl_linux.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBTHEMEENGINE_IMPL_LINUX_H_
-#define WEBTHEMEENGINE_IMPL_LINUX_H_
+#ifndef WEBKIT_GLUE_WEBTHEMEENGINE_IMPL_LINUX_H_
+#define WEBKIT_GLUE_WEBTHEMEENGINE_IMPL_LINUX_H_
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebThemeEngine.h"
@@ -14,13 +14,13 @@ class WebThemeEngineImpl : public WebKit::WebThemeEngine {
// WebThemeEngine methods:
virtual WebKit::WebSize getSize(WebKit::WebThemeEngine::Part);
virtual void paint(
- WebKit::WebCanvas*,
- WebKit::WebThemeEngine::Part,
- WebKit::WebThemeEngine::State,
- const WebKit::WebRect&,
- const WebKit::WebThemeEngine::ExtraParams*);
+ WebKit::WebCanvas* canvas,
+ WebKit::WebThemeEngine::Part part,
+ WebKit::WebThemeEngine::State state,
+ const WebKit::WebRect& rect,
+ const WebKit::WebThemeEngine::ExtraParams* extra_params);
};
} // namespace webkit_glue
-#endif // WEBTHEMEENGINE_IMPL_LINUX_H_
+#endif // WEBKIT_GLUE_WEBTHEMEENGINE_IMPL_LINUX_H_
diff --git a/webkit/glue/webthemeengine_impl_mac.h b/webkit/glue/webthemeengine_impl_mac.h
index 1c6c166..d444878 100644
--- a/webkit/glue/webthemeengine_impl_mac.h
+++ b/webkit/glue/webthemeengine_impl_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -13,11 +13,11 @@ class WebThemeEngineImpl : public WebKit::WebThemeEngine {
public:
// WebKit::WebThemeEngine implementation.
virtual void paintScrollbarThumb(
- WebKit::WebCanvas*,
- WebKit::WebThemeEngine::State,
- WebKit::WebThemeEngine::Size,
- const WebKit::WebRect&,
- const WebKit::WebThemeEngine::ScrollbarInfo&);
+ WebKit::WebCanvas* canvas,
+ WebKit::WebThemeEngine::State part,
+ WebKit::WebThemeEngine::Size state,
+ const WebKit::WebRect& rect,
+ const WebKit::WebThemeEngine::ScrollbarInfo& extra_params);
};
} // namespace webkit_glue
diff --git a/webkit/glue/webthemeengine_impl_win.h b/webkit/glue/webthemeengine_impl_win.h
index deb0ded..49a05cf 100644
--- a/webkit/glue/webthemeengine_impl_win.h
+++ b/webkit/glue/webthemeengine_impl_win.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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 WEBTHEMEENGINE_IMPL_WIN_H_
-#define WEBTHEMEENGINE_IMPL_WIN_H_
+#ifndef WEBKIT_GLUE_WEBTHEMEENGINE_IMPL_WIN_H_
+#define WEBKIT_GLUE_WEBTHEMEENGINE_IMPL_WIN_H_
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebThemeEngine.h"
@@ -13,36 +13,36 @@ class WebThemeEngineImpl : public WebKit::WebThemeEngine {
public:
// WebThemeEngine methods:
virtual void paintButton(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect);
virtual void paintMenuList(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect);
virtual void paintScrollbarArrow(
- WebKit::WebCanvas*, int state, int classic_state,
- const WebKit::WebRect&);
+ WebKit::WebCanvas* canvas, int state, int classic_state,
+ const WebKit::WebRect& rect);
virtual void paintScrollbarThumb(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect);
virtual void paintScrollbarTrack(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&, const WebKit::WebRect& align_rect);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect, const WebKit::WebRect& align_rect);
virtual void paintSpinButton(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect);
virtual void paintTextField(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&, WebKit::WebColor, bool fill_content_area,
- bool draw_edges);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect, WebKit::WebColor color,
+ bool fill_content_area, bool draw_edges);
virtual void paintTrackbar(
- WebKit::WebCanvas*, int part, int state, int classic_state,
- const WebKit::WebRect&);
+ WebKit::WebCanvas* canvas, int part, int state, int classic_state,
+ const WebKit::WebRect& rect);
virtual void paintProgressBar(
- WebKit::WebCanvas*, const WebKit::WebRect& barRect,
+ WebKit::WebCanvas* canvas, const WebKit::WebRect& barRect,
const WebKit::WebRect& valueRect, bool determinate,
double animatedSeconds);
};
} // namespace webkit_glue
-#endif // WEBTHEMEENGINE_IMPL_WIN_H_
+#endif // WEBKIT_GLUE_WEBTHEMEENGINE_IMPL_WIN_H_