diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 18:41:57 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-20 18:41:57 +0000 |
commit | ba70eabb348463314ada81fd451301196acb10e6 (patch) | |
tree | 9235475c8ac47ca756910ba71cebbf0b9b55a5b6 | |
parent | 690fbe052d94d881a6ddd810b64a87f84b65c6f2 (diff) | |
download | chromium_src-ba70eabb348463314ada81fd451301196acb10e6.zip chromium_src-ba70eabb348463314ada81fd451301196acb10e6.tar.gz chromium_src-ba70eabb348463314ada81fd451301196acb10e6.tar.bz2 |
Revert to using Apple's provided text area resize
corner graphic. This makes the resize corner look less
janky when in classic mode.
Review URL: http://codereview.chromium.org/11523
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5777 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/chromium_bridge_impl.cc | 40 | ||||
-rw-r--r-- | webkit/glue/resources/README.txt | 1 | ||||
-rwxr-xr-x | webkit/glue/resources/textarea_resize_corner.png | bin | 0 -> 195 bytes | |||
-rw-r--r-- | webkit/glue/webkit_resources.h | 1 | ||||
-rw-r--r-- | webkit/glue/webkit_resources.rc | 1 |
5 files changed, 6 insertions, 37 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc index effc33e..5774439 100644 --- a/webkit/glue/chromium_bridge_impl.cc +++ b/webkit/glue/chromium_bridge_impl.cc @@ -52,9 +52,6 @@ #include <vssym32.h> #include "base/gfx/native_theme.h" - -// This is only needed on Windows right now. -#include "BitmapImageSingleFrameSkia.h" #endif namespace { @@ -330,44 +327,13 @@ String ChromiumBridge::uiResourceProtocol() { // Resources ------------------------------------------------------------------ -#if defined(OS_WIN) -// Creates an Image for the text area resize corner. We do this by drawing the -// theme native control into a memory buffer then converting the memory buffer -// into an image. We don't bother caching this image because the caller holds -// onto a static copy (see WebCore/rendering/RenderLayer.cpp). -static PassRefPtr<Image> GetTextAreaResizeCorner() { - // Get the size of the resizer. - const int thickness = ScrollbarTheme::nativeTheme()->scrollbarThickness(); - - // Setup a memory buffer. - gfx::PlatformCanvasWin canvas(thickness, thickness, false); - gfx::PlatformDeviceWin& device = canvas.getTopPlatformDevice(); - device.prepareForGDI(0, 0, thickness, thickness); - HDC hdc = device.getBitmapDC(); - RECT widgetRect = { 0, 0, thickness, thickness }; - - // Do the drawing. - gfx::NativeTheme::instance()->PaintStatusGripper(hdc, SP_GRIPPER, 0, 0, - &widgetRect); - device.postProcessGDI(0, 0, thickness, thickness); - return BitmapImageSingleFrameSkia::create(device.accessBitmap(false)); -} -#endif - PassRefPtr<Image> ChromiumBridge::loadPlatformImageResource(const char* name) { - // Some need special handling. - if (!strcmp(name, "textAreaResizeCorner")) { -#if defined(OS_WIN) - return GetTextAreaResizeCorner(); -#else - DLOG(WARNING) << "This needs implementing on other platforms."; - return Image::nullImage(); -#endif - } // The rest get converted to a resource ID that we can pass to the glue. int resource_id = 0; - if (!strcmp(name, "missingImage")) { + if (!strcmp(name, "textAreaResizeCorner")) { + resource_id = IDR_TEXTAREA_RESIZER; + } else if (!strcmp(name, "missingImage")) { resource_id = IDR_BROKENIMAGE; } else if (!strcmp(name, "tickmarkDash")) { resource_id = IDR_TICKMARK_DASH; diff --git a/webkit/glue/resources/README.txt b/webkit/glue/resources/README.txt index 5210ff4..c5aaa7a 100644 --- a/webkit/glue/resources/README.txt +++ b/webkit/glue/resources/README.txt @@ -66,6 +66,7 @@ pan_south.cur pan_south_east.cur pan_south_west.cur pan_west.cur +textarea_resize_corner.png // ***** BEGIN LICENSE BLOCK ***** diff --git a/webkit/glue/resources/textarea_resize_corner.png b/webkit/glue/resources/textarea_resize_corner.png Binary files differnew file mode 100755 index 0000000..023615e --- /dev/null +++ b/webkit/glue/resources/textarea_resize_corner.png diff --git a/webkit/glue/webkit_resources.h b/webkit/glue/webkit_resources.h index 0e86c933..372bc35 100644 --- a/webkit/glue/webkit_resources.h +++ b/webkit/glue/webkit_resources.h @@ -5,6 +5,7 @@ #define IDR_TICKMARK_DASH 2001 #define IDR_FEED_PREVIEW 2002 #define IDR_PAN_SCROLL_ICON 2003 +#define IDR_TEXTAREA_RESIZER 2004 #define IDC_ALIAS 2100 #define IDC_CELL 2101 diff --git a/webkit/glue/webkit_resources.rc b/webkit/glue/webkit_resources.rc index f1505e5..e39ee75 100644 --- a/webkit/glue/webkit_resources.rc +++ b/webkit/glue/webkit_resources.rc @@ -18,6 +18,7 @@ IDR_BROKENIMAGE BINDATA "webkit\\glue\\resources\\broken-image.gif" IDR_TICKMARK_DASH BINDATA "webkit\\glue\\resources\\dash.png" IDR_FEED_PREVIEW BINDATA "webkit\\glue\\resources\\feed.html" IDR_PAN_SCROLL_ICON BINDATA "webkit\\glue\\resources\\pan_icon.png" +IDR_TEXTAREA_RESIZER BINDATA "webkit\\glue\\resources\\textarea_resize_corner.png" ///////////////////////////////////////////////////////////////////////////// // |