diff options
author | pvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 21:34:43 +0000 |
---|---|---|
committer | pvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 21:34:43 +0000 |
commit | 3faa467f5a4da77c16713ee39f4c7098a8210a7c (patch) | |
tree | cd78efdf29cbff79717c62db0c05c603a7e0a869 | |
parent | 6c5b9f9df3d703adf1cd76b69b86d87d80215fc9 (diff) | |
download | chromium_src-3faa467f5a4da77c16713ee39f4c7098a8210a7c.zip chromium_src-3faa467f5a4da77c16713ee39f4c7098a8210a7c.tar.gz chromium_src-3faa467f5a4da77c16713ee39f4c7098a8210a7c.tar.bz2 |
rid of more OS_LINUX defines, to help the BSD port (work by sprewell & I)
Review URL: http://codereview.chromium.org/2089010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55289 0039d316-1c4b-4281-b951-d872f2087c98
18 files changed, 65 insertions, 69 deletions
diff --git a/app/test_suite.h b/app/test_suite.h index eeea436..15276df 100644 --- a/app/test_suite.h +++ b/app/test_suite.h @@ -47,16 +47,14 @@ class AppTestSuite : public TestSuite { #error Unknown branding #endif mac_util::SetOverrideAppBundlePath(path); -#endif // OS_MACOSX - -#if defined(OS_LINUX) +#elif defined(OS_POSIX) FilePath pak_dir; PathService::Get(base::DIR_MODULE, &pak_dir); pak_dir = pak_dir.AppendASCII("app_unittests_strings"); PathService::Override(app::DIR_LOCALES, pak_dir); PathService::Override(app::FILE_RESOURCES_PAK, pak_dir.AppendASCII("app_resources.pak")); -#endif // OS_LINUX +#endif // Force unittests to run using en-US so if we test against string // output, it'll pass regardless of the system language. diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 85ab068..eb688f4 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -26,7 +26,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(TOOLKIT_USES_GTK) #include <gtk/gtk.h> #endif @@ -62,10 +62,10 @@ class TestSuite { base::EnableTerminationOnHeapCorruption(); CommandLine::Init(argc, argv); testing::InitGoogleTest(&argc, argv); -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(TOOLKIT_USES_GTK) g_thread_init(NULL); gtk_init_check(&argc, &argv); -#endif // defined(OS_LINUX) +#endif // defined(TOOLKIT_USES_GTK) // Don't add additional code to this constructor. Instead add it to // Initialize(). See bug 6436. } diff --git a/chrome/browser/browser_theme_provider.h b/chrome/browser/browser_theme_provider.h index da2db5b..c8fce8d 100644 --- a/chrome/browser/browser_theme_provider.h +++ b/chrome/browser/browser_theme_provider.h @@ -128,7 +128,7 @@ class BrowserThemeProvider : public NonThreadSafe, virtual bool ShouldUseNativeFrame() const; virtual bool HasCustomImage(int id) const; virtual RefCountedMemory* GetRawData(int id) const; -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) // GdkPixbufs returned by GetPixbufNamed and GetRTLEnabledPixbufNamed are // shared instances owned by the theme provider and should not be freed. virtual GdkPixbuf* GetPixbufNamed(int id) const; @@ -240,12 +240,12 @@ class BrowserThemeProvider : public NonThreadSafe, // Remove preference values for themes that are no longer in use. void RemoveUnusedThemes(); -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) // Loads an image and flips it horizontally if |rtl_enabled| is true. GdkPixbuf* GetPixbufImpl(int id, bool rtl_enabled) const; #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) typedef std::map<int, GdkPixbuf*> GdkPixbufMap; mutable GdkPixbufMap gdk_pixbufs_; #elif defined(OS_MACOSX) diff --git a/chrome/browser/cookie_modal_dialog.h b/chrome/browser/cookie_modal_dialog.h index ccf0636..8b7d333 100644 --- a/chrome/browser/cookie_modal_dialog.h +++ b/chrome/browser/cookie_modal_dialog.h @@ -74,7 +74,7 @@ class CookiePromptModalDialog : public AppModalDialog { static void RegisterUserPrefs(PrefService* prefs); // AppModalDialog overrides. -#if defined(OS_LINUX) || defined(OS_MACOSX) +#if defined(OS_POSIX) virtual void CreateAndShowDialog(); #endif virtual int GetDialogButtons(); @@ -104,7 +104,7 @@ class CookiePromptModalDialog : public AppModalDialog { protected: // AppModalDialog overrides. virtual NativeDialog CreateNativeDialog(); -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) virtual void HandleDialogResponse(GtkDialog* dialog, gint response_id); CHROMEGTK_CALLBACK_1(CookiePromptModalDialog, void, @@ -141,7 +141,7 @@ class CookiePromptModalDialog : public AppModalDialog { // delegate could be deleted CookiePromptModalDialogDelegate* delegate_; -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) // The "remember this choice" radio button in the dialog. GtkWidget* remember_radio_; diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 2a4e002..445bb38 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -57,14 +57,14 @@ #include "views/drag_utils.h" #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #if defined(TOOLKIT_VIEWS) #include "app/drag_drop_types.h" #include "views/widget/widget_gtk.h" #elif defined(TOOLKIT_GTK) #include "chrome/browser/gtk/custom_drag.h" #endif // defined(TOOLKIT_GTK) -#endif // defined(OS_LINUX) +#endif // defined(TOOLKIT_USES_GTK) #if defined(OS_WIN) #include "app/os_exchange_data_provider_win.h" @@ -515,7 +515,7 @@ void DragDownload(const DownloadItem* download, DWORD effects; DoDragDrop(OSExchangeDataProviderWin::GetIDataObject(data), drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) GtkWidget* root = gtk_widget_get_toplevel(view); if (!root) return; @@ -526,13 +526,13 @@ void DragDownload(const DownloadItem* download, widget->DoDrag(data, DragDropTypes::DRAG_COPY | DragDropTypes::DRAG_LINK); #endif // OS_WIN } -#elif defined(OS_LINUX) +#elif defined(USE_X11) void DragDownload(const DownloadItem* download, SkBitmap* icon, gfx::NativeView view) { DownloadItemDrag::BeginDrag(download, icon); } -#endif // OS_LINUX +#endif // USE_X11 DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) { DictionaryValue* file_value = new DictionaryValue(); diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 95cb7d4..3658a36 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -311,11 +311,11 @@ bool BrowserRenderProcessHost::Init(bool is_extensions_process) { in_process_renderer_.reset(new RendererMainThread(channel_id)); base::Thread::Options options; -#if !defined(OS_LINUX) +#if !defined(TOOLKIT_USES_GTK) // In-process plugins require this to be a UI message loop. options.message_loop_type = MessageLoop::TYPE_UI; #else - // We can't have multiple UI loops on Linux, so we don't support + // We can't have multiple UI loops on GTK, so we don't support // in-process plugins. options.message_loop_type = MessageLoop::TYPE_DEFAULT; #endif @@ -735,9 +735,9 @@ TransportDIB* BrowserRenderProcessHost::MapTransportDIB( // On OSX, the browser allocates all DIBs and keeps a file descriptor around // for each. return widget_helper_->MapTransportDIB(dib_id); -#elif defined(OS_LINUX) +#elif defined(OS_POSIX) return TransportDIB::Map(dib_id); -#endif // defined(OS_LINUX) +#endif // defined(OS_POSIX) } TransportDIB* BrowserRenderProcessHost::GetTransportDIB( diff --git a/chrome/browser/renderer_host/mock_render_process_host.cc b/chrome/browser/renderer_host/mock_render_process_host.cc index 9c8eac3..3866239 100644 --- a/chrome/browser/renderer_host/mock_render_process_host.cc +++ b/chrome/browser/renderer_host/mock_render_process_host.cc @@ -102,7 +102,7 @@ TransportDIB* MockRenderProcessHost::GetTransportDIB(TransportDIB::Id dib_id) { // On Mac, TransportDIBs are always created in the browser, so we cannot map // one from a dib_id. transport_dib_ = TransportDIB::Create(100 * 100 * 4, 0); -#elif defined(OS_LINUX) +#elif defined(OS_POSIX) transport_dib_ = TransportDIB::Map(dib_id); #endif diff --git a/chrome/browser/renderer_host/render_view_host_delegate.cc b/chrome/browser/renderer_host/render_view_host_delegate.cc index f6eca0d..c7b2aaa 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.cc +++ b/chrome/browser/renderer_host/render_view_host_delegate.cc @@ -11,7 +11,7 @@ #include "googleurl/src/gurl.h" #include "webkit/glue/webpreferences.h" -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #include "chrome/browser/gtk/gtk_util.h" #endif diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 109e0f8..5cb889c 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -154,12 +154,7 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) { OnMsgImeCancelComposition) IPC_MESSAGE_HANDLER(ViewHostMsg_GpuRenderingActivated, OnMsgGpuRenderingActivated) -#if defined(OS_LINUX) - IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer, - OnMsgCreatePluginContainer) - IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer, - OnMsgDestroyPluginContainer) -#elif defined(OS_MACOSX) +#if defined(OS_MACOSX) IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) @@ -174,6 +169,11 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) { OnAcceleratedSurfaceSetTransportDIB) IPC_MESSAGE_HANDLER(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, OnAcceleratedSurfaceBuffersSwapped) +#elif defined(OS_POSIX) + IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer, + OnMsgCreatePluginContainer) + IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer, + OnMsgDestroyPluginContainer) #endif IPC_MESSAGE_UNHANDLED_ERROR() IPC_END_MESSAGE_MAP_EX() @@ -915,28 +915,7 @@ void RenderWidgetHost::OnMsgGpuRenderingActivated(bool activated) { is_gpu_rendering_active_ = activated; } -#if defined(OS_LINUX) - -void RenderWidgetHost::OnMsgCreatePluginContainer(gfx::PluginWindowHandle id) { - // TODO(piman): view_ can only be NULL with delayed view creation in - // extensions (see ExtensionHost::CreateRenderViewSoon). Figure out how to - // support plugins in that case. - if (view_) { - view_->CreatePluginContainer(id); - } else { - NOTIMPLEMENTED(); - } -} - -void RenderWidgetHost::OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id) { - if (view_) { - view_->DestroyPluginContainer(id); - } else { - NOTIMPLEMENTED(); - } -} - -#elif defined(OS_MACOSX) +#if defined(OS_MACOSX) void RenderWidgetHost::OnMsgShowPopup( const ViewHostMsg_ShowPopup_Params& params) { @@ -1017,6 +996,27 @@ void RenderWidgetHost::OnAcceleratedSurfaceBuffersSwapped( view_->AcceleratedSurfaceBuffersSwapped(window); } } +#elif defined(OS_POSIX) + +void RenderWidgetHost::OnMsgCreatePluginContainer(gfx::PluginWindowHandle id) { + // TODO(piman): view_ can only be NULL with delayed view creation in + // extensions (see ExtensionHost::CreateRenderViewSoon). Figure out how to + // support plugins in that case. + if (view_) { + view_->CreatePluginContainer(id); + } else { + NOTIMPLEMENTED(); + } +} + +void RenderWidgetHost::OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id) { + if (view_) { + view_->DestroyPluginContainer(id); + } else { + NOTIMPLEMENTED(); + } +} + #endif void RenderWidgetHost::PaintBackingStoreRect( diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index 12a986d..d729cba 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -491,10 +491,7 @@ class RenderWidgetHost : public IPC::Channel::Listener, void OnMsgGpuRenderingActivated(bool activated); -#if defined(OS_LINUX) - void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id); - void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id); -#elif defined(OS_MACOSX) +#if defined(OS_MACOSX) void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); void OnMsgGetScreenInfo(gfx::NativeViewId view, WebKit::WebScreenInfo* results); @@ -513,6 +510,9 @@ class RenderWidgetHost : public IPC::Channel::Listener, int32 height, TransportDIB::Handle transport_dib); void OnAcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window); +#elif defined(OS_POSIX) + void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id); + void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id); #endif // Paints the given bitmap to the current backing store at the given location. diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index c4e4f00..55d033f 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -216,7 +216,7 @@ class RenderWidgetHostView { virtual void DrawAcceleratedSurfaceInstances(CGLContextObj context) = 0; #endif -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0; virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) = 0; #endif diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h index 53e10dd..86887d6 100644 --- a/chrome/browser/renderer_host/test/test_render_view_host.h +++ b/chrome/browser/renderer_host/test/test_render_view_host.h @@ -111,7 +111,7 @@ class TestRenderWidgetHostView : public RenderWidgetHostView { #endif virtual void SetVisuallyDeemphasized(bool deemphasized) { } -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) virtual void CreatePluginContainer(gfx::PluginWindowHandle id) { } virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) { } #endif diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc index dd29afc..0d41cfe 100644 --- a/chrome/browser/renderer_preferences_util.cc +++ b/chrome/browser/renderer_preferences_util.cc @@ -6,7 +6,7 @@ #include "chrome/browser/profile.h" -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #include "chrome/browser/gtk/gtk_theme_provider.h" #include "chrome/browser/gtk/gtk_util.h" #endif @@ -14,7 +14,7 @@ namespace renderer_preferences_util { void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) { -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) gtk_util::UpdateGtkFontSettings(prefs); #if !defined(TOOLKIT_VIEWS) @@ -31,7 +31,7 @@ void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) { prefs->inactive_selection_fg_color = provider->get_inactive_selection_fg_color(); #endif // !defined(TOOLKIT_VIEWS) -#endif // defined(OS_LINUX) +#endif // defined(TOOLKIT_USES_GTK) } } // renderer_preferences_util diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc index ae0a959d1..99b584a 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc @@ -4,7 +4,7 @@ #include "chrome/browser/search_engines/template_url_prepopulate_data.h" -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) #include <locale.h> #endif diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc index b94550e..bd31f8e 100644 --- a/chrome/browser/sync/syncable/syncable.cc +++ b/chrome/browser/sync/syncable/syncable.cc @@ -83,7 +83,7 @@ int64 Now() { LARGE_INTEGER n; memcpy(&n, &filetime, sizeof(filetime)); return n.QuadPart; -#elif defined(OS_LINUX) || defined(OS_MACOSX) +#elif defined(OS_POSIX) struct timeval tv; gettimeofday(&tv, NULL); return static_cast<int64>(tv.tv_sec); diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 9e7a3f7..9df3bf6 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -483,7 +483,7 @@ void InterstitialPage::CancelForNavigation() { } void InterstitialPage::SetSize(const gfx::Size& size) { -#if defined(OS_WIN) || defined(OS_LINUX) +#if !defined(OS_MACOSX) // When a tab is closed, we might be resized after our view was NULLed // (typically if there was an info-bar). if (render_view_host_->view()) diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index eb782bc..772360b 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -927,9 +927,7 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { WebContextMenuData::CheckableMenuItemEnabled; case IDC_WRITING_DIRECTION_MENU: return true; -#endif // OS_MACOSX - -#if defined(OS_LINUX) +#elif defined(OS_POSIX) // TODO(suzhe): this should not be enabled for password fields. case IDC_INPUT_METHODS_MENU: return true; diff --git a/chrome/common/native_web_keyboard_event.h b/chrome/common/native_web_keyboard_event.h index 300a199..4f6548d 100644 --- a/chrome/common/native_web_keyboard_event.h +++ b/chrome/common/native_web_keyboard_event.h @@ -33,7 +33,7 @@ struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { NativeWebKeyboardEvent(wchar_t character, int state, double time_stamp_seconds); -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) explicit NativeWebKeyboardEvent(const GdkEventKey* event); NativeWebKeyboardEvent(wchar_t character, int state, @@ -49,7 +49,7 @@ struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { MSG os_event; #elif defined(OS_MACOSX) NSEvent* os_event; -#elif defined(OS_LINUX) +#elif defined(TOOLKIT_USES_GTK) GdkEventKey* os_event; #endif |