summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/android/RenderThemeAndroid.cpp
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2011-03-03 16:05:45 -0500
committerLeon Scroggins <scroggo@google.com>2011-03-04 13:23:32 -0500
commit4de82d04a6a82fee6e2d924768e88af58e966982 (patch)
tree8bc313070b3e945a10581c403bd8bbce0c87b2ba /WebCore/platform/android/RenderThemeAndroid.cpp
parent00e711a28c6fe463e2c728c0bd926b949c1a8798 (diff)
downloadexternal_webkit-4de82d04a6a82fee6e2d924768e88af58e966982.zip
external_webkit-4de82d04a6a82fee6e2d924768e88af58e966982.tar.gz
external_webkit-4de82d04a6a82fee6e2d924768e88af58e966982.tar.bz2
Use members rather than globals to avoid leaking memory.
Part of bug:3009375 Requires a change to frameworks/base. Change-Id: I9f5e86afff4c87e16889eadf0ad0049120885480
Diffstat (limited to 'WebCore/platform/android/RenderThemeAndroid.cpp')
-rw-r--r--WebCore/platform/android/RenderThemeAndroid.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/WebCore/platform/android/RenderThemeAndroid.cpp b/WebCore/platform/android/RenderThemeAndroid.cpp
index 66f034d..68b6441 100644
--- a/WebCore/platform/android/RenderThemeAndroid.cpp
+++ b/WebCore/platform/android/RenderThemeAndroid.cpp
@@ -44,6 +44,7 @@
#include "RenderSkinRadio.h"
#include "SkCanvas.h"
#include "UserAgentStyleSheets.h"
+#include "WebCoreFrameBridge.h"
namespace WebCore {
@@ -67,6 +68,13 @@ static SkCanvas* getCanvasFromInfo(const PaintInfo& info)
return info.context->platformContext()->mCanvas;
}
+static android::WebFrame* getWebFrame(const Node* node)
+{
+ if (!node)
+ return 0;
+ return android::WebFrame::getWebFrame(node->document()->frame());
+}
+
RenderTheme* theme()
{
DEFINE_STATIC_LOCAL(RenderThemeAndroid, androidTheme, ());
@@ -223,9 +231,15 @@ bool RenderThemeAndroid::paintButton(RenderObject* obj, const PaintInfo& info, c
// If it is a disabled button, simply paint it to the master picture.
Node* node = obj->node();
Element* formControlElement = static_cast<Element*>(node);
- if (formControlElement && !formControlElement->isEnabledFormControl())
- RenderSkinButton::Draw(getCanvasFromInfo(info), rect, RenderSkinAndroid::kDisabled);
- else
+ if (formControlElement && !formControlElement->isEnabledFormControl()) {
+ android::WebFrame* webFrame = getWebFrame(node);
+ if (webFrame) {
+ const RenderSkinAndroid* skins = webFrame->renderSkins();
+ if (skins)
+ skins->renderSkinButton()->draw(getCanvasFromInfo(info), rect,
+ RenderSkinAndroid::kDisabled);
+ }
+ } else
// Store all the important information in the platform context.
info.context->platformContext()->storeButtonInfo(node, rect);