diff --git a/DEPS b/DEPS index 0d5032c..02e1ec81 100644 --- a/DEPS +++ b/DEPS
@@ -307,11 +307,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '81e4fb39880b4c2a3ff52d4778a56cef385cebd5', + 'v8_revision': '34248965c12fc846f437770c1a7557e8fabfccd1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '48ff6a269e732ea1fa458e5b8bb29df6578c9849', + 'angle_revision': '09c69b5b5cb987ff236fe11929a780a116a7a8bd', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -394,7 +394,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'b03d0e46221a7992bc9fb36ca888e9518d9f2818', + 'devtools_frontend_revision': '537237ced590b359b9a213bd44ef5b46107d4371', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -418,7 +418,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'b1b829b49d69af4c48875512c3392f1b2f4994c3', + 'dawn_revision': '10aa8bc80bbfef2650adbd4643a007e3efb7708c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -818,7 +818,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '9d6d0bc6a5faaa3482a95075222469c67bcabad9', + 'e1531b3b46bc2d38f1b94d016561b6a322ab764e', 'condition': 'checkout_android and checkout_src_internal', }, @@ -980,7 +980,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'V3eHW8d1wBTfaXCvDE6pgof9lg94Av7unMW_qMkA5rMC', + 'version': 'fqxYsn2IXlLsIUEqOtKmc889IE28eptRCxsFQBZP55kC', }, ], 'condition': 'checkout_android', @@ -1051,7 +1051,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_build_tools/manifest_merger', - 'version': '3rLesGAkawLbiSrx8-sR19ZU_fIHT5djFfmm1U2CRsYC', + 'version': 'SsLJuePpgSRlofU-tTKtZM6uoAelYZV8509WbBDI-ecC', }, ], 'condition': 'checkout_android', @@ -1078,7 +1078,7 @@ }, { 'package': 'chromium/third_party/android_sdk/public/cmdline-tools', - 'version': 'Sy00LuyBIUJdRGYKwg0zjWH8eAIUvgnnNiPkI8etaZYC', + 'version': 'BRpfUGFd3WoveSGTLVgkQF7ugIVyywGneVICP4c0010C', }, ], 'condition': 'checkout_android_native_support', @@ -1196,7 +1196,7 @@ Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '59f428f071a17a493a5563cda92e6a7dc3d59ef0', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '9384327dc44ffdc6a5b98783c7614efa75f753ed', 'condition': 'checkout_src_internal', }, @@ -1841,7 +1841,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'f20c5f7b8f53904edaa98651d764e1b8305d7c14', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'ee2fcbab428934630b39e0be128cb0fcd0573aae', + Var('webrtc_git') + '/src.git' + '@' + 'f40443424ea57e794be5e43abc2d8d8f6b7c50b9', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -1964,7 +1964,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'Fm-lleCz31hEAWpqbU_43qKzdDYs8WuNRqrU4stBW3EC', + 'version': 'CW27fTSHvRgStZUViK8yKE3FsVCJ4-PlWF8QDdPRUa8C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1975,7 +1975,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'XrVVLbTsS4BLvPdmuEmlm7UbTVGSlocLMRDuskk4GBUC', + 'version': 'aTTGvs9hXU5D6I_x64Q5O5avIbAiEWTYfF2pmynh1LQC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -3921,7 +3921,7 @@ 'src/components/autofill/core/browser/form_parsing/internal_resources': { 'url': Var('chrome_git') + '/chrome/components/autofill_regex_patterns.git' + '@' + - 'f4dc712c172a20560d4b834b8d42bdf751ec0bef', + '15d876427e377dae1ebacaadea05c7c211a04194', 'condition': 'checkout_src_internal', }, @@ -4004,7 +4004,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '0aa93701d8d782d45dc538c8fbae4eeeeee0414c', + '1b070c09e79ffad05461f8b098c6ba2cf2ae332d', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/android_webview/browser/aw_autofill_client.cc b/android_webview/browser/aw_autofill_client.cc index 516a55e..30582e3 100644 --- a/android_webview/browser/aw_autofill_client.cc +++ b/android_webview/browser/aw_autofill_client.cc
@@ -92,8 +92,7 @@ autofill::AutocompleteHistoryManager* AwAutofillClient::GetAutocompleteHistoryManager() { - return AwBrowserContext::FromWebContents(&GetWebContents()) - ->GetAutocompleteHistoryManager(); + NOTREACHED_NORETURN(); } PrefService* AwAutofillClient::GetPrefs() {
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc index cde292a..5350c42e 100644 --- a/android_webview/browser/aw_browser_context.cc +++ b/android_webview/browser/aw_browser_context.cc
@@ -373,19 +373,6 @@ return form_database_service_.get(); } -autofill::AutocompleteHistoryManager* -AwBrowserContext::GetAutocompleteHistoryManager() { - if (!autocomplete_history_manager_) { - autocomplete_history_manager_ = - std::make_unique<autofill::AutocompleteHistoryManager>(); - autocomplete_history_manager_->Init( - form_database_service_->get_autofill_webdata_service(), - user_pref_service_.get(), IsOffTheRecord()); - } - - return autocomplete_history_manager_.get(); -} - CookieManager* AwBrowserContext::GetCookieManager() { if (IsDefaultBrowserContext()) { // For the default context, the CookieManager isn't owned by the context,
diff --git a/android_webview/browser/aw_browser_context.h b/android_webview/browser/aw_browser_context.h index a11dfbc..fd9b36b 100644 --- a/android_webview/browser/aw_browser_context.h +++ b/android_webview/browser/aw_browser_context.h
@@ -101,7 +101,6 @@ void SetWebLayerRunningInSameProcess(JNIEnv* env); AwFormDatabaseService* GetFormDatabaseService(); - autofill::AutocompleteHistoryManager* GetAutocompleteHistoryManager(); CookieManager* GetCookieManager(); bool IsDefaultBrowserContext() const;
diff --git a/chrome/VERSION b/chrome/VERSION index 3848ac9..56d0568 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=122 MINOR=0 -BUILD=6215 +BUILD=6216 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 5cb0741b..bbeda3a 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -754,6 +754,7 @@ if (enable_supervised_users) { deps += [ + "//chrome/browser/supervised_user:supervised_user_service_platform_delegate_java", "//chrome/browser/supervised_user:website_parent_approval_java", "//components/supervised_user/android:supervised_user_preferences_java", ]
diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml index 72977ec..a494114e 100644 --- a/chrome/android/java/res/xml/main_preferences.xml +++ b/chrome/android/java/res/xml/main_preferences.xml
@@ -42,7 +42,7 @@ android:key="search_engine" android:order="6" android:title="@string/search_engine_settings"/> - <org.chromium.components.browser_ui.settings.ChromeBasePreference + <org.chromium.chrome.browser.password_manager.settings.PasswordsPreference android:fragment="org.chromium.chrome.browser.password_manager.settings.PasswordSettings" android:key="passwords" android:order="7"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java index 15188f3..f12db33 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
@@ -33,6 +33,7 @@ import org.chromium.chrome.browser.password_check.PasswordCheckFactory; import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher; +import org.chromium.chrome.browser.password_manager.settings.PasswordsPreference; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl; @@ -404,16 +405,17 @@ .setOnPreferenceClickListener( preference -> SettingsLauncherHelper.showAutofillProfileSettings(getActivity())); - findPreference(PREF_PASSWORDS) - .setOnPreferenceClickListener( - preference -> { - PasswordManagerLauncher.showPasswordSettings( - getActivity(), - ManagePasswordsReferrer.CHROME_SETTINGS, - mModalDialogManagerSupplier, - /* managePasskeys= */ false); - return true; - }); + PasswordsPreference passwordsPreference = findPreference(PREF_PASSWORDS); + passwordsPreference.setProfile(getProfile()); + passwordsPreference.setOnPreferenceClickListener( + preference -> { + PasswordManagerLauncher.showPasswordSettings( + getActivity(), + ManagePasswordsReferrer.CHROME_SETTINGS, + mModalDialogManagerSupplier, + /* managePasskeys= */ false); + return true; + }); } private void updatePlusAddressesPreference() {
diff --git a/chrome/android/profiles/arm.newest.txt b/chrome/android/profiles/arm.newest.txt index 3ccedca3..59a382c 100644 --- a/chrome/android/profiles/arm.newest.txt +++ b/chrome/android/profiles/arm.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-122.0.6210.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-arm-122.0.6213.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 2aa100e..6f38a23 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-122.0.6210.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-122.0.6213.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index fb87c23..4685d00 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -1478,7 +1478,7 @@ Follow the instructions on your phone to continue setup. Make sure your phone is nearby and Bluetooth is turned on. </message> <message name="IDS_LOGIN_QUICK_START_ACCOUNT_TRANSFER_STEP_TITLE" desc="A title used on OOBE's Quick Start flow when the user's credentails are being transferred from the Android device to ChromeOS."> - Getting Google Account info... + Signing in... </message> <message name="IDS_LOGIN_QUICK_START_ACCOUNT_TRANSFER_STEP_SUBTITLE" desc="A subtitle used on OOBE's Quick Start flow when the user's credentails are being transferred from the Android device to ChromeOS."> Transfering Google Account info from your Android phone
diff --git a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_QUICK_START_ACCOUNT_TRANSFER_STEP_TITLE.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_QUICK_START_ACCOUNT_TRANSFER_STEP_TITLE.png.sha1 index 8eee107..ab6028e 100644 --- a/chrome/app/chromeos_strings_grdp/IDS_LOGIN_QUICK_START_ACCOUNT_TRANSFER_STEP_TITLE.png.sha1 +++ b/chrome/app/chromeos_strings_grdp/IDS_LOGIN_QUICK_START_ACCOUNT_TRANSFER_STEP_TITLE.png.sha1
@@ -1 +1 @@ -b46ee31528a3c3f473608587d143465b395a0f03 \ No newline at end of file +5fa2e852905d6d20c6dbed76535b78feb73f9e65 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 91ef2933..225f9e90 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3578,7 +3578,7 @@ "supervised_user/child_accounts/child_account_service_android.h", ] deps += [ - "//chrome/browser/supervised_user:jni_headers", + "//chrome/browser/supervised_user:website_parent_approval_jni_headers", "//components/supervised_user/core/browser", "//components/supervised_user/core/browser:supervised_user_preferences", ] @@ -7798,6 +7798,7 @@ "supervised_user/android/supervised_user_service_platform_delegate.cc", "supervised_user/android/supervised_user_service_platform_delegate.h", ] + deps += [ "//chrome/browser/supervised_user:supervised_user_service_platform_delegate_jni_headers" ] } else { sources += [ "supervised_user/supervised_user_service_platform_delegate.cc",
diff --git a/chrome/browser/ash/fusebox/fusebox_read_writer.cc b/chrome/browser/ash/fusebox/fusebox_read_writer.cc index 220a1b79..5c4474f 100644 --- a/chrome/browser/ash/fusebox/fusebox_read_writer.cc +++ b/chrome/browser/ash/fusebox/fusebox_read_writer.cc
@@ -111,23 +111,23 @@ std::move(callback))); } -using FlushFsWriterCallback = base::OnceCallback<void( +using EOFFlushFsWriterCallback = base::OnceCallback<void( std::unique_ptr<storage::FileStreamWriter> fs_writer, int64_t write_offset, int posix_error_code)>; -// Calls fs_writer->Flush(), running the callback afterwards, if needs_flushing -// is true. If false, it just runs the callback immediately. +// Calls fs_writer->Flush(kEndOfFile), running the callback afterwards, if +// needs_eof_flushing is true. If false, it just runs the callback immediately. // // The fs_writer and write_offset are passed through to the callback. -void FlushFsWriterIfNecessary( +void EOFFlushFsWriterIfNecessary( std::unique_ptr<storage::FileStreamWriter> fs_writer, int64_t write_offset, - bool needs_flushing, - FlushFsWriterCallback callback) { + bool needs_eof_flushing, + EOFFlushFsWriterCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - if (!fs_writer || !needs_flushing) { + if (!fs_writer || !needs_eof_flushing) { std::move(callback).Run(std::move(fs_writer), write_offset, 0); return; } @@ -140,7 +140,7 @@ auto pair = base::SplitOnceCallback(base::BindOnce( [](std::unique_ptr<storage::FileStreamWriter> fs_writer, - int64_t write_offset, FlushFsWriterCallback callback, int result) { + int64_t write_offset, EOFFlushFsWriterCallback callback, int result) { int posix_error_code = (result < 0) ? NetErrorToErrno(result) : 0; std::move(callback).Run(std::move(fs_writer), write_offset, posix_error_code); @@ -187,16 +187,16 @@ } closed_ = true; - FlushFsWriterIfNecessary( + EOFFlushFsWriterIfNecessary( std::move(fs_writer_), std::exchange(write_offset_, -1), - std::exchange(fs_writer_needs_flushing_, false), - base::BindOnce(&ReadWriter::OnFlushBeforeActualClose, + std::exchange(fs_writer_needs_eof_flushing_, false), + base::BindOnce(&ReadWriter::OnEOFFlushBeforeActualClose, weak_ptr_factory_.GetWeakPtr(), std::move(fs_context), std::move(callback))); } // static -void ReadWriter::OnFlushBeforeActualClose( +void ReadWriter::OnEOFFlushBeforeActualClose( base::WeakPtr<ReadWriter> weak_ptr, scoped_refptr<storage::FileSystemContext> fs_context, Close2Callback callback, @@ -410,7 +410,7 @@ // See if we can re-use the previous storage::FileStreamWriter. // // If so, go on to CallWriteDirect immediately. Otherwise, go on to - // FlushFsWriterIfNecessary, OnFlushBeforeCallWriteDirect and then + // EOFFlushFsWriterIfNecessary, OnEOFFlushBeforeCallWriteDirect and then // CallWriteDirect. if (fs_writer_ && (write_offset_ == offset)) { CallWriteDirect(std::move(callback), std::move(fs_context), @@ -421,18 +421,18 @@ // We will need a new storage::FileStreamWriter, so destroy the previous one // saved to fs_writer_, if it is non-null. However, we might need to Flush it - // before destroying it. + // (with FlushMode::kEndOfFile) before destroying it. // - // Calling FlushFsWriterIfNecessary, with std::move(fs_writer_) and with - // OnFlushBeforeCallWriteDirect, will Flush (if needed) and destroy that + // Calling EOFFlushFsWriterIfNecessary, with std::move(fs_writer_) and with + // OnEOFFlushBeforeCallWriteDirect, will Flush (if needed) and destroy that // FileStreamWriter (positioned at write_offset_), if it is non-null. // - // Afterwards, OnFlushBeforeCallWriteDirect creates a new FileStreamWriter + // Afterwards, OnEOFFlushBeforeCallWriteDirect creates a new FileStreamWriter // (positioned at offset) and passes that on to CallWriteDirect. - FlushFsWriterIfNecessary( + EOFFlushFsWriterIfNecessary( std::move(fs_writer_), std::exchange(write_offset_, -1), - std::exchange(fs_writer_needs_flushing_, false), - base::BindOnce(&ReadWriter::OnFlushBeforeCallWriteDirect, + std::exchange(fs_writer_needs_eof_flushing_, false), + base::BindOnce(&ReadWriter::OnEOFFlushBeforeCallWriteDirect, weak_ptr_factory_.GetWeakPtr(), std::move(callback), std::move(fs_context), std::move(buffer), offset, length)); } @@ -526,7 +526,7 @@ } // static -void ReadWriter::OnFlushBeforeCallWriteDirect( +void ReadWriter::OnEOFFlushBeforeCallWriteDirect( base::WeakPtr<ReadWriter> weak_ptr, Write2Callback callback, scoped_refptr<storage::FileSystemContext> fs_context, // See § above. @@ -618,8 +618,8 @@ if (length >= 0) { self->fs_writer_ = std::move(fs_writer); self->write_offset_ = offset + length; - self->fs_writer_needs_flushing_ = - self->fs_writer_needs_flushing_ || + self->fs_writer_needs_eof_flushing_ = + self->fs_writer_needs_eof_flushing_ || (self->fs_url_.mount_option().flush_policy() == storage::FlushPolicy::FLUSH_ON_COMPLETION); } else {
diff --git a/chrome/browser/ash/fusebox/fusebox_read_writer.h b/chrome/browser/ash/fusebox/fusebox_read_writer.h index e8ad9350..727e04e 100644 --- a/chrome/browser/ash/fusebox/fusebox_read_writer.h +++ b/chrome/browser/ash/fusebox/fusebox_read_writer.h
@@ -87,7 +87,7 @@ // The CallXxx and OnXxx methods are static (but take a WeakPtr) so that the // callback will run even if the WeakPtr is invalidated. - static void OnFlushBeforeActualClose( + static void OnEOFFlushBeforeActualClose( base::WeakPtr<ReadWriter> weak_ptr, scoped_refptr<storage::FileSystemContext> fs_context, Close2Callback callback, @@ -120,7 +120,7 @@ Write2Callback callback, WriteTempFileResult result); - static void OnFlushBeforeCallWriteDirect( + static void OnEOFFlushBeforeCallWriteDirect( base::WeakPtr<ReadWriter> weak_ptr, Write2Callback callback, scoped_refptr<storage::FileSystemContext> fs_context, @@ -180,7 +180,10 @@ bool is_in_flight_ = false; bool closed_ = false; bool created_temp_file_ = false; - bool fs_writer_needs_flushing_ = false; + // storage::FileStreamWriter::Flush takes a storage::FlushMode parameter. + // This bool field is about calling with FlushMode::kEndOfFile, not with + // FlushMode::kDefault. + bool fs_writer_needs_eof_flushing_ = false; const bool use_temp_file_; const bool temp_file_starts_with_copy_;
diff --git a/chrome/browser/ash/login/quickstart_controller.cc b/chrome/browser/ash/login/quickstart_controller.cc index 70901d0..86a0952 100644 --- a/chrome/browser/ash/login/quickstart_controller.cc +++ b/chrome/browser/ash/login/quickstart_controller.cc
@@ -250,7 +250,7 @@ case Step::REQUESTING_GOOGLE_ACCOUNT_INFO: return; case Step::GOOGLE_ACCOUNT_INFO_RECEIVED: - UpdateUiState(UiState::TRANSFERRING_GAIA_CREDENTIALS); + UpdateUiState(UiState::SIGNING_IN); bootstrap_controller_->AttemptGoogleAccountTransfer(); return; case Step::TRANSFERRING_GOOGLE_ACCOUNT_DETAILS: @@ -263,8 +263,8 @@ CHECK(controller_state_ == ControllerState::CONNECTED); if (absl::holds_alternative<FidoAssertionInfo>(status.payload)) { QS_LOG(INFO) << "Successfully received FIDO assertion."; - fido_ = absl::get<FidoAssertionInfo>(status.payload); - UpdateUiState(UiState::SHOWING_FIDO); + // TODO(b/283724988) - Update with authorization code. + UpdateUiState(UiState::SIGNING_IN); SavePhoneInstanceID(); } else { CHECK(absl::holds_alternative<ErrorCode>(status.payload)); @@ -400,7 +400,7 @@ entry_point_.reset(); qr_code_data_.reset(); pin_.reset(); - fido_.reset(); + user_info_ = UserInfo(); wifi_name_.reset(); controller_state_ = ControllerState::NOT_ACTIVE; ui_state_.reset();
diff --git a/chrome/browser/ash/login/quickstart_controller.h b/chrome/browser/ash/login/quickstart_controller.h index 996df6ee9..21e8717 100644 --- a/chrome/browser/ash/login/quickstart_controller.h +++ b/chrome/browser/ash/login/quickstart_controller.h
@@ -71,8 +71,9 @@ CONNECTING_TO_WIFI, WIFI_CREDENTIALS_RECEIVED, CONFIRM_GOOGLE_ACCOUNT, - TRANSFERRING_GAIA_CREDENTIALS, - SHOWING_FIDO, + SIGNING_IN, + // Same state as 'SIGNING_IN' but without the 'Cancel' button. + CREATING_ACCOUNT, // Exits the screen. EXIT_SCREEN, }; @@ -83,6 +84,13 @@ ~UiDelegate() override = default; }; + // For showing the user information on the UI + struct UserInfo { + std::string email = ""; + std::string full_name = ""; + std::string avatar_url = ""; + }; + using EntryPointButtonVisibilityCallback = base::OnceCallback<void(bool)>; using UiState = UiDelegate::UiState; @@ -121,7 +129,7 @@ QRCode::PixelData GetQrCode() { return qr_code_data_.value(); } std::string GetPin() { return pin_.value(); } std::string GetDiscoverableName() { return discoverable_name_.value(); } - FidoAssertionInfo GetFidoAssertion() { return fido_.value(); } + UserInfo GetUserInfo() { return user_info_; } std::string GetWiFiName() { return wifi_name_.value(); } // Check if bluetooth is disabled which would require showing the enable @@ -207,8 +215,8 @@ // PIN to be shown on the UI when requested. std::optional<std::string> pin_; - // FIDO assertion returned by the phone. Used by the UI for debugging for now. - std::optional<FidoAssertionInfo> fido_; + // User information that is shown while 'Signing in...' + UserInfo user_info_; // WiFi name to be shown on the UI. std::optional<std::string> wifi_name_;
diff --git a/chrome/browser/ash/login/screens/quick_start_screen.cc b/chrome/browser/ash/login/screens/quick_start_screen.cc index 7edf6fc6..5302b2ab8 100644 --- a/chrome/browser/ash/login/screens/quick_start_screen.cc +++ b/chrome/browser/ash/login/screens/quick_start_screen.cc
@@ -104,9 +104,6 @@ case ash::quick_start::QuickStartController::UiState::SHOWING_QR: view_->SetQRCode(ConvertQrCode(controller_->GetQrCode())); break; - case quick_start::QuickStartController::UiState::SHOWING_FIDO: - view_->ShowFidoAssertionReceived(controller_->GetFidoAssertion().email); - break; case quick_start::QuickStartController::UiState::SHOWING_PIN: view_->SetPIN(controller_->GetPin()); break; @@ -119,9 +116,14 @@ case quick_start::QuickStartController::UiState::CONFIRM_GOOGLE_ACCOUNT: view_->ShowConfirmGoogleAccount(); break; - case ash::quick_start::QuickStartController::UiState:: - TRANSFERRING_GAIA_CREDENTIALS: - view_->ShowTransferringGaiaCredentials(); + case ash::quick_start::QuickStartController::UiState::SIGNING_IN: + view_->ShowSigningInStep(); + view_->SetUserEmail(controller_->GetUserInfo().email); + view_->SetUserFullName(controller_->GetUserInfo().full_name); + view_->SetUserAvatar(controller_->GetUserInfo().avatar_url); + break; + case ash::quick_start::QuickStartController::UiState::CREATING_ACCOUNT: + view_->ShowCreatingAccountStep(); break; case ash::quick_start::QuickStartController::UiState::LOADING: // TODO(b:283724988) - Add method to view to show the loading spinner.
diff --git a/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc b/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc index adb1d923..0688d6b 100644 --- a/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/quick_start_screen_browsertest.cc
@@ -56,7 +56,6 @@ constexpr char kCancelButton[] = "cancelButton"; constexpr char kPinCodeWrapper[] = "pinWrapper"; constexpr char kConfirmAccountDialog[] = "confirmAccountDialog"; -constexpr char kGaiaTransferDialog[] = "gaiaTransferDialog"; constexpr char kScreenOpenedHistogram[] = "QuickStart.ScreenOpened"; constexpr test::UIPath kQuickStartEntryPointPath = { WelcomeView::kScreenId.name, kWelcomeScreen, kQuickStartEntryPoint}; @@ -83,7 +82,7 @@ constexpr test::UIPath kConfirmAccountDialogPath = { QuickStartView::kScreenId.name, kConfirmAccountDialog}; constexpr test::UIPath kCancelButtonGaiaTransferDialog = { - QuickStartView::kScreenId.name, kGaiaTransferDialog, kCancelButton}; + QuickStartView::kScreenId.name, kCancelButton}; constexpr test::UIPath kQuickStartButtonGaia = { "gaia-signin", "signin-frame-dialog", "quick-start-signin-button"};
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 69e047e..a7cbb88 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -3380,7 +3380,7 @@ { "name": "enable-save-to-photos", "owners": [ "qpubert@google.com", "djean@google.com", "bling-flags@google.com" ], - "expiry_milestone": 121 + "expiry_milestone": 123 }, { "name": "enable-seamless-refresh-rate-switching",
diff --git a/chrome/browser/password_manager/android/BUILD.gn b/chrome/browser/password_manager/android/BUILD.gn index 2358172..7bc88d54 100644 --- a/chrome/browser/password_manager/android/BUILD.gn +++ b/chrome/browser/password_manager/android/BUILD.gn
@@ -125,8 +125,11 @@ "//chrome/browser/settings:java", "//chrome/browser/signin/services/android:java", "//chrome/browser/sync/android:java", + "//chrome/browser/ui/android/strings:ui_strings_grd", "//components/browser_ui/notifications/android:java", "//components/browser_ui/settings/android:java", + "//components/browser_ui/settings/android:managed_prefs_java_resources", + "//components/browser_ui/widget/android:java", "//components/browser_ui/widget/android:java_resources", "//components/device_reauth:device_reauth_java_enums", "//components/password_manager/core/browser:password_manager_java_enums", @@ -141,6 +144,7 @@ "//third_party/androidx:androidx_appcompat_appcompat_java", "//third_party/androidx:androidx_core_core_java", "//third_party/androidx:androidx_fragment_fragment_java", + "//third_party/androidx:androidx_preference_preference_java", "//third_party/jni_zero:jni_zero_java", "//ui/android:ui_no_recycler_view_java", "//url:gurl_java", @@ -175,6 +179,7 @@ "java/src/org/chromium/chrome/browser/password_manager/settings/PasswordAccessReauthenticationHelper.java", "java/src/org/chromium/chrome/browser/password_manager/settings/PasswordListObserver.java", "java/src/org/chromium/chrome/browser/password_manager/settings/PasswordReauthenticationFragment.java", + "java/src/org/chromium/chrome/browser/password_manager/settings/PasswordsPreference.java", "java/src/org/chromium/chrome/browser/password_manager/settings/ReauthenticationManager.java", "java/src/org/chromium/chrome/browser/password_manager/settings/SingleThreadBarrierClosure.java", "java/src/org/chromium/chrome/browser/password_manager/settings/TimedCallbackDelayer.java",
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackend.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackend.java index d2eed484..ab81923 100644 --- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackend.java +++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordStoreAndroidBackend.java
@@ -131,20 +131,19 @@ * includes credential sharing affiliation and grouping affiliation. * * @param signonRealm Signon realm string matched by a substring match. The returned results - * must be validated (e.g matching "sample.com" also returns logins for "not-sample.com"). + * must be validated (e.g matching "sample.com" also returns logins for "not-sample.com"). * @param syncingAccount Account used to sync passwords. If the syncingAccount is empty local - * account will be used. + * account will be used. * @param loginsReply Callback that is called on success with serialized {@link - * org.chromium.components.password_manager.core.browser.proto.ListAffiliatedPasswordsResult} - * data. + * org.chromium.components.password_manager.core.browser.proto.ListAffiliatedPasswordsResult} + * data. * @param failureCallback A callback that is called on failure for any reason. May return sync. - * TODO(crbug.com/1428539): Remove default keyword after downstream implementation. */ - default void getAffiliatedLoginsForSignonRealm( + void getAffiliatedLoginsForSignonRealm( String signonRealm, Optional<Account> syncingAccount, Callback<byte[]> loginsReply, - Callback<Exception> failureCallback) {} + Callback<Exception> failureCallback); /** * Triggers an async call to add a login to the store.
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordsPreference.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordsPreference.java new file mode 100644 index 0000000..bc5099f --- /dev/null +++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordsPreference.java
@@ -0,0 +1,61 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.password_manager.settings; + +import android.content.Context; +import android.util.AttributeSet; + +import androidx.preference.PreferenceViewHolder; + +import org.chromium.chrome.browser.preferences.Pref; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.settings.ProfileDependentSetting; +import org.chromium.components.browser_ui.settings.ChromeBasePreference; +import org.chromium.components.browser_ui.widget.text.TextViewWithCompoundDrawables; +import org.chromium.components.prefs.PrefService; +import org.chromium.components.user_prefs.UserPrefs; + +/** + * Password manager preference to be displayed in the main settings screen. A custom implementation + * is used so that the password manager entry point displays custom strings when saving passwords is + * enabled/disabled by policy. + */ +public class PasswordsPreference extends ChromeBasePreference implements ProfileDependentSetting { + private Profile mProfile; + + /** Constructor for inflating from XML. */ + public PasswordsPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public void setProfile(Profile profile) { + mProfile = profile; + } + + @Override + public void onBindViewHolder(PreferenceViewHolder holder) { + super.onBindViewHolder(holder); + // This preference is the only one of its type in the preferences group so it will not + // be recycled. + PrefService prefService = UserPrefs.get(mProfile); + if (!prefService.isManagedPreference(Pref.CREDENTIALS_ENABLE_SERVICE)) { + return; + } + + TextViewWithCompoundDrawables managedDisclaimerView = + holder.itemView.findViewById( + org.chromium.components.browser_ui.settings.R.id.managed_disclaimer_text); + assert managedDisclaimerView != null; + boolean offerToSavePasswords = + UserPrefs.get(mProfile).getBoolean(Pref.CREDENTIALS_ENABLE_SERVICE); + managedDisclaimerView.setText( + offerToSavePasswords + ? org.chromium.chrome.browser.password_manager.R.string + .password_saving_on_by_administrator + : org.chromium.chrome.browser.password_manager.R.string + .password_saving_off_by_administrator); + } +}
diff --git a/chrome/browser/password_manager/android/pwd_migration/BUILD.gn b/chrome/browser/password_manager/android/pwd_migration/BUILD.gn index 32e02ae6..1cb968d 100644 --- a/chrome/browser/password_manager/android/pwd_migration/BUILD.gn +++ b/chrome/browser/password_manager/android/pwd_migration/BUILD.gn
@@ -16,7 +16,6 @@ "//chrome/browser/signin/services/android:java", "//chrome/browser/sync/android:java", "//chrome/browser/ui/android/signin:java", - "//chrome/browser/ui/android/strings:ui_strings_grd", "//components/browser_ui/bottomsheet/android:java", "//components/browser_ui/settings/android:java", "//components/browser_ui/widget/android:java",
diff --git a/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakePasswordStoreAndroidBackend.java b/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakePasswordStoreAndroidBackend.java index 9ee48751..3d5a3356 100644 --- a/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakePasswordStoreAndroidBackend.java +++ b/chrome/browser/password_manager/android/test_support/java/src/org/chromium/chrome/browser/password_manager/FakePasswordStoreAndroidBackend.java
@@ -13,6 +13,8 @@ import org.chromium.base.task.PostTask; import org.chromium.base.task.SequencedTaskRunner; import org.chromium.base.task.TaskTraits; +import org.chromium.components.password_manager.core.browser.proto.ListAffiliatedPasswordsResult; +import org.chromium.components.password_manager.core.browser.proto.ListAffiliatedPasswordsResult.AffiliatedPassword; import org.chromium.components.password_manager.core.browser.proto.ListPasswordsResult; import org.chromium.components.password_manager.core.browser.proto.PasswordWithLocalData; import org.chromium.components.sync.protocol.PasswordSpecificsData; @@ -129,6 +131,34 @@ } @Override + public void getAffiliatedLoginsForSignonRealm( + String signonRealm, + Optional<Account> syncingAccount, + Callback<byte[]> loginsReply, + Callback<Exception> failureCallback) { + mTaskRunner.postTask( + () -> { + Account account = getAccountOrFail(syncingAccount, failureCallback); + if (account == null) return; + List<PasswordWithLocalData> filteredPasswords = + filterPasswords( + mSavedPasswords.get(account), + pwd -> hasSignonRealm(pwd, signonRealm)); + List<AffiliatedPassword> affiliatedPasswords = new ArrayList<>(); + for (PasswordWithLocalData password : filteredPasswords) { + affiliatedPasswords.add( + AffiliatedPassword.newBuilder().setPasswordData(password).build()); + } + + ListAffiliatedPasswordsResult allAffiliatedLogins = + ListAffiliatedPasswordsResult.newBuilder() + .addAllAffiliatedPasswords(affiliatedPasswords) + .build(); + loginsReply.onResult(allAffiliatedLogins.toByteArray()); + }); + } + + @Override public void addLogin( byte[] pwdWithLocalData, Optional<Account> syncingAccount,
diff --git a/chrome/browser/plugins/plugin_prefs.cc b/chrome/browser/plugins/plugin_prefs.cc index 0b622ab..ddb0b92e 100644 --- a/chrome/browser/plugins/plugin_prefs.cc +++ b/chrome/browser/plugins/plugin_prefs.cc
@@ -6,6 +6,7 @@ #include <stddef.h> +#include <memory> #include <string> #include "base/files/file_path.h" @@ -17,6 +18,7 @@ #include "chrome/common/chrome_content_client.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" +#include "components/prefs/pref_change_registrar.h" #include "content/public/browser/plugin_service.h" #include "content/public/common/webplugininfo.h" @@ -65,15 +67,16 @@ prefs_ = prefs; UpdatePdfPolicy(prefs::kPluginsAlwaysOpenPdfExternally); - registrar_.Init(prefs_); - registrar_.Add(prefs::kPluginsAlwaysOpenPdfExternally, - base::BindRepeating(&PluginPrefs::UpdatePdfPolicy, - base::Unretained(this))); + registrar_ = std::make_unique<PrefChangeRegistrar>(); + registrar_->Init(prefs_); + registrar_->Add(prefs::kPluginsAlwaysOpenPdfExternally, + base::BindRepeating(&PluginPrefs::UpdatePdfPolicy, + base::Unretained(this))); } void PluginPrefs::ShutdownOnUIThread() { prefs_ = nullptr; - registrar_.RemoveAll(); + registrar_.reset(); profile_ = nullptr; }
diff --git a/chrome/browser/plugins/plugin_prefs.h b/chrome/browser/plugins/plugin_prefs.h index 3f5afbf..2f271ba 100644 --- a/chrome/browser/plugins/plugin_prefs.h +++ b/chrome/browser/plugins/plugin_prefs.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_PLUGINS_PLUGIN_PREFS_H_ #define CHROME_BROWSER_PLUGINS_PLUGIN_PREFS_H_ +#include <memory> #include <string> #include "base/memory/raw_ptr.h" @@ -78,7 +79,7 @@ // Weak pointer, owned by the profile. raw_ptr<PrefService> prefs_ = nullptr; - PrefChangeRegistrar registrar_; + std::unique_ptr<PrefChangeRegistrar> registrar_; }; #endif // CHROME_BROWSER_PLUGINS_PLUGIN_PREFS_H_
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn index 83375cf..592a6f2 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn
@@ -41,7 +41,6 @@ "../common/automation_predicate.js", "../common/async_util.js", "../common/browser_util.js", - "../common/cursors/cursor.js", "../common/key_code.js", "../common/local_storage.js", "../common/rect_util.js",
diff --git a/chrome/browser/resources/chromeos/accessibility/common/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/common/BUILD.gn index 980e0a2..dca826d 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/common/BUILD.gn
@@ -29,7 +29,6 @@ "async_util.js", "automation_predicate.js", "browser_util.js", - "cursors/cursor.js", "event_handler.js", "gdocs_script.js", "key_code.js", @@ -48,6 +47,7 @@ "array_util.ts", "chrome_event_handler.ts", "constants.ts", + "cursors/cursor.ts", "cursors/range.ts", "cursors/recovery_strategy.ts", "event_generator.ts",
diff --git a/chrome/browser/resources/chromeos/accessibility/common/cursors/cursor.js b/chrome/browser/resources/chromeos/accessibility/common/cursors/cursor.ts similarity index 76% rename from chrome/browser/resources/chromeos/accessibility/common/cursors/cursor.js rename to chrome/browser/resources/chromeos/accessibility/common/cursors/cursor.ts index 5296839..9495c99 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/cursors/cursor.js +++ b/chrome/browser/resources/chromeos/accessibility/common/cursors/cursor.ts
@@ -15,10 +15,10 @@ import {AncestryRecoveryStrategy, RecoveryStrategy} from './recovery_strategy.js'; -const AutomationNode = chrome.automation.AutomationNode; -const Dir = constants.Dir; -const RoleType = chrome.automation.RoleType; -const StateType = chrome.automation.StateType; +import AutomationNode = chrome.automation.AutomationNode; +import Dir = constants.Dir; +import RoleType = chrome.automation.RoleType; +import StateType = chrome.automation.StateType; /** * The special index that represents a cursor pointing to a node without @@ -26,72 +26,73 @@ */ export const CURSOR_NODE_INDEX = -1; -/** - * Represents units of CursorMovement. - * @enum {string} - */ -export const CursorUnit = { +/** Represents units of CursorMovement. */ +export enum CursorUnit { /** A single character within accessible name or value. */ - CHARACTER: 'character', + CHARACTER = 'character', /** A range of characters (given by attributes on automation nodes). */ - WORD: 'word', + WORD = 'word', /** A text node. */ - TEXT: 'text', + TEXT = 'text', /** A leaf node. */ - NODE: 'node', + NODE = 'node', /** A leaf node for guesture navigation. */ - GESTURE_NODE: 'gesture_node', + GESTURE_NODE = 'gesture_node', /** * A node or in line textbox that immediately precedes or follows a visual * line break. */ - LINE: 'line', -}; + LINE = 'line', +} -/** - * Represents the ways in which cursors can move given a cursor unit. - * @enum {string} - */ -export const CursorMovement = { +/** Represents the ways in which cursors can move given a cursor unit. */ +export enum CursorMovement { /** Move to the beginning or end of the current unit. */ - BOUND: 'bound', + BOUND = 'bound', /** Move to the next unit in a particular direction. */ - DIRECTIONAL: 'directional', + DIRECTIONAL = 'directional', /** * Move to the beginning or end of the current cursor. Only supports * Unit.CHARACTER and Unit.WORD */ - SYNC: 'sync', -}; + SYNC = 'sync', +} /** * Represents a position within the automation tree. */ export class Cursor { + private index_: number; + private recovery_: RecoveryStrategy; + private wrapped_: boolean; + /** - * @param {!AutomationNode} node - * @param {number} index A 0-based index into this cursor node's primary + * @param index A 0-based index into this cursor node's primary * accessible name. An index of |CURSOR_NODE_INDEX| means the node as a * whole is pointed to and covers the case where the accessible text is * empty. - * @param {{wrapped: (boolean|undefined), - * preferNodeStartEquivalent: (boolean|undefined)}} args + * @param args * wrapped: determines whether this cursor wraps when moved beyond a * document boundary. * preferNodeStartEquivalent: When true,moves this cursor to the start of * the next node when it points to the end of the current node. */ - constructor(node, index, args = {}) { + constructor(node: AutomationNode, index: number, args: { + wrapped?: boolean, + preferNodeStartEquivalent?: boolean, + } = {}) { // Compensate for specific issues in Blink. // TODO(dtseng): Pass through affinity; if upstream, skip below. - if (node.role === RoleType.STATIC_TEXT && node.name.length === index && + // TODO(b/314203187): Not null asserted, check these to make sure this is + // correct. + if (node.role === RoleType.STATIC_TEXT && node.name!.length === index && !args.preferNodeStartEquivalent) { // Re-interpret this case as the beginning of the next node. const nextNode = AutomationUtil.findNextNode( @@ -106,29 +107,20 @@ } } - /** @type {number} @private */ this.index_ = index; - /** @type {RecoveryStrategy} */ this.recovery_ = new AncestryRecoveryStrategy(node); - /** @private {boolean} */ this.wrapped_ = args.wrapped || false; } - /** - * Convenience method to construct a Cursor from a node. - * @param {!AutomationNode} node - * @return {!Cursor} - */ - static fromNode(node) { + /** Convenience method to construct a Cursor from a node. */ + static fromNode(node: AutomationNode): Cursor { return new Cursor(node, CURSOR_NODE_INDEX); } /** * Gives a function that returns true for leaf types for |unit| navigations. - * @param {!CursorUnit} unit - * @return {AutomationPredicate.Unary} */ - static getLeafPredForUnit(unit) { + static getLeafPredForUnit(unit: CursorUnit): AutomationPredicate.Unary { switch (unit) { case CursorUnit.TEXT: return AutomationPredicate.leaf; @@ -142,14 +134,12 @@ /** * Returns true if |rhs| is equal to this cursor. * Use this for strict equality between cursors. - * @param {!Cursor} rhs - * @return {boolean} */ - equals(rhs) { + equals(rhs: Cursor): boolean { return this.node === rhs.node && this.index === rhs.index; } - equalsWithoutRecovery(rhs) { + equalsWithoutRecovery(rhs: Cursor): boolean { return this.recovery_.equalsWithoutRecovery(rhs.recovery_); } @@ -158,14 +148,12 @@ * Use this for loose equality between cursors where specific * character-based indicies do not matter such as when processing * node-targeted events. - * @param {!Cursor} rhs - * @return {boolean} */ - contentEquals(rhs) { + contentEquals(rhs: Cursor): boolean { // First, normalize the two nodes so they both point to the first non-text // node. - let lNode = this.node; - let rNode = rhs.node; + let lNode: AutomationNode|undefined = this.node; + let rNode: AutomationNode|undefined = rhs.node; while (lNode && (lNode.role === RoleType.INLINE_TEXT_BOX || lNode.role === RoleType.STATIC_TEXT)) { @@ -184,11 +172,10 @@ /** * Compares this cursor with |rhs|. - * @param {Cursor} rhs * @return Dir.BACKWARD if |rhs| comes before this cursor in * document order. Forward otherwise. */ - compare(rhs) { + compare(rhs: Cursor): Dir { if (!this.node || !rhs.node) { return Dir.FORWARD; } @@ -202,9 +189,8 @@ /** * Returns the node. If the node is invalid since the last time it * was accessed, moves the cursor to the nearest valid ancestor first. - * @return {!AutomationNode} */ - get node() { + get node(): AutomationNode { if (this.requiresRecovery()) { // If we need to recover, the index is no longer valid. this.index_ = CURSOR_NODE_INDEX; @@ -212,18 +198,12 @@ return this.recovery_.node; } - /** - * @return {number} - */ - get index() { + get index(): number { return this.index_; } - /** - * A node appropriate for making selections. - * @return {AutomationNode} - */ - get selectionNode() { + /** A node appropriate for making selections. */ + get selectionNode(): AutomationNode { // TODO(accessibility): figure out if we still need the above property. return this.node; } @@ -232,35 +212,28 @@ * An index appropriate for making selections. If this cursor has a * CURSOR_NODE_INDEX index, the selection index is a node offset e.g. the * index in parent. If not, the index is a character offset. - * @return {number} */ - get selectionIndex() { + get selectionIndex(): number { return this.index_ === CURSOR_NODE_INDEX ? 0 : this.index_; } - /** - * Gets the accessible text of the node associated with this cursor. - * @return {string} - */ - getText() { + /** Gets the accessible text of the node associated with this cursor. */ + getText(): string { return AutomationUtil.getText(this.node); } /** * Makes a Cursor which has been moved from this cursor by the unit in the * given direction using the given movement type. - * @param {CursorUnit} unit - * @param {CursorMovement} movement - * @param {constants.Dir} dir - * @return {!Cursor} The moved cursor. + * @return The moved cursor. */ - move(unit, movement, dir) { + move(unit: CursorUnit, movement: CursorMovement, dir: constants.Dir): Cursor { const originalNode = this.node; if (!originalNode) { return this; } - let newNode = originalNode; + let newNode: AutomationNode|null = originalNode; let newIndex = this.index_; switch (unit) { @@ -341,10 +314,12 @@ } let start; let end; - for (let i = 0; i < wordStarts.length; i++) { - if (newIndex >= wordStarts[i] && newIndex < wordEnds[i]) { - start = wordStarts[i]; - end = wordEnds[i]; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // they are correct. + for (let i = 0; i < wordStarts!.length; i++) { + if (newIndex >= wordStarts![i] && newIndex < wordEnds![i]) { + start = wordStarts![i]; + end = wordEnds![i]; break; } } @@ -352,6 +327,7 @@ newIndex = dir === Dir.FORWARD ? end : start; } } break; + // @ts-expect-error Fallthrough case in switch case CursorMovement.SYNC: if (newIndex === CURSOR_NODE_INDEX) { newIndex = dir === Dir.FORWARD ? firstWordStart - 1 : @@ -370,10 +346,12 @@ wordEnds = newNode.nonInlineTextWordEnds; } // Go to the next word stop in the same piece of text. - for (let i = 0; i < wordStarts.length; i++) { - if ((dir === Dir.FORWARD && newIndex < wordStarts[i]) || - (dir === Dir.BACKWARD && newIndex >= wordEnds[i])) { - start = wordStarts[i]; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // they are correct. + for (let i = 0; i < wordStarts!.length; i++) { + if ((dir === Dir.FORWARD && newIndex < wordStarts![i]) || + (dir === Dir.BACKWARD && newIndex >= wordEnds![i])) { + start = wordStarts![i]; if (dir === Dir.FORWARD) { break; } @@ -389,9 +367,11 @@ // The backward case is special at the beginning of nodes. newIndex = firstWordStart; } else { + // TODO(b/314203187): Not null asserted, check these to make + // sure this is correct. newNode = AutomationUtil.findNextNode( newNode, dir, AutomationPredicate.leafWithWordStop, - {root: r => r === newNode.root}); + {root: r => r === newNode!.root}); if (newNode) { let starts; if (newNode.role === RoleType.INLINE_TEXT_BOX) { @@ -399,10 +379,12 @@ } else { starts = newNode.nonInlineTextWordStarts; } - if (starts.length) { + // TODO(b/314203187): Not nulls asserted, check these to make + // sure they are correct. + if (starts!.length) { newIndex = dir === Dir.BACKWARD ? - starts[starts.length - 1] : - starts[0]; + starts![starts!.length - 1] : + starts![0]; } } } @@ -454,26 +436,29 @@ /** * Returns the deepest equivalent cursor. - * @return {!Cursor} */ - get deepEquivalent() { + get deepEquivalent(): Cursor { let newNode = this.node; let newIndex = this.index_; let isTextIndex = false; while (newNode.firstChild) { + // TODO(b/314203187): Not nulls asserted, check these to make sure this is + // correct. if (AutomationPredicate.editText(newNode) && - !newNode.state[StateType.MULTILINE]) { + !newNode.state![StateType.MULTILINE]) { // Do not reinterpret nodes and indices on this node. break; } else if (newNode.role === RoleType.STATIC_TEXT) { // Text offset. // Re-interpret the index as an offset into an inlineTextBox. isTextIndex = true; - let target = newNode.firstChild; + let target: AutomationNode|undefined = newNode.firstChild; let length = 0; while (target && length < newIndex) { - const newLength = length + target.name.length; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // this is correct. + const newLength = length + target.name!.length; // Either |newIndex| falls between target's text or |newIndex| is // the total length of all sibling text content. @@ -495,8 +480,10 @@ // editable should be treated as a child offset. // However, an index inside a simple editable, such as an input // element, should be treated as a character offset. - (!newNode.state[StateType.EDITABLE] || - newNode.state[StateType.RICHLY_EDITABLE]) && + // TODO(b/314203187): Not nulls asserted, check these to make sure + // they are correct. + (!newNode.state![StateType.EDITABLE] || + newNode.state![StateType.RICHLY_EDITABLE]) && newIndex <= newNode.children.length) { // Valid child node offset. Note that there is a special case where // |newIndex == node.children.length|. In these cases, we actually @@ -505,11 +492,15 @@ // |newIndex| is assumed to be > 0. if (newIndex === newNode.children.length) { // Take the last child. - newNode = newNode.lastChild; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // this is correct. + newNode = newNode.lastChild!; // The |newIndex| is either a text offset or a child offset. if (newNode.role === RoleType.STATIC_TEXT) { - newIndex = newNode.name.length; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // this is correct. + newIndex = newNode.name!.length; isTextIndex = true; break; } @@ -534,7 +525,9 @@ let targetIndex = 0; let cur = 0; while (walker.next().node) { - const line = walker.node; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // this is correct. + const line = walker.node!; const lineLength = line.name ? line.name.length : 1; cur += lineLength; if (cur > newIndex) { @@ -554,9 +547,14 @@ while (targetLine && targetLine.lastChild) { targetLine = targetLine.lastChild; } - targetIndex = targetLine ? targetLine.name.length : CURSOR_NODE_INDEX; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // this is correct. + targetIndex = + targetLine ? targetLine.name!.length : CURSOR_NODE_INDEX; } - newNode = targetLine; + // TODO(b/314203187): Not nulls asserted, check these to make sure this + // is correct. + newNode = targetLine!; newIndex = targetIndex; break; } @@ -565,22 +563,16 @@ newIndex = CURSOR_NODE_INDEX; } - return new this.constructor(newNode, newIndex); + return new Cursor(newNode, newIndex); } - /** - * Returns whether this cursor points to a valid position. - * @return {boolean} - */ - isValid() { + /** Returns whether this cursor points to a valid position. */ + isValid(): boolean { return this.node != null; } - /** - * Returns true if this cursor requires recovery. - * @return {boolean} - */ - requiresRecovery() { + /** Returns true if this cursor requires recovery. */ + requiresRecovery(): boolean { return this.recovery_.requiresRecovery(); } @@ -588,43 +580,36 @@ * Returns true if this cursor was created after wrapping. For example, moving * from a cursor at the end of a web contents to [this] range at the beginning * of the document. - * @return {boolean} */ - get wrapped() { + get wrapped(): boolean { return this.wrapped_; } } /** - * A Cursor that wraps from beginning to end and vice versa when - * moved. + * A Cursor that wraps from beginning to end and vice versa when moved. */ export class WrappingCursor extends Cursor { /** - * @param {!AutomationNode} node - * @param {number} index A 0-based index into this cursor node's primary - * accessible name. An index of |CURSOR_NODE_INDEX| means the node as a - * whole is pointed to and covers the case where the accessible text is - * empty. - * @param {{wrapped: (boolean|undefined)}} args + * @param index A 0-based index into this cursor node's primary accessible + * name. An index of |CURSOR_NODE_INDEX| means the node as a whole is pointed + * to and covers the case where the accessible text is empty. */ - constructor(node, index, args = {}) { + constructor(node: AutomationNode, index: number, args: { + wrapped?: boolean, + } = {}) { super(node, index, args); } - /** - * Convenience method to construct a Cursor from a node. - * @param {!AutomationNode} node - * @return {!WrappingCursor} - */ - static fromNode(node) { + /** Convenience method to construct a Cursor from a node. */ + static override fromNode(node: AutomationNode): WrappingCursor { return new WrappingCursor(node, CURSOR_NODE_INDEX); } - /** @override */ - move(unit, movement, dir) { - let result = this; + override move(unit: CursorUnit, movement: CursorMovement, dir: constants.Dir): + Cursor { + let result: Cursor = this; if (!result.node) { return this; } @@ -655,10 +640,11 @@ } // Finds any explicitly provided focus. - const getDirectedFocus = function(node) { - return dir === Dir.FORWARD ? node.nextWindowFocus : - node.previousWindowFocus; - }; + const getDirectedFocus = function(node: AutomationNode): AutomationNode| + undefined { + return dir === Dir.FORWARD ? node.nextWindowFocus : + node.previousWindowFocus; + }; // Case 1: forwards (find the root-like node). let directedFocus;
diff --git a/chrome/browser/resources/chromeos/accessibility/common/cursors/range.ts b/chrome/browser/resources/chromeos/accessibility/common/cursors/range.ts index f0ace17..1d1cc548 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/cursors/range.ts +++ b/chrome/browser/resources/chromeos/accessibility/common/cursors/range.ts
@@ -214,8 +214,10 @@ // Richly editables should always set a caret, but not select. This // makes it possible to navigate through content editables using // ChromeVox keys and not hear selections as you go. - if (startNode.state[StateType.RICHLY_EDITABLE] || - endNode.state[StateType.RICHLY_EDITABLE]) { + // TODO(b/314203187): Not nulls asserted, check these to make sure they + // are correct. + if (startNode.state![StateType.RICHLY_EDITABLE] || + endNode.state![StateType.RICHLY_EDITABLE]) { endIndex = startIndex; } @@ -240,15 +242,17 @@ case CursorUnit.WORD: let startCursor = this.start; if (!AutomationPredicate.leafWithWordStop(startCursor.node)) { - let startNode = startCursor.node; + let startNode: AutomationNode|null = startCursor.node; + // TODO(b/314203187): Not nulls asserted, check these to make sure + // they are correct. if (dir === constants.Dir.FORWARD) { startNode = AutomationUtil.findNextNode( - startNode, constants.Dir.FORWARD, + startNode!, constants.Dir.FORWARD, AutomationPredicate.leafWithWordStop, {skipInitialSubtree: false}); } else { startNode = AutomationUtil.findNodePost( - startNode, dir, AutomationPredicate.leafWithWordStop); + startNode!, dir, AutomationPredicate.leafWithWordStop); } if (!startNode) { return null; @@ -304,9 +308,11 @@ /** Returns true if this range has either cursor end on web content. */ isWebRange(): boolean { + // TODO(b/314203187): Not nulls asserted, check these to make sure they + // are correct. return this.isValid() && - (this.start.node.root.role !== RoleType.DESKTOP || - this.end.node.root.role !== RoleType.DESKTOP); + (this.start.node.root!.role !== RoleType.DESKTOP || + this.end.node.root!.role !== RoleType.DESKTOP); } /** Returns whether this range has valid start and end cursors. */
diff --git a/chrome/browser/resources/chromeos/login/debug/debug.js b/chrome/browser/resources/chromeos/login/debug/debug.js index c1ea3a2..da36fa2 100644 --- a/chrome/browser/resources/chromeos/login/debug/debug.js +++ b/chrome/browser/resources/chromeos/login/debug/debug.js
@@ -1841,7 +1841,7 @@ id: 'quick-start', kind: ScreenKind.NORMAL, handledSteps: - 'verification,connecting_to_wifi,gaia_credentials,fido_assertion_received', + 'verification,connecting_to_wifi,signing_in', states: [ { id: 'PinVerification', @@ -1863,15 +1863,19 @@ }, }, { - id: 'TransferringGaiaCreds', + id: 'SigninInEmailOnly', trigger: (screen) => { - screen.showTransferringGaiaCredentials(); + screen.showSigningInStep(); + screen.setUserEmail('test_email@gmail.com'); }, }, { - id: 'TransferredGaiaCreds', + id: 'SigninInFullAvatar', trigger: (screen) => { - screen.showFidoAssertionReceived('testUser@gmail.com'); + screen.showSigningInStep(); + screen.setUserEmail('test_email@gmail.com'); + screen.setUserFullName('Test User'); + screen.setUserAvatarUrl('https://lh3.googleusercontent.com/a/ACg8ocISjvU-p0Gz_kIBamP3jit_Y8PrQVU4AbIvQrUEZ04d=s96-c'); }, }, ],
diff --git a/chrome/browser/resources/chromeos/login/login.gni b/chrome/browser/resources/chromeos/login/login.gni index 2cd81c01..e7ca9655 100644 --- a/chrome/browser/resources/chromeos/login/login.gni +++ b/chrome/browser/resources/chromeos/login/login.gni
@@ -78,7 +78,7 @@ ] oobe_screens_js_files = [ - "screens/oobe/auto_enrollment_check.js", + "screens/oobe/auto_enrollment_check.ts", "screens/oobe/consumer_update.js", "screens/oobe/demo_preferences.ts", "screens/oobe/demo_setup.ts",
diff --git a/chrome/browser/resources/chromeos/login/screens/common/quick_start.html b/chrome/browser/resources/chromeos/login/screens/common/quick_start.html index 547c9124..49c2401 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/quick_start.html +++ b/chrome/browser/resources/chromeos/login/screens/common/quick_start.html
@@ -58,6 +58,53 @@ padding-bottom: 24px; } + #userInfo { + border: solid 1px var(--cros-sys-separator); + border-radius: 12px; + height: 32px; + margin-top: 16px; + padding: 16px 20px; + } + + #avatarWebview { + user-select: none; + } + + #accountIcon { + width: 32px; + height: 32px; + } + + #userPictureHolder { + height: 32px; + width: 32px; + margin: auto; + user-select: none; + } + + #userNameHolder { + padding-inline-start: 16px; + } + + #userFullName { + font-weight: 500; + line-height: 24px; + } + + #userEmail { + font-weight: 400; + line-height: 20px; + } + + #userEmailOnlyDiv { + line-height: 18px; + font-weight: 400; + } + + #spinner { + height: 95%; + } + #qrCodeWrapper { position: relative; width: 100%; @@ -149,29 +196,6 @@ <iron-icon slot="icon" icon="oobe-20:quick-start-wifi"> </iron-icon> </oobe-loading-dialog> -<!-- DEBUG ONLY - CONNECTED TO WIFI --> -<oobe-adaptive-dialog for-step="connected_to_wifi"> - <iron-icon slot="icon" icon="oobe-20:quick-start-wifi"> - </iron-icon> - <h1 slot="title"> - [DEBUG] Connected to WiFi - </h1> - <div slot="content" class="flex layout vertical center center-justified"> - <div> - SSID: [[ssid_]] - </div> - <div> - Password: [[password_]] - </div> - <div> - Click on the Next button to continue the flow. - </div> - </div> - <div slot="bottom-buttons"> - <oobe-next-button id="wifiConnected" on-click="onWifiConnectedNextClicked_"> - </oobe-next-button> - </div> -</oobe-adaptive-dialog> <!-- CONFIRM GOOGLE ACCOUNT --> <oobe-adaptive-dialog id="confirmAccountDialog" for-step="confirm_google_account"> <iron-icon slot="icon" icon="oobe-32:googleg"> @@ -192,35 +216,39 @@ </oobe-text-button> </div> </oobe-adaptive-dialog> -<!-- TRANSFERRING GAIA CREDENTIALS --> -<oobe-loading-dialog id="gaiaTransferDialog" for-step="gaia_credentials" - title-key="quickStartAccountTransferTitle" - subtitle-key="quickStartAccountTransferSubtitle" - on-cancel-loading="onCancelClicked_" can-cancel> - <iron-icon slot="icon" icon="oobe-32:googleg"> - </iron-icon> -</oobe-loading-dialog> -<!-- DEBUG ONLY - GAIA CREDENTIALS --> -<oobe-adaptive-dialog for-step="fido_assertion_received"> +<!-- SIGNING IN STEP --> +<oobe-adaptive-dialog for-step="signing_in" id="gaiaTransferDialog"> <iron-icon slot="icon" icon="oobe-32:googleg"> </iron-icon> <h1 slot="title"> - [DEBUG] [[i18nDynamic(locale, 'quickStartAccountTransferTitle')]] + [[i18nDynamic(locale, 'quickStartAccountTransferTitle')]] </h1> <div slot="subtitle"> - [[i18nDynamic(locale, 'quickStartAccountTransferSubtitle')]] + <!-- Email only --> + <div id="userEmailOnlyDiv" hidden="[[userAvatarUrl_]]">[[userEmail_]]</div> + <!-- Full Avatar --> + <div id="userInfo" class="flex layout horizontal" hidden="[[!userAvatarUrl_]]"> + <div id="userPictureHolder"> + <webview role="img" class="avatar-icon" allowtransparency + id="avatarWebview" + src="[[getWrappedAvatar_(userAvatarUrl_)]]" + aria-hidden="true" tabindex="-1"> + </webview> + </div> + <div class="flex layout vertical center-justified" id="userNameHolder"> + <div id="userFullName">[[userFullName_]]</div> + <div id="userEmail">[[userEmail_]]</div> + </div> + </div> </div> <div slot="content" class="flex layout vertical center center-justified"> - <div> - Received FIDO assertion & Refresh token! - </div> - <div> - Email: [[fidoAssertionEmail_]] - </div> + <oobe-cr-lottie id="spinner" hide-play-pause-icon + animation-url="../../animations/spinner.json"> + </oobe-cr-lottie> </div> <div slot="bottom-buttons"> <oobe-text-button id="cancelButton" on-click="onCancelClicked_" - text-key="cancelButton"> + text-key="cancelButton" hidden="[[!canCancelSignin_]]"> </oobe-text-button> </div> </oobe-adaptive-dialog>
diff --git a/chrome/browser/resources/chromeos/login/screens/common/quick_start.js b/chrome/browser/resources/chromeos/login/screens/common/quick_start.js index c78ab1a2d..273d1840 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/quick_start.js +++ b/chrome/browser/resources/chromeos/login/screens/common/quick_start.js
@@ -35,8 +35,7 @@ CONNECTING_TO_WIFI: 'connecting_to_wifi', CONNECTED_TO_WIFI: 'connected_to_wifi', CONFIRM_GOOGLE_ACCOUNT: 'confirm_google_account', - GAIA_CREDENTIALS: 'gaia_credentials', - FIDO_ASSERTION_RECEIVED: 'fido_assertion_received', + SIGNING_IN: 'signing_in', }; /** @@ -63,12 +62,6 @@ static get properties() { return { - shapes_: { - type: Object, - // Should be in sync with the C++ enum (ash::quick_start::Shape). - value: {CIRCLE: 0, DIAMOND: 1, TRIANGLE: 2, SQUARE: 3}, - readOnly: true, - }, discoverableName_: { type: String, value: '', @@ -82,10 +75,23 @@ type: Boolean, value: false, }, - fidoAssertionEmail_: { + userEmail_: { type: String, value: '', }, + userFullName_: { + type: String, + value: '', + }, + userAvatarUrl_: { + type: String, + value: '', + }, + // Once account creation starts, it is no longer possible to cancel. + canCancelSignin_: { + type: Boolean, + value: true, + }, }; } @@ -104,8 +110,11 @@ 'showConnectingToWifi', 'setDiscoverableName', 'showConfirmGoogleAccount', - 'showTransferringGaiaCredentials', - 'showFidoAssertionReceived', + 'showSigningInStep', + 'showCreatingAccountStep', + 'setUserEmail', + 'setUserFullName', + 'setUserAvatarUrl', ]; } @@ -125,6 +134,10 @@ this.qrCodeCanvas = new QrCodeCanvas(this.getCanvas_()); } + onBeforeHide() { + this.$.spinner.playing = false; + } + /** @override */ defaultUIStep() { return QuickStartUIState.LOADING; @@ -160,19 +173,58 @@ this.setUIStep(QuickStartUIState.CONFIRM_GOOGLE_ACCOUNT); } - showTransferringGaiaCredentials() { - this.setUIStep(QuickStartUIState.GAIA_CREDENTIALS); + showSigningInStep() { + this.setUIStep(QuickStartUIState.SIGNING_IN); + this.$.spinner.playing = true; } - showFidoAssertionReceived(email) { - this.fidoAssertionEmail_ = email; - this.setUIStep(QuickStartUIState.FIDO_ASSERTION_RECEIVED); + showCreatingAccountStep() { + // Same UI as 'Signing in...' but without a cancel button. + this.setUIStep(QuickStartUIState.SIGNING_IN); + this.canCancelSignin_ = false; + } + + setUserEmail(email) { + this.userEmail_ = email; + } + + setUserFullName(userFullName) { + this.userFullName_ = userFullName; + } + + setUserAvatarUrl(userAvatarUrl) { + this.userAvatarUrl_ = userAvatarUrl; } getCanvas_() { return this.shadowRoot.querySelector('#qrCodeCanvas'); } + /** + * Wrap the user avatar as an image into a html snippet. + * + * @param {string} avatarUri the icon uri to be wrapped. + * @return {string} wrapped html snippet. + * + * @private + */ + getWrappedAvatar_(avatarUri) { + return ('data:text/html;charset=utf-8,' + encodeURIComponent(String.raw` + <html> + <style> + body { + margin: 0; + } + #avatar { + width: 32px; + height: 32px; + user-select: none; + border-radius: 50%; + } + </style> + <body><img id="avatar" src="` + avatarUri + '"></body></html>')); + } + onCancelClicked_() { this.userActed('cancel'); }
diff --git a/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn b/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn index 86dae49..1b12ba5 100644 --- a/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/screens/oobe/BUILD.gn
@@ -17,7 +17,6 @@ "js_module_root=./gen/chrome/browser/resources/gaia_auth_host", ] deps = [ - ":auto_enrollment_check", ":consumer_update", ":enterprise_enrollment", ":hid_detection", @@ -31,17 +30,6 @@ ############################### # Closure compiler libraries below -js_library("auto_enrollment_check") { - sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.js" ] - deps = [ - "../../components/behaviors:login_screen_behavior", - "../../components/behaviors:oobe_dialog_host_behavior", - "../../components/behaviors:oobe_i18n_behavior", - "../../components/dialogs:oobe_loading_dialog", - ] - extra_deps = [ ":web_components" ] -} - js_library("consumer_update") { sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/oobe/consumer_update.js" ] deps = [
diff --git a/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.html b/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.html index 0dcbfb58..108c7e2 100644 --- a/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.html +++ b/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.html
@@ -3,6 +3,6 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<oobe-loading-dialog title-key="[[getLoadingTitle_()]]"> +<oobe-loading-dialog title-key="[[getLoadingTitle()]]"> <iron-icon slot="icon" icon="oobe-32:googleg"></iron-icon> </oobe-loading-dialog>
diff --git a/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.js b/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.js deleted file mode 100644 index 346b4a7c..0000000 --- a/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.js +++ /dev/null
@@ -1,72 +0,0 @@ -// Copyright 2014 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/** - * @fileoverview Oobe Auto-enrollment check screen implementation. - */ - -import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; -import '../../components/dialogs/oobe_loading_dialog.js'; - -import {mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; - -import {LoginScreenBehavior, LoginScreenBehaviorInterface} from '../../components/behaviors/login_screen_behavior.js'; -import {OobeDialogHostBehavior} from '../../components/behaviors/oobe_dialog_host_behavior.js'; -import {OobeI18nBehavior, OobeI18nBehaviorInterface} from '../../components/behaviors/oobe_i18n_behavior.js'; - -import {getTemplate} from './auto_enrollment_check.html.js'; - - -/** - * @constructor - * @extends {PolymerElement} - * @implements {OobeI18nBehaviorInterface} - * @implements {LoginScreenBehaviorInterface} - */ -const AutoEnrollmentCheckElementBase = mixinBehaviors( - [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior], - PolymerElement); - -/** - * @polymer - */ -class AutoEnrollmentCheckElement extends AutoEnrollmentCheckElementBase { - static get is() { - return 'auto-enrollment-check-element'; - } - - static get template() { - return getTemplate(); - } - - static get properties() { - return { - /** - * Whether to show get device ready title. - */ - isOobeSoftwareUpdateEnabled_: { - type: Boolean, - value() { - return loadTimeData.getBoolean('isOobeSoftwareUpdateEnabled'); - }, - }, - }; - } - - ready() { - super.ready(); - this.initializeLoginScreen('AutoEnrollmentCheckScreen'); - } - - getLoadingTitle_() { - if (this.isOobeSoftwareUpdateEnabled_) { - return 'gettingDeviceReadyTitle'; - } - return 'autoEnrollmentCheckMessage'; - } -} - -customElements.define( - AutoEnrollmentCheckElement.is, AutoEnrollmentCheckElement);
diff --git a/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.ts b/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.ts new file mode 100644 index 0000000..e8651bc8 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/screens/oobe/auto_enrollment_check.ts
@@ -0,0 +1,76 @@ +// Copyright 2014 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Oobe Auto-enrollment check screen implementation. + */ + +import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; +import '../../components/dialogs/oobe_loading_dialog.js'; + +import {loadTimeData} from '//resources/js/load_time_data.js'; +import {PolymerElementProperties} from '//resources/polymer/v3_0/polymer/interfaces.js'; +import {mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {LoginScreenBehavior, LoginScreenBehaviorInterface} from '../../components/behaviors/login_screen_behavior.js'; +import {OobeDialogHostBehavior, OobeDialogHostBehaviorInterface} from '../../components/behaviors/oobe_dialog_host_behavior.js'; +import {OobeI18nBehavior, OobeI18nBehaviorInterface} from '../../components/behaviors/oobe_i18n_behavior.js'; + +import {getTemplate} from './auto_enrollment_check.html.js'; + + +export const AutoEnrollmentCheckElementBase = + mixinBehaviors( + [OobeI18nBehavior, LoginScreenBehavior, OobeDialogHostBehavior], + PolymerElement) as { + new (): PolymerElement & OobeI18nBehaviorInterface & + LoginScreenBehaviorInterface & OobeDialogHostBehaviorInterface, + }; + +export class AutoEnrollmentCheckElement extends AutoEnrollmentCheckElementBase { + static get is() { + return 'auto-enrollment-check-element' as const; + } + + static get template(): HTMLTemplateElement { + return getTemplate(); + } + + static get properties(): PolymerElementProperties { + return { + /** + * Whether to show get device ready title. + */ + isOobeSoftwareUpdateEnabled: { + type: Boolean, + value() { + return loadTimeData.getBoolean('isOobeSoftwareUpdateEnabled'); + }, + }, + }; + } + + private isOobeSoftwareUpdateEnabled: boolean; + + override ready(): void { + super.ready(); + this.initializeLoginScreen('AutoEnrollmentCheckScreen'); + } + + private getLoadingTitle(): string { + if (this.isOobeSoftwareUpdateEnabled) { + return 'gettingDeviceReadyTitle'; + } + return 'autoEnrollmentCheckMessage'; + } +} + +declare global { + interface HTMLElementTagNameMap { + [AutoEnrollmentCheckElement.is]: AutoEnrollmentCheckElement; + } +} + +customElements.define( + AutoEnrollmentCheckElement.is, AutoEnrollmentCheckElement);
diff --git a/chrome/browser/supervised_user/BUILD.gn b/chrome/browser/supervised_user/BUILD.gn index 9204616..7e4a81d 100644 --- a/chrome/browser/supervised_user/BUILD.gn +++ b/chrome/browser/supervised_user/BUILD.gn
@@ -100,8 +100,8 @@ ] srcjar_deps = [ - ":jni_headers", ":local_web_approval_outcome_java_enum_srcjar", + ":website_parent_approval_jni_headers", ] sources = [ @@ -116,10 +116,27 @@ resources_package = "org.chromium.chrome.browser.supervised_user" } - generate_jni("jni_headers") { + generate_jni("website_parent_approval_jni_headers") { sources = [ "android/java/src/org/chromium/chrome/browser/supervised_user/WebsiteParentApproval.java" ] } + android_library("supervised_user_service_platform_delegate_java") { + deps = [ + "//base:base_java", + "//chrome/browser/tabmodel:java", + "//third_party/jni_zero:jni_zero_java", + ] + + srcjar_deps = [ ":supervised_user_service_platform_delegate_jni_headers" ] + + sources = [ "android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserServicePlatformDelegate.java" ] + resources_package = "org.chromium.chrome.browser.supervised_user" + } + + generate_jni("supervised_user_service_platform_delegate_jni_headers") { + sources = [ "android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserServicePlatformDelegate.java" ] + } + generate_jni("test_support_jni_headers") { testonly = true sources = [ "android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsTestBridge.java" ] @@ -144,6 +161,7 @@ testonly = true resources_package = "org.chromium.chrome.browser.supervised_user" sources = [ + "android/javatests/src/org/chromium/chrome/browser/supervised_user/IncognitoSignInInteractionTest.java", "android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserCriticalJourneysIntegrationTest.java", "android/javatests/src/org/chromium/chrome/browser/supervised_user/SupervisedUserSettingsTestUtils.java", "android/javatests/src/org/chromium/chrome/browser/supervised_user/WebsiteParentApprovalNativesTest.java",
diff --git a/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserServicePlatformDelegate.java b/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserServicePlatformDelegate.java new file mode 100644 index 0000000..eb51a3c --- /dev/null +++ b/chrome/browser/supervised_user/android/java/src/org/chromium/chrome/browser/supervised_user/SupervisedUserServicePlatformDelegate.java
@@ -0,0 +1,17 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.supervised_user; + +import org.jni_zero.CalledByNative; + +import org.chromium.chrome.browser.tabmodel.IncognitoTabHostUtils; + +class SupervisedUserServicePlatformDelegate { + /** Closes all open incognito tabs */ + @CalledByNative + private static void closeIncognitoTabs() { + IncognitoTabHostUtils.closeAllIncognitoTabs(); + } +}
diff --git a/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/IncognitoSignInInteractionTest.java b/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/IncognitoSignInInteractionTest.java new file mode 100644 index 0000000..112fc3298 --- /dev/null +++ b/chrome/browser/supervised_user/android/javatests/src/org/chromium/chrome/browser/supervised_user/IncognitoSignInInteractionTest.java
@@ -0,0 +1,77 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.supervised_user; + +import androidx.test.filters.LargeTest; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.RuleChain; +import org.junit.runner.RunWith; + +import org.chromium.base.test.util.Batch; +import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.browser.signin.SigninTestRule; +import org.chromium.content_public.browser.test.util.TestThreadUtils; + +/** Verifies the main user journeys for supervised users. */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +@Batch(Batch.PER_CLASS) +public class IncognitoSignInInteractionTest { + public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + + public final SigninTestRule mSigninTestRule = new SigninTestRule(); + + @Rule + public final RuleChain mRuleChain = + RuleChain.outerRule(mSigninTestRule).around(mActivityTestRule); + + /** Waits until the Incognito Tab is closed. */ + private class TabClosedWaiter extends EmptyTabObserver { + private CallbackHelper mCallbackHelper; + + public TabClosedWaiter() { + mCallbackHelper = new CallbackHelper(); + } + + @Override + public void onDestroyed(Tab tab) { + mCallbackHelper.notifyCalled(); + } + + public void waitForClose() throws Exception { + mCallbackHelper.waitForFirst(); + } + } + + @Before + public void setUp() { + mActivityTestRule.startMainActivityWithURL(null); + } + + @Test + @LargeTest + public void incognitoTabsClosedWhenSupervisedUserSignsIn() throws Exception { + // Create a new incognito tab. This succeeds, as the device is not + // supervised. + Tab tab = mActivityTestRule.newIncognitoTabFromMenu(); + TabClosedWaiter tabClosedWaiter = new TabClosedWaiter(); + TestThreadUtils.runOnUiThreadBlocking(() -> tab.addObserver(tabClosedWaiter)); + + // Add a supervised user to the device. + mSigninTestRule.addChildTestAccountThenWaitForSignin(); + + // Check that the incognito tab is no longer open. + tabClosedWaiter.waitForClose(); + } +}
diff --git a/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.cc b/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.cc index b9ebf78..79f70251cc 100644 --- a/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.cc +++ b/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.cc
@@ -2,11 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <jni.h> + +#include "base/android/jni_android.h" #include "chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.h" -#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/supervised_user/supervised_user_service_platform_delegate_jni_headers/SupervisedUserServicePlatformDelegate_jni.h" -SupervisedUserServicePlatformDelegate::SupervisedUserServicePlatformDelegate( - Profile& profile) - : profile_(profile) {} +SupervisedUserServicePlatformDelegate::SupervisedUserServicePlatformDelegate() { +} -void SupervisedUserServicePlatformDelegate::CloseIncognitoTabs() {} +void SupervisedUserServicePlatformDelegate::CloseIncognitoTabs() { + JNIEnv* env = base::android::AttachCurrentThread(); + Java_SupervisedUserServicePlatformDelegate_closeIncognitoTabs(env); +}
diff --git a/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.h b/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.h index 4c2fed9..0f183df9 100644 --- a/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.h +++ b/chrome/browser/supervised_user/android/supervised_user_service_platform_delegate.h
@@ -5,25 +5,15 @@ #ifndef CHROME_BROWSER_SUPERVISED_USER_ANDROID_SUPERVISED_USER_SERVICE_PLATFORM_DELEGATE_H_ #define CHROME_BROWSER_SUPERVISED_USER_ANDROID_SUPERVISED_USER_SERVICE_PLATFORM_DELEGATE_H_ -#include "base/memory/raw_ref.h" #include "components/supervised_user/core/browser/supervised_user_service.h" -class Profile; - class SupervisedUserServicePlatformDelegate : public supervised_user::SupervisedUserService::PlatformDelegate { public: - explicit SupervisedUserServicePlatformDelegate(Profile& profile); + SupervisedUserServicePlatformDelegate(); // SupervisedUserService::PlatformDelegate - - // Currently this method is a no-op. - // TODO(crbug/1491611): implement incognito tab closing on Android, via bridge - // to Java. void CloseIncognitoTabs() override; - - private: - const raw_ref<Profile> profile_; }; #endif // CHROME_BROWSER_SUPERVISED_USER_ANDROID_SUPERVISED_USER_SERVICE_PLATFORM_DELEGATE_H_
diff --git a/chrome/browser/supervised_user/android/website_parent_approval.cc b/chrome/browser/supervised_user/android/website_parent_approval.cc index 4ec0b2958..ffa464d 100644 --- a/chrome/browser/supervised_user/android/website_parent_approval.cc +++ b/chrome/browser/supervised_user/android/website_parent_approval.cc
@@ -18,7 +18,7 @@ #include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/supervised_user/android/favicon_fetcher.h" -#include "chrome/browser/supervised_user/jni_headers/WebsiteParentApproval_jni.h" +#include "chrome/browser/supervised_user/website_parent_approval_jni_headers/WebsiteParentApproval_jni.h" #include "content/public/browser/web_contents.h" #include "ui/android/window_android.h" #include "url/android/gurl_android.h"
diff --git a/chrome/browser/supervised_user/supervised_user_service_factory.cc b/chrome/browser/supervised_user/supervised_user_service_factory.cc index c35bdb6..deef4bf 100644 --- a/chrome/browser/supervised_user/supervised_user_service_factory.cc +++ b/chrome/browser/supervised_user/supervised_user_service_factory.cc
@@ -86,8 +86,13 @@ SyncServiceFactory::GetInstance()->GetForProfile(profile), base::BindRepeating(supervised_user::IsSupportedChromeExtensionURL), std::make_unique<FilterDelegateImpl>(), +#if BUILDFLAG(IS_ANDROID) + std::make_unique<SupervisedUserServicePlatformDelegate>( + SupervisedUserServicePlatformDelegate()), +#else std::make_unique<SupervisedUserServicePlatformDelegate>( SupervisedUserServicePlatformDelegate(*profile)), +#endif /*can_show_first_time_interstitial_banner=*/!profile->IsNewProfile()); }
diff --git a/chrome/browser/tpcd/heuristics/opener_heuristic_browsertest.cc b/chrome/browser/tpcd/heuristics/opener_heuristic_browsertest.cc index 902fa8a..289f2adc9 100644 --- a/chrome/browser/tpcd/heuristics/opener_heuristic_browsertest.cc +++ b/chrome/browser/tpcd/heuristics/opener_heuristic_browsertest.cc
@@ -1256,8 +1256,16 @@ EXPECT_NE(popup_id, popup_id2); } +// TODO(crbug.com/1511706): Flaky on mac. +#if BUILDFLAG(IS_MAC) +#define MAYBE_TopLevel_PastInteraction_AdTagged \ + DISABLED_TopLevel_PastInteraction_AdTagged +#else +#define MAYBE_TopLevel_PastInteraction_AdTagged \ + TopLevel_PastInteraction_AdTagged +#endif IN_PROC_BROWSER_TEST_F(OpenerHeuristicBrowserTest, - TopLevel_PastInteraction_AdTagged) { + MAYBE_TopLevel_PastInteraction_AdTagged) { ukm::TestAutoSetUkmRecorder ukm_recorder; GURL toplevel_url = embedded_test_server()->GetURL("a.com", "/ad_tagging/frame_factory.html");
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index 3a5073f4..655d953e 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -606,6 +606,12 @@ <message name="IDS_PASSWORD_MANAGER_SETTINGS_TITLE" desc="Title for the settings menu item leading to the Password Manager UI surface. This allows users to e.g. manage their saved passwords, toggle saving and auto-sign-in on/off, etc. [CHAR_LIMIT=32]"> Password Manager </message> + <message name="IDS_PASSWORD_SAVING_ON_BY_ADMINISTRATOR" desc="Subtitle for the settings menu item leading to the Password Manager UI surface, shown when the device administrator set saving passwords to enabled."> + Password saving is turned on by your administrator + </message> + <message name="IDS_PASSWORD_SAVING_OFF_BY_ADMINISTRATOR" desc="Subtitle for the settings menu item leading to the Password Manager UI surface, shown when the device administrator set saving passwords to disabled."> + Password saving is turned off by your administrator + </message> <message name="IDS_PASSWORD_SETTINGS_SAVE_PASSWORDS" desc="Title for the checkbox toggling whether passwords are saved or not. [CHAR_LIMIT=32]"> Save passwords </message>
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_SAVING_OFF_BY_ADMINISTRATOR.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_SAVING_OFF_BY_ADMINISTRATOR.png.sha1 new file mode 100644 index 0000000..b78aca5c --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_SAVING_OFF_BY_ADMINISTRATOR.png.sha1
@@ -0,0 +1 @@ +e0888c6cee28e8b0e8f639bcb1ce561e8c2c6cb9 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_SAVING_ON_BY_ADMINISTRATOR.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_SAVING_ON_BY_ADMINISTRATOR.png.sha1 new file mode 100644 index 0000000..4690387 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_SAVING_ON_BY_ADMINISTRATOR.png.sha1
@@ -0,0 +1 @@ +b5e27351203549ab0ea499ef8001237918f8c501 \ No newline at end of file
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.cc index f287431..9581b3da 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.cc
@@ -81,6 +81,30 @@ } } +void EmbeddedPermissionPromptBaseView::AddedToWidget() { + if (!GetRequestLinesConfiguration().empty()) { + return; + } + + auto title_container = std::make_unique<views::FlexLayoutView>(); + title_container->SetOrientation(views::LayoutOrientation::kVertical); + + auto label = std::make_unique<views::Label>( + GetWindowTitle(), views::style::CONTEXT_DIALOG_BODY_TEXT); + label->SetHorizontalAlignment(gfx::ALIGN_LEFT); + label->SetCollapseWhenHidden(true); + label->SetMultiLine(true); + label->SetProperty( + views::kFlexBehaviorKey, + views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero, + views::MaximumFlexSizeRule::kScaleToMaximum, + /*adjust_height_for_width=*/true)); + AddElementIdentifierToLabel(*label, /*index*/ 0); + title_container->AddChildView(std::move(label)); + + GetBubbleFrameView()->SetTitleView(std::move(title_container)); +} + void EmbeddedPermissionPromptBaseView::ClosingPermission() { if (delegate()) { delegate()->Dismiss();
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h b/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h index 1465642..f69ca66 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h
@@ -10,10 +10,13 @@ #include "base/memory/raw_ptr.h" #include "chrome/browser/ui/views/permissions/embedded_permission_prompt_view_delegate.h" #include "chrome/browser/ui/views/permissions/permission_prompt_base_view.h" +#include "components/favicon_base/favicon_types.h" #include "components/permissions/permission_prompt.h" #include "ui/base/interaction/element_identifier.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/vector_icon_types.h" +#include "ui/views/controls/styled_label.h" +#include "ui/views/layout/flex_layout_view.h" class Browser; @@ -64,6 +67,7 @@ // views::BubbleDialogDelegateView: bool ShouldShowCloseButton() const override; void Init() override; + void AddedToWidget() override; protected: enum class ButtonType {
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc index 2de5d47..b8248bf 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc
@@ -27,12 +27,25 @@ std::u16string EmbeddedPermissionPromptPreviouslyDeniedView::GetAccessibleWindowTitle() const { - return GetMessageText(); + return GetWindowTitle(); } std::u16string EmbeddedPermissionPromptPreviouslyDeniedView::GetWindowTitle() const { - return std::u16string(); + const auto& requests = delegate()->Requests(); + CHECK_GT(requests.size(), 0U); + + std::u16string permission_name; + if (requests.size() == 2) { + permission_name = l10n_util::GetStringUTF16( + IDS_CAMERA_AND_MICROPHONE_PERMISSION_NAME_FRAGMENT); + } else { + permission_name = requests[0]->GetPermissionNameTextFragment(); + } + + return l10n_util::GetStringFUTF16(IDS_EMBEDDED_PROMPT_PREVIOUSLY_NOT_ALLOWED, + permission_name, + GetUrlIdentityObject().name); } void EmbeddedPermissionPromptPreviouslyDeniedView::RunButtonCallback( @@ -60,7 +73,7 @@ EmbeddedPermissionPromptPreviouslyDeniedView::RequestLineConfiguration> EmbeddedPermissionPromptPreviouslyDeniedView::GetRequestLinesConfiguration() const { - return {{/*icon=*/nullptr, GetMessageText()}}; + return {}; } std::vector<EmbeddedPermissionPromptPreviouslyDeniedView::ButtonConfiguration> @@ -80,21 +93,3 @@ } return buttons; } - -std::u16string EmbeddedPermissionPromptPreviouslyDeniedView::GetMessageText() - const { - const auto& requests = delegate()->Requests(); - CHECK_GT(requests.size(), 0U); - - std::u16string permission_name; - if (requests.size() == 2) { - permission_name = l10n_util::GetStringUTF16( - IDS_CAMERA_AND_MICROPHONE_PERMISSION_NAME_FRAGMENT); - } else { - permission_name = requests[0]->GetPermissionNameTextFragment(); - } - - return l10n_util::GetStringFUTF16(IDS_EMBEDDED_PROMPT_PREVIOUSLY_NOT_ALLOWED, - permission_name, - GetUrlIdentityObject().name); -}
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.h b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.h index 54a9613..753827b 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.h +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.h
@@ -36,9 +36,6 @@ std::vector<RequestLineConfiguration> GetRequestLinesConfiguration() const override; std::vector<ButtonConfiguration> GetButtonsConfiguration() const override; - - private: - std::u16string GetMessageText() const; }; #endif // CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_PREVIOUSLY_DENIED_VIEW_H_
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc index 44454db..7de5e3b 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc
@@ -27,12 +27,25 @@ std::u16string EmbeddedPermissionPromptPreviouslyGrantedView::GetAccessibleWindowTitle() const { - return GetMessageText(); + return GetWindowTitle(); } std::u16string EmbeddedPermissionPromptPreviouslyGrantedView::GetWindowTitle() const { - return std::u16string(); + const auto& requests = delegate()->Requests(); + CHECK_GT(requests.size(), 0U); + + std::u16string permission_name; + if (requests.size() == 2) { + permission_name = l10n_util::GetStringUTF16( + IDS_CAMERA_AND_MICROPHONE_PERMISSION_NAME_FRAGMENT); + } else { + permission_name = requests[0]->GetPermissionNameTextFragment(); + } + + return l10n_util::GetStringFUTF16(IDS_EMBEDDED_PROMPT_PREVIOUSLY_ALLOWED, + permission_name, + GetUrlIdentityObject().name); } void EmbeddedPermissionPromptPreviouslyGrantedView::RunButtonCallback( @@ -55,7 +68,7 @@ EmbeddedPermissionPromptPreviouslyGrantedView::RequestLineConfiguration> EmbeddedPermissionPromptPreviouslyGrantedView::GetRequestLinesConfiguration() const { - return {{/*icon=*/nullptr, GetMessageText()}}; + return {}; } std::vector<EmbeddedPermissionPromptPreviouslyGrantedView::ButtonConfiguration> @@ -70,21 +83,3 @@ ButtonType::kStopAllowing, ui::ButtonStyle::kTonal, kStopAllowingId); return buttons; } - -std::u16string EmbeddedPermissionPromptPreviouslyGrantedView::GetMessageText() - const { - const auto& requests = delegate()->Requests(); - CHECK_GT(requests.size(), 0U); - - std::u16string permission_name; - if (requests.size() == 2) { - permission_name = l10n_util::GetStringUTF16( - IDS_CAMERA_AND_MICROPHONE_PERMISSION_NAME_FRAGMENT); - } else { - permission_name = requests[0]->GetPermissionNameTextFragment(); - } - - return l10n_util::GetStringFUTF16(IDS_EMBEDDED_PROMPT_PREVIOUSLY_ALLOWED, - permission_name, - GetUrlIdentityObject().name); -}
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.h b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.h index 1433f66..8aec274 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.h +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.h
@@ -35,9 +35,6 @@ std::vector<RequestLineConfiguration> GetRequestLinesConfiguration() const override; std::vector<ButtonConfiguration> GetButtonsConfiguration() const override; - - private: - std::u16string GetMessageText() const; }; #endif // CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_PREVIOUSLY_GRANTED_VIEW_H_
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.cc index c77ad2a..ef5fbf8c6 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.cc
@@ -23,36 +23,11 @@ std::u16string EmbeddedPermissionPromptShowSystemPromptView::GetAccessibleWindowTitle() const { - return GetMessageText(); + return GetWindowTitle(); } std::u16string EmbeddedPermissionPromptShowSystemPromptView::GetWindowTitle() const { - return std::u16string(); -} - -void EmbeddedPermissionPromptShowSystemPromptView::RunButtonCallback( - int button_id) { - // This view has no buttons. - NOTREACHED(); - return; -} - -std::vector< - EmbeddedPermissionPromptShowSystemPromptView::RequestLineConfiguration> -EmbeddedPermissionPromptShowSystemPromptView::GetRequestLinesConfiguration() - const { - return {{/*icon=*/nullptr, GetMessageText()}}; -} - -std::vector<EmbeddedPermissionPromptShowSystemPromptView::ButtonConfiguration> -EmbeddedPermissionPromptShowSystemPromptView::GetButtonsConfiguration() const { - // This view has no buttons. - return std::vector<ButtonConfiguration>(); -} - -std::u16string EmbeddedPermissionPromptShowSystemPromptView::GetMessageText() - const { const auto& requests = delegate()->Requests(); CHECK_GT(requests.size(), 0U); @@ -67,3 +42,23 @@ return l10n_util::GetStringFUTF16(IDS_PERMISSION_CHROME_NEEDS_PERMISSION, permission_name); } + +void EmbeddedPermissionPromptShowSystemPromptView::RunButtonCallback( + int button_id) { + // This view has no buttons. + NOTREACHED(); + return; +} + +std::vector< + EmbeddedPermissionPromptShowSystemPromptView::RequestLineConfiguration> +EmbeddedPermissionPromptShowSystemPromptView::GetRequestLinesConfiguration() + const { + return {}; +} + +std::vector<EmbeddedPermissionPromptShowSystemPromptView::ButtonConfiguration> +EmbeddedPermissionPromptShowSystemPromptView::GetButtonsConfiguration() const { + // This view has no buttons. + return std::vector<ButtonConfiguration>(); +}
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.h b/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.h index a24ea1f..c772ed01 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.h +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_show_system_prompt_view.h
@@ -35,9 +35,6 @@ std::vector<RequestLineConfiguration> GetRequestLinesConfiguration() const override; std::vector<ButtonConfiguration> GetButtonsConfiguration() const override; - - private: - std::u16string GetMessageText() const; }; #endif // CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_SHOW_SYSTEM_PROMPT_VIEW_H_
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.cc b/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.cc index 537912b..72b20b66 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.cc +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.cc
@@ -23,12 +23,24 @@ std::u16string EmbeddedPermissionPromptSystemSettingsView::GetAccessibleWindowTitle() const { - return GetMessageText(); + return GetWindowTitle(); } std::u16string EmbeddedPermissionPromptSystemSettingsView::GetWindowTitle() const { - return std::u16string(); + const auto& requests = delegate()->Requests(); + CHECK_GT(requests.size(), 0U); + + std::u16string permission_name; + if (requests.size() == 2) { + permission_name = l10n_util::GetStringUTF16( + IDS_CAMERA_AND_MICROPHONE_PERMISSION_NAME_FRAGMENT); + } else { + permission_name = requests[0]->GetPermissionNameTextFragment(); + } + + return l10n_util::GetStringFUTF16(IDS_PERMISSION_OFF_FOR_CHROME, + permission_name); } void EmbeddedPermissionPromptSystemSettingsView::RunButtonCallback( @@ -47,7 +59,7 @@ EmbeddedPermissionPromptSystemSettingsView::RequestLineConfiguration> EmbeddedPermissionPromptSystemSettingsView::GetRequestLinesConfiguration() const { - return {{/*icon=*/nullptr, GetMessageText()}}; + return {}; } std::vector<EmbeddedPermissionPromptSystemSettingsView::ButtonConfiguration> @@ -67,20 +79,3 @@ operating_system_name), ButtonType::kSystemSettings, ui::ButtonStyle::kTonal}}; } - -std::u16string EmbeddedPermissionPromptSystemSettingsView::GetMessageText() - const { - const auto& requests = delegate()->Requests(); - CHECK_GT(requests.size(), 0U); - - std::u16string permission_name; - if (requests.size() == 2) { - permission_name = l10n_util::GetStringUTF16( - IDS_CAMERA_AND_MICROPHONE_PERMISSION_NAME_FRAGMENT); - } else { - permission_name = requests[0]->GetPermissionNameTextFragment(); - } - - return l10n_util::GetStringFUTF16(IDS_PERMISSION_OFF_FOR_CHROME, - permission_name); -}
diff --git a/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.h b/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.h index a1ed140..f1293bc 100644 --- a/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.h +++ b/chrome/browser/ui/views/permissions/embedded_permission_prompt_system_settings_view.h
@@ -36,9 +36,6 @@ std::vector<RequestLineConfiguration> GetRequestLinesConfiguration() const override; std::vector<ButtonConfiguration> GetButtonsConfiguration() const override; - - private: - std::u16string GetMessageText() const; }; #endif // CHROME_BROWSER_UI_VIEWS_PERMISSIONS_EMBEDDED_PERMISSION_PROMPT_SYSTEM_SETTINGS_VIEW_H_
diff --git a/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc index 9bc9871..089f90b 100644 --- a/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc +++ b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.cc
@@ -41,12 +41,24 @@ CallExternalAPI("showConfirmGoogleAccount"); } -void QuickStartScreenHandler::ShowTransferringGaiaCredentials() { - CallExternalAPI("showTransferringGaiaCredentials"); +void QuickStartScreenHandler::ShowSigningInStep() { + CallExternalAPI("showSigningInStep"); } -void QuickStartScreenHandler::ShowFidoAssertionReceived(std::string email) { - CallExternalAPI("showFidoAssertionReceived", email); +void QuickStartScreenHandler::ShowCreatingAccountStep() { + CallExternalAPI("showCreatingAccountStep"); +} + +void QuickStartScreenHandler::SetUserEmail(const std::string email) { + CallExternalAPI("setUserEmail", email); +} + +void QuickStartScreenHandler::SetUserFullName(const std::string full_name) { + CallExternalAPI("setUserFullName", full_name); +} + +void QuickStartScreenHandler::SetUserAvatar(const std::string avatar_url) { + CallExternalAPI("setUserAvatarUrl", avatar_url); } void QuickStartScreenHandler::DeclareLocalizedValues(
diff --git a/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h index 0cd60d4..3c779def 100644 --- a/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h +++ b/chrome/browser/ui/webui/ash/login/quick_start_screen_handler.h
@@ -31,8 +31,11 @@ virtual void SetDiscoverableName(const std::string& discoverable_name) = 0; virtual void ShowConnectingToWifi() = 0; virtual void ShowConfirmGoogleAccount() = 0; - virtual void ShowTransferringGaiaCredentials() = 0; - virtual void ShowFidoAssertionReceived(std::string email) = 0; + virtual void ShowSigningInStep() = 0; + virtual void ShowCreatingAccountStep() = 0; + virtual void SetUserEmail(const std::string email) = 0; + virtual void SetUserFullName(const std::string full_name) = 0; + virtual void SetUserAvatar(const std::string avatar_url) = 0; }; // WebUI implementation of QuickStartView. @@ -55,8 +58,11 @@ void SetDiscoverableName(const std::string& discoverable_name) override; void ShowConnectingToWifi() override; void ShowConfirmGoogleAccount() override; - void ShowTransferringGaiaCredentials() override; - void ShowFidoAssertionReceived(std::string email) override; + void ShowSigningInStep() override; + void ShowCreatingAccountStep() override; + void SetUserEmail(const std::string email) override; + void SetUserFullName(const std::string full_name) override; + void SetUserAvatar(const std::string avatar_url) override; // BaseScreenHandler: void DeclareLocalizedValues(
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 3f372c1..e65f838 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1703807856-4296efebb911dcd4c761d1967b275b8e8cc1eb35.profdata +chrome-android32-main-1703872780-03ec59eaa790e07f8a6d1dac6f824c679684b915.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index 1f2f45bc..7f99d9b2 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1703807856-8d75cf0430fef077dad95a4898b01d8cdfa47c02.profdata +chrome-android64-main-1703872780-c70b339d48f47f750bb6c45bc84e9970c53602ee.profdata
diff --git a/chrome/build/lacros-arm64.pgo.txt b/chrome/build/lacros-arm64.pgo.txt index 8ef5afc1..076b1783 100644 --- a/chrome/build/lacros-arm64.pgo.txt +++ b/chrome/build/lacros-arm64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-arm64-generic-main-1703807856-b6261c04c3d6695db6af6456433574482d9332d1.profdata +chrome-chromeos-arm64-generic-main-1703851390-7f26095ece69d641fe82952cbf68aefbe0b17423.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 29632c8e..7d55ed4 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1703807856-a23fc9ad25d0d2cee6ce765c7cf4644ac8dc04c9.profdata +chrome-linux-main-1703872780-fec5052cf17e84aaacb545cf9195ac16ef20eb1a.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index 5b3ddade6..7fe0eff 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1703807856-a352eb34260db9dbdf89f97fbfcdc2aec184b4de.profdata +chrome-win-arm64-main-1703872780-c36ed3d3bf154a099aea64c08fe9700c27d3405c.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 2a0f0a7..a75b9bb 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1703807856-4fcc5c5d909108917bef527f509cc1b402353717.profdata +chrome-win32-main-1703882975-a90211d78d19d6694d5a55704adcac09936806e9.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 3c08643..b3dc2d2 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1703807856-20ffced82dfdf8d9fa2d2b04e2fb97149be2cba8.profdata +chrome-win64-main-1703882975-074d85d685e9cef9c5b021840c9ef1bdc4b43fae.profdata
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 8111933..5130f7a9 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -15723.0.0 \ No newline at end of file +15724.0.0 \ No newline at end of file
diff --git a/chromeos/profiles/arm-exp.afdo.newest.txt b/chromeos/profiles/arm-exp.afdo.newest.txt index c118873..116ff6c 100644 --- a/chromeos/profiles/arm-exp.afdo.newest.txt +++ b/chromeos/profiles/arm-exp.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-exp-122-6167.14-1703504610-benchmark-122.0.6195.0-r3-redacted.afdo.xz +chromeos-chrome-arm-exp-122-6167.14-1703504610-benchmark-122.0.6213.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/arm.afdo.newest.txt b/chromeos/profiles/arm.afdo.newest.txt index f779a7e..88d95ed 100644 --- a/chromeos/profiles/arm.afdo.newest.txt +++ b/chromeos/profiles/arm.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-none-122-6167.14-1703508819-benchmark-122.0.6210.0-r1-redacted.afdo.xz +chromeos-chrome-arm-none-122-6167.14-1703508819-benchmark-122.0.6213.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index 21d34d72..5676f1d 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-122-6167.14-1703504610-benchmark-122.0.6210.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-122-6167.14-1703504610-benchmark-122.0.6213.0-r1-redacted.afdo.xz
diff --git a/clank b/clank index 9d6d0bc..e1531b3 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 9d6d0bc6a5faaa3482a95075222469c67bcabad9 +Subproject commit e1531b3b46bc2d38f1b94d016561b6a322ab764e
diff --git a/components/autofill/core/browser/form_parsing/address_field.cc b/components/autofill/core/browser/form_parsing/address_field.cc index 37d8f88d..b415b00 100644 --- a/components/autofill/core/browser/form_parsing/address_field.cc +++ b/components/autofill/core/browser/form_parsing/address_field.cc
@@ -51,7 +51,7 @@ .negative_pattern = p.negative_pattern, .positive_score = p.positive_score, .match_field_attributes = match_field_attributes, - .match_field_input_types = p.match_field_input_types, + .form_control_types = p.form_control_types, }; } @@ -63,59 +63,71 @@ return match_type; } -// Adds a MatchFieldType to a MatchingPattern. +// Adds a FormControlType to a MatchingPattern. // TODO(crbug/1142936): This is necessary for AddressField::ParseAddressLines() // and AddressField::Parse(). -MatchingPattern WithFieldType(MatchingPattern p, MatchFieldType field_type) { - DenseSet<MatchFieldType> match_field_input_types = p.match_field_input_types; - match_field_input_types.insert(field_type); +MatchingPattern WithFieldType(MatchingPattern p, FormControlType field_type) { + DenseSet<FormControlType> form_control_types = p.form_control_types; + form_control_types.insert(field_type); return { .positive_pattern = p.positive_pattern, .negative_pattern = p.negative_pattern, .positive_score = p.positive_score, .match_field_attributes = p.match_field_attributes, - .match_field_input_types = match_field_input_types, + .form_control_types = form_control_types, }; } // Some sites use type="tel" for zip fields (to get a numerical input). // http://crbug.com/426958 constexpr MatchParams kZipCodeMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTelephone, - MatchFieldType::kNumber>; + kDefaultMatchParamsWith<FormControlType::kInputTelephone, + FormControlType::kInputNumber>; constexpr MatchParams kDependentLocalityMatchType = - kDefaultMatchParamsWith<MatchFieldType::kSelect, - MatchFieldType::kSearch, - MatchFieldType::kTextArea>; + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList, + FormControlType::kInputSearch, + FormControlType::kTextArea>; constexpr MatchParams kStreetLocationMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch>; // Select fields are allowed here. This occurs on top-100 site rediff.com. constexpr MatchParams kCityMatchType = - kDefaultMatchParamsWith<MatchFieldType::kSelect, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList, + FormControlType::kInputSearch>; constexpr MatchParams kStateMatchType = - kDefaultMatchParamsWith<MatchFieldType::kSelect, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList, + FormControlType::kInputSearch>; constexpr MatchParams kLandmarkMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch>; constexpr MatchParams kBetweenStreetsOrLandmarkMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch>; constexpr MatchParams kBetweenStreetsMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch>; constexpr MatchParams kAdminLevel2MatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, - MatchFieldType::kSearch, - MatchFieldType::kSelect>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch, + FormControlType::kSelectOne, + FormControlType::kSelectList>; constexpr MatchParams kOverflowMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch>; constexpr MatchParams kOverflowAndLandmarkMatchType = - kDefaultMatchParamsWith<MatchFieldType::kTextArea, MatchFieldType::kSearch>; + kDefaultMatchParamsWith<FormControlType::kTextArea, + FormControlType::kInputSearch>; } // namespace @@ -161,10 +173,10 @@ // Ignore email addresses. } else if (ParseFieldSpecifics( context, scanner, kEmailRe, - kDefaultMatchParamsWith<MatchFieldType::kTextArea>, + kDefaultMatchParamsWith<FormControlType::kTextArea>, email_patterns, nullptr, "kEmailRe", [](const MatchingPattern& p) { - return WithFieldType(p, MatchFieldType::kTextArea); + return WithFieldType(p, FormControlType::kTextArea); })) { continue; } else if (address_field->ParseAddress(context, scanner) || @@ -419,10 +431,10 @@ // TODO(crbug.com/1474308) Factor out these ParseFieldSpecifics into // ParseStreetName and similar functions. if (!street_name_ && !street_location_ && - ParseFieldSpecifics(context, scanner, kStreetNameRe, - kDefaultMatchParamsWith<MatchFieldType::kSearch>, - street_name_patterns, &street_name_, - "kStreetNameRe")) { + ParseFieldSpecifics( + context, scanner, kStreetNameRe, + kDefaultMatchParamsWith<FormControlType::kInputSearch>, + street_name_patterns, &street_name_, "kStreetNameRe")) { continue; } @@ -469,11 +481,11 @@ } if (!house_number_ && !street_location_ && - ParseFieldSpecifics(context, scanner, kHouseNumberRe, - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTelephone>, - house_number_patterns, &house_number_, - "kHouseNumberRe")) { + ParseFieldSpecifics( + context, scanner, kHouseNumberRe, + kDefaultMatchParamsWith<FormControlType::kInputNumber, + FormControlType::kInputTelephone>, + house_number_patterns, &house_number_, "kHouseNumberRe")) { continue; } @@ -483,11 +495,12 @@ !apartment_number_ && i18n_model_definition::IsTypeEnabledForCountry(ADDRESS_HOME_APT_NUM, country_code) && - ParseFieldSpecifics(context, scanner, kApartmentNumberRe, - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTelephone>, - apartment_number_patterns, &apartment_number_, - "kApartmentNumberRe")) { + ParseFieldSpecifics( + context, scanner, kApartmentNumberRe, + kDefaultMatchParamsWith<FormControlType::kInputNumber, + FormControlType::kInputTelephone>, + apartment_number_patterns, &apartment_number_, + "kApartmentNumberRe")) { continue; } @@ -602,30 +615,30 @@ // Address line 1 is skipped if a |street_name_|, |house_number_| combination // is present. if (!(street_name_ && house_number_) && - !ParseFieldSpecifics(context, scanner, pattern, - kDefaultMatchParamsWith<MatchFieldType::kSearch>, - address_line1_patterns, &address1_, - "kAddressLine1Re") && + !ParseFieldSpecifics( + context, scanner, pattern, + kDefaultMatchParamsWith<FormControlType::kInputSearch>, + address_line1_patterns, &address1_, "kAddressLine1Re") && !ParseFieldSpecifics( context, scanner, label_pattern, - MatchParams({MatchAttribute::kLabel}, - {MatchFieldType::kSearch, MatchFieldType::kText}), + MatchParams({MatchAttribute::kLabel}, {FormControlType::kInputSearch, + FormControlType::kInputText}), address_line1_patterns, &address1_, "kAddressLine1LabelRe") && - !ParseFieldSpecifics(context, scanner, pattern, - kDefaultMatchParamsWith<MatchFieldType::kSearch, - MatchFieldType::kTextArea>, - address_line1_patterns, &street_address_, - "kAddressLine1Re", - [](const MatchingPattern& p) { - return WithFieldType(p, MatchFieldType::kTextArea); - }) && + !ParseFieldSpecifics( + context, scanner, pattern, + kDefaultMatchParamsWith<FormControlType::kInputSearch, + FormControlType::kTextArea>, + address_line1_patterns, &street_address_, "kAddressLine1Re", + [](const MatchingPattern& p) { + return WithFieldType(p, FormControlType::kTextArea); + }) && !ParseFieldSpecifics( context, scanner, label_pattern, - MatchParams({MatchAttribute::kLabel}, - {MatchFieldType::kSearch, MatchFieldType::kTextArea}), + MatchParams({MatchAttribute::kLabel}, {FormControlType::kInputSearch, + FormControlType::kTextArea}), address_line1_patterns, &street_address_, "kAddressLine1LabelRe", [](const MatchingPattern& p) { - return WithFieldType(p, MatchFieldType::kTextArea); + return WithFieldType(p, FormControlType::kTextArea); })) { return false; } @@ -646,7 +659,7 @@ "kAddressLine2Re") && !ParseFieldSpecifics( context, scanner, label_pattern, - MatchParams({MatchAttribute::kLabel}, {MatchFieldType::kText}), + MatchParams({MatchAttribute::kLabel}, {FormControlType::kInputText}), address_line2_patterns, &address2_, "kAddressLine2LabelRe")) { return true; } @@ -661,7 +674,7 @@ &address3_, "kAddressLinesExtraRe") && !ParseFieldSpecifics( context, scanner, label_pattern, - MatchParams({MatchAttribute::kLabel}, {MatchFieldType::kText}), + MatchParams({MatchAttribute::kLabel}, {FormControlType::kInputText}), address_line2_patterns, &address3_, "kAddressLine2LabelRe")) { return true; } @@ -1051,7 +1064,9 @@ ParseNameLabelResult country_result = ParseNameAndLabelSeparately( context, scanner, kCountryRe, - kDefaultMatchParamsWith<MatchFieldType::kSelect, MatchFieldType::kSearch>, + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList, + FormControlType::kInputSearch>, country_patterns, &country_, "kCountryRe"); if (country_result != RESULT_MATCH_NONE) return country_result; @@ -1061,7 +1076,8 @@ return ParseNameAndLabelSeparately( context, scanner, kCountryLocationRe, MatchParams({MatchAttribute::kLabel, MatchAttribute::kName}, - {MatchFieldType::kSelect, MatchFieldType::kSearch}), + {FormControlType::kSelectOne, FormControlType::kSelectList, + FormControlType::kInputSearch}), country_location_patterns, &country_, "kCountryLocationRe"); }
diff --git a/components/autofill/core/browser/form_parsing/autofill_parsing_utils.h b/components/autofill/core/browser/form_parsing/autofill_parsing_utils.h index 5f6a731..c94fd02 100644 --- a/components/autofill/core/browser/form_parsing/autofill_parsing_utils.h +++ b/components/autofill/core/browser/form_parsing/autofill_parsing_utils.h
@@ -7,6 +7,7 @@ #include "base/strings/string_piece.h" #include "components/autofill/core/common/dense_set.h" +#include "components/autofill/core/common/form_field_data.h" namespace autofill { @@ -18,49 +19,21 @@ // the kLabel is "Cellphone number" and the kName is "mobile". enum class MatchAttribute { kLabel, kName, kMaxValue = kName }; -// The types of fields which may be matched. -// -// For example, in -// <label for="mobile">Cellphone number:</label> <input type="tel" id="mobile"> -// the MatchFieldType is kTelephone. -enum class MatchFieldType { - kText, - kEmail, - kTelephone, - kSelect, - kTextArea, - kPassword, - kNumber, - kSearch, - kMaxValue = kSearch -}; - -// Contains all MatchAttribute constants. -constexpr DenseSet<MatchAttribute> kAllMatchAttributes{MatchAttribute::kLabel, - MatchAttribute::kName}; - -// Contains all MatchFieldType constants. -constexpr DenseSet<MatchFieldType> kAllMatchFieldTypes{ - MatchFieldType::kText, MatchFieldType::kEmail, - MatchFieldType::kTelephone, MatchFieldType::kSelect, - MatchFieldType::kTextArea, MatchFieldType::kPassword, - MatchFieldType::kNumber, MatchFieldType::kSearch}; - -// A pair of sets of MatchAttributes and MatchFieldTypes. +// A pair of sets of MatchAttributes and FormControlTypes. struct MatchParams { inline constexpr MatchParams(DenseSet<MatchAttribute> attributes, - DenseSet<MatchFieldType> field_types); + DenseSet<FormControlType> field_types); inline constexpr MatchParams(const MatchParams&); inline constexpr MatchParams& operator=(const MatchParams&); inline constexpr MatchParams(MatchParams&&); inline constexpr MatchParams& operator=(MatchParams&&); DenseSet<MatchAttribute> attributes; - DenseSet<MatchFieldType> field_types; + DenseSet<FormControlType> field_types; }; inline constexpr MatchParams::MatchParams(DenseSet<MatchAttribute> attributes, - DenseSet<MatchFieldType> field_types) + DenseSet<FormControlType> field_types) : attributes(attributes), field_types(field_types) {} inline constexpr MatchParams::MatchParams(const MatchParams&) = default; inline constexpr MatchParams& MatchParams::operator=(const MatchParams&) = @@ -69,10 +42,10 @@ inline constexpr MatchParams& MatchParams::operator=(MatchParams&&) = default; // By default match label and name for <input type="text"> elements. -template <MatchFieldType... additional_match_field_types> +template <FormControlType... additional_match_field_types> constexpr MatchParams kDefaultMatchParamsWith{ - kAllMatchAttributes, - {MatchFieldType::kText, additional_match_field_types...}}; + {MatchAttribute::kLabel, MatchAttribute::kName}, + {FormControlType::kInputText, additional_match_field_types...}}; constexpr MatchParams kDefaultMatchParams = kDefaultMatchParamsWith<>; @@ -91,7 +64,7 @@ const char16_t* negative_pattern; const float positive_score = 1.1; const DenseSet<MatchAttribute> match_field_attributes; - const DenseSet<MatchFieldType> match_field_input_types; + const DenseSet<FormControlType> form_control_types; }; } // namespace autofill
diff --git a/components/autofill/core/browser/form_parsing/birthdate_field.cc b/components/autofill/core/browser/form_parsing/birthdate_field.cc index a3a9bc30..f8be1c5 100644 --- a/components/autofill/core/browser/form_parsing/birthdate_field.cc +++ b/components/autofill/core/browser/form_parsing/birthdate_field.cc
@@ -60,8 +60,9 @@ int max_value, size_t max_options) { AutofillField* field = scanner->Cursor(); - if (!MatchesFormControlType(FormControlTypeToString(field->form_control_type), - {MatchFieldType::kSelect})) { + if (!MatchesFormControlType( + field->form_control_type, + {FormControlType::kSelectOne, FormControlType::kSelectList})) { return false; } auto options = field->options; @@ -86,8 +87,9 @@ bool BirthdateField::IsLikelyBirthdateYearSelectField( AutofillScanner* scanner) { AutofillField* field = scanner->Cursor(); - if (!MatchesFormControlType(FormControlTypeToString(field->form_control_type), - {MatchFieldType::kSelect})) { + if (!MatchesFormControlType( + field->form_control_type, + {FormControlType::kSelectOne, FormControlType::kSelectList})) { return false; } auto options = field->options;
diff --git a/components/autofill/core/browser/form_parsing/credit_card_field.cc b/components/autofill/core/browser/form_parsing/credit_card_field.cc index 3c696e35..b9c5eb78 100644 --- a/components/autofill/core/browser/form_parsing/credit_card_field.cc +++ b/components/autofill/core/browser/form_parsing/credit_card_field.cc
@@ -151,9 +151,9 @@ // Note: Some sites use type="tel" or type="number" for numerical inputs. // They also sometimes use type="password" for sensitive types. const auto kMatchNumTelAndPwd = - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTelephone, - MatchFieldType::kPassword>; + kDefaultMatchParamsWith<FormControlType::kInputNumber, + FormControlType::kInputTelephone, + FormControlType::kInputPassword>; if (!credit_card_field->verification_ && ParseFieldSpecifics(context, scanner, kCardCvcRe, kMatchNumTelAndPwd, @@ -282,8 +282,9 @@ AutofillField* field = scanner->Cursor(); if (!MatchesFormControlType( - FormControlTypeToString(field->form_control_type), - {MatchFieldType::kSelect, MatchFieldType::kSearch})) { + field->form_control_type, + {FormControlType::kSelectOne, FormControlType::kSelectList, + FormControlType::kInputSearch})) { return false; } @@ -314,8 +315,9 @@ AutofillField* field = scanner->Cursor(); if (!MatchesFormControlType( - FormControlTypeToString(field->form_control_type), - {MatchFieldType::kSelect, MatchFieldType::kSearch})) { + field->form_control_type, + {FormControlType::kSelectOne, FormControlType::kSelectList, + FormControlType::kInputSearch})) { return false; } @@ -333,8 +335,9 @@ GetMatchPatterns("DAY", *context); if (FormField::ParseFieldSpecifics( *context, scanner, kDayRe, - kDefaultMatchParamsWith<MatchFieldType::kSelect>, day_patterns, - nullptr, "kDayRe")) { + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList>, + day_patterns, nullptr, "kDayRe")) { return false; } @@ -392,8 +395,9 @@ AutofillField* field = scanner->Cursor(); if (!MatchesFormControlType( - FormControlTypeToString(field->form_control_type), - {MatchFieldType::kSelect, MatchFieldType::kSearch})) { + field->form_control_type, + {FormControlType::kSelectOne, FormControlType::kSelectList, + FormControlType::kInputSearch})) { return false; } @@ -414,12 +418,12 @@ if (scanner->IsEnd()) return false; - // kMatchFieldType should subsume kMatchNumTelAndPwd used for + // kMatchParams should subsume kMatchNumTelAndPwd used for // CREDIT_CARD_NUMBER matching. Otherwise, a gift card field may not match the // GIFT_CARD pattern but erroneously do match the CREDIT_CARD_NUMBER pattern. - const auto kMatchFieldType = kDefaultMatchParamsWith< - MatchFieldType::kNumber, MatchFieldType::kTelephone, - MatchFieldType::kSearch, MatchFieldType::kPassword>; + const auto kMatchParams = kDefaultMatchParamsWith< + FormControlType::kInputNumber, FormControlType::kInputTelephone, + FormControlType::kInputSearch, FormControlType::kInputPassword>; size_t saved_cursor = scanner->SaveCursor(); base::span<const MatchPatternRef> debit_cards_patterns = @@ -431,19 +435,19 @@ base::span<const MatchPatternRef> gift_card_patterns = GetMatchPatterns("GIFT_CARD", context); - if (ParseFieldSpecifics(context, scanner, kDebitCardRe, kMatchFieldType, + if (ParseFieldSpecifics(context, scanner, kDebitCardRe, kMatchParams, debit_cards_patterns, nullptr, "kDebitCardRe")) { scanner->RewindTo(saved_cursor); return false; } - if (ParseFieldSpecifics(context, scanner, kDebitGiftCardRe, kMatchFieldType, + if (ParseFieldSpecifics(context, scanner, kDebitGiftCardRe, kMatchParams, debit_gift_card_patterns, nullptr, "kDebitGiftCardRe")) { scanner->RewindTo(saved_cursor); return false; } - return ParseFieldSpecifics(context, scanner, kGiftCardRe, kMatchFieldType, + return ParseFieldSpecifics(context, scanner, kGiftCardRe, kMatchParams, gift_card_patterns, nullptr, "kGiftCardRe"); } @@ -546,10 +550,10 @@ // If that fails, do a general regex search. size_t month_year_saved_cursor = scanner->SaveCursor(); - const auto kMatchCCType = - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTelephone, - MatchFieldType::kSelect, MatchFieldType::kSearch>; + const auto kMatchCCType = kDefaultMatchParamsWith< + FormControlType::kInputNumber, FormControlType::kInputTelephone, + FormControlType::kSelectOne, FormControlType::kSelectList, + FormControlType::kInputSearch>; base::span<const MatchPatternRef> cc_exp_month_patterns = GetMatchPatterns(CREDIT_CARD_EXP_MONTH, context);
diff --git a/components/autofill/core/browser/form_parsing/email_field.cc b/components/autofill/core/browser/form_parsing/email_field.cc index c1f25da..fe5b653 100644 --- a/components/autofill/core/browser/form_parsing/email_field.cc +++ b/components/autofill/core/browser/form_parsing/email_field.cc
@@ -17,7 +17,7 @@ base::span<const MatchPatternRef> email_patterns = GetMatchPatterns( "EMAIL_ADDRESS", context.page_language, context.pattern_source); if (ParseFieldSpecifics(context, scanner, kEmailRe, - kDefaultMatchParamsWith<MatchFieldType::kEmail>, + kDefaultMatchParamsWith<FormControlType::kInputEmail>, email_patterns, &field, "kEmailRe")) { return std::make_unique<EmailField>(field); }
diff --git a/components/autofill/core/browser/form_parsing/form_field.cc b/components/autofill/core/browser/form_parsing/form_field.cc index 4d8cc99..4ecac711 100644 --- a/components/autofill/core/browser/form_parsing/form_field.cc +++ b/components/autofill/core/browser/form_parsing/form_field.cc
@@ -354,9 +354,8 @@ const char* regex_name) { for (MatchPatternRef pattern_ref : patterns) { MatchingPattern pattern = *pattern_ref; - if (!MatchesFormControlType( - FormControlTypeToString(field.form_control_type), - pattern.match_field_input_types)) { + if (!MatchesFormControlType(field.form_control_type, + pattern.form_control_types)) { continue; } @@ -365,7 +364,7 @@ // negative pattern. If yes, remove it from the attributes that are // considered for positive matching. MatchParams match_type(pattern.match_field_attributes, - pattern.match_field_input_types); + pattern.form_control_types); if (!IsEmpty(pattern.negative_pattern)) { for (MatchAttribute attribute : pattern.match_field_attributes) { @@ -414,7 +413,7 @@ const AutofillField* field = scanner->Cursor(); - if (!MatchesFormControlType(FormControlTypeToString(field->form_control_type), + if (!MatchesFormControlType(field->form_control_type, match_type.field_types)) { return false; } @@ -439,9 +438,8 @@ for (MatchPatternRef pattern_ref : patterns) { MatchingPattern pattern = projection ? (*projection)(*pattern_ref) : *pattern_ref; - if (!MatchesFormControlType( - FormControlTypeToString(field->form_control_type), - pattern.match_field_input_types)) { + if (!MatchesFormControlType(field->form_control_type, + pattern.form_control_types)) { continue; } @@ -450,7 +448,7 @@ // pattern. If yes, remove it from the attributes that are considered for // positive matching. MatchParams match_type(pattern.match_field_attributes, - pattern.match_field_input_types); + pattern.form_control_types); if (!IsEmpty(pattern.negative_pattern)) { for (MatchAttribute attribute : pattern.match_field_attributes) { @@ -540,7 +538,14 @@ raw_ptr<AutofillField>* match) { return ParseFieldSpecificsWithLegacyPattern( context, scanner, kEmptyLabelRegex, - MatchParams({MatchAttribute::kLabel}, kAllMatchFieldTypes), match, + MatchParams( + {MatchAttribute::kLabel}, + {FormControlType::kInputEmail, FormControlType::kInputNumber, + FormControlType::kInputPassword, FormControlType::kInputSearch, + FormControlType::kInputTelephone, FormControlType::kInputText, + FormControlType::kSelectOne, FormControlType::kSelectList, + FormControlType::kTextArea}), + match, /*logging=*/{}); } @@ -684,35 +689,9 @@ } // static -bool FormField::MatchesFormControlType(std::string_view type, - DenseSet<MatchFieldType> match_type) { - if (match_type.contains(MatchFieldType::kText) && type == "text") - return true; - - if (match_type.contains(MatchFieldType::kEmail) && type == "email") - return true; - - if (match_type.contains(MatchFieldType::kTelephone) && type == "tel") - return true; - - if (match_type.contains(MatchFieldType::kSelect) && - (type == "select-one" || type == "selectlist")) { - return true; - } - - if (match_type.contains(MatchFieldType::kTextArea) && type == "textarea") - return true; - - if (match_type.contains(MatchFieldType::kPassword) && type == "password") - return true; - - if (match_type.contains(MatchFieldType::kNumber) && type == "number") - return true; - - if (match_type.contains(MatchFieldType::kSearch) && type == "search") - return true; - - return false; +bool FormField::MatchesFormControlType(FormControlType type, + DenseSet<FormControlType> match_type) { + return match_type.contains(type); } // static
diff --git a/components/autofill/core/browser/form_parsing/form_field.h b/components/autofill/core/browser/form_parsing/form_field.h index 4578fe1..45170ba 100644 --- a/components/autofill/core/browser/form_parsing/form_field.h +++ b/components/autofill/core/browser/form_parsing/form_field.h
@@ -24,6 +24,7 @@ #include "components/autofill/core/browser/form_parsing/field_candidates.h" #include "components/autofill/core/browser/form_parsing/regex_patterns.h" #include "components/autofill/core/common/autofill_features.h" +#include "components/autofill/core/common/form_field_data.h" #include "components/autofill/core/common/language_code.h" namespace autofill { @@ -284,9 +285,9 @@ float score, FieldCandidatesMap& field_candidates); - // Returns true iff |type| matches |match_type|. - static bool MatchesFormControlType(std::string_view type, - DenseSet<MatchFieldType> match_type); + // Returns true iff `type` matches `match_type`. + static bool MatchesFormControlType(FormControlType type, + DenseSet<FormControlType> match_type); protected: // Returns true if |field_type| is a single field parseable type.
diff --git a/components/autofill/core/browser/form_parsing/iban_field.cc b/components/autofill/core/browser/form_parsing/iban_field.cc index 33e49a6..46970d71 100644 --- a/components/autofill/core/browser/form_parsing/iban_field.cc +++ b/components/autofill/core/browser/form_parsing/iban_field.cc
@@ -19,8 +19,8 @@ IBAN_VALUE, context.page_language, context.pattern_source); if (ParseFieldSpecifics(context, scanner, kIbanRe, - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTextArea>, + kDefaultMatchParamsWith<FormControlType::kInputNumber, + FormControlType::kTextArea>, iban_patterns, &field, "kIbanRe")) { return std::make_unique<IbanField>(field); }
diff --git a/components/autofill/core/browser/form_parsing/internal_resources b/components/autofill/core/browser/form_parsing/internal_resources index f4dc712..15d8764 160000 --- a/components/autofill/core/browser/form_parsing/internal_resources +++ b/components/autofill/core/browser/form_parsing/internal_resources
@@ -1 +1 @@ -Subproject commit f4dc712c172a20560d4b834b8d42bdf751ec0bef +Subproject commit 15d876427e377dae1ebacaadea05c7c211a04194
diff --git a/components/autofill/core/browser/form_parsing/merchant_promo_code_field.cc b/components/autofill/core/browser/form_parsing/merchant_promo_code_field.cc index 0d7779b..c57dc196 100644 --- a/components/autofill/core/browser/form_parsing/merchant_promo_code_field.cc +++ b/components/autofill/core/browser/form_parsing/merchant_promo_code_field.cc
@@ -21,8 +21,8 @@ context.pattern_source); if (ParseFieldSpecifics(context, scanner, kMerchantPromoCodeRe, - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTextArea>, + kDefaultMatchParamsWith<FormControlType::kInputNumber, + FormControlType::kTextArea>, merchant_promo_code_patterns, &field, "kMerchantPromoCodeRe")) { return std::make_unique<MerchantPromoCodeField>(field);
diff --git a/components/autofill/core/browser/form_parsing/name_field.cc b/components/autofill/core/browser/form_parsing/name_field.cc index 611b7fb..6b33250 100644 --- a/components/autofill/core/browser/form_parsing/name_field.cc +++ b/components/autofill/core/browser/form_parsing/name_field.cc
@@ -242,10 +242,12 @@ } // Skip over any unrelated fields, e.g. "username" or "nickname". - if (ParseFieldSpecifics(context, scanner, kNameIgnoredRe, - kDefaultMatchParamsWith<MatchFieldType::kSelect, - MatchFieldType::kSearch>, - name_ignored_patterns, nullptr, "kNameIgnoredRe")) { + if (ParseFieldSpecifics( + context, scanner, kNameIgnoredRe, + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList, + FormControlType::kInputSearch>, + name_ignored_patterns, nullptr, "kNameIgnoredRe")) { continue; } @@ -441,10 +443,12 @@ } // Skip over any unrelated name fields, e.g. "username" or "nickname". - if (ParseFieldSpecifics(context, scanner, kNameIgnoredRe, - kDefaultMatchParamsWith<MatchFieldType::kSelect, - MatchFieldType::kSearch>, - name_ignored_patterns, nullptr, "kNameIgnoredRe")) { + if (ParseFieldSpecifics( + context, scanner, kNameIgnoredRe, + kDefaultMatchParamsWith<FormControlType::kSelectOne, + FormControlType::kSelectList, + FormControlType::kInputSearch>, + name_ignored_patterns, nullptr, "kNameIgnoredRe")) { continue; }
diff --git a/components/autofill/core/browser/form_parsing/numeric_quantity_field.cc b/components/autofill/core/browser/form_parsing/numeric_quantity_field.cc index 406dfcd..2ae9df6d 100644 --- a/components/autofill/core/browser/form_parsing/numeric_quantity_field.cc +++ b/components/autofill/core/browser/form_parsing/numeric_quantity_field.cc
@@ -22,8 +22,9 @@ if (ParseFieldSpecifics( context, scanner, kNumericQuantityRe, kDefaultMatchParamsWith< - MatchFieldType::kNumber, MatchFieldType::kSelect, - MatchFieldType::kTextArea, MatchFieldType::kSearch>, + FormControlType::kInputNumber, FormControlType::kSelectOne, + FormControlType::kSelectList, FormControlType::kTextArea, + FormControlType::kInputSearch>, quantity_patterns, &field, "kNumericQuantityRe")) { return base::WrapUnique(new NumericQuantityField(field)); }
diff --git a/components/autofill/core/browser/form_parsing/phone_field.cc b/components/autofill/core/browser/form_parsing/phone_field.cc index f4940e6..093050d 100644 --- a/components/autofill/core/browser/form_parsing/phone_field.cc +++ b/components/autofill/core/browser/form_parsing/phone_field.cc
@@ -142,8 +142,9 @@ AutofillField* field = scanner->Cursor(); // Return false if the field is not a selection box. - if (!MatchesFormControlType(FormControlTypeToString(field->form_control_type), - {MatchFieldType::kSelect})) { + if (!MatchesFormControlType( + field->form_control_type, + {FormControlType::kSelectOne, FormControlType::kSelectList})) { return false; } @@ -448,13 +449,14 @@ const char* regex_name, const bool is_country_code_field, const std::string& json_field_type) { - MatchParams match_type = kDefaultMatchParamsWith<MatchFieldType::kTelephone, - MatchFieldType::kNumber>; + MatchParams match_type = + kDefaultMatchParamsWith<FormControlType::kInputTelephone, + FormControlType::kInputNumber>; // Include the selection boxes too for the matching of the phone country code. if (is_country_code_field) { - match_type = kDefaultMatchParamsWith<MatchFieldType::kTelephone, - MatchFieldType::kNumber, - MatchFieldType::kSelect>; + match_type = kDefaultMatchParamsWith< + FormControlType::kInputTelephone, FormControlType::kInputNumber, + FormControlType::kSelectOne, FormControlType::kSelectList>; } base::span<const MatchPatternRef> patterns = GetMatchPatterns(
diff --git a/components/autofill/core/browser/form_parsing/price_field.cc b/components/autofill/core/browser/form_parsing/price_field.cc index d904e80..f60cbda5 100644 --- a/components/autofill/core/browser/form_parsing/price_field.cc +++ b/components/autofill/core/browser/form_parsing/price_field.cc
@@ -21,8 +21,9 @@ if (ParseFieldSpecifics( context, scanner, kPriceRe, kDefaultMatchParamsWith< - MatchFieldType::kNumber, MatchFieldType::kSelect, - MatchFieldType::kTextArea, MatchFieldType::kSearch>, + FormControlType::kInputNumber, FormControlType::kSelectOne, + FormControlType::kSelectList, FormControlType::kTextArea, + FormControlType::kInputSearch>, price_patterns, &field, "kPriceRe")) { return std::make_unique<PriceField>(field); }
diff --git a/components/autofill/core/browser/form_parsing/regex_patterns.cc b/components/autofill/core/browser/form_parsing/regex_patterns.cc index 7925ce9..aff93a5 100644 --- a/components/autofill/core/browser/form_parsing/regex_patterns.cc +++ b/components/autofill/core/browser/form_parsing/regex_patterns.cc
@@ -89,7 +89,7 @@ .match_field_attributes = is_supplementary() ? DenseSet<MatchAttribute>{MatchAttribute::kName} : p.match_field_attributes, - .match_field_input_types = p.match_field_input_types, + .form_control_types = p.form_control_types, }; }
diff --git a/components/autofill/core/browser/form_parsing/regex_patterns.h b/components/autofill/core/browser/form_parsing/regex_patterns.h index f6357f7..9f550bb 100644 --- a/components/autofill/core/browser/form_parsing/regex_patterns.h +++ b/components/autofill/core/browser/form_parsing/regex_patterns.h
@@ -35,15 +35,15 @@ // apply to the field's HTML name, not to the field's user-visible label. // // We use this for English patterns: we augment non-English languages with the - // English patterns, restricted to the Attribute::kName. The motivation is - // that the coding language also of non-English pages is often English. + // English patterns, restricted to the MatchAttribute::kName. The motivation + // is that the coding language also of non-English pages is often English. // // Representing the distinction between ordinary and supplementary patterns in // MatchPatternRef saves us from storing the supplementary MatchingPatterns // explicitly and saves some binary size. // // The dereferencing operator implements the restriction to - // MatchFieldType::kName of supplementary MatchPatternRef. + // MatchAttribute::kName of supplementary MatchPatternRef. // We choose a small integer to save memory in the generated arrays. // Since the generated code passes integer literals to the constructor, the
diff --git a/components/autofill/core/browser/form_parsing/regex_patterns_unittest.cc b/components/autofill/core/browser/form_parsing/regex_patterns_unittest.cc index 8772c13..e55f2a6 100644 --- a/components/autofill/core/browser/form_parsing/regex_patterns_unittest.cc +++ b/components/autofill/core/browser/form_parsing/regex_patterns_unittest.cc
@@ -168,7 +168,7 @@ EXPECT_EQ((*a).positive_pattern, (*b).positive_pattern); EXPECT_EQ((*a).negative_pattern, (*b).negative_pattern); EXPECT_EQ((*a).positive_score, (*b).positive_score); - EXPECT_EQ((*a).match_field_input_types, (*b).match_field_input_types); + EXPECT_EQ((*a).form_control_types, (*b).form_control_types); EXPECT_THAT((*a).match_field_attributes, Contains(MatchAttribute::kLabel)); EXPECT_THAT((*b).match_field_attributes, ElementsAre(MatchAttribute::kName)); }
diff --git a/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json b/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json index 2567cdf..2e55a1d 100644 --- a/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json +++ b/components/autofill/core/browser/form_parsing/resources/legacy_regex_patterns.json
@@ -10,7 +10,7 @@ "positive_score": 0.0, "negative_pattern": null, "match_field_attributes": [], - "match_field_input_types": [] + "form_control_types": [] } ] }, @@ -21,7 +21,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ] }, @@ -32,7 +32,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "de" : [ @@ -41,7 +41,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "es" : [ @@ -50,7 +50,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "ru" : [ @@ -59,7 +59,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "pt" : [ @@ -68,7 +68,7 @@ "positive_score": 1.1, "negative_pattern": "(do |de )endere[çc]o", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ] }, @@ -79,7 +79,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "es": [ @@ -88,7 +88,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "de": [ @@ -97,7 +97,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ru": [ @@ -106,7 +106,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "it": [ @@ -115,7 +115,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "fr": [ @@ -124,7 +124,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -135,7 +135,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "de": [ @@ -144,7 +144,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "pt": [ @@ -153,7 +153,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "es": [ @@ -162,7 +162,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ru": [ @@ -171,7 +171,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -182,7 +182,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -193,7 +193,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -202,7 +202,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -211,7 +211,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -222,7 +222,7 @@ "positive_score": 1.1, "negative_pattern": "e.?mail|re.?type|typed", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "es": [ @@ -231,7 +231,7 @@ "positive_score": 1.1, "negative_pattern": "e.?mail|correo|apellido|nombres", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "tr": [ @@ -240,7 +240,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "pt": [ @@ -249,7 +249,7 @@ "positive_score": 1.1, "negative_pattern": "e.?mail|eletrónico|usuário|nomes", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "id": [ @@ -258,7 +258,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -269,7 +269,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "de": [ @@ -278,7 +278,7 @@ "positive_score": 1.1, "negative_pattern": "confirma", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -287,7 +287,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -296,7 +296,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "it": [ @@ -305,7 +305,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -314,7 +314,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -323,7 +323,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "zh-CN": [ @@ -332,7 +332,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fa": [ @@ -341,7 +341,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ko": [ @@ -350,7 +350,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "id": [ @@ -359,7 +359,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -370,14 +370,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] }, { "positive_pattern": "(^\\W*address)|(address\\W*$)|(?:shipping|billing|mailing|pick.?up|drop.?off|delivery|sender|postal|recipient|home|work|office|school|business|mail)[\\s\\-]+address|address\\s+(of|for|to|from)|street.*(house|building|apartment|floor)|(house|building|apartment|floor).*street", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "de": [ @@ -386,7 +386,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "es": [ @@ -395,7 +395,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "fr": [ @@ -404,14 +404,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] }, { "positive_pattern": "adresse", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "it": [ @@ -420,14 +420,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] }, { "positive_pattern": "indirizzo", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "ja": [ @@ -436,14 +436,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] }, { "positive_pattern": "住所", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "pt": [ @@ -452,7 +452,7 @@ "positive_score": 1.1, "negative_pattern": "(do |de )endereço", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "ru": [ @@ -461,14 +461,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] }, { "positive_pattern": "улиц.*(дом|корпус|квартир|этаж)|(дом|корпус|квартир|этаж).*улиц", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "zh-CN": [ @@ -477,7 +477,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "tr": [ @@ -486,14 +486,14 @@ "positive_score": 1.1, "negative_pattern": "(\\b|_)adres tarifi(\\b|_)", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] }, { "positive_pattern": "(\\b|_)adres(\\b|_)|(sokak|cadde).*(apartman|bina|daire|mahalle)|(apartman|bina|daire|mahalle).*(sokak|cadde)", "positive_score": 1.1, "negative_pattern": "(\\b|_)adres tarifi(\\b|_)", "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "ko": [ @@ -502,7 +502,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } , { @@ -510,7 +510,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ], "id": [ @@ -519,7 +519,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } , { @@ -527,7 +527,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_SEARCH"] } ] }, @@ -538,14 +538,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] }, { "positive_pattern": "address|line", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "de": [ @@ -554,7 +554,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -563,7 +563,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -572,14 +572,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] }, { "positive_pattern": "adresse", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "it": [ @@ -588,14 +588,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] }, { "positive_pattern": "indirizzo", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -604,7 +604,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -613,7 +613,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -622,7 +622,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "zh-CN": [ @@ -631,14 +631,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] }, { "positive_pattern": "地址", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ko": [ @@ -647,14 +647,14 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] }, { "positive_pattern": "주소", "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -665,7 +665,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -674,7 +674,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "it": [ @@ -683,7 +683,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -694,7 +694,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -705,7 +705,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "es": [ @@ -714,7 +714,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "de": [ @@ -723,7 +723,7 @@ "positive_score": 1.1, "negative_pattern": "(\\b|_)land(\\b|_).*mark.*", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ja": [ @@ -732,7 +732,7 @@ "positive_score": 1.1, "negative_pattern": "(入|出)国", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "zh-CN": [ @@ -741,7 +741,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ko": [ @@ -750,7 +750,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "tr": [ @@ -759,7 +759,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "fa": [ @@ -768,7 +768,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "id": [ @@ -777,7 +777,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -788,7 +788,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["SELECT", "SEARCH"] + "form_control_types": ["SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -800,7 +800,7 @@ "negative_pattern": "\\.zip\\b", "negative_patterns_explainer": ".zip refers to a file extension. However, there are field billingAddress.zip", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] }, { "positive_pattern": "address\\.zip", @@ -808,7 +808,7 @@ "negative_pattern": null, "negative_patterns_explainer": "", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "de": [ @@ -817,7 +817,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "es": [ @@ -826,7 +826,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "fr": [ @@ -835,7 +835,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "it": [ @@ -844,7 +844,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ja": [ @@ -853,7 +853,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "pt": [ @@ -862,7 +862,7 @@ "positive_score": 1.1, "negative_pattern": "codigo.*segur", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ru": [ @@ -871,7 +871,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "hi": [ @@ -880,7 +880,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ml": [ @@ -889,7 +889,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "zh-CN": [ @@ -898,7 +898,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "zh-TW": [ @@ -907,7 +907,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "tr": [ @@ -916,7 +916,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ko": [ @@ -925,7 +925,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "id": [ @@ -934,7 +934,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -946,7 +946,7 @@ "negative_pattern": "\\.zip", "negative_patterns_explainer": ".zip refers to a file extension", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "pt": [ @@ -955,7 +955,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -966,7 +966,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "pt": [ @@ -975,7 +975,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "tr": [ @@ -984,7 +984,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "id": [ @@ -993,7 +993,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "es": [ @@ -1002,7 +1002,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -1013,7 +1013,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "de": [ @@ -1022,7 +1022,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "es": [ @@ -1031,7 +1031,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "fr": [ @@ -1040,7 +1040,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "it": [ @@ -1049,7 +1049,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ja": [ @@ -1058,7 +1058,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "pt": [ @@ -1067,7 +1067,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ru": [ @@ -1076,7 +1076,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "zh-TW": [ @@ -1085,7 +1085,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "fa": [ @@ -1094,7 +1094,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "hi": [ @@ -1103,7 +1103,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ml": [ @@ -1112,7 +1112,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "tr": [ @@ -1121,7 +1121,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ko": [ @@ -1130,7 +1130,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "id": [ @@ -1139,7 +1139,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -1150,7 +1150,7 @@ "positive_score": 1.1, "negative_pattern": "(united|hist|history).?state", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ja": [ @@ -1159,7 +1159,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "pt": [ @@ -1168,7 +1168,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ru": [ @@ -1177,7 +1177,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "zh-TW": [ @@ -1186,7 +1186,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ml": [ @@ -1195,7 +1195,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "fa": [ @@ -1204,7 +1204,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "hi": [ @@ -1213,7 +1213,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "tr": [ @@ -1222,7 +1222,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ko": [ @@ -1231,7 +1231,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "id": [ @@ -1240,7 +1240,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -1251,7 +1251,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "pt": [ @@ -1261,7 +1261,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1272,7 +1272,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1283,7 +1283,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "pt": [ @@ -1292,7 +1292,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "es": [ @@ -1301,7 +1301,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1312,7 +1312,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "es": [ @@ -1321,7 +1321,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1332,7 +1332,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "es": [ @@ -1341,7 +1341,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1352,7 +1352,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1363,7 +1363,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1374,7 +1374,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH", "SELECT"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH", "SELECT_ONE", "SELECT_LIST"] } ], "es": [ @@ -1383,7 +1383,7 @@ "positive_score": 1.1, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH", "SELECT"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH", "SELECT_ONE", "SELECT_LIST"] } ] }, @@ -1394,7 +1394,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "de": [ @@ -1403,7 +1403,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "zh-CN": [ @@ -1412,7 +1412,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "ja": [ @@ -1421,7 +1421,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "fr": [ @@ -1430,7 +1430,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "pt": [ @@ -1439,7 +1439,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "fa": [ @@ -1448,7 +1448,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ], "ru": [ @@ -1457,7 +1457,7 @@ "positive_score": 0.8, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_SEARCH"] } ] }, @@ -1468,7 +1468,7 @@ "positive_score": 0.95, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "TEXT_AREA", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "TEXT_AREA", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -1479,7 +1479,7 @@ "positive_score": 0.95, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "TEXT_AREA", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "TEXT_AREA", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ar": [ @@ -1488,7 +1488,7 @@ "positive_score": 0.95, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "TEXT_AREA", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "TEXT_AREA", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "fa": [ @@ -1497,7 +1497,7 @@ "positive_score": 0.95, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "TEXT_AREA", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "TEXT_AREA", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "fr": [ @@ -1506,7 +1506,7 @@ "positive_score": 0.95, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "TEXT_AREA", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "TEXT_AREA", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -1517,7 +1517,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "de": [ @@ -1526,7 +1526,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -1535,7 +1535,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -1544,7 +1544,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "it": [ @@ -1553,7 +1553,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -1562,7 +1562,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -1572,7 +1572,7 @@ "positive_score": 1.0, "negative_pattern": "do titular do cartão", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -1581,7 +1581,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "zh-CN": [ @@ -1590,7 +1590,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "id": [ @@ -1599,7 +1599,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -1610,7 +1610,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -1621,7 +1621,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "de": [ @@ -1630,7 +1630,7 @@ "positive_score": 1.0, "negative_pattern": "(telefon|haus|person|fødsels|kunden)nummer", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "ja": [ @@ -1639,7 +1639,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "ru": [ @@ -1648,7 +1648,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "zh-CN": [ @@ -1657,7 +1657,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "zh-TW": [ @@ -1666,7 +1666,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "ko": [ @@ -1675,7 +1675,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "es": [ @@ -1684,7 +1684,7 @@ "positive_score": 1.0, "negative_pattern": "(numero|número|numéro).*(document|fono|phone|réservation)", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "pt": [ @@ -1693,7 +1693,7 @@ "positive_score": 1.0, "negative_pattern": "(numero|número|numéro).*(document|fono|phone|réservation)", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "fr": [ @@ -1702,7 +1702,7 @@ "positive_score": 1.0, "negative_pattern": "(numero|número|numéro).*(document|fono|phone|réservation)", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "id": [ @@ -1711,7 +1711,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ] }, @@ -1722,7 +1722,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "br": [ @@ -1731,7 +1731,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ], "es": [ @@ -1740,7 +1740,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "PASSWORD", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_PASSWORD", "INPUT_NUMBER"] } ] }, @@ -1751,7 +1751,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "de": [ @@ -1760,7 +1760,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "es": [ @@ -1769,7 +1769,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "fr": [ @@ -1778,7 +1778,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "it": [ @@ -1787,7 +1787,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ja": [ @@ -1796,7 +1796,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "pt": [ @@ -1805,7 +1805,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ru": [ @@ -1814,7 +1814,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "zh-CN": [ @@ -1823,7 +1823,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "id": [ @@ -1832,7 +1832,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -1843,7 +1843,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "de": [ @@ -1852,7 +1852,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "es": [ @@ -1861,7 +1861,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "it": [ @@ -1870,7 +1870,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ja": [ @@ -1879,7 +1879,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "pt": [ @@ -1888,7 +1888,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ru": [ @@ -1897,7 +1897,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "zh-CN": [ @@ -1906,7 +1906,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "id": [ @@ -1915,7 +1915,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -1926,7 +1926,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -1937,7 +1937,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -1948,7 +1948,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "de": [ @@ -1957,7 +1957,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "es": [ @@ -1966,7 +1966,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "fr": [ @@ -1975,7 +1975,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "it": [ @@ -1984,7 +1984,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ja": [ @@ -1993,7 +1993,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "pt": [ @@ -2002,7 +2002,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ], "ru": [ @@ -2011,7 +2011,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -2022,7 +2022,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -2033,7 +2033,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -2044,7 +2044,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -2055,7 +2055,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -2066,7 +2066,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER", "INPUT_SEARCH"] } ] }, @@ -2077,7 +2077,7 @@ "positive_score": 1.0, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST"] } ] }, @@ -2088,7 +2088,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "fr": [ @@ -2097,7 +2097,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "es": [ @@ -2106,7 +2106,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "ja": [ @@ -2115,7 +2115,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "ru": [ @@ -2124,7 +2124,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "zh-CN": [ @@ -2133,7 +2133,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "zh-TW": [ @@ -2142,7 +2142,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "ml": [ @@ -2151,7 +2151,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "fa": [ @@ -2160,7 +2160,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "hi": [ @@ -2169,7 +2169,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "tr": [ @@ -2178,7 +2178,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ], "ko": [ @@ -2187,7 +2187,7 @@ "positive_score": 1.4, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "EMAIL"] + "form_control_types": ["INPUT_TEXT", "INPUT_EMAIL"] } ] }, @@ -2198,7 +2198,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "de": [ @@ -2207,7 +2207,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "zh-CN": [ @@ -2216,7 +2216,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ], "ko": [ @@ -2225,7 +2225,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "SELECT", "SEARCH"] + "form_control_types": ["INPUT_TEXT", "SELECT_ONE", "SELECT_LIST", "INPUT_SEARCH"] } ] }, @@ -2236,7 +2236,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -2245,7 +2245,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -2254,7 +2254,7 @@ "positive_score": 0.9, "negative_pattern": "^nom[a-zA-Z]", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -2263,7 +2263,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -2272,7 +2272,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fa": [ @@ -2281,7 +2281,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "zh-CN": [ @@ -2290,7 +2290,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -2299,7 +2299,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "tr": [ @@ -2308,7 +2308,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ko": [ @@ -2317,7 +2317,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "id": [ @@ -2326,7 +2326,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2337,7 +2337,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -2346,7 +2346,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -2355,7 +2355,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2366,7 +2366,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "de": [ @@ -2375,7 +2375,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -2384,7 +2384,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -2393,7 +2393,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -2402,7 +2402,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -2411,7 +2411,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -2420,7 +2420,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fa": [ @@ -2429,7 +2429,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ko": [ @@ -2438,7 +2438,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ml": [ @@ -2447,7 +2447,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "tr": [ @@ -2456,7 +2456,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "hi": [ @@ -2465,7 +2465,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "id": [ @@ -2474,7 +2474,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2485,7 +2485,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2496,7 +2496,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2507,7 +2507,7 @@ "positive_score": 0.9, "negative_pattern": "surname\\d", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "de": [ @@ -2516,7 +2516,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -2525,7 +2525,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -2534,7 +2534,7 @@ "positive_score": 0.9, "negative_pattern": "^nom[a-zA-Z]", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "it": [ @@ -2543,7 +2543,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -2552,7 +2552,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "pt": [ @@ -2561,7 +2561,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -2570,7 +2570,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fa": [ @@ -2579,7 +2579,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "hi": [ @@ -2588,7 +2588,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ml": [ @@ -2597,7 +2597,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "tr": [ @@ -2606,7 +2606,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ko": [ @@ -2615,7 +2615,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "id": [ @@ -2624,7 +2624,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2635,7 +2635,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2646,7 +2646,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2657,7 +2657,7 @@ "positive_score": 0.9, "negative_pattern": "salutation and given name", "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "de": [ @@ -2666,7 +2666,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -2675,7 +2675,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "it": [ @@ -2684,7 +2684,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -2693,7 +2693,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ru": [ @@ -2702,7 +2702,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "el": [ @@ -2711,7 +2711,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "tr": [ @@ -2720,7 +2720,7 @@ "positive_score": 0.9, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2731,7 +2731,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "de": [ @@ -2740,7 +2740,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "es": [ @@ -2749,7 +2749,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "fr": [ @@ -2758,7 +2758,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ja": [ @@ -2767,7 +2767,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "pt": [ @@ -2776,7 +2776,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ru": [ @@ -2785,7 +2785,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "hi": [ @@ -2794,7 +2794,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "tr": [ @@ -2803,7 +2803,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "zh-CN": [ @@ -2812,7 +2812,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ml": [ @@ -2821,7 +2821,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ko": [ @@ -2830,7 +2830,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "id": [ @@ -2839,7 +2839,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2850,7 +2850,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -2861,7 +2861,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "SELECT", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "SELECT_ONE", "SELECT_LIST", "INPUT_NUMBER"] } ] }, @@ -2872,7 +2872,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2883,7 +2883,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "ko": [ @@ -2892,7 +2892,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2903,7 +2903,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2914,7 +2914,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2925,7 +2925,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "fr": [ @@ -2934,7 +2934,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "pt": [ @@ -2943,7 +2943,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2954,7 +2954,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2965,7 +2965,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ], "pt": [ @@ -2974,7 +2974,7 @@ "positive_score": 1.3, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TELEPHONE", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "INPUT_TELEPHONE", "INPUT_NUMBER"] } ] }, @@ -2985,7 +2985,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "fr": [ @@ -2994,7 +2994,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -3003,7 +3003,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -3012,7 +3012,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -3023,7 +3023,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -3032,7 +3032,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -3041,7 +3041,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -3052,7 +3052,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -3061,7 +3061,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -3070,7 +3070,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -3081,7 +3081,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "es": [ @@ -3090,7 +3090,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ], "ja": [ @@ -3099,7 +3099,7 @@ "positive_score": 1.2, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -3110,7 +3110,7 @@ "positive_score": 0.85, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT"] + "form_control_types": ["INPUT_TEXT"] } ] }, @@ -3121,7 +3121,7 @@ "positive_score": 0.975, "negative_pattern": null, "match_field_attributes": ["LABEL", "NAME"], - "match_field_input_types": ["TEXT", "TEXT_AREA", "NUMBER"] + "form_control_types": ["INPUT_TEXT", "TEXT_AREA", "INPUT_NUMBER"] } ] }
diff --git a/components/autofill/core/browser/form_parsing/search_field.cc b/components/autofill/core/browser/form_parsing/search_field.cc index ad5fa10..746fca0 100644 --- a/components/autofill/core/browser/form_parsing/search_field.cc +++ b/components/autofill/core/browser/form_parsing/search_field.cc
@@ -19,8 +19,8 @@ SEARCH_TERM, context.page_language, context.pattern_source); if (ParseFieldSpecifics(context, scanner, kSearchTermRe, - kDefaultMatchParamsWith<MatchFieldType::kSearch, - MatchFieldType::kTextArea>, + kDefaultMatchParamsWith<FormControlType::kInputSearch, + FormControlType::kTextArea>, patterns, &field, "kSearchTermRe")) { return std::make_unique<SearchField>(field); }
diff --git a/components/autofill/core/browser/form_parsing/standalone_cvc_field.cc b/components/autofill/core/browser/form_parsing/standalone_cvc_field.cc index 4b2f5f56..0b12e2bf 100644 --- a/components/autofill/core/browser/form_parsing/standalone_cvc_field.cc +++ b/components/autofill/core/browser/form_parsing/standalone_cvc_field.cc
@@ -34,9 +34,9 @@ // CVC fields can occur in many different field types so we check for each const auto kMatchNumTelAndPwd = - kDefaultMatchParamsWith<MatchFieldType::kNumber, - MatchFieldType::kTelephone, - MatchFieldType::kPassword>; + kDefaultMatchParamsWith<FormControlType::kInputNumber, + FormControlType::kInputTelephone, + FormControlType::kInputPassword>; if (ParseFieldSpecifics(context, scanner, kCardCvcRe, kMatchNumTelAndPwd, cvc_patterns, &field, "kCardCvcRe(standalone)")) { return std::make_unique<StandaloneCvcField>(field); @@ -54,15 +54,15 @@ return false; } - const auto kMatchFieldType = kDefaultMatchParamsWith< - MatchFieldType::kNumber, MatchFieldType::kTelephone, - MatchFieldType::kSearch, MatchFieldType::kPassword>; + const auto kMatchParams = kDefaultMatchParamsWith< + FormControlType::kInputNumber, FormControlType::kInputTelephone, + FormControlType::kInputSearch, FormControlType::kInputPassword>; base::span<const MatchPatternRef> gift_card_patterns = GetMatchPatterns( "GIFT_CARD", context.page_language, context.pattern_source); size_t saved_cursor = scanner->SaveCursor(); const bool gift_card_match = - ParseFieldSpecifics(context, scanner, kGiftCardRe, kMatchFieldType, + ParseFieldSpecifics(context, scanner, kGiftCardRe, kMatchParams, gift_card_patterns, nullptr, "kGiftCardRe"); // MatchGiftCard only wants to test the presence of a gift card but not // consume the field.
diff --git a/components/autofill/core/browser/form_parsing/transpile_regex_patterns.py b/components/autofill/core/browser/form_parsing/transpile_regex_patterns.py index 405faca..f18b7e9 100755 --- a/components/autofill/core/browser/form_parsing/transpile_regex_patterns.py +++ b/components/autofill/core/browser/form_parsing/transpile_regex_patterns.py
@@ -98,11 +98,11 @@ def json_to_cpp_match_field_attributes(enum_values): return json_to_cpp_dense_set(enum_values, 'MatchAttribute') - # Maps a list of strings to a DenseSet<MatchFieldType> expression. - # The strings must be the names of MatchFieldType constants, e.g., TEXT_AREA. + # Maps a list of strings to a DenseSet<FormControlType> expression. + # The strings must be the names of FormControlType constants, e.g., TEXT_AREA. # They're mapped to C++ constants, e.g., kTextArea. - def json_to_cpp_match_field_input_types(enum_values): - return json_to_cpp_dense_set(enum_values, 'MatchFieldType') + def json_to_cpp_form_control_types(enum_values): + return json_to_cpp_dense_set(enum_values, 'FormControlType') # Maps a JSON object representing a pattern to a C++ MatchingPattern # expression. @@ -112,14 +112,14 @@ positive_score = json['positive_score'] match_field_attributes = json_to_cpp_match_field_attributes( json['match_field_attributes']) - match_field_input_types = json_to_cpp_match_field_input_types( - json['match_field_input_types']) + form_control_types = json_to_cpp_form_control_types( + json['form_control_types']) return f'MatchingPattern{{\n' \ f' .positive_pattern = {positive_pattern},\n' \ f' .negative_pattern = {negative_pattern},\n' \ f' .positive_score = {positive_score},\n' \ f' .match_field_attributes = {match_field_attributes},\n' \ - f' .match_field_input_types = {match_field_input_types},\n' \ + f' .form_control_types = {form_control_types},\n' \ f'}}' # Name of the auxiliary C++ constant.
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index 1fe940b..2c7804b 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "29.9", - "log_list_timestamp": "2023-12-28T12:57:12Z", + "version": "29.10", + "log_list_timestamp": "2023-12-29T12:55:32Z", "operators": [ { "name": "Google",
diff --git a/components/webauthn/android/BUILD.gn b/components/webauthn/android/BUILD.gn index 5606cec..7085020 100644 --- a/components/webauthn/android/BUILD.gn +++ b/components/webauthn/android/BUILD.gn
@@ -43,10 +43,14 @@ "java/src/org/chromium/components/webauthn/MakeCredentialResponseCallback.java", "java/src/org/chromium/components/webauthn/WebAuthnBrowserBridge.java", "java/src/org/chromium/components/webauthn/WebAuthnCredentialDetails.java", + "java/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelper.java", + "java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java", "java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java", "java/src/org/chromium/components/webauthn/cred_man/CredManMetricsHelper.java", + "java/src/org/chromium/components/webauthn/cred_man/CredManRequestDecorator.java", "java/src/org/chromium/components/webauthn/cred_man/CredManSupportProvider.java", "java/src/org/chromium/components/webauthn/cred_man/CredManUiModeRecommender.java", + "java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java", ] jar_excluded_patterns = [ "*/cred_man/CredManUiModeRecommender.class" ] @@ -160,7 +164,10 @@ "junit/src/org/chromium/components/webauthn/BarrierTest.java", "junit/src/org/chromium/components/webauthn/Fido2CredentialRequestRobolectricTest.java", "junit/src/org/chromium/components/webauthn/ShadowWebContentStatics.java", + "junit/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelperRobolectricTest.java", + "junit/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelperRobolectricTest.java", "junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java", + "junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java", "junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialException.java", "junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialRequest.java", "junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialResponse.java",
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java index bd7dea7..2926bea 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java
@@ -38,6 +38,7 @@ import org.chromium.components.payments.PaymentFeatureList; import org.chromium.components.webauthn.cred_man.CredManHelper; import org.chromium.components.webauthn.cred_man.CredManSupportProvider; +import org.chromium.components.webauthn.cred_man.GpmCredManRequestDecorator; import org.chromium.content_public.browser.ClientDataJson; import org.chromium.content_public.browser.ClientDataRequestType; import org.chromium.content_public.browser.RenderFrameHost; @@ -116,7 +117,9 @@ public Fido2CredentialRequest(FidoIntentSender intentSender) { mIntentSender = intentSender; mPlayServicesAvailable = Fido2ApiCallHelper.getInstance().arePlayServicesAvailable(); - mCredManHelper = new CredManHelper(this, mPlayServicesAvailable); + mCredManHelper = + new CredManHelper( + this, mPlayServicesAvailable, GpmCredManRequestDecorator.getInstance()); mBarrier = new Barrier(this::returnErrorAndResetCallback); }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelper.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelper.java new file mode 100644 index 0000000..b005ad4 --- /dev/null +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelper.java
@@ -0,0 +1,110 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import static org.chromium.components.webauthn.cred_man.CredManHelper.CRED_MAN_PREFIX; +import static org.chromium.components.webauthn.cred_man.CredManHelper.TYPE_PASSKEY; + +import android.credentials.CreateCredentialRequest; +import android.os.Build; +import android.os.Bundle; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; + +/** + * This class is responsible for holding the arguments to create a valid {@link + * CreateCredentialRequest}. The request can be formed using the `getCreateCredentialRequest` + * method. + */ +class CredManCreateCredentialRequestHelper { + private static CredManCreateCredentialRequestHelper sInstanceForTesting; + + private String mRequestAsJson; + private byte[] mClientDataHash; + @Nullable private String mOrigin; + @Nullable private byte[] mUserId; + + static class Builder { + private CredManCreateCredentialRequestHelper mHelper; + + Builder(String requestAsJson, byte[] clientDataHash) { + mHelper = CredManCreateCredentialRequestHelper.getInstance(); + mHelper.mRequestAsJson = requestAsJson; + mHelper.mClientDataHash = clientDataHash; + } + + Builder setUserId(byte[] userId) { + mHelper.mUserId = userId; + return this; + } + + Builder setOrigin(String origin) { + mHelper.mOrigin = origin; + return this; + } + + CredManCreateCredentialRequestHelper build() { + return mHelper; + } + } + + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + CreateCredentialRequest getCreateCredentialRequest( + @Nullable CredManRequestDecorator decorator) { + final Bundle requestBundle = getBundleForRequest(decorator); + var builder = + new CreateCredentialRequest.Builder(TYPE_PASSKEY, requestBundle, requestBundle) + .setAlwaysSendAppInfoToProvider(true); + if (decorator != null) { + decorator.updateCreateCredentialRequestBuilder(builder, this); + } + return builder.build(); + } + + String getOrigin() { + return mOrigin; + } + + byte[] getUserId() { + return mUserId; + } + + private static CredManCreateCredentialRequestHelper getInstance() { + if (sInstanceForTesting == null) return new CredManCreateCredentialRequestHelper(); + return sInstanceForTesting; + } + + public static void setInstanceForTesting( + CredManCreateCredentialRequestHelper instanceForTesting) { + sInstanceForTesting = instanceForTesting; + } + + private Bundle getBundleForRequest(@Nullable CredManRequestDecorator decorator) { + Bundle bundle = getBaseCreateCredentialRequestBundle(); + if (decorator != null) { + decorator.updateCreateCredentialRequestBundle(bundle, this); + } + return bundle; + } + + private Bundle getBaseCreateCredentialRequestBundle() { + Bundle createCredentialRequestBundle = new Bundle(); + // The CreateCredentialRequest is for a public key credential. + createCredentialRequestBundle.putString( + CRED_MAN_PREFIX + "BUNDLE_KEY_SUBTYPE", + CRED_MAN_PREFIX + "BUNDLE_VALUE_SUBTYPE_CREATE_PUBLIC_KEY_CREDENTIAL_REQUEST"); + // The PublicKeyCredentialCreationOptions JSON as string. @see + // https://w3c.github.io/webauthn/#dictdef-publickeycredentialcreationoptionsjson + createCredentialRequestBundle.putString( + CRED_MAN_PREFIX + "BUNDLE_KEY_REQUEST_JSON", mRequestAsJson); + // The SHA-256 of the ClientDataJSON as byte array. + createCredentialRequestBundle.putByteArray( + CRED_MAN_PREFIX + "BUNDLE_KEY_CLIENT_DATA_HASH", mClientDataHash); + return createCredentialRequestBundle; + } + + private CredManCreateCredentialRequestHelper() {} +}
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java new file mode 100644 index 0000000..50228ec --- /dev/null +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java
@@ -0,0 +1,199 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import static org.chromium.components.webauthn.cred_man.CredManHelper.CRED_MAN_PREFIX; +import static org.chromium.components.webauthn.cred_man.CredManHelper.TYPE_PASSKEY; + +import android.credentials.CredentialOption; +import android.credentials.GetCredentialRequest; +import android.os.Build; +import android.os.Bundle; + +import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; + +import org.chromium.content_public.browser.RenderFrameHost; + +/** + * This class is responsible for holding the arguments to create a valid {@link + * GetCredentialRequest}. The request can be formed using the `getGetCredentialRequest` method. + */ +class CredManGetCredentialRequestHelper { + private static CredManGetCredentialRequestHelper sInstanceForTesting; + + // Auto-select means that, when an allowlist is present and one of the providers matches with + // it, the account selector can be skipped. (However, if two or more providers match with the + // allowlist then the selector will, sadly, still be shown.) + private static final String IS_AUTO_SELECT_ALLOWED = + CRED_MAN_PREFIX + "BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED"; + private static final String TYPE_PASSWORD_CREDENTIAL = + "android.credentials.TYPE_PASSWORD_CREDENTIAL"; + + private String mRequestAsJson; + private byte[] mClientDataHash; + private boolean mPreferImmediatelyAvailable; + private boolean mAllowAutoSelect; + private boolean mRequestPasswords; + + @Nullable private String mOrigin; + private boolean mPlayServicesAvailable; + private boolean mIgnoreGpm; + @Nullable private RenderFrameHost mRenderFrameHost; + + static class Builder { + private CredManGetCredentialRequestHelper mHelper; + + Builder( + String requestAsJson, + byte[] clientDataHash, + boolean preferImmediatelyAvailable, + boolean allowAutoSelect, + boolean requestPasswords) { + mHelper = CredManGetCredentialRequestHelper.getInstance(); + mHelper.mRequestAsJson = requestAsJson; + mHelper.mClientDataHash = clientDataHash; + mHelper.mPreferImmediatelyAvailable = preferImmediatelyAvailable; + mHelper.mAllowAutoSelect = allowAutoSelect; + mHelper.mRequestPasswords = requestPasswords; + } + + Builder setOrigin(String origin) { + mHelper.mOrigin = origin; + return this; + } + + Builder setPlayServicesAvailable(boolean playServicesAvailable) { + mHelper.mPlayServicesAvailable = playServicesAvailable; + return this; + } + + Builder setIgnoreGpm(boolean ignoreGpm) { + mHelper.mIgnoreGpm = ignoreGpm; + return this; + } + + Builder setRenderFrameHost(RenderFrameHost renderFrameHost) { + mHelper.mRenderFrameHost = renderFrameHost; + return this; + } + + CredManGetCredentialRequestHelper build() { + if (sInstanceForTesting != null) return sInstanceForTesting; + return mHelper; + } + } + + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + GetCredentialRequest getGetCredentialRequest(@Nullable CredManRequestDecorator decorator) { + final Bundle requestBundle = getGetCredentialRequestBundle(decorator); + var builder = new GetCredentialRequest.Builder(requestBundle); + final CredentialOption publicKeyCredentialOption = getPublicKeyCredentialOption(decorator); + final CredentialOption passwordCredentialOption = getPasswordCredentialOption(decorator); + if (decorator != null) { + decorator.updateGetCredentialRequestBuilder(builder, this); + } + builder.addCredentialOption(publicKeyCredentialOption); + if (passwordCredentialOption != null) builder.addCredentialOption(passwordCredentialOption); + return builder.build(); + } + + boolean getPreferImmediatelyAvailable() { + return mPreferImmediatelyAvailable; + } + + @Nullable + String getOrigin() { + return mOrigin; + } + + boolean getPlayServicesAvailable() { + return mPlayServicesAvailable; + } + + boolean getIgnoreGpm() { + return mIgnoreGpm; + } + + @Nullable + RenderFrameHost getRenderFrameHost() { + return mRenderFrameHost; + } + + private Bundle getGetCredentialRequestBundle(@Nullable CredManRequestDecorator decorator) { + Bundle bundle = getBaseGetCredentialRequestBundle(); + if (decorator != null) { + decorator.updateGetCredentialRequestBundle(bundle, this); + } + return bundle; + } + + private Bundle getBaseGetCredentialRequestBundle() { + Bundle getCredentialRequestBundle = new Bundle(); + getCredentialRequestBundle.putBoolean( + CRED_MAN_PREFIX + "BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS", + mPreferImmediatelyAvailable); + return getCredentialRequestBundle; + } + + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + private CredentialOption getPublicKeyCredentialOption( + @Nullable CredManRequestDecorator decorator) { + Bundle publicKeyCredentialOptionBundle = getBasePublicKeyCredentialOptionBundle(); + if (decorator != null) { + decorator.updatePublicKeyCredentialOptionBundle(publicKeyCredentialOptionBundle, this); + } + CredentialOption publicKeyCredentialOption = + new CredentialOption.Builder( + TYPE_PASSKEY, + publicKeyCredentialOptionBundle, + publicKeyCredentialOptionBundle) + .build(); + return publicKeyCredentialOption; + } + + private Bundle getBasePublicKeyCredentialOptionBundle() { + Bundle publicKeyCredentialOptionBundle = new Bundle(); + publicKeyCredentialOptionBundle.putString( + CRED_MAN_PREFIX + "BUNDLE_KEY_SUBTYPE", + CRED_MAN_PREFIX + "BUNDLE_VALUE_SUBTYPE_GET_PUBLIC_KEY_CREDENTIAL_OPTION"); + publicKeyCredentialOptionBundle.putString( + CRED_MAN_PREFIX + "BUNDLE_KEY_REQUEST_JSON", mRequestAsJson); + publicKeyCredentialOptionBundle.putByteArray( + CRED_MAN_PREFIX + "BUNDLE_KEY_CLIENT_DATA_HASH", mClientDataHash); + publicKeyCredentialOptionBundle.putBoolean(IS_AUTO_SELECT_ALLOWED, mAllowAutoSelect); + return publicKeyCredentialOptionBundle; + } + + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + private @Nullable CredentialOption getPasswordCredentialOption( + @Nullable CredManRequestDecorator decorator) { + if (!mRequestPasswords) return null; + Bundle passwordCredentialOptionBundle = new Bundle(); + if (decorator != null) { + decorator.updatePasswordCredentialOptionBundle(passwordCredentialOptionBundle, this); + } + var builder = + new CredentialOption.Builder( + TYPE_PASSWORD_CREDENTIAL, + passwordCredentialOptionBundle, + passwordCredentialOptionBundle); + if (decorator != null) { + decorator.updatePasswordCredentialOptionBuilder(builder, this); + } + return builder.build(); + } + + private static CredManGetCredentialRequestHelper getInstance() { + if (sInstanceForTesting != null) return sInstanceForTesting; + return new CredManGetCredentialRequestHelper(); + } + + public static void setInstanceForTesting(CredManGetCredentialRequestHelper instanceForTesting) { + sInstanceForTesting = instanceForTesting; + } + + private CredManGetCredentialRequestHelper() {} +}
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java index 4ba7e05..8891fc766b 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java
@@ -4,13 +4,11 @@ package org.chromium.components.webauthn.cred_man; -import android.content.ComponentName; import android.content.Context; import android.credentials.CreateCredentialException; import android.credentials.CreateCredentialRequest; import android.credentials.CreateCredentialResponse; import android.credentials.CredentialManager; -import android.credentials.CredentialOption; import android.credentials.GetCredentialException; import android.credentials.GetCredentialRequest; import android.credentials.GetCredentialResponse; @@ -19,7 +17,6 @@ import android.os.Bundle; import android.os.OutcomeReceiver; import android.os.SystemClock; -import android.util.Base64; import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; @@ -32,7 +29,6 @@ import org.chromium.blink.mojom.PaymentOptions; import org.chromium.blink.mojom.PublicKeyCredentialCreationOptions; import org.chromium.blink.mojom.PublicKeyCredentialRequestOptions; -import org.chromium.components.version_info.VersionInfo; import org.chromium.components.webauthn.Barrier; import org.chromium.components.webauthn.Fido2CredentialRequest.ConditionalUiState; import org.chromium.components.webauthn.Fido2CredentialRequestJni; @@ -45,14 +41,11 @@ import org.chromium.content_public.browser.ClientDataJson; import org.chromium.content_public.browser.ClientDataRequestType; import org.chromium.content_public.browser.RenderFrameHost; -import org.chromium.content_public.browser.WebContents; -import org.chromium.content_public.browser.WebContentsStatics; import org.chromium.url.Origin; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.Set; public class CredManHelper { // These two values are formed differently because they come from the @@ -61,23 +54,10 @@ public static final String CRED_MAN_EXCEPTION_CREATE_CREDENTIAL_TYPE_INVALID_STATE_ERROR = "androidx.credentials.TYPE_CREATE_PUBLIC_KEY_CREDENTIAL_DOM_EXCEPTION/androidx.credentials.TYPE_INVALID_STATE_ERROR"; - public static final String CRED_MAN_IS_AUTO_SELECT_ALLOWED = - "androidx.credentials.BUNDLE_KEY_IS_AUTO_SELECT_ALLOWED"; + protected static final String CRED_MAN_PREFIX = "androidx.credentials."; + protected static final String TYPE_PASSKEY = CRED_MAN_PREFIX + "TYPE_PUBLIC_KEY_CREDENTIAL"; - private static final String CHANNEL_KEY = "com.android.chrome.CHANNEL"; - private static final String INCOGNITO_KEY = "com.android.chrome.INCOGNITO"; - private static final String CRED_MAN_PREFIX = "androidx.credentials."; - private static final ComponentName GPM_COMPONENT_NAME = - ComponentName.createRelative( - "com.google.android.gms", - ".auth.api.credentials.credman.service.PasswordAndPasskeyService"); - private static final String PASSWORDS_ONLY_FOR_THE_CHANNEL = - "com.android.chrome.PASSWORDS_ONLY_FOR_THE_CHANNEL"; - private static final String PASSWORDS_WITH_NO_USERNAME_INCLUDED = - "com.android.chrome.PASSWORDS_WITH_NO_USERNAME_INCLUDED"; - private static final String IGNORE_GPM = "com.android.chrome.GPM_IGNORE"; private static final String TAG = "CredManHelper"; - private static final String TYPE_PASSKEY = CRED_MAN_PREFIX + "TYPE_PUBLIC_KEY_CREDENTIAL"; private Callback<Integer> mErrorCallback; private Barrier mBarrier; @@ -88,6 +68,7 @@ private byte[] mClientDataJson; private ConditionalUiState mConditionalUiState = ConditionalUiState.NONE; private Context mContext; + private CredManRequestDecorator mCredManRequestDecorator; private CredManMetricsHelper mMetricsHelper; private RenderFrameHost mFrameHost; private Runnable mNoCredentialsFallback; @@ -96,10 +77,14 @@ WebAuthnBrowserBridge getBridge(); } - public CredManHelper(BridgeProvider bridgeProvider, boolean playServicesAvailable) { + public CredManHelper( + BridgeProvider bridgeProvider, + boolean playServicesAvailable, + CredManRequestDecorator credManRequestDecorator) { mMetricsHelper = new CredManMetricsHelper(); mBridgeProvider = bridgeProvider; mPlayServicesAvailable = playServicesAvailable; + mCredManRequestDecorator = credManRequestDecorator; } /** Create a credential using the Android 14 CredMan API. */ @@ -133,26 +118,6 @@ return AuthenticatorStatus.NOT_ALLOWED_ERROR; } - final Bundle requestBundle = new Bundle(); - requestBundle.putString( - CRED_MAN_PREFIX + "BUNDLE_KEY_SUBTYPE", - CRED_MAN_PREFIX + "BUNDLE_VALUE_SUBTYPE_CREATE_PUBLIC_KEY_CREDENTIAL_REQUEST"); - requestBundle.putString(CRED_MAN_PREFIX + "BUNDLE_KEY_REQUEST_JSON", requestAsJson); - requestBundle.putByteArray(CRED_MAN_PREFIX + "BUNDLE_KEY_CLIENT_DATA_HASH", clientDataHash); - - final Bundle displayInfoBundle = new Bundle(); - displayInfoBundle.putCharSequence( - CRED_MAN_PREFIX + "BUNDLE_KEY_USER_ID", - Base64.encodeToString( - options.user.id, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP)); - displayInfoBundle.putString( - CRED_MAN_PREFIX + "BUNDLE_KEY_DEFAULT_PROVIDER", - GPM_COMPONENT_NAME.flattenToString()); - - requestBundle.putBundle( - CRED_MAN_PREFIX + "BUNDLE_KEY_REQUEST_DISPLAY_INFO", displayInfoBundle); - requestBundle.putString(CHANNEL_KEY, getChannel()); - OutcomeReceiver<CreateCredentialResponse, CreateCredentialException> receiver = new OutcomeReceiver<>() { @Override @@ -223,11 +188,13 @@ } }; - final CreateCredentialRequest request = - new CreateCredentialRequest.Builder(TYPE_PASSKEY, requestBundle, requestBundle) - .setAlwaysSendAppInfoToProvider(true) + final CredManCreateCredentialRequestHelper requestHelper = + new CredManCreateCredentialRequestHelper.Builder(requestAsJson, clientDataHash) + .setUserId(options.user.id) .setOrigin(originString) .build(); + final CreateCredentialRequest request = + requestHelper.getCreateCredentialRequest(mCredManRequestDecorator); final CredentialManager manager = (CredentialManager) mContext.getSystemService(Context.CREDENTIAL_SERVICE); manager.createCredential(mContext, request, null, mContext.getMainExecutor(), receiver); @@ -645,111 +612,19 @@ boolean hasAllowCredentials = options.allowCredentials != null && options.allowCredentials.length != 0; - Bundle publicKeyCredentialOptionBundle = - buildPublicKeyCredentialOptionBundle( - requestAsJson, - clientDataHash, - ignoreGpm, - /* allowAutoSelect= */ hasAllowCredentials); - CredentialOption credentialOption = - new CredentialOption.Builder( - TYPE_PASSKEY, - publicKeyCredentialOptionBundle, - publicKeyCredentialOptionBundle) + CredManGetCredentialRequestHelper helper = + new CredManGetCredentialRequestHelper.Builder( + requestAsJson, + clientDataHash, + preferImmediatelyAvailable, + hasAllowCredentials, + requestPasswords) + .setOrigin(originString) + .setPlayServicesAvailable(mPlayServicesAvailable) + .setIgnoreGpm(ignoreGpm) + .setRenderFrameHost(mFrameHost) .build(); - - Bundle getCredentialRequestBundle = new Bundle(); - if (!ignoreGpm) { - getCredentialRequestBundle.putParcelable( - CRED_MAN_PREFIX + "BUNDLE_KEY_PREFER_UI_BRANDING_COMPONENT_NAME", - GPM_COMPONENT_NAME); - } - // The CredMan UI for the case where there aren't any credentials isn't - // suitable for the modal case. This bundle key requests that the - // request fail immediately if there aren't any credentials. It'll fail - // with a `CRED_MAN_EXCEPTION_GET_CREDENTIAL_TYPE_NO_CREDENTIAL` error - // which is handled above by calling Play Services to render the error. - getCredentialRequestBundle.putBoolean( - CRED_MAN_PREFIX + "BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS", - preferImmediatelyAvailable && mPlayServicesAvailable); - final GetCredentialRequest.Builder getCredentialRequestBuilder = - new GetCredentialRequest.Builder(getCredentialRequestBundle) - .addCredentialOption(credentialOption); - if (requestPasswords) { - getCredentialRequestBuilder.addCredentialOption(buildPasswordOption(ignoreGpm)); - } - return getCredentialRequestBuilder.setOrigin(originString).build(); - } - - private Bundle buildPublicKeyCredentialOptionBundle( - String requestAsJson, - byte[] clientDataHash, - boolean ignoreGpm, - boolean allowAutoSelect) { - final Bundle publicKeyCredentialOptionBundle = new Bundle(); - publicKeyCredentialOptionBundle.putString( - CRED_MAN_PREFIX + "BUNDLE_KEY_SUBTYPE", - CRED_MAN_PREFIX + "BUNDLE_VALUE_SUBTYPE_GET_PUBLIC_KEY_CREDENTIAL_OPTION"); - publicKeyCredentialOptionBundle.putString( - CRED_MAN_PREFIX + "BUNDLE_KEY_REQUEST_JSON", requestAsJson); - publicKeyCredentialOptionBundle.putByteArray( - CRED_MAN_PREFIX + "BUNDLE_KEY_CLIENT_DATA_HASH", clientDataHash); - - if (allowAutoSelect) { - // Auto-select means that, when an allowlist is present and one of - // the providers matches with it, the account selector can be - // skipped. (However, if two or more providers match with the - // allowlist then the selector will, sadly, still be shown.) - publicKeyCredentialOptionBundle.putBoolean(CRED_MAN_IS_AUTO_SELECT_ALLOWED, true); - } - - publicKeyCredentialOptionBundle.putString(CHANNEL_KEY, getChannel()); - publicKeyCredentialOptionBundle.putBoolean(INCOGNITO_KEY, isIncognito()); - publicKeyCredentialOptionBundle.putBoolean(IGNORE_GPM, ignoreGpm); - return publicKeyCredentialOptionBundle; - } - - @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) - private CredentialOption buildPasswordOption(boolean ignoreGpm) { - Bundle passwordOptionBundle = new Bundle(); - passwordOptionBundle.putString(CHANNEL_KEY, getChannel()); - passwordOptionBundle.putBoolean(INCOGNITO_KEY, isIncognito()); - passwordOptionBundle.putBoolean(PASSWORDS_ONLY_FOR_THE_CHANNEL, true); - passwordOptionBundle.putBoolean(PASSWORDS_WITH_NO_USERNAME_INCLUDED, true); - passwordOptionBundle.putBoolean(IGNORE_GPM, ignoreGpm); - - return new CredentialOption.Builder( - "android.credentials.TYPE_PASSWORD_CREDENTIAL", - passwordOptionBundle, - passwordOptionBundle) - .setAllowedProviders(Set.of(GPM_COMPONENT_NAME)) - .build(); - } - - private final boolean isIncognito() { - if (mFrameHost == null) return false; - WebContents webContents = WebContentsStatics.fromRenderFrameHost(mFrameHost); - return webContents == null ? false : webContents.isIncognito(); - } - - private static final String getChannel() { - if (VersionInfo.isCanaryBuild()) { - return "canary"; - } - if (VersionInfo.isDevBuild()) { - return "dev"; - } - if (VersionInfo.isBetaBuild()) { - return "beta"; - } - if (VersionInfo.isStableBuild()) { - return "stable"; - } - if (VersionInfo.isLocalBuild()) { - return "built_locally"; - } - assert false : "Channel must be canary, dev, beta, stable or chrome must be built locally."; - return null; + return helper.getGetCredentialRequest(mCredManRequestDecorator); } private static void logDeserializationException(Throwable e) {
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManRequestDecorator.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManRequestDecorator.java new file mode 100644 index 0000000..c2e2f5e4 --- /dev/null +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManRequestDecorator.java
@@ -0,0 +1,36 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import android.credentials.CreateCredentialRequest; +import android.credentials.CredentialOption; +import android.credentials.GetCredentialRequest; +import android.os.Bundle; + +/** Interface for code that will update the CredMan request bundles or requests. */ +interface CredManRequestDecorator { + void updateCreateCredentialRequestBundle( + Bundle input, CredManCreateCredentialRequestHelper helper); + + void updateCreateCredentialRequestBuilder( + CreateCredentialRequest.Builder builder, CredManCreateCredentialRequestHelper helper); + + void updateGetCredentialRequestBundle(Bundle bundle, CredManGetCredentialRequestHelper helper); + + void updateGetCredentialRequestBuilder( + GetCredentialRequest.Builder builder, CredManGetCredentialRequestHelper helper); + + void updatePublicKeyCredentialOptionBundle( + Bundle bundle, CredManGetCredentialRequestHelper helper); + + void updatePublicKeyCredentialOptionBuilder( + CredentialOption.Builder builder, CredManGetCredentialRequestHelper helper); + + void updatePasswordCredentialOptionBundle( + Bundle bundle, CredManGetCredentialRequestHelper helper); + + void updatePasswordCredentialOptionBuilder( + CredentialOption.Builder builder, CredManGetCredentialRequestHelper helper); +}
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java new file mode 100644 index 0000000..94900dee --- /dev/null +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java
@@ -0,0 +1,174 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import static org.chromium.components.webauthn.cred_man.CredManHelper.CRED_MAN_PREFIX; + +import android.content.ComponentName; +import android.credentials.CreateCredentialRequest; +import android.credentials.CredentialOption; +import android.credentials.GetCredentialRequest.Builder; +import android.os.Build; +import android.os.Bundle; +import android.util.Base64; + +import androidx.annotation.RequiresApi; + +import org.chromium.components.version_info.VersionInfo; +import org.chromium.content_public.browser.RenderFrameHost; +import org.chromium.content_public.browser.WebContents; +import org.chromium.content_public.browser.WebContentsStatics; + +import java.util.Set; + +/** + * This decorator is responsible for decorating the CredMan requests with Google Password Manager + * and Chrome specific values. The values may be used to theme CredMan UI with Google Password + * Manager. + */ +public class GpmCredManRequestDecorator implements CredManRequestDecorator { + private static final ComponentName GPM_COMPONENT_NAME = + ComponentName.createRelative( + "com.google.android.gms", + ".auth.api.credentials.credman.service.PasswordAndPasskeyService"); + private static final String CHANNEL_KEY = "com.android.chrome.CHANNEL"; + private static final String INCOGNITO_KEY = "com.android.chrome.INCOGNITO"; + private static final String IGNORE_GPM_KEY = "com.android.chrome.GPM_IGNORE"; + + private static final String PASSWORDS_ONLY_FOR_THE_CHANNEL = + "com.android.chrome.PASSWORDS_ONLY_FOR_THE_CHANNEL"; + private static final String PASSWORDS_WITH_NO_USERNAME_INCLUDED = + "com.android.chrome.PASSWORDS_WITH_NO_USERNAME_INCLUDED"; + + private static GpmCredManRequestDecorator sInstance; + + public static GpmCredManRequestDecorator getInstance() { + if (sInstance == null) { + sInstance = new GpmCredManRequestDecorator(); + } + return sInstance; + } + + @Override + public void updateCreateCredentialRequestBundle( + Bundle input, CredManCreateCredentialRequestHelper helper) { + // displayInfo bundle is required to theme the CredMan UI with Google Password Manager. + final Bundle displayInfoBundle = new Bundle(); + displayInfoBundle.putCharSequence( + CRED_MAN_PREFIX + "BUNDLE_KEY_USER_ID", + Base64.encodeToString( + helper.getUserId(), Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP)); + displayInfoBundle.putString( + CRED_MAN_PREFIX + "BUNDLE_KEY_DEFAULT_PROVIDER", + GPM_COMPONENT_NAME.flattenToString()); + input.putBundle(CRED_MAN_PREFIX + "BUNDLE_KEY_REQUEST_DISPLAY_INFO", displayInfoBundle); + + // Google Password Manager only: Specify the channel to save credential to the correct + // account. When multiple Google accounts are present on the device, this will prioritize + // the current account in Chrome. + input.putString(CHANNEL_KEY, getChannel()); + } + + @Override + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + public void updateCreateCredentialRequestBuilder( + CreateCredentialRequest.Builder builder, CredManCreateCredentialRequestHelper helper) { + builder.setOrigin(helper.getOrigin()); + } + + @Override + public void updateGetCredentialRequestBundle( + Bundle getCredentialRequestBundle, CredManGetCredentialRequestHelper helper) { + if (!helper.getIgnoreGpm()) { + // Theme the CredMan UI with Google Password Manager: + getCredentialRequestBundle.putParcelable( + CRED_MAN_PREFIX + "BUNDLE_KEY_PREFER_UI_BRANDING_COMPONENT_NAME", + GPM_COMPONENT_NAME); + } + // The CredMan UI for the case where there aren't any credentials isn't suitable for the + // modal case. This bundle key requests that the request fail immediately if there aren't + // any credentials. It'll fail with a `CRED_MAN_EXCEPTION_GET_CREDENTIAL_TYPE_NO_CREDENTIAL` + // error which is handled by calling Play Services to render the error. + getCredentialRequestBundle.putBoolean( + CRED_MAN_PREFIX + "BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS", + helper.getPreferImmediatelyAvailable() && helper.getPlayServicesAvailable()); + } + + @Override + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + public void updateGetCredentialRequestBuilder( + Builder builder, CredManGetCredentialRequestHelper helper) { + builder.setOrigin(helper.getOrigin()); + } + + @Override + public void updatePublicKeyCredentialOptionBundle( + Bundle publicKeyCredentialOptionBundle, CredManGetCredentialRequestHelper helper) { + // The values below are specific to Google Password Manager. + // Use the channel info to prioritize the credentials for the current account in Chrome. + publicKeyCredentialOptionBundle.putString(CHANNEL_KEY, getChannel()); + // Specify if the tab is in incognito mode for user privacy. + publicKeyCredentialOptionBundle.putBoolean( + INCOGNITO_KEY, isIncognito(helper.getRenderFrameHost())); + // Do not include any passkeys from GPM if `helper.getIgnoreGpm()` is true. + publicKeyCredentialOptionBundle.putBoolean(IGNORE_GPM_KEY, helper.getIgnoreGpm()); + } + + @Override + public void updatePublicKeyCredentialOptionBuilder( + CredentialOption.Builder builder, CredManGetCredentialRequestHelper helper) {} + + @Override + public void updatePasswordCredentialOptionBundle( + Bundle passwordCredentialOptionBundle, CredManGetCredentialRequestHelper helper) { + // The values below are specific to Google Password Manager. + // Specify the channel so that GPM can return passwords only for that channel. + passwordCredentialOptionBundle.putString(CHANNEL_KEY, getChannel()); + // Specify if the tab is in incognito mode for user privacy. + passwordCredentialOptionBundle.putBoolean( + INCOGNITO_KEY, isIncognito(helper.getRenderFrameHost())); + // Requests passwords only for the current Chrome channel. + passwordCredentialOptionBundle.putBoolean(PASSWORDS_ONLY_FOR_THE_CHANNEL, true); + // If there are passwords with empty usernames, also return them in the response. + passwordCredentialOptionBundle.putBoolean(PASSWORDS_WITH_NO_USERNAME_INCLUDED, true); + // Do not include any passwords from GPM if `helper.getIgnoreGpm()` is true. + passwordCredentialOptionBundle.putBoolean(IGNORE_GPM_KEY, helper.getIgnoreGpm()); + } + + @Override + @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + public void updatePasswordCredentialOptionBuilder( + CredentialOption.Builder builder, CredManGetCredentialRequestHelper helper) { + builder.setAllowedProviders(Set.of(GPM_COMPONENT_NAME)); + } + + protected static final String getChannel() { + if (VersionInfo.isCanaryBuild()) { + return "canary"; + } + if (VersionInfo.isDevBuild()) { + return "dev"; + } + if (VersionInfo.isBetaBuild()) { + return "beta"; + } + if (VersionInfo.isStableBuild()) { + return "stable"; + } + if (VersionInfo.isLocalBuild()) { + return "built_locally"; + } + assert false : "Channel must be canary, dev, beta, stable or chrome must be built locally."; + return null; + } + + private static final boolean isIncognito(RenderFrameHost frameHost) { + if (frameHost == null) return false; + WebContents webContents = WebContentsStatics.fromRenderFrameHost(frameHost); + return webContents == null ? false : webContents.isIncognito(); + } + + private GpmCredManRequestDecorator() {} +}
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelperRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelperRobolectricTest.java new file mode 100644 index 0000000..d9ef0bf --- /dev/null +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManCreateCredentialRequestHelperRobolectricTest.java
@@ -0,0 +1,85 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import static com.google.common.truth.Truth.assertThat; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; + +import android.credentials.CreateCredentialRequest; + +import androidx.test.filters.SmallTest; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +@RunWith(BaseRobolectricTestRunner.class) +@Config( + manifest = Config.NONE, + shadows = { + ShadowCreateCredentialRequest.class, + ShadowCreateCredentialRequest.ShadowBuilder.class, + ShadowCreateCredentialResponse.class, + ShadowCreateCredentialException.class + }) +public class CredManCreateCredentialRequestHelperRobolectricTest { + private static final String REQUEST_AS_JSON = "coolest-request-as-json"; + private static final byte[] CLIENT_DATA_HASH = new byte[] {1, 1, 2}; + private static final String ORIGIN = "www.coolwebsite.com"; + private static final byte[] USER_ID = new byte[] {3, 5, 8}; + + @Mock private CredManRequestDecorator mDecorator; + + private CredManCreateCredentialRequestHelper mHelper; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.openMocks(this); + + mHelper = + new CredManCreateCredentialRequestHelper.Builder(REQUEST_AS_JSON, CLIENT_DATA_HASH) + .setOrigin(ORIGIN) + .setUserId(USER_ID) + .build(); + } + + @Test + @SmallTest + public void testGetCreateCredentialRequest_nullDecorator_onlyRequiredValues() { + CreateCredentialRequest createCredentialRequest = mHelper.getCreateCredentialRequest(null); + + assertThat(createCredentialRequest).isNotNull(); + assertThat(createCredentialRequest.getType()) + .isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); + assertThat( + createCredentialRequest + .getCredentialData() + .getString("androidx.credentials.BUNDLE_KEY_REQUEST_JSON")) + .isEqualTo(REQUEST_AS_JSON); + assertThat( + createCredentialRequest + .getCredentialData() + .getByteArray("androidx.credentials.BUNDLE_KEY_CLIENT_DATA_HASH")) + .isEqualTo(CLIENT_DATA_HASH); + assertThat(createCredentialRequest.alwaysSendAppInfoToProvider()).isTrue(); + } + + @Test + @SmallTest + public void testGetCreateCredentialRequest_mockDecorator_setsOriginAndBundleValues() { + mHelper.getCreateCredentialRequest(mDecorator); + + verify(mDecorator).updateCreateCredentialRequestBuilder(any(), eq(mHelper)); + verify(mDecorator).updateCreateCredentialRequestBundle(any(), eq(mHelper)); + } +}
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelperRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelperRobolectricTest.java new file mode 100644 index 0000000..a1281d52 --- /dev/null +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelperRobolectricTest.java
@@ -0,0 +1,184 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import static com.google.common.truth.Truth.assertThat; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; + +import android.credentials.CredentialOption; +import android.credentials.GetCredentialRequest; + +import androidx.test.filters.SmallTest; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +@RunWith(BaseRobolectricTestRunner.class) +@Config( + manifest = Config.NONE, + shadows = { + ShadowCredentialOption.class, + ShadowCredentialOption.ShadowBuilder.class, + ShadowGetCredentialRequest.class, + ShadowGetCredentialRequest.ShadowBuilder.class, + ShadowGetCredentialResponse.class, + ShadowGetCredentialException.class + }) +public class CredManGetCredentialRequestHelperRobolectricTest { + private static final String REQUEST_AS_JSON = "coolest-request-as-json"; + private static final byte[] CLIENT_DATA_HASH = new byte[] {1, 1, 2}; + + @Mock private CredManRequestDecorator mDecorator; + + private CredManGetCredentialRequestHelper mHelper; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.openMocks(this); + mHelper = + new CredManGetCredentialRequestHelper.Builder( + REQUEST_AS_JSON, + CLIENT_DATA_HASH, + /* preferImmediatelyAvailable= */ false, + /* allowAutoSelect= */ false, + /* requestPasswords= */ false) + .build(); + } + + @Test + @SmallTest + public void testGetGetCredentialRequest_nullDecorator_setsBasicGetCredentialRequest() { + GetCredentialRequest getCredentialRequest = mHelper.getGetCredentialRequest(null); + + assertThat(getCredentialRequest).isNotNull(); + assertThat( + getCredentialRequest + .getData() + .containsKey( + "androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS")) + .isTrue(); + } + + @Test + @SmallTest + public void testGetGetCredentialRequest_mockDecorator_setsBasicGetCredentialRequest() { + GetCredentialRequest getCredentialRequest = mHelper.getGetCredentialRequest(mDecorator); + + verify(mDecorator).updateGetCredentialRequestBuilder(any(), eq(mHelper)); + verify(mDecorator).updateGetCredentialRequestBundle(any(), eq(mHelper)); + assertThat(getCredentialRequest).isNotNull(); + assertThat( + getCredentialRequest + .getData() + .containsKey( + "androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS")) + .isTrue(); + } + + @Test + @SmallTest + public void testGetGetCredentialRequest_nullDecorator_firstCredentialOptionIsPublicKey() { + GetCredentialRequest getCredentialRequest = mHelper.getGetCredentialRequest(null); + + assertThat(getCredentialRequest).isNotNull(); + assertThat(getCredentialRequest.getCredentialOptions()).hasSize(1); + + CredentialOption option = getCredentialRequest.getCredentialOptions().get(0); + assertThat(option.getType()).isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); + assertThat( + option.getCandidateQueryData() + .getString("androidx.credentials.BUNDLE_KEY_REQUEST_JSON")) + .isEqualTo(REQUEST_AS_JSON); + assertThat( + option.getCandidateQueryData() + .getByteArray("androidx.credentials.BUNDLE_KEY_CLIENT_DATA_HASH")) + .isEqualTo(CLIENT_DATA_HASH); + assertThat( + option.getCandidateQueryData() + .getString("androidx.credentials.BUNDLE_KEY_SUBTYPE")) + .isEqualTo( + "androidx.credentials.BUNDLE_VALUE_SUBTYPE_GET_PUBLIC_KEY_CREDENTIAL_OPTION"); + } + + @Test + @SmallTest + public void testGetGetCredentialRequest_mockDecorator_firstCredentialOptionIsPublicKey() { + GetCredentialRequest getCredentialRequest = mHelper.getGetCredentialRequest(mDecorator); + + verify(mDecorator).updatePublicKeyCredentialOptionBundle(any(), eq(mHelper)); + + assertThat(getCredentialRequest).isNotNull(); + assertThat(getCredentialRequest.getCredentialOptions()).hasSize(1); + + CredentialOption option = getCredentialRequest.getCredentialOptions().get(0); + assertThat(option.getType()).isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); + assertThat( + option.getCandidateQueryData() + .getString("androidx.credentials.BUNDLE_KEY_REQUEST_JSON")) + .isEqualTo(REQUEST_AS_JSON); + assertThat( + option.getCandidateQueryData() + .getByteArray("androidx.credentials.BUNDLE_KEY_CLIENT_DATA_HASH")) + .isEqualTo(CLIENT_DATA_HASH); + assertThat( + option.getCandidateQueryData() + .getString("androidx.credentials.BUNDLE_KEY_SUBTYPE")) + .isEqualTo( + "androidx.credentials.BUNDLE_VALUE_SUBTYPE_GET_PUBLIC_KEY_CREDENTIAL_OPTION"); + } + + @Test + @SmallTest + public void + testGetGetCredentialRequest_nullDecoratorAndRequestPasswordsIsTrue_BothOptionsInRequest() { + mHelper = + new CredManGetCredentialRequestHelper.Builder( + REQUEST_AS_JSON, + CLIENT_DATA_HASH, + /* preferImmediatelyAvailable= */ false, + /* allowAutoSelect= */ false, + /* requestPasswords= */ true) + .build(); + + GetCredentialRequest getCredentialRequest = mHelper.getGetCredentialRequest(null); + + assertThat(getCredentialRequest).isNotNull(); + assertThat(getCredentialRequest.getCredentialOptions()).hasSize(2); + CredentialOption option = getCredentialRequest.getCredentialOptions().get(1); + assertThat(option.getType()).isEqualTo("android.credentials.TYPE_PASSWORD_CREDENTIAL"); + } + + @Test + @SmallTest + public void + testGetGetCredentialRequest_mockDecoratorAndRequestPasswordsIsTrue_BothOptionsInRequest() { + mHelper = + new CredManGetCredentialRequestHelper.Builder( + REQUEST_AS_JSON, + CLIENT_DATA_HASH, + /* preferImmediatelyAvailable= */ false, + /* allowAutoSelect= */ false, + /* requestPasswords= */ true) + .build(); + + GetCredentialRequest getCredentialRequest = mHelper.getGetCredentialRequest(mDecorator); + + verify(mDecorator).updatePasswordCredentialOptionBundle(any(), eq(mHelper)); + verify(mDecorator).updatePasswordCredentialOptionBuilder(any(), eq(mHelper)); + assertThat(getCredentialRequest).isNotNull(); + assertThat(getCredentialRequest.getCredentialOptions()).hasSize(2); + CredentialOption option = getCredentialRequest.getCredentialOptions().get(1); + assertThat(option.getType()).isEqualTo("android.credentials.TYPE_PASSWORD_CREDENTIAL"); + } +}
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java index 2b1c23f..a050502 100644 --- a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java
@@ -22,7 +22,6 @@ import android.credentials.CreateCredentialResponse; import android.credentials.Credential; import android.credentials.CredentialManager; -import android.credentials.CredentialOption; import android.credentials.GetCredentialException; import android.credentials.GetCredentialRequest; import android.credentials.GetCredentialResponse; @@ -62,8 +61,6 @@ import org.chromium.content_public.browser.RenderFrameHost; import org.chromium.content_public.browser.WebContents; -import java.util.List; - @RunWith(BaseRobolectricTestRunner.class) @Config( manifest = Config.NONE, @@ -99,6 +96,11 @@ @Mock private WebAuthnBrowserBridge mBrowserBridge; @Mock private Callback<Integer> mErrorCallback; @Mock private Barrier mBarrier; + @Mock private CredManRequestDecorator mRequestDecorator; + @Mock private CredManCreateCredentialRequestHelper mCredManCreateCredentialRequestHelper; + @Mock private CreateCredentialRequest mCreateCredentialRequest; + @Mock private CredManGetCredentialRequestHelper mCredManGetCredentialRequestHelper; + @Mock private GetCredentialRequest mGetCredentialRequest; private CredManHelper.BridgeProvider mBridgeProvider = new CredManHelper.BridgeProvider() { @@ -127,7 +129,17 @@ mCallback = Fido2ApiTestHelper.getAuthenticatorCallback(); - mCredManHelper = new CredManHelper(mBridgeProvider, /* playServicesAvailable= */ true); + CredManCreateCredentialRequestHelper.setInstanceForTesting( + mCredManCreateCredentialRequestHelper); + when(mCredManCreateCredentialRequestHelper.getCreateCredentialRequest(any())) + .thenReturn(mCreateCredentialRequest); + CredManGetCredentialRequestHelper.setInstanceForTesting(mCredManGetCredentialRequestHelper); + when(mCredManGetCredentialRequestHelper.getGetCredentialRequest(any())) + .thenReturn(mGetCredentialRequest); + + mCredManHelper = + new CredManHelper( + mBridgeProvider, /* playServicesAvailable= */ true, mRequestDecorator); mCredManHelper.setMetricsHelperForTesting(mMetricsHelper); when(mContext.getSystemService(Context.CREDENTIAL_SERVICE)).thenReturn(mCredentialManager); } @@ -150,21 +162,9 @@ ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); CreateCredentialRequest createCredentialRequest = shadowCredentialManager.getCreateCredentialRequest(); - assertThat(createCredentialRequest).isNotNull(); - assertThat(createCredentialRequest.getOrigin()).isEqualTo(mOriginString); - assertThat(createCredentialRequest.getType()) - .isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); - assertThat( - createCredentialRequest - .getCredentialData() - .getString("androidx.credentials.BUNDLE_KEY_REQUEST_JSON")) - .isEqualTo("{serialized_make_request}"); - assertThat(createCredentialRequest.alwaysSendAppInfoToProvider()).isTrue(); - assertThat( - createCredentialRequest - .getCandidateQueryData() - .containsKey("com.android.chrome.CHANNEL")) - .isTrue(); + verify(mCredManCreateCredentialRequestHelper) + .getCreateCredentialRequest(eq(mRequestDecorator)); + assertThat(createCredentialRequest).isEqualTo(mCreateCredentialRequest); shadowCredentialManager .getCreateCredentialCallback() @@ -193,13 +193,9 @@ ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); CreateCredentialRequest createCredentialRequest = shadowCredentialManager.getCreateCredentialRequest(); - assertThat(createCredentialRequest).isNotNull(); - assertThat(createCredentialRequest.getOrigin()).isEqualTo(mOriginString); - assertThat( - createCredentialRequest - .getCredentialData() - .getByteArray("androidx.credentials.BUNDLE_KEY_CLIENT_DATA_HASH")) - .isEqualTo(mMaybeClientDataHash); + verify(mCredManCreateCredentialRequestHelper) + .getCreateCredentialRequest(eq(mRequestDecorator)); + assertThat(createCredentialRequest).isEqualTo(mCreateCredentialRequest); shadowCredentialManager .getCreateCredentialCallback() @@ -303,32 +299,10 @@ assertThat(result).isEqualTo(AuthenticatorStatus.SUCCESS); + verify(mCredManGetCredentialRequestHelper).getGetCredentialRequest(eq(mRequestDecorator)); ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); GetCredentialRequest credManRequest = shadowCredentialManager.getGetCredentialRequest(); - assertThat(credManRequest).isNotNull(); - assertThat( - credManRequest - .getData() - .containsKey( - "androidx.credentials.BUNDLE_KEY_PREFER_UI_BRANDING_COMPONENT_NAME")) - .isTrue(); - assertThat(credManRequest.getOrigin()).isEqualTo(mOriginString); - assertThat(credManRequest.getCredentialOptions()).hasSize(1); - - CredentialOption option = credManRequest.getCredentialOptions().get(0); - assertThat(option).isNotNull(); - assertThat(option.getType()).isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); - assertThat( - option.getCredentialRetrievalData() - .getString("androidx.credentials.BUNDLE_KEY_REQUEST_JSON")) - .isEqualTo("{serialized_get_request}"); - assertThat(option.getCandidateQueryData().containsKey("com.android.chrome.CHANNEL")) - .isTrue(); - assertThat( - option.getCandidateQueryData() - .getBoolean("com.android.chrome.GPM_IGNORE", false)) - .isFalse(); - assertThat(option.isSystemProviderRequired()).isFalse(); + assertThat(credManRequest).isEqualTo(mGetCredentialRequest); GetCredentialResponse response = new GetCredentialResponse(createPasskeyCredential()); shadowCredentialManager.getGetCredentialCallback().onResult(response); @@ -358,15 +332,10 @@ assertThat(result).isEqualTo(AuthenticatorStatus.SUCCESS); + verify(mCredManGetCredentialRequestHelper).getGetCredentialRequest(eq(mRequestDecorator)); ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); GetCredentialRequest credManRequest = shadowCredentialManager.getGetCredentialRequest(); - assertThat(credManRequest).isNotNull(); - assertThat(credManRequest.getCredentialOptions()).hasSize(1); - CredentialOption option = credManRequest.getCredentialOptions().get(0); - assertThat( - option.getCredentialRetrievalData() - .getByteArray("androidx.credentials.BUNDLE_KEY_CLIENT_DATA_HASH")) - .isEqualTo(mMaybeClientDataHash); + assertThat(credManRequest).isEqualTo(mGetCredentialRequest); } @Test @@ -391,13 +360,7 @@ ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); GetCredentialRequest credManRequest = shadowCredentialManager.getGetCredentialRequest(); - assertThat(credManRequest).isNotNull(); - assertThat( - credManRequest - .getData() - .getBoolean( - "androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS")) - .isTrue(); + assertThat(credManRequest).isEqualTo(mGetCredentialRequest); GetCredentialException exception = new GetCredentialException(GetCredentialException.TYPE_NO_CREDENTIAL, "Message"); @@ -506,17 +469,7 @@ ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); GetCredentialRequest credManRequest = shadowCredentialManager.getGetCredentialRequest(); - - assertThat(credManRequest).isNotNull(); - assertThat(credManRequest.getOrigin()).isEqualTo(mOriginString); - CredentialOption option = credManRequest.getCredentialOptions().get(0); - assertThat(option).isNotNull(); - assertThat(option.getType()).isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); - assertThat( - option.getCredentialRetrievalData() - .getString("androidx.credentials.BUNDLE_KEY_REQUEST_JSON")) - .isEqualTo("{serialized_get_request}"); - assertThat(option.isSystemProviderRequired()).isFalse(); + assertThat(credManRequest).isEqualTo(mGetCredentialRequest); PrepareGetCredentialResponse prepareGetCredentialResponse = Shadow.newInstanceOf(PrepareGetCredentialResponse.class); @@ -698,11 +651,6 @@ credManCallSuccessfulRunback.getValue().run(); verify(mMetricsHelper, times(1)).recordCredmanPrepareRequestDuration(anyLong()); - - GetCredentialRequest credManRequest = shadowCredentialManager.getGetCredentialRequest(); - assertThat(credManRequest).isNotNull(); - assertThat(credManRequest.getCredentialOptions()).hasSize(1); - verify(mBrowserBridge, times(1)) .onCredManConditionalRequestPending(any(), anyBoolean(), callbackCaptor.capture()); @@ -715,21 +663,6 @@ callbackCaptor.getValue().onResult(true); shadowCredentialManager.getGetCredentialCallback().onResult(response); - credManRequest = shadowCredentialManager.getGetCredentialRequest(); - assertThat(credManRequest).isNotNull(); - assertThat(credManRequest.getCredentialOptions()).hasSize(2); - List<CredentialOption> credentialOptions = credManRequest.getCredentialOptions(); - assertThat(credentialOptions.get(0).getType()) - .isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); - assertThat(credentialOptions.get(1).getType()) - .isEqualTo(Credential.TYPE_PASSWORD_CREDENTIAL); - assertThat( - credentialOptions - .get(1) - .getCandidateQueryData() - .containsKey("com.android.chrome.PASSWORDS_ONLY_FOR_THE_CHANNEL")) - .isTrue(); - verify(mBrowserBridge, never()).onCredManUiClosed(any(), anyBoolean()); // A password is selected, the callback will not be signed. assertThat(mCallback.getStatus()).isNull(); @@ -756,21 +689,7 @@ ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); GetCredentialRequest credManRequest = shadowCredentialManager.getGetCredentialRequest(); - assertThat(credManRequest).isNotNull(); - assertThat( - credManRequest - .getData() - .containsKey( - "androidx.credentials.BUNDLE_KEY_PREFER_UI_BRANDING_COMPONENT_NAME")) - .isFalse(); - assertThat(credManRequest.getCredentialOptions()).hasSize(1); - CredentialOption option = credManRequest.getCredentialOptions().get(0); - assertThat(option).isNotNull(); - assertThat(option.getType()).isEqualTo("androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL"); - assertThat(option.getCandidateQueryData().containsKey("com.android.chrome.GPM_IGNORE")) - .isTrue(); - assertThat(option.getCandidateQueryData().getBoolean("com.android.chrome.GPM_IGNORE")) - .isTrue(); + assertThat(credManRequest).isEqualTo(mGetCredentialRequest); } private Credential createPasskeyCredential() {
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java new file mode 100644 index 0000000..1469aba5 --- /dev/null +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java
@@ -0,0 +1,154 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.webauthn.cred_man; + +import static com.google.common.truth.Truth.assertThat; + +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.credentials.CreateCredentialRequest; +import android.os.Bundle; +import android.util.Base64; + +import androidx.test.filters.SmallTest; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.Config; +import org.robolectric.shadow.api.Shadow; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +@RunWith(BaseRobolectricTestRunner.class) +@Config( + manifest = Config.NONE, + shadows = { + ShadowCreateCredentialRequest.class, + ShadowCreateCredentialRequest.ShadowBuilder.class, + ShadowCreateCredentialResponse.class, + ShadowCreateCredentialException.class + }) +public class GpmCredManRequestDecoratorRobolectricTest { + private static final String ORIGIN = "www.coolwebsite.com"; + private static final byte[] USER_ID = new byte[] {3, 5, 8}; + + private CreateCredentialRequest.Builder mBuilder = + Shadow.newInstanceOf(CreateCredentialRequest.Builder.class); + @Mock private CredManCreateCredentialRequestHelper mCreateHelper; + @Mock private CredManGetCredentialRequestHelper mGetHelper; + + private GpmCredManRequestDecorator mDecorator = GpmCredManRequestDecorator.getInstance(); + + @Before + public void setUp() throws Exception { + MockitoAnnotations.openMocks(this); + } + + @Test + @SmallTest + public void testUpdateCreateCredentialRequestBundle() { + when(mCreateHelper.getUserId()).thenReturn(USER_ID); + Bundle bundle = new Bundle(); + + mDecorator.updateCreateCredentialRequestBundle(bundle, mCreateHelper); + + verify(mCreateHelper).getUserId(); + Bundle displayInfoBundle = + bundle.getBundle("androidx.credentials.BUNDLE_KEY_REQUEST_DISPLAY_INFO"); + assertThat(displayInfoBundle).isNotNull(); + assertThat(displayInfoBundle.getCharSequence("androidx.credentials.BUNDLE_KEY_USER_ID")) + .isEqualTo( + Base64.encodeToString( + USER_ID, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP)); + assertThat(displayInfoBundle.getString("androidx.credentials.BUNDLE_KEY_DEFAULT_PROVIDER")) + .contains("com.google.android.gms"); + assertThat(bundle.containsKey("com.android.chrome.CHANNEL")).isTrue(); + } + + @Test + @SmallTest + public void testUpdateCreateCredentialRequestBuilder() { + when(mCreateHelper.getOrigin()).thenReturn(ORIGIN); + + mDecorator.updateCreateCredentialRequestBuilder(mBuilder, mCreateHelper); + + ShadowCreateCredentialRequest.ShadowBuilder shadowBuilder = Shadow.extract(mBuilder); + assertThat(shadowBuilder.getOrigin()).isEqualTo(ORIGIN); + } + + @Test + @SmallTest + public void + testUpdateGetCredentialRequestBundle_whenIgnoreGpmFalse_thenBundleContainsBranding() { + when(mGetHelper.getPlayServicesAvailable()).thenReturn(true); + when(mGetHelper.getPreferImmediatelyAvailable()).thenReturn(true); + when(mGetHelper.getIgnoreGpm()).thenReturn(false); + Bundle bundle = new Bundle(); + + mDecorator.updateGetCredentialRequestBundle(bundle, mGetHelper); + + assertThat( + bundle.containsKey( + "androidx.credentials.BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS")) + .isTrue(); + assertThat( + bundle.containsKey( + "androidx.credentials.BUNDLE_KEY_PREFER_UI_BRANDING_COMPONENT_NAME")) + .isTrue(); + } + + @Test + @SmallTest + public void + testUpdateGetCredentialRequestBundle_whenIgnoreGpmTrue_thenBundleDoesNotContainBranding() { + when(mGetHelper.getPlayServicesAvailable()).thenReturn(true); + when(mGetHelper.getPreferImmediatelyAvailable()).thenReturn(true); + when(mGetHelper.getIgnoreGpm()).thenReturn(true); + Bundle bundle = new Bundle(); + + mDecorator.updateGetCredentialRequestBundle(bundle, mGetHelper); + + assertThat( + bundle.containsKey( + "androidx.credentials.BUNDLE_KEY_PREFER_UI_BRANDING_COMPONENT_NAME")) + .isFalse(); + } + + @Test + @SmallTest + public void testUpdatePublicKeyCredentialOptionBundle() { + Bundle bundle = new Bundle(); + when(mGetHelper.getRenderFrameHost()).thenReturn(null); + when(mGetHelper.getIgnoreGpm()).thenReturn(false); + + mDecorator.updatePublicKeyCredentialOptionBundle(bundle, mGetHelper); + + assertThat(bundle.containsKey("com.android.chrome.CHANNEL")).isTrue(); + assertThat(bundle.containsKey("com.android.chrome.INCOGNITO")).isTrue(); + assertThat(bundle.containsKey("com.android.chrome.GPM_IGNORE")).isTrue(); + } + + @Test + @SmallTest + public void testUpdatePasswordCredentialOptionBundle() { + Bundle bundle = new Bundle(); + when(mGetHelper.getRenderFrameHost()).thenReturn(null); + when(mGetHelper.getIgnoreGpm()).thenReturn(false); + + mDecorator.updatePasswordCredentialOptionBundle(bundle, mGetHelper); + + assertThat(bundle.containsKey("com.android.chrome.CHANNEL")).isTrue(); + assertThat(bundle.containsKey("com.android.chrome.INCOGNITO")).isTrue(); + assertThat(bundle.containsKey("com.android.chrome.PASSWORDS_ONLY_FOR_THE_CHANNEL")) + .isTrue(); + assertThat(bundle.containsKey("com.android.chrome.PASSWORDS_WITH_NO_USERNAME_INCLUDED")) + .isTrue(); + assertThat(bundle.containsKey("com.android.chrome.GPM_IGNORE")).isTrue(); + } +}
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialRequest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialRequest.java index 1ab2c59..a114e0c6e 100644 --- a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialRequest.java +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/ShadowCreateCredentialRequest.java
@@ -80,6 +80,10 @@ return mRealBuilder; } + protected String getOrigin() { + return mOrigin; + } + @Implementation protected CreateCredentialRequest build() { CreateCredentialRequest realRequest =
diff --git a/ios/chrome/browser/shared/model/prefs/pref_names.cc b/ios/chrome/browser/shared/model/prefs/pref_names.cc index 4b9a12c4..694a4c9 100644 --- a/ios/chrome/browser/shared/model/prefs/pref_names.cc +++ b/ios/chrome/browser/shared/model/prefs/pref_names.cc
@@ -133,6 +133,11 @@ // the sign-in promo in bookmark view. const char kIosBookmarkPromoAlreadySeen[] = "ios.bookmark.promo_already_seen"; +// Preference that hold a boolean indicating if the user has already dismissed +// the review account settings promo in bookmark view. +const char kIosBookmarkSettingsPromoAlreadySeen[] = + "ios.bookmark.settings_promo_already_seen"; + // Integer to represent the number of time the sign-in promo has been displayed // in the bookmark view. const char kIosBookmarkSigninPromoDisplayedCount[] = @@ -308,6 +313,11 @@ const char kIosReadingListPromoAlreadySeen[] = "ios.reading_list.promo_already_seen"; +// Preference that hold a boolean indicating if the user has already dismissed +// the review account settings promo in the reading list. +const char kIosReadingListSettingsPromoAlreadySeen[] = + "ios.reading_list.settings_promo_already_seen"; + // Integer to represent the number of time the sign-in promo has been displayed // in the reading list view. const char kIosReadingListSigninPromoDisplayedCount[] =
diff --git a/ios/chrome/browser/shared/model/prefs/pref_names.h b/ios/chrome/browser/shared/model/prefs/pref_names.h index f49fae28..82f2c70 100644 --- a/ios/chrome/browser/shared/model/prefs/pref_names.h +++ b/ios/chrome/browser/shared/model/prefs/pref_names.h
@@ -41,6 +41,7 @@ extern const char kIosBookmarkLastUsedFolderReceivingBookmarks[]; extern const char kIosBookmarkLastUsedStorageReceivingBookmarks[]; extern const char kIosBookmarkPromoAlreadySeen[]; +extern const char kIosBookmarkSettingsPromoAlreadySeen[]; extern const char kIosBookmarkSigninPromoDisplayedCount[]; extern const char kIosBringAndroidTabsPromptDisplayed[]; extern const char kIosShareChromeCount[]; @@ -79,6 +80,7 @@ extern const char kIosNtpFeedTopPromoAlreadySeen[]; extern const char kIosNtpFeedTopSigninPromoDisplayedCount[]; extern const char kIosReadingListPromoAlreadySeen[]; +extern const char kIosReadingListSettingsPromoAlreadySeen[]; extern const char kIosReadingListSigninPromoDisplayedCount[]; extern const char kLinkPreviewEnabled[]; extern const char kNTPContentSuggestionsEnabled[];
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h index 29dc20b..799b473a 100644 --- a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h +++ b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h
@@ -114,6 +114,8 @@ // of times it has been displayed and if the user closed the sign-in promo view. + (BOOL)shouldDisplaySigninPromoViewWithAccessPoint: (signin_metrics::AccessPoint)accessPoint + signinPromoAction: + (SigninPromoAction)signinPromoAction authenticationService: (AuthenticationService*)authenticationService prefService:(PrefService*)prefService;
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm index 2bb6061..ea52300 100644 --- a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm +++ b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm
@@ -520,6 +520,33 @@ } } +// Returns AlreadySeen preference key string for `access_point` and +// `promo_action`. +const char* AlreadySeenSigninViewPreferenceKey( + signin_metrics::AccessPoint access_point, + SigninPromoAction promo_action) { + const char* pref_key = nullptr; + switch (promo_action) { + case SigninPromoAction::kReviewAccountSettings: { + if (access_point == + signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_MANAGER) { + pref_key = prefs::kIosBookmarkSettingsPromoAlreadySeen; + } else if (access_point == + signin_metrics::AccessPoint::ACCESS_POINT_READING_LIST) { + pref_key = prefs::kIosReadingListSettingsPromoAlreadySeen; + } + break; + } + case SigninPromoAction::kSync: + case SigninPromoAction::kSigninSheet: + case SigninPromoAction::kInstantSignin: + case SigninPromoAction::kSigninWithNoDefaultIdentity: + pref_key = AlreadySeenSigninViewPreferenceKey(access_point); + break; + } + return pref_key; +} + // See documentation of displayedIdentity property. id<SystemIdentity> GetDisplayedIdentity( AuthenticationService* authService, @@ -589,6 +616,8 @@ + (void)registerBrowserStatePrefs:(user_prefs::PrefRegistrySyncable*)registry { // Bookmarks registry->RegisterBooleanPref(prefs::kIosBookmarkPromoAlreadySeen, false); + registry->RegisterBooleanPref(prefs::kIosBookmarkSettingsPromoAlreadySeen, + false); registry->RegisterIntegerPref(prefs::kIosBookmarkSigninPromoDisplayedCount, 0); // NTP Feed @@ -597,12 +626,16 @@ 0); // Reading List registry->RegisterBooleanPref(prefs::kIosReadingListPromoAlreadySeen, false); + registry->RegisterBooleanPref(prefs::kIosReadingListSettingsPromoAlreadySeen, + false); registry->RegisterIntegerPref(prefs::kIosReadingListSigninPromoDisplayedCount, 0); } + (BOOL)shouldDisplaySigninPromoViewWithAccessPoint: (signin_metrics::AccessPoint)accessPoint + signinPromoAction: + (SigninPromoAction)signinPromoAction authenticationService: (AuthenticationService*)authenticationService prefService:(PrefService*)prefService { @@ -627,19 +660,21 @@ return YES; } - // Checks if the user has exceeded the max impression count. - const int maxDisplayedCount = - accessPoint == - signin_metrics::AccessPoint::ACCESS_POINT_NTP_FEED_TOP_PROMO - ? FeedSyncPromoAutodismissCount() - : kAutomaticSigninPromoViewDismissCount; - const char* displayedCountPreferenceKey = - DisplayedCountPreferenceKey(accessPoint); - const int displayedCount = - prefService ? prefService->GetInteger(displayedCountPreferenceKey) - : INT_MAX; - if (displayedCount >= maxDisplayedCount) { - return NO; + if (signinPromoAction != SigninPromoAction::kReviewAccountSettings) { + // Checks if the user has exceeded the max impression count. + const int maxDisplayedCount = + accessPoint == + signin_metrics::AccessPoint::ACCESS_POINT_NTP_FEED_TOP_PROMO + ? FeedSyncPromoAutodismissCount() + : kAutomaticSigninPromoViewDismissCount; + const char* displayedCountPreferenceKey = + DisplayedCountPreferenceKey(accessPoint); + const int displayedCount = + prefService ? prefService->GetInteger(displayedCountPreferenceKey) + : INT_MAX; + if (displayedCount >= maxDisplayedCount) { + return NO; + } } // For the top-of-feed promo, the user must have engaged with a feed first. @@ -653,7 +688,7 @@ // Checks if user has already acknowledged or dismissed the promo. const char* alreadySeenSigninViewPreferenceKey = - AlreadySeenSigninViewPreferenceKey(accessPoint); + AlreadySeenSigninViewPreferenceKey(accessPoint, signinPromoAction); if (alreadySeenSigninViewPreferenceKey && prefService && prefService->GetBoolean(alreadySeenSigninViewPreferenceKey)) { return NO; @@ -711,7 +746,8 @@ - (SigninPromoViewConfigurator*)createConfigurator { BOOL hasCloseButton = - AlreadySeenSigninViewPreferenceKey(self.accessPoint) != nullptr; + AlreadySeenSigninViewPreferenceKey(self.accessPoint, + self.signinPromoAction) != nullptr; if (self.authService->HasPrimaryIdentity(signin::ConsentLevel::kSignin)) { if (!self.displayedIdentity) { // TODO(crbug.com/1227708): The default identity should already be known @@ -784,6 +820,18 @@ self.signinPromoViewState = SigninPromoViewState::kUnused; } self.signinPromoViewVisible = YES; + switch (self.signinPromoAction) { + case SigninPromoAction::kReviewAccountSettings: + // TODO(crbug.com/1459255): Record user impression metrics for this promo + // action. + // This action should not contribute to the DisplayedCount pref. + return; + case SigninPromoAction::kSync: + case SigninPromoAction::kSigninSheet: + case SigninPromoAction::kInstantSignin: + case SigninPromoAction::kSigninWithNoDefaultIdentity: + break; + } signin_metrics::RecordSigninImpressionUserActionForAccessPoint( self.accessPoint); const char* displayedCountPreferenceKey = @@ -998,6 +1046,15 @@ if (wasNeverVisible) return; + switch (self.signinPromoAction) { + case SigninPromoAction::kReviewAccountSettings: + return; + case SigninPromoAction::kSync: + case SigninPromoAction::kSigninSheet: + case SigninPromoAction::kInstantSignin: + case SigninPromoAction::kSigninWithNoDefaultIdentity: + break; + } // If the sign-in promo view has been used at least once, it should not be // counted as dismissed (even if the sign-in has been canceled). const char* displayedCountPreferenceKey = @@ -1180,18 +1237,32 @@ base::RecordAction(base::UserMetricsAction("Signin_Promo_Close")); self.signinPromoViewState = SigninPromoViewState::kClosed; const char* alreadySeenSigninViewPreferenceKey = - AlreadySeenSigninViewPreferenceKey(self.accessPoint); + AlreadySeenSigninViewPreferenceKey(self.accessPoint, + self.signinPromoAction); DCHECK(alreadySeenSigninViewPreferenceKey) << base::SysNSStringToUTF8([self description]); self.prefService->SetBoolean(alreadySeenSigninViewPreferenceKey, true); - const char* displayedCountPreferenceKey = - DisplayedCountPreferenceKey(self.accessPoint); - if (displayedCountPreferenceKey) { - int displayedCount = - self.prefService->GetInteger(displayedCountPreferenceKey); - RecordImpressionsTilXButtonHistogramForAccessPoint(self.accessPoint, - displayedCount); + + switch (self.signinPromoAction) { + case SigninPromoAction::kReviewAccountSettings: + // This promo action should not contribute to the displayed count of the + // sign-in actions. + break; + case SigninPromoAction::kSync: + case SigninPromoAction::kSigninSheet: + case SigninPromoAction::kInstantSignin: + case SigninPromoAction::kSigninWithNoDefaultIdentity: + const char* displayedCountPreferenceKey = + DisplayedCountPreferenceKey(self.accessPoint); + if (displayedCountPreferenceKey) { + int displayedCount = + self.prefService->GetInteger(displayedCountPreferenceKey); + RecordImpressionsTilXButtonHistogramForAccessPoint(self.accessPoint, + displayedCount); + break; + } } + if ([self.consumer respondsToSelector:@selector (signinPromoViewMediatorCloseButtonWasTapped:)]) { [self.consumer signinPromoViewMediatorCloseButtonWasTapped:self];
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator_unittest.mm b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator_unittest.mm index 4513fd53..a13919b 100644 --- a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator_unittest.mm +++ b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator_unittest.mm
@@ -620,6 +620,8 @@ EXPECT_FALSE([SigninPromoViewMediator shouldDisplaySigninPromoViewWithAccessPoint:signin_metrics::AccessPoint:: ACCESS_POINT_RECENT_TABS + signinPromoAction:SigninPromoAction:: + kInstantSignin authenticationService:GetAuthenticationService() prefService:browser_state->GetPrefs()]); } @@ -756,4 +758,30 @@ mediator_.signinPromoViewState); } +// Tests that review settings promo is not shown if the user has already +// dismissed it, but the signin promo should not be affected. +TEST_F(SigninPromoViewMediatorTest, + ShouldNotDisplaySigninPromoViewIfAlreadySeen) { + CreateMediator(signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_MANAGER); + TestChromeBrowserState::Builder builder; + builder.SetPrefService(CreatePrefService()); + std::unique_ptr<TestChromeBrowserState> browser_state = builder.Build(); + browser_state->GetPrefs()->SetBoolean( + prefs::kIosBookmarkSettingsPromoAlreadySeen, true); + EXPECT_FALSE([SigninPromoViewMediator + shouldDisplaySigninPromoViewWithAccessPoint: + signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_MANAGER + signinPromoAction:SigninPromoAction:: + kReviewAccountSettings + authenticationService:GetAuthenticationService() + prefService:browser_state->GetPrefs()]); + EXPECT_TRUE([SigninPromoViewMediator + shouldDisplaySigninPromoViewWithAccessPoint: + signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_MANAGER + signinPromoAction:SigninPromoAction:: + kInstantSignin + authenticationService:GetAuthenticationService() + prefService:browser_state->GetPrefs()]); +} + } // namespace
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.mm b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.mm index 61f49eb5..276edb6 100644 --- a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.mm +++ b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.mm
@@ -159,12 +159,10 @@ defaultSymbol ? DefaultSymbolWithConfiguration(symbolName, imageConfiguration) : CustomSymbolWithConfiguration(symbolName, imageConfiguration); - if (IsUIButtonConfigurationEnabled()) { - UIButtonConfiguration* buttonConfiguration = - [UIButtonConfiguration plainButtonConfiguration]; - buttonConfiguration.contentInsets = NSDirectionalEdgeInsetsMake(0, 0, 0, 0); - button.configuration = buttonConfiguration; - } + UIButtonConfiguration* buttonConfiguration = + [UIButtonConfiguration plainButtonConfiguration]; + buttonConfiguration.contentInsets = NSDirectionalEdgeInsetsMake(0, 0, 0, 0); + button.configuration = buttonConfiguration; [button setImage:image forState:UIControlStateNormal]; button.tintColor = IconActiveTintColor(); @@ -209,15 +207,10 @@ self.passwordButton.hidden = self.isPasswordButtonHidden; - if (IsUIButtonConfigurationEnabled()) { - UIButtonConfiguration* buttonConfiguration = - self.passwordButton.configuration; - buttonConfiguration.contentInsets = NSDirectionalEdgeInsetsMake(0, 2, 0, 2); - self.passwordButton.configuration = buttonConfiguration; - } else { - UIEdgeInsets contentEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 2); - SetContentEdgeInsets(self.passwordButton, contentEdgeInsets); - } + UIButtonConfiguration* buttonConfiguration = + self.passwordButton.configuration; + buttonConfiguration.contentInsets = NSDirectionalEdgeInsetsMake(0, 2, 0, 2); + self.passwordButton.configuration = buttonConfiguration; [icons addObject:self.passwordButton];
diff --git a/ios/chrome/browser/ui/bookmarks/home/bookmark_promo_controller.mm b/ios/chrome/browser/ui/bookmarks/home/bookmark_promo_controller.mm index 60cdd05..02f5fac 100644 --- a/ios/chrome/browser/ui/bookmarks/home/bookmark_promo_controller.mm +++ b/ios/chrome/browser/ui/bookmarks/home/bookmark_promo_controller.mm
@@ -100,59 +100,45 @@ _browser->GetBrowserState()->GetOriginalChromeBrowserState(); AuthenticationService* authenticationService = AuthenticationServiceFactory::GetForBrowserState(browserState); - if (![SigninPromoViewMediator - shouldDisplaySigninPromoViewWithAccessPoint: - signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_MANAGER - authenticationService:authenticationService - prefService:browserState - ->GetPrefs()]) { - self.shouldShowSigninPromo = NO; - return; - } signin::IdentityManager* identityManager = IdentityManagerFactory::GetForBrowserState(browserState); + syncer::SyncService* syncService = + SyncServiceFactory::GetForBrowserState(browserState); + + std::optional<SigninPromoAction> signinPromoAction; if (!identityManager->HasPrimaryAccount(signin::ConsentLevel::kSignin)) { PrefService* prefs = browserState->GetPrefs(); const std::string lastSignedInGaiaId = prefs->GetString(prefs::kGoogleServicesLastSyncingGaiaId); - // If the last signed-in user did not remove data during sign-out, don't - // show the signin promo if kEnableBatchUploadFromBookmarksManager is not - // enabled. if (lastSignedInGaiaId.empty() || base::FeatureList::IsEnabled(kEnableBatchUploadFromBookmarksManager)) { - self.shouldShowSigninPromo = YES; - _signinPromoViewMediator.signinPromoAction = - SigninPromoAction::kInstantSignin; + signinPromoAction = SigninPromoAction::kInstantSignin; } else { + // If the last signed-in user did not remove data during sign-out, don't + // show the signin promo if kEnableBatchUploadFromBookmarksManager is not + // enabled. self.shouldShowSigninPromo = NO; + return; } - return; - } - // TODO(crbug.com/1462552): Simplify once kSync becomes unreachable or is - // deleted from the codebase. See ConsentLevel::kSync documentation for - // details. - if (identityManager->HasPrimaryAccount(signin::ConsentLevel::kSync)) { + } else if (identityManager->HasPrimaryAccount(signin::ConsentLevel::kSync)) { + // TODO(crbug.com/1462552): Simplify once kSync becomes unreachable or is + // deleted from the codebase. See ConsentLevel::kSync documentation for + // details. // If the user is already syncing, the promo should not be visible. self.shouldShowSigninPromo = NO; return; - } - syncer::SyncService* syncService = - SyncServiceFactory::GetForBrowserState(browserState); - if (!base::FeatureList::IsEnabled( - syncer::kReplaceSyncPromosWithSignInPromos) && - !bookmark_utils_ios::IsAccountBookmarkStorageOptedIn(syncService)) { + } else if (!base::FeatureList::IsEnabled( + syncer::kReplaceSyncPromosWithSignInPromos) && + !bookmark_utils_ios::IsAccountBookmarkStorageOptedIn( + syncService)) { // The user signed in, but not opted into syncing bookmarks - show sync // promo. - self.shouldShowSigninPromo = YES; - _signinPromoViewMediator.signinPromoAction = SigninPromoAction::kSync; - return; - } - - // At this point, the user is signed-in not syncing. - if (base::FeatureList::IsEnabled( - syncer::kReplaceSyncPromosWithSignInPromos) && - base::FeatureList::IsEnabled(kEnableReviewAccountSettingsPromo) && - !bookmark_utils_ios::IsAccountBookmarkStorageOptedIn(syncService)) { + signinPromoAction = SigninPromoAction::kSync; + } else if (base::FeatureList::IsEnabled( + syncer::kReplaceSyncPromosWithSignInPromos) && + base::FeatureList::IsEnabled(kEnableReviewAccountSettingsPromo) && + !bookmark_utils_ios::IsAccountBookmarkStorageOptedIn( + syncService)) { if (self.shouldShowSigninPromo && _signinPromoViewMediator.signinPromoAction != SigninPromoAction::kReviewAccountSettings) { @@ -160,23 +146,35 @@ // needs to be toggled first to reflect this change. self.shouldShowSigninPromo = NO; } - _signinPromoViewMediator.signinPromoAction = - SigninPromoAction::kReviewAccountSettings; - self.shouldShowSigninPromo = YES; + // The user signed in, but not opted into account bookmarks storage - show + // review account settings promo. + signinPromoAction = SigninPromoAction::kReviewAccountSettings; + } else if (self.signinPromoViewMediator.showSpinner) { + // The user is opted into syncing bookmarks, but the first sync is not + // finished yet - keep the promo visible with the same action to show the + // spinner. + signinPromoAction = SigninPromoAction::kInstantSignin; + } else { + // The user is opted into syncing bookmarks and the first sync is done - + // hide the promo. + self.shouldShowSigninPromo = NO; return; } - if (self.signinPromoViewMediator.showSpinner) { - // The user is opted into syncing bookmarks, but the first sync is not - // finished yet - keep the promo visible to show the spinner. - self.shouldShowSigninPromo = YES; - _signinPromoViewMediator.signinPromoAction = - SigninPromoAction::kInstantSignin; + CHECK(signinPromoAction.has_value()); + if (![SigninPromoViewMediator + shouldDisplaySigninPromoViewWithAccessPoint: + signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_MANAGER + signinPromoAction:signinPromoAction.value() + authenticationService:authenticationService + prefService:browserState + ->GetPrefs()]) { + self.shouldShowSigninPromo = NO; return; } - // The user is opted into syncing bookmarks and the first sync is done - hide - // the promo. - self.shouldShowSigninPromo = NO; + + _signinPromoViewMediator.signinPromoAction = signinPromoAction.value(); + self.shouldShowSigninPromo = YES; } #pragma mark - IdentityManagerObserverBridgeDelegate
diff --git a/ios/chrome/browser/ui/ntp/feed_top_section/feed_top_section_mediator.mm b/ios/chrome/browser/ui/ntp/feed_top_section/feed_top_section_mediator.mm index c121ccd0..c165d48 100644 --- a/ios/chrome/browser/ui/ntp/feed_top_section/feed_top_section_mediator.mm +++ b/ios/chrome/browser/ui/ntp/feed_top_section/feed_top_section_mediator.mm
@@ -249,6 +249,8 @@ if ([SigninPromoViewMediator shouldDisplaySigninPromoViewWithAccessPoint: signin_metrics::AccessPoint::ACCESS_POINT_NTP_FEED_TOP_PROMO + signinPromoAction:SigninPromoAction:: + kInstantSignin authenticationService:self.authenticationService prefService:self.prefService]) { isAccountEligibleForSignInPromo = ![self isUserSignedIn];
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm index 184fecfb..23f46ab 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
@@ -643,9 +643,19 @@ return; } + SigninPromoAction signinPromoAction = SigninPromoAction::kInstantSignin; + if (_identityManager->HasPrimaryAccount(signin::ConsentLevel::kSignin) && + base::FeatureList::IsEnabled( + syncer::kReplaceSyncPromosWithSignInPromos) && + base::FeatureList::IsEnabled(kEnableReviewAccountSettingsPromo) && + !_syncService->GetUserSettings()->GetSelectedTypes().Has( + syncer::UserSelectableType::kReadingList)) { + signinPromoAction = SigninPromoAction::kReviewAccountSettings; + } if (![SigninPromoViewMediator shouldDisplaySigninPromoViewWithAccessPoint: signin_metrics::AccessPoint::ACCESS_POINT_READING_LIST + signinPromoAction:signinPromoAction authenticationService:_authService prefService:_prefService]) { self.shouldShowSignInPromo = NO;
diff --git a/ios/chrome/browser/ui/search_engine_choice/BUILD.gn b/ios/chrome/browser/ui/search_engine_choice/BUILD.gn index a181b299..b9a2e30 100644 --- a/ios/chrome/browser/ui/search_engine_choice/BUILD.gn +++ b/ios/chrome/browser/ui/search_engine_choice/BUILD.gn
@@ -55,6 +55,7 @@ deps = [ "//base", "//base:i18n", + "//components/search_engines", "//components/strings", "//ios/chrome/app/strings", "//ios/chrome/browser/shared/public/features",
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn index 16d43fb..defebfc 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn
@@ -24,6 +24,7 @@ "//ios/chrome/browser/shared/ui/table_view:styler", "//ios/chrome/browser/shared/ui/table_view:utils", "//ios/chrome/browser/ui/search_engine_choice:constants", + "//ios/chrome/browser/ui/search_engine_choice:ui_util", "//ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells", "//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/util",
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm index 75d52576..f2eaf34 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm
@@ -18,7 +18,7 @@ #import "ios/chrome/browser/shared/ui/list_model/list_model.h" #import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_item.h" #import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_consumer.h" -#import "ui/base/resource/resource_bundle.h" +#import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.h" namespace { @@ -26,25 +26,19 @@ // only be for a prepopulated search engine. This function doesn't support // custom search engine. SnippetSearchEngineItem* CreateSnippetSearchEngineItemFromTemplateURL( - TemplateURL* template_url, - TemplateURLService* template_url_service) { + const TemplateURL& template_url) { SnippetSearchEngineItem* item = nil; - // Only prepopulated search engines are shown. - CHECK_GT(template_url->prepopulate_id(), 0) - << base::UTF16ToUTF8(template_url->short_name()); + // Only works for prepopulated search engines. + CHECK_GT(template_url.prepopulate_id(), 0) + << base::UTF16ToUTF8(template_url.short_name()); item = [[SnippetSearchEngineItem alloc] initWithType:kItemTypeEnumZero]; // Add the name and snippet to the item. - item.name = base::SysUTF16ToNSString(template_url->short_name()); + item.name = base::SysUTF16ToNSString(template_url.short_name()); std::u16string string = - search_engines::GetMarketingSnippetString(template_url->data()); + search_engines::GetMarketingSnippetString(template_url.data()); item.snippetDescription = base::SysUTF16ToNSString(string); // Add the favicon to the item. - std::u16string engine_keyword = template_url->data().keyword(); - int resource_id = search_engines::GetIconResourceId(engine_keyword); - CHECK_NE(resource_id, -1) << base::UTF16ToUTF8(engine_keyword); - ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); - item.faviconImage = - resource_bundle.GetNativeImageNamed(resource_id).ToUIImage(); + item.faviconImage = SearchEngineFaviconFromTemplateURL(template_url); return item; } @@ -123,8 +117,7 @@ // Convert TemplateURLs to SnippetSearchEngineItems. for (auto& templateURL : _urlList) { SnippetSearchEngineItem* item = - CreateSnippetSearchEngineItemFromTemplateURL(templateURL.get(), - _templateURLService); + CreateSnippetSearchEngineItemFromTemplateURL(*templateURL); [searchEngineList addObject:item]; }
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.h b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.h index 58a82435..943e1866 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.h +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.h
@@ -7,6 +7,8 @@ #import <UIKit/UIKit.h> +class TemplateURL; + // UI Util containing helper methods for the choice screen UI. // Gets the correct font for the title. @@ -24,4 +26,8 @@ BOOL isConfirmButton, BOOL isEnabled); +// Returns embedded favicon for search engine from `template_url`. The search +// engine has to be prepopulated. +UIImage* SearchEngineFaviconFromTemplateURL(const TemplateURL& template_url); + #endif // IOS_CHROME_BROWSER_UI_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_UI_UTIL_H_
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm index 50d4fba..2d62dbf57 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm
@@ -6,6 +6,9 @@ #import "base/i18n/rtl.h" #import "base/strings/sys_string_conversions.h" +#import "base/strings/utf_string_conversions.h" +#import "components/search_engines/search_engine_choice_utils.h" +#import "components/search_engines/template_url.h" #import "components/strings/grit/components_strings.h" #import "ios/chrome/browser/shared/ui/symbols/symbols.h" #import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" @@ -15,6 +18,7 @@ #import "ios/chrome/common/ui/util/device_util.h" #import "ios/chrome/common/ui/util/sdk_forward_declares.h" #import "ui/base/l10n/l10n_util_mac.h" +#import "ui/base/resource/resource_bundle.h" namespace { @@ -120,3 +124,14 @@ button.enabled = isEnabled; button.accessibilityIdentifier = kSetAsDefaultSearchEngineIdentifier; } + +UIImage* SearchEngineFaviconFromTemplateURL(const TemplateURL& template_url) { + // Only works for prepopulated search engines. + CHECK_GT(template_url.prepopulate_id(), 0) + << base::UTF16ToUTF8(template_url.short_name()); + std::u16string engine_keyword = template_url.data().keyword(); + int resource_id = search_engines::GetIconResourceId(engine_keyword); + CHECK_NE(resource_id, -1) << base::UTF16ToUTF8(engine_keyword); + ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); + return resource_bundle.GetNativeImageNamed(resource_id).ToUIImage(); +}
diff --git a/ios/chrome/browser/ui/settings/cells/BUILD.gn b/ios/chrome/browser/ui/settings/cells/BUILD.gn index b133fd4..c75638c2 100644 --- a/ios/chrome/browser/ui/settings/cells/BUILD.gn +++ b/ios/chrome/browser/ui/settings/cells/BUILD.gn
@@ -14,6 +14,8 @@ "inline_promo_cell.mm", "inline_promo_item.h", "inline_promo_item.mm", + "legacy_settings_search_engine_item.h", + "legacy_settings_search_engine_item.mm", "passphrase_error_item.h", "passphrase_error_item.mm", "safe_browsing_header_item.h", @@ -26,8 +28,6 @@ "settings_image_detail_text_cell.mm", "settings_image_detail_text_item.h", "settings_image_detail_text_item.mm", - "settings_search_engine_item.h", - "settings_search_engine_item.mm", "sync_switch_item.h", "sync_switch_item.mm", "table_view_clear_browsing_data_item.h", @@ -81,10 +81,10 @@ "byo_textfield_item_unittest.mm", "copied_to_chrome_item_unittest.mm", "inline_promo_item_unittest.mm", + "legacy_settings_search_engine_item_unittest.mm", "passphrase_error_item_unittest.mm", "settings_check_item_unittest.mm", "settings_image_detail_text_item_unittest.mm", - "settings_search_engine_item_unittest.mm", "version_item_unittest.mm", ]
diff --git a/ios/chrome/browser/ui/settings/cells/settings_search_engine_item.h b/ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h similarity index 68% rename from ios/chrome/browser/ui/settings/cells/settings_search_engine_item.h rename to ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h index 721345e..4109497 100644 --- a/ios/chrome/browser/ui/settings/cells/settings_search_engine_item.h +++ b/ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h
@@ -2,8 +2,8 @@ // 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_SETTINGS_CELLS_SETTINGS_SEARCH_ENGINE_ITEM_H_ -#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_SEARCH_ENGINE_ITEM_H_ +#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_LEGACY_SETTINGS_SEARCH_ENGINE_ITEM_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_LEGACY_SETTINGS_SEARCH_ENGINE_ITEM_H_ #import <UIKit/UIKit.h> @@ -11,8 +11,9 @@ class GURL; -// SearchEngineItem contains the model data for a TableViewURLCell. -@interface SettingsSearchEngineItem : TableViewItem +// LegacySettingsSearchEngineItem contains the model data for a TableViewURLCell. +// This class is deprecated for SettingsSearchEngineItem. +@interface LegacySettingsSearchEngineItem : TableViewItem // The enabled/disabled state. If disabled, user interaction will be forbidden // and cell's alpha will be reduced. @@ -30,4 +31,4 @@ @end -#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_SEARCH_ENGINE_ITEM_H_ +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_LEGACY_SETTINGS_SEARCH_ENGINE_ITEM_H_
diff --git a/ios/chrome/browser/ui/settings/cells/settings_search_engine_item.mm b/ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.mm similarity index 90% rename from ios/chrome/browser/ui/settings/cells/settings_search_engine_item.mm rename to ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.mm index aff56d2..078267c4 100644 --- a/ios/chrome/browser/ui/settings/cells/settings_search_engine_item.mm +++ b/ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.mm
@@ -2,7 +2,7 @@ // 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/settings/cells/settings_search_engine_item.h" +#import "ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h" #import "base/apple/foundation_util.h" #import "base/strings/sys_string_conversions.h" @@ -17,14 +17,14 @@ #pragma mark - SearchEngineItem -@interface SettingsSearchEngineItem () +@interface LegacySettingsSearchEngineItem () // Redefined as read write. @property(nonatomic, readwrite, copy) NSString* uniqueIdentifier; @end -@implementation SettingsSearchEngineItem +@implementation LegacySettingsSearchEngineItem - (instancetype)initWithType:(NSInteger)type { self = [super initWithType:type]; @@ -66,7 +66,7 @@ [cell configureUILayout]; } -- (BOOL)isEqual:(SettingsSearchEngineItem*)otherItem { +- (BOOL)isEqual:(LegacySettingsSearchEngineItem*)otherItem { return (self.text == otherItem.text) && (self.detailText == otherItem.detailText) && (self.URL == otherItem.URL);
diff --git a/ios/chrome/browser/ui/settings/cells/settings_search_engine_item_unittest.mm b/ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item_unittest.mm similarity index 74% rename from ios/chrome/browser/ui/settings/cells/settings_search_engine_item_unittest.mm rename to ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item_unittest.mm index 3ad5b441..0ae9df5 100644 --- a/ios/chrome/browser/ui/settings/cells/settings_search_engine_item_unittest.mm +++ b/ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item_unittest.mm
@@ -2,7 +2,7 @@ // 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/settings/cells/settings_search_engine_item.h" +#import "ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h" #import "base/apple/foundation_util.h" #import "ios/chrome/browser/shared/public/features/features.h" @@ -15,17 +15,17 @@ #import "url/gurl.h" namespace { -using SettingsSearchEngineItemTest = PlatformTest; +using LegacySettingsSearchEngineItemTest = PlatformTest; } // namespace // Tests that the UILabels are set properly after a call to `configureCell:`. -TEST_F(SettingsSearchEngineItemTest, BasicProperties) { +TEST_F(LegacySettingsSearchEngineItemTest, BasicProperties) { NSString* text = @"Title text"; NSString* detailText = @"www.google.com"; GURL URL = net::GURLWithNSURL([NSURL URLWithString:detailText]); - SettingsSearchEngineItem* item = - [[SettingsSearchEngineItem alloc] initWithType:0]; + LegacySettingsSearchEngineItem* item = + [[LegacySettingsSearchEngineItem alloc] initWithType:0]; item.text = text; item.detailText = detailText; item.URL = URL; @@ -49,7 +49,7 @@ EXPECT_EQ(UITableViewCellAccessoryCheckmark, URLCell.accessoryType); } -TEST_F(SettingsSearchEngineItemTest, isEqual) { +TEST_F(LegacySettingsSearchEngineItemTest, isEqual) { NSString* text = @"Title text"; NSString* detailText = @"www.google.com"; GURL URL = net::GURLWithNSURL([NSURL URLWithString:detailText]); @@ -57,38 +57,38 @@ NSString* otherDetailText = @"www.notGoogle.com"; GURL otherURL = net::GURLWithNSURL([NSURL URLWithString:otherDetailText]); - SettingsSearchEngineItem* item = - [[SettingsSearchEngineItem alloc] initWithType:0]; + LegacySettingsSearchEngineItem* item = + [[LegacySettingsSearchEngineItem alloc] initWithType:0]; item.text = text; item.detailText = detailText; item.URL = URL; - SettingsSearchEngineItem* sameItem = - [[SettingsSearchEngineItem alloc] initWithType:0]; + LegacySettingsSearchEngineItem* sameItem = + [[LegacySettingsSearchEngineItem alloc] initWithType:0]; sameItem.text = text; sameItem.detailText = detailText; sameItem.URL = URL; EXPECT_TRUE([item isEqual:sameItem]); - SettingsSearchEngineItem* itemWithDifferentText = - [[SettingsSearchEngineItem alloc] initWithType:0]; + LegacySettingsSearchEngineItem* itemWithDifferentText = + [[LegacySettingsSearchEngineItem alloc] initWithType:0]; itemWithDifferentText.text = otherText; itemWithDifferentText.detailText = item.detailText; itemWithDifferentText.URL = item.URL; EXPECT_FALSE([item isEqual:itemWithDifferentText]); - SettingsSearchEngineItem* itemWithDifferentDetailText = - [[SettingsSearchEngineItem alloc] initWithType:0]; + LegacySettingsSearchEngineItem* itemWithDifferentDetailText = + [[LegacySettingsSearchEngineItem alloc] initWithType:0]; itemWithDifferentDetailText.text = item.text; itemWithDifferentDetailText.detailText = otherDetailText; itemWithDifferentDetailText.URL = item.URL; EXPECT_FALSE([item isEqual:itemWithDifferentDetailText]); - SettingsSearchEngineItem* itemWithDifferentURL = - [[SettingsSearchEngineItem alloc] initWithType:0]; + LegacySettingsSearchEngineItem* itemWithDifferentURL = + [[LegacySettingsSearchEngineItem alloc] initWithType:0]; itemWithDifferentURL.text = item.text; itemWithDifferentURL.detailText = item.detailText; itemWithDifferentURL.URL = otherURL;
diff --git a/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm b/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm index ae41762..d5849e46 100644 --- a/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/search_engine_table_view_controller.mm
@@ -28,7 +28,7 @@ #import "ios/chrome/browser/shared/ui/table_view/cells/table_view_text_header_footer_item.h" #import "ios/chrome/browser/shared/ui/table_view/cells/table_view_url_item.h" #import "ios/chrome/browser/shared/ui/table_view/table_view_utils.h" -#import "ios/chrome/browser/ui/settings/cells/settings_search_engine_item.h" +#import "ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h" #import "ios/chrome/common/ui/favicon/favicon_constants.h" #import "ios/chrome/common/ui/favicon/favicon_view.h" #import "ios/chrome/grit/ios_strings.h" @@ -41,9 +41,9 @@ }; typedef NS_ENUM(NSInteger, ItemType) { - ItemTypePrepopulatedEngine = kItemTypeEnumZero, + ItemTypeLegacyPrepopulatedEngine = kItemTypeEnumZero, ItemTypeHeader, - ItemTypeCustomEngine, + ItemTypeLegacyCustomEngine, }; const CGFloat kTableViewSeparatorLeadingInset = 56; @@ -310,9 +310,9 @@ } - (BOOL)editButtonEnabled { - return [self.tableViewModel hasItemForItemType:ItemTypeCustomEngine + return [self.tableViewModel hasItemForItemType:ItemTypeLegacyCustomEngine sectionIdentifier:SectionIdentifierFirstList] || - [self.tableViewModel hasItemForItemType:ItemTypeCustomEngine + [self.tableViewModel hasItemForItemType:ItemTypeLegacyCustomEngine sectionIdentifier:SectionIdentifierSecondList]; } @@ -340,12 +340,12 @@ TableViewItem* selectedItem = [model itemAtIndexPath:indexPath]; // Only search engine items can be selected. - DCHECK(selectedItem.type == ItemTypePrepopulatedEngine || - selectedItem.type == ItemTypeCustomEngine); + DCHECK(selectedItem.type == ItemTypeLegacyPrepopulatedEngine || + selectedItem.type == ItemTypeLegacyCustomEngine); // Do nothing if the tapped engine was already the default. - SettingsSearchEngineItem* selectedTextItem = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>(selectedItem); + LegacySettingsSearchEngineItem* selectedTextItem = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>(selectedItem); if (selectedTextItem.accessoryType == UITableViewCellAccessoryCheckmark) { [tableView deselectRowAtIndexPath:indexPath animated:YES]; return; @@ -355,8 +355,8 @@ if ([model hasSectionForSectionIdentifier:SectionIdentifierFirstList]) { for (TableViewItem* item in [model itemsInSectionWithIdentifier:SectionIdentifierFirstList]) { - SettingsSearchEngineItem* textItem = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>(item); + LegacySettingsSearchEngineItem* textItem = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>(item); if (textItem.accessoryType == UITableViewCellAccessoryCheckmark) { textItem.accessoryType = UITableViewCellAccessoryNone; UITableViewCell* cell = @@ -368,9 +368,9 @@ if ([model hasSectionForSectionIdentifier:SectionIdentifierSecondList]) { for (TableViewItem* item in [model itemsInSectionWithIdentifier:SectionIdentifierSecondList]) { - DCHECK(item.type == ItemTypeCustomEngine); - SettingsSearchEngineItem* textItem = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>(item); + DCHECK(item.type == ItemTypeLegacyCustomEngine); + LegacySettingsSearchEngineItem* textItem = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>(item); if (textItem.accessoryType == UITableViewCellAccessoryCheckmark) { textItem.accessoryType = UITableViewCellAccessoryNone; UITableViewCell* cell = @@ -382,8 +382,8 @@ // Show the checkmark on the new default engine. - SettingsSearchEngineItem* newDefaultEngine = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>( + LegacySettingsSearchEngineItem* newDefaultEngine = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>( [model itemAtIndexPath:indexPath]); newDefaultEngine.accessoryType = UITableViewCellAccessoryCheckmark; UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath]; @@ -429,14 +429,14 @@ return cell; TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath]; - DCHECK(item.type == ItemTypePrepopulatedEngine || - item.type == ItemTypeCustomEngine); - SettingsSearchEngineItem* engineItem = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>(item); + DCHECK(item.type == ItemTypeLegacyPrepopulatedEngine || + item.type == ItemTypeLegacyCustomEngine); + LegacySettingsSearchEngineItem* engineItem = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>(item); TableViewURLCell* urlCell = base::apple::ObjCCastStrict<TableViewURLCell>(cell); - if (item.type == ItemTypePrepopulatedEngine) { + if (item.type == ItemTypeLegacyPrepopulatedEngine) { _faviconLoader->FaviconForPageUrl( engineItem.URL, kDesiredMediumFaviconSizePt, kMinFaviconSizePt, /*fallback_to_google_server=*/YES, ^(FaviconAttributes* attributes) { @@ -463,7 +463,7 @@ - (BOOL)tableView:(UITableView*)tableView canEditRowAtIndexPath:(NSIndexPath*)indexPath { TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath]; - return item.type == ItemTypeCustomEngine; + return item.type == ItemTypeLegacyCustomEngine; } - (void)tableView:(UITableView*)tableView @@ -550,16 +550,17 @@ _secondList.erase(cutBegin, end); } -// Creates a SettingsSearchEngineItem for `templateURL`. -- (SettingsSearchEngineItem*)createSettingsSearchEngineItemFromTemplateURL: - (const TemplateURL*)templateURL { +// Creates a LegacySettingsSearchEngineItem for `templateURL`. +- (LegacySettingsSearchEngineItem*) + createSettingsSearchEngineItemFromTemplateURL: + (const TemplateURL*)templateURL { if (_settingsAreDismissed) return nil; - SettingsSearchEngineItem* item = nil; + LegacySettingsSearchEngineItem* item = nil; if (templateURL->prepopulate_id() > 0) { - item = [[SettingsSearchEngineItem alloc] - initWithType:ItemTypePrepopulatedEngine]; + item = [[LegacySettingsSearchEngineItem alloc] + initWithType:ItemTypeLegacyPrepopulatedEngine]; // Fake up a page URL for favicons of prepopulated search engines, since // favicons may be fetched from Google server which doesn't suppoprt // icon URL. @@ -568,7 +569,8 @@ _templateURLService->search_terms_data()); item.URL = GURL(emptyPageUrl); } else { - item = [[SettingsSearchEngineItem alloc] initWithType:ItemTypeCustomEngine]; + item = [[LegacySettingsSearchEngineItem alloc] + initWithType:ItemTypeLegacyCustomEngine]; // Use icon URL for favicons of custom search engines. item.URL = templateURL->favicon_url(); } @@ -612,7 +614,7 @@ if (path.section == firstSection) { TableViewItem* item = [self.tableViewModel itemAtIndexPath:path]; // Only custom search engine can be deleted. - DCHECK(item.type == ItemTypeCustomEngine); + DCHECK(item.type == ItemTypeLegacyCustomEngine); if (_shouldShowUpdatedSettings) { // The custom search engine in the first section should be the first // one. @@ -678,8 +680,8 @@ NSIndexPath* indexPath = [NSIndexPath indexPathForRow:0 inSection:firstSection]; TableViewItem* item = [model itemAtIndexPath:indexPath]; - SettingsSearchEngineItem* engineItem = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>(item); + LegacySettingsSearchEngineItem* engineItem = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>(item); engineItem.accessoryType = UITableViewCellAccessoryCheckmark; [strongSelf.tableView reloadRowsAtIndexPaths:@[ indexPath ] @@ -719,13 +721,13 @@ if (_settingsAreDismissed) return; - NSArray<NSIndexPath*>* indexPaths = - [self.tableViewModel indexPathsForItemType:ItemTypePrepopulatedEngine - sectionIdentifier:SectionIdentifierFirstList]; + NSArray<NSIndexPath*>* indexPaths = [self.tableViewModel + indexPathsForItemType:ItemTypeLegacyPrepopulatedEngine + sectionIdentifier:SectionIdentifierFirstList]; for (NSIndexPath* indexPath in indexPaths) { TableViewItem* item = [self.tableViewModel itemAtIndexPath:indexPath]; - SettingsSearchEngineItem* engineItem = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>(item); + LegacySettingsSearchEngineItem* engineItem = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>(item); engineItem.enabled = !editing; if (!editing && [self isItem:engineItem equalForTemplateURL:_templateURLService @@ -741,7 +743,7 @@ // Returns whether the `item` is the same as an item that would be created // from `templateURL`. -- (BOOL)isItem:(SettingsSearchEngineItem*)item +- (BOOL)isItem:(LegacySettingsSearchEngineItem*)item equalForTemplateURL:(const TemplateURL*)templateURL { if (!templateURL) { return NO;
diff --git a/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm index a1a1744..b0d5c64 100644 --- a/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm
@@ -36,7 +36,7 @@ #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/shared/ui/table_view/legacy_chrome_table_view_controller_test.h" -#import "ios/chrome/browser/ui/settings/cells/settings_search_engine_item.h" +#import "ios/chrome/browser/ui/settings/cells/legacy_settings_search_engine_item.h" #import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -147,8 +147,8 @@ int section, int row, bool enabled) { - SettingsSearchEngineItem* item = - base::apple::ObjCCastStrict<SettingsSearchEngineItem>( + LegacySettingsSearchEngineItem* item = + base::apple::ObjCCastStrict<LegacySettingsSearchEngineItem>( GetTableViewItem(section, row)); EXPECT_NSEQ(expected_text, item.text); EXPECT_NSEQ(expected_detail_text, item.detailText); @@ -159,12 +159,13 @@ EXPECT_EQ(enabled, item.enabled); } - // Checks a SettingsSearchEngineItem with data from a fabricated TemplateURL. - // The SettingsSearchEngineItem in the `row` of `section` should contain - // a title and a subtitle that are equal to `expected_text` and an URL which - // can be generated by filling empty query word into + // Checks a LegacySettingsSearchEngineItem with data from a fabricated + // TemplateURL. The LegacySettingsSearchEngineItem in the `row` of `section` + // should contain a title and a subtitle that are equal to `expected_text` and + // an URL which can be generated by filling empty query word into // `expected_searchable_url`. If `expected_checked` is true, the - // SettingsSearchEngineItem should have a UITableViewCellAccessoryCheckmark. + // LegacySettingsSearchEngineItem should have a + // UITableViewCellAccessoryCheckmark. void CheckPrepopulatedItem(const std::string& expected_text, const GURL& expected_searchable_url, bool expected_checked, @@ -182,12 +183,13 @@ expected_checked, section, row, enabled); } - // Checks a SettingsSearchEngineItem with data from a fabricated TemplateURL. - // The SettingsSearchEngineItem in the `row` of `section` should contain - // a title and a subtitle that are equal to `expected_text` and an URL - // which can be generated from `expected_searchable_url` by + // Checks a LegacySettingsSearchEngineItem with data from a fabricated + // TemplateURL. The LegacySettingsSearchEngineItem in the `row` of `section` + // should contain a title and a subtitle that are equal to `expected_text` and + // an URL which can be generated from `expected_searchable_url` by // TemplateURL::GenerateFaviconURL. If `expected_checked` is true, the - // SettingsSearchEngineItem should have a UITableViewCellAccessoryCheckmark. + // LegacySettingsSearchEngineItem should have a + // UITableViewCellAccessoryCheckmark. void CheckCustomItem(const std::string& expected_text, const GURL& expected_searchable_url, bool expected_checked, @@ -200,12 +202,12 @@ expected_checked, section, row, enabled); } - // Checks a SettingsSearchEngineItem with data from a real prepopulated - // TemplateURL. The SettingsSearchEngineItem in the `row` of `section` should - // contain a title equal to `expected_text`, a subtitle equal to + // Checks a LegacySettingsSearchEngineItem with data from a real prepopulated + // TemplateURL. The LegacySettingsSearchEngineItem in the `row` of `section` + // should contain a title equal to `expected_text`, a subtitle equal to // `expected_detail_text`, and an URL equal to `expected_favicon_url`. If - // `expected_checked` is true, the SettingsSearchEngineItem should have a - // UITableViewCellAccessoryCheckmark. + // `expected_checked` is true, the LegacySettingsSearchEngineItem should have + // a UITableViewCellAccessoryCheckmark. void CheckRealItem(const TemplateURL* turl, bool expected_checked, int section,
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/tab_groups/tab_group_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/tab_groups/tab_group_view_controller.mm index 42ac160..7468adc5 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/tab_groups/tab_group_view_controller.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/tab_groups/tab_group_view_controller.mm
@@ -210,7 +210,7 @@ UIView* dotView = [[UIView alloc] initWithFrame:CGRectZero]; dotView.translatesAutoresizingMaskIntoConstraints = NO; dotView.layer.cornerRadius = kColoredDotSize / 2; - dotView.layer.backgroundColor = _groupColor.CGColor; + dotView.backgroundColor = _groupColor; [NSLayoutConstraint activateConstraints:@[ [dotView.heightAnchor constraintEqualToConstant:kColoredDotSize], @@ -249,8 +249,7 @@ - (UIView*)configuredPrimaryTitle { UIView* fullTitleView = [[UIView alloc] initWithFrame:CGRectZero]; fullTitleView.translatesAutoresizingMaskIntoConstraints = NO; - fullTitleView.backgroundColor = - [[UIColor colorNamed:kSolidWhiteColor] colorWithAlphaComponent:0.1]; + fullTitleView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.1]; fullTitleView.layer.cornerRadius = kTitleBackgroundCornerRadius; fullTitleView.opaque = NO;
diff --git a/ios/chrome/common/ui/util/button_util.mm b/ios/chrome/common/ui/util/button_util.mm index c1f0c06..2113259 100644 --- a/ios/chrome/common/ui/util/button_util.mm +++ b/ios/chrome/common/ui/util/button_util.mm
@@ -29,7 +29,7 @@ UIFont* font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; NSDictionary* attributes = @{NSFontAttributeName : font}; NSMutableAttributedString* string = - [[NSMutableAttributedString alloc] initWithString:@""]; + [[NSMutableAttributedString alloc] initWithString:@" "]; [string addAttributes:attributes range:NSMakeRange(0, string.length)]; buttonConfiguration.attributedTitle = string;
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 index 2c6e9cf..459d026 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -51cd3479e43b4012e0d1f2e210458380e9819e88 \ No newline at end of file +172157f789dff862e2e94b2a9760ac20ff27050b \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 index 4d9a2453..ca89720 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -bbc5aed3305db65ccd19de59bf007472d43864fd \ No newline at end of file +7cea44686597875e11cea163697863daaa39eb22 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index 4638499..c31cf76 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -9c961dee0b2592a97fcc952abf1b6bc72e39afb6 \ No newline at end of file +b48bbb9c30472203000c831923ac9214024b5ab5 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index 3e6d28a..5c6de1f 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -f5281e75ac73c9cad378bd95addeb4c46b071549 \ No newline at end of file +453090452495c7c5f5a6590aa80eee9773b491f1 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index ef0ca3f4..1b5a1da 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -ca8f7fb5b2c35b97b99d79846f0034bc5ef5ef15 \ No newline at end of file +1dbd47fa98a22ad9810300450acea38a3fdc0b72 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index edc3d30..72df7aa 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -ec56a82623e6962b4d9c64b1258806be56ceb46a \ No newline at end of file +43085eb280c7bd6872efcbe7e1fb3cfd2da2a826 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 index 4710728..ab36f495 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -0ad445f89f2c50cf0eb0051aa315813d83f0b03c \ No newline at end of file +bb0e02ecad6eb7d840f207ce0d2fc26c828df809 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 index ea3014a..f8b53f40 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -acb01ce5750c9a0376da74f6d7a55b2a8481375e \ No newline at end of file +1862307a4f573dd64376362730391a9b94188348 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index d7b6aa5..0d5d0ec 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -031298aec3fb1fefa0cb5818b17b49d673025d56 \ No newline at end of file +a40b9a981f457c7c9583f2ddd4aaf3d12cb742aa \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index d32fec5..2d128922 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -10c2ae89fa262d9e2c745601ab50613f155a5a7e \ No newline at end of file +a784e47975a5092be8fe7a787fdd2d5c0b38e044 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index bb5c37d..0a0f611 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -0af56d1b354e04ebd5d74ef3d010d45399ff4c53 \ No newline at end of file +530280348b24db1f6c71d0f15c8458024eac4ed2 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index 945c44f..342fa433 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -347e16e2bc24382b1f78ebcfe4fb617a161eeeb8 \ No newline at end of file +7f95b256f3b74298e30027c0ce043586621520b3 \ No newline at end of file
diff --git a/ios_internal b/ios_internal index 0aa9370..1b070c0 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 0aa93701d8d782d45dc538c8fbae4eeeeee0414c +Subproject commit 1b070c09e79ffad05461f8b098c6ba2cf2ae332d
diff --git a/third_party/angle b/third_party/angle index 48ff6a2..09c69b5 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit 48ff6a269e732ea1fa458e5b8bb29df6578c9849 +Subproject commit 09c69b5b5cb987ff236fe11929a780a116a7a8bd
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc b/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc index 4c5edd0..7aaa814 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc +++ b/third_party/blink/renderer/core/intersection_observer/intersection_geometry.cc
@@ -203,7 +203,8 @@ IntersectionGeometry::kShouldTrackFractionOfRoot | IntersectionGeometry::kForFrameViewportIntersection | IntersectionGeometry::kShouldConvertToCSSPixels | - IntersectionGeometry::kUseOverflowClipEdge; + IntersectionGeometry::kUseOverflowClipEdge | + IntersectionGeometry::kRespectFilters; } // namespace @@ -386,15 +387,12 @@ const LayoutObject* previous_container = nullptr; const LayoutObject* container = target; while (container != root) { - if (!RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()) { - has_filter |= container->HasFilterInducingProperty(); - } + has_filter |= container->HasFilterInducingProperty(); // Don't check for filters if we've already found one. LayoutObject::AncestorSkipInfo skip_info(root, !has_filter); previous_container = container; container = container->Container(&skip_info); - if (!RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled() && - !has_filter) { + if (!has_filter) { has_filter = skip_info.FilterSkipped(); } if (!container || skip_info.AncestorSkipped()) { @@ -711,7 +709,7 @@ unsigned flags = kDefaultVisualRectFlags | kEdgeInclusive | kDontApplyMainFrameOverflowClip; - if (RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()) { + if (!ShouldRespectFilters()) { flags |= kIgnoreFilters; } if (CanUseGeometryMapper(*target)) { @@ -847,8 +845,7 @@ // Intersection is not affected by scroll. return kInfiniteScrollDelta; } - if (root_and_target.has_filter) { - DCHECK(!RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()); + if (root_and_target.has_filter && ShouldRespectFilters()) { // With filters, the intersection rect can be non-empty even if root_rect_ // and target_rect_ don't intersect. return gfx::Vector2dF();
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_geometry.h b/third_party/blink/renderer/core/intersection_observer/intersection_geometry.h index 5c83a491..0fee2a5 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_geometry.h +++ b/third_party/blink/renderer/core/intersection_observer/intersection_geometry.h
@@ -45,12 +45,13 @@ // Applies to boxes. If true, OverflowClipRect() is used if necessary // instead of BorderBoundingBox(). kUseOverflowClipEdge = 1 << 5, + kRespectFilters = 1 << 6, // These flags will be computed - kShouldUseCachedRects = 1 << 6, - kRootIsImplicit = 1 << 7, - kDidComputeGeometry = 1 << 8, - kIsVisible = 1 << 9 + kShouldUseCachedRects = 1 << 7, + kRootIsImplicit = 1 << 8, + kDidComputeGeometry = 1 << 9, + kIsVisible = 1 << 10 }; struct RootGeometry { @@ -139,6 +140,7 @@ private: bool RootIsImplicit() const { return flags_ & kRootIsImplicit; } bool ShouldUseCachedRects() const { return flags_ & kShouldUseCachedRects; } + bool ShouldRespectFilters() const { return flags_ & kRespectFilters; } bool IsForFrameViewportIntersection() const { return flags_ & kForFrameViewportIntersection; } @@ -174,7 +176,8 @@ // - `root` is the LayoutView and `target` is contained by a fixed-position // element that is fixed to the viewport. bool root_scrolls_target = false; - // This is used only when relationship is kScrollable*. + // This is used only when relationship is kHasIntermediateClippers or + // kScrollableByRootOnly. bool has_filter = false; // This is collected only if has_scroll_margin is true. HeapVector<Member<const LayoutBox>, 2> intermediate_scrollers;
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observation.cc b/third_party/blink/renderer/core/intersection_observer/intersection_observation.cc index 6cd2614d..5407fb34 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observation.cc +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observation.cc
@@ -251,6 +251,11 @@ geometry_flags |= IntersectionGeometry::kShouldTrackFractionOfRoot; if (Observer()->UseOverflowClipEdge()) geometry_flags |= IntersectionGeometry::kUseOverflowClipEdge; + if (Observer()->IsInternal()) { + // TODO(wangxianzhu): Let internal clients decide whether to respect + // filters. + geometry_flags |= IntersectionGeometry::kRespectFilters; + } return geometry_flags; }
diff --git a/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc b/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc index 35404887..1e5cad2 100644 --- a/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc +++ b/third_party/blink/renderer/core/intersection_observer/intersection_observer_test.cc
@@ -2074,8 +2074,7 @@ } TEST_P(IntersectionObserverTest, MinScrollDeltaToUpdateThresholdFilterOnRoot) { - if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled() || - RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()) { + if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled()) { return; } WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600)); @@ -2095,7 +2094,9 @@ LocalFrameView* frame_view = GetDocument().View(); TestIntersectionObserverDelegate* observer_delegate = - MakeGarbageCollected<TestIntersectionObserverDelegate>(GetDocument()); + MakeGarbageCollected<TestIntersectionObserverDelegate>( + GetDocument(), + LocalFrameUkmAggregator::kDisplayLockIntersectionObserver); IntersectionObserverInit* observer_init = IntersectionObserverInit::Create(); observer_init->setRoot(MakeGarbageCollected<V8UnionDocumentOrElement>(root)); DummyExceptionStateForTesting exception_state; @@ -2119,8 +2120,7 @@ TEST_P(IntersectionObserverTest, MinScrollDeltaToUpdateThresholdFilterOnTarget) { - if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled() || - RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()) { + if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled()) { return; } WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600)); @@ -2139,33 +2139,47 @@ Element* target = GetDocument().getElementById(AtomicString("target")); LocalFrameView* frame_view = GetDocument().View(); - TestIntersectionObserverDelegate* observer_delegate = + TestIntersectionObserverDelegate* observer_delegate_js = MakeGarbageCollected<TestIntersectionObserverDelegate>(GetDocument()); + TestIntersectionObserverDelegate* observer_delegate_display_lock = + MakeGarbageCollected<TestIntersectionObserverDelegate>( + GetDocument(), + LocalFrameUkmAggregator::kDisplayLockIntersectionObserver); IntersectionObserverInit* observer_init = IntersectionObserverInit::Create(); observer_init->setRoot(MakeGarbageCollected<V8UnionDocumentOrElement>(root)); DummyExceptionStateForTesting exception_state; - IntersectionObserver* observer = IntersectionObserver::Create( - observer_init, *observer_delegate, exception_state); + IntersectionObserver* observer_js = IntersectionObserver::Create( + observer_init, *observer_delegate_js, exception_state); + IntersectionObserver* observer_display_lock = IntersectionObserver::Create( + observer_init, *observer_delegate_display_lock, exception_state); ASSERT_FALSE(exception_state.HadException()); - observer->observe(target, exception_state); + observer_js->observe(target, exception_state); ASSERT_FALSE(exception_state.HadException()); - const IntersectionObservation* observation = - target->IntersectionObserverData()->GetObservationFor(*observer); - EXPECT_EQ(gfx::Vector2dF(), observation->MinScrollDeltaToUpdate()); + observer_display_lock->observe(target, exception_state); + ASSERT_FALSE(exception_state.HadException()); + const IntersectionObservation* observation_js = + target->IntersectionObserverData()->GetObservationFor(*observer_js); + EXPECT_EQ(gfx::Vector2dF(), observation_js->MinScrollDeltaToUpdate()); + const IntersectionObservation* observation_display_lock = + target->IntersectionObserverData()->GetObservationFor( + *observer_display_lock); + EXPECT_EQ(gfx::Vector2dF(), + observation_display_lock->MinScrollDeltaToUpdate()); EXPECT_EQ(LocalFrameView::kRequired, frame_view->GetIntersectionObservationStateForTesting()); Compositor().BeginFrame(); test::RunPendingTasks(); - EXPECT_EQ(gfx::Vector2dF(), observation->MinScrollDeltaToUpdate()); + EXPECT_EQ(gfx::Vector2dF(100, 100), observation_js->MinScrollDeltaToUpdate()); + EXPECT_EQ(gfx::Vector2dF(), + observation_display_lock->MinScrollDeltaToUpdate()); EXPECT_EQ(LocalFrameView::kNotNeeded, frame_view->GetIntersectionObservationStateForTesting()); } TEST_P(IntersectionObserverTest, MinScrollDeltaToUpdateThresholdFilterOnIntermediateContainer) { - if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled() || - RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()) { + if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled()) { return; } WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600)); @@ -2186,7 +2200,9 @@ LocalFrameView* frame_view = GetDocument().View(); TestIntersectionObserverDelegate* observer_delegate = - MakeGarbageCollected<TestIntersectionObserverDelegate>(GetDocument()); + MakeGarbageCollected<TestIntersectionObserverDelegate>( + GetDocument(), + LocalFrameUkmAggregator::kDisplayLockIntersectionObserver); IntersectionObserverInit* observer_init = IntersectionObserverInit::Create(); observer_init->setRoot(MakeGarbageCollected<V8UnionDocumentOrElement>(root)); DummyExceptionStateForTesting exception_state; @@ -2210,8 +2226,7 @@ TEST_P(IntersectionObserverTest, MinScrollDeltaToUpdateThresholdFilterOnIntermediateNonContainer) { - if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled() || - RuntimeEnabledFeatures::IntersectionObserverIgnoreFiltersEnabled()) { + if (!RuntimeEnabledFeatures::IntersectionOptimizationEnabled()) { return; } WebView().MainFrameViewWidget()->Resize(gfx::Size(800, 600)); @@ -2234,7 +2249,9 @@ LocalFrameView* frame_view = GetDocument().View(); TestIntersectionObserverDelegate* observer_delegate = - MakeGarbageCollected<TestIntersectionObserverDelegate>(GetDocument()); + MakeGarbageCollected<TestIntersectionObserverDelegate>( + GetDocument(), + LocalFrameUkmAggregator::kDisplayLockIntersectionObserver); IntersectionObserverInit* observer_init = IntersectionObserverInit::Create(); observer_init->setRoot(MakeGarbageCollected<V8UnionDocumentOrElement>(root)); DummyExceptionStateForTesting exception_state;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 17d3e273..8f9d7a9 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2165,12 +2165,6 @@ name: "InterruptComposedScrollbarDisappearance", status: "stable", }, - // A killswitch for the change. Will remove after M120 or M121 becomes - // stable without no blocking bugs. - { - name: "IntersectionObserverIgnoreFilters", - status: "stable", - }, { // If enabled, IntersectionObserverScrollMargin will be parsed. name: "IntersectionObserverScrollMargin",
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-site-isolation-trials b/third_party/blink/web_tests/FlagExpectations/disable-site-isolation-trials index 8c88dc3..c4cecaf 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-site-isolation-trials +++ b/third_party/blink/web_tests/FlagExpectations/disable-site-isolation-trials
@@ -143,8 +143,6 @@ crbug.com/1444753 http/tests/inspector-protocol/tracing/prerender.js [ Skip ] # Re-enable after new baselines are generated -crbug.com/1456636 [ Linux ] virtual/view-transition-wide-gamut/view-transition/parent-transition-cancels-child.html [ Failure ] # Reftest image failure -crbug.com/1456636 [ Linux ] virtual/view-transition-mpa-serialization/view-transition/parent-transition-cancels-child.html [ Failure ] # Reftest image failure crbug.com/1456636 [ Linux ] virtual/view-transition/view-transition/parent-transition-cancels-child.html [ Failure ] # Reftest image failure crbug.com/1487775 virtual/fenced-frame-mparch/wpt_internal/fenced_frame/unfenced-top.https.html [ Failure Timeout ]
diff --git a/third_party/blink/web_tests/FlagExpectations/highdpi b/third_party/blink/web_tests/FlagExpectations/highdpi index 6fee212..fe1d4f3 100644 --- a/third_party/blink/web_tests/FlagExpectations/highdpi +++ b/third_party/blink/web_tests/FlagExpectations/highdpi
@@ -440,8 +440,6 @@ # crbug.com/1339051: some ref tests generate output with minor differences. crbug.com/1339051 fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl.html [ Failure ] -# Re-enable after new baselines are generated -crbug.com/1456636 [ Linux ] virtual/view-transition/external/wpt/css/css-view-transitions/new-and-old-sizes-match.html [ Failure ] # Reftest image failure # Fails with a single-pixel offset when run with single-threaded compositing. crbug.com/1491883 [ Linux ] fast/forms/date/date-with-csp.html [ Failure ] # Reftest image failure
diff --git a/third_party/blink/web_tests/SlowTests b/third_party/blink/web_tests/SlowTests index 8d8b68c..53328d1 100644 --- a/third_party/blink/web_tests/SlowTests +++ b/third_party/blink/web_tests/SlowTests
@@ -120,7 +120,8 @@ crbug.com/24182 [ Linux ] fast/events/tabindex-focus-blur-all.html [ Slow ] crbug.com/24182 [ Mac11 Release ] fast/events/tabindex-focus-blur-all.html [ Slow ] crbug.com/24182 [ Mac12 ] fast/events/tabindex-focus-blur-all.html [ Slow ] -crbug.com/24182 [ Release Win ] fast/events/tabindex-focus-blur-all.html [ Slow ] +crbug.com/24182 [ Release Win10.20h2 ] fast/events/tabindex-focus-blur-all.html [ Slow ] +crbug.com/24182 [ Release Win11 ] fast/events/tabindex-focus-blur-all.html [ Slow ] crbug.com/451577 [ Debug Linux ] fast/dom/gc-treescope.html [ Slow ] crbug.com/451577 [ Debug Linux ] fast/frames/calculate-round.html [ Slow ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 0d7aa66f..802bd22 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -382,7 +382,6 @@ crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=normal&right-white-space=pre-wrap [ Failure ] crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=nowrap&right-white-space=normal [ Failure ] crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=nowrap&right-white-space=pre [ Failure ] -crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=nowrap&right-white-space=pre-line [ Failure ] crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=nowrap&right-white-space=pre-wrap [ Failure ] crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=pre&right-white-space=normal [ Failure ] crbug.com/1370704 external/wpt/editing/other/join-different-white-space-style-left-paragraph-and-right-line.html?method=backspace&left-white-space=pre&right-white-space=nowrap [ Failure ] @@ -4222,8 +4221,6 @@ # reftests that only pass when the new direction code is enabled. crbug.com/576815 virtual/dir-pseudo-disabled/external/wpt/html/dom/elements/global-attributes/dir_auto-N-EN.html [ Failure ] -# SwANGLE issues -crbug.com/1204234 css3/blending/background-blend-mode-single-accelerated-element.html [ Failure ] # "in-multicol-child.html" is laid out in legacy layout due by "multicol" but # reference is laid out by LayoutNG. @@ -5541,7 +5538,7 @@ crbug.com/1289607 [ Linux ] external/wpt/cookie-store/cookieStore_subscribe_arguments.https.any.html [ Failure ] crbug.com/1408294 [ Debug Linux ] virtual/gpu/external/wpt/mediacapture-record/MediaRecorder-canvas-media-source.https.html [ Failure ] crbug.com/1229708 fast/events/pointerevents/pointer-event-in-slop-region.html [ Failure Pass ] -crbug.com/1406896 [ Linux ] http/tests/inspector-protocol/cpu-profiler/record-cpu-profile-with-cpu-throttling.js [ Crash ] +crbug.com/1406896 [ Debug Linux ] http/tests/inspector-protocol/cpu-profiler/record-cpu-profile-with-cpu-throttling.js [ Crash ] crbug.com/1370749 [ Debug Linux ] virtual/threaded-no-composited-antialiasing/animations/add-keyframes-recalc.html [ Failure ] crbug.com/1422340 [ Win ] virtual/media-foundation-for-clear-dcomp/media/video-move-to-document-pip.html [ Failure ] crbug.com/1434123 media/video-source-type.html [ Failure Pass ] @@ -6618,8 +6615,6 @@ # Re-enable after new baselines are generated crbug.com/1456636 [ Linux ] virtual/view-transition/view-transition/parent-transition-cancels-child.html [ Failure ] # Reftest image failure -crbug.com/1456636 [ Linux ] virtual/view-transition-wide-gamut/view-transition/parent-transition-cancels-child.html [ Failure ] # Reftest image failure -crbug.com/1456636 [ Linux ] virtual/view-transition-mpa-serialization/view-transition/parent-transition-cancels-child.html [ Failure ] # Reftest image failure crbug.com/1367789 [ Win10.20h2 ] external/wpt/orientation-event/motion/page-visibility.https.html [ Timeout ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 060ad6f..3056f0bd 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -439,7 +439,8 @@ "exclusive_tests": ["fast/hidpi/static"], "args": ["--force-device-scale-factor=2", "--disable-threaded-compositing", "--disable-threaded-animation"], - "expires": "Jul 1, 2023" + "owners": ["paint-dev@chromium.org"], + "expires": "never" }, { "prefix": "scalefactor150", @@ -449,7 +450,8 @@ "exclusive_tests": ["fast/hidpi/static"], "args": ["--force-device-scale-factor=1.5", "--disable-threaded-compositing", "--disable-threaded-animation"], - "expires": "Jul 1, 2023" + "owners": ["paint-dev@chromium.org"], + "expires": "never" }, { "prefix": "dark-mode-classifier-transparency-and-num-colors", @@ -601,7 +603,7 @@ "prefix": "direct-sockets", "platforms": ["Linux", "Mac", "Win"], "bases": ["external/wpt/direct-sockets", - "wpt_internal/direct-sockets"], + "wpt_internal/direct-sockets"], "exclusive_tests": "ALL", "args": ["--isolated-context-origins=https://web-platform.test", "--disable-threaded-compositing", "--disable-threaded-animation"],
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index d93e63c1..b5fb595 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -286454,7 +286454,46 @@ {} ] ] - } + }, + "side-effects-of-animations-current.html": [ + "b0de72bdbf9bcffef88ca5dc12bbe0f9ef239823", + [ + null, + [ + [ + "/web-animations/animation-model/side-effects-of-animations-current-ref.html", + "==" + ] + ], + {} + ] + ], + "side-effects-of-animations-in-effect.html": [ + "ff53c98d79373bd048f5ec96051cb129d7ed5795", + [ + null, + [ + [ + "/web-animations/animation-model/side-effects-of-animations-in-effect-ref.html", + "==" + ] + ], + {} + ] + ], + "side-effects-of-animations-none.html": [ + "b460ecc27fd1487075b9871e656e5a3bdbfb5399", + [ + null, + [ + [ + "/web-animations/animation-model/side-effects-of-animations-none-ref.html", + "==" + ] + ], + {} + ] + ] }, "responsive": { "toggle-animated-iframe-visibility.html": [ @@ -393364,7 +393403,19 @@ "1e7f250c48fb093160a509b3d98c0b265085179f", [] ] - } + }, + "side-effects-of-animations-current-ref.html": [ + "acc0465b074c2dddfeb1ac427d49a55e5dcecd64", + [] + ], + "side-effects-of-animations-in-effect-ref.html": [ + "24160cb267788196430c4299e12dc6c010183fc0", + [] + ], + "side-effects-of-animations-none-ref.html": [ + "4d1ea997f4cb6923f6c1a22409469652d7170d87", + [] + ] }, "idlharness.window-expected.txt": [ "ce969c5afbe5f63195d75624a798340d97619a0d", @@ -444133,7 +444184,7 @@ ] ], "content-visibility-vs-scrollIntoView-003.html": [ - "65e48663a917d029238feb767395c132ecf8a43d", + "93b085a5318c0cc2fcaf44fbb1fe3f50485b6319", [ null, {}
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html index 65e48663..93b085a 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html
@@ -56,12 +56,13 @@ }); } -promise_test(async () => { - await tick(); +function waitForEvent() { + return new Promise(resolve => e3.addEventListener('contentvisibilityautostatechange', resolve)); +} - function waitForEvent() { - return new Promise(resolve => e3.addEventListener('contentvisibilityautostatechange', resolve)); - } +promise_test(async (t) => { + // Make sure the first event has fired. + await waitForEvent(); var eventCounter = 0; function eventHandler(e) {
diff --git a/third_party/dawn b/third_party/dawn index b1b829b..10aa8bc 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit b1b829b49d69af4c48875512c3392f1b2f4994c3 +Subproject commit 10aa8bc80bbfef2650adbd4643a007e3efb7708c
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 59f428f..9384327 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 59f428f071a17a493a5563cda92e6a7dc3d59ef0 +Subproject commit 9384327dc44ffdc6a5b98783c7614efa75f753ed
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index b03d0e4..537237c 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit b03d0e46221a7992bc9fb36ca888e9518d9f2818 +Subproject commit 537237ced590b359b9a213bd44ef5b46107d4371
diff --git a/third_party/webrtc b/third_party/webrtc index ee2fcba..f404434 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit ee2fcbab428934630b39e0be128cb0fcd0573aae +Subproject commit f40443424ea57e794be5e43abc2d8d8f6b7c50b9
diff --git a/ui/views/layout/layout_manager_base.cc b/ui/views/layout/layout_manager_base.cc index a29225d..31a0ee6 100644 --- a/ui/views/layout/layout_manager_base.cc +++ b/ui/views/layout/layout_manager_base.cc
@@ -12,6 +12,7 @@ #include "base/memory/raw_ptr.h" #include "base/trace_event/trace_event.h" #include "ui/views/view.h" +#include "ui/views/view_class_properties.h" namespace views { @@ -112,21 +113,24 @@ void LayoutManagerBase::SetChildViewIgnoredByLayout(View* child_view, bool ignored) { - auto it = child_infos_.find(child_view); - DCHECK(it != child_infos_.end()); - if (it->second.ignored == ignored) + if (child_view->GetProperty(kViewIgnoredByLayoutKey) == ignored) { return; + } base::AutoReset<bool> setter(&suppress_invalidate_, true); + if (ignored) { + child_view->SetProperty(kViewIgnoredByLayoutKey, true); + } else { + child_view->ClearProperty(kViewIgnoredByLayoutKey); + } + PropagateChildViewIgnoredByLayout(child_view, ignored); InvalidateHost(false); } bool LayoutManagerBase::IsChildViewIgnoredByLayout( const View* child_view) const { - auto it = child_infos_.find(child_view); - DCHECK(it != child_infos_.end()); - return it->second.ignored; + return child_view->GetProperty(kViewIgnoredByLayoutKey); } LayoutManagerBase::LayoutManagerBase() = default; @@ -147,7 +151,8 @@ if (it == child_infos_.end()) return false; - return !it->second.ignored && (include_hidden || it->second.can_be_visible); + return !IsChildViewIgnoredByLayout(child) && + (include_hidden || it->second.can_be_visible); } bool LayoutManagerBase::CanBeVisible(const View* child) const { @@ -287,7 +292,8 @@ auto it = child_infos_.find(view); DCHECK(it != child_infos_.end()); - const bool removed_visible = it->second.can_be_visible && !it->second.ignored; + const bool removed_visible = + it->second.can_be_visible && !IsChildViewIgnoredByLayout(view); base::AutoReset<bool> setter(&suppress_invalidate_, true); const bool invalidate = PropagateViewRemoved(host, view); @@ -302,7 +308,7 @@ DCHECK_EQ(host_view_, host); auto it = child_infos_.find(view); DCHECK(it != child_infos_.end()); - const bool was_ignored = it->second.ignored; + const bool was_ignored = IsChildViewIgnoredByLayout(view); if (it->second.can_be_visible == new_visibility) return; @@ -321,8 +327,8 @@ owned_layout->Installed(host_view_); for (View* child_view : host_view_->children()) { const ChildInfo& child_info = child_infos_.find(child_view)->second; - owned_layout->PropagateChildViewIgnoredByLayout(child_view, - child_info.ignored); + owned_layout->PropagateChildViewIgnoredByLayout( + child_view, IsChildViewIgnoredByLayout(child_view)); owned_layout->PropagateViewVisibilitySet(host_view_, child_view, child_info.can_be_visible); } @@ -340,8 +346,6 @@ bool LayoutManagerBase::PropagateChildViewIgnoredByLayout(View* child_view, bool ignored) { - child_infos_[child_view].ignored = ignored; - bool result = false; for (auto& owned_layout : owned_layouts_) { result |= @@ -352,7 +356,7 @@ } bool LayoutManagerBase::PropagateViewAdded(View* host, View* view) { - child_infos_.emplace(view, ChildInfo{view->GetVisible(), false}); + child_infos_.emplace(view, ChildInfo{view->GetVisible()}); bool result = false; @@ -392,7 +396,7 @@ void LayoutManagerBase::PropagateInstalled(View* host) { host_view_ = host; for (views::View* it : host->children()) { - child_infos_.emplace(it, ChildInfo{it->GetVisible(), false}); + child_infos_.emplace(it, ChildInfo{it->GetVisible()}); } for (auto& owned_layout : owned_layouts_)
diff --git a/ui/views/layout/layout_manager_base.h b/ui/views/layout/layout_manager_base.h index 0943845..23b065c2 100644 --- a/ui/views/layout/layout_manager_base.h +++ b/ui/views/layout/layout_manager_base.h
@@ -181,7 +181,6 @@ // layout. struct ChildInfo { bool can_be_visible = true; - bool ignored = false; }; // LayoutManager:
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc index 181982f..b5b1a62 100644 --- a/ui/views/window/dialog_client_view.cc +++ b/ui/views/window/dialog_client_view.cc
@@ -416,12 +416,13 @@ auto* layout = button_row_container_->SetLayoutManager( std::make_unique<views::TableLayout>()); layout->SetMinimumSize(minimum_size_); - if (extra_view_ && !extra_view_->GetVisible()) { + if (extra_view_) { // TableLayout will force its child views to be visible if they aren't // explicitly ignored, which will cause the extra view the client supplied // to be shown when they don't want it to. // TODO(https://crbug.com/1474952): Remove this workaround. - layout->SetChildViewIgnoredByLayout(extra_view_, true); + extra_view_->SetProperty(kViewIgnoredByLayoutKey, + !extra_view_->GetVisible()); } // The |resize_percent| constants. There's only one stretchy column (padding
diff --git a/v8 b/v8 index 81e4fb3..3424896 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit 81e4fb39880b4c2a3ff52d4778a56cef385cebd5 +Subproject commit 34248965c12fc846f437770c1a7557e8fabfccd1