Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Unified Diff: content/browser/plugin_service.cc

Issue 7006006: Replace OS_LINUX ifdefs with OS_POSIX & !OS_MACOSX, TOOLKIT_USES_GTK, or (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_service.h ('k') | content/browser/renderer_host/render_sandbox_host_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_service.cc
diff --git a/content/browser/plugin_service.cc b/content/browser/plugin_service.cc
index f4c293f4da968dda62498c15df1ecd280cb1e51f..1cfea31ebe64c4f9e404d0645ea05ebfe1d59518 100644
--- a/content/browser/plugin_service.cc
+++ b/content/browser/plugin_service.cc
@@ -31,7 +31,7 @@
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/npapi/webplugininfo.h"
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
using ::base::files::FilePathWatcher;
#endif
@@ -45,9 +45,7 @@ static void NotifyPluginsOfActivation() {
plugin->OnAppActivation();
}
}
-#endif
-
-#if defined(OS_LINUX)
+#elif defined(OS_POSIX)
// Delegate class for monitoring directories.
class PluginDirWatcherDelegate : public FilePathWatcher::Delegate {
virtual void OnFilePathChanged(const FilePath& path) OVERRIDE {
@@ -102,7 +100,12 @@ PluginService::PluginService()
hklm_watcher_.StartWatching(hklm_event_.get(), this);
}
}
-#elif defined(OS_POSIX) && !defined(OS_MACOSX)
+#elif defined(OS_MACOSX)
+ // We need to know when the browser comes forward so we can bring modal plugin
+ // windows forward too.
+ registrar_.Add(this, NotificationType::APP_ACTIVATED,
+ NotificationService::AllSources());
+#elif defined(OS_POSIX)
// Also find plugins in a user-specific plugins dir,
// e.g. ~/.config/chromium/Plugins.
FilePath user_data_dir;
@@ -110,12 +113,11 @@ PluginService::PluginService()
webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(
user_data_dir.Append("Plugins"));
}
-#endif
+
// The FilePathWatcher produces too many false positives on MacOS (access time
// updates?) which will lead to enforcing updates of the plugins way too often.
// On ChromeOS the user can't install plugins anyway and on Windows all
// important plugins register themselves in the registry so no need to do that.
-#if defined(OS_LINUX)
file_watcher_delegate_ = new PluginDirWatcherDelegate();
// Get the list of all paths for registering the FilePathWatchers
// that will track and if needed reload the list of plugins on runtime.
@@ -141,12 +143,6 @@ PluginService::PluginService()
file_watchers_.push_back(watcher);
}
#endif
-#if defined(OS_MACOSX)
- // We need to know when the browser comes forward so we can bring modal plugin
- // windows forward too.
- registrar_.Add(this, NotificationType::APP_ACTIVATED,
- NotificationService::AllSources());
-#endif
registrar_.Add(this, NotificationType::PLUGIN_ENABLE_STATUS_CHANGED,
NotificationService::AllSources());
registrar_.Add(this,
@@ -497,7 +493,7 @@ PepperPluginInfo* PluginService::GetRegisteredPpapiPluginInfo(
return info;
}
-#if defined(OS_LINUX)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
// static
void PluginService::RegisterFilePathWatcher(
FilePathWatcher *watcher,
« no previous file with comments | « content/browser/plugin_service.h ('k') | content/browser/renderer_host/render_sandbox_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698