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

Unified Diff: chrome/browser/component_updater/pepper_flash_component_installer.cc

Issue 8806034: Enable pepper flash by default in windows canary (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/pepper_flash_component_installer.cc
===================================================================
--- chrome/browser/component_updater/pepper_flash_component_installer.cc (revision 112808)
+++ chrome/browser/component_updater/pepper_flash_component_installer.cc (working copy)
@@ -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 @@
// 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;
+ std::wstring channel;
brettw 2011/12/06 01:34:48 Can you use string16 for new code?
+ 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,18 @@
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)
brettw 2011/12/06 01:34:48 Need {}
+ PluginPrefs::EnablePluginGlobally(IsPepperFlashEnabledByDefault(),
+ plugin_info.path);
PluginService::GetInstance()->RegisterInternalPlugin(
plugin_info.ToWebPluginInfo());
PluginService::GetInstance()->RefreshPlugins();
@@ -222,7 +238,7 @@
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 +327,7 @@
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 +341,8 @@
} // 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
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698