diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 16:34:17 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 16:34:17 +0000 |
commit | 3b48dbc794dd45719eb6047968eb1946d39fe59e (patch) | |
tree | 61cdc08668739748a0a2de3aa5e582b2b7c4a92c /content/browser | |
parent | 67edf3b5a450c34ded10e67783500376248ba85e (diff) | |
download | chromium_src-3b48dbc794dd45719eb6047968eb1946d39fe59e.zip chromium_src-3b48dbc794dd45719eb6047968eb1946d39fe59e.tar.gz chromium_src-3b48dbc794dd45719eb6047968eb1946d39fe59e.tar.bz2 |
Automatically load newly installed plug-ins if they are missing on a page.
To enable this on Mac OS, we also enable plug-in directory watching there. There shouldn't be any false positives causing unnecessary disk hits anymore.
BUG=62079
TEST=go to http://www.corp.google.com/~bauerb/no_crawl/test/install_plugin.html, install the missing plug-in. It should automatically load.
Review URL: http://codereview.chromium.org/9015025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/plugin_service_impl.cc | 13 | ||||
-rw-r--r-- | content/browser/plugin_service_impl.h | 8 |
2 files changed, 10 insertions, 11 deletions
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index fd1f0bd..8cd4cbc 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -38,7 +38,7 @@ #include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/webplugininfo.h" -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +#if defined(OS_POSIX) && !defined(OS_OPENBSD) using ::base::files::FilePathWatcher; #endif @@ -89,7 +89,8 @@ static void NotifyPluginsOfActivation() { plugin->OnAppActivation(); } } -#elif defined(OS_POSIX) && !defined(OS_OPENBSD) +#endif +#if defined(OS_POSIX) && !defined(OS_OPENBSD) // Delegate class for monitoring directories. class PluginDirWatcherDelegate : public FilePathWatcher::Delegate { virtual void OnFilePathChanged(const FilePath& path) OVERRIDE { @@ -203,9 +204,7 @@ void PluginServiceImpl::StartWatchingPlugins() { hklm_watcher_.StartWatching(hklm_event_.get(), this); } } -#elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) -// The FilePathWatcher produces too many false positives on MacOS (access time -// updates?) which will lead to enforcing updates of the plugins way too often. +#elif defined(OS_POSIX) && !defined(OS_OPENBSD) // 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. file_watcher_delegate_ = new PluginDirWatcherDelegate(); @@ -629,7 +628,7 @@ content::PepperPluginInfo* PluginServiceImpl::GetRegisteredPpapiPluginInfo( return &ppapi_plugins_[ppapi_plugins_.size() - 1]; } -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +#if defined(OS_POSIX) && !defined(OS_OPENBSD) // static void PluginServiceImpl::RegisterFilePathWatcher( FilePathWatcher *watcher, diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index b106edd..4a2c203 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,7 +31,7 @@ #include "base/win/registry.h" #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +#if defined(OS_POSIX) && !defined(OS_OPENBSD) #include "base/files/file_path_watcher.h" #endif @@ -189,7 +189,7 @@ class CONTENT_EXPORT PluginServiceImpl const FilePath& plugin_path, PluginProcessHost::Client* client); -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +#if defined(OS_POSIX) && !defined(OS_OPENBSD) // Registers a new FilePathWatcher for a given path. static void RegisterFilePathWatcher( base::files::FilePathWatcher* watcher, @@ -215,7 +215,7 @@ class CONTENT_EXPORT PluginServiceImpl base::WaitableEventWatcher hklm_watcher_; #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +#if defined(OS_POSIX) && !defined(OS_OPENBSD) ScopedVector<base::files::FilePathWatcher> file_watchers_; scoped_refptr<PluginDirWatcherDelegate> file_watcher_delegate_; #endif |