Commit 6f3a2600 authored by Gregory Chatzinoff's avatar Gregory Chatzinoff Committed by Commit Bot

Add feature flag for sharing canonical URLs.

Adds a feature flag to control whether the canonical URL is shared.

Bug: none
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I5b70667ab1743af8ea5845f541dfc0f621ba9314
Reviewed-on: https://chromium-review.googlesource.com/744973
Commit-Queue: Peter Lee <pkl@chromium.org>
Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512762}
parent e849b518
...@@ -123,6 +123,7 @@ source_set("browser") { ...@@ -123,6 +123,7 @@ source_set("browser") {
"//ios/chrome/browser/payments:constants", "//ios/chrome/browser/payments:constants",
"//ios/chrome/browser/ssl:features", "//ios/chrome/browser/ssl:features",
"//ios/chrome/browser/sync/glue", "//ios/chrome/browser/sync/glue",
"//ios/chrome/browser/ui/activity_services:features",
"//ios/chrome/browser/ui/external_search:features", "//ios/chrome/browser/ui/external_search:features",
"//ios/chrome/browser/ui/history:history_base_feature", "//ios/chrome/browser/ui/history:history_base_feature",
"//ios/chrome/browser/ui/main:feature_flags", "//ios/chrome/browser/ui/main:feature_flags",
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h" #include "ios/chrome/browser/drag_and_drop/drag_and_drop_flag.h"
#include "ios/chrome/browser/ios_chrome_flag_descriptions.h" #include "ios/chrome/browser/ios_chrome_flag_descriptions.h"
#include "ios/chrome/browser/ssl/captive_portal_features.h" #include "ios/chrome/browser/ssl/captive_portal_features.h"
#include "ios/chrome/browser/ui/activity_services/canonical_url_feature.h"
#include "ios/chrome/browser/ui/external_search/features.h" #include "ios/chrome/browser/ui/external_search/features.h"
#import "ios/chrome/browser/ui/history/history_base_feature.h" #import "ios/chrome/browser/ui/history/history_base_feature.h"
#include "ios/chrome/browser/ui/main/main_feature_flags.h" #include "ios/chrome/browser/ui/main/main_feature_flags.h"
...@@ -193,6 +194,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = { ...@@ -193,6 +194,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"slim-navigation-manager", flag_descriptions::kSlimNavigationManagerName, {"slim-navigation-manager", flag_descriptions::kSlimNavigationManagerName,
flag_descriptions::kSlimNavigationManagerDescription, flags_ui::kOsIos, flag_descriptions::kSlimNavigationManagerDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(web::features::kSlimNavigationManager)}, FEATURE_VALUE_TYPE(web::features::kSlimNavigationManager)},
{"ios-share-canonical-url", flag_descriptions::kShareCanonicalURLName,
flag_descriptions::kShareCanonicalURLDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(activity_services::kShareCanonicalURL)},
}; };
// Add all switches from experimental flags to |command_line|. // Add all switches from experimental flags to |command_line|.
......
...@@ -78,6 +78,11 @@ extern const char kSafeAreaCompatibleToolbarName[] = ...@@ -78,6 +78,11 @@ extern const char kSafeAreaCompatibleToolbarName[] =
extern const char kSafeAreaCompatibleToolbarDescription[] = extern const char kSafeAreaCompatibleToolbarDescription[] =
"When enabled, the toolbar resizes itself when the safe area changes."; "When enabled, the toolbar resizes itself when the safe area changes.";
const char kShareCanonicalURLName[] = "Share Canonical URL";
const char kShareCanonicalURLDescription[] =
"When enabled, the current page's canonical URL is shared (if it exists) "
"instead of the visible URL.";
const char kSlimNavigationManagerName[] = "Use Slim Navigation Manager"; const char kSlimNavigationManagerName[] = "Use Slim Navigation Manager";
const char kSlimNavigationManagerDescription[] = const char kSlimNavigationManagerDescription[] =
"When enabled, uses the experimental slim navigation manager that provides " "When enabled, uses the experimental slim navigation manager that provides "
......
...@@ -70,6 +70,11 @@ extern const char kPhysicalWebDescription[]; ...@@ -70,6 +70,11 @@ extern const char kPhysicalWebDescription[];
extern const char kSafeAreaCompatibleToolbarName[]; extern const char kSafeAreaCompatibleToolbarName[];
extern const char kSafeAreaCompatibleToolbarDescription[]; extern const char kSafeAreaCompatibleToolbarDescription[];
// Title and description for the flag to share the canonical URL of the
// current page instead of the visible URL.
extern const char kShareCanonicalURLName[];
extern const char kShareCanonicalURLDescription[];
// Title and description for the flag to enable WKBackForwardList based // Title and description for the flag to enable WKBackForwardList based
// navigation manager. // navigation manager.
extern const char kSlimNavigationManagerName[]; extern const char kSlimNavigationManagerName[];
......
...@@ -119,3 +119,14 @@ source_set("eg_tests") { ...@@ -119,3 +119,14 @@ source_set("eg_tests") {
] ]
libs = [ "XCTest.framework" ] libs = [ "XCTest.framework" ]
} }
source_set("features") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"canonical_url_feature.cc",
"canonical_url_feature.h",
]
deps = [
"//base",
]
}
// Copyright 2017 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/activity_services/canonical_url_feature.h"
namespace activity_services {
const base::Feature kShareCanonicalURL{"ShareCanonicalURLIOS",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace activity_services
// Copyright 2017 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_ACTIVITY_SERVICES_CANONICAL_URL_FEATURE_H_
#define IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_CANONICAL_URL_FEATURE_H_
#include "base/feature_list.h"
namespace activity_services {
// Used to control whether the canonical URL is shared if available.
extern const base::Feature kShareCanonicalURL;
} // namespace activity_services
#endif // IOS_CHROME_BROWSER_UI_ACTIVITY_SERVICES_CANONICAL_URL_FEATURE_H_
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