summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/chromium_bridge_impl.cc18
-rw-r--r--webkit/glue/webkit_glue.h2
-rw-r--r--webkit/glue/webplugin.h9
-rw-r--r--webkit/glue/webplugin_impl.cc3
-rw-r--r--webkit/glue/webplugin_impl.h5
-rw-r--r--webkit/glue/webwidget_delegate.h2
-rw-r--r--webkit/pending/AccessibleBase.cpp6
-rwxr-xr-xwebkit/tools/test_shell/test_shell.cc4
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc7
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.h2
10 files changed, 30 insertions, 28 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc
index 680ae9e..4780fa6 100644
--- a/webkit/glue/chromium_bridge_impl.cc
+++ b/webkit/glue/chromium_bridge_impl.cc
@@ -62,14 +62,10 @@
namespace {
-gfx::NativeView ToPlatform(WebCore::Widget* widget) {
+gfx::NativeViewId ToNativeId(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);
+ return widget->root()->hostWindow()->platformWindow();
}
#if PLATFORM(WIN_OS)
@@ -433,25 +429,25 @@ PassRefPtr<Image> ChromiumBridge::loadPlatformImageResource(const char* name) {
// Screen ---------------------------------------------------------------------
int ChromiumBridge::screenDepth(Widget* widget) {
- return webkit_glue::GetScreenInfo(ToPlatform(widget)).depth;
+ return webkit_glue::GetScreenInfo(ToNativeId(widget)).depth;
}
int ChromiumBridge::screenDepthPerComponent(Widget* widget) {
- return webkit_glue::GetScreenInfo(ToPlatform(widget)).depth_per_component;
+ return webkit_glue::GetScreenInfo(ToNativeId(widget)).depth_per_component;
}
bool ChromiumBridge::screenIsMonochrome(Widget* widget) {
- return webkit_glue::GetScreenInfo(ToPlatform(widget)).is_monochrome;
+ return webkit_glue::GetScreenInfo(ToNativeId(widget)).is_monochrome;
}
IntRect ChromiumBridge::screenRect(Widget* widget) {
return webkit_glue::ToIntRect(
- webkit_glue::GetScreenInfo(ToPlatform(widget)).rect);
+ webkit_glue::GetScreenInfo(ToNativeId(widget)).rect);
}
IntRect ChromiumBridge::screenAvailableRect(Widget* widget) {
return webkit_glue::ToIntRect(
- webkit_glue::GetScreenInfo(ToPlatform(widget)).available_rect);
+ webkit_glue::GetScreenInfo(ToNativeId(widget)).available_rect);
}
// SharedTimers ----------------------------------------------------------------
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index f3335b5..50cd2c4 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -241,7 +241,7 @@ bool EnsureFontLoaded(HFONT font);
#endif
// Returns screen information corresponding to the given window.
-ScreenInfo GetScreenInfo(gfx::NativeView window);
+ScreenInfo GetScreenInfo(gfx::NativeViewId window);
// Functions implemented by webkit_glue for WebKit ----------------------------
diff --git a/webkit/glue/webplugin.h b/webkit/glue/webplugin.h
index 7350df4..773752f 100644
--- a/webkit/glue/webplugin.h
+++ b/webkit/glue/webplugin.h
@@ -11,11 +11,11 @@
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/gfx/rect.h"
+#include "base/gfx/native_widget_types.h"
-// TODO(port): type typedefs are obviously incorrect on non-Windows
+// TODO(port): this typedef is obviously incorrect on non-Windows
// platforms, but now a lot of code now accidentally depends on them
// existing. #ifdef out these declarations and fix all the users.
-typedef struct HWND__* HWND;
typedef void* HANDLE;
class GURL;
@@ -58,7 +58,7 @@ struct WebPluginInfo {
// Describes the new location for a plugin window.
struct WebPluginGeometry {
- HWND window;
+ gfx::NativeView window;
gfx::Rect window_rect;
// Clip rect (include) and cutouts (excludes), relative to
// window_rect origin.
@@ -89,7 +89,8 @@ class WebPlugin {
// The pump_messages_event is a event handle which is valid only for
// windowless plugins and is used in NPP_HandleEvent calls to pump messages
// if the plugin enters a modal loop.
- virtual void SetWindow(HWND window, HANDLE pump_messages_event) = 0;
+ virtual void SetWindow(gfx::NativeView window,
+ HANDLE pump_messages_event) = 0;
// Cancels a pending request.
virtual void CancelResource(int id) = 0;
virtual void Invalidate() = 0;
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index d7d32a4..5bf2f72 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -328,7 +328,8 @@ WebPluginImpl::WebPluginImpl(WebCore::Element* element,
WebPluginImpl::~WebPluginImpl() {
}
-void WebPluginImpl::SetWindow(HWND window, HANDLE pump_messages_event) {
+void WebPluginImpl::SetWindow(gfx::NativeView window,
+ HANDLE pump_messages_event) {
if (window) {
DCHECK(!windowless_); // Make sure not called twice.
window_ = window;
diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h
index b99b784..58c633e 100644
--- a/webkit/glue/webplugin_impl.h
+++ b/webkit/glue/webplugin_impl.h
@@ -11,6 +11,7 @@
#include "config.h"
#include "base/compiler_specific.h"
+#include "base/gfx/native_widget_types.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "ResourceHandle.h"
@@ -146,7 +147,7 @@ class WebPluginImpl : public WebPlugin,
int arg_count, char** arg_names, char** arg_values);
// WebPlugin implementation:
- void SetWindow(HWND window, HANDLE pump_messages_event);
+ void SetWindow(gfx::NativeView window, HANDLE pump_messages_event);
// Given a (maybe partial) url, completes using the base url.
bool CompleteURL(const std::string& url_in, std::string* url_out);
@@ -323,7 +324,7 @@ class WebPluginImpl : public WebPlugin,
std::vector<ClientInfo> clients_;
bool windowless_;
- HWND window_;
+ gfx::NativeView window_;
WebCore::Element* element_;
WebFrameImpl* webframe_;
diff --git a/webkit/glue/webwidget_delegate.h b/webkit/glue/webwidget_delegate.h
index cd84041..81caeb31 100644
--- a/webkit/glue/webwidget_delegate.h
+++ b/webkit/glue/webwidget_delegate.h
@@ -20,7 +20,7 @@ struct WebPluginGeometry;
class WebWidgetDelegate {
public:
// Returns the view in which the WebWidget is embedded.
- virtual gfx::NativeView GetContainingView(WebWidget* webwidget) = 0;
+ virtual gfx::NativeViewId GetContainingView(WebWidget* webwidget) = 0;
// Called when a region of the WebWidget needs to be re-painted.
virtual void DidInvalidateRect(WebWidget* webwidget, const gfx::Rect& rect) = 0;
diff --git a/webkit/pending/AccessibleBase.cpp b/webkit/pending/AccessibleBase.cpp
index aed40ce..c211bbb 100644
--- a/webkit/pending/AccessibleBase.cpp
+++ b/webkit/pending/AccessibleBase.cpp
@@ -127,7 +127,7 @@ 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)
@@ -137,8 +137,8 @@ HRESULT STDMETHODCALLTYPE AccessibleBase::get_accParent(IDispatch** parent)
// 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));
+ HWND window = reinterpret_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)
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index c1ae406..ceeb6e6 100755
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -595,8 +595,8 @@ bool SpellCheckWord(const wchar_t* word, int word_len,
return true;
}
-ScreenInfo GetScreenInfo(gfx::NativeView window) {
- return GetScreenInfoHelper(window);
+ScreenInfo GetScreenInfo(gfx::NativeViewId window) {
+ return GetScreenInfoHelper(gfx::NativeViewFromId(window));
}
bool IsPluginRunningInRendererProcess() {
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 631d48e..684b22a 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -10,6 +10,7 @@
#include "base/file_util.h"
#include "base/gfx/point.h"
+#include "base/gfx/native_widget_types.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/trace_event.h"
@@ -664,9 +665,11 @@ void TestWebViewDelegate::SetUserStyleSheetLocation(const GURL& location) {
// WebWidgetDelegate ---------------------------------------------------------
-gfx::NativeView TestWebViewDelegate::GetContainingView(WebWidget* webwidget) {
+gfx::NativeViewId TestWebViewDelegate::GetContainingView(WebWidget* webwidget) {
+ // For test shell, we pack a NativeView pointer into the NativeViewId since
+ // everything is single process.
if (WebWidgetHost* host = GetHostForWidget(webwidget))
- return host->view_handle();
+ return gfx::IdFromNativeView(host->view_handle());
return NULL;
}
diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h
index d934bcc..65d0723 100644
--- a/webkit/tools/test_shell/test_webview_delegate.h
+++ b/webkit/tools/test_shell/test_webview_delegate.h
@@ -205,7 +205,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>,
virtual int GetHistoryForwardListCount();
// WebWidgetDelegate
- virtual gfx::NativeView GetContainingView(WebWidget* webwidget);
+ virtual gfx::NativeViewId GetContainingView(WebWidget* webwidget);
virtual void DidInvalidateRect(WebWidget* webwidget, const gfx::Rect& rect);
virtual void DidScrollRect(WebWidget* webwidget, int dx, int dy,
const gfx::Rect& clip_rect);