| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H__ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H__ |
| 6 #define WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H__ | 6 #define WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H__ |
| 7 | 7 |
| 8 #if defined(OS_WIN) |
| 8 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif |
| 9 | 11 |
| 10 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
| 11 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 12 #include "webkit/tools/test_shell/webwidget_host.h" | 14 #include "webkit/tools/test_shell/webwidget_host.h" |
| 13 | 15 |
| 14 struct WebPreferences; | 16 struct WebPreferences; |
| 15 class WebView; | 17 class WebView; |
| 16 class WebViewDelegate; | 18 class WebViewDelegate; |
| 17 | 19 |
| 18 // This class is a simple HWND-based host for a WebView | 20 // This class is a simple HWND-based host for a WebView |
| 19 class WebViewHost : public WebWidgetHost { | 21 class WebViewHost : public WebWidgetHost { |
| 20 public: | 22 public: |
| 21 // The new instance is deleted once the associated HWND is destroyed. The | 23 // The new instance is deleted once the associated HWND is destroyed. The |
| 22 // newly created window should be resized after it is created, using the | 24 // newly created window should be resized after it is created, using the |
| 23 // MoveWindow (or equivalent) function. | 25 // MoveWindow (or equivalent) function. |
| 26 #if defined(OS_WIN) |
| 24 static WebViewHost* Create(HWND parent_window, | 27 static WebViewHost* Create(HWND parent_window, |
| 25 WebViewDelegate* delegate, | 28 WebViewDelegate* delegate, |
| 26 const WebPreferences& prefs); | 29 const WebPreferences& prefs); |
| 30 #else // null port. |
| 31 static WebViewHost* Create(void* parent_window, |
| 32 WebViewDelegate* delegate, |
| 33 const WebPreferences& prefs); |
| 34 #endif |
| 27 | 35 |
| 28 WebView* webview() const; | 36 WebView* webview() const; |
| 29 | 37 |
| 30 protected: | 38 protected: |
| 39 #if defined(OS_WIN) |
| 31 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) { | 40 virtual bool WndProc(UINT message, WPARAM wparam, LPARAM lparam) { |
| 32 return false; | 41 return false; |
| 33 } | 42 } |
| 43 #endif |
| 34 }; | 44 }; |
| 35 | 45 |
| 36 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H__ | 46 #endif // WEBKIT_TOOLS_TEST_SHELL_WEBVIEW_HOST_H__ |
| 37 | |
| OLD | NEW |