Commit 5e343663 authored by Robbie Gibson's avatar Robbie Gibson Committed by Commit Bot

[iOS] Use cross-platform feature instead of iOS one for cookie controls

This cross-platform behavior already exists and controls behavior in
cookie_settings.cc, so we should use it instead on iOS.

Bug: 1075534
Change-Id: I28c9cbbfb0cf5edafbe05d07ff01159bbb09120a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2165740
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762863}
parent d0ea0291
......@@ -25,6 +25,7 @@
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/autofill/ios/browser/autofill_switches.h"
#include "components/content_settings/core/common/features.h"
#include "components/dom_distiller/core/dom_distiller_switches.h"
#include "components/feature_engagement/public/feature_constants.h"
#include "components/feature_engagement/public/feature_list.h"
......@@ -552,9 +553,10 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"reload-sad-tab", flag_descriptions::kReloadSadTabName,
flag_descriptions::kReloadSadTabDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::kReloadSadTab)},
{"page-info-chrome-guard", flag_descriptions::kPageInfoChromeGuardName,
flag_descriptions::kPageInfoChromeGuardDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kPageInfoChromeGuard)},
{"improved-cookie-controls",
flag_descriptions::kImprovedCookieControlsDescription,
flag_descriptions::kImprovedCookieControlsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(content_settings::kImprovedCookieControls)},
{"page-info-refactoring", flag_descriptions::kPageInfoRefactoringName,
flag_descriptions::kPageInfoRefactoringDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kPageInfoRefactoring)},
......
......@@ -356,9 +356,9 @@ const char kOpenDownloadsInFilesAppDescription[] =
"the tools menu or after pressing the 'Open in downloads' button invoked "
"by pressing 'Open In...' after download completes.";
const char kPageInfoChromeGuardName[] = "Third-party cookie blocking UI";
const char kPageInfoChromeGuardDescription[] =
"Allows user to manage third-party cookie blocking from the page info";
const char kImprovedCookieControlsName[] = "Third-party cookie blocking UI";
const char kImprovedCookieControlsDescription[] =
"Allows user to manage third-party cookie blocking.";
const char kPageInfoRefactoringName[] = "New design of the page info";
const char kPageInfoRefactoringDescription[] =
......
......@@ -305,10 +305,10 @@ extern const char kOmniboxOnFocusSuggestionsDescription[];
extern const char kOpenDownloadsInFilesAppName[];
extern const char kOpenDownloadsInFilesAppDescription[];
// Title and description for the flag to allow user to manage third-party cookie
// blocking from the page info.
extern const char kPageInfoChromeGuardName[];
extern const char kPageInfoChromeGuardDescription[];
// Title and description for the flag to provide user with improved settings
// relating to cookies.
extern const char kImprovedCookieControlsName[];
extern const char kImprovedCookieControlsDescription[];
// Title and description for the flag to enable the new design of the page info.
extern const char kPageInfoRefactoringName[];
......
......@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/ntp/incognito_view.h"
#include "components/content_settings/core/common/features.h"
#include "components/google/core/common/google_util.h"
#include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/application_context.h"
......@@ -180,8 +181,8 @@ NSAttributedString* FormatHTMLListForUILabel(NSString* listString) {
[self addTextSections];
if (base::FeatureList::IsEnabled(kPageInfoChromeGuard))
[self addCoockiesViewController];
if (base::FeatureList::IsEnabled(content_settings::kImprovedCookieControls))
[self addCookiesViewController];
// |topGuide| and |bottomGuide| exist to vertically position the stackview
// inside the container scrollview.
......@@ -451,7 +452,7 @@ NSAttributedString* FormatHTMLListForUILabel(NSString* listString) {
object:nil];
}
- (void)addCoockiesViewController {
- (void)addCookiesViewController {
IncognitoCookiesView* cookiesView = [[IncognitoCookiesView alloc] init];
[_stackView addArrangedSubview:cookiesView];
}
......
......@@ -10,8 +10,4 @@
// Feature to enable the new design of the page info.
extern const base::Feature kPageInfoRefactoring;
// Feature to allow user to manage cookie blocking from the page
// info.
extern const base::Feature kPageInfoChromeGuard;
#endif // IOS_CHROME_BROWSER_UI_PAGE_INFO_FEATURES_H_
......@@ -10,6 +10,3 @@
const base::Feature kPageInfoRefactoring{"PageInfoRefactoring",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kPageInfoChromeGuard{"PageInfoChromeGuard",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -4,6 +4,7 @@
#import "ios/chrome/browser/ui/page_info/page_info_view_controller.h"
#include "components/content_settings/core/common/features.h"
#import "ios/chrome/browser/ui/page_info/features.h"
#import "ios/chrome/browser/ui/page_info/page_info_navigation_commands.h"
#import "ios/chrome/browser/ui/table_view/cells/table_view_detail_icon_item.h"
......@@ -58,8 +59,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
[self.tableViewModel addItem:securityItem
toSectionWithIdentifier:SectionIdentifierContent];
if (base::FeatureList::IsEnabled(kPageInfoChromeGuard)) {
// Create the Chrome Guard item.
if (base::FeatureList::IsEnabled(content_settings::kImprovedCookieControls)) {
// Create the Cookies item.
TableViewDetailIconItem* CookiesItem =
[[TableViewDetailIconItem alloc] initWithType:ItemTypeCookies];
CookiesItem.text = l10n_util::GetNSString(IDS_IOS_PAGE_INFO_COOKIES_TITLE);
......
......@@ -6,6 +6,7 @@
#include "base/logging.h"
#import "base/mac/foundation_util.h"
#include "components/content_settings/core/common/features.h"
#include "components/handoff/pref_names_ios.h"
#import "components/prefs/ios/pref_observer_bridge.h"
#include "components/prefs/pref_change_registrar.h"
......@@ -132,7 +133,7 @@ const char kGoogleServicesSettingsURL[] = "settings://open_google_services";
[model addItem:[self handoffDetailItem]
toSectionWithIdentifier:SectionIdentifierWebServices];
if (base::FeatureList::IsEnabled(kPageInfoChromeGuard)) {
if (base::FeatureList::IsEnabled(content_settings::kImprovedCookieControls)) {
// Cookies Section
[model addSectionWithIdentifier:SectionIndentifierCookies];
[model addItem:[self cookiesItem]
......
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