diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 22:37:55 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 22:37:55 +0000 |
commit | 417ace90672beb80072472f75654dbd95d5f4cac (patch) | |
tree | e83add106a16009d549c21f8ec81d5af51501981 /chrome/browser | |
parent | 0d454eaf4847dc49968f577e6fa2f2e92e3cef20 (diff) | |
download | chromium_src-417ace90672beb80072472f75654dbd95d5f4cac.zip chromium_src-417ace90672beb80072472f75654dbd95d5f4cac.tar.gz chromium_src-417ace90672beb80072472f75654dbd95d5f4cac.tar.bz2 |
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
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/component_updater/pepper_flash_component_installer.cc | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/chrome/browser/component_updater/pepper_flash_component_installer.cc b/chrome/browser/component_updater/pepper_flash_component_installer.cc index 22e5cf1..0d053d6 100644 --- a/chrome/browser/component_updater/pepper_flash_component_installer.cc +++ b/chrome/browser/component_updater/pepper_flash_component_installer.cc @@ -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 } |