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

Unified Diff: components/plugins/common/plugins_field_trial.cc

Issue 1033103002: Plugin Power Saver: Overhaul plugin-power-saver flags. Show in UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gypi i hope Created 5 years, 9 months 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
Index: components/plugins/common/plugins_field_trial.cc
diff --git a/components/plugins/common/plugins_field_trial.cc b/components/plugins/common/plugins_field_trial.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f2c8e763b280e19a8e7214f961126a54d09e26ab
--- /dev/null
+++ b/components/plugins/common/plugins_field_trial.cc
@@ -0,0 +1,20 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/plugins/common/plugins_field_trial.h"
+
+#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
+#include "components/plugins/common/plugins_switches.h"
+
+bool PluginsFieldTrial::EnableForcePluginPowerSaver() {
+ const base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
+ if (cl->HasSwitch(switches::kDisableForcePluginPowerSaver))
+ return false;
+ if (cl->HasSwitch(switches::kEnableForcePluginPowerSaver))
+ return true;
+
+ return base::FieldTrialList::FindFullName("ForcePluginPowerSaver") ==
+ "Enabled";
+}

Powered by Google App Engine
This is Rietveld 408576698