Commit 417ace90 authored by cpu@chromium.org's avatar cpu@chromium.org

Enable pepper flash by default in windows canary

- Enabled by default for new versions of the plugin
- Now it does not auto-disable if enabled

BUG=89248
TEST=see bug
Review URL: http://codereview.chromium.org/8806034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113266 0039d316-1c4b-4281-b951-d872f2087c98
parent 0d454eaf
......@@ -21,6 +21,7 @@
#include "chrome/browser/component_updater/component_updater_service.h"
#include "chrome/browser/plugin_prefs.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/installer/util/browser_distribution.h"
#include "content/browser/plugin_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/pepper_plugin_info.h"
......@@ -78,12 +79,23 @@ const FilePath::CharType kPepperFlashBaseDirectory[] =
// If we don't have a Pepper Flash component, this is the version we claim.
const char kNullVersion[] = "0.0.0.0";
// True if Pepper Flash should be enabled by default.
// True if Pepper Flash should be enabled by default. Aura builds for any OS
// and Windows canary have it enabled by default.
bool IsPepperFlashEnabledByDefault() {
#if defined(USE_AURA)
const bool kEnablePepperFlash = true;
return true;
#elif !defined(OS_WIN)
return false;
#else
const bool kEnablePepperFlash = false;
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
if (!dist)
return false;
string16 channel;
if (!dist->GetChromeChannel(&channel))
return false;
return (channel == L"canary");
#endif
}
// The base directory on Windows looks like:
// <profile>\AppData\Local\Google\Chrome\User Data\PepperFlash\.
......@@ -160,14 +172,19 @@ bool MakePepperFlashPluginInfo(const FilePath& flash_path,
return true;
}
// If it is a |fresh_install| we enable or disable it by default in some
// configurations. See IsPepperFlashEnabledByDefault() for more information.
void RegisterPepperFlashWithChrome(const FilePath& path,
const Version& version) {
const Version& version,
bool fresh_install) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
content::PepperPluginInfo plugin_info;
// Register it as out-of-process and disabled.
if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info))
return;
PluginPrefs::EnablePluginGlobally(kEnablePepperFlash, plugin_info.path);
if (fresh_install) {
PluginPrefs::EnablePluginGlobally(IsPepperFlashEnabledByDefault(),
plugin_info.path);
}
PluginService::GetInstance()->RegisterInternalPlugin(
plugin_info.ToWebPluginInfo());
PluginService::GetInstance()->RefreshPlugins();
......@@ -222,7 +239,7 @@ bool PepperFlashComponentInstaller::Install(base::DictionaryValue* manifest,
PathService::Override(chrome::FILE_PEPPER_FLASH_PLUGIN, path);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&RegisterPepperFlashWithChrome, path, version));
base::Bind(&RegisterPepperFlashWithChrome, path, version, true));
return true;
}
......@@ -311,7 +328,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) {
if (file_util::PathExists(path)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&RegisterPepperFlashWithChrome, path, version));
base::Bind(&RegisterPepperFlashWithChrome, path, version, false));
} else {
version = Version(kNullVersion);
}
......@@ -325,8 +342,8 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) {
} // namespace
void RegisterPepperFlashComponent(ComponentUpdateService* cus) {
// #if defined(GOOGLE_CHROME_BUILD)
#if defined(GOOGLE_CHROME_BUILD)
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
base::Bind(&StartPepperFlashUpdateRegistration, cus));
// #endif
#endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment