diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-10 15:09:39 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-10 15:09:39 +0000 |
commit | 9146221ca83c4996713894316661b442b20c9e28 (patch) | |
tree | 0cd1efb863d39a4ac44aacde045c957552e3da7d /webkit | |
parent | 98f5f88b53f774cee109503b0225a5bfb9deb550 (diff) | |
download | chromium_src-9146221ca83c4996713894316661b442b20c9e28.zip chromium_src-9146221ca83c4996713894316661b442b20c9e28.tar.gz chromium_src-9146221ca83c4996713894316661b442b20c9e28.tar.bz2 |
Adds some ifdefs so that test_shell can be compiled on linux
without GTK.
I had to recreate this patch as my workspace for various
resonds. UGH!
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/67024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webcursor.h | 4 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 7 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_shell.cc | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/webwidget_host.h | 16 |
6 files changed, 31 insertions, 12 deletions
diff --git a/webkit/glue/webcursor.h b/webkit/glue/webcursor.h index a46f881..f2fbe62 100644 --- a/webkit/glue/webcursor.h +++ b/webkit/glue/webcursor.h @@ -15,7 +15,7 @@ typedef struct HINSTANCE__* HINSTANCE; typedef struct HICON__* HICON; typedef HICON HCURSOR; -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_GTK) // GdkCursorType is an enum, which we can't forward-declare. :( #include <gdk/gdkcursor.h> #elif defined(OS_MACOSX) @@ -71,7 +71,7 @@ class WebCursor { // APIs on it. void InitFromExternalCursor(HCURSOR handle); -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_GTK) // Return the stock GdkCursorType for this cursor, or GDK_CURSOR_IS_PIXMAP // if it's a custom cursor. Return GDK_LAST_CURSOR to indicate that the cursor // should be set to the system default. diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index a1e5416..1c498cf 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -155,7 +155,7 @@ MSVC_POP_WARNING(); #include "webkit/glue/webtextinput_impl.h" #include "webkit/glue/webview_impl.h" -#if defined(OS_LINUX) +#if defined(TOOLKIT_GTK) #include <gdk/gdk.h> #endif diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index f674147..308e4ea 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -715,12 +715,15 @@ void WebPluginImpl::paint(WebCore::GraphicsContext* gc, gc->translate(static_cast<float>(origin.x()), static_cast<float>(origin.y())); -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(TOOLKIT_GTK) // Note that |context| is only used when in windowless mode. gfx::NativeDrawingContext context = gc->platformContext()->canvas()->beginPlatformPaint(); #elif defined(OS_MACOSX) gfx::NativeDrawingContext context = gc->platformContext(); +#else + NOTIMPLEMENTED(); + gfx::NativeDrawingContext context = NULL; #endif WebCore::IntRect window_rect = @@ -729,7 +732,7 @@ void WebPluginImpl::paint(WebCore::GraphicsContext* gc, delegate_->Paint(context, webkit_glue::FromIntRect(window_rect)); -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) || defined(TOOLKIT_GTK) gc->platformContext()->canvas()->endPlatformPaint(); #endif gc->restore(); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index df8b087..6ce2509 100755 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -574,9 +574,11 @@ void AppendToLog(const char* file, int line, const char* msg) { logging::LogMessage(file, line).stream() << msg; } +#if !defined(LINUX2) bool GetApplicationDirectory(std::wstring *path) { return PathService::Get(base::DIR_EXE, path); } +#endif GURL GetInspectorURL() { return GURL("test-shell-resource://inspector/inspector.html"); @@ -586,9 +588,11 @@ std::string GetUIResourceProtocol() { return "test-shell-resource"; } +#if !defined(LINUX2) bool GetExeDirectory(std::wstring *path) { return PathService::Get(base::DIR_EXE, path); } +#endif bool SpellCheckWord(const wchar_t* word, int word_len, int* misspelling_start, int* misspelling_len) { @@ -598,14 +602,17 @@ bool SpellCheckWord(const wchar_t* word, int word_len, return true; } +#if !defined(LINUX2) bool IsPluginRunningInRendererProcess() { return true; } +#endif bool GetPluginFinderURL(std::string* plugin_finder_url) { return false; } +#if !defined(LINUX2) bool IsDefaultPluginEnabled() { return false; } @@ -613,5 +620,6 @@ bool IsDefaultPluginEnabled() { std::wstring GetWebKitLocale() { return L"en-US"; } +#endif } // namespace webkit_glue diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 03d7387..15f92f5 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -16,7 +16,7 @@ #endif #include <map> -#if defined(OS_LINUX) +#if defined(TOOLKIT_GTK) #include <gdk/gdkcursor.h> #endif @@ -69,7 +69,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, #else , select_trailing_whitespace_enabled_(false) #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_GTK) , cursor_type_(GDK_X_CURSOR) #endif { @@ -341,7 +341,7 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, scoped_refptr<TestDropDelegate> drop_delegate_; #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_GTK) // The type of cursor the window is currently using. // Used for judging whether a new SetCursor call is actually changing the // cursor. diff --git a/webkit/tools/test_shell/webwidget_host.h b/webkit/tools/test_shell/webwidget_host.h index 1fd02c1..96235a9 100644 --- a/webkit/tools/test_shell/webwidget_host.h +++ b/webkit/tools/test_shell/webwidget_host.h @@ -8,16 +8,13 @@ #include "base/basictypes.h" #include "base/gfx/native_widget_types.h" #include "base/gfx/rect.h" +#include "base/gfx/size.h" #include "base/scoped_ptr.h" #include "skia/ext/platform_canvas.h" class WebWidget; class WebWidgetDelegate; -namespace gfx { -class Size; -} - namespace WebKit { struct WebScreenInfo; } @@ -51,6 +48,9 @@ class WebWidgetHost { #if defined(OS_WIN) void SetCursor(HCURSOR cursor); #endif +#if defined(LINUX2) + const gfx::Size& size() const { return size_; } +#endif void DiscardBackingStore(); // Allow clients to update the paint rect. For example, if we get a gdk @@ -58,6 +58,8 @@ class WebWidgetHost { void UpdatePaintRect(const gfx::Rect& rect); void Paint(); + skia::PlatformCanvas* canvas() const { return canvas_.get(); } + WebKit::WebScreenInfo GetScreenInfo(); protected: @@ -112,6 +114,12 @@ class WebWidgetHost { #endif } +#if defined(LINUX2) + void ScheduleRepaint(const gfx::Rect& bounds); + + gfx::Size size_; +#endif + gfx::NativeView view_; WebWidget* webwidget_; scoped_ptr<skia::PlatformCanvas> canvas_; |