Commit 76b9ba0e authored by sczs's avatar sczs Committed by Commit Bot

[ios] Creates flag for Collections Automatic style presentation.

Bug: 979201
Change-Id: Iec61d3d7115b1aaeece301a501035a1f6df2b71b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713812Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680212}
parent 45266c3b
...@@ -51,6 +51,7 @@ source_set("flags") { ...@@ -51,6 +51,7 @@ source_set("flags") {
"//ios/chrome/browser/ui/fullscreen:feature_flags", "//ios/chrome/browser/ui/fullscreen:feature_flags",
"//ios/chrome/browser/ui/infobars:feature_flags", "//ios/chrome/browser/ui/infobars:feature_flags",
"//ios/chrome/browser/ui/settings/autofill:feature_flags", "//ios/chrome/browser/ui/settings/autofill:feature_flags",
"//ios/chrome/browser/ui/table_view:feature_flags",
"//ios/chrome/browser/ui/toolbar/public:feature_flags", "//ios/chrome/browser/ui/toolbar/public:feature_flags",
"//ios/chrome/browser/ui/toolbar_container:feature_flags", "//ios/chrome/browser/ui/toolbar_container:feature_flags",
"//ios/chrome/browser/web:feature_flags", "//ios/chrome/browser/web:feature_flags",
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
#import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_feature.h"
#include "ios/chrome/browser/ui/settings/autofill/features.h" #include "ios/chrome/browser/ui/settings/autofill/features.h"
#import "ios/chrome/browser/ui/table_view/feature_flags.h"
#import "ios/chrome/browser/ui/toolbar/public/features.h" #import "ios/chrome/browser/ui/toolbar/public/features.h"
#import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h" #import "ios/chrome/browser/ui/toolbar_container/toolbar_container_features.h"
#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_feature_flags.h"
...@@ -578,6 +579,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -578,6 +579,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSettingsAddPaymentMethodName, flag_descriptions::kSettingsAddPaymentMethodName,
flag_descriptions::kSettingsAddPaymentMethodDescription, flags_ui::kOsIos, flag_descriptions::kSettingsAddPaymentMethodDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kSettingsAddPaymentMethod)}, FEATURE_VALUE_TYPE(kSettingsAddPaymentMethod)},
{"collections-card-presentation-style",
flag_descriptions::kCollectionsCardPresentationStyleName,
flag_descriptions::kCollectionsCardPresentationStyleDescription,
flags_ui::kOsIos, FEATURE_VALUE_TYPE(kCollectionsCardPresentationStyle)},
}; };
// Add all switches from experimental flags to |command_line|. // Add all switches from experimental flags to |command_line|.
......
...@@ -126,6 +126,12 @@ const char kClosingLastIncognitoTabDescription[] = ...@@ -126,6 +126,12 @@ const char kClosingLastIncognitoTabDescription[] =
"Automatically switches to the regular tabs panel in the tab grid after " "Automatically switches to the regular tabs panel in the tab grid after "
"closing the last incognito tab"; "closing the last incognito tab";
const char kCollectionsCardPresentationStyleName[] =
"Card style presentation for Collections.";
const char kCollectionsCardPresentationStyleDescription[] =
"When enabled collections are presented using the new iOS13 card "
"style.";
const char kContextualSearch[] = "Contextual Search"; const char kContextualSearch[] = "Contextual Search";
const char kContextualSearchDescription[] = const char kContextualSearchDescription[] =
"Whether or not Contextual Search is enabled."; "Whether or not Contextual Search is enabled.";
......
...@@ -97,6 +97,11 @@ extern const char kBrowserTaskSchedulerDescription[]; ...@@ -97,6 +97,11 @@ extern const char kBrowserTaskSchedulerDescription[];
extern const char kClosingLastIncognitoTabName[]; extern const char kClosingLastIncognitoTabName[];
extern const char kClosingLastIncognitoTabDescription[]; extern const char kClosingLastIncognitoTabDescription[];
// Title and description for the flag that controls whether Collections are
// presented using the new iOS13 Card style or the custom legacy one.
extern const char kCollectionsCardPresentationStyleName[];
extern const char kCollectionsCardPresentationStyleDescription[];
// Title and description for the flag to enable Contextual Search. // Title and description for the flag to enable Contextual Search.
extern const char kContextualSearch[]; extern const char kContextualSearch[];
extern const char kContextualSearchDescription[]; extern const char kContextualSearchDescription[];
......
...@@ -79,6 +79,17 @@ source_set("views") { ...@@ -79,6 +79,17 @@ source_set("views") {
] ]
} }
source_set("feature_flags") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"feature_flags.h",
"feature_flags.mm",
]
deps = [
"//base",
]
}
source_set("test_support") { source_set("test_support") {
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
testonly = true testonly = true
......
// Copyright 2019 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.
#ifndef IOS_CHROME_BROWSER_UI_TABLE_VIEW_FEATURE_FLAGS_H_
#define IOS_CHROME_BROWSER_UI_TABLE_VIEW_FEATURE_FLAGS_H_
#include "base/feature_list.h"
// Feature to choose whether to use the new Card iOS13 presentation, or the
// legacy one.
extern const base::Feature kCollectionsCardPresentationStyle;
// Whether the kCollectionsCardPresentationStyle flag is enabled.
bool IsCollectionsCardPresentationStyleEnabled();
#endif // IOS_CHROME_BROWSER_UI_TABLE_VIEW_FEATURE_FLAGS_H_
// Copyright 2019 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.
#import "ios/chrome/browser/ui/table_view/feature_flags.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
const base::Feature kCollectionsCardPresentationStyle{
"CollectionsCardPresentationStyle", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsCollectionsCardPresentationStyleEnabled() {
return base::FeatureList::IsEnabled(kCollectionsCardPresentationStyle);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment