summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 18:37:14 +0000
committerpvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-01 18:37:14 +0000
commitb2aa3ed777110d64e6647285fc3650bd5455681c (patch)
treed738ea5089cc1b6bd6b09e51fc9da672c912bc99 /chrome
parent70f2c448125ebe327d97596af088d8e81e82b901 (diff)
downloadchromium_src-b2aa3ed777110d64e6647285fc3650bd5455681c.zip
chromium_src-b2aa3ed777110d64e6647285fc3650bd5455681c.tar.gz
chromium_src-b2aa3ed777110d64e6647285fc3650bd5455681c.tar.bz2
BSD port: chrome/app and chrome/browser ifdef cleaning
Review URL: http://codereview.chromium.org/548203 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll_main.cc17
-rw-r--r--chrome/browser/app_modal_dialog.h6
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view.h4
-rw-r--r--chrome/browser/autocomplete/search_provider_unittest.cc6
-rw-r--r--chrome/browser/automation/automation_provider.cc10
-rw-r--r--chrome/browser/automation/ui_controls.h2
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc10
-rw-r--r--chrome/browser/sync/notifier/base/async_dns_lookup.cc1
8 files changed, 27 insertions, 29 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 1e3cb83..f30e39a 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -23,7 +23,7 @@
#include <unistd.h>
#endif
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
#include <gdk/gdk.h>
#include <glib.h>
#include <gtk/gtk.h>
@@ -57,8 +57,11 @@
#include "chrome/common/sandbox_init_wrapper.h"
#include "ipc/ipc_switches.h"
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
#include "base/nss_util.h"
+#endif
+
+#if defined(OS_LINUX)
#include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
#include "chrome/browser/zygote_host_linux.h"
#endif
@@ -191,7 +194,7 @@ bool HasDeprecatedArguments(const std::wstring& command_line) {
#endif // OS_WIN
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
static void GLibLogHandler(const gchar* log_domain,
GLogLevelFlags log_level,
const gchar* message,
@@ -278,7 +281,7 @@ static void AdjustLinuxOOMScore(const std::string& process_type) {
if (score > -1)
base::AdjustOOMScore(base::GetCurrentProcId(), score);
}
-#endif // defined(OS_LINUX)
+#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
// Register the invalid param handler and pure call handler to be able to
// notify breakpad when it happens.
@@ -349,7 +352,7 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
// Windows needs resources for the default/null plugin.
process_type == switches::kPluginProcess ||
#endif
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
// The zygote process opens the resources for the renderers.
process_type == switches::kZygoteProcess ||
#endif
@@ -448,7 +451,7 @@ int ChromeMain(int argc, char** argv) {
return 1;
#endif
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
// Show the man page on --help or -h.
if (parsed_command_line.HasSwitch("help") ||
parsed_command_line.HasSwitch("h")) {
@@ -690,7 +693,7 @@ int ChromeMain(int argc, char** argv) {
rv = NaClMain(main_params);
#endif
} else if (process_type == switches::kZygoteProcess) {
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
if (ZygoteMain(main_params)) {
// Zygote::HandleForkRequest may have reallocated the command
// line so update it here with the new version.
diff --git a/chrome/browser/app_modal_dialog.h b/chrome/browser/app_modal_dialog.h
index 31b637b..bbb352a 100644
--- a/chrome/browser/app_modal_dialog.h
+++ b/chrome/browser/app_modal_dialog.h
@@ -14,9 +14,6 @@
#if defined(OS_WIN)
class JavascriptMessageBoxDialog;
typedef JavascriptMessageBoxDialog* NativeDialog;
-#elif defined(OS_LINUX)
-typedef struct _GtkWidget GtkWidget;
-typedef GtkWidget* NativeDialog;
#elif defined(OS_MACOSX)
#if __OBJC__
@class NSAlert;
@@ -24,6 +21,9 @@ typedef GtkWidget* NativeDialog;
class NSAlert;
#endif
typedef NSAlert* NativeDialog;
+#elif defined(OS_POSIX)
+typedef struct _GtkWidget GtkWidget;
+typedef GtkWidget* NativeDialog;
#endif
class ExtensionHost;
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view.h b/chrome/browser/autocomplete/autocomplete_popup_view.h
index f030a9b..0742442 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view.h
@@ -19,11 +19,9 @@ class BubblePositioner;
namespace gfx {
class Font;
}
-#if defined(OS_WIN) || defined(OS_LINUX)
class AutocompleteEditViewWin;
class AutocompleteEditModel;
class Profile;
-#endif
class AutocompletePopupView {
public:
@@ -45,7 +43,7 @@ class AutocompletePopupView {
// Returns the popup's model.
virtual AutocompletePopupModel* GetModel() = 0;
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if !defined(OS_MACOSX)
// Create a popup view implementation. It may make sense for this to become
// platform independent eventually.
static AutocompletePopupView* CreatePopupView(
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index 9b53178..4d9ba3b 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -147,10 +147,10 @@ void SearchProviderTest::RunTillProviderDone() {
return;
quit_when_done_ = true;
-#if defined(OS_WIN) || defined(OS_LINUX)
- message_loop_.Run(NULL);
-#else
+#if defined(OS_MACOSX)
message_loop_.Run();
+#else
+ message_loop_.Run(NULL);
#endif
}
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index aa35bab..a0c3d3c 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -313,11 +313,9 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(AutomationMsg_WindowClick, WindowSimulateClick)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowMouseMove, WindowSimulateMouseMove)
IPC_MESSAGE_HANDLER(AutomationMsg_WindowKeyPress, WindowSimulateKeyPress)
-#endif // !defined(OS_MACOSX)
-#if defined(OS_WIN) || defined(OS_LINUX)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowDrag,
WindowSimulateDrag)
-#endif // defined(OS_WIN) || defined(OS_LINUX)
+#endif
IPC_MESSAGE_HANDLER(AutomationMsg_TabCount, GetTabCount)
IPC_MESSAGE_HANDLER(AutomationMsg_Type, GetType)
IPC_MESSAGE_HANDLER(AutomationMsg_Tab, GetTab)
@@ -783,7 +781,7 @@ void AutomationProvider::GetLastActiveBrowserWindow(int* handle) {
*handle = browser_tracker_->Add(browser);
}
-#if defined(OS_LINUX) || defined(OS_MACOSX)
+#if defined(OS_POSIX)
// TODO(estade): use this implementation for all platforms?
void AutomationProvider::GetActiveWindow(int* handle) {
gfx::NativeWindow window =
@@ -861,7 +859,7 @@ class InvokeTaskLaterTask : public Task {
DISALLOW_COPY_AND_ASSIGN(InvokeTaskLaterTask);
};
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if !defined(OS_MACOSX)
void AutomationProvider::WindowSimulateClick(const IPC::Message& message,
int handle,
const gfx::Point& click,
@@ -896,7 +894,7 @@ void AutomationProvider::WindowSimulateKeyPress(const IPC::Message& message,
((flags & views::Event::EF_ALT_DOWN) ==
views::Event::EF_ALT_DOWN));
}
-#endif // defined(OS_WIN) || defined(OS_LINUX)
+#endif // !defined(OS_MACOSX)
void AutomationProvider::IsWindowActive(int handle, bool* success,
bool* is_active) {
diff --git a/chrome/browser/automation/ui_controls.h b/chrome/browser/automation/ui_controls.h
index 92705dc..e78a13f 100644
--- a/chrome/browser/automation/ui_controls.h
+++ b/chrome/browser/automation/ui_controls.h
@@ -84,7 +84,7 @@ bool SendMouseClick(MouseButton type);
void MoveMouseToCenterAndPress(
#if defined(TOOLKIT_VIEWS)
views::View* view,
-#elif defined(OS_LINUX)
+#elif defined(TOOLKIT_GTK)
GtkWidget* widget,
#endif
MouseButton button,
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index 2d21acc..e35c55c 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -354,7 +354,8 @@ void OpenAll(gfx::NativeWindow parent,
void CopyToClipboard(BookmarkModel* model,
const std::vector<const BookmarkNode*>& nodes,
bool remove_nodes) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+// Not implemented on mac yet.
+#if !defined(OS_MACOSX)
if (nodes.empty())
return;
@@ -366,15 +367,14 @@ void CopyToClipboard(BookmarkModel* model,
nodes[i]->GetParent()->IndexOfChild(nodes[i]));
}
}
-#else
- // Not implemented on mac yet.
#endif
}
void PasteFromClipboard(BookmarkModel* model,
const BookmarkNode* parent,
int index) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+// Not implemented on mac yet.
+#if !defined(OS_MACOSX)
if (!parent)
return;
@@ -385,8 +385,6 @@ void PasteFromClipboard(BookmarkModel* model,
if (index == -1)
index = parent->GetChildCount();
bookmark_utils::CloneDragData(model, bookmark_data.elements, parent, index);
-#else
- // Not implemented on mac yet.
#endif
}
diff --git a/chrome/browser/sync/notifier/base/async_dns_lookup.cc b/chrome/browser/sync/notifier/base/async_dns_lookup.cc
index 869eb23..a8fee43 100644
--- a/chrome/browser/sync/notifier/base/async_dns_lookup.cc
+++ b/chrome/browser/sync/notifier/base/async_dns_lookup.cc
@@ -9,6 +9,7 @@
#if defined(OS_POSIX)
#include <arpa/inet.h>
#include <netdb.h>
+#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <sys/socket.h>