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

Unified Diff: ui/native_theme/native_theme.cc

Issue 12549009: Added finch experiment to track new menu style effect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme.cc
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index 21071189ed6be06fb8dbdf2417ed90609b44ad88..b9a27728dd26f2c15b981e892946570c84b03296 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -5,8 +5,13 @@
#include "ui/native_theme/native_theme.h"
#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "ui/base/ui_base_switches.h"
+// Constants for the new menu style field trial.
+const char kNewMenuStyleFieldTrialName[] = "NewMenuStyle";
+const char kNewMenuStyleFieldTrialGroupName[] = "OldStyle";
+
namespace ui {
void NativeTheme::SetScrollbarColors(unsigned inactive_color,
@@ -25,6 +30,12 @@ bool NativeTheme::IsNewMenuStyleEnabled() {
static bool enable_new_menu_style =
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableNewMenuStyle);
+ // Run experiment only if there is no kDisableNewMenuStyle flag.
+ if (enable_new_menu_style) {
+ enable_new_menu_style =
+ base::FieldTrialList::FindFullName(kNewMenuStyleFieldTrialName) !=
+ kNewMenuStyleFieldTrialGroupName;
+ }
return enable_new_menu_style;
}
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698