| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/pepper_flash.h" | 5 #include "chrome/common/pepper_flash.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 activated = true; | 59 activated = true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 int group = base::FieldTrialList::FindValue(kFieldTrialName); | 62 int group = base::FieldTrialList::FindValue(kFieldTrialName); |
| 63 return group != base::FieldTrial::kNotFinalized && | 63 return group != base::FieldTrial::kNotFinalized && |
| 64 group != g_disabled_group_number; | 64 group != g_disabled_group_number; |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 bool ConductingPepperFlashFieldTrial() { |
| 70 #if defined(OS_WIN) |
| 71 return true; |
| 72 #else |
| 73 return false; |
| 74 #endif |
| 75 } |
| 76 |
| 69 bool IsPepperFlashEnabledByDefault() { | 77 bool IsPepperFlashEnabledByDefault() { |
| 70 #if defined(USE_AURA) | 78 #if defined(USE_AURA) |
| 71 // Pepper Flash is required for Aura (on any OS). | 79 // Pepper Flash is required for Aura (on any OS). |
| 72 return true; | 80 return true; |
| 73 #elif defined(OS_WIN) | 81 #elif defined(OS_WIN) |
| 74 // Pepper Flash is required for Windows 8 Metro mode. | 82 // Pepper Flash is required for Windows 8 Metro mode. |
| 75 if (base::win::GetMetroModule()) | 83 if (base::win::GetMetroModule()) |
| 76 return true; | 84 return true; |
| 77 | 85 |
| 78 // For other Windows users, enable only for Canary users in a field trial. | 86 // For other Windows users, enable only for Canary users in a field trial. |
| 79 if (!IsInFieldTrialGroup()) | 87 if (!IsInFieldTrialGroup()) |
| 80 return false; | 88 return false; |
| 81 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 89 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 82 if (!dist) | 90 if (!dist) |
| 83 return false; | 91 return false; |
| 84 string16 channel; | 92 string16 channel; |
| 85 if (!dist->GetChromeChannel(&channel)) | 93 if (!dist->GetChromeChannel(&channel)) |
| 86 return false; | 94 return false; |
| 87 return (channel == L"canary"); | 95 return (channel == L"canary"); |
| 88 #elif defined(OS_LINUX) | 96 #elif defined(OS_LINUX) |
| 89 // For Linux, always try to use it (availability is checked elsewhere). | 97 // For Linux, always try to use it (availability is checked elsewhere). |
| 90 return true; | 98 return true; |
| 91 #else | 99 #else |
| 92 return false; | 100 return false; |
| 93 #endif | 101 #endif |
| 94 } | 102 } |
| OLD | NEW |