Commit 5284ee3d authored by groby@chromium.org's avatar groby@chromium.org

Revert 133472 - Use bundled Pepper Flash on Windows (Canary, still on a field trial).

Reverted because it failed to find "flapper.h" in pepper_flash_component_installer

Review URL: http://codereview.chromium.org/10123016

TBR=viettrungluu@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10193001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133482 0039d316-1c4b-4281-b951-d872f2087c98
parent 83088b2c
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
#include "base/version.h" #include "base/version.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/component_updater/component_updater_service.h" #include "chrome/browser/component_updater/component_updater_service.h"
#include "chrome/common/pepper_flash.h" #include "chrome/browser/component_updater/pepper_flash_field_trial.h"
#include "chrome/browser/plugin_prefs.h" #include "chrome/browser/plugin_prefs.h"
#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/installer/util/browser_distribution.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/plugin_service.h" #include "content/public/browser/plugin_service.h"
#include "content/public/common/pepper_plugin_info.h" #include "content/public/common/pepper_plugin_info.h"
...@@ -33,7 +34,9 @@ ...@@ -33,7 +34,9 @@
#include "webkit/plugins/plugin_constants.h" #include "webkit/plugins/plugin_constants.h"
#include "webkit/plugins/ppapi/plugin_module.h" #include "webkit/plugins/ppapi/plugin_module.h"
#include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. #if defined(OS_WIN)
#include "base/win/metro.h"
#endif
using content::BrowserThread; using content::BrowserThread;
using content::PluginService; using content::PluginService;
...@@ -76,6 +79,29 @@ const FilePath::CharType kPepperFlashBaseDirectory[] = ...@@ -76,6 +79,29 @@ const FilePath::CharType kPepperFlashBaseDirectory[] =
// If we don't have a Pepper Flash component, this is the version we claim. // If we don't have a Pepper Flash component, this is the version we claim.
const char kNullVersion[] = "0.0.0.0"; const char kNullVersion[] = "0.0.0.0";
// True if Pepper Flash should be enabled by default. Aura builds for any OS
// Windows 8 metro mode and part of Windows canary have it enabled by default.
bool IsPepperFlashEnabledByDefault() {
#if defined(USE_AURA)
return true;
#elif !defined(OS_WIN)
return false;
#else
if (base::win::GetMetroModule())
return true;
if (!PepperFlashFieldTrial::InEnableByDefaultGroup())
return 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: // The base directory on Windows looks like:
// <profile>\AppData\Local\Google\Chrome\User Data\PepperFlash\. // <profile>\AppData\Local\Google\Chrome\User Data\PepperFlash\.
FilePath GetPepperFlashBaseDirectory() { FilePath GetPepperFlashBaseDirectory() {
...@@ -360,7 +386,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) { ...@@ -360,7 +386,7 @@ void StartPepperFlashUpdateRegistration(ComponentUpdateService* cus) {
} // namespace } // namespace
void RegisterPepperFlashComponent(ComponentUpdateService* cus) { void RegisterPepperFlashComponent(ComponentUpdateService* cus) {
#if defined(GOOGLE_CHROME_BUILD) && !defined(FLAPPER_AVAILABLE) #if defined(GOOGLE_CHROME_BUILD)
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
base::Bind(&StartPepperFlashUpdateRegistration, cus)); base::Bind(&StartPepperFlashUpdateRegistration, cus));
#endif #endif
......
...@@ -2,19 +2,12 @@ ...@@ -2,19 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/common/pepper_flash.h" #include "chrome/browser/component_updater/pepper_flash_field_trial.h"
#include "base/basictypes.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/metrics/field_trial.h" #include "base/metrics/field_trial.h"
#include "base/string16.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/browser_distribution.h"
#if defined(OS_WIN)
#include "base/win/metro.h"
#endif
namespace { namespace {
...@@ -52,7 +45,10 @@ void ActivateFieldTrial() { ...@@ -52,7 +45,10 @@ void ActivateFieldTrial() {
trial->AppendGroup(kEnableGroupName, 500); trial->AppendGroup(kEnableGroupName, 500);
} }
bool IsInFieldTrialGroup() { } // namespace
// static
bool PepperFlashFieldTrial::InEnableByDefaultGroup() {
static bool activated = false; static bool activated = false;
if (!activated) { if (!activated) {
ActivateFieldTrial(); ActivateFieldTrial();
...@@ -63,32 +59,3 @@ bool IsInFieldTrialGroup() { ...@@ -63,32 +59,3 @@ bool IsInFieldTrialGroup() {
return group != base::FieldTrial::kNotFinalized && return group != base::FieldTrial::kNotFinalized &&
group != g_disabled_group_number; group != g_disabled_group_number;
} }
} // namespace
bool IsPepperFlashEnabledByDefault() {
#if defined(USE_AURA)
// Pepper Flash is required for Aura (on any OS).
return true;
#elif defined(OS_WIN)
// Pepper Flash is required for Windows 8 Metro mode.
if (base::win::GetMetroModule())
return true;
// For other Windows users, enable only for Canary users in a field trial.
if (!IsInFieldTrialGroup())
return false;
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
if (!dist)
return false;
string16 channel;
if (!dist->GetChromeChannel(&channel))
return false;
return (channel == L"canary");
#elif defined(OS_LINUX)
// For Linux, always try to use it (availability is checked elsewhere).
return true;
#else
return false;
#endif
}
...@@ -2,10 +2,17 @@ ...@@ -2,10 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_COMMON_PEPPER_FLASH_H_ #ifndef CHROME_BROWSER_COMPONENT_UPDATER_PEPPER_FLASH_FIELD_TRIAL_H_
#define CHROME_COMMON_PEPPER_FLASH_H_ #define CHROME_BROWSER_COMPONENT_UPDATER_PEPPER_FLASH_FIELD_TRIAL_H_
// True if Pepper Flash should be enabled by default. #include "base/basictypes.h"
bool IsPepperFlashEnabledByDefault();
#endif // CHROME_COMMON_PEPPER_FLASH_H_ class PepperFlashFieldTrial {
public:
static bool InEnableByDefaultGroup();
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PepperFlashFieldTrial);
};
#endif // CHROME_BROWSER_COMPONENT_UPDATER_PEPPER_FLASH_FIELD_TRIAL_H_
...@@ -865,6 +865,8 @@ ...@@ -865,6 +865,8 @@
'browser/component_updater/flash_component_installer.h', 'browser/component_updater/flash_component_installer.h',
'browser/component_updater/npapi_flash_component_installer.cc', 'browser/component_updater/npapi_flash_component_installer.cc',
'browser/component_updater/pepper_flash_component_installer.cc', 'browser/component_updater/pepper_flash_component_installer.cc',
'browser/component_updater/pepper_flash_field_trial.cc',
'browser/component_updater/pepper_flash_field_trial.h',
'browser/component_updater/pnacl/pnacl_component_installer.cc', 'browser/component_updater/pnacl/pnacl_component_installer.cc',
'browser/component_updater/pnacl/pnacl_component_installer.h', 'browser/component_updater/pnacl/pnacl_component_installer.h',
'browser/component_updater/recovery_component_installer.cc', 'browser/component_updater/recovery_component_installer.cc',
......
...@@ -218,8 +218,6 @@ ...@@ -218,8 +218,6 @@
'common/nacl_types.h', 'common/nacl_types.h',
'common/libxml_utils.cc', 'common/libxml_utils.cc',
'common/libxml_utils.h', 'common/libxml_utils.h',
'common/pepper_flash.cc',
'common/pepper_flash.h',
'common/persistent_pref_store.h', 'common/persistent_pref_store.h',
'common/pref_store.cc', 'common/pref_store.cc',
'common/pref_store.h', 'common/pref_store.h',
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h" #include "chrome/common/chrome_version_info.h"
#include "chrome/common/pepper_flash.h"
#include "chrome/common/render_messages.h" #include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "content/public/common/pepper_plugin_info.h" #include "content/public/common/pepper_plugin_info.h"
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
#include "webkit/plugins/npapi/plugin_list.h" #include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/plugin_constants.h" #include "webkit/plugins/plugin_constants.h"
#include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. #include "flapper_version.h" // In <(SHARED_INTERMEDIATE_DIR).
#if defined(OS_WIN) #if defined(OS_WIN)
#include "base/win/registry.h" #include "base/win/registry.h"
...@@ -216,15 +215,15 @@ void AddPepperFlash(std::vector<content::PepperPluginInfo>* plugins) { ...@@ -216,15 +215,15 @@ void AddPepperFlash(std::vector<content::PepperPluginInfo>* plugins) {
flash_version = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( flash_version = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kPpapiFlashVersion); switches::kPpapiFlashVersion);
} else { } else {
// Try to use a bundled Pepper Flash if: // Use the bundled Pepper Flash if it's enabled and available.
// 1) it's forcibly enabled via the command-line; // It's currently only enabled by default on Linux ia32 and x64.
#if defined(FLAPPER_AVAILABLE) && defined(OS_LINUX) && \
(defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64))
bool bundled_flapper_enabled = true;
#else
bool bundled_flapper_enabled = CommandLine::ForCurrentProcess()->HasSwitch( bool bundled_flapper_enabled = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBundledPpapiFlash); switches::kEnableBundledPpapiFlash);
// 2) it's known to be available at build time and enabled by default; and
#if defined(FLAPPER_AVAILABLE)
bundled_flapper_enabled |= IsPepperFlashEnabledByDefault();
#endif #endif
// 3) it's not forcibly disabled via the command-line.
bundled_flapper_enabled &= !CommandLine::ForCurrentProcess()->HasSwitch( bundled_flapper_enabled &= !CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableBundledPpapiFlash); switches::kDisableBundledPpapiFlash);
if (!bundled_flapper_enabled) if (!bundled_flapper_enabled)
......
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