diff options
-rw-r--r-- | base/gfx/native_widget_types.h | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/webview_host.mm | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/mac/webwidget_host.mm | 12 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 18 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate_gtk.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host.h | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host_gtk.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/webview_host_win.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host.h | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_gtk.cc | 10 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host_win.cc | 6 |
12 files changed, 38 insertions, 38 deletions
diff --git a/base/gfx/native_widget_types.h b/base/gfx/native_widget_types.h index 95e2292..3d4c046 100644 --- a/base/gfx/native_widget_types.h +++ b/base/gfx/native_widget_types.h @@ -47,6 +47,7 @@ class NSTextField; #endif // __OBJC__ #elif defined(OS_LINUX) typedef struct _GtkWidget GtkWidget; +typedef struct _GtkWindow GtkWindow; #endif namespace gfx { @@ -61,7 +62,7 @@ typedef NSWindow* NativeWindow; typedef NSTextField* NativeEditView; #elif defined(OS_LINUX) typedef GtkWidget* NativeView; -typedef GtkWidget* NativeWindow; +typedef GtkWindow* NativeWindow; typedef GtkWidget* NativeEditView; #else // null port. #error No known OS defined diff --git a/webkit/tools/test_shell/mac/webview_host.mm b/webkit/tools/test_shell/mac/webview_host.mm index 942f55d..bb9c0d3 100644 --- a/webkit/tools/test_shell/mac/webview_host.mm +++ b/webkit/tools/test_shell/mac/webview_host.mm @@ -14,12 +14,12 @@ #include "webkit/glue/webview.h" /*static*/ -WebViewHost* WebViewHost::Create(NSWindow *parent_window, +WebViewHost* WebViewHost::Create(NSView* parent_view, WebViewDelegate* delegate, const WebPreferences& prefs) { WebViewHost* host = new WebViewHost(); - NSRect content_rect = [[parent_window contentView] frame]; + NSRect content_rect = [parent_view frame]; // bump down the top of the view so that it doesn't overlap the buttons // and URL field. 32 is an ad hoc constant. // TODO(awalker): replace explicit view layout with a little nib file @@ -28,7 +28,7 @@ WebViewHost* WebViewHost::Create(NSWindow *parent_window, host->view_ = [[TestShellWebView alloc] initWithFrame:content_rect]; // make the height and width track the window size. [host->view_ setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; - [[parent_window contentView] addSubview:host->view_]; + [parent_view addSubview:host->view_]; [host->view_ release]; host->webwidget_ = WebView::Create(delegate, prefs); diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index 2050f909..802634a 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -14,15 +14,15 @@ #include "webkit/glue/webwidget.h" /*static*/ -WebWidgetHost* WebWidgetHost::Create(NSWindow* parent_window, +WebWidgetHost* WebWidgetHost::Create(NSView* parent_view, WebWidgetDelegate* delegate) { WebWidgetHost* host = new WebWidgetHost(); - NSRect content_rect = [parent_window frame]; + NSRect content_rect = [parent_view frame]; content_rect.origin.y += 64; content_rect.size.height -= 64; host->view_ = [[NSView alloc] initWithFrame:content_rect]; - [[parent_window contentView] addSubview:host->view_]; + [parent_view addSubview:host->view_]; // win_util::SetWindowUserData(host->hwnd_, host); @@ -33,13 +33,13 @@ WebWidgetHost* WebWidgetHost::Create(NSWindow* parent_window, } /*static*/ -WebWidgetHost* WebWidgetHost::FromWindow(NSWindow* hwnd) { +WebWidgetHost* WebWidgetHost::FromWindow(NSView* view) { return NULL; } /*static*/ -void WebWidgetHost::HandleEvent(NSWindow *window, NSEvent *event) { - WebWidgetHost* host = FromWindow(window); +void WebWidgetHost::HandleEvent(NSView* view, NSEvent* event) { + WebWidgetHost* host = FromWindow(view); if (host) { switch ([event type]) { case NSLeftMouseDown: diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 8e980f9..7cdca4b 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -209,7 +209,7 @@ namespace { // Callback for when the main window is destroyed. gboolean MainWindowDestroyed(GtkWindow* window, TestShell* shell) { - TestShell::RemoveWindowFromList(GTK_WIDGET(window)); + TestShell::RemoveWindowFromList(window); if (TestShell::windowList()->empty() || shell->is_modal()) { MessageLoop::current()->PostTask(FROM_HERE, @@ -304,9 +304,9 @@ GtkWidget* CreateMenuBar(TestShell* shell) { } bool TestShell::Initialize(const std::wstring& startingURL) { - m_mainWnd = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(m_mainWnd), "Test Shell"); - gtk_window_set_default_size(GTK_WINDOW(m_mainWnd), 640, 480); + m_mainWnd = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); + gtk_window_set_title(m_mainWnd, "Test Shell"); + gtk_window_set_default_size(m_mainWnd, 640, 480); g_signal_connect(G_OBJECT(m_mainWnd), "destroy", G_CALLBACK(MainWindowDestroyed), this); g_signal_connect(G_OBJECT(m_mainWnd), "focus-out-event", @@ -361,7 +361,7 @@ bool TestShell::Initialize(const std::wstring& startingURL) { webView()->SetUseEditorDelegate(true); gtk_container_add(GTK_CONTAINER(m_mainWnd), vbox); - gtk_widget_show_all(m_mainWnd); + gtk_widget_show_all(GTK_WIDGET(m_mainWnd)); top_chrome_height_ = toolbar->allocation.height + menu_bar->allocation.height + 2 * gtk_box_get_spacing(GTK_BOX(vbox)); @@ -384,7 +384,7 @@ void TestShell::TestFinished() { return; test_is_pending_ = false; - GtkWidget* window = *(TestShell::windowList()->begin()); + GtkWindow* window = *(TestShell::windowList()->begin()); TestShell* shell = static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), "test-shell")); TestShell::Dump(shell); @@ -437,7 +437,7 @@ void TestShell::InteractiveSetFocus(WebWidgetHost* host, bool enable) { void TestShell::DestroyWindow(gfx::NativeWindow windowHandle) { RemoveWindowFromList(windowHandle); - gtk_widget_destroy(windowHandle); + gtk_widget_destroy(GTK_WIDGET(windowHandle)); } WebWidget* TestShell::CreatePopupWidget(WebView* webview) { @@ -477,7 +477,7 @@ void TestShell::ResizeSubViews() { result->clear(); for (WindowList::iterator iter = TestShell::windowList()->begin(); iter != TestShell::windowList()->end(); iter++) { - GtkWidget* window = *iter; + GtkWindow* window = *iter; TestShell* shell = static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), "test-shell")); webkit_glue::DumpBackForwardList(shell->webView(), NULL, result); @@ -491,7 +491,7 @@ void TestShell::ResizeSubViews() { return false; } - GtkWidget* window = *(TestShell::windowList()->begin()); + GtkWindow* window = *(TestShell::windowList()->begin()); TestShell* shell = static_cast<TestShell*>(g_object_get_data(G_OBJECT(window), "test-shell")); shell->ResetTestController(); diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index ce5ead7..cbf1794 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -265,7 +265,7 @@ bool TestShell::Initialize(const std::wstring& startingURL) { // Create a webview. Note that |web_view| takes ownership of this shell so we // will get cleaned up when it gets destroyed. m_webViewHost.reset( - WebViewHost::Create(m_mainWnd, delegate_.get(), *TestShell::web_prefs_)); + WebViewHost::Create([m_mainWnd contentView], delegate_.get(), *TestShell::web_prefs_)); webView()->SetUseEditorDelegate(true); delegate_->RegisterDragDrop(); TestShellWebView* web_view = diff --git a/webkit/tools/test_shell/test_webview_delegate_gtk.cc b/webkit/tools/test_shell/test_webview_delegate_gtk.cc index 8482080..3b61456 100644 --- a/webkit/tools/test_shell/test_webview_delegate_gtk.cc +++ b/webkit/tools/test_shell/test_webview_delegate_gtk.cc @@ -95,9 +95,8 @@ WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate( } void TestWebViewDelegate::ShowJavaScriptAlert(const std::wstring& message) { - // TODO(port): remove GTK_WINDOW bit after gfx::NativeWindow is fixed. GtkWidget* dialog = gtk_message_dialog_new( - GTK_WINDOW(shell_->mainWnd()), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, + shell_->mainWnd(), GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", WideToUTF8(message).c_str()); gtk_window_set_title(GTK_WINDOW(dialog), "JavaScript Alert"); gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop. diff --git a/webkit/tools/test_shell/webview_host.h b/webkit/tools/test_shell/webview_host.h index 86dba37..c1bee42 100644 --- a/webkit/tools/test_shell/webview_host.h +++ b/webkit/tools/test_shell/webview_host.h @@ -21,7 +21,7 @@ class WebViewHost : public WebWidgetHost { // The new instance is deleted once the associated NativeView is destroyed. // The newly created window should be resized after it is created, using the // MoveWindow (or equivalent) function. - static WebViewHost* Create(gfx::NativeWindow parent_window, + static WebViewHost* Create(gfx::NativeView parent_view, WebViewDelegate* delegate, const WebPreferences& prefs); diff --git a/webkit/tools/test_shell/webview_host_gtk.cc b/webkit/tools/test_shell/webview_host_gtk.cc index 9673f2f..81753f6 100644 --- a/webkit/tools/test_shell/webview_host_gtk.cc +++ b/webkit/tools/test_shell/webview_host_gtk.cc @@ -14,12 +14,12 @@ #include "webkit/glue/webview.h" /*static*/ -WebViewHost* WebViewHost::Create(GtkWidget* box, +WebViewHost* WebViewHost::Create(GtkWidget* parent_view, WebViewDelegate* delegate, const WebPreferences& prefs) { WebViewHost* host = new WebViewHost(); - host->view_ = WebWidgetHost::CreateWindow(box, host); + host->view_ = WebWidgetHost::CreateWindow(parent_view, host); g_object_set_data(G_OBJECT(host->view_), "webwidgethost", host); host->webwidget_ = WebView::Create(delegate, prefs); diff --git a/webkit/tools/test_shell/webview_host_win.cc b/webkit/tools/test_shell/webview_host_win.cc index 899ce31..c1cc900 100644 --- a/webkit/tools/test_shell/webview_host_win.cc +++ b/webkit/tools/test_shell/webview_host_win.cc @@ -14,7 +14,7 @@ static const wchar_t kWindowClassName[] = L"WebViewHost"; /*static*/ -WebViewHost* WebViewHost::Create(gfx::NativeWindow parent_window, +WebViewHost* WebViewHost::Create(HWND parent_view, WebViewDelegate* delegate, const WebPreferences& prefs) { WebViewHost* host = new WebViewHost(); diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h index 8498c4f..7b09d16 100644 --- a/webkit/tools/test_shell/webwidget_host.h +++ b/webkit/tools/test_shell/webwidget_host.h @@ -24,12 +24,12 @@ class WebWidgetHost { // The new instance is deleted once the associated NativeView is destroyed. // The newly created window should be resized after it is created, using the // MoveWindow (or equivalent) function. - static WebWidgetHost* Create(gfx::NativeWindow parent_window, + static WebWidgetHost* Create(gfx::NativeView parent_view, WebWidgetDelegate* delegate); - static WebWidgetHost* FromWindow(gfx::NativeWindow view); + static WebWidgetHost* FromWindow(gfx::NativeView view); #if defined(OS_MACOSX) - static void HandleEvent(gfx::NativeWindow window, NSEvent *event); + static void HandleEvent(gfx::NativeView view, NSEvent* event); #endif gfx::NativeView view_handle() const { return view_; } @@ -83,7 +83,7 @@ class WebWidgetHost { // parent: a GtkBox to pack the new widget at the end of // host: a pointer to a WebWidgetHost (or subclass thereof) // --------------------------------------------------------------------------- - static gfx::NativeWindow CreateWindow(gfx::NativeWindow parent, void* host); + static gfx::NativeView CreateWindow(gfx::NativeView parent_view, void* host); void WindowDestroyed(); void Resize(const gfx::Size& size); #endif diff --git a/webkit/tools/test_shell/webwidget_host_gtk.cc b/webkit/tools/test_shell/webwidget_host_gtk.cc index f873fa1..5577040 100644 --- a/webkit/tools/test_shell/webwidget_host_gtk.cc +++ b/webkit/tools/test_shell/webwidget_host_gtk.cc @@ -118,10 +118,10 @@ gboolean MouseScrollEvent(GtkWidget* widget, GdkEventScroll* event, // ----------------------------------------------------------------------------- -gfx::NativeWindow WebWidgetHost::CreateWindow(gfx::NativeWindow box, +GtkWidget* WebWidgetHost::CreateWindow(GtkWidget* parent_view, void* host) { GtkWidget* widget = gtk_drawing_area_new(); - gtk_box_pack_start(GTK_BOX(box), widget, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(parent_view), widget, TRUE, TRUE, 0); gtk_widget_add_events(widget, GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | @@ -152,10 +152,10 @@ gfx::NativeWindow WebWidgetHost::CreateWindow(gfx::NativeWindow box, return widget; } -WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow box, +WebWidgetHost* WebWidgetHost::Create(GtkWidget* parent_view, WebWidgetDelegate* delegate) { WebWidgetHost* host = new WebWidgetHost(); - host->view_ = CreateWindow(box, host); + host->view_ = CreateWindow(parent_view, host); host->webwidget_ = WebWidget::Create(delegate); // We manage our own double buffering because we need to be able to update // the expose area in an ExposeEvent within the lifetime of the event handler. @@ -185,7 +185,7 @@ void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) { DidInvalidateRect(clip_rect); } -WebWidgetHost* FromWindow(gfx::NativeWindow view) { +WebWidgetHost* FromWindow(GtkWidget* view) { const gpointer p = g_object_get_data(G_OBJECT(view), "webwidgethost"); return (WebWidgetHost* ) p; } diff --git a/webkit/tools/test_shell/webwidget_host_win.cc b/webkit/tools/test_shell/webwidget_host_win.cc index 845abf3..8980d33 100644 --- a/webkit/tools/test_shell/webwidget_host_win.cc +++ b/webkit/tools/test_shell/webwidget_host_win.cc @@ -15,7 +15,7 @@ static const wchar_t kWindowClassName[] = L"WebWidgetHost"; /*static*/ -WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window, +WebWidgetHost* WebWidgetHost::Create(HWND parent_view, WebWidgetDelegate* delegate) { WebWidgetHost* host = new WebWidgetHost(); @@ -45,8 +45,8 @@ WebWidgetHost* WebWidgetHost::Create(gfx::NativeWindow parent_window, } /*static*/ -WebWidgetHost* WebWidgetHost::FromWindow(gfx::NativeWindow hwnd) { - return reinterpret_cast<WebWidgetHost*>(win_util::GetWindowUserData(hwnd)); +WebWidgetHost* WebWidgetHost::FromWindow(HWND view) { + return reinterpret_cast<WebWidgetHost*>(win_util::GetWindowUserData(view)); } /*static*/ |