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

Side by Side Diff: ios/chrome/browser/experimental_flags.mm

Issue 2088993005: Add Physical Web experiment and command line flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // This file can be empty. Its purpose is to contain the relatively short lived 5 // This file can be empty. Its purpose is to contain the relatively short lived
6 // definitions required for experimental flags. 6 // definitions required for experimental flags.
7 7
8 #include "ios/chrome/browser/experimental_flags.h" 8 #include "ios/chrome/browser/experimental_flags.h"
9 9
10 #include <dispatch/dispatch.h> 10 #include <dispatch/dispatch.h>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 std::string group_name = 114 std::string group_name =
115 base::FieldTrialList::FindFullName("RemoveAllBookmarks"); 115 base::FieldTrialList::FindFullName("RemoveAllBookmarks");
116 116
117 if (group_name.empty()) { 117 if (group_name.empty()) {
118 return true; // If no finch experiment, keep all bookmarks enabled. 118 return true; // If no finch experiment, keep all bookmarks enabled.
119 } 119 }
120 return base::StartsWith(group_name, "Enabled", 120 return base::StartsWith(group_name, "Enabled",
121 base::CompareCase::INSENSITIVE_ASCII); 121 base::CompareCase::INSENSITIVE_ASCII);
122 } 122 }
123 123
124 bool IsPhysicalWebEnabled() {
125 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
Olivier 2016/06/24 07:52:33 I think you should check for the NSUserDefault to
mattreynolds 2016/06/24 17:47:20 I think this is unnecessary because in about_flags
126 if (command_line->HasSwitch(switches::kEnableIOSPhysicalWeb)) {
127 return true;
128 } else if (command_line->HasSwitch(switches::kDisableIOSPhysicalWeb)) {
129 return false;
130 }
131
132 // Check if the finch experiment is turned on
133 std::string group_name =
134 base::FieldTrialList::FindFullName("PhysicalWebEnabled");
135 return base::StartsWith(group_name, "Enabled",
136 base::CompareCase::INSENSITIVE_ASCII);
137 }
138
124 } // namespace experimental_flags 139 } // namespace experimental_flags
OLDNEW
« no previous file with comments | « ios/chrome/browser/experimental_flags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698