diff options
author | eseidel@chromium.org <eseidel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-20 20:59:09 +0000 |
---|---|---|
committer | eseidel@chromium.org <eseidel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-20 20:59:09 +0000 |
commit | 098ccbd71a12768efe6c7698ffb93896ed3780d2 (patch) | |
tree | c14b6188c006847c01b1c12b2bac99c984505ce8 /webkit | |
parent | 0cb165a2ba40eb2c5b338ff183ce8ad1139eca18 (diff) | |
download | chromium_src-098ccbd71a12768efe6c7698ffb93896ed3780d2.zip chromium_src-098ccbd71a12768efe6c7698ffb93896ed3780d2.tar.gz chromium_src-098ccbd71a12768efe6c7698ffb93896ed3780d2.tar.bz2 |
Get rid of another base/ include by inlining the NSView/HWND/GtkWidget typdefs.
Review URL: http://codereview.chromium.org/13770
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/chromium_bridge_impl.cc | 14 | ||||
-rw-r--r-- | webkit/pending/AccessibleBase.cpp | 19 | ||||
-rw-r--r-- | webkit/port/platform/chromium/PlatformWidget.h | 7 |
3 files changed, 26 insertions, 14 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc index 26d18f5..f66ca2e 100644 --- a/webkit/glue/chromium_bridge_impl.cc +++ b/webkit/glue/chromium_bridge_impl.cc @@ -60,6 +60,16 @@ namespace { +gfx::NativeView ToPlatform(WebCore::Widget* widget) { + if (!widget) + return 0; + PlatformWidget widget_id = widget->root()->hostWindow()->platformWindow(); + // TODO(eseidel): This cast is a hack. We should replace gfx::NativeView with
+ // something more abstract like PlatformWidget since webkit/glue should not
+ // know about actual native widgets. + return static_cast<gfx::NativeView>(widget_id); +} + #if PLATFORM(WIN_OS) static RECT IntRectToRECT(const WebCore::IntRect& r) { RECT result; @@ -71,10 +81,6 @@ static RECT IntRectToRECT(const WebCore::IntRect& r) { } #endif -PlatformWidget ToPlatform(WebCore::Widget* widget) { - return widget ? widget->root()->hostWindow()->platformWindow() : 0; -} - ChromeClientImpl* ToChromeClient(WebCore::Widget* widget) { WebCore::FrameView* view; if (widget->isFrameView()) { diff --git a/webkit/pending/AccessibleBase.cpp b/webkit/pending/AccessibleBase.cpp index 2bca2eb..aed40ce 100644 --- a/webkit/pending/AccessibleBase.cpp +++ b/webkit/pending/AccessibleBase.cpp @@ -127,13 +127,18 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::get_accParent(IDispatch** parent) return S_OK; } - HMODULE accessibilityLib = ::LoadLibrary(TEXT("oleacc.dll")); + HMODULE accessibilityLib = ::LoadLibrary(TEXT("oleacc.dll")); static LPFNACCESSIBLEOBJECTFROMWINDOW procPtr = reinterpret_cast<LPFNACCESSIBLEOBJECTFROMWINDOW>(::GetProcAddress(accessibilityLib, "AccessibleObjectFromWindow")); - if (!procPtr) - return E_FAIL; + if (!procPtr) + return E_FAIL; - return procPtr(m_object->topDocumentFrameView()->hostWindow()->platformWindow(), OBJID_WINDOW, __uuidof(IAccessible), reinterpret_cast<void**>(parent)); + // TODO(eseidel): platformWindow returns a void* which is an opaque + // identifier corresponding to the HWND WebKit is embedded in. It happens + // to be the case that platformWindow is a valid HWND pointer (inaccessible + // from the sandboxed renderer). + HWND window = static_cast<HWND>(m_object->topDocumentFrameView()->hostWindow()->platformWindow()); + return procPtr(window, OBJID_WINDOW, __uuidof(IAccessible), reinterpret_cast<void**>(parent)); } HRESULT STDMETHODCALLTYPE AccessibleBase::get_accChildCount(long* count) @@ -152,9 +157,9 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::get_accChild(VARIANT vChild, IDispatch return E_POINTER; if (vChild.vt != VT_I4) { - *ppChild = NULL; - return E_INVALIDARG; - } + *ppChild = NULL; + return E_INVALIDARG; + } *ppChild = 0; diff --git a/webkit/port/platform/chromium/PlatformWidget.h b/webkit/port/platform/chromium/PlatformWidget.h index 5012eae..661999f 100644 --- a/webkit/port/platform/chromium/PlatformWidget.h +++ b/webkit/port/platform/chromium/PlatformWidget.h @@ -4,7 +4,6 @@ // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above @@ -30,8 +29,10 @@ #ifndef PlatformWidget_h #define PlatformWidget_h -#include "base/gfx/native_widget_types.h" +// PlatformWidget is an opaque identifier corresponding to whatever native +// view type the embedder may use. PlatformWidget CANNOT be assumed to be +// a valid pointer. Some embedders may not use this identifier at all. -typedef gfx::NativeView PlatformWidget; +typedef void* PlatformWidget; #endif |