diff options
11 files changed, 46 insertions, 17 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index a951454..5188ee9 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1398,7 +1398,7 @@ const FeatureEntry kFeatureEntries[] = { SINGLE_VALUE_TYPE(switches::kEnableTabAudioMuting)}, {"enable-credential-manager-api", IDS_FLAGS_CREDENTIAL_MANAGER_API_NAME, IDS_FLAGS_CREDENTIAL_MANAGER_API_DESCRIPTION, kOsAll, - SINGLE_VALUE_TYPE(switches::kEnableCredentialManagerAPI)}, + FEATURE_VALUE_TYPE(features::kCredentialManagementAPI)}, {"reduced-referrer-granularity", IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_NAME, IDS_FLAGS_REDUCED_REFERRER_GRANULARITY_DESCRIPTION, kOsAll, diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc index eca1739..738e70c 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc @@ -7,6 +7,7 @@ #include <utility> #include "base/command_line.h" +#include "base/feature_list.h" #include "base/macros.h" #include "base/metrics/histogram_samples.h" #include "base/strings/utf_string_conversions.h" @@ -22,7 +23,7 @@ #include "chrome/test/base/interactive_test_utils.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/render_view_host.h" -#include "content/public/common/content_switches.h" +#include "content/public/common/content_features.h" #include "net/url_request/test_url_fetcher_factory.h" #include "testing/gmock/include/gmock/gmock.h" @@ -291,9 +292,13 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, TwoTabsWithBubble) { } IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, AutoSignin) { - // The switch enables the new UI. - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kEnableCredentialManagerAPI); + base::FeatureList::ClearInstanceForTesting(); + scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); + feature_list->InitializeFromCommandLine( + features::kCredentialManagementAPI.name, std::string()); + base::FeatureList::SetInstance(std::move(feature_list)); + ASSERT_TRUE(base::FeatureList::IsEnabled(features::kCredentialManagementAPI)); + ScopedVector<autofill::PasswordForm> local_credentials; test_form()->origin = GURL("https://example.com"); test_form()->display_name = base::ASCIIToUTF16("Peter"); diff --git a/chrome/browser/ui/webui/options/password_manager_handler.cc b/chrome/browser/ui/webui/options/password_manager_handler.cc index efba085..77256a7 100644 --- a/chrome/browser/ui/webui/options/password_manager_handler.cc +++ b/chrome/browser/ui/webui/options/password_manager_handler.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/webui/options/password_manager_handler.h" #include "base/bind.h" -#include "base/command_line.h" +#include "base/feature_list.h" #include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" @@ -32,7 +32,7 @@ #include "content/public/browser/user_metrics.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" -#include "content/public/common/content_switches.h" +#include "content/public/common/content_features.h" #include "content/public/common/origin_util.h" #include "ui/base/l10n/l10n_util.h" @@ -149,8 +149,7 @@ void PasswordManagerHandler::GetLocalizedValues( localized_strings->SetBoolean("disableShowPasswords", disable_show_passwords); localized_strings->SetBoolean( "enableCredentialManagerAPI", - base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableCredentialManagerAPI)); + base::FeatureList::IsEnabled(features::kCredentialManagementAPI)); } void PasswordManagerHandler::RegisterMessages() { diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index aba66b4..9ef9c63 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1430,7 +1430,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kDomAutomationController, switches::kEnableBlinkFeatures, switches::kEnableBrowserSideNavigation, - switches::kEnableCredentialManagerAPI, switches::kEnableDisplayList2dCanvas, switches::kEnableDistanceFieldText, switches::kEnableExperimentalCanvasFeatures, diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 920bb03..d11d49c 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc @@ -142,8 +142,8 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( WebRuntimeFeatures::enableNetworkInformation(true); } - if (command_line.HasSwitch(switches::kEnableCredentialManagerAPI)) - WebRuntimeFeatures::enableCredentialManagerAPI(true); + if (!base::FeatureList::IsEnabled(features::kCredentialManagementAPI)) + WebRuntimeFeatures::enableCredentialManagerAPI(false); if (command_line.HasSwitch(switches::kReducedReferrerGranularity)) WebRuntimeFeatures::enableReducedReferrerGranularity(true); diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 30f109a..5582e9e 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc @@ -14,6 +14,11 @@ namespace features { const base::Feature kBrotliEncoding{"brotli-encoding", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enables the credential management API: +// https://w3c.github.io/webappsec-credential-management/ +const base::Feature kCredentialManagementAPI{"CredentialManagementAPI", + base::FEATURE_ENABLED_BY_DEFAULT}; + // Downloads resumption will be controllable via a flag until it's enabled // permanently. See https://crbug.com/7648 const base::Feature kDownloadResumption{"DownloadResumption", diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 4f70c50..92681729 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h @@ -17,6 +17,7 @@ namespace features { // All features in alphabetical order. The features should be documented // alongside the definition of their values in the .cc file. CONTENT_EXPORT extern const base::Feature kBrotliEncoding; +CONTENT_EXPORT extern const base::Feature kCredentialManagementAPI; CONTENT_EXPORT extern const base::Feature kDownloadResumption; CONTENT_EXPORT extern const base::Feature kExperimentalFramework; CONTENT_EXPORT extern const base::Feature kOptimizeIPCForSmallResource; diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 70363f3..1dfeb1a 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -324,9 +324,6 @@ const char kEnableLCDText[] = "enable-lcd-text"; // Only valid if GPU rasterization is enabled as well. const char kEnableDistanceFieldText[] = "enable-distance-field-text"; -// Enable the experimental Credential Manager JavaScript API. -const char kEnableCredentialManagerAPI[] = "enable-credential-manager-api"; - // Enable the creation of compositing layers when it would prevent LCD text. const char kEnablePreferCompositingToLCDText[] = "enable-prefer-compositing-to-lcd-text"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index fe08255..8613800 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -102,7 +102,6 @@ CONTENT_EXPORT extern const char kDownloadProcess[]; extern const char kEnable2dCanvasClipAntialiasing[]; CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[]; CONTENT_EXPORT extern const char kEnableAudioSupportForDesktopShare[]; -CONTENT_EXPORT extern const char kEnableCredentialManagerAPI[]; CONTENT_EXPORT extern const char kEnablePreferCompositingToLCDText[]; CONTENT_EXPORT extern const char kEnableBlinkFeatures[]; CONTENT_EXPORT extern const char kEnableBrowserSideNavigation[]; diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt index 39b4216..084e8ee 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt @@ -488,6 +488,17 @@ interface ConvolverNode : AudioNode method constructor setter buffer setter normalize +interface Credential + getter iconURL + getter id + getter name + getter type + method constructor +interface CredentialsContainer + method constructor + method get + method requireUserMediation + method store interface Crypto getter subtle method constructor @@ -1085,6 +1096,10 @@ interface EventTarget method constructor method dispatchEvent method removeEventListener +interface FederatedCredential : Credential + getter protocol + getter provider + method constructor interface File : Blob getter lastModified getter lastModifiedDate @@ -3027,6 +3042,7 @@ interface Navigator getter appVersion getter bluetooth getter cookieEnabled + getter credentials getter doNotTrack getter geolocation getter hardwareConcurrency @@ -3192,6 +3208,14 @@ interface OscillatorNode : AudioSourceNode interface PageTransitionEvent : Event getter persisted method constructor +interface PasswordCredential : Credential + getter additionalData + getter idName + getter passwordName + method constructor + setter additionalData + setter idName + setter passwordName interface Path2D method arc method arcTo diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in index a27072e..33553ec 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in @@ -37,7 +37,7 @@ CompositorWorker status=experimental // Unified Chrome Compositor and Blink Animations engine (Project Heaviside). crbug.com/394772 CompositorAnimationTimelines ContextMenu status=experimental -CredentialManager status=test +CredentialManager status=stable CSS3Text status=experimental CSS3TextDecorations status=experimental CSSAdditiveAnimations status=experimental, depends_on=StackedCSSPropertyAnimations |