diff options
-rw-r--r-- | chrome/common/common_glue.cc | 7 | ||||
-rw-r--r-- | chrome/common/gfx/chrome_font_gtk.cc | 2 | ||||
-rw-r--r-- | chrome/common/resource_bundle.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 42 | ||||
-rw-r--r-- | chrome/test/unit/unit_tests.scons | 14 | ||||
-rw-r--r-- | webkit/glue/SConscript | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/SConscript | 5 |
7 files changed, 67 insertions, 21 deletions
diff --git a/chrome/common/common_glue.cc b/chrome/common/common_glue.cc index 7d32310..0e173f80 100644 --- a/chrome/common/common_glue.cc +++ b/chrome/common/common_glue.cc @@ -4,6 +4,7 @@ #include "base/command_line.h" #include "base/path_service.h" +#include "build/build_config.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/l10n_util.h" @@ -22,7 +23,13 @@ bool GetApplicationDirectory(std::wstring *path) { } bool IsPluginRunningInRendererProcess() { +#if defined(OS_WIN) return !IsPluginProcess(); +#else + // TODO(port): We need an implementation of IsPluginProcess. + NOTIMPLEMENTED(); + return false; +#endif } std::wstring GetWebKitLocale() { diff --git a/chrome/common/gfx/chrome_font_gtk.cc b/chrome/common/gfx/chrome_font_gtk.cc index 48f48a6..f925261 100644 --- a/chrome/common/gfx/chrome_font_gtk.cc +++ b/chrome/common/gfx/chrome_font_gtk.cc @@ -8,6 +8,8 @@ #include "base/string_util.h" +ChromeFont* ChromeFont::default_font_ = NULL; + // Get the default gtk system font (name and size). // TODO(estade): is there a way to do this that does not involve making a // temporary widget? diff --git a/chrome/common/resource_bundle.cc b/chrome/common/resource_bundle.cc index c97f1b2..1e2538e 100644 --- a/chrome/common/resource_bundle.cc +++ b/chrome/common/resource_bundle.cc @@ -15,6 +15,9 @@ ResourceBundle* ResourceBundle::g_shared_instance_ = NULL; +// TODO(port): InitSharedInstance and CleanupSharedInstance are portable, but +// they need LoadLocaleResource and ~ResourceBundle implemented. +#if defined(OS_WIN) /* static */ void ResourceBundle::InitSharedInstance(const std::wstring& pref_locale) { DCHECK(g_shared_instance_ == NULL) << "ResourceBundle initialized twice"; @@ -30,6 +33,7 @@ void ResourceBundle::CleanupSharedInstance() { g_shared_instance_ = NULL; } } +#endif /* static */ ResourceBundle& ResourceBundle::GetSharedInstance() { @@ -51,6 +55,8 @@ void ResourceBundle::FreeImages() { skia_images_.clear(); } +// TODO(port): LoadBitmap is portable, but it needs a LoadResourceBytes impl. +#if defined(OS_WIN) /* static */ SkBitmap* ResourceBundle::LoadBitmap(DataHandle data_handle, int resource_id) { std::vector<unsigned char> raw_data, png_data; @@ -71,6 +77,7 @@ SkBitmap* ResourceBundle::LoadBitmap(DataHandle data_handle, int resource_id) { image_width, image_height); } +#endif SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) { // Check to see if we already have the Skia image in the cache. @@ -83,9 +90,15 @@ SkBitmap* ResourceBundle::GetBitmapNamed(int resource_id) { scoped_ptr<SkBitmap> bitmap; - // Try to load the bitmap from the theme data. - if (theme_data_) + if (theme_data_) { +#if defined(OS_WIN) + // TODO(port): We need to implement LoadBitmap before this can link. + // Try to load the bitmap from the theme data. bitmap.reset(LoadBitmap(theme_data_, resource_id)); +#else + NOTIMPLEMENTED(); +#endif + } #if defined(OS_WIN) // TODO(port): refactor to remove this. diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index d31fa6a..3bd9edf 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -4,6 +4,8 @@ // This file provides the embedder's side of random webkit glue functions. +#include "build/build_config.h" + #if defined(OS_WIN) #include <windows.h> #include <wininet.h> @@ -13,7 +15,6 @@ #include "base/command_line.h" #include "base/scoped_clipboard_writer.h" #include "base/string_util.h" -#include "build/build_config.h" #include "chrome/renderer/net/render_dns_master.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/resource_bundle.h" @@ -162,9 +163,14 @@ void AppendToLog(const char* file, int line, const char* msg) { } bool GetMimeTypeFromExtension(const std::wstring &ext, - std::string *mime_type) { + std::string *mime_type) { +#if defined(OS_WIN) + // TODO(port): Need to define IsPluginProcess. if (IsPluginProcess()) return net::GetMimeTypeFromExtension(ext, mime_type); +#else + NOTIMPLEMENTED(); +#endif // The sandbox restricts our access to the registry, so we need to proxy // these calls over to the browser process. @@ -175,9 +181,14 @@ bool GetMimeTypeFromExtension(const std::wstring &ext, } bool GetMimeTypeFromFile(const std::wstring &file_path, - std::string *mime_type) { + std::string *mime_type) { +#if defined(OS_WIN) + // TODO(port): Need to define IsPluginProcess. if (IsPluginProcess()) return net::GetMimeTypeFromFile(file_path, mime_type); +#else + NOTIMPLEMENTED(); +#endif // The sandbox restricts our access to the registry, so we need to proxy // these calls over to the browser process. @@ -188,9 +199,14 @@ bool GetMimeTypeFromFile(const std::wstring &file_path, } bool GetPreferredExtensionForMimeType(const std::string& mime_type, - std::wstring* ext) { + std::wstring* ext) { +#if defined(OS_WIN) + // TODO(port): Need to define IsPluginProcess. if (IsPluginProcess()) return net::GetPreferredExtensionForMimeType(mime_type, ext); +#else + NOTIMPLEMENTED(); +#endif // The sandbox restricts our access to the registry, so we need to proxy // these calls over to the browser process. @@ -200,15 +216,21 @@ bool GetPreferredExtensionForMimeType(const std::string& mime_type, return !ext->empty(); } +// TODO(port): Need to finish port ResourceBundle. std::string GetDataResource(int resource_id) { +#if defined(OS_WIN) return ResourceBundle::GetSharedInstance().GetDataResource(resource_id); +#else + NOTIMPLEMENTED(); + return std::string(); +#endif } +#if defined(OS_WIN) SkBitmap* GetBitmapResource(int resource_id) { return ResourceBundle::GetSharedInstance().GetBitmapNamed(resource_id); } -#if defined(OS_WIN) HCURSOR LoadCursor(int cursor_id) { return ResourceBundle::GetSharedInstance().LoadCursor(cursor_id); } @@ -220,6 +242,16 @@ Clipboard* ClipboardGetClipboard(){ return NULL; } +#if defined(OS_LINUX) +// TODO(port): This should replace the method below (the unsigned int is a +// windows type). We may need to convert the type of format so it can be sent +// over IPC. +bool ClipboardIsFormatAvailable(Clipboard::FormatType format) { + NOTIMPLEMENTED(); + return false; +} +#endif + bool ClipboardIsFormatAvailable(unsigned int format) { bool result; g_render_thread->Send( diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons index 6d67674..9132f1b 100644 --- a/chrome/test/unit/unit_tests.scons +++ b/chrome/test/unit/unit_tests.scons @@ -24,20 +24,11 @@ env.SConscript([ '$MODP_B64_DIR/using_modp_b64.scons', '$NET_DIR/using_net.scons', '$NPAPI_DIR/using_npapi.scons', + '$SDCH_DIR/using_sdch.scons', '$SKIA_DIR/using_skia.scons', '$ZLIB_DIR/using_zlib.scons', ], {'env':env}) -if env.Bit('windows'): - env.SConscript([ - '$SDCH_DIR/using_sdch.scons', - ], {'env':env}) - -if env.Bit('posix'): - env.SConscript([ - '$LIBEVENT_DIR/using_libevent.scons', - ], {'env':env}) - env.Prepend( CPPPATH = [ '$CHROME_DIR/app/resources', @@ -48,7 +39,6 @@ env.Prepend( 'common', 'plugin', 'renderer', - 'sdch', 'sqlite', 'util', 'v8_snapshot', @@ -81,7 +71,6 @@ if env.Bit('windows'): 'jscre', 'test_chrome_plugin', 'views', - 'WebCore', # Windows-specific libraries. 'activex_shim', @@ -261,7 +250,6 @@ input_files = ChromeFileList([ '$CHROME_DIR/renderer/render_widget_unittest.cc', '$CHROME_DIR/renderer/user_script_slave_unittest.cc', '$CHROME_DIR/renderer/render_process_unittest.cc', - '$WEBKIT_DIR/glue/mock_webkit_glue.cc', '$CHROME_DIR/renderer/render_thread_unittest.cc', # test_infrastructure diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript index 5027c9d..df87873 100644 --- a/webkit/glue/SConscript +++ b/webkit/glue/SConscript @@ -65,7 +65,6 @@ input_files = [ 'resource_fetcher.cc', 'resource_handle_impl.cc', 'searchable_form_data.cc', - 'simple_clipboard_impl.cc', 'stacking_order_iterator.cc', 'webcursor.cc', 'webdatasource_impl.cc', diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript index 4bdfea9..06d28c7 100644 --- a/webkit/tools/test_shell/SConscript +++ b/webkit/tools/test_shell/SConscript @@ -107,6 +107,11 @@ input_files = [ 'event_sending_controller.cc', 'layout_test_controller.cc', 'simple_resource_loader_bridge.cc', + + # This file is only used by test_shell/test_shell_tests. It should + # probably be moved to the test_shell directory like + # simple_resource_loader_bridge.cc. + '$WEBKIT_DIR/glue/simple_clipboard_impl.cc', 'test_navigation_controller.cc', 'test_shell_request_context.cc', 'test_shell_switches.cc', |