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

Unified Diff: ios/chrome/browser/experimental_flags.mm

Issue 1491253003: Enable enhanced bookmarks by default on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing include. Created 5 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/experimental_flags.mm
diff --git a/ios/chrome/browser/experimental_flags.mm b/ios/chrome/browser/experimental_flags.mm
index 29ea735a03c148750cb61e980f02e0e8115a24c3..cce88aa80119a56810989514f589b0fd65208797 100644
--- a/ios/chrome/browser/experimental_flags.mm
+++ b/ios/chrome/browser/experimental_flags.mm
@@ -16,7 +16,7 @@
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
#include "components/autofill/core/common/autofill_switches.h"
-#include "components/enhanced_bookmarks/enhanced_bookmark_features.h"
+#include "components/enhanced_bookmarks/enhanced_bookmark_switches.h"
#include "components/variations/variations_associated_data.h"
#include "ios/chrome/browser/chrome_switches.h"
#include "ios/web/public/web_view_creation_util.h"
@@ -48,7 +48,24 @@ bool IsAlertOnBackgroundUploadEnabled() {
}
bool IsBookmarkCollectionEnabled() {
- return enhanced_bookmarks::IsEnhancedBookmarksEnabled();
+ // kEnhancedBookmarksExperiment flag could have values "", "1" and "0".
+ // "" - default, "0" - user opted out, "1" - user opted in. Tests also use
+ // the command line flag to force enhanced bookmark to be on.
+ // If none is specified, the finch experiment is checked. If not disabled in
+ // finch, the default is opt-in.
+ std::string switch_value =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kEnhancedBookmarksExperiment);
+ if (switch_value == "1")
+ return true;
+ if (switch_value == "0")
+ return false;
+
+ // Check if the finch experiment is turned on.
+ std::string group_name =
+ base::FieldTrialList::FindFullName("IOSNewBookmarksUI");
+ return !base::StartsWith(group_name, "Disabled",
+ base::CompareCase::INSENSITIVE_ASCII);
}
void SetWKWebViewTrialEligibility(bool eligible) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698