diff --git a/DEPS b/DEPS index ff04f26..9ee8e211 100644 --- a/DEPS +++ b/DEPS
@@ -300,11 +300,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'ca89d2781f782c36ed021e9bc9e1dd80b6550b52', + 'skia_revision': 'd8a45111ba9a352e9aefd43e871adad190f19c82', # 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': 'bbf40f4b96998cd1a47d9b20ba513707f166691f', + 'v8_revision': '64cdb3f8534c5a090134fc59962f92b2a886f4c7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -316,7 +316,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '48c2e69051b94b9a26b9126974bb282be8a36b2d', + 'pdfium_revision': '435a508730a6509af8fd1f3ab44e70f5a450f9e0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -371,7 +371,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '94fe26f9d5ab1009c0cc716314d3d92a4f56e056', + 'catapult_revision': '7ee071132a536a6616589cc2411674d1b459b4da', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -415,11 +415,11 @@ # 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': '426b47e4816542659fdce29b3c689045d288e199', + 'dawn_revision': '1862e83510aef598b427af3d3a5c18fbf17ac590', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': '51510ec3b3e3996239e7a03d745da0db2da79ea3', + 'quiche_revision': 'c9cd7f6c60e89fd5f478c067b746ac1ed11babde', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -955,7 +955,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'vqYWBuNeaF85CGvaKzQtC7wXNdb5Yy-R-KFqxDNbyBkC', + 'version': '1l2wW2v13pOINmRJeW_1lNPxQkpbH0RXm7GGAN6c0oMC', }, ], 'condition': 'checkout_android', @@ -1198,7 +1198,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '5084800dc3cea44a6e135ccee721034ec7951fa7', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'bcb046f58350ee087cd392004bda421417913478', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1592,7 +1592,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '85910f22b620e71323e7681d8b3c6689aaf4aa1a', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'e5f4582104f08abdd38246c6085684dc1c4e8112', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1723,7 +1723,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@1d36249fb716315181169b0aa95307584c338bf2', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@40446ec62941acb18e1da662a6609ea51e10618f', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + 'ebe84bec02c041d28f902da0214bf442743fc907', @@ -1759,10 +1759,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd1b65aa5a88f6efd900604dfcda840154e9f16e2', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '39f597ad35bd5e88af9c388c65582673922df63c', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'e53aff4e9a6c3d418f94b2f22af58243f7d3c7a3', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '4c77c5462325cc8b73c7e13777438d6dd387ac06', + Var('webrtc_git') + '/src.git' + '@' + '5027c1a482dda5a827a60812540a68a3d24e3b73', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1835,7 +1835,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@e52d1f44e259791bec1662e75298a62f29371ab4', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@bb0bfc93d2a6a8eefedbe16ef7b6baacd642468f', 'condition': 'checkout_src_internal', },
diff --git a/android_webview/tools/run_cts.py b/android_webview/tools/run_cts.py index 0e5303b0..1ab2893 100755 --- a/android_webview/tools/run_cts.py +++ b/android_webview/tools/run_cts.py
@@ -39,11 +39,13 @@ os.path.dirname(__file__), os.pardir, os.pardir, 'build', 'android', 'test_runner.py') -_WEBVIEW_CTS_GCS_PATH_FILE = os.path.join( - os.path.dirname(__file__), 'cts_config', 'webview_cts_gcs_path.json') _ARCH_SPECIFIC_CTS_INFO = ["filename", "unzip_dir", "_origin"] -_CTS_ARCHIVE_DIR = os.path.join(os.path.dirname(__file__), 'cts_archive') +_DEFAULT_CTS_GCS_PATH_FILE = os.path.join(os.path.dirname(__file__), + 'cts_config', + 'webview_cts_gcs_path.json') +_DEFAULT_CTS_ARCHIVE_DIR = os.path.join(os.path.dirname(__file__), + 'cts_archive') _CTS_WEBKIT_PACKAGES = ["com.android.cts.webkit", "android.webkit.cts"] @@ -81,12 +83,14 @@ TEST_FILTER_OPT = '--test-filter' -def GetCtsInfo(arch, cts_release, item): - """Gets contents of CTS Info for arch and cts_release. - See _WEBVIEW_CTS_GCS_PATH_FILE +def GetCtsInfo(cts_gcs_path, arch, cts_release, item): + """Gets contents of CTS Info for arch and cts_release from the + CTS configuration file. + + See --cts-gcs-path """ - with open(_WEBVIEW_CTS_GCS_PATH_FILE) as f: + with open(cts_gcs_path) as f: cts_gcs_path_info = json.load(f) try: if item in _ARCH_SPECIFIC_CTS_INFO: @@ -99,9 +103,11 @@ (item, arch, cts_release)) -def GetCTSModuleNames(arch, cts_release): - """Gets the module apk name of the arch and cts_release""" - test_runs = GetCtsInfo(arch, cts_release, 'test_runs') +def GetCTSModuleNames(cts_gcs_path, arch, cts_release): + """Gets the module apk name of the arch and cts_release from the CTS + configuration file. + """ + test_runs = GetCtsInfo(cts_gcs_path, arch, cts_release, 'test_runs') return [os.path.basename(r['apk']) for r in test_runs] @@ -214,7 +220,7 @@ def ExtractCTSZip(args, arch, cts_release): """Extract the CTS tests for cts_release. - Extract the CTS zip file from _CTS_ARCHIVE_DIR to + Extract the CTS zip file from --cts-archive-dir to apk_dir if specified, or a new temporary directory if not. Returns following tuple (local_cts_dir, base_cts_dir, delete_cts_dir): local_cts_dir - CTS extraction location for current arch and cts_release @@ -224,7 +230,8 @@ """ base_cts_dir = None delete_cts_dir = False - relative_cts_zip_path = GetCtsInfo(arch, cts_release, 'filename') + relative_cts_zip_path = GetCtsInfo(args.cts_gcs_path, arch, cts_release, + 'filename') if args.apk_dir: base_cts_dir = args.apk_dir @@ -232,11 +239,10 @@ base_cts_dir = tempfile.mkdtemp() delete_cts_dir = True - cts_zip_path = os.path.join(_CTS_ARCHIVE_DIR, relative_cts_zip_path) - local_cts_dir = os.path.join(base_cts_dir, - GetCtsInfo(arch, cts_release, - 'unzip_dir') - ) + cts_zip_path = os.path.join(args.cts_archive_dir, relative_cts_zip_path) + local_cts_dir = os.path.join( + base_cts_dir, GetCtsInfo(args.cts_gcs_path, arch, cts_release, + 'unzip_dir')) zf = zipfile.ZipFile(cts_zip_path, 'r') zf.extractall(local_cts_dir) return (local_cts_dir, base_cts_dir, delete_cts_dir) @@ -252,12 +258,13 @@ returns the failure code of the last failing test. """ - local_cts_dir, base_cts_dir, delete_cts_dir = ExtractCTSZip(args, arch, - cts_release) + local_cts_dir, base_cts_dir, delete_cts_dir = ExtractCTSZip( + args, arch, cts_release) cts_result = 0 json_results_file = args.json_results_file try: - cts_test_runs = GetCtsInfo(arch, cts_release, 'test_runs') + cts_test_runs = GetCtsInfo(args.cts_gcs_path, arch, cts_release, + 'test_runs') cts_results_json = {} for cts_test_run in cts_test_runs: iteration_cts_result = 0 @@ -445,18 +452,32 @@ help='If set, will dump results in JSON form to the specified file. ' 'Note that this will also trigger saving per-test logcats to ' 'logdog.') - parser.add_argument( - '-m', - '--module-apk', - dest='module_apk', - help='CTS module apk name in ' + _WEBVIEW_CTS_GCS_PATH_FILE + - ' file, without the path prefix.') + parser.add_argument('-m', + '--module-apk', + dest='module_apk', + help='CTS module apk name in the --cts-gcs-path' + ' file, without the path prefix.') parser.add_argument( '--avd-config', type=os.path.realpath, help='Path to the avd config textpb. ' '(See //tools/android/avd/proto for message definition' ' and existing textpb files.)') + # The CTS config and archive paths are suitable defaults that + # normally won't need to change, this is available for if we + # want to re-use the run_cts.py script with alternative configurations. + parser.add_argument( + '--cts-gcs-path', + type=os.path.realpath, + default=_DEFAULT_CTS_GCS_PATH_FILE, + help='Path to the JSON file used to configure WebView CTS ' + 'test suites per Android version. Defaults to: ' + + _DEFAULT_CTS_GCS_PATH_FILE) + parser.add_argument('--cts-archive-dir', + type=os.path.realpath, + default=_DEFAULT_CTS_ARCHIVE_DIR, + help='Path to where CTS archives are stored. ' + 'Defaults to: ' + _DEFAULT_CTS_ARCHIVE_DIR) # We are re-using this argument that is used by our test runner # to detect if we are testing against an instant app # This allows us to know if we should filter tests based off the app @@ -493,7 +514,7 @@ if not args.module_apk: args.module_apk = 'CtsWebkitTestCases.apk' - platform_modules = GetCTSModuleNames(arch, cts_release) + platform_modules = GetCTSModuleNames(args.cts_gcs_path, arch, cts_release) if args.module_apk and args.module_apk not in platform_modules: raise Exception('--module-apk for arch==' + arch + 'and cts_release==' + cts_release + ' must be one of: '
diff --git a/ash/components/login/auth/auth_performer.cc b/ash/components/login/auth/auth_performer.cc index 126ea3ca..933b3ea 100644 --- a/ash/components/login/auth/auth_performer.cc +++ b/ash/components/login/auth/auth_performer.cc
@@ -5,6 +5,7 @@ #include "ash/components/login/auth/auth_performer.h" #include "ash/components/login/auth/cryptohome_parameter_utils.h" +#include "ash/components/login/auth/public/auth_session_intent.h" #include "ash/components/login/auth/public/auth_session_status.h" #include "ash/components/login/auth/public/cryptohome_key_constants.h" #include "ash/components/login/auth/public/user_context.h" @@ -32,6 +33,15 @@ type == user_manager::USER_TYPE_WEB_KIOSK_APP; } +user_data_auth::AuthIntent AuthIntentToProto(AuthSessionIntent intent) { + switch (intent) { + case AuthSessionIntent::kDecrypt: + return user_data_auth::AUTH_INTENT_DECRYPT; + case AuthSessionIntent::kVerifyOnly: + return user_data_auth::AUTH_INTENT_VERIFY_ONLY; + } +} + } // namespace AuthPerformer::AuthPerformer(base::raw_ptr<UserDataAuthClient> client) @@ -51,14 +61,16 @@ void AuthPerformer::StartAuthSession(std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartSessionCallback callback) { client_->WaitForServiceToBeAvailable(base::BindOnce( &AuthPerformer::OnServiceRunning, weak_factory_.GetWeakPtr(), - std::move(context), ephemeral, std::move(callback))); + std::move(context), ephemeral, intent, std::move(callback))); } void AuthPerformer::OnServiceRunning(std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartSessionCallback callback, bool service_is_available) { if (!service_is_available) { @@ -69,6 +81,7 @@ user_data_auth::StartAuthSessionRequest request; *request.mutable_account_id() = cryptohome::CreateAccountIdentifierFromAccountId(context->GetAccountId()); + request.set_intent(AuthIntentToProto(intent)); if (ephemeral) { request.set_flags(user_data_auth::AUTH_SESSION_FLAGS_EPHEMERAL_USER);
diff --git a/ash/components/login/auth/auth_performer.h b/ash/components/login/auth/auth_performer.h index 813fead..7274cc5 100644 --- a/ash/components/login/auth/auth_performer.h +++ b/ash/components/login/auth/auth_performer.h
@@ -8,6 +8,7 @@ #include <memory> #include "ash/components/login/auth/public/auth_callbacks.h" +#include "ash/components/login/auth/public/auth_session_intent.h" #include "ash/components/login/auth/public/auth_session_status.h" #include "ash/components/login/auth/public/cryptohome_error.h" #include "base/callback.h" @@ -59,6 +60,7 @@ // Does not authenticate new session. virtual void StartAuthSession(std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartSessionCallback callback); // Attempts to authenticate session using Key in `context`. @@ -108,6 +110,7 @@ private: void OnServiceRunning(std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartSessionCallback callback, bool service_is_running); void OnStartAuthSession(
diff --git a/ash/components/login/auth/auth_performer_unittest.cc b/ash/components/login/auth/auth_performer_unittest.cc index 8f18715..b6d11b2 100644 --- a/ash/components/login/auth/auth_performer_unittest.cc +++ b/ash/components/login/auth/auth_performer_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/components/login/auth/public/auth_factors_data.h" +#include "ash/components/login/auth/public/auth_session_intent.h" #include "ash/components/login/auth/public/auth_session_status.h" #include "ash/components/login/auth/public/user_context.h" #include "base/bind.h" @@ -104,7 +105,7 @@ absl::optional<CryptohomeError>> result; performer.StartAuthSession(std::move(context_), /*ephemeral=*/false, - result.GetCallback()); + AuthSessionIntent::kDecrypt, result.GetCallback()); auto [user_exists, user_context, cryptohome_error] = result.Take(); // Assert: no error, user context has AuthSession ID and the password factor. @@ -137,7 +138,7 @@ absl::optional<CryptohomeError>> result; performer.StartAuthSession(std::move(context_), /*ephemeral=*/false, - result.GetCallback()); + AuthSessionIntent::kDecrypt, result.GetCallback()); auto [user_exists, user_context, cryptohome_error] = result.Take(); // Assert: no error, user context has AuthSession ID and the kiosk factor.
diff --git a/ash/components/login/auth/auth_session_authenticator.cc b/ash/components/login/auth/auth_session_authenticator.cc index 1221f3e..cbe1bd0 100644 --- a/ash/components/login/auth/auth_session_authenticator.cc +++ b/ash/components/login/auth/auth_session_authenticator.cc
@@ -6,6 +6,7 @@ #include "ash/components/login/auth/cryptohome_parameter_utils.h" #include "ash/components/login/auth/public/auth_failure.h" +#include "ash/components/login/auth/public/auth_session_intent.h" #include "ash/components/login/auth/public/cryptohome_key_constants.h" #include "ash/components/login/auth/public/operation_chain_runner.h" #include "ash/components/login/auth/public/user_context.h" @@ -78,6 +79,7 @@ } StartAuthSessionWithChecks( std::move(context), is_ephemeral_mount_enforced_, + AuthSessionIntent::kDecrypt, base::BindOnce(&AuthSessionAuthenticator::DoCompleteLogin, weak_factory_.GetWeakPtr())); } @@ -85,20 +87,22 @@ void AuthSessionAuthenticator::StartAuthSessionWithChecks( std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartAuthSessionCallback callback) { // Clone the context to be able to retry the StartAuthSession operation in // case we need to go through stale data removal. auto original_context = std::make_unique<UserContext>(*context); auth_performer_->StartAuthSession( - std::move(context), ephemeral, + std::move(context), ephemeral, intent, base::BindOnce(&AuthSessionAuthenticator::OnStartAuthSession, weak_factory_.GetWeakPtr(), std::move(original_context), - ephemeral, std::move(callback))); + ephemeral, intent, std::move(callback))); } void AuthSessionAuthenticator::OnStartAuthSession( std::unique_ptr<UserContext> original_context, bool ephemeral, + AuthSessionIntent intent, StartAuthSessionCallback callback, bool user_exists, std::unique_ptr<UserContext> context, @@ -112,7 +116,7 @@ // It's an edge case when cryptohomed didn't have a chance to delete the // stale data yet. Trigger the removal and retry. RemoveStaleUserForEphemeral(context->GetAuthSessionId(), - std::move(original_context), + std::move(original_context), intent, std::move(callback)); return; } @@ -123,6 +127,7 @@ void AuthSessionAuthenticator::RemoveStaleUserForEphemeral( const std::string& auth_session_id, std::unique_ptr<UserContext> original_context, + AuthSessionIntent intent, StartAuthSessionCallback callback) { if (auth_session_id.empty()) NOTREACHED() << "Auth session should exist"; @@ -133,11 +138,12 @@ remove_request, base::BindOnce(&AuthSessionAuthenticator::OnRemoveStaleUserForEphemeral, weak_factory_.GetWeakPtr(), std::move(original_context), - std::move(callback))); + intent, std::move(callback))); } void AuthSessionAuthenticator::OnRemoveStaleUserForEphemeral( std::unique_ptr<UserContext> original_context, + AuthSessionIntent intent, StartAuthSessionCallback callback, absl::optional<user_data_auth::RemoveReply> reply) { auto error = user_data_auth::ReplyToCryptohomeError(reply); @@ -150,7 +156,7 @@ } // Retry the auth session creation after we recovered from stale data. auth_performer_->StartAuthSession( - std::move(original_context), /*ephemeral=*/true, + std::move(original_context), /*ephemeral=*/true, intent, base::BindOnce( &AuthSessionAuthenticator::OnStartAuthSessionAfterStaleRemoval, weak_factory_.GetWeakPtr(), std::move(callback))); @@ -296,7 +302,7 @@ } StartAuthSessionWithChecks( std::move(context), is_ephemeral_mount_enforced_, - + AuthSessionIntent::kDecrypt, base::BindOnce(&AuthSessionAuthenticator::DoLoginAsExistingUser, weak_factory_.GetWeakPtr())); } @@ -411,7 +417,7 @@ } StartAuthSessionWithChecks( - std::move(context), true /* ephemeral */, + std::move(context), true /* ephemeral */, AuthSessionIntent::kDecrypt, base::BindOnce(&AuthSessionAuthenticator::DoLoginAsPublicSession, weak_factory_.GetWeakPtr())); } @@ -487,6 +493,7 @@ } StartAuthSessionWithChecks( std::move(context), is_ephemeral_mount_enforced_, + AuthSessionIntent::kDecrypt, base::BindOnce(&AuthSessionAuthenticator::DoLoginAsKiosk, weak_factory_.GetWeakPtr())); }
diff --git a/ash/components/login/auth/auth_session_authenticator.h b/ash/components/login/auth/auth_session_authenticator.h index 1b011f0..6b240e6 100644 --- a/ash/components/login/auth/auth_session_authenticator.h +++ b/ash/components/login/auth/auth_session_authenticator.h
@@ -123,9 +123,11 @@ // Helpers for starting the auth session and cleaning stale data during that. void StartAuthSessionWithChecks(std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartAuthSessionCallback callback); void OnStartAuthSession(std::unique_ptr<UserContext> original_context, bool ephemeral, + AuthSessionIntent intent, StartAuthSessionCallback callback, bool user_exists, std::unique_ptr<UserContext> context, @@ -133,9 +135,11 @@ void RemoveStaleUserForEphemeral( const std::string& auth_session_id, std::unique_ptr<UserContext> original_context, + AuthSessionIntent intent, StartAuthSessionCallback callback); void OnRemoveStaleUserForEphemeral( std::unique_ptr<UserContext> original_context, + AuthSessionIntent intent, StartAuthSessionCallback callback, absl::optional<user_data_auth::RemoveReply> reply); void OnStartAuthSessionAfterStaleRemoval(
diff --git a/ash/components/login/auth/auth_session_authenticator_unittest.cc b/ash/components/login/auth/auth_session_authenticator_unittest.cc index e8915cb..860087c 100644 --- a/ash/components/login/auth/auth_session_authenticator_unittest.cc +++ b/ash/components/login/auth/auth_session_authenticator_unittest.cc
@@ -38,6 +38,7 @@ using testing::AllOf; using testing::AtMost; using user_data_auth::AddCredentialsReply; +using user_data_auth::AUTH_INTENT_DECRYPT; using user_data_auth::AUTH_SESSION_FLAGS_EPHEMERAL_USER; using user_data_auth::AUTH_SESSION_FLAGS_NONE; using user_data_auth::AuthenticateAuthSessionReply; @@ -67,10 +68,11 @@ return arg.auth_session_id() == kSecondAuthSessionId; } -// Matcher for `StartAuthSessionRequest` that checks its account_id and flags. -MATCHER_P(WithAccountIdAndFlags, flags, "") { +// Matcher for `StartAuthSessionRequest` that checks its account_id, flags and +// intent. +MATCHER_P2(WithAccountIdAndFlags, flags, intent, "") { return arg.account_id().account_id() == kEmail && - arg.flags() == static_cast<unsigned>(flags); + arg.flags() == static_cast<unsigned>(flags) && arg.intent() == intent; } // Matchers for `AuthenticateAuthSessionRequest` and `AddCredentialsRequest` @@ -211,9 +213,10 @@ auto user_context = std::make_unique<UserContext>( user_manager::USER_TYPE_REGULAR, kAccountId); user_context->SetKey(Key(kPassword)); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); @@ -244,9 +247,10 @@ auto user_context = std::make_unique<UserContext>( user_manager::USER_TYPE_REGULAR, kAccountId); user_context->SetKey(Key(kPassword)); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith( BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, /*keys=*/{{kCryptohomeGaiaKeyLabel, KeyData()}}))); @@ -278,9 +282,10 @@ auto user_context = std::make_unique<UserContext>( user_manager::USER_TYPE_REGULAR, kAccountId); user_context->SetKey(Key(kPassword)); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith( BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, @@ -311,9 +316,11 @@ auto user_context = std::make_unique<UserContext>( user_manager::USER_TYPE_REGULAR, kAccountId); user_context->SetKey(Key(kPassword)); - EXPECT_CALL(userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL( + userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); EXPECT_CALL(userdataauth(), @@ -344,19 +351,21 @@ user_context->SetKey(Key(kPassword)); { testing::InSequence seq; - EXPECT_CALL( - userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession( + WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, /*keys=*/{}))) .RetiresOnSaturation(); EXPECT_CALL(userdataauth(), Remove(WithFirstAuthSessionId(), _)) .WillOnce(ReplyWith(RemoveReply())); - EXPECT_CALL( - userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession( + WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply( kSecondAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); EXPECT_CALL(userdataauth(), @@ -385,9 +394,10 @@ auto user_context = std::make_unique<UserContext>( user_manager::USER_TYPE_REGULAR, kAccountId); user_context->SetKey(Key(kPassword)); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith( BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, @@ -419,9 +429,10 @@ auto user_context = std::make_unique<UserContext>( user_manager::USER_TYPE_REGULAR, kAccountId); user_context->SetKey(Key(kPassword)); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith( BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, /*keys=*/{{kCryptohomeGaiaKeyLabel, KeyData()}}))); @@ -457,9 +468,11 @@ // Arrange. CreateAuthenticator(/*is_ephemeral_mount_enforced=*/false); UserContext user_context(user_manager::USER_TYPE_PUBLIC_ACCOUNT, kAccountId); - EXPECT_CALL(userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL( + userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); EXPECT_CALL(userdataauth(), @@ -480,9 +493,10 @@ TEST_F(AuthSessionAuthenticatorTest, LoginAsKioskAccountNew) { // Arrange. CreateAuthenticator(/*is_ephemeral_mount_enforced=*/false); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce( ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); @@ -512,9 +526,10 @@ CreateAuthenticator(/*is_ephemeral_mount_enforced=*/false); KeyData key_data; key_data.set_type(KeyData::KEY_TYPE_KIOSK); - EXPECT_CALL( - userdataauth(), - StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_NONE, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith( BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, /*keys=*/{{kCryptohomePublicMountLabel, key_data}}))); @@ -539,9 +554,11 @@ TEST_F(AuthSessionAuthenticatorTest, LoginAsKioskAccountEphemeral) { // Arrange. CreateAuthenticator(/*is_ephemeral_mount_enforced=*/true); - EXPECT_CALL(userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL( + userdataauth(), + StartAuthSession(WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); EXPECT_CALL(userdataauth(), @@ -564,19 +581,21 @@ CreateAuthenticator(/*is_ephemeral_mount_enforced=*/true); { testing::InSequence seq; - EXPECT_CALL( - userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession( + WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply(kFirstAuthSessionId, /*user_exists=*/true, /*keys=*/{}))) .RetiresOnSaturation(); EXPECT_CALL(userdataauth(), Remove(WithFirstAuthSessionId(), _)) .WillOnce(ReplyWith(RemoveReply())); - EXPECT_CALL( - userdataauth(), - StartAuthSession( - WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER), _)) + EXPECT_CALL(userdataauth(), + StartAuthSession( + WithAccountIdAndFlags(AUTH_SESSION_FLAGS_EPHEMERAL_USER, + AUTH_INTENT_DECRYPT), + _)) .WillOnce(ReplyWith(BuildStartReply( kSecondAuthSessionId, /*user_exists=*/false, /*keys=*/{}))); EXPECT_CALL(userdataauth(),
diff --git a/ash/components/login/auth/mock_auth_performer.h b/ash/components/login/auth/mock_auth_performer.h index 7457e4ca..bad5ecaa 100644 --- a/ash/components/login/auth/mock_auth_performer.h +++ b/ash/components/login/auth/mock_auth_performer.h
@@ -6,6 +6,7 @@ #define ASH_COMPONENTS_LOGIN_AUTH_MOCK_AUTH_PERFORMER_H_ #include "ash/components/login/auth/auth_performer.h" +#include "ash/components/login/auth/public/auth_session_intent.h" #include "ash/components/login/auth/public/user_context.h" #include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" #include "testing/gmock/include/gmock/gmock.h" @@ -24,6 +25,7 @@ StartAuthSession, (std::unique_ptr<UserContext> context, bool ephemeral, + AuthSessionIntent intent, StartSessionCallback callback), (override));
diff --git a/ash/components/login/auth/public/BUILD.gn b/ash/components/login/auth/public/BUILD.gn index b52aa49..1af19bbc3 100644 --- a/ash/components/login/auth/public/BUILD.gn +++ b/ash/components/login/auth/public/BUILD.gn
@@ -31,6 +31,7 @@ "auth_factors_data.h", "auth_failure.cc", "auth_failure.h", + "auth_session_intent.h", "auth_session_status.h", "cryptohome_error.cc", "cryptohome_error.h",
diff --git a/ash/components/login/auth/public/auth_session_intent.h b/ash/components/login/auth/public/auth_session_intent.h new file mode 100644 index 0000000..5e02381cb --- /dev/null +++ b/ash/components/login/auth/public/auth_session_intent.h
@@ -0,0 +1,31 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_COMPONENTS_LOGIN_AUTH_PUBLIC_AUTH_SESSION_INTENT_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_PUBLIC_AUTH_SESSION_INTENT_H_ + +namespace ash { + +// This enum represents the intent of the authentication, i.e., the set of +// privileged operations that will be done after the authentication succeeds. +// +// The intent allows the underlying authentication implementation (e.g., +// cryptohome) to choose eligible ways of authentication and also to use faster +// cryptographic schemes when viable. +enum class AuthSessionIntent { + // Intent to decrypt the user's data protection keys. Authorizing for this + // intent allows to access user data (e.g., for login), change the user's + // authentication configuration (adding/removing/updating means of + // authentication for the future). + kDecrypt, + // Intent to simply check whether the authentication succeeds. Authorizing for + // this intent doesn't allow any privileged operation. It's suitable in + // scenarios that only require a boolean result: can the user authenticate or + // not + kVerifyOnly, +}; + +} // namespace ash + +#endif // ASH_COMPONENTS_LOGIN_AUTH_PUBLIC_AUTH_SESSION_INTENT_H_
diff --git a/ash/components/login/auth/public/auth_session_status.h b/ash/components/login/auth/public/auth_session_status.h index 1c3bed3..068534e 100644 --- a/ash/components/login/auth/public/auth_session_status.h +++ b/ash/components/login/auth/public/auth_session_status.h
@@ -34,4 +34,4 @@ } // namespace ash -#endif // ASH_COMPONENTS_LOGIN_AUTH_PUBLIC_AUTH_RESULTS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_PUBLIC_AUTH_SESSION_STATUS_H_
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 6efb8de..7228403 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -921,7 +921,7 @@ // Controls whether the snooping protection prototype is enabled. const base::Feature kSnoopingProtection{"SnoopingProtection", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Controls whether to start AssistantAudioDecoder service on demand (at query // response time).
diff --git a/ash/in_session_auth/authentication_dialog.cc b/ash/in_session_auth/authentication_dialog.cc index b965599..3ddafd8 100644 --- a/ash/in_session_auth/authentication_dialog.cc +++ b/ash/in_session_auth/authentication_dialog.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/components/login/auth/auth_performer.h" +#include "ash/components/login/auth/public/auth_session_intent.h" #include "ash/components/login/auth/public/cryptohome_error.h" #include "ash/components/login/auth/public/cryptohome_key_constants.h" #include "ash/components/login/auth/public/user_context.h" @@ -107,8 +108,10 @@ auto user_context = std::make_unique<UserContext>(); user_context->SetAccountId(account_id); + // TODO(b/240147756): Choose the intent based on + // `InSessionAuthDialogController::Reason`. auth_performer_->StartAuthSession( - std::move(user_context), /*ephemeral=*/false, + std::move(user_context), /*ephemeral=*/false, AuthSessionIntent::kDecrypt, base::BindOnce(&AuthenticationDialog::OnAuthSessionStarted, weak_factory_.GetWeakPtr())); } @@ -177,8 +180,11 @@ user_data_auth::CRYPTOHOME_INVALID_AUTH_SESSION_TOKEN) { // Auth session expired for some reason, start it again and reattempt // authentication. + // TODO(b/240147756): Choose the intent based on + // `InSessionAuthDialogController::Reason`. auth_performer_->StartAuthSession( std::move(user_context), /*ephemeral=*/false, + AuthSessionIntent::kDecrypt, base::BindOnce(&AuthenticationDialog::OnAuthSessionInvalid, weak_factory_.GetWeakPtr())); return;
diff --git a/ash/in_session_auth/authentication_dialog_unittest.cc b/ash/in_session_auth/authentication_dialog_unittest.cc index b88651a..6616c38 100644 --- a/ash/in_session_auth/authentication_dialog_unittest.cc +++ b/ash/in_session_auth/authentication_dialog_unittest.cc
@@ -47,7 +47,8 @@ } void StartAuthSession(std::unique_ptr<UserContext> user_context, - bool ephemeral, + bool /*ephemeral*/, + AuthSessionIntent /*intent*/, AuthPerformer::StartSessionCallback callback) { user_context->SetAuthFactorsData( AuthFactorsData{{cryptohome::KeyDefinition::CreateForPassword(
diff --git a/ash/webui/common/resources/cr_picture/cr_camera.js b/ash/webui/common/resources/cr_picture/cr_camera.js index bbb0fe8..3d0cf4e 100644 --- a/ash/webui/common/resources/cr_picture/cr_camera.js +++ b/ash/webui/common/resources/cr_picture/cr_camera.js
@@ -7,7 +7,7 @@ * 'cr-camera' is a Polymer element used to take a picture from the * user webcam to use as a Chrome OS profile picture. */ -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/cr_icon_button/cr_icon_button.js'; import '//resources/polymer/v3_0/iron-a11y-keys/iron-a11y-keys.js'; import '//resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js';
diff --git a/ash/webui/common/resources/cr_picture/cr_picture_list.js b/ash/webui/common/resources/cr_picture/cr_picture_list.js index 8e0557a..e2806ed 100644 --- a/ash/webui/common/resources/cr_picture/cr_picture_list.js +++ b/ash/webui/common/resources/cr_picture/cr_picture_list.js
@@ -10,7 +10,7 @@ */ import '//resources/cr_elements/icons.m.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/polymer/v3_0/iron-a11y-keys/iron-a11y-keys.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import '//resources/polymer/v3_0/iron-selector/iron-selector.js';
diff --git a/ash/webui/common/resources/cr_picture/cr_picture_pane.js b/ash/webui/common/resources/cr_picture/cr_picture_pane.js index de35f86b..ee59928 100644 --- a/ash/webui/common/resources/cr_picture/cr_picture_pane.js +++ b/ash/webui/common/resources/cr_picture/cr_picture_pane.js
@@ -8,7 +8,7 @@ * picture or a camera image preview. */ -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/cr_icon_button/cr_icon_button.js'; import './cr_camera.js';
diff --git a/ash/webui/common/resources/navigation_selector.js b/ash/webui/common/resources/navigation_selector.js index 595382c..4243101 100644 --- a/ash/webui/common/resources/navigation_selector.js +++ b/ash/webui/common/resources/navigation_selector.js
@@ -4,7 +4,7 @@ import './navigation_icons.html.js'; import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/ash/webui/common/resources/page_toolbar.js b/ash/webui/common/resources/page_toolbar.js index dfbc1d35..41b8fd2 100644 --- a/ash/webui/common/resources/page_toolbar.js +++ b/ash/webui/common/resources/page_toolbar.js
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ash/webui/connectivity_diagnostics/resources/connectivity_diagnostics.js b/ash/webui/connectivity_diagnostics/resources/connectivity_diagnostics.js index 7a15133..9dbf4e36 100644 --- a/ash/webui/connectivity_diagnostics/resources/connectivity_diagnostics.js +++ b/ash/webui/connectivity_diagnostics/resources/connectivity_diagnostics.js
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_components/chromeos/network_health/network_diagnostics.js'; import 'chrome://resources/cr_components/chromeos/network_health/network_health_summary.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {CrContainerShadowBehavior} from 'chrome://resources/cr_elements/cr_container_shadow_behavior.js';
diff --git a/ash/webui/diagnostics_ui/resources/diagnostics_shared_css.js b/ash/webui/diagnostics_ui/resources/diagnostics_shared_css.js index 37bc1879..a37acbd 100644 --- a/ash/webui/diagnostics_ui/resources/diagnostics_shared_css.js +++ b/ash/webui/diagnostics_ui/resources/diagnostics_shared_css.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/ash/common/navigation_shared_vars.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ash/webui/firmware_update_ui/resources/firmware_shared_css.js b/ash/webui/firmware_update_ui/resources/firmware_shared_css.js index fbaf20e..666d88c 100644 --- a/ash/webui/firmware_update_ui/resources/firmware_shared_css.js +++ b/ash/webui/firmware_update_ui/resources/firmware_shared_css.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ash/webui/os_feedback_ui/resources/help_content.js b/ash/webui/os_feedback_ui/resources/help_content.js index 779f731..eb2dba89 100644 --- a/ash/webui/os_feedback_ui/resources/help_content.js +++ b/ash/webui/os_feedback_ui/resources/help_content.js
@@ -7,7 +7,7 @@ import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import '//resources/polymer/v3_0/iron-media-query/iron-media-query.js'; import '//resources/cr_elements/cr_icons_css.m.js'; -import '//resources/cr_elements/hidden_style_css.m.js'; +import '//resources/cr_elements/cr_hidden_style.css.js'; import '//resources/cr_elements/icons.m.js'; import '//resources/cr_elements/policy/cr_tooltip_icon.js'; import '//resources/cr_elements/shared_vars_css.m.js';
diff --git a/ash/webui/os_feedback_ui/resources/os_feedback_shared_css.js b/ash/webui/os_feedback_ui/resources/os_feedback_shared_css.js index ffd45cc..4948fc7c 100644 --- a/ash/webui/os_feedback_ui/resources/os_feedback_shared_css.js +++ b/ash/webui/os_feedback_ui/resources/os_feedback_shared_css.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ash/webui/personalization_app/resources/js/ambient/albums_subpage_element.ts b/ash/webui/personalization_app/resources/js/ambient/albums_subpage_element.ts index ed737c3..ef3b285d 100644 --- a/ash/webui/personalization_app/resources/js/ambient/albums_subpage_element.ts +++ b/ash/webui/personalization_app/resources/js/ambient/albums_subpage_element.ts
@@ -8,7 +8,7 @@ */ import 'chrome://resources/cr_components/localized_link/localized_link.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './album_list_element.js'; import './art_album_dialog_element.js';
diff --git a/ash/webui/personalization_app/resources/js/ambient/ambient_weather_element.ts b/ash/webui/personalization_app/resources/js/ambient/ambient_weather_element.ts index 2ed67d4..b31db15 100644 --- a/ash/webui/personalization_app/resources/js/ambient/ambient_weather_element.ts +++ b/ash/webui/personalization_app/resources/js/ambient/ambient_weather_element.ts
@@ -10,7 +10,7 @@ import '../../css/common.css.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {TemperatureUnit} from '../personalization_app.mojom-webui.js'; import {WithPersonalizationStore} from '../personalization_store.js';
diff --git a/ash/webui/personalization_app/resources/js/ambient/topic_source_item_element.ts b/ash/webui/personalization_app/resources/js/ambient/topic_source_item_element.ts index decfbfda..7c97484 100644 --- a/ash/webui/personalization_app/resources/js/ambient/topic_source_item_element.ts +++ b/ash/webui/personalization_app/resources/js/ambient/topic_source_item_element.ts
@@ -8,7 +8,7 @@ import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button_style.css.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/ash/webui/print_management/resources/print_management.ts b/ash/webui/print_management/resources/print_management.ts index b651795..b3622638 100644 --- a/ash/webui/print_management/resources/print_management.ts +++ b/ash/webui/print_management/resources/print_management.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_policy_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js';
diff --git a/ash/webui/print_management/resources/print_management_shared.css b/ash/webui/print_management/resources/print_management_shared.css index 4a7b28a..d56fa85 100644 --- a/ash/webui/print_management/resources/print_management_shared.css +++ b/ash/webui/print_management/resources/print_management_shared.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #include=cr-shared-style * #css_wrapper_metadata_end */ @@ -212,4 +212,4 @@ margin-inline-start: 16px; padding-left: 16px; } -} \ No newline at end of file +}
diff --git a/ash/webui/scanning/resources/scanning_shared_css.js b/ash/webui/scanning/resources/scanning_shared_css.js index d07ee1bc..475aba2 100644 --- a/ash/webui/scanning/resources/scanning_shared_css.js +++ b/ash/webui/scanning/resources/scanning_shared_css.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import './scanning_fonts_css.js';
diff --git a/ash/webui/shimless_rma/resources/shimless_rma_shared_css.js b/ash/webui/shimless_rma/resources/shimless_rma_shared_css.js index af8a1fbf..a30e40dc 100644 --- a/ash/webui/shimless_rma/resources/shimless_rma_shared_css.js +++ b/ash/webui/shimless_rma/resources/shimless_rma_shared_css.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ash/webui/shortcut_customization_ui/resources/input_key.ts b/ash/webui/shortcut_customization_ui/resources/input_key.ts index 11a0874..fb78e4ed 100644 --- a/ash/webui/shortcut_customization_ui/resources/input_key.ts +++ b/ash/webui/shortcut_customization_ui/resources/input_key.ts
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -51,4 +51,4 @@ } } -customElements.define(InputKeyElement.is, InputKeyElement); \ No newline at end of file +customElements.define(InputKeyElement.is, InputKeyElement);
diff --git a/base/values_unittest.cc b/base/values_unittest.cc index a06fa29..2d1e3c81 100644 --- a/base/values_unittest.cc +++ b/base/values_unittest.cc
@@ -184,8 +184,8 @@ } TEST(ValuesTest, ConstructDict) { - DictionaryValue value; - EXPECT_EQ(Value::Type::DICTIONARY, value.type()); + Value::Dict value; + EXPECT_EQ(Value::Type::DICTIONARY, Value(std::move(value)).type()); } TEST(ValuesTest, ConstructDictFromValueDict) { @@ -444,7 +444,7 @@ Value value(std::move(dict)); Value moved_value(std::move(value)); EXPECT_EQ(Value::Type::DICTIONARY, moved_value.type()); - EXPECT_EQ(123, moved_value.FindKey("Int")->GetInt()); + EXPECT_EQ(123, moved_value.GetDict().Find("Int")->GetInt()); } TEST(ValuesTest, MoveAssignDictionary) { @@ -454,7 +454,7 @@ Value blank; blank = Value(std::move(dict)); EXPECT_EQ(Value::Type::DICTIONARY, blank.type()); - EXPECT_EQ(123, blank.FindKey("Int")->GetInt()); + EXPECT_EQ(123, blank.GetDict().Find("Int")->GetInt()); } TEST(ValuesTest, ConstructDictWithIterators) { @@ -465,7 +465,7 @@ blank = Value(Value::Dict(std::make_move_iterator(values.begin()), std::make_move_iterator(values.end()))); EXPECT_EQ(Value::Type::DICTIONARY, blank.type()); - EXPECT_EQ(123, blank.FindKey("Int")->GetInt()); + EXPECT_EQ(123, blank.GetDict().Find("Int")->GetInt()); } TEST(ValuesTest, MoveList) { @@ -793,32 +793,27 @@ Value::Dict dict; dict.Set("foo", "bar"); Value value(std::move(dict)); - EXPECT_NE(nullptr, value.FindKey("foo")); - EXPECT_EQ(nullptr, value.FindKey("baz")); - - // Single not found key. - bool found = value.FindKey("notfound"); - EXPECT_FALSE(found); + EXPECT_NE(nullptr, value.GetDict().Find("foo")); + EXPECT_EQ(nullptr, value.GetDict().Find("baz")); } TEST(ValuesTest, FindKeyChangeValue) { Value::Dict dict; dict.Set("foo", "bar"); - Value value(std::move(dict)); - Value* found = value.FindKey("foo"); - EXPECT_NE(nullptr, found); + Value* found = dict.Find("foo"); + ASSERT_NE(nullptr, found); EXPECT_EQ("bar", found->GetString()); *found = Value(123); - EXPECT_EQ(123, value.FindKey("foo")->GetInt()); + EXPECT_EQ(123, dict.Find("foo")->GetInt()); } TEST(ValuesTest, FindKeyConst) { Value::Dict dict; dict.Set("foo", "bar"); const Value value(std::move(dict)); - EXPECT_NE(nullptr, value.FindKey("foo")); - EXPECT_EQ(nullptr, value.FindKey("baz")); + EXPECT_NE(nullptr, value.GetDict().Find("foo")); + EXPECT_EQ(nullptr, value.GetDict().Find("baz")); } TEST(ValuesTest, FindKeyOfType) { @@ -1002,15 +997,14 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("null")); - EXPECT_NE(absl::nullopt, value.FindBoolKey("bool")); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("int")); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("double")); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("string")); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("blob")); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("list")); - EXPECT_EQ(absl::nullopt, value.FindBoolKey("dict")); + EXPECT_EQ(absl::nullopt, dict.FindBool("null")); + EXPECT_NE(absl::nullopt, dict.FindBool("bool")); + EXPECT_EQ(absl::nullopt, dict.FindBool("int")); + EXPECT_EQ(absl::nullopt, dict.FindBool("double")); + EXPECT_EQ(absl::nullopt, dict.FindBool("string")); + EXPECT_EQ(absl::nullopt, dict.FindBool("blob")); + EXPECT_EQ(absl::nullopt, dict.FindBool("list")); + EXPECT_EQ(absl::nullopt, dict.FindBool("dict")); } TEST(ValuesTest, FindIntKey) { @@ -1024,15 +1018,14 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(absl::nullopt, value.FindIntKey("null")); - EXPECT_EQ(absl::nullopt, value.FindIntKey("bool")); - EXPECT_NE(absl::nullopt, value.FindIntKey("int")); - EXPECT_EQ(absl::nullopt, value.FindIntKey("double")); - EXPECT_EQ(absl::nullopt, value.FindIntKey("string")); - EXPECT_EQ(absl::nullopt, value.FindIntKey("blob")); - EXPECT_EQ(absl::nullopt, value.FindIntKey("list")); - EXPECT_EQ(absl::nullopt, value.FindIntKey("dict")); + EXPECT_EQ(absl::nullopt, dict.FindInt("null")); + EXPECT_EQ(absl::nullopt, dict.FindInt("bool")); + EXPECT_NE(absl::nullopt, dict.FindInt("int")); + EXPECT_EQ(absl::nullopt, dict.FindInt("double")); + EXPECT_EQ(absl::nullopt, dict.FindInt("string")); + EXPECT_EQ(absl::nullopt, dict.FindInt("blob")); + EXPECT_EQ(absl::nullopt, dict.FindInt("list")); + EXPECT_EQ(absl::nullopt, dict.FindInt("dict")); } TEST(ValuesTest, FindDoubleKey) { @@ -1046,15 +1039,14 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(absl::nullopt, value.FindDoubleKey("null")); - EXPECT_EQ(absl::nullopt, value.FindDoubleKey("bool")); - EXPECT_NE(absl::nullopt, value.FindDoubleKey("int")); - EXPECT_NE(absl::nullopt, value.FindDoubleKey("double")); - EXPECT_EQ(absl::nullopt, value.FindDoubleKey("string")); - EXPECT_EQ(absl::nullopt, value.FindDoubleKey("blob")); - EXPECT_EQ(absl::nullopt, value.FindDoubleKey("list")); - EXPECT_EQ(absl::nullopt, value.FindDoubleKey("dict")); + EXPECT_EQ(absl::nullopt, dict.FindDouble("null")); + EXPECT_EQ(absl::nullopt, dict.FindDouble("bool")); + EXPECT_NE(absl::nullopt, dict.FindDouble("int")); + EXPECT_NE(absl::nullopt, dict.FindDouble("double")); + EXPECT_EQ(absl::nullopt, dict.FindDouble("string")); + EXPECT_EQ(absl::nullopt, dict.FindDouble("blob")); + EXPECT_EQ(absl::nullopt, dict.FindDouble("list")); + EXPECT_EQ(absl::nullopt, dict.FindDouble("dict")); } TEST(ValuesTest, FindStringKey) { @@ -1068,28 +1060,29 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(nullptr, value.FindStringKey("null")); - EXPECT_EQ(nullptr, value.FindStringKey("bool")); - EXPECT_EQ(nullptr, value.FindStringKey("int")); - EXPECT_EQ(nullptr, value.FindStringKey("double")); - EXPECT_NE(nullptr, value.FindStringKey("string")); - EXPECT_EQ(nullptr, value.FindStringKey("blob")); - EXPECT_EQ(nullptr, value.FindStringKey("list")); - EXPECT_EQ(nullptr, value.FindStringKey("dict")); + EXPECT_EQ(nullptr, dict.FindString("null")); + EXPECT_EQ(nullptr, dict.FindString("bool")); + EXPECT_EQ(nullptr, dict.FindString("int")); + EXPECT_EQ(nullptr, dict.FindString("double")); + EXPECT_NE(nullptr, dict.FindString("string")); + EXPECT_EQ(nullptr, dict.FindString("blob")); + EXPECT_EQ(nullptr, dict.FindString("list")); + EXPECT_EQ(nullptr, dict.FindString("dict")); } TEST(ValuesTest, MutableFindStringKey) { Value::Dict dict; dict.Set("string", "foo"); - Value value(std::move(dict)); - *(value.FindStringKey("string")) = "bar"; + *(dict.FindString("string")) = "bar"; Value::Dict expected_dict; expected_dict.Set("string", "bar"); - Value expected_value(std::move(expected_dict)); + EXPECT_EQ(expected_dict, dict); + + Value value(std::move(dict)); + Value expected_value(std::move(expected_dict)); EXPECT_EQ(expected_value, value); } @@ -1104,15 +1097,14 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(nullptr, value.FindDictKey("null")); - EXPECT_EQ(nullptr, value.FindDictKey("bool")); - EXPECT_EQ(nullptr, value.FindDictKey("int")); - EXPECT_EQ(nullptr, value.FindDictKey("double")); - EXPECT_EQ(nullptr, value.FindDictKey("string")); - EXPECT_EQ(nullptr, value.FindDictKey("blob")); - EXPECT_EQ(nullptr, value.FindDictKey("list")); - EXPECT_NE(nullptr, value.FindDictKey("dict")); + EXPECT_EQ(nullptr, dict.FindDict("null")); + EXPECT_EQ(nullptr, dict.FindDict("bool")); + EXPECT_EQ(nullptr, dict.FindDict("int")); + EXPECT_EQ(nullptr, dict.FindDict("double")); + EXPECT_EQ(nullptr, dict.FindDict("string")); + EXPECT_EQ(nullptr, dict.FindDict("blob")); + EXPECT_EQ(nullptr, dict.FindDict("list")); + EXPECT_NE(nullptr, dict.FindDict("dict")); } TEST(ValuesTest, FindListKey) { @@ -1126,18 +1118,17 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(nullptr, value.FindListKey("null")); - EXPECT_EQ(nullptr, value.FindListKey("bool")); - EXPECT_EQ(nullptr, value.FindListKey("int")); - EXPECT_EQ(nullptr, value.FindListKey("double")); - EXPECT_EQ(nullptr, value.FindListKey("string")); - EXPECT_EQ(nullptr, value.FindListKey("blob")); - EXPECT_NE(nullptr, value.FindListKey("list")); - EXPECT_EQ(nullptr, value.FindListKey("dict")); + EXPECT_EQ(nullptr, dict.FindList("null")); + EXPECT_EQ(nullptr, dict.FindList("bool")); + EXPECT_EQ(nullptr, dict.FindList("int")); + EXPECT_EQ(nullptr, dict.FindList("double")); + EXPECT_EQ(nullptr, dict.FindList("string")); + EXPECT_EQ(nullptr, dict.FindList("blob")); + EXPECT_NE(nullptr, dict.FindList("list")); + EXPECT_EQ(nullptr, dict.FindList("dict")); } -TEST(ValuesTest, FindBlobKey) { +TEST(ValuesTest, FindBlob) { Value::Dict dict; dict.Set("null", Value()); dict.Set("bool", false); @@ -1148,15 +1139,14 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - const Value value(std::move(dict)); - EXPECT_EQ(nullptr, value.FindBlobKey("null")); - EXPECT_EQ(nullptr, value.FindBlobKey("bool")); - EXPECT_EQ(nullptr, value.FindBlobKey("int")); - EXPECT_EQ(nullptr, value.FindBlobKey("double")); - EXPECT_EQ(nullptr, value.FindBlobKey("string")); - EXPECT_NE(nullptr, value.FindBlobKey("blob")); - EXPECT_EQ(nullptr, value.FindBlobKey("list")); - EXPECT_EQ(nullptr, value.FindBlobKey("dict")); + EXPECT_EQ(nullptr, dict.FindBlob("null")); + EXPECT_EQ(nullptr, dict.FindBlob("bool")); + EXPECT_EQ(nullptr, dict.FindBlob("int")); + EXPECT_EQ(nullptr, dict.FindBlob("double")); + EXPECT_EQ(nullptr, dict.FindBlob("string")); + EXPECT_NE(nullptr, dict.FindBlob("blob")); + EXPECT_EQ(nullptr, dict.FindBlob("list")); + EXPECT_EQ(nullptr, dict.FindBlob("dict")); } TEST(ValuesTest, SetKey) { @@ -1170,358 +1160,364 @@ dict.Set("list", Value::List()); dict.Set("dict", Value::Dict()); - Value value(Value::Type::DICTIONARY); - value.SetKey(StringPiece("null"), Value(Value::Type::NONE)); - value.SetKey(StringPiece("bool"), Value(Value::Type::BOOLEAN)); - value.SetKey(std::string("int"), Value(Value::Type::INTEGER)); - value.SetKey(std::string("double"), Value(Value::Type::DOUBLE)); - value.SetKey(std::string("string"), Value(Value::Type::STRING)); - value.SetKey("blob", Value(Value::Type::BINARY)); - value.SetKey("list", Value(Value::Type::LIST)); - value.SetKey("dict", Value(Value::Type::DICTIONARY)); + Value::Dict dict2; + dict2.Set(StringPiece("null"), Value(Value::Type::NONE)); + dict2.Set(StringPiece("bool"), Value(Value::Type::BOOLEAN)); + dict2.Set(std::string("int"), Value(Value::Type::INTEGER)); + dict2.Set(std::string("double"), Value(Value::Type::DOUBLE)); + dict2.Set(std::string("string"), Value(Value::Type::STRING)); + dict2.Set("blob", Value(Value::Type::BINARY)); + dict2.Set("list", Value(Value::Type::LIST)); + dict2.Set("dict", Value(Value::Type::DICTIONARY)); - EXPECT_EQ(Value(std::move(dict)), value); + EXPECT_EQ(dict, dict2); + EXPECT_EQ(Value(std::move(dict)), Value(std::move(dict2))); } TEST(ValuesTest, SetBoolKey) { absl::optional<bool> value; - DictionaryValue dict; - dict.SetBoolKey("true_key", true); - dict.SetBoolKey("false_key", false); + Value::Dict dict; + dict.Set("true_key", true); + dict.Set("false_key", false); - value = dict.FindBoolKey("true_key"); + value = dict.FindBool("true_key"); ASSERT_TRUE(value); ASSERT_TRUE(*value); - value = dict.FindBoolKey("false_key"); + value = dict.FindBool("false_key"); ASSERT_TRUE(value); ASSERT_FALSE(*value); - value = dict.FindBoolKey("missing_key"); + value = dict.FindBool("missing_key"); ASSERT_FALSE(value); } TEST(ValuesTest, SetIntKey) { absl::optional<int> value; - DictionaryValue dict; - dict.SetIntKey("one_key", 1); - dict.SetIntKey("minus_one_key", -1); + Value::Dict dict; + dict.Set("one_key", 1); + dict.Set("minus_one_key", -1); - value = dict.FindIntKey("one_key"); + value = dict.FindInt("one_key"); ASSERT_TRUE(value); ASSERT_EQ(1, *value); - value = dict.FindIntKey("minus_one_key"); + value = dict.FindInt("minus_one_key"); ASSERT_TRUE(value); ASSERT_EQ(-1, *value); - value = dict.FindIntKey("missing_key"); + value = dict.FindInt("missing_key"); ASSERT_FALSE(value); } TEST(ValuesTest, SetDoubleKey) { - DictionaryValue dict; - dict.SetDoubleKey("one_key", 1.0); - dict.SetDoubleKey("minus_one_key", -1.0); - dict.SetDoubleKey("pi_key", 3.1415); + Value::Dict dict; + dict.Set("one_key", 1.0); + dict.Set("minus_one_key", -1.0); + dict.Set("pi_key", 3.1415); // NOTE: Use FindKey() instead of FindDoubleKey() because the latter will // auto-convert integers to doubles as well. const Value* value; - value = dict.FindKey("one_key"); + value = dict.Find("one_key"); ASSERT_TRUE(value); EXPECT_TRUE(value->is_double()); EXPECT_EQ(1.0, value->GetDouble()); - value = dict.FindKey("minus_one_key"); + value = dict.Find("minus_one_key"); ASSERT_TRUE(value); EXPECT_TRUE(value->is_double()); EXPECT_EQ(-1.0, value->GetDouble()); - value = dict.FindKey("pi_key"); + value = dict.Find("pi_key"); ASSERT_TRUE(value); EXPECT_TRUE(value->is_double()); EXPECT_EQ(3.1415, value->GetDouble()); } TEST(ValuesTest, SetStringKey) { - DictionaryValue dict; - dict.SetStringKey("one_key", "one"); - dict.SetStringKey("hello_key", "hello world"); + Value::Dict dict; + dict.Set("one_key", "one"); + dict.Set("hello_key", "hello world"); std::string movable_value("movable_value"); - dict.SetStringKey("movable_key", std::move(movable_value)); + dict.Set("movable_key", std::move(movable_value)); ASSERT_TRUE(movable_value.empty()); const std::string* value; - value = dict.FindStringKey("one_key"); + value = dict.FindString("one_key"); ASSERT_TRUE(value); ASSERT_EQ("one", *value); - value = dict.FindStringKey("hello_key"); + value = dict.FindString("hello_key"); ASSERT_TRUE(value); ASSERT_EQ("hello world", *value); - value = dict.FindStringKey("movable_key"); + value = dict.FindString("movable_key"); ASSERT_TRUE(value); ASSERT_EQ("movable_value", *value); - value = dict.FindStringKey("missing_key"); + value = dict.FindString("missing_key"); ASSERT_FALSE(value); } TEST(ValuesTest, FindPath) { // Construct a dictionary path {root}.foo.bar = 123 - Value foo(Value::Type::DICTIONARY); - foo.SetKey("bar", Value(123)); + Value::Dict foo; + foo.Set("bar", Value(123)); - Value root(Value::Type::DICTIONARY); - root.SetKey("foo", std::move(foo)); + Value::Dict root; + root.Set("foo", std::move(foo)); // Double key, second not found. - Value* found = root.FindPath("foo.notfound"); + Value* found = root.FindByDottedPath("foo.notfound"); EXPECT_FALSE(found); // Double key, found. - found = root.FindPath("foo.bar"); + found = root.FindByDottedPath("foo.bar"); EXPECT_TRUE(found); EXPECT_TRUE(found->is_int()); EXPECT_EQ(123, found->GetInt()); } TEST(ValuesTest, SetPath) { - Value root(Value::Type::DICTIONARY); + Value::Dict root; - Value* inserted = root.SetPath("one.two", Value(123)); - Value* found = root.FindPathOfType("one.two", Value::Type::INTEGER); + Value* inserted = root.SetByDottedPath("one.two", Value(123)); + Value* found = root.FindByDottedPath("one.two"); ASSERT_TRUE(found); + EXPECT_EQ(found->type(), Value::Type::INTEGER); EXPECT_EQ(inserted, found); EXPECT_EQ(123, found->GetInt()); - inserted = root.SetPath("foo.bar", Value(123)); - found = root.FindPathOfType("foo.bar", Value::Type::INTEGER); + inserted = root.SetByDottedPath("foo.bar", Value(123)); + found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); + EXPECT_EQ(found->type(), Value::Type::INTEGER); EXPECT_EQ(inserted, found); EXPECT_EQ(123, found->GetInt()); // Overwrite with a different value. - root.SetPath("foo.bar", Value("hello")); - found = root.FindPathOfType("foo.bar", Value::Type::STRING); + root.SetByDottedPath("foo.bar", Value("hello")); + found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); + EXPECT_EQ(found->type(), Value::Type::STRING); EXPECT_EQ("hello", found->GetString()); // Can't change existing non-dictionary keys to dictionaries. - found = root.SetPath("foo.bar.baz", Value(123)); + found = root.SetByDottedPath("foo.bar.baz", Value(123)); EXPECT_FALSE(found); } TEST(ValuesTest, SetBoolPath) { - DictionaryValue root; - Value* inserted = root.SetBoolPath("foo.bar", true); - Value* found = root.FindPath("foo.bar"); + Value::Dict root; + Value* inserted = root.SetByDottedPath("foo.bar", true); + Value* found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); EXPECT_EQ(inserted, found); ASSERT_TRUE(found->is_bool()); EXPECT_TRUE(found->GetBool()); // Overwrite with a different value. - root.SetBoolPath("foo.bar", false); - found = root.FindPath("foo.bar"); + root.SetByDottedPath("foo.bar", false); + found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); ASSERT_TRUE(found->is_bool()); EXPECT_FALSE(found->GetBool()); // Can't change existing non-dictionary keys. - ASSERT_FALSE(root.SetBoolPath("foo.bar.zoo", true)); + ASSERT_FALSE(root.SetByDottedPath("foo.bar.zoo", true)); } TEST(ValuesTest, SetIntPath) { - DictionaryValue root; - Value* inserted = root.SetIntPath("foo.bar", 123); - Value* found = root.FindPath("foo.bar"); + Value::Dict root; + Value* inserted = root.SetByDottedPath("foo.bar", 123); + Value* found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); EXPECT_EQ(inserted, found); ASSERT_TRUE(found->is_int()); EXPECT_EQ(123, found->GetInt()); // Overwrite with a different value. - root.SetIntPath("foo.bar", 234); - found = root.FindPath("foo.bar"); + root.SetByDottedPath("foo.bar", 234); + found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); ASSERT_TRUE(found->is_int()); EXPECT_EQ(234, found->GetInt()); // Can't change existing non-dictionary keys. - ASSERT_FALSE(root.SetIntPath("foo.bar.zoo", 567)); + ASSERT_FALSE(root.SetByDottedPath("foo.bar.zoo", 567)); } TEST(ValuesTest, SetDoublePath) { - DictionaryValue root; - Value* inserted = root.SetDoublePath("foo.bar", 1.23); - Value* found = root.FindPath("foo.bar"); + Value::Dict root; + Value* inserted = root.SetByDottedPath("foo.bar", 1.23); + Value* found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); EXPECT_EQ(inserted, found); ASSERT_TRUE(found->is_double()); EXPECT_EQ(1.23, found->GetDouble()); // Overwrite with a different value. - root.SetDoublePath("foo.bar", 2.34); - found = root.FindPath("foo.bar"); + root.SetByDottedPath("foo.bar", 2.34); + found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); ASSERT_TRUE(found->is_double()); EXPECT_EQ(2.34, found->GetDouble()); // Can't change existing non-dictionary keys. - ASSERT_FALSE(root.SetDoublePath("foo.bar.zoo", 5.67)); + ASSERT_FALSE(root.SetByDottedPath("foo.bar.zoo", 5.67)); } TEST(ValuesTest, SetStringPath) { - DictionaryValue root; - Value* inserted = root.SetStringPath("foo.bar", "hello world"); - Value* found = root.FindPath("foo.bar"); + Value::Dict root; + Value* inserted = root.SetByDottedPath("foo.bar", "hello world"); + Value* found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); EXPECT_EQ(inserted, found); ASSERT_TRUE(found->is_string()); EXPECT_EQ("hello world", found->GetString()); // Overwrite with a different value. - root.SetStringPath("foo.bar", "bonjour monde"); - found = root.FindPath("foo.bar"); + root.SetByDottedPath("foo.bar", "bonjour monde"); + found = root.FindByDottedPath("foo.bar"); ASSERT_TRUE(found); ASSERT_TRUE(found->is_string()); EXPECT_EQ("bonjour monde", found->GetString()); - ASSERT_TRUE(root.SetStringPath("foo.bar", StringPiece("rah rah"))); - ASSERT_TRUE(root.SetStringPath("foo.bar", std::string("temp string"))); - ASSERT_TRUE(root.SetStringPath("foo.bar", u"temp string")); + ASSERT_TRUE(root.SetByDottedPath("foo.bar", StringPiece("rah rah"))); + ASSERT_TRUE(root.SetByDottedPath("foo.bar", std::string("temp string"))); + ASSERT_TRUE(root.SetByDottedPath("foo.bar", u"temp string")); // Can't change existing non-dictionary keys. - ASSERT_FALSE(root.SetStringPath("foo.bar.zoo", "ola mundo")); + ASSERT_FALSE(root.SetByDottedPath("foo.bar.zoo", "ola mundo")); } TEST(ValuesTest, RemoveKey) { - Value root(Value::Type::DICTIONARY); - root.SetKey("one", Value(123)); + Value::Dict root; + root.Set("one", Value(123)); // Removal of missing key should fail. - EXPECT_FALSE(root.RemoveKey("two")); + EXPECT_FALSE(root.Remove("two")); // Removal of existing key should succeed. - EXPECT_TRUE(root.RemoveKey("one")); + EXPECT_TRUE(root.Remove("one")); // Second removal of previously existing key should fail. - EXPECT_FALSE(root.RemoveKey("one")); + EXPECT_FALSE(root.Remove("one")); } TEST(ValuesTest, ExtractKey) { - Value root(Value::Type::DICTIONARY); - root.SetKey("one", Value(123)); + Value::Dict root; + root.Set("one", Value(123)); // Extraction of missing key should fail. - EXPECT_EQ(absl::nullopt, root.ExtractKey("two")); + EXPECT_EQ(absl::nullopt, root.Extract("two")); // Extraction of existing key should succeed. - EXPECT_EQ(Value(123), root.ExtractKey("one")); + EXPECT_EQ(Value(123), root.Extract("one")); // Second extraction of previously existing key should fail. - EXPECT_EQ(absl::nullopt, root.ExtractKey("one")); + EXPECT_EQ(absl::nullopt, root.Extract("one")); } TEST(ValuesTest, RemovePath) { - Value root(Value::Type::DICTIONARY); - root.SetPath("one.two.three", Value(123)); + Value::Dict root; + root.SetByDottedPath("one.two.three", Value(123)); // Removal of missing key should fail. - EXPECT_FALSE(root.RemovePath("one.two.four")); + EXPECT_FALSE(root.RemoveByDottedPath("one.two.four")); // Removal of existing key should succeed. - EXPECT_TRUE(root.RemovePath("one.two.three")); + EXPECT_TRUE(root.RemoveByDottedPath("one.two.three")); // Second removal of previously existing key should fail. - EXPECT_FALSE(root.RemovePath("one.two.three")); + EXPECT_FALSE(root.RemoveByDottedPath("one.two.three")); // Intermediate empty dictionaries should be cleared. - EXPECT_EQ(nullptr, root.FindKey("one")); + EXPECT_EQ(nullptr, root.Find("one")); - root.SetPath("one.two.three", Value(123)); - root.SetPath("one.two.four", Value(124)); + root.SetByDottedPath("one.two.three", Value(123)); + root.SetByDottedPath("one.two.four", Value(124)); - EXPECT_TRUE(root.RemovePath("one.two.three")); + EXPECT_TRUE(root.RemoveByDottedPath("one.two.three")); // Intermediate non-empty dictionaries should be kept. - EXPECT_NE(nullptr, root.FindKey("one")); - EXPECT_NE(nullptr, root.FindPath("one.two")); - EXPECT_NE(nullptr, root.FindPath("one.two.four")); + EXPECT_NE(nullptr, root.Find("one")); + EXPECT_NE(nullptr, root.FindByDottedPath("one.two")); + EXPECT_NE(nullptr, root.FindByDottedPath("one.two.four")); } TEST(ValuesTest, ExtractPath) { - Value root(Value::Type::DICTIONARY); - root.SetPath("one.two.three", Value(123)); + Value::Dict root; + root.SetByDottedPath("one.two.three", Value(123)); // Extraction of missing key should fail. - EXPECT_EQ(absl::nullopt, root.ExtractPath("one.two.four")); + EXPECT_EQ(absl::nullopt, root.ExtractByDottedPath("one.two.four")); // Extraction of existing key should succeed. - EXPECT_EQ(Value(123), root.ExtractPath("one.two.three")); + EXPECT_EQ(Value(123), root.ExtractByDottedPath("one.two.three")); // Second extraction of previously existing key should fail. - EXPECT_EQ(absl::nullopt, root.ExtractPath("one.two.three")); + EXPECT_EQ(absl::nullopt, root.ExtractByDottedPath("one.two.three")); // Intermediate empty dictionaries should be cleared. - EXPECT_EQ(nullptr, root.FindKey("one")); + EXPECT_EQ(nullptr, root.Find("one")); - root.SetPath("one.two.three", Value(123)); - root.SetPath("one.two.four", Value(124)); + root.SetByDottedPath("one.two.three", Value(123)); + root.SetByDottedPath("one.two.four", Value(124)); - EXPECT_EQ(Value(123), root.ExtractPath("one.two.three")); + EXPECT_EQ(Value(123), root.ExtractByDottedPath("one.two.three")); // Intermediate non-empty dictionaries should be kept. - EXPECT_NE(nullptr, root.FindKey("one")); - EXPECT_NE(nullptr, root.FindPath("one.two")); - EXPECT_NE(nullptr, root.FindPath("one.two.four")); + EXPECT_NE(nullptr, root.Find("one")); + EXPECT_NE(nullptr, root.FindByDottedPath("one.two")); + EXPECT_NE(nullptr, root.FindByDottedPath("one.two.four")); } TEST(ValuesTest, Basic) { // Test basic dictionary getting/setting - DictionaryValue settings; - ASSERT_FALSE(settings.FindPath("global.homepage")); + Value::Dict settings; + ASSERT_FALSE(settings.FindByDottedPath("global.homepage")); - ASSERT_FALSE(settings.FindKey("global")); - settings.SetKey("global", Value(true)); - ASSERT_TRUE(settings.FindKey("global")); - settings.RemoveKey("global"); - settings.SetPath("global.homepage", Value("http://scurvy.com")); - ASSERT_TRUE(settings.FindKey("global")); - const std::string* homepage = settings.FindStringPath("global.homepage"); + ASSERT_FALSE(settings.Find("global")); + settings.Set("global", Value(true)); + ASSERT_TRUE(settings.Find("global")); + settings.Remove("global"); + settings.SetByDottedPath("global.homepage", Value("http://scurvy.com")); + ASSERT_TRUE(settings.Find("global")); + const std::string* homepage = + settings.FindStringByDottedPath("global.homepage"); ASSERT_TRUE(homepage); ASSERT_EQ(std::string("http://scurvy.com"), *homepage); // Test storing a dictionary in a list. - ASSERT_FALSE(settings.FindPath("global.toolbar.bookmarks")); + ASSERT_FALSE(settings.FindByDottedPath("global.toolbar.bookmarks")); ListValue new_toolbar_bookmarks; - settings.SetPath("global.toolbar.bookmarks", - std::move(new_toolbar_bookmarks)); - Value* toolbar_bookmarks = settings.FindListPath("global.toolbar.bookmarks"); + settings.SetByDottedPath("global.toolbar.bookmarks", + std::move(new_toolbar_bookmarks)); + Value::List* toolbar_bookmarks = + settings.FindListByDottedPath("global.toolbar.bookmarks"); ASSERT_TRUE(toolbar_bookmarks); - DictionaryValue new_bookmark; - new_bookmark.SetKey("name", Value("Froogle")); - new_bookmark.SetKey("url", Value("http://froogle.com")); + Value::Dict new_bookmark; + new_bookmark.Set("name", Value("Froogle")); + new_bookmark.Set("url", Value("http://froogle.com")); toolbar_bookmarks->Append(std::move(new_bookmark)); - Value* bookmark_list = settings.FindPath("global.toolbar.bookmarks"); + Value* bookmark_list = settings.FindByDottedPath("global.toolbar.bookmarks"); ASSERT_TRUE(bookmark_list); ASSERT_EQ(1U, bookmark_list->GetListDeprecated().size()); Value* bookmark = &bookmark_list->GetListDeprecated()[0]; ASSERT_TRUE(bookmark); ASSERT_TRUE(bookmark->is_dict()); - const std::string* bookmark_name = bookmark->FindStringKey("name"); + const std::string* bookmark_name = bookmark->GetDict().FindString("name"); ASSERT_TRUE(bookmark_name); ASSERT_EQ(std::string("Froogle"), *bookmark_name); - const std::string* bookmark_url = bookmark->FindStringKey("url"); + const std::string* bookmark_url = bookmark->GetDict().FindString("url"); ASSERT_TRUE(bookmark_url); ASSERT_EQ(std::string("http://froogle.com"), *bookmark_url); } @@ -1605,62 +1601,59 @@ TEST(ValuesTest, DictionaryDeletion) { std::string key = "test"; - DictionaryValue dict; - dict.Set(key, std::make_unique<Value>()); - EXPECT_FALSE(dict.DictEmpty()); - EXPECT_FALSE(dict.DictEmpty()); - EXPECT_EQ(1U, dict.DictSize()); - dict.DictClear(); - EXPECT_TRUE(dict.DictEmpty()); - EXPECT_TRUE(dict.DictEmpty()); - EXPECT_EQ(0U, dict.DictSize()); + Value::Dict dict; + dict.Set(key, Value()); + EXPECT_FALSE(dict.empty()); + EXPECT_EQ(1U, dict.size()); + dict.clear(); + EXPECT_TRUE(dict.empty()); + EXPECT_TRUE(dict.empty()); + EXPECT_EQ(0U, dict.size()); } TEST(ValuesTest, DictionarySetReturnsPointer) { { - DictionaryValue dict; - Value* blank_ptr = dict.Set("foo.bar", std::make_unique<base::Value>()); + Value::Dict dict; + Value* blank_ptr = dict.Set("foo.bar", Value()); EXPECT_EQ(Value::Type::NONE, blank_ptr->type()); } { - DictionaryValue dict; - Value* blank_ptr = dict.SetKey("foo.bar", base::Value()); + Value::Dict dict; + Value* blank_ptr = dict.Set("foo.bar", Value()); EXPECT_EQ(Value::Type::NONE, blank_ptr->type()); } { - DictionaryValue dict; - Value* int_ptr = dict.SetInteger("foo.bar", 42); + Value::Dict dict; + Value* int_ptr = dict.Set("foo.bar", 42); EXPECT_EQ(Value::Type::INTEGER, int_ptr->type()); EXPECT_EQ(42, int_ptr->GetInt()); } { - DictionaryValue dict; - Value* string_ptr = dict.SetString("foo.bar", "foo"); + Value::Dict dict; + Value* string_ptr = dict.Set("foo.bar", "foo"); EXPECT_EQ(Value::Type::STRING, string_ptr->type()); EXPECT_EQ("foo", string_ptr->GetString()); } { - DictionaryValue dict; - Value* string16_ptr = dict.SetString("foo.bar", u"baz"); + Value::Dict dict; + Value* string16_ptr = dict.Set("foo.bar", u"baz"); EXPECT_EQ(Value::Type::STRING, string16_ptr->type()); EXPECT_EQ("baz", string16_ptr->GetString()); } { - DictionaryValue dict; - Value* dict_ptr = - dict.SetPath("foo.bar", base::Value(base::Value::Type::DICTIONARY)); + Value::Dict dict; + Value* dict_ptr = dict.Set("foo.bar", Value::Dict()); EXPECT_EQ(Value::Type::DICTIONARY, dict_ptr->type()); } { - DictionaryValue dict; - ListValue* list_ptr = - dict.SetList("foo.bar", std::make_unique<base::ListValue>()); + Value::Dict dict; + Value* list_ptr = dict.Set("foo.bar", Value::List()); EXPECT_EQ(Value::Type::LIST, list_ptr->type()); } } @@ -1691,96 +1684,84 @@ EXPECT_EQ(Value::Type::NONE, value4->type()); } -TEST(ValuesTest, DeepCopy) { - DictionaryValue original_dict; - Value* null_weak = original_dict.SetKey("null", Value()); - Value* bool_weak = original_dict.SetKey("bool", Value(true)); - Value* int_weak = original_dict.SetKey("int", Value(42)); - Value* double_weak = original_dict.SetKey("double", Value(3.14)); - Value* string_weak = original_dict.SetKey("string", Value("hello")); - Value* string16_weak = original_dict.SetKey("string16", Value(u"hello16")); +TEST(ValuesTest, Clone) { + Value::Dict original_dict; + Value* null_weak = original_dict.Set("null", Value()); + Value* bool_weak = original_dict.Set("bool", Value(true)); + Value* int_weak = original_dict.Set("int", Value(42)); + Value* double_weak = original_dict.Set("double", Value(3.14)); + Value* string_weak = original_dict.Set("string", Value("hello")); + Value* string16_weak = original_dict.Set("string16", Value(u"hello16")); Value* binary_weak = - original_dict.SetKey("binary", Value(Value::BlobStorage(42, '!'))); + original_dict.Set("binary", Value(Value::BlobStorage(42, '!'))); Value::List list; list.Append(0); list.Append(1); - Value* list_weak = original_dict.SetKey("list", Value(std::move(list))); + Value* list_weak = original_dict.Set("list", Value(std::move(list))); - Value* dict_weak = original_dict.SetKey( - "dictionary", base::Value(base::Value::Type::DICTIONARY)); - dict_weak->SetStringKey("key", "value"); + Value* dict_weak = + original_dict.Set("dictionary", Value(Value::Type::DICTIONARY)); + dict_weak->GetDict().Set("key", "value"); - auto copy_dict = original_dict.CreateDeepCopy(); - ASSERT_TRUE(copy_dict.get()); - ASSERT_NE(copy_dict.get(), &original_dict); + Value::Dict copy_dict = original_dict.Clone(); - Value* copy_null = nullptr; - ASSERT_TRUE(copy_dict->Get("null", ©_null)); + Value* copy_null = copy_dict.Find("null"); ASSERT_TRUE(copy_null); ASSERT_NE(copy_null, null_weak); ASSERT_TRUE(copy_null->is_none()); - Value* copy_bool = nullptr; - ASSERT_TRUE(copy_dict->Get("bool", ©_bool)); + Value* copy_bool = copy_dict.Find("bool"); ASSERT_TRUE(copy_bool); ASSERT_NE(copy_bool, bool_weak); ASSERT_TRUE(copy_bool->is_bool()); ASSERT_TRUE(copy_bool->GetBool()); - Value* copy_int = nullptr; - ASSERT_TRUE(copy_dict->Get("int", ©_int)); + Value* copy_int = copy_dict.Find("int"); ASSERT_TRUE(copy_int); ASSERT_NE(copy_int, int_weak); ASSERT_TRUE(copy_int->is_int()); ASSERT_EQ(42, copy_int->GetInt()); - Value* copy_double = nullptr; - ASSERT_TRUE(copy_dict->Get("double", ©_double)); + Value* copy_double = copy_dict.Find("double"); ASSERT_TRUE(copy_double); ASSERT_NE(copy_double, double_weak); ASSERT_TRUE(copy_double->is_double()); ASSERT_EQ(3.14, copy_double->GetDouble()); - Value* copy_string = nullptr; - ASSERT_TRUE(copy_dict->Get("string", ©_string)); + Value* copy_string = copy_dict.Find("string"); ASSERT_TRUE(copy_string); ASSERT_NE(copy_string, string_weak); ASSERT_TRUE(copy_string->is_string()); ASSERT_EQ(std::string("hello"), copy_string->GetString()); - Value* copy_string16 = nullptr; - ASSERT_TRUE(copy_dict->Get("string16", ©_string16)); + Value* copy_string16 = copy_dict.Find("string16"); ASSERT_TRUE(copy_string16); ASSERT_NE(copy_string16, string16_weak); ASSERT_TRUE(copy_string16->is_string()); ASSERT_EQ(std::string("hello16"), copy_string16->GetString()); - Value* copy_binary = nullptr; - ASSERT_TRUE(copy_dict->Get("binary", ©_binary)); + Value* copy_binary = copy_dict.Find("binary"); ASSERT_TRUE(copy_binary); ASSERT_NE(copy_binary, binary_weak); ASSERT_TRUE(copy_binary->is_blob()); ASSERT_NE(binary_weak->GetBlob().data(), copy_binary->GetBlob().data()); ASSERT_EQ(binary_weak->GetBlob(), copy_binary->GetBlob()); - Value* copy_value = nullptr; - ASSERT_TRUE(copy_dict->Get("list", ©_value)); + Value* copy_value = copy_dict.Find("list"); ASSERT_TRUE(copy_value); ASSERT_NE(copy_value, list_weak); ASSERT_TRUE(copy_value->is_list()); ASSERT_EQ(2U, copy_value->GetList().size()); - copy_value = nullptr; - ASSERT_TRUE(copy_dict->Get("dictionary", ©_value)); + copy_value = copy_dict.Find("dictionary"); ASSERT_TRUE(copy_value); ASSERT_NE(copy_value, dict_weak); ASSERT_TRUE(copy_value->is_dict()); - DictionaryValue* copy_nested_dictionary = nullptr; - ASSERT_TRUE(copy_value->GetAsDictionary(©_nested_dictionary)); + Value::Dict* copy_nested_dictionary = copy_value->GetIfDict(); ASSERT_TRUE(copy_nested_dictionary); - EXPECT_TRUE(copy_nested_dictionary->FindKey("key")); + EXPECT_TRUE(copy_nested_dictionary->Find("key")); } TEST(ValuesTest, SpecializedEquals) { @@ -1872,36 +1853,36 @@ Value boolean(false); EXPECT_NE(*null1, boolean); - DictionaryValue dv; - dv.SetBoolKey("a", false); - dv.SetIntKey("b", 2); - dv.SetDoubleKey("c", 2.5); - dv.SetStringKey("d1", "string"); - dv.SetStringKey("d2", u"http://google.com"); - dv.SetKey("e", Value()); + Value::Dict dv; + dv.Set("a", false); + dv.Set("b", 2); + dv.Set("c", 2.5); + dv.Set("d1", "string"); + dv.Set("d2", u"http://google.com"); + dv.Set("e", Value()); - auto copy = dv.CreateDeepCopy(); - EXPECT_EQ(dv, *copy); + Value::Dict copy = dv.Clone(); + EXPECT_EQ(dv, copy); - std::unique_ptr<ListValue> list(new ListValue); - list->Append(Value()); - list->Append(Value(Value::Type::DICTIONARY)); - Value list_copy(list->Clone()); + Value::List list; + list.Append(Value()); + list.Append(Value(Value::Type::DICTIONARY)); + Value::List list_copy(list.Clone()); - ListValue* list_weak = dv.SetList("f", std::move(list)); - EXPECT_NE(dv, *copy); - copy->SetKey("f", std::move(list_copy)); - EXPECT_EQ(dv, *copy); + Value* list_weak = dv.Set("f", std::move(list)); + EXPECT_NE(dv, copy); + copy.Set("f", std::move(list_copy)); + EXPECT_EQ(dv, copy); - list_weak->Append(true); - EXPECT_NE(dv, *copy); + list_weak->GetList().Append(true); + EXPECT_NE(dv, copy); // Check if Equals detects differences in only the keys. - copy = dv.CreateDeepCopy(); - EXPECT_EQ(dv, *copy); - copy->RemoveKey("a"); - copy->SetBoolKey("aa", false); - EXPECT_NE(dv, *copy); + copy = dv.Clone(); + EXPECT_EQ(dv, copy); + copy.Remove("a"); + copy.Set("aa", false); + EXPECT_NE(dv, copy); } TEST(ValuesTest, Comparisons) { @@ -1988,8 +1969,8 @@ EXPECT_FALSE(int_list1 >= int_list2); // Test Empty Dict Values. - DictionaryValue null_dict1; - DictionaryValue null_dict2; + Value::Dict null_dict1; + Value::Dict null_dict2; EXPECT_EQ(null_dict1, null_dict2); EXPECT_FALSE(null_dict1 != null_dict2); EXPECT_FALSE(null_dict1 < null_dict2); @@ -1998,10 +1979,10 @@ EXPECT_GE(null_dict1, null_dict2); // Test Non Empty Dict Values. - DictionaryValue int_dict1; - DictionaryValue int_dict2; - int_dict1.SetIntKey("key", 1); - int_dict2.SetIntKey("key", 2); + Value::Dict int_dict1; + Value::Dict int_dict2; + int_dict1.Set("key", 1); + int_dict2.Set("key", 2); EXPECT_FALSE(int_dict1 == int_dict2); EXPECT_NE(int_dict1, int_dict2); EXPECT_LT(int_dict1, int_dict2); @@ -2068,52 +2049,64 @@ EXPECT_EQ(*list_weak, *copy_list); } -TEST(ValuesTest, MergeDictionary) { - std::unique_ptr<DictionaryValue> base(new DictionaryValue); - base->SetStringKey("base_key", "base_key_value_base"); - base->SetStringKey("collide_key", "collide_key_value_base"); - DictionaryValue base_sub_dict; - base_sub_dict.SetStringKey("sub_base_key", "sub_base_key_value_base"); - base_sub_dict.SetStringKey("sub_collide_key", "sub_collide_key_value_base"); - base->SetKey("sub_dict_key", std::move(base_sub_dict)); +TEST(ValuesTest, Merge) { + Value::Dict base; + base.Set("base_key", "base_key_value_base"); + base.Set("collide_key", "collide_key_value_base"); + Value::Dict base_sub_dict; + base_sub_dict.Set("sub_base_key", "sub_base_key_value_base"); + base_sub_dict.Set("sub_collide_key", "sub_collide_key_value_base"); + base.Set("sub_dict_key", std::move(base_sub_dict)); - std::unique_ptr<DictionaryValue> merge(new DictionaryValue); - merge->SetStringKey("merge_key", "merge_key_value_merge"); - merge->SetStringKey("collide_key", "collide_key_value_merge"); - DictionaryValue merge_sub_dict; - merge_sub_dict.SetStringKey("sub_merge_key", "sub_merge_key_value_merge"); - merge_sub_dict.SetStringKey("sub_collide_key", "sub_collide_key_value_merge"); - merge->SetKey("sub_dict_key", std::move(merge_sub_dict)); + Value::Dict merge; + merge.Set("merge_key", "merge_key_value_merge"); + merge.Set("collide_key", "collide_key_value_merge"); + Value::Dict merge_sub_dict; + merge_sub_dict.Set("sub_merge_key", "sub_merge_key_value_merge"); + merge_sub_dict.Set("sub_collide_key", "sub_collide_key_value_merge"); + merge.Set("sub_dict_key", std::move(merge_sub_dict)); - base->MergeDictionary(merge.get()); + base.Merge(std::move(merge)); - EXPECT_EQ(4U, base->DictSize()); - std::string base_key_value; - EXPECT_TRUE(base->GetString("base_key", &base_key_value)); - EXPECT_EQ("base_key_value_base", base_key_value); // Base value preserved. - std::string collide_key_value; - EXPECT_TRUE(base->GetString("collide_key", &collide_key_value)); - EXPECT_EQ("collide_key_value_merge", collide_key_value); // Replaced. - std::string merge_key_value; - EXPECT_TRUE(base->GetString("merge_key", &merge_key_value)); - EXPECT_EQ("merge_key_value_merge", merge_key_value); // Merged in. + EXPECT_EQ(4U, base.size()); + const std::string* base_key_value = base.FindString("base_key"); + ASSERT_TRUE(base_key_value); + EXPECT_EQ("base_key_value_base", *base_key_value); // Base value preserved. + const std::string* collide_key_value = base.FindString("collide_key"); + ASSERT_TRUE(collide_key_value); + EXPECT_EQ("collide_key_value_merge", *collide_key_value); // Replaced. + const std::string* merge_key_value = base.FindString("merge_key"); + ASSERT_TRUE(merge_key_value); + EXPECT_EQ("merge_key_value_merge", *merge_key_value); // Merged in. - DictionaryValue* res_sub_dict; - EXPECT_TRUE(base->GetDictionary("sub_dict_key", &res_sub_dict)); - EXPECT_EQ(3U, res_sub_dict->DictSize()); - std::string sub_base_key_value; - EXPECT_TRUE(res_sub_dict->GetString("sub_base_key", &sub_base_key_value)); - EXPECT_EQ("sub_base_key_value_base", sub_base_key_value); // Preserved. - std::string sub_collide_key_value; - EXPECT_TRUE( - res_sub_dict->GetString("sub_collide_key", &sub_collide_key_value)); - EXPECT_EQ("sub_collide_key_value_merge", sub_collide_key_value); // Replaced. - std::string sub_merge_key_value; - EXPECT_TRUE(res_sub_dict->GetString("sub_merge_key", &sub_merge_key_value)); - EXPECT_EQ("sub_merge_key_value_merge", sub_merge_key_value); // Merged in. + Value::Dict* res_sub_dict = base.FindDict("sub_dict_key"); + ASSERT_TRUE(res_sub_dict); + EXPECT_EQ(3U, res_sub_dict->size()); + const std::string* sub_base_key_value = + res_sub_dict->FindString("sub_base_key"); + ASSERT_TRUE(sub_base_key_value); + EXPECT_EQ("sub_base_key_value_base", *sub_base_key_value); // Preserved. + const std::string* sub_collide_key_value = + res_sub_dict->FindString("sub_collide_key"); + ASSERT_TRUE(sub_collide_key_value); + EXPECT_EQ("sub_collide_key_value_merge", + *sub_collide_key_value); // Replaced. + const std::string* sub_merge_key_value = + res_sub_dict->FindString("sub_merge_key"); + ASSERT_TRUE(sub_merge_key_value); + EXPECT_EQ("sub_merge_key_value_merge", *sub_merge_key_value); // Merged in. } TEST(ValuesTest, MergeDictionaryDeepCopy) { + // Note: This test still uses the old and deprecated MergeDictionary() API, as + // the new API doesn't support what this test expects. The test expects that + // the dictionary passed as an argument to MergeDictionary() be left unchanged + // (which is pretty much implied anyway, by the constness). However, the new + // API, Value::Dict::Merge(), will std::move() any values from the dict + // argument. + // + // Just remove this test when the old API is removed. + std::unique_ptr<DictionaryValue> child(new DictionaryValue); DictionaryValue* original_child = child.get(); child->SetStringKey("test", "value"); @@ -2146,33 +2139,33 @@ } TEST(ValuesTest, DictionaryIterator) { - DictionaryValue dict; - for (DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { + Value::Dict dict; + for (Value::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { ADD_FAILURE(); } Value value1("value1"); - dict.SetKey("key1", value1.Clone()); + dict.Set("key1", value1.Clone()); bool seen1 = false; - for (DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { + for (Value::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { EXPECT_FALSE(seen1); - EXPECT_EQ("key1", it.key()); - EXPECT_EQ(value1, it.value()); + EXPECT_EQ("key1", it->first); + EXPECT_EQ(value1, it->second); seen1 = true; } EXPECT_TRUE(seen1); Value value2("value2"); - dict.SetKey("key2", value2.Clone()); + dict.Set("key2", value2.Clone()); bool seen2 = seen1 = false; - for (DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { - if (it.key() == "key1") { + for (Value::Dict::iterator it = dict.begin(); it != dict.end(); ++it) { + if (it->first == "key1") { EXPECT_FALSE(seen1); - EXPECT_EQ(value1, it.value()); + EXPECT_EQ(value1, it->second); seen1 = true; - } else if (it.key() == "key2") { + } else if (it->first == "key2") { EXPECT_FALSE(seen2); - EXPECT_EQ(value2, it.value()); + EXPECT_EQ(value2, it->second); seen2 = true; } else { ADD_FAILURE(); @@ -2183,31 +2176,30 @@ } TEST(ValuesTest, MutatingCopiedPairsInDictItemsMutatesUnderlyingValues) { - Value dict(Value::Type::DICTIONARY); - dict.SetKey("key", Value("initial value")); + Value::Dict dict; + dict.Set("key", Value("initial value")); - // Because the non-const DictItems() iterates over - // <const std::string&, Value&> pairs, it's possible - // to alter iterated-over values in place even when + // Because the non-const dict iterates over <const std::string&, Value&> + // pairs, it's possible to alter iterated-over values in place even when // "copying" the key-value pair: - for (auto kv : dict.DictItems()) + for (auto kv : dict) kv.second.GetString() = "replacement"; - std::string* found = dict.FindStringKey("key"); + std::string* found = dict.FindString("key"); ASSERT_TRUE(found); EXPECT_EQ(*found, "replacement"); } TEST(ValuesTest, StdDictionaryIterator) { - DictionaryValue dict; - for (auto it = dict.DictItems().begin(); it != dict.DictItems().end(); ++it) { + Value::Dict dict; + for (auto it = dict.begin(); it != dict.end(); ++it) { ADD_FAILURE(); } Value value1("value1"); - dict.SetKey("key1", value1.Clone()); + dict.Set("key1", value1.Clone()); bool seen1 = false; - for (auto it : dict.DictItems()) { + for (auto it : dict) { EXPECT_FALSE(seen1); EXPECT_EQ("key1", it.first); EXPECT_EQ(value1, it.second); @@ -2216,9 +2208,9 @@ EXPECT_TRUE(seen1); Value value2("value2"); - dict.SetKey("key2", value2.Clone()); + dict.Set("key2", value2.Clone()); bool seen2 = seen1 = false; - for (auto it : dict.DictItems()) { + for (auto it : dict) { if (it.first == "key1") { EXPECT_FALSE(seen1); EXPECT_EQ(value1, it.second); @@ -2335,13 +2327,13 @@ } TEST(ValuesTest, MutableFindStringPath) { - Value dict(Value::Type::DICTIONARY); - dict.SetStringPath("foo.bar", "value"); + Value::Dict dict; + dict.SetByDottedPath("foo.bar", "value"); - *(dict.FindStringPath("foo.bar")) = "new_value"; + *(dict.FindStringByDottedPath("foo.bar")) = "new_value"; - Value expected_dict(Value::Type::DICTIONARY); - expected_dict.SetStringPath("foo.bar", "new_value"); + Value::Dict expected_dict; + expected_dict.SetByDottedPath("foo.bar", "new_value"); EXPECT_EQ(expected_dict, dict); }
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index 5ecfd6dc..6f0f10a 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -9.20220830.1.1 +9.20220831.3.1
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/InstalledWebappRegistrar.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/InstalledWebappRegistrar.java index c4e0ec3..ce0e81a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/InstalledWebappRegistrar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/InstalledWebappRegistrar.java
@@ -58,14 +58,14 @@ * for PostMessage). Only at step 4 do we know that Chrome should associate the browsing data * for that origin with that app. */ - public void registerClient(String packageName, Origin origin) { + public void registerClient(String packageName, Origin origin, String pageUrl) { if (mRegisteredOrigins.contains(origin)) return; // Register that we should wipe data for this origin when the client app is uninstalled. mDataRecorder.get().register(packageName, origin); // Register that we trust the client app to handle permission for this origin and update // Chrome's permission for the origin. - mPermissionUpdater.onOriginVerified(origin, packageName); + mPermissionUpdater.onOriginVerified(origin, pageUrl, packageName); mRegisteredOrigins.add(origin); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClient.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClient.java index b9334a5..019bb83 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClient.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClient.java
@@ -147,13 +147,14 @@ /** * Gets the notification permission setting of the TWA for the given origin. + * @param url The url of the web page that requesting the permission. * @param permissionCallback To be called with the permission setting. */ - public void checkNotificationPermission(Origin origin, PermissionCallback permissionCallback) { + public void checkNotificationPermission(String url, PermissionCallback permissionCallback) { String channelName = ContextUtils.getApplicationContext().getResources().getString( R.string.notification_category_group_general); - connectAndExecute(origin.uri(), new ExecutionCallback() { + connectAndExecute(Uri.parse(url), new ExecutionCallback() { @Override public void onConnected(Origin origin, Connection service) throws RemoteException { Bundle commandArgs = new Bundle(); @@ -197,14 +198,14 @@ } /** - * Requests notification permission for the TWA for the given origin using a dialog. + * Requests notification permission for the TWA for the given url using a dialog. + * @param url The url of the web page that requesting the permission. * @param permissionCallback To be called with the permission setting. */ - public void requestNotificationPermission( - Origin origin, PermissionCallback permissionCallback) { + public void requestNotificationPermission(String url, PermissionCallback permissionCallback) { String channelName = ContextUtils.getApplicationContext().getResources().getString( R.string.notification_category_group_general); - connectAndExecute(origin.uri(), new ExecutionCallback() { + connectAndExecute(Uri.parse(url), new ExecutionCallback() { @Override public void onConnected(Origin origin, Connection service) throws RemoteException { Bundle commandArgs = new Bundle(); @@ -260,10 +261,11 @@ /** * Check location permission for the TWA of the given origin. + * @param url The url of the web page that requesting the permission. * @param permissionCallback Will be called with whether the permission is granted. */ - public void checkLocationPermission(Origin origin, PermissionCallback permissionCallback) { - connectAndExecute(origin.uri(), new ExecutionCallback() { + public void checkLocationPermission(String url, PermissionCallback permissionCallback) { + connectAndExecute(Uri.parse(url), new ExecutionCallback() { @Override public void onConnected(Origin origin, Connection service) throws RemoteException { TrustedWebActivityCallback resultCallback = new TrustedWebActivityCallback() { @@ -309,8 +311,8 @@ * depending on where and when they happen. */ public void startListeningLocationUpdates( - Origin origin, boolean highAccuracy, TrustedWebActivityCallback locationCallback) { - connectAndExecute(origin.uri(), new ExecutionCallback() { + String url, boolean highAccuracy, TrustedWebActivityCallback locationCallback) { + connectAndExecute(Uri.parse(url), new ExecutionCallback() { @Override public void onConnected(Origin origin, Connection service) throws RemoteException { Bundle args = new Bundle(); @@ -332,8 +334,8 @@ }); } - public void stopLocationUpdates(Origin origin) { - connectAndExecute(origin.uri(), new ExecutionCallback() { + public void stopLocationUpdates(String url) { + connectAndExecute(Uri.parse(url), new ExecutionCallback() { @Override public void onConnected(Origin origin, Connection service) throws RemoteException { service.sendExtraCommand(STOP_LOCATION_COMMAND_NAME, Bundle.EMPTY, null);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappBridge.java index ba125dc..bc01c36 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappBridge.java
@@ -94,7 +94,7 @@ } switch (type) { case ContentSettingsType.GEOLOCATION: - PermissionUpdater.get().getLocationPermission(origin, callback); + PermissionUpdater.get().getLocationPermission(origin, lastCommittedUrl, callback); break; case ContentSettingsType.NOTIFICATIONS: PermissionUpdater.get().requestNotificationPermission(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridge.java index f799c4d8..f02aef7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridge.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.browserservices.permissiondelegation; -import android.net.Uri; import android.os.Bundle; import android.text.TextUtils; @@ -16,8 +15,8 @@ import org.chromium.base.task.PostTask; import org.chromium.chrome.browser.ChromeApplicationImpl; import org.chromium.chrome.browser.browserservices.TrustedWebActivityClient; -import org.chromium.components.embedder_support.util.Origin; import org.chromium.content_public.browser.UiThreadTaskTraits; +import org.chromium.url.GURL; /** * Provides Trusted Web Activity Client App location for native. The C++ counterpart is the @@ -34,7 +33,7 @@ public static final String EXTRA_NEW_LOCATION_ERROR_CALLBACK = "onNewLocationError"; private long mNativePointer; - private final Origin mOrigin; + private final GURL mUrl; private final TrustedWebActivityClient mTwaClient; @@ -55,32 +54,31 @@ } }; - InstalledWebappGeolocationBridge( - long nativePtr, Origin origin, TrustedWebActivityClient client) { + InstalledWebappGeolocationBridge(long nativePtr, GURL url, TrustedWebActivityClient client) { mNativePointer = nativePtr; - mOrigin = origin; + mUrl = url; mTwaClient = client; } @CalledByNative @Nullable - public static InstalledWebappGeolocationBridge create(long nativePtr, String url) { - Origin origin = Origin.create(Uri.parse(url)); - if (origin == null) return null; + public static InstalledWebappGeolocationBridge create(long nativePtr, GURL url) { + if (url == null) return null; - return new InstalledWebappGeolocationBridge(nativePtr, origin, + return new InstalledWebappGeolocationBridge(nativePtr, url, ChromeApplicationImpl.getComponent().resolveTrustedWebActivityClient()); } @CalledByNative public void start(boolean highAccuracy) { - mTwaClient.startListeningLocationUpdates(mOrigin, highAccuracy, mLocationUpdateCallback); + mTwaClient.startListeningLocationUpdates( + mUrl.getSpec(), highAccuracy, mLocationUpdateCallback); } @CalledByNative public void stopAndDestroy() { mNativePointer = 0; - mTwaClient.stopLocationUpdates(mOrigin); + mTwaClient.stopLocationUpdates(mUrl.getSpec()); } private void notifyNewGeoposition(@Nullable Bundle bundle) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdater.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdater.java index d85b177d..19adc6c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdater.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdater.java
@@ -55,9 +55,9 @@ * permission for that origin to client app's Android location permission if a * TrustedWebActivityService is found, and the TWAService supports location permission. */ - void checkPermission(Origin origin, long callback) { + void checkPermission(Origin origin, String lastCommitedUrl, long callback) { mTrustedWebActivityClient.checkLocationPermission( - origin, new TrustedWebActivityClient.PermissionCallback() { + lastCommitedUrl, new TrustedWebActivityClient.PermissionCallback() { private boolean mCalled; @Override public void onPermission(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdater.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdater.java index 14175bc..1a3f420 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdater.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdater.java
@@ -56,14 +56,14 @@ * that origin to match Android's notification permission for the package. * - Otherwise, it does nothing. */ - public void onOriginVerified(Origin origin, String packageName) { + public void onOriginVerified(Origin origin, String url, String packageName) { // It's important to note here that the client we connect to to check for the notification // permission may not be the client that triggered this method call. // The function passed to this method call may not be executed in the case of the app not // having a TrustedWebActivityService. That's fine because we only want to update the // permission if a TrustedWebActivityService exists. - mTrustedWebActivityClient.checkNotificationPermission(origin, + mTrustedWebActivityClient.checkNotificationPermission(url, (app, settingValue) -> updatePermission( origin, /*callback=*/0, app.getPackageName(), settingValue)); @@ -87,7 +87,7 @@ // See if there is any other app installed that could handle the notifications (and update // to that apps notification permission if it exists). mTrustedWebActivityClient.checkNotificationPermission( - origin, new TrustedWebActivityClient.PermissionCallback() { + origin.toString(), new TrustedWebActivityClient.PermissionCallback() { @Override public void onPermission( ComponentName app, @ContentSettingValues int settingValue) { @@ -111,7 +111,7 @@ void requestPermission(Origin origin, String lastCommittedUrl, long callback) { assert BuildInfo.isAtLeastT() : "Cannot request notification permission before Android T"; mTrustedWebActivityClient.requestNotificationPermission( - origin, new TrustedWebActivityClient.PermissionCallback() { + lastCommittedUrl, new TrustedWebActivityClient.PermissionCallback() { private boolean mCalled; @Override public void onPermission(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdater.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdater.java index be3f1cd1..7b0d86c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdater.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdater.java
@@ -49,17 +49,17 @@ * the Notification and Location delegation state for that origin if the package handles * browsable intents for the origin; otherwise, it does nothing. */ - public void onOriginVerified(Origin origin, String packageName) { + public void onOriginVerified(Origin origin, String url, String packageName) { // If the client doesn't handle browsable Intents for the URL, we don't do anything special // for the origin. - if (!appHandlesBrowsableIntent(packageName, origin.uri())) { + if (!appHandlesBrowsableIntent(packageName, Uri.parse(url))) { Log.d(TAG, "Package does not handle Browsable Intents for the origin."); return; } mPermissionManager.addDelegateApp(origin, packageName); - mNotificationPermissionUpdater.onOriginVerified(origin, packageName); + mNotificationPermissionUpdater.onOriginVerified(origin, url, packageName); } public void onWebApkLaunch(Origin origin, String packageName) { @@ -84,8 +84,8 @@ } } - void getLocationPermission(Origin origin, long callback) { - mLocationPermissionUpdater.checkPermission(origin, callback); + void getLocationPermission(Origin origin, String lastCommittedUrl, long callback) { + mLocationPermissionUpdater.checkPermission(origin, lastCommittedUrl, callback); } void requestNotificationPermission(Origin origin, String lastCommittedUrl, long callback) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/README.md b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/README.md new file mode 100644 index 0000000..c782ce4 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/permissiondelegation/README.md
@@ -0,0 +1,23 @@ +# Permission delegations + +Permission delegation is a feature that allows the web content running in a Trusted Web Activities(TWA) client app making use of the client app’s Android permission instead of checking Chrome’s permission setting for the website. + +Currently permission delegation is implemented for notifications permission and location permission. For a Trusted Web Activity client app to support delegating any permissions, it must contain a TrustedWebActivityService. + +## Notifications delegation + +Whenever a package verifies for a web page's origin, we first check whether that package handles Intents for that web page's URL. Apps that verify for an origin but don’t handle Intents to it are ignored. + +If the verified app can handle Intents, we perform notification delegation - resolving and connecting to the Trusted Web Activity Service - and query whether that app has the notification permission. On Android T+, the app may show a permission prompt to request runtime permission. + +When Chrome displays notifications for the associated website, it will connect to the TrustedWebActivityService and pass the notification over. Notifications that outside of any TWA's scope will be displayed through Chrome. + +## Location delegation + +Location permission will only be granted when running as a TWA. + +When a web content running in TWA trying to access geolocation, we will look for a TWA app that handles Intents for the site URL and query the TWA app’s Android permissions, and treat Android permissions to the corresponding ContentSettingValues. + +If the location permission is granted, Chrome will connect to the TrustedWebActivityService and the client app should access the Android location API and provide the location data to Chrome. + +If no TWA handle Intents for the site or the TWA did not declare the permission in its AndroidManifest, the location permission will decided by Chrome's site permission. \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/controller/CurrentPageVerifier.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/controller/CurrentPageVerifier.java index 6b72eb9..0937a29c0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/controller/CurrentPageVerifier.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/controller/CurrentPageVerifier.java
@@ -52,11 +52,13 @@ /** Represents the verification state of currently viewed web page. */ public static class VerificationState { public final String scope; + public final String url; @VerificationStatus public final int status; - public VerificationState(String scope, @VerificationStatus int status) { + public VerificationState(String scope, String url, @VerificationStatus int status) { this.scope = scope; + this.url = url; this.status = status; } } @@ -124,9 +126,9 @@ if (scope == null) return; if (result.isFulfilled()) { - updateState(scope, statusFromBoolean(result.getResult())); + updateState(scope, url, statusFromBoolean(result.getResult())); } else { - updateState(scope, VerificationStatus.PENDING); + updateState(scope, url, VerificationStatus.PENDING); result.then(verified -> { onVerificationResult(scope, verified); }); } } @@ -142,12 +144,13 @@ boolean resultStillApplies = tab != null && scope.equals(mDelegate.getVerifiedScope(tab.getUrl().getSpec())); if (resultStillApplies) { - updateState(scope, verified ? VerificationStatus.SUCCESS : VerificationStatus.FAILURE); + updateState(scope, tab.getUrl().getSpec(), + verified ? VerificationStatus.SUCCESS : VerificationStatus.FAILURE); } } - private void updateState(String scope, @VerificationStatus int status) { - mState = new VerificationState(scope, status); + private void updateState(String scope, String url, @VerificationStatus int status) { + mState = new VerificationState(scope, url, status); for (Runnable observer : mObservers) { observer.run(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/trustedwebactivity/TrustedWebActivityCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/trustedwebactivity/TrustedWebActivityCoordinator.java index cb21d25..ecda078 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/trustedwebactivity/TrustedWebActivityCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/trustedwebactivity/TrustedWebActivityCoordinator.java
@@ -83,7 +83,7 @@ // want to register the clients once the state reaches SUCCESS. if (state != null && state.status == VerificationStatus.SUCCESS) { mInstalledWebappRegistrar.registerClient( - mClientPackageNameProvider.get(), Origin.create(state.scope)); + mClientPackageNameProvider.get(), Origin.create(state.scope), state.url); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivityCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivityCoordinator.java index 460fe757..60fb971b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivityCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivityCoordinator.java
@@ -74,7 +74,7 @@ Origin origin = Origin.create(scope); String packageName = storage.getWebApkPackageName(); - mInstalledWebappRegistrar.registerClient(packageName, origin); + mInstalledWebappRegistrar.registerClient(packageName, origin, storage.getUrl()); PermissionUpdater.get().onWebApkLaunch(origin, packageName); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientLocationDelegationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientLocationDelegationTest.java index 9fd9b2b..66c82d2 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientLocationDelegationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientLocationDelegationTest.java
@@ -76,7 +76,7 @@ (app, settingValue) -> locationPermission.notifyCalled(); PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, - () -> mClient.checkLocationPermission(ORIGIN, callback)); + () -> mClient.checkLocationPermission(SCOPE.toString(), callback)); locationPermission.waitForFirst(); } @@ -102,8 +102,8 @@ }; PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () - -> mClient.startListeningLocationUpdates( - ORIGIN, false /* highAccuracy */, locationUpdateCallback)); + -> mClient.startListeningLocationUpdates(SCOPE.toString(), + false /* highAccuracy */, locationUpdateCallback)); locationUpdate.waitForFirst(); } @@ -128,8 +128,8 @@ }; PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () - -> mClient.startListeningLocationUpdates( - otherOrigin, false /* highAccuracy */, locationUpdateCallback)); + -> mClient.startListeningLocationUpdates(otherOrigin.toString(), + false /* highAccuracy */, locationUpdateCallback)); locationError.waitForFirst(); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientTest.java index b654db2..a490264 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityClientTest.java
@@ -30,6 +30,7 @@ import org.chromium.base.task.PostTask; import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.DoNotBatch; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeApplicationImpl; import org.chromium.chrome.browser.dependency_injection.ChromeAppComponent; @@ -65,6 +66,7 @@ * `--approve-app-links` command passed to the test target. */ @RunWith(BaseJUnit4ClassRunner.class) +@DoNotBatch(reason = "Test TWA start up behaviors.") public class TrustedWebActivityClientTest { private static final Uri SCOPE = Uri.parse("https://www.example.com/notifications"); private static final Origin ORIGIN = Origin.create(SCOPE); @@ -213,7 +215,7 @@ @Test @SmallTest public void testNoClientFound() throws TimeoutException { - Origin scope = Origin.createOrThrow("https://www.websitewithouttwa.com/"); + String scope = "https://www.websitewithouttwa.com/"; CallbackHelper noTwaFound = new CallbackHelper();
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridgeTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridgeTest.java index 92acd50..4d97693 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridgeTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/InstalledWebappGeolocationBridgeTest.java
@@ -33,21 +33,24 @@ import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.JniMocker; import org.chromium.chrome.browser.browserservices.TrustedWebActivityClient; -import org.chromium.components.embedder_support.util.Origin; +import org.chromium.url.GURL; +import org.chromium.url.JUnitTestGURLs; +import org.chromium.url.ShadowGURL; /** * Tests for {@link InstalledWebappGeolocationBridge}. */ @RunWith(BaseRobolectricTestRunner.class) -@Config(manifest = Config.NONE) +@Config(manifest = Config.NONE, shadows = {ShadowGURL.class}) @LooperMode(LooperMode.Mode.LEGACY) public class InstalledWebappGeolocationBridgeTest { - private static final Origin ORIGIN = Origin.create("https://www.website.com"); - private static final Origin OTHER_ORIGIN = Origin.create("https://www.other.website.com"); private static final String EXTRA_CALLBACK = "extraCallback"; private static final long NATIVE_POINTER = 12; + private GURL mScope; + private GURL mOtherScope; + @Rule public JniMocker mocker = new JniMocker(); @@ -65,14 +68,17 @@ MockitoAnnotations.initMocks(this); mocker.mock(InstalledWebappGeolocationBridgeJni.TEST_HOOKS, mNativeMock); + mScope = new GURL(JUnitTestGURLs.URL_1); + mOtherScope = new GURL(JUnitTestGURLs.URL_2); + mGeolocation = new InstalledWebappGeolocationBridge( - NATIVE_POINTER, ORIGIN, mTrustedWebActivityClient); + NATIVE_POINTER, mScope, mTrustedWebActivityClient); } @Test @Feature("TrustedWebActivities") public void getLocationError_whenClientDoesntHaveService() { - uninstallTrustedWebActivityService(ORIGIN); + uninstallTrustedWebActivityService(mScope); mGeolocation.start(false /* HighAccuracy */); verifyGetLocationError(); } @@ -80,7 +86,7 @@ @Test @Feature("TrustedWebActivities") public void getLocationUpdate_afterStartListening() { - installTrustedWebActivityService(ORIGIN); + installTrustedWebActivityService(mScope); mGeolocation.start(false /* HighAccuracy */); verifyGetLocationUpdate(); } @@ -88,7 +94,7 @@ @Test @Feature("TrustedWebActivities") public void noLocationUpdate_stopBeforeStart() { - installTrustedWebActivityService(ORIGIN); + installTrustedWebActivityService(mScope); mGeolocation.stopAndDestroy(); mGeolocation.start(false /* HighAccuracy */); verifyNoLocationUpdate(); @@ -97,8 +103,8 @@ @Test @Feature("TrustedWebActivities") public void getLocationError_whenOnlytherClientHasService() { - installTrustedWebActivityService(OTHER_ORIGIN); - uninstallTrustedWebActivityService(ORIGIN); + installTrustedWebActivityService(mOtherScope); + uninstallTrustedWebActivityService(mScope); mGeolocation.start(false /* HighAccuracy */); verifyGetLocationError(); verifyNoLocationUpdate(); @@ -107,16 +113,16 @@ @Test @Feature("TrustedWebActivities") public void changeHighAccuracyAfterStart() { - installTrustedWebActivityService(ORIGIN); + installTrustedWebActivityService(mScope); mGeolocation.start(false /* HighAccuracy */); assertFalse(mIsHighAccuracy); mGeolocation.start(true /* HighAccuracy */); assertTrue(mIsHighAccuracy); } - /** "Installs" a Trusted Web Activity Service for the origin. */ + /** "Installs" a Trusted Web Activity Service for the scope. */ @SuppressWarnings("unchecked") - private void installTrustedWebActivityService(Origin origin) { + private void installTrustedWebActivityService(GURL scope) { doAnswer(invocation -> { TrustedWebActivityCallback callback = invocation.getArgument(2); mIsHighAccuracy = invocation.getArgument(1); @@ -137,10 +143,10 @@ return true; }) .when(mTrustedWebActivityClient) - .startListeningLocationUpdates(eq(origin), anyBoolean(), any()); + .startListeningLocationUpdates(eq(scope.getSpec()), anyBoolean(), any()); } - private void uninstallTrustedWebActivityService(Origin origin) { + private void uninstallTrustedWebActivityService(GURL scope) { doAnswer(invocation -> { TrustedWebActivityCallback callback = invocation.getArgument(2); Bundle error = new Bundle(); @@ -150,7 +156,7 @@ return true; }) .when(mTrustedWebActivityClient) - .startListeningLocationUpdates(eq(origin), anyBoolean(), any()); + .startListeningLocationUpdates(eq(scope.getSpec()), anyBoolean(), any()); } // Verify native gets location update with correct value.
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdaterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdaterTest.java index 80fefc89..7603dd82 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdaterTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/LocationPermissionUpdaterTest.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser.browserservices.permissiondelegation; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.never; @@ -15,6 +16,7 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; +import android.net.Uri; import org.junit.Before; import org.junit.Rule; @@ -43,7 +45,8 @@ @Config(manifest = Config.NONE) @LooperMode(LooperMode.Mode.LEGACY) public class LocationPermissionUpdaterTest { - private static final Origin ORIGIN = Origin.create("https://www.website.com"); + private static final String SCOPE = "https://www.website.com"; + private static final Origin ORIGIN = Origin.create(SCOPE); private static final String PACKAGE_NAME = "com.package.name"; private static final String OTHER_PACKAGE_NAME = "com.other.package.name"; private static final long CALLBACK = 12; @@ -77,16 +80,23 @@ mShadowPackageManager = shadowOf(pm); mLocationPermissionUpdater = new LocationPermissionUpdater( mPermissionManager, mTrustedWebActivityClient, mUmaRecorder); - installBrowsableIntentHandler(ORIGIN, PACKAGE_NAME); + + doAnswer(invocation -> { + TrustedWebActivityClient.PermissionCallback callback = invocation.getArgument(1); + callback.onNoTwaFound(); + return true; + }) + .when(mTrustedWebActivityClient) + .checkLocationPermission(any(), any()); } @Test @Feature("TrustedWebActivities") public void disablesLocation_whenClientLocationAreDisabled() { - installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); + installTrustedWebActivityService(SCOPE, PACKAGE_NAME); setLocationPermissionForClient(ContentSettingValues.BLOCK); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(ContentSettingValues.BLOCK); } @@ -94,10 +104,10 @@ @Test @Feature("TrustedWebActivities") public void enablesLocation_whenClientLocationAreEnabled() { - installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); + installTrustedWebActivityService(SCOPE, PACKAGE_NAME); setLocationPermissionForClient(ContentSettingValues.ALLOW); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(ContentSettingValues.ALLOW); } @@ -105,72 +115,76 @@ @Test @Feature("TrustedWebActivities") public void updatesPermission_onSubsequentCalls() { - installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); + installTrustedWebActivityService(SCOPE, PACKAGE_NAME); setLocationPermissionForClient(ContentSettingValues.ALLOW); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(ContentSettingValues.ALLOW); setLocationPermissionForClient(ContentSettingValues.BLOCK); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(ContentSettingValues.BLOCK); } @Test @Feature("TrustedWebActivities") public void updatesPermission_onNewClient() { - installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); + installTrustedWebActivityService(SCOPE, PACKAGE_NAME); setLocationPermissionForClient(ContentSettingValues.ALLOW); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(ContentSettingValues.ALLOW); - installBrowsableIntentHandler(ORIGIN, OTHER_PACKAGE_NAME); - installTrustedWebActivityService(ORIGIN, OTHER_PACKAGE_NAME); + installBrowsableIntentHandler(SCOPE, OTHER_PACKAGE_NAME); + installTrustedWebActivityService(SCOPE, OTHER_PACKAGE_NAME); setLocationPermissionForClient(ContentSettingValues.BLOCK); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(OTHER_PACKAGE_NAME, ContentSettingValues.BLOCK); } @Test @Feature("TrustedWebActivities") public void unregisters_onClientUninstall() { - installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); + installTrustedWebActivityService(SCOPE, PACKAGE_NAME); setLocationPermissionForClient(ContentSettingValues.ALLOW); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); - uninstallTrustedWebActivityService(ORIGIN); + uninstallTrustedWebActivityService(SCOPE); mLocationPermissionUpdater.onClientAppUninstalled(ORIGIN); verifyPermissionReset(); } - /** "Installs" the given package to handle intents for that origin. */ - private void installBrowsableIntentHandler(Origin origin, String packageName) { + /** "Installs" the given package to handle intents for that scope. */ + private void installBrowsableIntentHandler(String scope, String packageName) { Intent intent = new Intent(); intent.setPackage(packageName); - intent.setData(origin.uri()); + intent.setData(Uri.parse(scope)); intent.setAction(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_BROWSABLE); mShadowPackageManager.addResolveInfoForIntent(intent, new ResolveInfo()); } - /** "Installs" a Trusted Web Activity Service for the origin. */ + /** "Installs" a Trusted Web Activity Service for the scope. */ @SuppressWarnings("unchecked") - private void installTrustedWebActivityService(Origin origin, String packageName) { + private void installTrustedWebActivityService(String scope, String packageName) { doAnswer(invocation -> { TrustedWebActivityClient.PermissionCallback callback = invocation.getArgument(1); callback.onPermission(new ComponentName(packageName, "FakeClass"), mLocationPermission); return true; - }).when(mTrustedWebActivityClient).checkLocationPermission(eq(origin), any()); + }) + .when(mTrustedWebActivityClient) + .checkLocationPermission(eq(scope), any()); } - private void uninstallTrustedWebActivityService(Origin origin) { + private void uninstallTrustedWebActivityService(String scope) { doAnswer(invocation -> { TrustedWebActivityClient.PermissionCallback callback = invocation.getArgument(1); callback.onNoTwaFound(); return true; - }).when(mTrustedWebActivityClient).checkLocationPermission(eq(origin), any()); + }) + .when(mTrustedWebActivityClient) + .checkLocationPermission(eq(scope), any()); } private void setLocationPermissionForClient(@ContentSettingValues int settingValue) { @@ -210,9 +224,33 @@ callback.onPermission( new ComponentName(PACKAGE_NAME, "FakeClass"), ContentSettingValues.ALLOW); return true; - }).when(mTrustedWebActivityClient).checkLocationPermission(eq(ORIGIN), any()); + }) + .when(mTrustedWebActivityClient) + .checkLocationPermission(eq(SCOPE), any()); - mLocationPermissionUpdater.checkPermission(ORIGIN, CALLBACK); + mLocationPermissionUpdater.checkPermission(ORIGIN, SCOPE, CALLBACK); verifyPermissionUpdated(PACKAGE_NAME, ContentSettingValues.BLOCK); } + + @Test + @Feature("TrustedWebActivity") + public void permissionNotUpdate_incorrectScope() { + String twaScope = "https://www.website.com/scope"; + String incorrectScope = "https://www.website.com/another"; + + installBrowsableIntentHandler(twaScope, PACKAGE_NAME); + installTrustedWebActivityService(twaScope, PACKAGE_NAME); + setLocationPermissionForClient(ContentSettingValues.ALLOW); + + mLocationPermissionUpdater.checkPermission( + Origin.create(twaScope), incorrectScope, CALLBACK); + + // verify permission not updated. + verify(mPermissionManager, never()) + .updatePermission( + any(), eq(PACKAGE_NAME), eq(ContentSettingsType.GEOLOCATION), anyInt()); + + mLocationPermissionUpdater.checkPermission(Origin.create(twaScope), twaScope, CALLBACK); + verifyPermissionUpdated(PACKAGE_NAME, ContentSettingValues.ALLOW); + } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdaterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdaterTest.java index 55a6ee0..1e78479 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdaterTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/NotificationPermissionUpdaterTest.java
@@ -46,6 +46,7 @@ @LooperMode(LooperMode.Mode.LEGACY) public class NotificationPermissionUpdaterTest { private static final Origin ORIGIN = Origin.create("https://www.website.com"); + private static final String URL = "https://www.website.com"; private static final String PACKAGE_NAME = "com.package.name"; private static final String OTHER_PACKAGE_NAME = "com.other.package.name"; @@ -76,7 +77,7 @@ @Test @Feature("TrustedWebActivities") public void doesntRegister_whenClientDoesntHaveService() { - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionNotUpdated(); } @@ -87,7 +88,7 @@ installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); setNotificationPermission(ContentSettingValues.BLOCK); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionUpdated(ContentSettingValues.BLOCK); } @@ -98,7 +99,7 @@ installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); setNotificationPermission(ContentSettingValues.ALLOW); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionUpdated(ContentSettingValues.ALLOW); } @@ -109,11 +110,11 @@ installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); setNotificationPermission(ContentSettingValues.ALLOW); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionUpdated(ContentSettingValues.ALLOW); setNotificationPermission(ContentSettingValues.BLOCK); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionUpdated(ContentSettingValues.BLOCK); } @@ -122,12 +123,12 @@ public void updatesPermission_onNewClient() { installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); setNotificationPermission(ContentSettingValues.ALLOW); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionUpdated(ContentSettingValues.ALLOW); installTrustedWebActivityService(ORIGIN, OTHER_PACKAGE_NAME); setNotificationPermission(ContentSettingValues.BLOCK); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, OTHER_PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, OTHER_PACKAGE_NAME); verifyPermissionUpdated(OTHER_PACKAGE_NAME, ContentSettingValues.BLOCK); } @@ -137,7 +138,7 @@ installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); setNotificationPermission(ContentSettingValues.ALLOW); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); uninstallTrustedWebActivityService(ORIGIN); mNotificationPermissionUpdater.onClientAppUninstalled(ORIGIN); @@ -152,7 +153,7 @@ installTrustedWebActivityService(ORIGIN, PACKAGE_NAME); setNotificationPermission(ContentSettingValues.ALLOW); - mNotificationPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mNotificationPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionUpdated(ContentSettingValues.ALLOW); // Since we haven't called uninstallTrustedWebActivityService, the Updater sees that @@ -187,7 +188,9 @@ callback.onPermission( new ComponentName(packageName, "FakeClass"), mNotificationPermission); return true; - }).when(mTrustedWebActivityClient).checkNotificationPermission(eq(origin), any()); + }) + .when(mTrustedWebActivityClient) + .checkNotificationPermission(eq(origin.toString()), any()); } private void setNotificationPermission(@ContentSettingValues int permission) { @@ -199,7 +202,9 @@ TrustedWebActivityClient.PermissionCallback callback = invocation.getArgument(1); callback.onNoTwaFound(); return true; - }).when(mTrustedWebActivityClient).checkNotificationPermission(eq(origin), any()); + }) + .when(mTrustedWebActivityClient) + .checkNotificationPermission(eq(origin.toString()), any()); } private void verifyPermissionNotUpdated() {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdaterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdaterTest.java index 7df1bdab..1912b00 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdaterTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/permissiondelegation/PermissionUpdaterTest.java
@@ -38,6 +38,7 @@ @Config(manifest = Config.NONE) public class PermissionUpdaterTest { private static final Origin ORIGIN = Origin.create("https://www.website.com"); + private static final String URL = "https://www.website.com"; private static final String PACKAGE_NAME = "com.package.name"; private static final String OTHER_PACKAGE_NAME = "com.other.package.name"; @@ -68,7 +69,7 @@ @Test @Feature("TrustedWebActivities") public void doesntRegister_whenClientDoesntHandleIntents() { - mPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionNotUpdated(); } @@ -78,7 +79,7 @@ public void doesntRegister_whenOtherClientHandlesIntent() { installBrowsableIntentHandler(ORIGIN, "com.package.other"); - mPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionNotUpdated(); } @@ -88,7 +89,7 @@ public void doesRegister_whenClientHandleIntentCorrectly() { installBrowsableIntentHandler(ORIGIN, PACKAGE_NAME); - mPermissionUpdater.onOriginVerified(ORIGIN, PACKAGE_NAME); + mPermissionUpdater.onOriginVerified(ORIGIN, URL, PACKAGE_NAME); verifyPermissionWillUpdate(); } @@ -106,11 +107,13 @@ private void verifyPermissionNotUpdated() { verify(mPermissionManager, never()).addDelegateApp(any(), anyString()); - verify(mNotificationsPermissionUpdater, never()).onOriginVerified(any(), anyString()); + verify(mNotificationsPermissionUpdater, never()) + .onOriginVerified(any(), any(), anyString()); } private void verifyPermissionWillUpdate() { verify(mPermissionManager).addDelegateApp(eq(ORIGIN), eq(PACKAGE_NAME)); - verify(mNotificationsPermissionUpdater).onOriginVerified(eq(ORIGIN), eq(PACKAGE_NAME)); + verify(mNotificationsPermissionUpdater) + .onOriginVerified(eq(ORIGIN), eq(URL), eq(PACKAGE_NAME)); } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityDisclosureControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityDisclosureControllerTest.java index 54633e9..5d21e24 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityDisclosureControllerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityDisclosureControllerTest.java
@@ -169,11 +169,11 @@ } private void enterVerifiedOrigin() { - setVerificationState(new VerificationState(SCOPE, VerificationStatus.SUCCESS)); + setVerificationState(new VerificationState(SCOPE, SCOPE, VerificationStatus.SUCCESS)); } private void exitVerifiedOrigin() { - setVerificationState(new VerificationState(SCOPE, VerificationStatus.FAILURE)); + setVerificationState(new VerificationState(SCOPE, SCOPE, VerificationStatus.FAILURE)); } private void setVerificationState(VerificationState state) {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityOpenTimeRecorderTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityOpenTimeRecorderTest.java index 32777fd..ec527c4 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityOpenTimeRecorderTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/trustedwebactivity/TrustedWebActivityOpenTimeRecorderTest.java
@@ -216,7 +216,8 @@ } private void setVerificationStatus(@VerificationStatus int status) { - VerificationState newState = new VerificationState("www.example.com", status); + VerificationState newState = + new VerificationState("www.example.com", "www.example.com", status); when(mCurrentPageVerifier.getState()).thenReturn(newState); for (Runnable observer : mVerificationObserverCaptor.getAllValues()) { observer.run();
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/webapps/WebappDisclosureControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/webapps/WebappDisclosureControllerTest.java index a42a8d6..453a21d 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/webapps/WebappDisclosureControllerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/browserservices/ui/controller/webapps/WebappDisclosureControllerTest.java
@@ -175,7 +175,7 @@ } private void setVerificationStatus(@VerificationStatus int status) { - VerificationState state = new VerificationState(SCOPE, status); + VerificationState state = new VerificationState(SCOPE, SCOPE, status); doReturn(state).when(mCurrentPageVerifier).getState(); for (Runnable observer : mVerificationObserverCaptor.getAllValues()) {
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 493df84..f29b725e 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -9836,9 +9836,6 @@ <message name="IDS_SYNC_CONFIRMATION_SYNC_INFO_SIGNIN_INTERCEPT" desc="Information about sync on the sync confirmation dialog in the Signin Intercept flow"> Turn on sync to get your bookmarks, passwords, history, and more on this device and anywhere else you're syncing. </message> - <message name="IDS_SYNC_CONFIRMATION_MANAGE_SYNC_BUTTON_LABEL" desc="Label of the button in the sync confirmation dialog of the Signin Intercept flow to open settings"> - Manage sync - </message> <message name="IDS_SYNC_CONFIRMATION_TURN_ON_SYNC_BUTTON_LABEL" desc="Label of the confirmation button in the sync confirmation dialog of the Signin Intercept flow"> Turn on sync </message> @@ -13370,6 +13367,9 @@ <message name="IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT" desc="The consent text shown to the user before sign up."> To continue, <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">$1<ex>idp.com</ex></ph> will share your name, email address, and profile picture with this site. See this site's <ph name="BEGIN_LINK1">$2</ph>privacy policy<ph name="END_LINK1">$3</ph> and <ph name="BEGIN_LINK2">$4</ph>terms of service<ph name="END_LINK2">$5</ph>. </message> + <message name="IDS_FAILURE_DIALOG_TITLE" desc="Header for failure dialog." translateable="false"> + Failed signing in to <ph name="SITE_ETLD_PLUS_ONE">$1<ex>rp.example</ex></ph> with <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">$2<ex>idp.example</ex></ph> + </message> <message name="IDS_MULTI_IDP_ACCOUNT_SELECTION_SHEET_TITLE_EXPLICIT" desc="Header for sign in sheet when there are multiple identity providers. Sheet is shown to prompt user for sign in consent." translateable="false"> Sign in to <ph name="SITE_ETLD_PLUS_ONE">$1<ex>rp.example</ex></ph> </message>
diff --git a/chrome/app/generated_resources_grd/IDS_SYNC_CONFIRMATION_MANAGE_SYNC_BUTTON_LABEL.png.sha1 b/chrome/app/generated_resources_grd/IDS_SYNC_CONFIRMATION_MANAGE_SYNC_BUTTON_LABEL.png.sha1 deleted file mode 100644 index fdde7d2..0000000 --- a/chrome/app/generated_resources_grd/IDS_SYNC_CONFIRMATION_MANAGE_SYNC_BUTTON_LABEL.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -11db154e7594e1cd147316ad6fecc3b9ab4cfc6a \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 9904987..4db100a 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3672,6 +3672,8 @@ "diagnostics/recon_diagnostics.h", "diagnostics/sqlite_diagnostics.cc", "diagnostics/sqlite_diagnostics.h", + "direct_sockets/chrome_direct_sockets_delegate.cc", + "direct_sockets/chrome_direct_sockets_delegate.h", "download/bubble/download_bubble_controller.cc", "download/bubble/download_bubble_controller.h", "download/bubble/download_bubble_prefs.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 1b4442d7..bcc3296 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2516,6 +2516,8 @@ {features::kFedCmIdpSignoutFieldTrialParamName, "true"}}; const FeatureEntry::FeatureParam kFedCmVariationIframe[] = { {features::kFedCmIframeSupportFieldTrialParamName, "true"}}; +const FeatureEntry::FeatureParam kFedCmVariationIdpSigninStatus[] = { + {features::kFedCmIdpSigninStatusFieldTrialParamName, "true"}}; const FeatureEntry::FeatureVariation kFedCmFeatureVariations[] = { {"- with FedCM auto sign-in", kFedCmVariationAutoSignin, std::size(kFedCmVariationAutoSignin), nullptr}, @@ -2523,6 +2525,8 @@ std::size(kFedCmVariationIdpSignout), nullptr}, {"- with iframe support", kFedCmVariationIframe, std::size(kFedCmVariationIframe), nullptr}, + {"- with FedCM IDP sign-in status", kFedCmVariationIdpSigninStatus, + std::size(kFedCmVariationIdpSigninStatus), nullptr}, }; #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -7088,10 +7092,6 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS_ASH) - {"sync-settings-categorization", - flag_descriptions::kSyncSettingsCategorizationName, - flag_descriptions::kSyncSettingsCategorizationDescription, kOsCrOS, - FEATURE_VALUE_TYPE(chromeos::features::kSyncSettingsCategorization)}, {"os-settings-app-notifications-page", flag_descriptions::kOsSettingsAppNotificationsPageName, flag_descriptions::kOsSettingsAppNotificationsPageDescription, kOsCrOS,
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index 20d9e02..3509d0c 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -1924,41 +1924,33 @@ GetGuestViewManager()->WaitForNumGuestsCreated(2); content::WebContents* embedder = GetEmbedderWebContents(); - auto* unattached_guest = extensions::WebViewGuest::FromWebContents( - GetGuestViewManager()->DeprecatedGetLastGuestCreated()); + auto* unattached_guest = GetGuestViewManager()->GetLastGuestViewCreated(); ASSERT_TRUE(unattached_guest); ASSERT_EQ(embedder, unattached_guest->owner_web_contents()); ASSERT_FALSE(unattached_guest->attached()); ASSERT_FALSE(unattached_guest->embedder_web_contents()); - std::vector<content::WebContents*> guest_contents_list; - GetGuestViewManager()->DeprecatedGetGuestWebContentsList( - &guest_contents_list); - ASSERT_EQ(2u, guest_contents_list.size()); - content::WebContents* other_guest = - (guest_contents_list[0] == unattached_guest->web_contents()) - ? guest_contents_list[1] - : guest_contents_list[0]; + std::vector<content::RenderFrameHost*> guest_rfh_list; + GetGuestViewManager()->GetGuestRenderFrameHostList(&guest_rfh_list); + ASSERT_EQ(2u, guest_rfh_list.size()); + content::RenderFrameHost* unattached_guest_rfh = + unattached_guest->GetGuestMainFrame(); + content::RenderFrameHost* other_guest_rfh = + (guest_rfh_list[0] == unattached_guest_rfh) ? guest_rfh_list[1] + : guest_rfh_list[0]; content::RenderFrameHost* embedder_main_frame = embedder->GetPrimaryMainFrame(); - content::RenderFrameHost* unattached_guest_main_frame = - unattached_guest->web_contents()->GetPrimaryMainFrame(); - content::RenderFrameHost* other_guest_main_frame = - other_guest->GetPrimaryMainFrame(); - - EXPECT_THAT( - content::CollectAllRenderFrameHosts(embedder_main_frame), - testing::UnorderedElementsAre(embedder_main_frame, other_guest_main_frame, - unattached_guest_main_frame)); + EXPECT_THAT(content::CollectAllRenderFrameHosts(embedder_main_frame), + testing::UnorderedElementsAre( + embedder_main_frame, other_guest_rfh, unattached_guest_rfh)); // In either case, GetParentOrOuterDocument does not escape GuestViews. - EXPECT_EQ(nullptr, other_guest_main_frame->GetParentOrOuterDocument()); - EXPECT_EQ(nullptr, unattached_guest_main_frame->GetParentOrOuterDocument()); - EXPECT_EQ(other_guest_main_frame, - other_guest_main_frame->GetOutermostMainFrame()); - EXPECT_EQ(unattached_guest_main_frame, - unattached_guest_main_frame->GetOutermostMainFrame()); + EXPECT_EQ(nullptr, other_guest_rfh->GetParentOrOuterDocument()); + EXPECT_EQ(nullptr, unattached_guest_rfh->GetParentOrOuterDocument()); + EXPECT_EQ(other_guest_rfh, other_guest_rfh->GetOutermostMainFrame()); + EXPECT_EQ(unattached_guest_rfh, + unattached_guest_rfh->GetOutermostMainFrame()); } IN_PROC_BROWSER_TEST_P(WebViewTest, Shim_TestContentLoadEvent) { @@ -4165,21 +4157,18 @@ std::unique_ptr<EmbedderWebContentsObserver> observer( new EmbedderWebContentsObserver(embedder_web_contents)); - content::WebContents* guest_web_contents = GetGuestWebContents(); - ASSERT_TRUE(guest_web_contents); - extensions::WebViewGuest* guest = - extensions::WebViewGuest::FromWebContents(guest_web_contents); - ASSERT_TRUE(guest); + guest_view::GuestViewBase* guest_view = GetGuestView(); + ASSERT_TRUE(guest_view); // Register rule for the guest. Profile* profile = browser()->profile(); int rules_registry_id = extensions::WebViewGuest::GetOrGenerateRulesRegistryID( - guest->owner_web_contents() + guest_view->owner_web_contents() ->GetPrimaryMainFrame() ->GetProcess() ->GetID(), - guest->view_instance_id()); + guest_view->view_instance_id()); extensions::RulesRegistryService* registry_service = extensions::RulesRegistryService::Get(profile); @@ -4211,22 +4200,19 @@ LoadAppWithGuest("web_view/rules_registry"); - content::WebContents* guest_web_contents = GetGuestWebContents(); - ASSERT_TRUE(guest_web_contents); - extensions::WebViewGuest* guest = - extensions::WebViewGuest::FromWebContents(guest_web_contents); - ASSERT_TRUE(guest); + guest_view::GuestViewBase* guest_view = GetGuestView(); + ASSERT_TRUE(guest_view); Profile* profile = browser()->profile(); extensions::RulesRegistryService* registry_service = extensions::RulesRegistryService::Get(profile); int rules_registry_id = extensions::WebViewGuest::GetOrGenerateRulesRegistryID( - guest->owner_web_contents() + guest_view->owner_web_contents() ->GetPrimaryMainFrame() ->GetProcess() ->GetID(), - guest->view_instance_id()); + guest_view->view_instance_id()); // Get an existing registered rule for the guest. extensions::RulesRegistry* registry = @@ -5485,7 +5471,7 @@ identifiability_metrics_test_helper_.PrepareForTest(&run_loop); LoadAppWithGuest("web_view/simple"); - content::WebContents* guest = GetGuestWebContents(); + content::RenderFrameHost* guest = GetGuestView()->GetGuestMainFrame(); const extensions::Extension* extension = LoadExtension(test_data_dir_.AppendASCII("web_accessible_resources")); @@ -5494,30 +5480,25 @@ GURL iframe_url(embedded_test_server()->GetURL("/title1.html")); - std::string setup_iframe_script = base::StringPrintf( - R"( + std::string setup_iframe_script = R"( var iframe = document.createElement('iframe'); iframe.id = 'subframe'; - iframe.src = '%s'; document.body.appendChild(iframe); - )", - iframe_url.spec().c_str()); + )"; EXPECT_TRUE(content::ExecuteScript(guest, setup_iframe_script)); - EXPECT_TRUE(content::WaitForLoadStop(guest)); + content::RenderFrameHost* webview_subframe = ChildFrameAt(guest, 0); + EXPECT_TRUE(content::NavigateToURLFromRenderer(webview_subframe, iframe_url)); // Navigate the subframe to an unrelated extension URL. This shouldn't // terminate the renderer. If it does, this test will fail via // content::NoRendererCrashesAssertion(). - content::TestNavigationObserver load_observer(guest); - EXPECT_TRUE(BeginNavigateIframeToURL(guest, "subframe", extension_url)); - load_observer.Wait(); + webview_subframe = ChildFrameAt(guest, 0); + EXPECT_FALSE( + content::NavigateToURLFromRenderer(webview_subframe, extension_url)); // The navigation should be aborted and the iframe should be left at its old // URL. - EXPECT_FALSE(load_observer.last_navigation_succeeded()); - content::RenderFrameHost* webview_subframe = - ChildFrameAt(guest->GetPrimaryMainFrame(), 0); EXPECT_EQ(webview_subframe->GetLastCommittedURL(), iframe_url); // Check that a proper UKM event was logged for failed extension file access.
diff --git a/chrome/browser/ash/app_mode/kiosk_cryptohome_remover.cc b/chrome/browser/ash/app_mode/kiosk_cryptohome_remover.cc index 9150d032..a9936e3 100644 --- a/chrome/browser/ash/app_mode/kiosk_cryptohome_remover.cc +++ b/chrome/browser/ash/app_mode/kiosk_cryptohome_remover.cc
@@ -103,7 +103,9 @@ } void KioskCryptohomeRemover::CancelDelayedCryptohomeRemoval( - const AccountId& account_id) {} + const AccountId& account_id) { + UnscheduleDelayedCryptohomeRemoval(cryptohome::Identification(account_id)); +} void KioskCryptohomeRemover::RemoveCryptohomesAndExitIfNeeded( const std::vector<AccountId>& account_ids) {
diff --git a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc index f6db24d..ad57a36e 100644 --- a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc +++ b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher.cc
@@ -61,6 +61,15 @@ return; } + // If the installed app is a placeholder (similar to failed installation in + // the old launcher), try to install again to replace it. + if (web_app_provider_->registrar().IsPlaceholderApp( + app_id.value(), web_app::WebAppManagement::Type::kKiosk)) { + SYSLOG(INFO) << "Placeholder app installed. Trying to reinstall..."; + delegate_->InitializeNetwork(); + return; + } + app_id_ = app_id.value(); // Don't enforce network status in web Kiosk if the app is already installed. @@ -80,8 +89,7 @@ // When the install URL redirects to another URL a placeholder will be // installed. This happens if a web app requires authentication. options.install_placeholder = true; - // The placeholder app will be replaced after the install URL can be accessed - // directly (for example after authentication). + // If there is a placeholder app installed, try to reinstall it. options.reinstall_placeholder = true; web_app_provider_->externally_managed_app_manager().Install( options,
diff --git a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc index a6c6c7d..0c7072e3 100644 --- a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc +++ b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc
@@ -51,6 +51,14 @@ namespace { +#define EXEC_AND_WAIT_FOR_CALL(exec, mock, method) \ + ({ \ + base::RunLoop loop; \ + EXPECT_CALL(mock, method).WillOnce(RunClosure(loop.QuitClosure())); \ + exec; \ + loop.Run(); \ + }) + class MockAppLauncherDelegate : public WebKioskAppServiceLauncher::Delegate { public: MockAppLauncherDelegate() = default; @@ -111,6 +119,18 @@ const GURL& install_url = install_options.install_url; const web_app::AppId app_id = web_app::GenerateAppId( /*manifest_id=*/absl::nullopt, start_url); + // Uninstall placeholder if reinstall_placeholder is set to true. + auto placeholder_id = + web_app_provider()->registrar().LookupPlaceholderAppId( + install_url, web_app::WebAppManagement::Type::kKiosk); + if (placeholder_id.has_value()) { + if (install_options.reinstall_placeholder) { + UnregisterApp(placeholder_id.value()); + } else { + return web_app::ExternallyManagedAppManager::InstallResult( + webapps::InstallResultCode::kSuccessAlreadyInstalled); + } + } if (!app_registrar().GetAppById(app_id)) { const auto install_source = install_options.install_source; std::unique_ptr<web_app::WebApp> web_app = @@ -119,9 +139,9 @@ ConvertExternalInstallSourceToSource(install_source)); web_app->SetName(base::UTF16ToUTF8(kAppTitle)); RegisterApp(std::move(web_app)); - web_app::test::AddInstallUrlData(profile()->GetPrefs(), - &sync_bridge(), app_id, - install_url, install_source); + web_app::test::AddInstallUrlAndPlaceholderData( + profile()->GetPrefs(), &sync_bridge(), app_id, install_url, + install_source, this->install_placeholder_); } return web_app::ExternallyManagedAppManager::InstallResult( install_result_code_, app_id); @@ -204,6 +224,16 @@ base::Unretained(this), std::move(app_id))); } + void UnregisterApp(const std::string& app_id) { + std::unique_ptr<web_app::WebAppRegistryUpdate> update = + sync_bridge().BeginUpdate(); + update->DeleteApp(app_id); + sync_bridge().CommitUpdate( + std::move(update), + base::BindOnce(&WebKioskAppServiceLauncherTest::OnAppUnregistered, + base::Unretained(this), std::move(app_id))); + } + apps::AppServiceProxy* app_service() { return app_service_; } apps::AppServiceTest& app_service_test() { return app_service_test_; } @@ -237,12 +267,21 @@ install_result_code_ = result_code; } + void set_install_placeholder(bool install_placeholder) { + install_placeholder_ = install_placeholder; + } + private: void OnAppRegistered(std::string app_id, bool success) { ASSERT_TRUE(success); web_app_provider()->install_manager().NotifyWebAppInstalled(app_id); } + void OnAppUnregistered(std::string app_id, bool success) { + ASSERT_TRUE(success); + web_app_provider()->install_manager().NotifyWebAppUninstalled(app_id); + } + AccountId account_id_; apps::AppServiceTest app_service_test_; @@ -257,75 +296,72 @@ webapps::InstallResultCode install_result_code_ = webapps::InstallResultCode::kSuccessNewInstall; + + bool install_placeholder_ = false; }; TEST_F(WebKioskAppServiceLauncherTest, NormalFlowNotInstalled) { - SetupAppData(/*installed*/ false); - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), InitializeNetwork()) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->Initialize(); - loop.Run(); - } - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), OnAppInstalling()); - EXPECT_CALL(*delegate(), OnAppPrepared()) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->ContinueWithNetworkReady(); - loop.Run(); - } - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), OnAppLaunched()) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->LaunchApp(); - loop.Run(); - } + SetupAppData(/*installed=*/false); + + EXEC_AND_WAIT_FOR_CALL(launcher()->Initialize(), *delegate(), + InitializeNetwork()); + + EXPECT_CALL(*delegate(), OnAppInstalling()); + EXEC_AND_WAIT_FOR_CALL(launcher()->ContinueWithNetworkReady(), *delegate(), + OnAppPrepared()); + + EXEC_AND_WAIT_FOR_CALL(launcher()->LaunchApp(), *delegate(), OnAppLaunched()); EXPECT_EQ(app_data()->status(), WebKioskAppData::Status::kInstalled); EXPECT_EQ(app_data()->launch_url(), kAppLaunchUrl); } TEST_F(WebKioskAppServiceLauncherTest, NormalFlowAlreadyInstalled) { - SetupAppData(/*installed*/ true); - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), OnAppPrepared()) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->Initialize(); - loop.Run(); - } - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), OnAppLaunched()) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->LaunchApp(); - loop.Run(); - } + SetupAppData(/*installed=*/true); + + EXEC_AND_WAIT_FOR_CALL(launcher()->Initialize(), *delegate(), + OnAppPrepared()); + + EXEC_AND_WAIT_FOR_CALL(launcher()->LaunchApp(), *delegate(), OnAppLaunched()); } TEST_F(WebKioskAppServiceLauncherTest, FailedToInstall) { - SetupAppData(/*installed*/ false); - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), InitializeNetwork()) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->Initialize(); - loop.Run(); - } + SetupAppData(/*installed=*/false); + + EXEC_AND_WAIT_FOR_CALL(launcher()->Initialize(), *delegate(), + InitializeNetwork()); + set_install_result_code(webapps::InstallResultCode::kInstallURLLoadFailed); - { - base::RunLoop loop; - EXPECT_CALL(*delegate(), OnAppInstalling()); - EXPECT_CALL(*delegate(), - OnLaunchFailed(KioskAppLaunchError::Error::kUnableToInstall)) - .WillOnce(RunClosure(loop.QuitClosure())); - launcher()->ContinueWithNetworkReady(); - loop.Run(); - } + + EXPECT_CALL(*delegate(), OnAppInstalling()); + EXEC_AND_WAIT_FOR_CALL( + launcher()->ContinueWithNetworkReady(), *delegate(), + OnLaunchFailed(KioskAppLaunchError::Error::kUnableToInstall)); + EXPECT_NE(app_data()->status(), WebKioskAppData::Status::kInstalled); } +TEST_F(WebKioskAppServiceLauncherTest, PlaceholderReplaced) { + set_install_placeholder(true); + SetupAppData(/*installed=*/true); + EXPECT_TRUE(web_app_provider()->registrar().LookupPlaceholderAppId( + GURL(kAppInstallUrl), web_app::WebAppManagement::Type::kKiosk)); + + set_install_placeholder(false); + + EXEC_AND_WAIT_FOR_CALL(launcher()->Initialize(), *delegate(), + InitializeNetwork()); + + EXPECT_CALL(*delegate(), OnAppInstalling()); + EXEC_AND_WAIT_FOR_CALL(launcher()->ContinueWithNetworkReady(), *delegate(), + OnAppPrepared()); + + EXEC_AND_WAIT_FOR_CALL(launcher()->LaunchApp(), *delegate(), OnAppLaunched()); + + EXPECT_EQ(app_data()->status(), WebKioskAppData::Status::kInstalled); + EXPECT_EQ(app_data()->launch_url(), kAppLaunchUrl); + EXPECT_FALSE(web_app_provider()->registrar().LookupPlaceholderAppId( + GURL(kAppInstallUrl), web_app::WebAppManagement::Type::kKiosk)); +} + } // namespace ash
diff --git a/chrome/browser/ash/login/saml/saml_browsertest.cc b/chrome/browser/ash/login/saml/saml_browsertest.cc index ae033c3b..91406807 100644 --- a/chrome/browser/ash/login/saml/saml_browsertest.cc +++ b/chrome/browser/ash/login/saml/saml_browsertest.cc
@@ -185,8 +185,11 @@ constexpr char kAffiliationID[] = "some-affiliation-id"; -// A FakeUserDataAuthClient that stores the salted and hashed secret passed to -// MountEx(). +constexpr char kDeviceTrustMatchHistogramName[] = + "Enterprise.VerifiedAccess.SAML.DeviceTrustMatchesEndpoints"; + +// A FakeUserDataAuthClient that stores the salted and hashed secret passed +// to MountEx(). class SecretInterceptingFakeUserDataAuthClient : public FakeUserDataAuthClient { public: SecretInterceptingFakeUserDataAuthClient(); @@ -2038,6 +2041,8 @@ SAMLDeviceAttestationTest::SetUpInProcessBrowserTestFixture(); stub_install_attributes_.Get()->SetCloudManaged("google.com", "device_id"); } + + base::HistogramTester histogram_tester_; }; // Verify that device attestation is not available when @@ -2108,6 +2113,8 @@ return; } + histogram_tester_.ExpectBucketCount(kDeviceTrustMatchHistogramName, false, 1); + ASSERT_TRUE(fake_saml_idp()->IsLastChallengeResponseExists()); ASSERT_NO_FATAL_FAILURE( fake_saml_idp()->AssertChallengeResponseMatchesTpmResponse()); @@ -2126,6 +2133,8 @@ return; } + histogram_tester_.ExpectTotalCount(kDeviceTrustMatchHistogramName, 0); + ASSERT_FALSE(fake_saml_idp()->IsLastChallengeResponseExists()); } @@ -2142,6 +2151,8 @@ return; } + histogram_tester_.ExpectBucketCount(kDeviceTrustMatchHistogramName, false, 1); + ASSERT_TRUE(fake_saml_idp()->IsLastChallengeResponseExists()); ASSERT_NO_FATAL_FAILURE( fake_saml_idp()->AssertChallengeResponseMatchesTpmResponse()); @@ -2161,6 +2172,8 @@ return; } + histogram_tester_.ExpectBucketCount(kDeviceTrustMatchHistogramName, false, 1); + ASSERT_TRUE(fake_saml_idp()->IsLastChallengeResponseExists()); ASSERT_NO_FATAL_FAILURE( fake_saml_idp()->AssertChallengeResponseMatchesTpmResponse()); @@ -2168,7 +2181,8 @@ // Verify that device attestation is not available for URLs that also match the // ones on the DeviceContextAwareAccessSignalsAllowlist -IN_PROC_BROWSER_TEST_P(SAMLDeviceAttestationEnrolledTest, PolicyCASMatchError) { +IN_PROC_BROWSER_TEST_P(SAMLDeviceAttestationEnrolledTest, + PolicyDeviceTrustMatchError) { SetAllowedUrlsPolicy({fake_saml_idp()->GetIdpHost()}); SetDeviceContextAwareAccessSignalsAllowlistPolicy( {fake_saml_idp()->GetIdpHost()}); @@ -2181,6 +2195,8 @@ return; } + histogram_tester_.ExpectBucketCount(kDeviceTrustMatchHistogramName, true, 1); + ASSERT_FALSE(fake_saml_idp()->IsLastChallengeResponseExists()); } @@ -2207,6 +2223,8 @@ return; } + histogram_tester_.ExpectBucketCount(kDeviceTrustMatchHistogramName, false, 1); + ASSERT_FALSE(fake_saml_idp()->IsLastChallengeResponseExists()); }
diff --git a/chrome/browser/ash/login/screens/hid_detection_screen.cc b/chrome/browser/ash/login/screens/hid_detection_screen.cc index 66aa8e90..df23f46 100644 --- a/chrome/browser/ash/login/screens/hid_detection_screen.cc +++ b/chrome/browser/ash/login/screens/hid_detection_screen.cc
@@ -14,6 +14,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" +#include "base/memory/weak_ptr.h" #include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -28,6 +29,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/device_service.h" #include "device/bluetooth/bluetooth_adapter_factory.h" +#include "services/device/public/mojom/input_service.mojom.h" #include "ui/base/l10n/l10n_util.h" // Enable VLOG level 1. @@ -140,14 +142,11 @@ } } -HIDDetectionScreen::HIDDetectionScreen(HIDDetectionView* view, +HIDDetectionScreen::HIDDetectionScreen(base::WeakPtr<HIDDetectionView> view, const ScreenExitCallback& exit_callback) : BaseScreen(HIDDetectionView::kScreenId, OobeScreenPriority::DEFAULT), - view_(view), + view_(std::move(view)), exit_callback_(exit_callback) { - if (view_) - view_->Bind(this); - if (ash::features::IsOobeHidDetectionRevampEnabled()) { const auto& hid_detection_manager_override = GetHidDetectionManagerOverrideForTesting(); @@ -167,14 +166,11 @@ HIDDetectionScreen::~HIDDetectionScreen() { if (ash::features::IsOobeHidDetectionRevampEnabled()) { - if (view_) - view_->Unbind(); return; } adapter_initially_powered_.reset(); - if (view_) - view_->Unbind(); + if (discovery_session_.get()) discovery_session_->Stop(); if (adapter_.get()) @@ -214,11 +210,6 @@ PowerOff(); } -void HIDDetectionScreen::OnViewDestroyed(HIDDetectionView* view) { - if (view_ == view) - view_ = nullptr; -} - bool HIDDetectionScreen::ShouldEnableContinueButton() { return !pointing_device_id_.empty() || !keyboard_device_id_.empty() || !touchscreen_id_.empty(); @@ -289,17 +280,15 @@ if (adapter_) adapter_->RemoveObserver(this); } - - if (view_) - view_->Hide(); } -void HIDDetectionScreen::OnUserActionDeprecated(const std::string& action_id) { +void HIDDetectionScreen::OnUserAction(const base::Value::List& args) { + const std::string& action_id = args[0].GetString(); if (action_id == kUserActionContinue) { OnContinueButtonClicked(); - } else { - BaseScreen::OnUserActionDeprecated(action_id); + return; } + BaseScreen::OnUserAction(args); } void HIDDetectionScreen::RequestPinCode(device::BluetoothDevice* device) {
diff --git a/chrome/browser/ash/login/screens/hid_detection_screen.h b/chrome/browser/ash/login/screens/hid_detection_screen.h index e9a9fdd4..b80d34d0 100644 --- a/chrome/browser/ash/login/screens/hid_detection_screen.h +++ b/chrome/browser/ash/login/screens/hid_detection_screen.h
@@ -48,7 +48,7 @@ using ScreenExitCallback = base::RepeatingCallback<void(Result result)>; - HIDDetectionScreen(HIDDetectionView* view, + HIDDetectionScreen(base::WeakPtr<HIDDetectionView> view, const ScreenExitCallback& exit_callback); HIDDetectionScreen(const HIDDetectionScreen&) = delete; @@ -63,9 +63,6 @@ // Also different testing flags might forcefully skip the screen static bool CanShowScreen(); - // This method is called when the view is being destroyed. - void OnViewDestroyed(HIDDetectionView* view); - // Checks if this screen should be displayed. `on_check_done` should be // invoked with the result; true if the screen should be displayed, false // otherwise. @@ -95,7 +92,7 @@ bool MaybeSkip(WizardContext& context) override; void ShowImpl() override; void HideImpl() override; - void OnUserActionDeprecated(const std::string& action_id) override; + void OnUserAction(const base::Value::List& args) override; // device::BluetoothDevice::PairingDelegate: void RequestPinCode(device::BluetoothDevice* device) override; @@ -228,7 +225,7 @@ scoped_refptr<device::BluetoothAdapter> GetAdapterForTesting(); void SetAdapterInitialPoweredForTesting(bool powered); - HIDDetectionView* view_; + base::WeakPtr<HIDDetectionView> view_; const ScreenExitCallback exit_callback_; absl::optional<Result> exit_result_for_testing_;
diff --git a/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc b/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc index e43bf803..ef671fb2 100644 --- a/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/hid_detection_screen_browsertest.cc
@@ -128,8 +128,9 @@ HIDDetectionScreen* hid_detection_screen() { return hid_detection_screen_; } HIDDetectionScreenHandler* handler() { - return static_cast<HIDDetectionScreenHandler*>( - hid_detection_screen()->view_); + return LoginDisplayHost::default_host() + ->GetOobeUI() + ->GetHandler<HIDDetectionScreenHandler>(); } void ContinueToWelcomeScreen() {
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index b991133..21dd0dd 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -658,7 +658,7 @@ if (HIDDetectionScreen::CanShowScreen()) { append(std::make_unique<HIDDetectionScreen>( - oobe_ui->GetView<HIDDetectionScreenHandler>(), + oobe_ui->GetView<HIDDetectionScreenHandler>()->AsWeakPtr(), base::BindRepeating(&WizardController::OnHidDetectionScreenExit, weak_factory_.GetWeakPtr()))); } @@ -1543,12 +1543,8 @@ case EnrollmentScreen::Result::BACK: case EnrollmentScreen::Result::SKIPPED_FOR_TESTS: PerformOOBECompletedActions(); - if (prescribed_enrollment_config_.is_forced()) { - LOG(WARNING) << "User trying to skip enrollment screen"; - ShowPackagedLicenseScreen(); - } else { - ShowLoginScreen(); - } + DCHECK(!prescribed_enrollment_config_.is_forced()); + ShowLoginScreen(); break; case EnrollmentScreen::Result::TPM_ERROR: DCHECK(switches::IsTpmDynamic());
diff --git a/chrome/browser/ash/policy/dlp/dlp_files_controller.cc b/chrome/browser/ash/policy/dlp/dlp_files_controller.cc index 59ad85d..9e6338e 100644 --- a/chrome/browser/ash/policy/dlp/dlp_files_controller.cc +++ b/chrome/browser/ash/policy/dlp/dlp_files_controller.cc
@@ -8,6 +8,7 @@ #include <iterator> #include <memory> #include <string> +#include <vector> #include "base/bind.h" #include "base/check.h" @@ -19,6 +20,7 @@ #include "base/ranges/algorithm.h" #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/file_manager/path_util.h" +#include "chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h" #include "chrome/browser/chromeos/policy/dlp/dlp_reporting_manager.h" #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h" #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.h" @@ -27,6 +29,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chromeos/dbus/dlp/dlp_client.h" #include "chromeos/dbus/dlp/dlp_service.pb.h" +#include "chromeos/ui/base/file_icon_util.h" #include "storage/browser/file_system/file_system_url.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h" @@ -321,6 +324,7 @@ std::vector<FileDaemonInfo> restricted_files; std::vector<FileDaemonInfo> warned_files; + DlpConfidentialContents dialog_files; for (const auto& file : transferred_files) { DlpRulesManager::Level level; if (dst_component.has_value()) { @@ -340,10 +344,17 @@ DlpFileDestination(*destination.url_or_path), level); } - if (level == DlpRulesManager::Level::kBlock) + if (level == DlpRulesManager::Level::kBlock) { restricted_files.push_back(file); - else if (level == DlpRulesManager::Level::kWarn) + } else if (level == DlpRulesManager::Level::kWarn) { warned_files.push_back(file); + if (files_action != DlpWarnDialog::FilesAction::kDownload) { + dialog_files.Add( + // TODO(crbug.com/1357593): Pass the proper |dark_background| + chromeos::GetIconForPath(file.path, /*dark_background=*/false), + file.path.BaseName().LossyDisplayName(), GURL(file.source_url)); + } + } } if (warned_files.empty()) { std::move(result_callback).Run(std::move(restricted_files)); @@ -355,7 +366,7 @@ weak_ptr_factory_.GetWeakPtr(), std::move(restricted_files), std::move(warned_files), std::move(result_callback)), - files_action); + std::move(dialog_files), files_action); } std::vector<DlpFilesController::DlpFileRestrictionDetails>
diff --git a/chrome/browser/ash/policy/dlp/dlp_files_controller.h b/chrome/browser/ash/policy/dlp/dlp_files_controller.h index 1e097a1..e3f1c88d 100644 --- a/chrome/browser/ash/policy/dlp/dlp_files_controller.h +++ b/chrome/browser/ash/policy/dlp/dlp_files_controller.h
@@ -9,6 +9,7 @@ #include "base/callback_forward.h" #include "base/containers/flat_map.h" +#include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h" #include "chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.h"
diff --git a/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc b/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc index 90d31ab..5f1d7cf6 100644 --- a/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_files_controller_unittest.cc
@@ -15,6 +15,7 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_refptr.h" +#include "base/strings/utf_string_conversions.h" #include "base/test/mock_callback.h" #include "base/test/test_future.h" #include "chrome/browser/ash/crostini/crostini_manager.h" @@ -39,6 +40,7 @@ #include "chromeos/ash/components/dbus/seneschal/seneschal_client.h" #include "chromeos/dbus/dlp/dlp_client.h" #include "chromeos/dbus/dlp/dlp_service.pb.h" +#include "chromeos/ui/base/file_icon_util.h" #include "components/drive/drive_pref_names.h" #include "components/user_manager/scoped_user_manager.h" #include "content/public/test/browser_task_environment.h" @@ -69,10 +71,37 @@ constexpr char kExample3[] = "https://example3.com/"; constexpr char kExampleNotRestricted[] = "https://example4.com/"; +constexpr char kFilePath1[] = "test1.txt"; +constexpr char kFilePath2[] = "test2.txt"; +constexpr char kFilePath3[] = "test3.txt"; + bool CreateDummyFile(const base::FilePath& path) { return WriteFile(path, "42", sizeof("42")) == sizeof("42"); } +struct DialogChoiceResult { + DialogChoiceResult(bool should_action_proceed, + std::vector<std::string> disallowed_file_sources) + : should_action_proceed(should_action_proceed), + disallowed_file_sources(disallowed_file_sources) {} + + bool should_action_proceed; + std::vector<std::string> disallowed_file_sources; +}; + +struct FilesTransferInfo { + FilesTransferInfo(DlpWarnDialog::FilesAction files_action, + std::vector<std::string> file_sources, + std::vector<std::string> file_paths) + : files_action(files_action), + file_sources(file_sources), + file_paths(file_paths) {} + + DlpWarnDialog::FilesAction files_action; + std::vector<std::string> file_sources; + std::vector<std::string> file_paths; +}; + } // namespace using MockIsFilesTransferRestrictedCallback = testing::StrictMock< @@ -163,21 +192,21 @@ const base::FilePath path = temp_dir_.GetPath(); - const base::FilePath file1 = path.AppendASCII("test1.txt"); + const base::FilePath file1 = path.AppendASCII(kFilePath1); ASSERT_TRUE(CreateDummyFile(file1)); dlp::AddFileRequest add_file_req1; add_file_req1.set_file_path(file1.value()); add_file_req1.set_source_url(kExample1); chromeos::DlpClient::Get()->AddFile(add_file_req1, add_file_cb.Get()); - const base::FilePath file2 = path.AppendASCII("test2.txt"); + const base::FilePath file2 = path.AppendASCII(kFilePath2); ASSERT_TRUE(CreateDummyFile(file2)); dlp::AddFileRequest add_file_req2; add_file_req2.set_file_path(file2.value()); add_file_req2.set_source_url(kExample2); chromeos::DlpClient::Get()->AddFile(add_file_req2, add_file_cb.Get()); - const base::FilePath file3 = path.AppendASCII("test3.txt"); + const base::FilePath file3 = path.AppendASCII(kFilePath3); ASSERT_TRUE(CreateDummyFile(file3)); dlp::AddFileRequest add_file_req3; add_file_req3.set_file_path(file3.value()); @@ -751,24 +780,24 @@ } } -class DlpFilesWarningDialogTest +class DlpFilesWarningDialogChoiceTest : public DlpFilesControllerTest, - public ::testing::WithParamInterface< - std::tuple<bool, std::vector<std::string>>> {}; + public ::testing::WithParamInterface<DialogChoiceResult> {}; INSTANTIATE_TEST_SUITE_P( DlpFiles, - DlpFilesWarningDialogTest, + DlpFilesWarningDialogChoiceTest, ::testing::Values( - std::make_tuple(true, std::vector<std::string>({kExample1})), - std::make_tuple(false, - std::vector<std::string>({kExample1, kExample2})))); + DialogChoiceResult(/*should_action_proceed=*/true, + std::vector<std::string>({kExample1})), + DialogChoiceResult(/*should_action_proceed=*/false, + std::vector<std::string>({kExample1, kExample2})))); -TEST_P(DlpFilesWarningDialogTest, +TEST_P(DlpFilesWarningDialogChoiceTest, IsFilesTransferRestricted_FileDownloadWarned) { - auto [should_proceed, disallowed_sources_str] = GetParam(); + auto choice_result = GetParam(); std::vector<DlpFilesController::FileDaemonInfo> disallowed_files; - for (const auto& source : disallowed_sources_str) + for (const auto& source : choice_result.disallowed_file_sources) disallowed_files.emplace_back(base::FilePath(), source); std::vector<DlpFilesController::FileDaemonInfo> transferred_files( {{base::FilePath(), kExample1}, @@ -785,7 +814,8 @@ base::FilePath(file_manager::util::kRemovableMediaPath))); std::unique_ptr<MockDlpWarnNotifier> wrapper = - std::make_unique<MockDlpWarnNotifier>(should_proceed); + std::make_unique<MockDlpWarnNotifier>( + choice_result.should_action_proceed); MockDlpWarnNotifier* mock_dlp_warn_notifier = wrapper.get(); files_controller_->SetWarnNotifierForTesting(std::move(wrapper)); @@ -813,4 +843,84 @@ storage::ExternalMountPoints::GetSystemInstance()->RevokeAllFileSystems(); } +class DlpFilesWarningDialogContentTest + : public DlpFilesControllerTest, + public ::testing::WithParamInterface<FilesTransferInfo> {}; + +INSTANTIATE_TEST_SUITE_P( + DlpFiles, + DlpFilesWarningDialogContentTest, + ::testing::Values( + FilesTransferInfo(DlpWarnDialog::FilesAction::kDownload, + std::vector<std::string>({kExample1}), + std::vector<std::string>({kFilePath1})), + FilesTransferInfo(DlpWarnDialog::FilesAction::kTransfer, + std::vector<std::string>({kExample1}), + std::vector<std::string>({kFilePath1})), + FilesTransferInfo(DlpWarnDialog::FilesAction::kTransfer, + std::vector<std::string>({kExample1, kExample2}), + std::vector<std::string>({kFilePath1, kFilePath2})))); + +TEST_P(DlpFilesWarningDialogContentTest, + IsFilesTransferRestricted_WarningDialogContent) { + auto transfer_info = GetParam(); + std::vector<DlpFilesController::FileDaemonInfo> warned_files; + for (int i = 0; i < transfer_info.file_sources.size(); ++i) { + warned_files.emplace_back(base::FilePath(transfer_info.file_paths[i]), + transfer_info.file_sources[i]); + } + storage::ExternalMountPoints* mount_points = + storage::ExternalMountPoints::GetSystemInstance(); + ASSERT_TRUE(mount_points); + mount_points->RevokeAllFileSystems(); + ASSERT_TRUE(mount_points->RegisterFileSystem( + chromeos::kSystemMountNameRemovable, storage::kFileSystemTypeLocal, + storage::FileSystemMountOption(), + base::FilePath(file_manager::util::kRemovableMediaPath))); + AddFilesToDlpClient(); + + std::unique_ptr<MockDlpWarnNotifier> wrapper = + std::make_unique<MockDlpWarnNotifier>(false); + MockDlpWarnNotifier* mock_dlp_warn_notifier = wrapper.get(); + files_controller_->SetWarnNotifierForTesting(std::move(wrapper)); + DlpConfidentialContents expected_contents; + + if (transfer_info.files_action != DlpWarnDialog::FilesAction::kDownload) { + for (int i = 0; i < transfer_info.file_sources.size(); ++i) { + expected_contents.Add( + chromeos::GetIconForPath( + base::FilePath(std::string(transfer_info.file_paths[i])), + /*dark_background=*/false), + base::UTF8ToUTF16(transfer_info.file_paths[i]), + GURL(transfer_info.file_sources[i])); + } + } + DlpWarnDialog::DlpWarnDialogOptions expected_dialog_options( + DlpWarnDialog::Restriction::kFiles, expected_contents, + transfer_info.files_action); + + EXPECT_CALL(*rules_manager_, + IsRestrictedComponent(_, DlpRulesManager::Component::kUsb, _, _)) + .WillRepeatedly(testing::Return(DlpRulesManager::Level::kWarn)); + + EXPECT_CALL(*mock_dlp_warn_notifier, + ShowDlpWarningDialog(_, expected_dialog_options)) + .Times(1); + + MockIsFilesTransferRestrictedCallback cb; + EXPECT_CALL(cb, Run(warned_files)).Times(1); + + auto dst_url = mount_points->CreateExternalFileSystemURL( + blink::StorageKey(), "removable", + base::FilePath("MyUSB/path/in/removable")); + ASSERT_TRUE(dst_url.is_valid()); + + files_controller_->IsFilesTransferRestricted( + warned_files, + DlpFilesController::DlpFileDestination(dst_url.path().value()), + transfer_info.files_action, cb.Get()); + + storage::ExternalMountPoints::GetSystemInstance()->RevokeAllFileSystems(); +} + } // namespace policy
diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index c11b4edc..5b0f52bf 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc
@@ -659,9 +659,9 @@ const std::string& app_id) { if (!prefs_) return false; - const base::Value* contents = - prefs_->GetDictionary(prefs::kRegisteredBackgroundContents); - return contents->FindKey(app_id); + const base::Value::Dict& contents = + prefs_->GetValueDict(prefs::kRegisteredBackgroundContents); + return contents.Find(app_id); } void BackgroundContentsService::UnregisterBackgroundContents(
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index c69f485..c65ff3c0 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -443,6 +443,7 @@ #if !BUILDFLAG(IS_ANDROID) #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" #include "chrome/browser/devtools/devtools_window.h" +#include "chrome/browser/direct_sockets/chrome_direct_sockets_delegate.h" #include "chrome/browser/media/unified_autoplay_config.h" #include "chrome/browser/new_tab_page/new_tab_page_util.h" #include "chrome/browser/page_info/about_this_site_side_panel_throttle.h" @@ -1601,6 +1602,13 @@ content::StoragePartitionConfig::CreateDefault(browser_context); #if BUILDFLAG(ENABLE_EXTENSIONS) + if (site.SchemeIs(extensions::kExtensionScheme)) { + // The host in an extension site URL is the extension_id. + CHECK(site.has_host()); + return extensions::util::GetStoragePartitionConfigForExtensionId( + site.host(), browser_context); + } + // TODO(crbug.com/1212263): Isolated PWAs are tracked by origin, but this // function takes a site, so it will only work correctly when the site equals // the full origin. @@ -1617,13 +1625,6 @@ /*partition_name=*/std::string(), /*in_memory=*/false); } - - if (site.SchemeIs(extensions::kExtensionScheme)) { - // The host in an extension site URL is the extension_id. - CHECK(site.has_host()); - return extensions::util::GetStoragePartitionConfigForExtensionId( - site.host(), browser_context); - } #endif return storage_partition_config; @@ -2053,11 +2054,17 @@ #endif } -blink::ParsedPermissionsPolicy +absl::optional<blink::ParsedPermissionsPolicy> ChromeContentBrowserClient::GetPermissionsPolicyForIsolatedApp( content::BrowserContext* browser_context, const url::Origin& app_origin) { #if !BUILDFLAG(IS_ANDROID) + // Extensions are exempt from manifest policy enforcement and retain the + // default frame permissions policy. + if (app_origin.scheme() == extensions::kExtensionScheme) { + return absl::nullopt; + } + Profile* profile = Profile::FromBrowserContext(browser_context); auto& registrar = web_app::WebAppProvider::GetForWebApps(profile)->registrar(); @@ -2211,6 +2218,11 @@ content::BrowserContext* browser_context, const GURL& url) { #if BUILDFLAG(ENABLE_EXTENSIONS) + if (url.SchemeIs(extensions::kExtensionScheme)) { + return !!extensions::ExtensionRegistry::Get(browser_context) + ->enabled_extensions() + .GetExtensionOrAppByURL(url); + } if (content::SiteIsolationPolicy::IsApplicationIsolationLevelEnabled()) { Profile* profile = Profile::FromBrowserContext(browser_context); return web_app::GetStorageIsolationKey(profile->GetPrefs(), @@ -5733,6 +5745,14 @@ return usb_delegate_.get(); } +content::DirectSocketsDelegate* +ChromeContentBrowserClient::GetDirectSocketsDelegate() { + if (!direct_sockets_delegate_) { + direct_sockets_delegate_ = std::make_unique<ChromeDirectSocketsDelegate>(); + } + return direct_sockets_delegate_.get(); +} + content::WebAuthenticationDelegate* ChromeContentBrowserClient::GetWebAuthenticationDelegate() { if (!web_authentication_delegate_) {
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 8c66311..7daca68 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -97,6 +97,7 @@ enum class Channel; } // namespace version_info +class ChromeDirectSocketsDelegate; class ChromeHidDelegate; class ChromeSerialDelegate; class ChromeUsbDelegate; @@ -205,9 +206,9 @@ const GURL& site_url) override; bool MayReuseHost(content::RenderProcessHost* process_host) override; size_t GetProcessCountToIgnoreForLimit() override; - blink::ParsedPermissionsPolicy GetPermissionsPolicyForIsolatedApp( - content::BrowserContext* browser_context, - const url::Origin& app_origin) override; + absl::optional<blink::ParsedPermissionsPolicy> + GetPermissionsPolicyForIsolatedApp(content::BrowserContext* browser_context, + const url::Origin& app_origin) override; bool ShouldTryToUseExistingProcessHost( content::BrowserContext* browser_context, const GURL& url) override; @@ -614,6 +615,7 @@ content::SerialDelegate* GetSerialDelegate() override; content::HidDelegate* GetHidDelegate() override; content::UsbDelegate* GetUsbDelegate() override; + content::DirectSocketsDelegate* GetDirectSocketsDelegate() override; content::WebAuthenticationDelegate* GetWebAuthenticationDelegate() override; std::unique_ptr<content::AuthenticatorRequestClientDelegate> GetWebAuthenticationRequestDelegate( @@ -920,6 +922,7 @@ #if !BUILDFLAG(IS_ANDROID) std::unique_ptr<ChromeSerialDelegate> serial_delegate_; std::unique_ptr<ChromeHidDelegate> hid_delegate_; + std::unique_ptr<ChromeDirectSocketsDelegate> direct_sockets_delegate_; std::unique_ptr<ChromeWebAuthenticationDelegate> web_authentication_delegate_; #endif std::unique_ptr<permissions::BluetoothDelegateImpl> bluetooth_delegate_;
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc index 2c5c3f31..e1fc995 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc +++ b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.cc
@@ -59,6 +59,11 @@ title(window->GetTitle()), url(GetWithoutRef(url)) {} +DlpConfidentialContent::DlpConfidentialContent(const gfx::ImageSkia& icon, + const std::u16string& title, + const GURL& url) + : icon(icon), title(title), url(url) {} + DlpConfidentialContent::DlpConfidentialContent( const DlpConfidentialContent& other) = default; DlpConfidentialContent& DlpConfidentialContent::operator=( @@ -127,6 +132,12 @@ contents_.insert(DlpConfidentialContent(window, url)); } +void DlpConfidentialContents::Add(const gfx::ImageSkia& icon, + const std::u16string& title, + const GURL& url) { + contents_.insert(DlpConfidentialContent(icon, title, url)); +} + void DlpConfidentialContents::ClearAndAdd(content::WebContents* web_contents) { contents_.clear(); Add(web_contents);
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h index bb557b17..6401f45 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h +++ b/chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h
@@ -39,6 +39,9 @@ // Constructs DlpConfidentialContent from the title and icon obtained from // |window|, which cannot be null and |url|. DlpConfidentialContent(aura::Window* window, const GURL& url); + DlpConfidentialContent(const gfx::ImageSkia& icon, + const std::u16string& title, + const GURL& url); DlpConfidentialContent(const DlpConfidentialContent& other); DlpConfidentialContent& operator=(const DlpConfidentialContent& other); ~DlpConfidentialContent() = default; @@ -101,6 +104,10 @@ void Add(content::WebContents* web_contents); // Same for |window| and |url| pair. void Add(aura::Window* window, const GURL& url); + // Same for |icon|, |title| and |url|. + void Add(const gfx::ImageSkia& icon, + const std::u16string& title, + const GURL& url); // Removes all stored confidential content, if there was any, and adds // |web_contents| converted to a DlpConfidentialContent.
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.cc b/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.cc index d3a015c7..eb0ecf61 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.cc +++ b/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.cc
@@ -99,7 +99,8 @@ switch (files_action) { case DlpWarnDialog::FilesAction::kDownload: return l10n_util::GetPluralStringFUTF16( - IDS_POLICY_DLP_FILES_DOWNLOAD_WARN_TITLE, files_number); + // Download action is only allowed for one file. + IDS_POLICY_DLP_FILES_DOWNLOAD_WARN_TITLE, 1); case DlpWarnDialog::FilesAction::kTransfer: return l10n_util::GetPluralStringFUTF16( IDS_POLICY_DLP_FILES_TRANSFER_WARN_TITLE, files_number); @@ -113,15 +114,16 @@ case DlpWarnDialog::FilesAction::kDownload: return base::ReplaceStringPlaceholders( l10n_util::GetPluralStringFUTF16( - IDS_POLICY_DLP_FILES_DOWNLOAD_WARN_MESSAGE, files_number), - // TODO(crbug.com/1350978) Change to the actual destination string + // Download action is only allowed for one file. + IDS_POLICY_DLP_FILES_DOWNLOAD_WARN_MESSAGE, 1), + // TODO(crbug.com/1350978) Change to the actual destination string. u"External storage", /*offset=*/nullptr); case DlpWarnDialog::FilesAction::kTransfer: return base::ReplaceStringPlaceholders( l10n_util::GetPluralStringFUTF16( IDS_POLICY_DLP_FILES_TRANSFER_WARN_MESSAGE, files_number), - // TODO(crbug.com/1350978) Change to the actual destination string + // TODO(crbug.com/1350978) Change to the actual destination string. u"External storage", /*offset=*/nullptr); } @@ -178,8 +180,9 @@ return l10n_util::GetStringUTF16(IDS_POLICY_DLP_SCREEN_SHARE_WARN_TITLE); case DlpWarnDialog::Restriction::kFiles: DCHECK(options.files_action.has_value()); - // TODO(crbug.com/1351744) Pass the number of files - return GetTitleForFiles(options.files_action.value(), 1); + return GetTitleForFiles( + options.files_action.value(), + options.confidential_contents.GetContents().size()); } } @@ -201,8 +204,9 @@ options.application_title.value()); case DlpWarnDialog::Restriction::kFiles: DCHECK(options.files_action.has_value()); - // TODO(crbug.com/1351744) Pass the number of files - return GetMessageForFiles(options.files_action.value(), 1); + return GetMessageForFiles( + options.files_action.value(), + options.confidential_contents.GetContents().size()); } } @@ -365,8 +369,11 @@ DlpWarnDialog::DlpWarnDialogOptions::DlpWarnDialogOptions( Restriction restriction, + DlpConfidentialContents confidential_contents, FilesAction files_action) - : restriction(restriction), files_action(files_action) {} + : restriction(restriction), + confidential_contents(confidential_contents), + files_action(files_action) {} DlpWarnDialog::DlpWarnDialogOptions::DlpWarnDialogOptions( const DlpWarnDialogOptions& other) = default;
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.h b/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.h index 38fae7e..0e43be7 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.h +++ b/chrome/browser/chromeos/policy/dlp/dlp_warn_dialog.h
@@ -52,7 +52,9 @@ DlpWarnDialogOptions(Restriction restriction, DlpConfidentialContents confidential_contents, const std::u16string& application_title); - DlpWarnDialogOptions(Restriction restriction, FilesAction files_action); + DlpWarnDialogOptions(Restriction restriction, + DlpConfidentialContents confidential_contents, + FilesAction files_action); DlpWarnDialogOptions(const DlpWarnDialogOptions& other); DlpWarnDialogOptions& operator=(const DlpWarnDialogOptions& other); ~DlpWarnDialogOptions();
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.cc b/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.cc index 1ef21d7b..6b58f503 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.cc +++ b/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.cc
@@ -54,10 +54,12 @@ void DlpWarnNotifier::ShowDlpFilesWarningDialog( OnDlpRestrictionCheckedCallback callback, + const DlpConfidentialContents& confidential_contents, DlpWarnDialog::FilesAction files_action) { - ShowDlpWarningDialog(std::move(callback), - DlpWarnDialog::DlpWarnDialogOptions( - DlpWarnDialog::Restriction::kFiles, files_action)); + ShowDlpWarningDialog( + std::move(callback), + DlpWarnDialog::DlpWarnDialogOptions(DlpWarnDialog::Restriction::kFiles, + confidential_contents, files_action)); } base::WeakPtr<views::Widget> DlpWarnNotifier::ShowDlpScreenShareWarningDialog(
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.h b/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.h index f66e31f..ed9b8383 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.h +++ b/chrome/browser/chromeos/policy/dlp/dlp_warn_notifier.h
@@ -47,10 +47,12 @@ const DlpConfidentialContents& confidential_contents); // Shows a warning dialog that informs the user that |files_action| on - // selected files is not recommended. Calls |callback| and passes user's - // choice of whether to proceed or not. - void ShowDlpFilesWarningDialog(OnDlpRestrictionCheckedCallback callback, - DlpWarnDialog::FilesAction files_action); + // selected |confidential_contents| files is not recommended. Calls |callback| + // and passes user's choice of whether to proceed or not. + void ShowDlpFilesWarningDialog( + OnDlpRestrictionCheckedCallback callback, + const DlpConfidentialContents& confidential_contents, + DlpWarnDialog::FilesAction files_action); // Shows a warning dialog that informs the user that screen sharing is not // recommended due to |confidential_contents| visible. Calls |callback| and
diff --git a/chrome/browser/device_reauth/mac/biometric_authenticator_mac.mm b/chrome/browser/device_reauth/mac/biometric_authenticator_mac.mm index 347f62a..ac864e4b 100644 --- a/chrome/browser/device_reauth/mac/biometric_authenticator_mac.mm +++ b/chrome/browser/device_reauth/mac/biometric_authenticator_mac.mm
@@ -5,6 +5,7 @@ #include "chrome/browser/device_reauth/mac/biometric_authenticator_mac.h" #include "base/bind.h" +#include "base/metrics/histogram_functions.h" #include "base/notreached.h" #include "components/device_reauth/biometric_authenticator.h" #include "device/fido/mac/touch_id_context.h" @@ -16,9 +17,12 @@ bool BiometricAuthenticatorMac::CanAuthenticate( device_reauth::BiometricAuthRequester requester) { base::scoped_nsobject<LAContext> context([[LAContext alloc] init]); - return + bool is_available = [context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]; + base::UmaHistogramBoolean("PasswordManager.CanUseBiometricsMac", + is_available); + return is_available; } void BiometricAuthenticatorMac::Authenticate(
diff --git a/chrome/browser/devtools/devtools_browsertest.cc b/chrome/browser/devtools/devtools_browsertest.cc index 003f9dbe..69bdf72 100644 --- a/chrome/browser/devtools/devtools_browsertest.cc +++ b/chrome/browser/devtools/devtools_browsertest.cc
@@ -142,8 +142,6 @@ const char kDebuggerTestPage[] = "/devtools/debugger_test_page.html"; const char kPauseWhenLoadingDevTools[] = "/devtools/pause_when_loading_devtools.html"; -const char kPauseWhenScriptIsRunning[] = - "/devtools/pause_when_script_is_running.html"; const char kPageWithContentScript[] = "/devtools/page_with_content_script.html"; const char kNavigateBackTestPage[] = "/devtools/navigate_back.html"; const char kWindowOpenTestPage[] = "/devtools/window_open.html"; @@ -1742,24 +1740,6 @@ RunTest("testPauseWhenLoadingDevTools", kPauseWhenLoadingDevTools); } -// Tests that pressing 'Pause' will pause script execution if the script -// is already running. -#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ - defined(ARCH_CPU_ARM_FAMILY) -// Timing out on linux ARM bot: https://crbug/238453 -#define MAYBE_TestPauseWhenScriptIsRunning DISABLED_TestPauseWhenScriptIsRunning -#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -// Timing out on Linux and ChromeOS MSan: https://crbug.com/1181692 -// Flaky failures: https://crbug/1289529 -#define MAYBE_TestPauseWhenScriptIsRunning DISABLED_TestPauseWhenScriptIsRunning -#else -#define MAYBE_TestPauseWhenScriptIsRunning TestPauseWhenScriptIsRunning -#endif -IN_PROC_BROWSER_TEST_F(DevToolsTest, - MAYBE_TestPauseWhenScriptIsRunning) { - RunTest("testPauseWhenScriptIsRunning", kPauseWhenScriptIsRunning); -} - // Tests network timing. IN_PROC_BROWSER_TEST_F(DevToolsTest, TestNetworkTiming) { RunTest("testNetworkTiming", kSlowTestPage);
diff --git a/chrome/browser/direct_sockets/OWNERS b/chrome/browser/direct_sockets/OWNERS new file mode 100644 index 0000000..4167a28 --- /dev/null +++ b/chrome/browser/direct_sockets/OWNERS
@@ -0,0 +1 @@ +file://third_party/blink/renderer/modules/direct_sockets/OWNERS \ No newline at end of file
diff --git a/chrome/browser/direct_sockets/chrome_direct_sockets_delegate.cc b/chrome/browser/direct_sockets/chrome_direct_sockets_delegate.cc new file mode 100644 index 0000000..9384843c --- /dev/null +++ b/chrome/browser/direct_sockets/chrome_direct_sockets_delegate.cc
@@ -0,0 +1,55 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/direct_sockets/chrome_direct_sockets_delegate.h" + +#include "content/public/browser/render_frame_host.h" +#include "content/public/common/socket_permission_request.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/common/api/sockets/sockets_manifest_data.h" +#include "extensions/common/constants.h" +#include "url/gurl.h" + +namespace { + +bool IsExtensionFrame(content::RenderFrameHost* frame) { + return frame->GetLastCommittedURL().SchemeIs(extensions::kExtensionScheme); +} + +const extensions::Extension* GetExtensionFromFrame( + content::RenderFrameHost* frame) { + return extensions::ExtensionRegistry::Get(frame->GetBrowserContext()) + ->enabled_extensions() + .GetExtensionOrAppByURL(frame->GetLastCommittedURL()); +} + +} // namespace + +bool ChromeDirectSocketsDelegate::ValidateAddressAndPort( + content::RenderFrameHost* frame, + const std::string& address, + uint16_t port, + blink::mojom::DirectSocketProtocolType protocol) const { + if (!IsExtensionFrame(frame)) { + return true; + } + + // If we're running an extension, follow the chrome.sockets.* permission + // model. + auto* extension = GetExtensionFromFrame(frame); + DCHECK(extension); + content::SocketPermissionRequest param( + protocol == blink::mojom::DirectSocketProtocolType::kTcp + ? content::SocketPermissionRequest::TCP_CONNECT + : content::SocketPermissionRequest::UDP_SEND_TO, + address, port); + return extensions::SocketsManifestData::CheckRequest(extension, param); +} + +bool ChromeDirectSocketsDelegate::ShouldSkipPostResolveChecks( + content::RenderFrameHost* frame) const { + // chrome.sockets.* doesn't have any restrictions on resolved addresses, so we + // may skip these checks. + return IsExtensionFrame(frame); +}
diff --git a/chrome/browser/direct_sockets/chrome_direct_sockets_delegate.h b/chrome/browser/direct_sockets/chrome_direct_sockets_delegate.h new file mode 100644 index 0000000..50b79a6e --- /dev/null +++ b/chrome/browser/direct_sockets/chrome_direct_sockets_delegate.h
@@ -0,0 +1,21 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_DIRECT_SOCKETS_CHROME_DIRECT_SOCKETS_DELEGATE_H_ +#define CHROME_BROWSER_DIRECT_SOCKETS_CHROME_DIRECT_SOCKETS_DELEGATE_H_ + +#include "content/public/browser/direct_sockets_delegate.h" + +class ChromeDirectSocketsDelegate : public content::DirectSocketsDelegate { + public: + // content::DirectSocketsDelegate: + bool ValidateAddressAndPort( + content::RenderFrameHost*, + const std::string& address, + uint16_t port, + blink::mojom::DirectSocketProtocolType protocol) const override; + bool ShouldSkipPostResolveChecks(content::RenderFrameHost*) const override; +}; + +#endif // CHROME_BROWSER_DIRECT_SOCKETS_CHROME_DIRECT_SOCKETS_DELEGATE_H_
diff --git a/chrome/browser/direct_sockets/direct_sockets_apitest.cc b/chrome/browser/direct_sockets/direct_sockets_apitest.cc new file mode 100644 index 0000000..bf258c2 --- /dev/null +++ b/chrome/browser/direct_sockets/direct_sockets_apitest.cc
@@ -0,0 +1,299 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/files/file_path.h" +#include "base/json/json_reader.h" +#include "base/json/json_writer.h" +#include "base/strings/stringprintf.h" +#include "build/build_config.h" +#include "chrome/common/chrome_features.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "components/crx_file/id_util.h" +#include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" +#include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "extensions/buildflags/buildflags.h" +#include "extensions/common/manifest_constants.h" +#include "extensions/common/switches.h" +#include "net/dns/mock_host_resolver.h" + +#if BUILDFLAG(ENABLE_EXTENSIONS) +#include "chrome/browser/extensions/extension_apitest.h" +#include "extensions/browser/api/sockets_udp/test_udp_echo_server.h" +#include "extensions/browser/api_test_utils.h" +#include "extensions/common/extension.h" +#include "extensions/test/extension_test_message_listener.h" +#include "extensions/test/result_catcher.h" +#include "extensions/test/test_extension_dir.h" +#endif // BUILDFLAG(ENABLE_EXTENSIONS) + +namespace { + +#if BUILDFLAG(ENABLE_EXTENSIONS) + +constexpr char kHostname[] = "www.foo.com"; + +std::string GenerateManifest( + absl::optional<base::Value::Dict> socket_permissions = {}) { + base::Value::Dict manifest; + manifest.Set(extensions::manifest_keys::kName, + "Direct Sockets in Chrome Extensions"); + manifest.Set(extensions::manifest_keys::kManifestVersion, 2); + manifest.Set(extensions::manifest_keys::kVersion, "1.0"); + + base::Value::List scripts; + scripts.Append("background.js"); + manifest.SetByDottedPath( + extensions::manifest_keys::kPlatformAppBackgroundScripts, + std::move(scripts)); + + if (socket_permissions) { + manifest.Set(extensions::manifest_keys::kSockets, + std::move(*socket_permissions)); + } + + std::string out; + base::JSONWriter::Write(manifest, &out); + + return out; +} + +class DirectSocketsApiTest : public extensions::ExtensionApiTest { + public: + void SetUpOnMainThread() override { + ExtensionApiTest::SetUpOnMainThread(); + host_resolver()->AddRule(kHostname, "127.0.0.1"); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + ExtensionApiTest::SetUpCommandLine(command_line); + command_line->AppendSwitchASCII( + ::switches::kIsolatedAppOrigins, + extensions::Extension::CreateOriginFromExtensionId( + GuessFutureExtensionId()) + .Serialize()); + } + + protected: + extensions::TestExtensionDir& dir() { return dir_; } + + private: + std::string GuessFutureExtensionId() { + return crx_file::id_util::GenerateIdForPath(dir().UnpackedPath()); + } + + extensions::TestExtensionDir dir_; +}; + +using DirectSocketsTcpApiTest = DirectSocketsApiTest; + +IN_PROC_BROWSER_TEST_F(DirectSocketsTcpApiTest, TcpReadWrite) { + base::Value::Dict socket_permissions; + socket_permissions.SetByDottedPath("tcp.connect", "*"); + + dir().WriteManifest(GenerateManifest(std::move(socket_permissions))); + + dir().WriteFile(FILE_PATH_LITERAL("background.js"), R"( + chrome.test.sendMessage("ready", async (message) => { + try { + const [remoteAddress, remotePort] = message.split(':'); + const socket = new TCPSocket(remoteAddress, remotePort); + + const { readable, writable } = await socket.opened; + + const reader = readable.getReader(); + const writer = writable.getWriter(); + + const kTcpPacket = + "POST /echo HTTP/1.1\r\n" + + "Content-Length: 19\r\n\r\n" + + "0100000005320000005"; + + // The echo server can send back the response in multiple chunks. + // We must wait for at least `kTcpMinExpectedResponseLength` bytes to + // be received before matching the response with `kTcpResponsePattern`. + const kTcpMinExpectedResponseLength = 102; + + const kTcpResponsePattern = "0100000005320000005"; + + let tcpResponse = ""; + const readUntil = async () => { + reader.read().then(packet => { + const { value, done } = packet; + chrome.test.assertFalse(done, + "ReadableStream must not be exhausted at this point."); + + tcpResponse += (new TextDecoder()).decode(value); + if (tcpResponse.length >= kTcpMinExpectedResponseLength) { + chrome.test.assertTrue( + !!(new TextDecoder()).decode(value).match(kTcpResponsePattern), + "The data returned must match the data sent." + ); + + chrome.test.succeed(); + } else { + readUntil(); + } + }); + }; + + readUntil(); + + writer.write((new TextEncoder()).encode(kTcpPacket)); + } catch (e) { + chrome.test.fail(e.name + ':' + e.message); + } + }); + )"); + + net::EmbeddedTestServer test_server(net::EmbeddedTestServer::TYPE_HTTP); + test_server.AddDefaultHandlers(); + EXPECT_TRUE(test_server.Start()); + + net::HostPortPair host_port_pair = test_server.host_port_pair(); + int port = host_port_pair.port(); + ASSERT_GT(port, 0); + + host_port_pair.set_host(kHostname); + + extensions::ResultCatcher catcher; + ExtensionTestMessageListener listener("ready", ReplyBehavior::kWillReply); + + ASSERT_TRUE(LoadExtension(dir().UnpackedPath())); + + EXPECT_TRUE(listener.WaitUntilSatisfied()); + listener.Reply( + base::StringPrintf("%s:%d", host_port_pair.host().c_str(), port)); + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); +} + +IN_PROC_BROWSER_TEST_F(DirectSocketsTcpApiTest, + TcpFailsWithoutSocketsPermission) { + dir().WriteManifest(GenerateManifest()); + + dir().WriteFile(FILE_PATH_LITERAL("background.js"), R"( + chrome.test.sendMessage("ready", async (message) => { + try { + const [remoteAddress, remotePort] = message.split(':'); + const socket = new TCPSocket(remoteAddress, remotePort); + + await chrome.test.assertPromiseRejects( + socket.opened, + "InvalidAccessError: Access to the requested host is blocked." + ); + + chrome.test.succeed(); + } catch (e) { + chrome.test.fail(e.name + ':' + e.message); + } + }); + )"); + + extensions::ResultCatcher catcher; + ExtensionTestMessageListener listener("ready", ReplyBehavior::kWillReply); + + ASSERT_TRUE(LoadExtension(dir().UnpackedPath())); + ASSERT_TRUE(listener.WaitUntilSatisfied()); + + listener.Reply(base::StringPrintf("%s:%d", kHostname, 0)); + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); +} + +using DirectSocketsUdpApiTest = DirectSocketsApiTest; + +IN_PROC_BROWSER_TEST_F(DirectSocketsUdpApiTest, UdpReadWrite) { + base::Value::Dict socket_permissions; + socket_permissions.SetByDottedPath("udp.send", "*"); + + dir().WriteManifest(GenerateManifest(std::move(socket_permissions))); + + dir().WriteFile(FILE_PATH_LITERAL("background.js"), R"( + chrome.test.sendMessage("ready", async (message) => { + try { + const [remoteAddress, remotePort] = message.split(':'); + const socket = new UDPSocket({ remoteAddress, remotePort }); + + const { readable, writable } = await socket.opened; + + const reader = readable.getReader(); + const writer = writable.getWriter(); + + const kUdpMessage = "udp_message"; + + reader.read().then(packet => { + const { value, done } = packet; + chrome.test.assertFalse(done, + "ReadableStream must not be exhausted at this point."); + + const { data } = value; + chrome.test.assertEq((new TextDecoder()).decode(data), kUdpMessage, + "The data returned must exactly match the data sent."); + + chrome.test.succeed(); + }); + + writer.write({ + data: (new TextEncoder()).encode(kUdpMessage) + }); + } catch (e) { + chrome.test.fail(e.name + ':' + e.message); + } + }); + )"); + + extensions::TestUdpEchoServer udp_echo_server; + net::HostPortPair host_port_pair; + ASSERT_TRUE(udp_echo_server.Start(&host_port_pair)); + + int port = host_port_pair.port(); + ASSERT_GT(port, 0); + + host_port_pair.set_host(kHostname); + + extensions::ResultCatcher catcher; + ExtensionTestMessageListener listener("ready", ReplyBehavior::kWillReply); + + ASSERT_TRUE(LoadExtension(dir().UnpackedPath())); + EXPECT_TRUE(listener.WaitUntilSatisfied()); + listener.Reply( + base::StringPrintf("%s:%d", host_port_pair.host().c_str(), port)); + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); +} + +IN_PROC_BROWSER_TEST_F(DirectSocketsUdpApiTest, + UdpFailsWithoutSocketsPermission) { + dir().WriteManifest(GenerateManifest()); + + dir().WriteFile(FILE_PATH_LITERAL("background.js"), R"( + chrome.test.sendMessage("ready", async (message) => { + try { + const [remoteAddress, remotePort] = message.split(':'); + const socket = new UDPSocket({ remoteAddress, remotePort }); + + await chrome.test.assertPromiseRejects( + socket.opened, + "InvalidAccessError: Access to the requested host is blocked." + ); + + chrome.test.succeed(); + } catch (e) { + chrome.test.fail(e.name + ':' + e.message); + } + }); + )"); + + extensions::ResultCatcher catcher; + ExtensionTestMessageListener listener("ready", ReplyBehavior::kWillReply); + + ASSERT_TRUE(LoadExtension(dir().UnpackedPath())); + ASSERT_TRUE(listener.WaitUntilSatisfied()); + + listener.Reply(base::StringPrintf("%s:%d", kHostname, 0)); + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); +} + +#endif + +} // namespace
diff --git a/chrome/browser/extensions/identifiability_metrics_test_util.cc b/chrome/browser/extensions/identifiability_metrics_test_util.cc index fabb71a2..d8cdb5d 100644 --- a/chrome/browser/extensions/identifiability_metrics_test_util.cc +++ b/chrome/browser/extensions/identifiability_metrics_test_util.cc
@@ -53,6 +53,26 @@ ukm::builders::Identifiability::kEntryName); } +std::map<ukm::SourceId, ukm::mojom::UkmEntryPtr> +IdentifiabilityMetricsTestHelper::NavigateToBlankAndWaitForMetrics( + content::RenderFrameHost* render_frame_host, + base::RunLoop* run_loop) { + DCHECK(ukm_recorder_) << "IdentifiabilityMetricsTestHelper::" + "SetUpOnMainThread hasn't been called"; + + // Need to navigate away to force a metrics flush; otherwise it would be + // dependent on periodic flush heuristics. + EXPECT_TRUE(content::NavigateToURLFromRenderer(render_frame_host, + GURL("about:blank"))); + + // Also force a browser-side flush. + blink::IdentifiabilitySampleCollector::Get()->Flush(ukm::UkmRecorder::Get()); + + run_loop->Run(); + return ukm_recorder_->GetMergedEntriesByName( + ukm::builders::Identifiability::kEntryName); +} + void IdentifiabilityMetricsTestHelper::EnsureIdentifiabilityEventGenerated( content::WebContents* contents) { // Create a canvas and serialize it to force at least one event to happen,
diff --git a/chrome/browser/extensions/identifiability_metrics_test_util.h b/chrome/browser/extensions/identifiability_metrics_test_util.h index 19de1241..4f710e22 100644 --- a/chrome/browser/extensions/identifiability_metrics_test_util.h +++ b/chrome/browser/extensions/identifiability_metrics_test_util.h
@@ -13,6 +13,7 @@ namespace content { class WebContents; +class RenderFrameHost; } namespace extensions { @@ -55,6 +56,11 @@ NavigateToBlankAndWaitForMetrics(content::WebContents* contents, base::RunLoop* run_loop); + // Similar to the above, but uses RenderFrameHost. + std::map<ukm::SourceId, ukm::mojom::UkmEntryPtr> + NavigateToBlankAndWaitForMetrics(content::RenderFrameHost* render_frame_host, + base::RunLoop* run_loop); + // Makes sure that |contents| has a non-extension identifiability event // generated on it, so that NavigateToBlankAndWaitForMetrics() can terminate // in negative tests.
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl.cc b/chrome/browser/fast_checkout/fast_checkout_client_impl.cc index 3455840..293b8559 100644 --- a/chrome/browser/fast_checkout/fast_checkout_client_impl.cc +++ b/chrome/browser/fast_checkout/fast_checkout_client_impl.cc
@@ -3,10 +3,15 @@ // found in the LICENSE file. #include "chrome/browser/fast_checkout/fast_checkout_client_impl.h" + #include "base/feature_list.h" +#include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/autofill_assistant/common_dependencies_chrome.h" #include "chrome/browser/fast_checkout/fast_checkout_external_action_delegate.h" #include "chrome/browser/fast_checkout/fast_checkout_features.h" +#include "chrome/browser/fast_checkout/fast_checkout_util.h" +#include "chrome/browser/profiles/profile.h" +#include "components/autofill/core/browser/autofill_client.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/data_model/credit_card.h" #include "components/autofill/core/browser/fast_checkout_delegate.h" @@ -20,6 +25,34 @@ // TODO(crbug.com/1338521): Define and specify proper caller(s) and source(s). constexpr char kCaller[] = "7"; // run was started from within Chromium constexpr char kSource[] = "1"; // run was started organically + +std::vector<autofill::CreditCard*> GetValidCreditCardsToSuggest( + autofill::PersonalDataManager* pdm) { + // TODO(crbug.com/1334642): Check on autofill_client whether server credit + // cards are supported. + std::vector<autofill::CreditCard*> cards_to_suggest = + pdm->GetCreditCardsToSuggest(true); + base::EraseIf(cards_to_suggest, [](const autofill::CreditCard* card) { + return !card->IsCompleteValidCard(); + }); + + return cards_to_suggest; +} + +std::vector<autofill::AutofillProfile*> GetValidAddressProfilesToSuggest( + autofill::PersonalDataManager* pdm) { + // Trigger only if there is at least 1 complete address profile on file. + std::vector<autofill::AutofillProfile*> profiles_to_suggest = + pdm->GetProfilesToSuggest(); + + base::EraseIf(profiles_to_suggest, + [&pdm](const autofill::AutofillProfile* profile) { + return !fast_checkout::IsCompleteAddressProfile( + profile, pdm->app_locale()); + }); + return profiles_to_suggest; +} + } // namespace FastCheckoutClientImpl::FastCheckoutClientImpl( @@ -37,9 +70,20 @@ if (is_running_) return false; + autofill::PersonalDataManager* pdm = GetPersonalDataManager(); + DCHECK(pdm); + // Trigger only if there is at least 1 complete valid credit card on file. + if (GetValidCreditCardsToSuggest(pdm).empty() || + GetValidAddressProfilesToSuggest(pdm).empty()) { + // TODO(crbug.com/1334642): Add to metric that tracks reasons why FC was not + // shown. + return false; + } + is_running_ = true; url_ = url; delegate_ = std::move(delegate); + personal_data_manager_observation_.Observe(GetPersonalDataManager()); base::flat_map<std::string, std::string> params_map{ {autofill_assistant::public_script_parameters::kIntentParameterName, @@ -78,7 +122,13 @@ void FastCheckoutClientImpl::OnOnboardingCompletedSuccessfully() { fast_checkout_controller_ = CreateFastCheckoutController(); - fast_checkout_controller_->Show(); + ShowFastCheckoutUI(); +} + +void FastCheckoutClientImpl::ShowFastCheckoutUI() { + autofill::PersonalDataManager* pdm = GetPersonalDataManager(); + fast_checkout_controller_->Show(GetValidAddressProfilesToSuggest(pdm), + GetValidCreditCardsToSuggest(pdm)); } void FastCheckoutClientImpl::OnRunComplete( @@ -91,6 +141,7 @@ external_script_controller_.reset(); fast_checkout_controller_.reset(); is_running_ = false; + personal_data_manager_observation_.Reset(); } bool FastCheckoutClientImpl::IsRunning() const { @@ -138,4 +189,17 @@ Stop(); } +autofill::PersonalDataManager* +FastCheckoutClientImpl::GetPersonalDataManager() { + Profile* profile = + Profile::FromBrowserContext(GetWebContents().GetBrowserContext()); + return autofill::PersonalDataManagerFactory::GetForProfile( + profile->GetOriginalProfile()); +} + +void FastCheckoutClientImpl::OnPersonalDataChanged() { + // TODO(crbug.com/1334642): Refresh UI data or stop the flow if data is not + // valid anymore. +} + WEB_CONTENTS_USER_DATA_KEY_IMPL(FastCheckoutClientImpl);
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl.h b/chrome/browser/fast_checkout/fast_checkout_client_impl.h index 05fe755..b45e8168 100644 --- a/chrome/browser/fast_checkout/fast_checkout_client_impl.h +++ b/chrome/browser/fast_checkout/fast_checkout_client_impl.h
@@ -5,8 +5,10 @@ #ifndef CHROME_BROWSER_FAST_CHECKOUT_FAST_CHECKOUT_CLIENT_IMPL_H_ #define CHROME_BROWSER_FAST_CHECKOUT_FAST_CHECKOUT_CLIENT_IMPL_H_ +#include "base/scoped_observation.h" #include "chrome/browser/fast_checkout/fast_checkout_client.h" #include "chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h" +#include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill_assistant/browser/public/headless_script_controller.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_user_data.h" @@ -17,7 +19,8 @@ class FastCheckoutClientImpl : public content::WebContentsUserData<FastCheckoutClientImpl>, public FastCheckoutClient, - public FastCheckoutControllerImpl::Delegate { + public FastCheckoutControllerImpl::Delegate, + public autofill::PersonalDataManagerObserver { public: ~FastCheckoutClientImpl() override; @@ -51,9 +54,15 @@ virtual std::unique_ptr<FastCheckoutController> CreateFastCheckoutController(); + // Returns the current active personal data manager. + virtual autofill::PersonalDataManager* GetPersonalDataManager(); + private: friend class content::WebContentsUserData<FastCheckoutClientImpl>; + // From autofill::PersonalDataManagerObserver. + void OnPersonalDataChanged() override; + // Called whenever the surface gets hidden (regardless of the cause). Informs // the Delegate that the surface is now hidden. void OnHidden(); @@ -62,8 +71,12 @@ void OnRunComplete( autofill_assistant::HeadlessScriptController::ScriptResult result); - // Registers when onboarding was completed successfully and the scripts are - // ready to run. + // Displays the bottom sheet UI. If the underlying autofill data is updated, + // the method is called again to refresh the information displayed in the UI. + void ShowFastCheckoutUI(); + + // Registers when onboarding was completed successfully and the scripts + // are ready to run. void OnOnboardingCompletedSuccessfully(); // Delegate for the surface being shown. @@ -90,6 +103,10 @@ // The url for which `Start()` was triggered. GURL url_; + base::ScopedObservation<autofill::PersonalDataManager, + autofill::PersonalDataManagerObserver> + personal_data_manager_observation_{this}; + // content::WebContentsUserData: WEB_CONTENTS_USER_DATA_KEY_DECL(); };
diff --git a/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc b/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc index ea5448d..c2f12445 100644 --- a/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc +++ b/chrome/browser/fast_checkout/fast_checkout_client_impl_unittest.cc
@@ -10,17 +10,27 @@ #include "chrome/browser/fast_checkout/fast_checkout_features.h" #include "chrome/browser/ui/fast_checkout/fast_checkout_controller.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/data_model/credit_card.h" #include "components/autofill/core/browser/fast_checkout_delegate.h" +#include "components/autofill/core/browser/test_personal_data_manager.h" #include "components/autofill/core/common/form_field_data.h" #include "components/autofill_assistant/browser/public/mock_headless_script_controller.h" #include "ui/gfx/native_widget_types.h" +using ::autofill::AutofillProfile; +using ::autofill::CreditCard; using ::testing::_; +using ::testing::Pointee; +using ::testing::UnorderedElementsAre; namespace { constexpr char kUrl[] = "https://www.example.com"; +const AutofillProfile profile1 = autofill::test::GetFullProfile(); +const AutofillProfile profile2 = autofill::test::GetFullProfile2(); +const CreditCard credit_card1 = autofill::test::GetCreditCard(); +const CreditCard credit_card2 = autofill::test::GetCreditCard2(); } class MockFastCheckoutController : public FastCheckoutController { @@ -28,11 +38,15 @@ MockFastCheckoutController() : FastCheckoutController() {} ~MockFastCheckoutController() override = default; - MOCK_METHOD(void, Show, (), (override)); + MOCK_METHOD(void, + Show, + (const std::vector<AutofillProfile*>& autofill_profiles, + const std::vector<CreditCard*>& credit_cards), + (override)); MOCK_METHOD(void, OnOptionsSelected, - (std::unique_ptr<autofill::AutofillProfile> profile, - std::unique_ptr<autofill::CreditCard> credit_card), + (std::unique_ptr<AutofillProfile> profile, + std::unique_ptr<CreditCard> credit_card), (override)); MOCK_METHOD(void, OnDismiss, (), (override)); MOCK_METHOD(void, OpenAutofillProfileSettings, (), (override)); @@ -70,8 +84,8 @@ MOCK_METHOD(void, SetOptionsSelected, - (const autofill::AutofillProfile& selected_profile, - const autofill::CreditCard& selected_credit_card), + (const AutofillProfile& selected_profile, + const CreditCard& selected_credit_card), (override)); }; @@ -99,6 +113,10 @@ return std::move(fast_checkout_controller_); } + autofill::PersonalDataManager* GetPersonalDataManager() override { + return personal_data_manager_; + } + void InjectFastCheckoutController( std::unique_ptr<FastCheckoutController> fast_checkout_controller) { fast_checkout_controller_ = std::move(fast_checkout_controller); @@ -115,11 +133,17 @@ external_action_delegate_ = std::move(external_action_delegate); } + void InjectPersonalDataManager( + autofill::PersonalDataManager* personal_data_manager) { + personal_data_manager_ = personal_data_manager; + } + private: std::unique_ptr<autofill_assistant::HeadlessScriptController> external_script_controller_; std::unique_ptr<FastCheckoutController> fast_checkout_controller_; std::unique_ptr<FastCheckoutExternalActionDelegate> external_action_delegate_; + autofill::PersonalDataManager* personal_data_manager_; }; // static @@ -165,10 +189,33 @@ test_client_->InjectFastCheckoutExternalActionDelegate( std::move(external_action_delegate)); + // Prepare the PersonalDataManager. + SetUpPersonalDataManager(); + // Prepare the FastCheckoutDelegate. fast_checkout_delegate_ = std::make_unique<MockFastCheckoutDelegate>(); } + void SetUpPersonalDataManager() { + test_personal_data_manager_ = + std::make_unique<autofill::TestPersonalDataManager>(); + // Set up initial data + test_personal_data_manager_->SetAutofillProfileEnabled(true); + test_personal_data_manager_->SetAutofillCreditCardEnabled(true); + test_personal_data_manager_->SetAutofillWalletImportEnabled(true); + test_personal_data_manager_->AddProfile(profile1); + test_personal_data_manager_->AddProfile(profile2); + test_personal_data_manager_->AddProfile( + autofill::test::GetIncompleteProfile1()); + // Add incomplete autofill profile, should not be shown on the sheet. + test_personal_data_manager_->AddCreditCard(credit_card1); + test_personal_data_manager_->AddCreditCard(credit_card2); + // Add incomplete credit card, should not be shown on the sheet. + test_personal_data_manager_->AddCreditCard( + autofill::test::GetIncompleteCreditCard()); + test_client_->InjectPersonalDataManager(test_personal_data_manager_.get()); + } + TestFastCheckoutClientImpl* fast_checkout_client() { return test_client_; } autofill_assistant::MockHeadlessScriptController* @@ -191,12 +238,14 @@ protected: base::test::ScopedFeatureList feature_list_; - raw_ptr<TestFastCheckoutClientImpl> test_client_; raw_ptr<autofill_assistant::MockHeadlessScriptController> external_script_controller_; raw_ptr<MockFastCheckoutController> fast_checkout_controller_; raw_ptr<MockFastCheckoutExternalActionDelegate> external_action_delegate_; std::unique_ptr<MockFastCheckoutDelegate> fast_checkout_delegate_; + std::unique_ptr<autofill::TestPersonalDataManager> + test_personal_data_manager_; + raw_ptr<TestFastCheckoutClientImpl> test_client_; }; TEST_F( @@ -253,7 +302,10 @@ }); // Expect bottomsheet to show up. - EXPECT_CALL(*fast_checkout_controller(), Show); + EXPECT_CALL( + *fast_checkout_controller(), + Show(UnorderedElementsAre(Pointee(profile1), Pointee(profile2)), + UnorderedElementsAre(Pointee(credit_card1), Pointee(credit_card2)))); // Starting the run successfully. EXPECT_TRUE(fast_checkout_client()->Start(delegate(), GURL(kUrl))); @@ -274,6 +326,78 @@ EXPECT_FALSE(fast_checkout_client()->IsRunning()); } +TEST_F(FastCheckoutClientImplTest, Start_FailsIfNoProfilesOnFile) { + // `FastCheckoutClient` is not running initially. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); + + // Remove all profiles. + test_personal_data_manager_->ClearProfiles(); + + EXPECT_CALL(*external_script_controller(), StartScript(_, _, _, _)).Times(0); + + // Starting the run unsuccessfully. + EXPECT_FALSE(fast_checkout_client()->Start(delegate(), GURL(kUrl))); + + // `FastCheckoutClient` is not running. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); +} + +TEST_F(FastCheckoutClientImplTest, Start_FailsIfNoCompleteProfile) { + // `FastCheckoutClient` is not running initially. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); + + // Remove all Profiles. + test_personal_data_manager_->ClearProfiles(); + test_personal_data_manager_->AddProfile( + autofill::test::GetIncompleteProfile1()); + test_personal_data_manager_->AddProfile( + autofill::test::GetIncompleteProfile2()); + + EXPECT_CALL(*external_script_controller(), StartScript(_, _, _, _)).Times(0); + + // Starting the run unsuccessfully. + EXPECT_FALSE(fast_checkout_client()->Start(delegate(), GURL(kUrl))); + + // `FastCheckoutClient` is not running. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); +} + +TEST_F(FastCheckoutClientImplTest, Start_FailsIfNoCreditCardsOnFile) { + // `FastCheckoutClient` is not running initially. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); + + // Remove all credit cards. + test_personal_data_manager_->ClearCreditCards(); + + EXPECT_CALL(*external_script_controller(), StartScript(_, _, _, _)).Times(0); + + // Starting the run unsuccessfully. + EXPECT_FALSE(fast_checkout_client()->Start(delegate(), GURL(kUrl))); + + // `FastCheckoutClient` is not running. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); +} + +TEST_F(FastCheckoutClientImplTest, Start_FailsIfNoCompleteorValidCreditCard) { + // `FastCheckoutClient` is not running initially. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); + + // Remove all credit Cards. + test_personal_data_manager_->ClearCreditCards(); + test_personal_data_manager_->AddCreditCard( + autofill::test::GetExpiredCreditCard()); + test_personal_data_manager_->AddCreditCard( + autofill::test::GetIncompleteCreditCard()); + + EXPECT_CALL(*external_script_controller(), StartScript(_, _, _, _)).Times(0); + + // Starting the run unsuccessfully. + EXPECT_FALSE(fast_checkout_client()->Start(delegate(), GURL(kUrl))); + + // `FastCheckoutClient` is not running. + EXPECT_FALSE(fast_checkout_client()->IsRunning()); +} + TEST_F(FastCheckoutClientImplTest, Start_OnboardingNotSuccessful_BottomsheetNotShowing) { // `FastCheckoutClient` is not running initially. @@ -347,9 +471,8 @@ EXPECT_CALL(*delegate(), OnFastCheckoutUIHidden); // User selected profile and card in bottomsheet. - fast_checkout_client()->OnOptionsSelected( - std::make_unique<autofill::AutofillProfile>(), - std::make_unique<autofill::CreditCard>()); + fast_checkout_client()->OnOptionsSelected(std::make_unique<AutofillProfile>(), + std::make_unique<CreditCard>()); } TEST_F(FastCheckoutClientImplTest, RunsSuccessfullyIfDelegateIsDestroyed) {
diff --git a/chrome/browser/fast_checkout/fast_checkout_util.cc b/chrome/browser/fast_checkout/fast_checkout_util.cc index 81f2562..fe30ffc 100644 --- a/chrome/browser/fast_checkout/fast_checkout_util.cc +++ b/chrome/browser/fast_checkout/fast_checkout_util.cc
@@ -9,6 +9,7 @@ #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/data_model/credit_card.h" #include "components/autofill/core/browser/field_types.h" +#include "components/autofill/core/browser/geo/autofill_country.h" namespace fast_checkout { @@ -59,4 +60,21 @@ return card_proto; } +bool IsCompleteAddressProfile(const autofill::AutofillProfile* profile, + const std::string& app_locale) { + std::string country_code = + base::UTF16ToASCII(profile->GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)); + if (country_code.empty()) { + return false; + } + + autofill::AutofillCountry country(country_code, app_locale); + return !profile->GetInfo(autofill::NAME_FULL, app_locale).empty() && + !profile->GetRawInfo(autofill::ADDRESS_HOME_STREET_ADDRESS).empty() && + (!country.requires_zip() || + profile->HasRawInfo(autofill::ADDRESS_HOME_ZIP)) && + !profile->GetRawInfo(autofill::EMAIL_ADDRESS).empty() && + !profile->GetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER).empty(); +} + } // namespace fast_checkout
diff --git a/chrome/browser/fast_checkout/fast_checkout_util.h b/chrome/browser/fast_checkout/fast_checkout_util.h index b11d156c..1d70d97 100644 --- a/chrome/browser/fast_checkout/fast_checkout_util.h +++ b/chrome/browser/fast_checkout/fast_checkout_util.h
@@ -25,6 +25,11 @@ autofill_assistant::external::CreditCardProto CreateCreditCardProto( const autofill::CreditCard& credit_card); +// Complete = contains name, street address, country code, zip code, email and +// phone number. +bool IsCompleteAddressProfile(const autofill::AutofillProfile* profile, + const std::string& app_locale); + } // namespace fast_checkout #endif
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 2f642d6e..134795e 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -5897,11 +5897,6 @@ "bootstrapping the Seccomp BPF sandbox. Can be overridden by " "#force-spectre-variant2-mitigation."; -const char kSyncSettingsCategorizationName[] = "Split OS and browser sync"; -const char kSyncSettingsCategorizationDescription[] = - "Allows OS sync to be configured separately from browser sync. Changes the " - "OS settings UI to provide controls for OS data types."; - const char kSystemChinesePhysicalTypingName[] = "Use system IME for Chinese typing"; const char kSystemChinesePhysicalTypingDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 77c83cf..9e9220d4 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -3378,9 +3378,6 @@ extern const char kSpectreVariant2MitigationName[]; extern const char kSpectreVariant2MitigationDescription[]; -extern const char kSyncSettingsCategorizationName[]; -extern const char kSyncSettingsCategorizationDescription[]; - extern const char kSystemChinesePhysicalTypingName[]; extern const char kSystemChinesePhysicalTypingDescription[];
diff --git a/chrome/browser/installable/installed_webapp_geolocation_bridge.cc b/chrome/browser/installable/installed_webapp_geolocation_bridge.cc index a55cfd4..1ca30806 100644 --- a/chrome/browser/installable/installed_webapp_geolocation_bridge.cc +++ b/chrome/browser/installable/installed_webapp_geolocation_bridge.cc
@@ -13,6 +13,7 @@ #include "chrome/android/chrome_jni_headers/InstalledWebappGeolocationBridge_jni.h" #include "chrome/browser/installable/installed_webapp_geolocation_context.h" #include "services/device/public/cpp/geolocation/geoposition.h" +#include "url/android/gurl_android.h" namespace { @@ -41,10 +42,10 @@ InstalledWebappGeolocationBridge::InstalledWebappGeolocationBridge( mojo::PendingReceiver<Geolocation> receiver, - const GURL& origin, + const GURL& url, InstalledWebappGeolocationContext* context) : context_(context), - origin_(origin), + url_(url), high_accuracy_(false), has_position_to_report_(false), receiver_(this, std::move(receiver)) { @@ -61,11 +62,9 @@ void InstalledWebappGeolocationBridge::StartListeningForUpdates() { JNIEnv* env = base::android::AttachCurrentThread(); if (java_ref_.is_null()) { - base::android::ScopedJavaLocalRef<jstring> j_origin = - base::android::ConvertUTF8ToJavaString( - env, origin_.DeprecatedGetOriginAsURL().spec()); java_ref_.Reset(Java_InstalledWebappGeolocationBridge_create( - env, reinterpret_cast<intptr_t>(this), j_origin)); + env, reinterpret_cast<intptr_t>(this), + url::GURLAndroid::FromNativeGURL(env, url_))); } Java_InstalledWebappGeolocationBridge_start(env, java_ref_, high_accuracy_); }
diff --git a/chrome/browser/installable/installed_webapp_geolocation_bridge.h b/chrome/browser/installable/installed_webapp_geolocation_bridge.h index 7c0ccdf..0511ee24 100644 --- a/chrome/browser/installable/installed_webapp_geolocation_bridge.h +++ b/chrome/browser/installable/installed_webapp_geolocation_bridge.h
@@ -75,7 +75,7 @@ device::mojom::Geoposition current_position_; - const GURL origin_; + const GURL url_; // Whether this instance is currently observing location updates with high // accuracy.
diff --git a/chrome/browser/installable/installed_webapp_geolocation_context.cc b/chrome/browser/installable/installed_webapp_geolocation_context.cc index 2180c09e..d8d603c7 100644 --- a/chrome/browser/installable/installed_webapp_geolocation_context.cc +++ b/chrome/browser/installable/installed_webapp_geolocation_context.cc
@@ -16,9 +16,9 @@ void InstalledWebappGeolocationContext::BindGeolocation( mojo::PendingReceiver<device::mojom::Geolocation> receiver, - const GURL& requesting_origin) { + const GURL& requesting_url) { impls_.push_back(std::make_unique<InstalledWebappGeolocationBridge>( - std::move(receiver), requesting_origin, this)); + std::move(receiver), requesting_url, this)); if (geoposition_override_) impls_.back()->SetOverride(*geoposition_override_); else
diff --git a/chrome/browser/installable/installed_webapp_geolocation_context.h b/chrome/browser/installable/installed_webapp_geolocation_context.h index 56bbdd1..1730c15 100644 --- a/chrome/browser/installable/installed_webapp_geolocation_context.h +++ b/chrome/browser/installable/installed_webapp_geolocation_context.h
@@ -31,7 +31,7 @@ // mojom::GeolocationContext implementation: void BindGeolocation( mojo::PendingReceiver<device::mojom::Geolocation> receiver, - const GURL& requesting_origin) override; + const GURL& requesting_url) override; void SetOverride(device::mojom::GeopositionPtr geoposition) override; void ClearOverride() override;
diff --git a/chrome/browser/page_info/about_this_site_tab_helper.cc b/chrome/browser/page_info/about_this_site_tab_helper.cc index 06aace3d..eded670 100644 --- a/chrome/browser/page_info/about_this_site_tab_helper.cc +++ b/chrome/browser/page_info/about_this_site_tab_helper.cc
@@ -95,14 +95,9 @@ if (status != AboutThisSiteStatus::kValid) return; - content::OpenURLParams url_params( - net::AppendOrReplaceQueryParameter( - GURL(about_this_site_metadata->site_info().more_about().url()), - page_info::AboutThisSiteRenderModeParameterName, - page_info::AboutThisSiteRenderModeParameterValue), - content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, - ui::PAGE_TRANSITION_LINK, /*is_renderer_initiated=*/false); - RegisterAboutThisSiteSidePanel(web_contents(), url_params); + RegisterAboutThisSiteSidePanel( + web_contents(), + GURL(about_this_site_metadata->site_info().more_about().url())); } WEB_CONTENTS_USER_DATA_KEY_IMPL(AboutThisSiteTabHelper);
diff --git a/chrome/browser/password_edit_dialog/android/BUILD.gn b/chrome/browser/password_edit_dialog/android/BUILD.gn index fc40d32f..6dc7bfb 100644 --- a/chrome/browser/password_edit_dialog/android/BUILD.gn +++ b/chrome/browser/password_edit_dialog/android/BUILD.gn
@@ -58,6 +58,7 @@ sources = [ "java/res/drawable/dropdown_arrow_down.xml", "java/res/layout/password_edit_dialog.xml", + "java/res/layout/password_edit_dialog_dropdown_item.xml", "java/res/layout/password_edit_dialog_with_details.xml", "java/res/values/dimens.xml", ]
diff --git a/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_dropdown_item.xml b/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_dropdown_item.xml new file mode 100644 index 0000000..60667d5 --- /dev/null +++ b/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_dropdown_item.xml
@@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> + +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="@dimen/dropdown_item_height" + android:paddingStart="@dimen/dropdown_item_label_margin" + android:paddingEnd="@dimen/dropdown_item_label_margin" + android:ellipsize="end" + android:includeFontPadding="false" + android:singleLine="true" + android:gravity="center_vertical" + android:textAppearance="@style/TextAppearance.TextLarge.Primary.Baseline" /> \ No newline at end of file
diff --git a/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_with_details.xml b/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_with_details.xml index acb4e06..9153bd3 100644 --- a/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_with_details.xml +++ b/chrome/browser/password_edit_dialog/android/java/res/layout/password_edit_dialog_with_details.xml
@@ -32,7 +32,8 @@ android:paddingTop="@dimen/password_edit_field_padding_top" android:focusableInTouchMode="true" android:textAppearance="@style/TextAppearance.TextLarge.Primary" - android:inputType="text" /> + android:inputType="text" + android:popupBackground="@drawable/popup_bg"/> </com.google.android.material.textfield.TextInputLayout>
diff --git a/chrome/browser/password_edit_dialog/android/java/src/org/chromium/chrome/browser/password_edit_dialog/PasswordEditDialogWithDetailsView.java b/chrome/browser/password_edit_dialog/android/java/src/org/chromium/chrome/browser/password_edit_dialog/PasswordEditDialogWithDetailsView.java index eb51d6c..e164095 100644 --- a/chrome/browser/password_edit_dialog/android/java/src/org/chromium/chrome/browser/password_edit_dialog/PasswordEditDialogWithDetailsView.java +++ b/chrome/browser/password_edit_dialog/android/java/src/org/chromium/chrome/browser/password_edit_dialog/PasswordEditDialogWithDetailsView.java
@@ -80,8 +80,7 @@ @Override public void setUsernames(List<String> usernames, String initialUsername) { ArrayAdapter<String> usernamesAdapter = new NoFilterArrayAdapter<>( - getContext(), android.R.layout.simple_spinner_item, usernames); - usernamesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + getContext(), R.layout.password_edit_dialog_dropdown_item, usernames); mUsernameView.setAdapter(usernamesAdapter); mUsernameView.setText(initialUsername); }
diff --git a/chrome/browser/privacy_guide/android/BUILD.gn b/chrome/browser/privacy_guide/android/BUILD.gn index df8549f..ed12dce 100644 --- a/chrome/browser/privacy_guide/android/BUILD.gn +++ b/chrome/browser/privacy_guide/android/BUILD.gn
@@ -39,6 +39,7 @@ sources = [ "junit/src/org/chromium/chrome/browser/privacy_guide/MSBBFragmentTest.java", "junit/src/org/chromium/chrome/browser/privacy_guide/PrivacyGuidePagerAdapterTest.java", + "junit/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragmentTest.java", "junit/src/org/chromium/chrome/browser/privacy_guide/StepDisplayHandlerImplTest.java", ] deps = [ @@ -48,6 +49,8 @@ "//chrome/browser/profiles/android:java", "//chrome/browser/safe_browsing/android:java", "//chrome/browser/signin/services/android:java", + "//components/browser_ui/bottomsheet/android:java", + "//components/browser_ui/widget/android:java", "//third_party/androidx:androidx_appcompat_appcompat_java", "//third_party/androidx:androidx_fragment_fragment_java", "//third_party/androidx:androidx_fragment_fragment_testing_java",
diff --git a/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_enhanced_explanation.xml b/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_enhanced_explanation.xml index b07b818..275c4fe8 100644 --- a/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_enhanced_explanation.xml +++ b/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_enhanced_explanation.xml
@@ -6,6 +6,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/sb_enhanced_sheet" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start"
diff --git a/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_standard_explanation.xml b/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_standard_explanation.xml index ada4760..a7bbadf 100644 --- a/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_standard_explanation.xml +++ b/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_standard_explanation.xml
@@ -6,6 +6,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/sb_standard_sheet" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start"
diff --git a/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_step.xml b/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_step.xml index a76e367..877ef55 100644 --- a/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_step.xml +++ b/chrome/browser/privacy_guide/android/java/res/layout/privacy_guide_sb_step.xml
@@ -37,6 +37,7 @@ style="@style/TextAppearance.TextLarge.Primary" /> <org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout + android:id="@+id/sb_radio_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:focusable="false">
diff --git a/chrome/browser/privacy_guide/android/java/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragment.java b/chrome/browser/privacy_guide/android/java/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragment.java index af0281b..8664ba75 100644 --- a/chrome/browser/privacy_guide/android/java/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragment.java +++ b/chrome/browser/privacy_guide/android/java/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragment.java
@@ -8,9 +8,12 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.RadioGroup; import androidx.fragment.app.Fragment; +import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge; +import org.chromium.chrome.browser.safe_browsing.SafeBrowsingState; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton; @@ -18,7 +21,8 @@ * Controls the behaviour of the Safe Browsing privacy guide page. */ public class SafeBrowsingFragment extends Fragment - implements RadioButtonWithDescriptionAndAuxButton.OnAuxButtonClickedListener { + implements RadioButtonWithDescriptionAndAuxButton.OnAuxButtonClickedListener, + RadioGroup.OnCheckedChangeListener { private RadioButtonWithDescriptionAndAuxButton mStandardProtection; private RadioButtonWithDescriptionAndAuxButton mEnhancedProtection; private BottomSheetController mBottomSheetController; @@ -31,6 +35,9 @@ @Override public void onViewCreated(View view, Bundle savedInstanceState) { + RadioGroup radioGroup = view.findViewById(R.id.sb_radio_button); + radioGroup.setOnCheckedChangeListener(this); + mEnhancedProtection = (RadioButtonWithDescriptionAndAuxButton) view.findViewById(R.id.enhanced_option); mStandardProtection = @@ -38,6 +45,23 @@ mEnhancedProtection.setAuxButtonClickedListener(this); mStandardProtection.setAuxButtonClickedListener(this); + + initialRadioButtonConfig(); + } + + private void initialRadioButtonConfig() { + @SafeBrowsingState + int safeBrowsingState = SafeBrowsingBridge.getSafeBrowsingState(); + switch (safeBrowsingState) { + case (SafeBrowsingState.ENHANCED_PROTECTION): + mEnhancedProtection.setChecked(true); + break; + case (SafeBrowsingState.STANDARD_PROTECTION): + mStandardProtection.setChecked(true); + break; + default: + assert false : "Unexpected SafeBrowsingState " + safeBrowsingState; + } } @Override @@ -50,7 +74,18 @@ displayBottomSheet( inflater.inflate(R.layout.privacy_guide_sb_standard_explanation, null)); } else { - assert false : "Should not be reached."; + assert false : "Unknown Aux clickedButtonId " + clickedButtonId; + } + } + + @Override + public void onCheckedChanged(RadioGroup radioGroup, int clickedButtonId) { + if (clickedButtonId == R.id.enhanced_option) { + SafeBrowsingBridge.setSafeBrowsingState(SafeBrowsingState.ENHANCED_PROTECTION); + } else if (clickedButtonId == R.id.standard_option) { + SafeBrowsingBridge.setSafeBrowsingState(SafeBrowsingState.STANDARD_PROTECTION); + } else { + assert false : "Unknown clickedButtonId " + clickedButtonId; } }
diff --git a/chrome/browser/privacy_guide/android/junit/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragmentTest.java b/chrome/browser/privacy_guide/android/junit/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragmentTest.java new file mode 100644 index 0000000..b9134ba7 --- /dev/null +++ b/chrome/browser/privacy_guide/android/junit/src/org/chromium/chrome/browser/privacy_guide/SafeBrowsingFragmentTest.java
@@ -0,0 +1,108 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.privacy_guide; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.os.Bundle; + +import androidx.fragment.app.testing.FragmentScenario; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.JniMocker; +import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge; +import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridgeJni; +import org.chromium.chrome.browser.safe_browsing.SafeBrowsingState; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; +import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton; + +/** + * JUnit tests of the class {@link SafeBrowsingFragment} + */ +@RunWith(BaseRobolectricTestRunner.class) +public class SafeBrowsingFragmentTest { + // TODO(crbug.com/1357003): Use Espresso for view interactions. + @Rule + public JniMocker mMocker = new JniMocker(); + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule(); + + @Mock + private SafeBrowsingBridge.Natives mNativeMock; + @Mock + private BottomSheetController mBottomSheetController; + + private FragmentScenario mScenario; + private RadioButtonWithDescriptionAndAuxButton mEnhancedProtectionButton; + private RadioButtonWithDescriptionAndAuxButton mStandardProtectionButton; + + @Before + public void setUp() { + mMocker.mock(SafeBrowsingBridgeJni.TEST_HOOKS, mNativeMock); + } + + @After + public void tearDown() { + if (mScenario != null) { + mScenario.close(); + } + } + + private void initFragmentWithSBState(@SafeBrowsingState int state) { + when(mNativeMock.getSafeBrowsingState()).thenReturn(state); + mScenario = FragmentScenario.launchInContainer( + SafeBrowsingFragment.class, Bundle.EMPTY, R.style.Theme_MaterialComponents); + mScenario.onFragment(fragment -> { + mEnhancedProtectionButton = fragment.getView().findViewById(R.id.enhanced_option); + mStandardProtectionButton = fragment.getView().findViewById(R.id.standard_option); + ((SafeBrowsingFragment) fragment).setBottomSheetController(mBottomSheetController); + }); + } + + @Test + public void testInitWhenSBEnhanced() { + initFragmentWithSBState(SafeBrowsingState.ENHANCED_PROTECTION); + assertTrue(mEnhancedProtectionButton.isChecked()); + assertFalse(mStandardProtectionButton.isChecked()); + } + + @Test + public void testInitWhenSBStandard() { + initFragmentWithSBState(SafeBrowsingState.STANDARD_PROTECTION); + assertFalse(mEnhancedProtectionButton.isChecked()); + assertTrue(mStandardProtectionButton.isChecked()); + } + + @Test(expected = AssertionError.class) + public void testInitWhenSBOff() { + initFragmentWithSBState(SafeBrowsingState.NO_SAFE_BROWSING); + } + + @Test + public void testSelectEnhanced() { + initFragmentWithSBState(SafeBrowsingState.STANDARD_PROTECTION); + mEnhancedProtectionButton.performClick(); + verify(mNativeMock).setSafeBrowsingState(SafeBrowsingState.ENHANCED_PROTECTION); + } + + @Test + public void testSelectStandard() { + initFragmentWithSBState(SafeBrowsingState.ENHANCED_PROTECTION); + mStandardProtectionButton.performClick(); + verify(mNativeMock).setSafeBrowsingState(SafeBrowsingState.STANDARD_PROTECTION); + } +}
diff --git a/chrome/browser/resources/access_code_cast/access_code_cast.ts b/chrome/browser/resources/access_code_cast/access_code_cast.ts index c4015754..79af437 100644 --- a/chrome/browser/resources/access_code_cast/access_code_cast.ts +++ b/chrome/browser/resources/access_code_cast/access_code_cast.ts
@@ -7,7 +7,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/browser/resources/bookmarks/app.ts b/chrome/browser/resources/bookmarks/app.ts index e5b1f6b..140d787 100644 --- a/chrome/browser/resources/bookmarks/app.ts +++ b/chrome/browser/resources/bookmarks/app.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_components/managed_footnote/managed_footnote.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_toast/cr_toast_manager.js';
diff --git a/chrome/browser/resources/bookmarks/edit_dialog.ts b/chrome/browser/resources/bookmarks/edit_dialog.ts index c15ab82..6b7eeec 100644 --- a/chrome/browser/resources/bookmarks/edit_dialog.ts +++ b/chrome/browser/resources/bookmarks/edit_dialog.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js';
diff --git a/chrome/browser/resources/bookmarks/folder_node.ts b/chrome/browser/resources/bookmarks/folder_node.ts index 5df8667..7cd10a8 100644 --- a/chrome/browser/resources/bookmarks/folder_node.ts +++ b/chrome/browser/resources/bookmarks/folder_node.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_nav_menu_item_style.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/paper-ripple/paper-ripple.js'; import './shared_style.css.js';
diff --git a/chrome/browser/resources/bookmarks/shared_style.css b/chrome/browser/resources/bookmarks/shared_style.css index 7c00c2c..35833e8 100644 --- a/chrome/browser/resources/bookmarks/shared_style.css +++ b/chrome/browser/resources/bookmarks/shared_style.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #import=./shared_vars.css.js * #include=cr-shared-style
diff --git a/chrome/browser/resources/chromeos/accessibility/common/tutorial/lesson_menu.js b/chrome/browser/resources/chromeos/accessibility/common/tutorial/lesson_menu.js index 6b1973a..cc6b68c 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/tutorial/lesson_menu.js +++ b/chrome/browser/resources/chromeos/accessibility/common/tutorial/lesson_menu.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/common/tutorial/main_menu.js b/chrome/browser/resources/chromeos/accessibility/common/tutorial/main_menu.js index 70a1498..a0e216d 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/tutorial/main_menu.js +++ b/chrome/browser/resources/chromeos/accessibility/common/tutorial/main_menu.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/common/tutorial/navigation_buttons.js b/chrome/browser/resources/chromeos/accessibility/common/tutorial/navigation_buttons.js index 1e3ce15..cec187e7 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/tutorial/navigation_buttons.js +++ b/chrome/browser/resources/chromeos/accessibility/common/tutorial/navigation_buttons.js
@@ -8,7 +8,7 @@ */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/common/tutorial/tutorial_lesson.js b/chrome/browser/resources/chromeos/accessibility/common/tutorial/tutorial_lesson.js index 467ad6e9..a29b4b016 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/tutorial/tutorial_lesson.js +++ b/chrome/browser/resources/chromeos/accessibility/common/tutorial/tutorial_lesson.js
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/account_manager/account_manager_shared_css.js b/chrome/browser/resources/chromeos/account_manager/account_manager_shared_css.js index 79f6b3e9..2cd4f3ff 100644 --- a/chrome/browser/resources/chromeos/account_manager/account_manager_shared_css.js +++ b/chrome/browser/resources/chromeos/account_manager/account_manager_shared_css.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; const template = document.createElement('template');
diff --git a/chrome/browser/resources/chromeos/arc_support/main.js b/chrome/browser/resources/chromeos/arc_support/main.js index c9842697..857b685 100644 --- a/chrome/browser/resources/chromeos/arc_support/main.js +++ b/chrome/browser/resources/chromeos/arc_support/main.js
@@ -4,5 +4,5 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js b/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js index 5460616..3228064 100644 --- a/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js +++ b/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_components/chromeos/bluetooth/bluetooth_dialog.js'; import 'chrome://resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/cr_page_host_style.css.js'; import './strings.m.js';
diff --git a/chrome/browser/resources/chromeos/crostini_installer/app.js b/chrome/browser/resources/chromeos/crostini_installer/app.js index 37ceb56..41af356e 100644 --- a/chrome/browser/resources/chromeos/crostini_installer/app.js +++ b/chrome/browser/resources/chromeos/crostini_installer/app.js
@@ -12,7 +12,7 @@ import 'chrome://resources/polymer/v3_0/paper-progress/paper-progress.js'; import 'chrome://crostini-installer/strings.m.js'; import 'chrome://resources/cros_elements/button/button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import {BrowserProxy} from 'chrome://crostini-installer/browser_proxy.js'; import {assert, assertNotReached} from 'chrome://resources/js/assert.m.js';
diff --git a/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_css.js b/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_css.js index e3ef878..011db9f 100644 --- a/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_css.js +++ b/chrome/browser/resources/chromeos/edu_coexistence/edu_coexistence_css.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/chromeos/cros_color_overrides.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; const template = document.createElement('template'); template.innerHTML = `
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html index 7c83bbcb..d82e2c57 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.html
@@ -261,7 +261,6 @@ class="side-padding" id="search-container" categories-data="[[categoriesData]]" - search="{{search}}" lazy-indexing="[[searchLazyIndexing]]" on-scroll="onSearchScroll" category-metadata="[[getCategoryMetadata(category)]]"
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js index d24e0a31..8fe62c69 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_picker.js
@@ -55,8 +55,6 @@ categoriesHistory: {type: Object, value: () => ({})}, /** @private {number} */ pagination: {type: Number, value: 1, observer: 'onPaginationChanged'}, - /** @private {string} */ - search: {type: String, value: '', observer: 'onSearchChanged'}, /** @private {boolean} */ searchLazyIndexing: {type: Boolean, value: true}, /** @private {boolean} */ @@ -122,6 +120,7 @@ this.addEventListener( events.CATEGORY_BUTTON_CLICK, ev => this.onCategoryButtonClick(ev.detail.categoryName)); + this.addEventListener('search', ev => this.onSearchChanged(ev.detail)); } /** @@ -600,11 +599,6 @@ * @param {boolean} updateTabsScroll */ updateActiveGroup(updateTabsScroll) { - // no need to update scroll state if search is showing. - if (this.search) { - return; - } - const activeGroupId = this.getActiveGroupIdFromScrollPosition(); this.set('pagination', this.getPaginationFromGroupId(activeGroupId)); this.updateChevrons();
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html index a501e02..b59ef4e6 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.html
@@ -171,7 +171,7 @@ </template> </div> -<template is="dom-if" if="[[search]]"> +<template is="dom-if" if="[[searchNotEmpty(searchResults)]]"> <div id="results" on-scroll="onSearchScroll"> <div class="sr-only" role="heading" aria-level="1"> Emoji Search Results
diff --git a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.js b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.js index f4891188..0c27273a 100644 --- a/chrome/browser/resources/chromeos/emoji_picker/emoji_search.js +++ b/chrome/browser/resources/chromeos/emoji_picker/emoji_search.js
@@ -23,12 +23,10 @@ return { /** @type {EmojiGroupData} */ categoriesData: {type: Array, readonly: true}, - /** @type {!string} */ - search: {type: String, notify: true}, /** @type {!boolean} */ lazyIndexing: {type: Boolean, value: true}, /** @private {EmojiGroupData} */ - searchResults: {type: Array, computed: 'computeSearchResults(search)'}, + searchResults: {type: Array}, /** @private {!boolean} */ v2Enabled: { type: Boolean, @@ -77,7 +75,7 @@ } onSearch(newSearch) { - this.search = newSearch; + this.searchResults = this.computeSearchResults(newSearch); } /** @@ -161,7 +159,7 @@ onSearchKeyDown(ev) { const resultsCount = this.getNumSearchResults(); // if not searching or no results, do nothing. - if (!this.search || resultsCount === 0) { + if (!this.$['search'].getValue() || resultsCount === 0) { return; } @@ -360,6 +358,27 @@ return this.searchResults.reduce( (acc, item) => acc + item.emoji.length, 0); } + + /** + * Checks if the search query is empty + * + * @param {!EmojiGroupData} searchResults Search results is not used but + * function needs to be run when searchResults updated. + * @returns {boolean} True if the search is empty + */ + searchNotEmpty(searchResults) { + return this.$['search'].getValue() !== ''; + } + + /** + * Sets the search query + * + * @param {!string} value for the search query + */ + setSearchQuery(value) { + /** @type {{setValue: function(string)}} */ (this.$['search']) + .setValue(value); + } } customElements.define(EmojiSearch.is, EmojiSearch);
diff --git a/chrome/browser/resources/chromeos/emulator/audio_settings.js b/chrome/browser/resources/chromeos/emulator/audio_settings.js index 4a77079..dfbb4aa 100644 --- a/chrome/browser/resources/chromeos/emulator/audio_settings.js +++ b/chrome/browser/resources/chromeos/emulator/audio_settings.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import './icons.js'; import './shared_styles.js';
diff --git a/chrome/browser/resources/chromeos/emulator/bluetooth_settings.js b/chrome/browser/resources/chromeos/emulator/bluetooth_settings.js index 3c83fc50..76bb4f6 100644 --- a/chrome/browser/resources/chromeos/emulator/bluetooth_settings.js +++ b/chrome/browser/resources/chromeos/emulator/bluetooth_settings.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import './icons.js'; import './shared_styles.js';
diff --git a/chrome/browser/resources/chromeos/internet_config_dialog/internet_config_dialog.js b/chrome/browser/resources/chromeos/internet_config_dialog/internet_config_dialog.js index f2d9700..abafa80 100644 --- a/chrome/browser/resources/chromeos/internet_config_dialog/internet_config_dialog.js +++ b/chrome/browser/resources/chromeos/internet_config_dialog/internet_config_dialog.js
@@ -8,7 +8,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_page_host_style.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {assert} from 'chrome://resources/js/assert.m.js';
diff --git a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js index 4b99f5f..8497479 100644 --- a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js +++ b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js
@@ -15,7 +15,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_page_host_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {isActiveSim} from 'chrome://resources/cr_components/chromeos/network/cellular_utils.m.js';
diff --git a/chrome/browser/resources/chromeos/login/components/buttons/oobe_back_button.html b/chrome/browser/resources/chromeos/login/components/buttons/oobe_back_button.html index 95f12d1d..5af45869 100644 --- a/chrome/browser/resources/chromeos/login/components/buttons/oobe_back_button.html +++ b/chrome/browser/resources/chromeos/login/components/buttons/oobe_back_button.html
@@ -7,7 +7,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="../common_styles/common_styles.html">
diff --git a/chrome/browser/resources/chromeos/login/components/buttons/oobe_icon_button.html b/chrome/browser/resources/chromeos/login/components/buttons/oobe_icon_button.html index 8127ee9..c97932e 100644 --- a/chrome/browser/resources/chromeos/login/components/buttons/oobe_icon_button.html +++ b/chrome/browser/resources/chromeos/login/components/buttons/oobe_icon_button.html
@@ -7,7 +7,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="../common_styles/common_styles.html"> <link rel="import" href="../hd_iron_icon.html">
diff --git a/chrome/browser/resources/chromeos/login/components/buttons/oobe_next_button.html b/chrome/browser/resources/chromeos/login/components/buttons/oobe_next_button.html index f53d59b..e1e47e5 100644 --- a/chrome/browser/resources/chromeos/login/components/buttons/oobe_next_button.html +++ b/chrome/browser/resources/chromeos/login/components/buttons/oobe_next_button.html
@@ -7,7 +7,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="../common_styles/common_styles.html">
diff --git a/chrome/browser/resources/chromeos/login/components/buttons/oobe_text_button.html b/chrome/browser/resources/chromeos/login/components/buttons/oobe_text_button.html index 7e738a9..4f960be4 100644 --- a/chrome/browser/resources/chromeos/login/components/buttons/oobe_text_button.html +++ b/chrome/browser/resources/chromeos/login/components/buttons/oobe_text_button.html
@@ -6,7 +6,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> <link rel="import" href="../common_styles/common_styles.html">
diff --git a/chrome/browser/resources/chromeos/login/components/dialogs/oobe_adaptive_dialog.html b/chrome/browser/resources/chromeos/login/components/dialogs/oobe_adaptive_dialog.html index b1a39a2..501eac3a 100644 --- a/chrome/browser/resources/chromeos/login/components/dialogs/oobe_adaptive_dialog.html +++ b/chrome/browser/resources/chromeos/login/components/dialogs/oobe_adaptive_dialog.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html">
diff --git a/chrome/browser/resources/chromeos/login/components/dialogs/oobe_content_dialog.html b/chrome/browser/resources/chromeos/login/components/dialogs/oobe_content_dialog.html index fb71d9a..090063d 100644 --- a/chrome/browser/resources/chromeos/login/components/dialogs/oobe_content_dialog.html +++ b/chrome/browser/resources/chromeos/login/components/dialogs/oobe_content_dialog.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html"> <link rel="import" href="../behaviors/oobe_focus_behavior.html">
diff --git a/chrome/browser/resources/chromeos/login/components/dialogs/oobe_modal_dialog.html b/chrome/browser/resources/chromeos/login/components/dialogs/oobe_modal_dialog.html index b71103e..c669359 100644 --- a/chrome/browser/resources/chromeos/login/components/dialogs/oobe_modal_dialog.html +++ b/chrome/browser/resources/chromeos/login/components/dialogs/oobe_modal_dialog.html
@@ -5,7 +5,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="../behaviors/oobe_i18n_behavior.html"> <link rel="import" href="../buttons/oobe_text_button.html">
diff --git a/chrome/browser/resources/chromeos/login/components/gaia_dialog.html b/chrome/browser/resources/chromeos/login/components/gaia_dialog.html index 5bb19a6..2e94eb3 100644 --- a/chrome/browser/resources/chromeos/login/components/gaia_dialog.html +++ b/chrome/browser/resources/chromeos/login/components/gaia_dialog.html
@@ -7,7 +7,7 @@ <link rel="import" href="chrome://resources/html/load_time_data.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../../gaia_auth_host/authenticator.html"> <link rel="import" href="./oobe_types.html">
diff --git a/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni b/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni index 310e308d..c79438c 100644 --- a/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni +++ b/chrome/browser/resources/chromeos/login/oobe_auto_imports.gni
@@ -105,6 +105,7 @@ "ui/webui/resources/cr_elements/cr_radio_button/cr_card_radio_button.html", "ui/webui/resources/cr_elements/cr_radio_group/cr_radio_group.html", "ui/webui/resources/cr_elements/cr_scrollable_behavior.html", + "ui/webui/resources/cr_elements/cr_shared_style.css.html", "ui/webui/resources/cr_elements/cr_toggle/cr_toggle.html", "ui/webui/resources/cr_elements/md_select.css.html", "ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_enter_code_page.html",
diff --git a/chrome/browser/resources/chromeos/login/screens/common/consolidated_consent.html b/chrome/browser/resources/chromeos/login/screens/common/consolidated_consent.html index 6e697bb..cc919b7 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/consolidated_consent.html +++ b/chrome/browser/resources/chromeos/login/screens/common/consolidated_consent.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html"> <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="chrome://resources/html/load_time_data.html">
diff --git a/chrome/browser/resources/chromeos/login/screens/common/guest_tos.html b/chrome/browser/resources/chromeos/login/screens/common/guest_tos.html index 71bf83fd..87117f5 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/guest_tos.html +++ b/chrome/browser/resources/chromeos/login/screens/common/guest_tos.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html"> <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
diff --git a/chrome/browser/resources/chromeos/login/screens/common/hw_data_collection.html b/chrome/browser/resources/chromeos/login/screens/common/hw_data_collection.html index 189ba17b..83c9368 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/hw_data_collection.html +++ b/chrome/browser/resources/chromeos/login/screens/common/hw_data_collection.html
@@ -5,7 +5,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="../../components/oobe_icons.html">
diff --git a/chrome/browser/resources/chromeos/login/screens/common/oobe_eula.html b/chrome/browser/resources/chromeos/login/screens/common/oobe_eula.html index b769938..8264d08a 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/oobe_eula.html +++ b/chrome/browser/resources/chromeos/login/screens/common/oobe_eula.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html"> <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="chrome://resources/html/assert.html">
diff --git a/chrome/browser/resources/chromeos/login/screens/common/pin_setup.js b/chrome/browser/resources/chromeos/login/screens/common/pin_setup.js index b1e7507..7528220 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/pin_setup.js +++ b/chrome/browser/resources/chromeos/login/screens/common/pin_setup.js
@@ -4,7 +4,7 @@ import '//resources/cr_components/chromeos/quick_unlock/setup_pin_keyboard.m.js'; import '//resources/cr_elements/cr_input/cr_input.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import '../../components/oobe_icons.m.js'; import '../../components/common_styles/common_styles.m.js';
diff --git a/chrome/browser/resources/chromeos/login/screens/common/saml_confirm_password.js b/chrome/browser/resources/chromeos/login/screens/common/saml_confirm_password.js index 50dd421f..a65cedb2 100644 --- a/chrome/browser/resources/chromeos/login/screens/common/saml_confirm_password.js +++ b/chrome/browser/resources/chromeos/login/screens/common/saml_confirm_password.js
@@ -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 '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/cr_button/cr_button.js'; import '//resources/cr_elements/cr_input/cr_input.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/chromeos/login/screens/login/active_directory_password_change.html b/chrome/browser/resources/chromeos/login/screens/login/active_directory_password_change.html index 4848b9c..9b6d47f 100644 --- a/chrome/browser/resources/chromeos/login/screens/login/active_directory_password_change.html +++ b/chrome/browser/resources/chromeos/login/screens/login/active_directory_password_change.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
diff --git a/chrome/browser/resources/chromeos/login/screens/login/offline_login.html b/chrome/browser/resources/chromeos/login/screens/login/offline_login.html index dea09bb..39d58b4e 100644 --- a/chrome/browser/resources/chromeos/login/screens/login/offline_login.html +++ b/chrome/browser/resources/chromeos/login/screens/login/offline_login.html
@@ -4,7 +4,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
diff --git a/chrome/browser/resources/chromeos/login/screens/oobe/welcome_dialog.html b/chrome/browser/resources/chromeos/login/screens/oobe/welcome_dialog.html index 0757c69..534e2f4 100644 --- a/chrome/browser/resources/chromeos/login/screens/oobe/welcome_dialog.html +++ b/chrome/browser/resources/chromeos/login/screens/oobe/welcome_dialog.html
@@ -9,7 +9,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/load_time_data.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../components/oobe_icons.html"> <link rel="import" href="../../components/oobe_cr_lottie.html">
diff --git a/chrome/browser/resources/chromeos/login/test_api/test_api.js b/chrome/browser/resources/chromeos/login/test_api/test_api.js index 843bb8c..5f0a4b3 100644 --- a/chrome/browser/resources/chromeos/login/test_api/test_api.js +++ b/chrome/browser/resources/chromeos/login/test_api/test_api.js
@@ -117,7 +117,7 @@ // Must be called to enable the next button emulateDevicesConnected() { - chrome.send('HIDDetectionScreen.emulateDevicesConnectedForTesting'); + chrome.send('OobeTestApi.emulateDevicesForTesting'); } touchscreenDetected() {
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_metadata_form.js b/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_metadata_form.js index d5d88f6..0ce8edde 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_metadata_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_metadata_form.js
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {BrowserTabsMetadataModel, ImageType, imageTypeToStringMap} from './types.js'; Polymer({
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_model_form.js b/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_model_form.js index fc2d7f78..74c90c0 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_model_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/browser_tabs_model_form.js
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js'; import './browser_tabs_metadata_form.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {MultidevicePhoneHubBrowserProxy} from './multidevice_phonehub_browser_proxy.js'; import {BrowserTabsMetadataModel, BrowserTabsModel} from './types.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/camera_roll_manager_form.js b/chrome/browser/resources/chromeos/multidevice_internals/camera_roll_manager_form.js index 1d479477..cc8070d8 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/camera_roll_manager_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/camera_roll_manager_form.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/notification_form.js b/chrome/browser/resources/chromeos/multidevice_internals/notification_form.js index 6596a74..fb9e25a9 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/notification_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/notification_form.js
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js'; import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {MultidevicePhoneHubBrowserProxy} from './multidevice_phonehub_browser_proxy.js'; import {ImageType, imageTypeToStringMap, Importance, importanceToString, Notification} from './types.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/notification_manager.js b/chrome/browser/resources/chromeos/multidevice_internals/notification_manager.js index f41d306..391f57f 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/notification_manager.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/notification_manager.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/phone_name_form.js b/chrome/browser/resources/chromeos/multidevice_internals/phone_name_form.js index a7e2a52..bf06ac68 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/phone_name_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/phone_name_form.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/phone_status_model_form.js b/chrome/browser/resources/chromeos/multidevice_internals/phone_status_model_form.js index 605e9c0..6681d5d 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/phone_status_model_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/phone_status_model_form.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/phonehub_tab.js b/chrome/browser/resources/chromeos/multidevice_internals/phonehub_tab.js index 30f2d8b..7554c9c 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/phonehub_tab.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/phonehub_tab.js
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './browser_tabs_model_form.js'; import './camera_roll_manager_form.js'; import './i18n_setup.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/quick_action_controller_form.js b/chrome/browser/resources/chromeos/multidevice_internals/quick_action_controller_form.js index 8f13fdfc..49bb5cd 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/quick_action_controller_form.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/quick_action_controller_form.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/chromeos/multidevice_internals/shared_style.js b/chrome/browser/resources/chromeos/multidevice_internals/shared_style.js index ce15f967..8b3d72e1 100644 --- a/chrome/browser/resources/chromeos/multidevice_internals/shared_style.js +++ b/chrome/browser/resources/chromeos/multidevice_internals/shared_style.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; const template = document.createElement('template'); template.innerHTML = ` <dom-module id="shared-style">{__html_template__}</dom-module>
diff --git a/chrome/browser/resources/chromeos/network_ui/network_logs_ui.js b/chrome/browser/resources/chromeos/network_ui/network_logs_ui.js index c87e8a6..ba74ec4 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_logs_ui.js +++ b/chrome/browser/resources/chromeos/network_ui/network_logs_ui.js
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/network_ui/network_metrics_ui.js b/chrome/browser/resources/chromeos/network_ui/network_metrics_ui.js index ae34c903..889a497 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_metrics_ui.js +++ b/chrome/browser/resources/chromeos/network_ui/network_metrics_ui.js
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/chromeos/network_ui/network_state_ui.js b/chrome/browser/resources/chromeos/network_ui/network_state_ui.js index 2ff1338..4fabf663 100644 --- a/chrome/browser/resources/chromeos/network_ui/network_state_ui.js +++ b/chrome/browser/resources/chromeos/network_ui/network_state_ui.js
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_components/chromeos/network/network_icon.m.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_components/chromeos/network/network_icon.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; import 'chrome://resources/mojo/chromeos/services/network_config/public/mojom/cros_network_config.mojom-lite.js';
diff --git a/chrome/browser/resources/chromeos/password_change/password_change.html b/chrome/browser/resources/chromeos/password_change/password_change.html index 5eebdd3..a6ac5524 100644 --- a/chrome/browser/resources/chromeos/password_change/password_change.html +++ b/chrome/browser/resources/chromeos/password_change/password_change.html
@@ -8,7 +8,7 @@ <script src="chrome://resources/js/assert.js"></script> <script src="chrome://resources/js/util.js"></script> - <script src="chrome://password-change/authenticator.js"></script> + <script src="chrome://password-change/password_change_authenticator.js"></script> <script type="module" src="chrome://password-change/password_change.js"></script>
diff --git a/chrome/browser/resources/chromeos/set_time_dialog/set_time_dialog.js b/chrome/browser/resources/chromeos/set_time_dialog/set_time_dialog.js index 4b39ca2..2dcecc3 100644 --- a/chrome/browser/resources/chromeos/set_time_dialog/set_time_dialog.js +++ b/chrome/browser/resources/chromeos/set_time_dialog/set_time_dialog.js
@@ -16,7 +16,7 @@ import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_page_host_style.css.js'; import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {assert} from 'chrome://resources/js/assert.m.js';
diff --git a/chrome/browser/resources/discards/discards_main.ts b/chrome/browser/resources/discards/discards_main.ts index a6a5da33..3879c015 100644 --- a/chrome/browser/resources/discards/discards_main.ts +++ b/chrome/browser/resources/discards/discards_main.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_tabs/cr_tabs.js'; import 'chrome://resources/polymer/v3_0/iron-location/iron-location.js'; import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js'; @@ -11,6 +11,7 @@ import './graph_tab_template.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './discards_main.html.js'; class DiscardsMainElement extends PolymerElement {
diff --git a/chrome/browser/resources/downloads/item.ts b/chrome/browser/resources/downloads/item.ts index 0380b15..7c54935 100644 --- a/chrome/browser/resources/downloads/item.ts +++ b/chrome/browser/resources/downloads/item.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js';
diff --git a/chrome/browser/resources/downloads/manager.ts b/chrome/browser/resources/downloads/manager.ts index 3e03a146..54fc131 100644 --- a/chrome/browser/resources/downloads/manager.ts +++ b/chrome/browser/resources/downloads/manager.ts
@@ -7,9 +7,9 @@ import './toolbar.js'; import 'chrome://resources/cr_components/managed_footnote/managed_footnote.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_page_host_style.css.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js';
diff --git a/chrome/browser/resources/downloads/toolbar.ts b/chrome/browser/resources/downloads/toolbar.ts index f87344a..aff8e8b6 100644 --- a/chrome/browser/resources/downloads/toolbar.ts +++ b/chrome/browser/resources/downloads/toolbar.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/util.m.js';
diff --git a/chrome/browser/resources/extensions/activity_log/activity_log.ts b/chrome/browser/resources/extensions/activity_log/activity_log.ts index d5f9590..fe377fb 100644 --- a/chrome/browser/resources/extensions/activity_log/activity_log.ts +++ b/chrome/browser/resources/extensions/activity_log/activity_log.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_tabs/cr_tabs.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js'; import './activity_log_stream.js';
diff --git a/chrome/browser/resources/extensions/code_section.ts b/chrome/browser/resources/extensions/code_section.ts index 45168de..c5c8f7a 100644 --- a/chrome/browser/resources/extensions/code_section.ts +++ b/chrome/browser/resources/extensions/code_section.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/paper-styles/color.js'; import './strings.m.js'; @@ -10,6 +10,7 @@ import {I18nMixin} from 'chrome://resources/js/i18n_mixin.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './code_section.html.js';
diff --git a/chrome/browser/resources/extensions/detail_view.ts b/chrome/browser/resources/extensions/detail_view.ts index 22ed77e..359dec6 100644 --- a/chrome/browser/resources/extensions/detail_view.ts +++ b/chrome/browser/resources/extensions/detail_view.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_tooltip_icon.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js'; import 'chrome://resources/cr_elements/action_link.css.js';
diff --git a/chrome/browser/resources/extensions/drop_overlay.ts b/chrome/browser/resources/extensions/drop_overlay.ts index 71fbbd6..3d57953 100644 --- a/chrome/browser/resources/extensions/drop_overlay.ts +++ b/chrome/browser/resources/extensions/drop_overlay.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/extensions/error_page.ts b/chrome/browser/resources/extensions/error_page.ts index 02288d77..74cb376 100644 --- a/chrome/browser/resources/extensions/error_page.ts +++ b/chrome/browser/resources/extensions/error_page.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/extensions/host_permissions_toggle_list.ts b/chrome/browser/resources/extensions/host_permissions_toggle_list.ts index 3d06a85..cc2997b 100644 --- a/chrome/browser/resources/extensions/host_permissions_toggle_list.ts +++ b/chrome/browser/resources/extensions/host_permissions_toggle_list.ts
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/extensions/install_warnings_dialog.ts b/chrome/browser/resources/extensions/install_warnings_dialog.ts index 2a43d64..5600c903 100644 --- a/chrome/browser/resources/extensions/install_warnings_dialog.ts +++ b/chrome/browser/resources/extensions/install_warnings_dialog.ts
@@ -4,12 +4,13 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/paper-styles/color.js'; import './code_section.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './install_warnings_dialog.html.js'; interface ExtensionsInstallWarningsDialogElement {
diff --git a/chrome/browser/resources/extensions/item.ts b/chrome/browser/resources/extensions/item.ts index d7494a19..4929820 100644 --- a/chrome/browser/resources/extensions/item.ts +++ b/chrome/browser/resources/extensions/item.ts
@@ -6,9 +6,9 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js'; import 'chrome://resources/cr_elements/action_link.css.js';
diff --git a/chrome/browser/resources/extensions/keyboard_shortcuts.ts b/chrome/browser/resources/extensions/keyboard_shortcuts.ts index ce83138f..1074f74 100644 --- a/chrome/browser/resources/extensions/keyboard_shortcuts.ts +++ b/chrome/browser/resources/extensions/keyboard_shortcuts.ts
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/polymer/v3_0/paper-styles/color.js';
diff --git a/chrome/browser/resources/extensions/kiosk_dialog.ts b/chrome/browser/resources/extensions/kiosk_dialog.ts index 956bd89..f9d07cf 100644 --- a/chrome/browser/resources/extensions/kiosk_dialog.ts +++ b/chrome/browser/resources/extensions/kiosk_dialog.ts
@@ -8,7 +8,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {CrCheckboxElement} from 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js';
diff --git a/chrome/browser/resources/extensions/load_error.ts b/chrome/browser/resources/extensions/load_error.ts index e0d17a5..d1349917 100644 --- a/chrome/browser/resources/extensions/load_error.ts +++ b/chrome/browser/resources/extensions/load_error.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js'; import './code_section.js'; import './strings.m.js';
diff --git a/chrome/browser/resources/extensions/manager.ts b/chrome/browser/resources/extensions/manager.ts index 7508b62..ebe5d78 100644 --- a/chrome/browser/resources/extensions/manager.ts +++ b/chrome/browser/resources/extensions/manager.ts
@@ -7,7 +7,7 @@ import 'chrome://resources/cr_elements/cr_toast/cr_toast_manager.js'; import 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.js'; import 'chrome://resources/cr_elements/cr_view_manager/cr_view_manager.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './activity_log/activity_log.js'; import './detail_view.js';
diff --git a/chrome/browser/resources/extensions/pack_dialog.ts b/chrome/browser/resources/extensions/pack_dialog.ts index f7e7b991..1f24ec5 100644 --- a/chrome/browser/resources/extensions/pack_dialog.ts +++ b/chrome/browser/resources/extensions/pack_dialog.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './pack_dialog_alert.js'; import './strings.m.js'; @@ -13,6 +13,7 @@ import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './pack_dialog.html.js'; export interface PackDialogDelegate {
diff --git a/chrome/browser/resources/extensions/pack_dialog_alert.ts b/chrome/browser/resources/extensions/pack_dialog_alert.ts index e2609cb..d1acf56 100644 --- a/chrome/browser/resources/extensions/pack_dialog_alert.ts +++ b/chrome/browser/resources/extensions/pack_dialog_alert.ts
@@ -4,12 +4,13 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import {assert, assertNotReached} from 'chrome://resources/js/assert_ts.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './pack_dialog_alert.html.js'; export interface ExtensionsPackDialogAlertElement {
diff --git a/chrome/browser/resources/extensions/restricted_sites_dialog.ts b/chrome/browser/resources/extensions/restricted_sites_dialog.ts index 713bff01..af85550e 100644 --- a/chrome/browser/resources/extensions/restricted_sites_dialog.ts +++ b/chrome/browser/resources/extensions/restricted_sites_dialog.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './strings.m.js';
diff --git a/chrome/browser/resources/extensions/runtime_host_permissions.ts b/chrome/browser/resources/extensions/runtime_host_permissions.ts index 796ef8c..6b44a518 100644 --- a/chrome/browser/resources/extensions/runtime_host_permissions.ts +++ b/chrome/browser/resources/extensions/runtime_host_permissions.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js'; import 'chrome://resources/cr_elements/action_link.css.js';
diff --git a/chrome/browser/resources/extensions/runtime_hosts_dialog.ts b/chrome/browser/resources/extensions/runtime_hosts_dialog.ts index f098b48..62df9ce 100644 --- a/chrome/browser/resources/extensions/runtime_hosts_dialog.ts +++ b/chrome/browser/resources/extensions/runtime_hosts_dialog.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './strings.m.js'; import './shared_vars.css.js';
diff --git a/chrome/browser/resources/extensions/shared_style.css b/chrome/browser/resources/extensions/shared_style.css index 083a9f3..599c2a0b 100644 --- a/chrome/browser/resources/extensions/shared_style.css +++ b/chrome/browser/resources/extensions/shared_style.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #import=./shared_vars.css.js * #include=cr-shared-style
diff --git a/chrome/browser/resources/extensions/shortcut_input.ts b/chrome/browser/resources/extensions/shortcut_input.ts index 1a203e1e..5370929d 100644 --- a/chrome/browser/resources/extensions/shortcut_input.ts +++ b/chrome/browser/resources/extensions/shortcut_input.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/paper-styles/color.js'; import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js';
diff --git a/chrome/browser/resources/extensions/sidebar.ts b/chrome/browser/resources/extensions/sidebar.ts index cec1980..a8e1313d 100644 --- a/chrome/browser/resources/extensions/sidebar.ts +++ b/chrome/browser/resources/extensions/sidebar.ts
@@ -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 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js'; import 'chrome://resources/polymer/v3_0/paper-ripple/paper-ripple.js'; import 'chrome://resources/polymer/v3_0/paper-styles/color.js';
diff --git a/chrome/browser/resources/extensions/site_permissions.ts b/chrome/browser/resources/extensions/site_permissions.ts index 1e5f587..bc54696 100644 --- a/chrome/browser/resources/extensions/site_permissions.ts +++ b/chrome/browser/resources/extensions/site_permissions.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './strings.m.js'; import './shared_style.css.js';
diff --git a/chrome/browser/resources/extensions/site_permissions_by_site.ts b/chrome/browser/resources/extensions/site_permissions_by_site.ts index 4cf1523..3e8aa2d1 100644 --- a/chrome/browser/resources/extensions/site_permissions_by_site.ts +++ b/chrome/browser/resources/extensions/site_permissions_by_site.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './shared_style.css.js'; import './shared_vars.css.js'; import './site_permissions_site_group.js';
diff --git a/chrome/browser/resources/extensions/site_permissions_edit_permissions_dialog.ts b/chrome/browser/resources/extensions/site_permissions_edit_permissions_dialog.ts index 83d6946..7d1e257b 100644 --- a/chrome/browser/resources/extensions/site_permissions_edit_permissions_dialog.ts +++ b/chrome/browser/resources/extensions/site_permissions_edit_permissions_dialog.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.js'; import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/browser/resources/extensions/site_permissions_edit_url_dialog.ts b/chrome/browser/resources/extensions/site_permissions_edit_url_dialog.ts index 2fdd3ca..51200f81 100644 --- a/chrome/browser/resources/extensions/site_permissions_edit_url_dialog.ts +++ b/chrome/browser/resources/extensions/site_permissions_edit_url_dialog.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/browser/resources/extensions/site_permissions_list.ts b/chrome/browser/resources/extensions/site_permissions_list.ts index 9481fa5f..61a02d1 100644 --- a/chrome/browser/resources/extensions/site_permissions_list.ts +++ b/chrome/browser/resources/extensions/site_permissions_list.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './strings.m.js'; import './shared_style.css.js';
diff --git a/chrome/browser/resources/extensions/site_permissions_site_group.ts b/chrome/browser/resources/extensions/site_permissions_site_group.ts index ba4b937f..18b3afc 100644 --- a/chrome/browser/resources/extensions/site_permissions_site_group.ts +++ b/chrome/browser/resources/extensions/site_permissions_site_group.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './strings.m.js'; import './shared_style.css.js';
diff --git a/chrome/browser/resources/extensions/toggle_row.ts b/chrome/browser/resources/extensions/toggle_row.ts index 3b50bed..00b5ba0 100644 --- a/chrome/browser/resources/extensions/toggle_row.ts +++ b/chrome/browser/resources/extensions/toggle_row.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {CrToggleElement} from 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/extensions/toolbar.ts b/chrome/browser/resources/extensions/toolbar.ts index 7517774..5d2363bf 100644 --- a/chrome/browser/resources/extensions/toolbar.ts +++ b/chrome/browser/resources/extensions/toolbar.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/policy/cr_tooltip_icon.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/paper-styles/color.js';
diff --git a/chrome/browser/resources/history/app.ts b/chrome/browser/resources/history/app.ts index b422bfeb..40cdfad 100644 --- a/chrome/browser/resources/history/app.ts +++ b/chrome/browser/resources/history/app.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_components/history_clusters/clusters.js'; import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/cr_tabs/cr_tabs.js'; import 'chrome://resources/polymer/v3_0/iron-media-query/iron-media-query.js';
diff --git a/chrome/browser/resources/history/history_list.ts b/chrome/browser/resources/history/history_list.ts index e6789866c..9f78c361 100644 --- a/chrome/browser/resources/history/history_list.ts +++ b/chrome/browser/resources/history/history_list.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import 'chrome://resources/polymer/v3_0/iron-scroll-threshold/iron-scroll-threshold.js'; import './shared_style.css.js';
diff --git a/chrome/browser/resources/history/shared_style.css b/chrome/browser/resources/history/shared_style.css index 9b07ee4..1d2f6d07 100644 --- a/chrome/browser/resources/history/shared_style.css +++ b/chrome/browser/resources/history/shared_style.css
@@ -5,7 +5,7 @@ /* #css_wrapper_metadata_start * #type=style * #import=./shared_vars.css.js - * #import=chrome://resources/cr_elements/hidden_style_css.m.js + * #import=chrome://resources/cr_elements/cr_hidden_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #include=cr-hidden-style * #css_wrapper_metadata_end */
diff --git a/chrome/browser/resources/history/synced_device_manager.ts b/chrome/browser/resources/history/synced_device_manager.ts index 43b6108..d70de3e 100644 --- a/chrome/browser/resources/history/synced_device_manager.ts +++ b/chrome/browser/resources/history/synced_device_manager.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './shared_style.css.js'; import './synced_device_card.js';
diff --git a/chrome/browser/resources/management/management_ui.ts b/chrome/browser/resources/management/management_ui.ts index e2a0b7b2..578f5f92 100644 --- a/chrome/browser/resources/management/management_ui.ts +++ b/chrome/browser/resources/management/management_ui.ts
@@ -6,9 +6,9 @@ import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_page_host_style.css.js'; import 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './icons.html.js'; import './strings.m.js';
diff --git a/chrome/browser/resources/media_router/cast_feedback/cast_feedback_ui.ts b/chrome/browser/resources/media_router/cast_feedback/cast_feedback_ui.ts index 23d365a..7ba8225 100644 --- a/chrome/browser/resources/media_router/cast_feedback/cast_feedback_ui.ts +++ b/chrome/browser/resources/media_router/cast_feedback/cast_feedback_ui.ts
@@ -9,7 +9,7 @@ import '//resources/cr_elements/cr_input/cr_input.js'; import '//resources/cr_elements/cr_radio_button/cr_radio_button.js'; import '//resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/shared_vars_css.m.js'; import {CrDialogElement} from '//resources/cr_elements/cr_dialog/cr_dialog.js';
diff --git a/chrome/browser/resources/nearby_internals/contact_tab.js b/chrome/browser/resources/nearby_internals/contact_tab.js index 5108485d..f958c18 100644 --- a/chrome/browser/resources/nearby_internals/contact_tab.js +++ b/chrome/browser/resources/nearby_internals/contact_tab.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import './contact_object.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/nearby_internals/http_tab.js b/chrome/browser/resources/nearby_internals/http_tab.js index 3788a24..2ae3d9e 100644 --- a/chrome/browser/resources/nearby_internals/http_tab.js +++ b/chrome/browser/resources/nearby_internals/http_tab.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import './http_message_object.js'; import './shared_style.js';
diff --git a/chrome/browser/resources/nearby_internals/shared_style.js b/chrome/browser/resources/nearby_internals/shared_style.js index 65a361d..ff48917 100644 --- a/chrome/browser/resources/nearby_internals/shared_style.js +++ b/chrome/browser/resources/nearby_internals/shared_style.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; const styleMod = document.createElement('dom-module'); styleMod.innerHTML = `{__html_template__}`;
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_contact_visibility.js b/chrome/browser/resources/nearby_share/shared/nearby_contact_visibility.js index 91e3dce5..854029c5c 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_contact_visibility.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_contact_visibility.js
@@ -8,7 +8,7 @@ * embedded in the nearby_visibility_page as well as the settings pop-up dialog. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; import 'chrome://resources/cr_elements/cr_radio_button/cr_card_radio_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_device.js b/chrome/browser/resources/nearby_share/shared/nearby_device.js index b68f4d4f..f358328 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_device.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_device.js
@@ -7,7 +7,7 @@ */ import 'chrome://resources/cr_elements/cr_auto_img/cr_auto_img.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './nearby_shared_icons.html.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_device_icon.js b/chrome/browser/resources/nearby_share/shared/nearby_device_icon.js index 3e24870..1a9ef0b 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_device_icon.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_device_icon.js
@@ -8,7 +8,7 @@ * type. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './nearby_shared_icons.html.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_onboarding_one_page.js b/chrome/browser/resources/nearby_share/shared/nearby_onboarding_one_page.js index 14ce4200..f803b9e 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_onboarding_one_page.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_onboarding_one_page.js
@@ -8,7 +8,7 @@ * chrome://settings and as a standalone dialog via chrome://nearby. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_onboarding_page.js b/chrome/browser/resources/nearby_share/shared/nearby_onboarding_page.js index a5fec36..9380f38 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_onboarding_page.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_onboarding_page.js
@@ -8,7 +8,7 @@ * and as a standalone dialog via chrome://nearby. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_page_template.js b/chrome/browser/resources/nearby_share/shared/nearby_page_template.js index 599a2a9..b341985 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_page_template.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_page_template.js
@@ -8,7 +8,7 @@ * and button options. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_preview.js b/chrome/browser/resources/nearby_share/shared/nearby_preview.js index bcf9499f..059584c 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_preview.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_preview.js
@@ -7,7 +7,7 @@ * sent to a remote device. The data might be some plain text, a URL or a file. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './nearby_shared_icons.html.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_progress.js b/chrome/browser/resources/nearby_share/shared/nearby_progress.js index 6204017..9611717a 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_progress.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_progress.js
@@ -10,7 +10,7 @@ */ import 'chrome://resources/cr_elements/cr_auto_img/cr_auto_img.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import './nearby_shared_icons.html.js'; import './nearby_device_icon.js';
diff --git a/chrome/browser/resources/nearby_share/shared/nearby_visibility_page.js b/chrome/browser/resources/nearby_share/shared/nearby_visibility_page.js index 5b6ec942..6ed871b7 100644 --- a/chrome/browser/resources/nearby_share/shared/nearby_visibility_page.js +++ b/chrome/browser/resources/nearby_share/shared/nearby_visibility_page.js
@@ -12,7 +12,7 @@ * dialog via chrome://nearby. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js';
diff --git a/chrome/browser/resources/new_tab_page/app.ts b/chrome/browser/resources/new_tab_page/app.ts index 59ae8ed..7e964dbf 100644 --- a/chrome/browser/resources/new_tab_page/app.ts +++ b/chrome/browser/resources/new_tab_page/app.ts
@@ -6,7 +6,7 @@ import './realbox/realbox.js'; import './logo.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {startColorChangeUpdater} from 'chrome://resources/cr_components/color_change_listener/colors_css_updater.js'; import {ClickInfo, Command} from 'chrome://resources/js/browser_command/browser_command.mojom-webui.js';
diff --git a/chrome/browser/resources/new_tab_page/customize_backgrounds.ts b/chrome/browser/resources/new_tab_page/customize_backgrounds.ts index 7dc94c5..ae3332a 100644 --- a/chrome/browser/resources/new_tab_page/customize_backgrounds.ts +++ b/chrome/browser/resources/new_tab_page/customize_backgrounds.ts
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_grid/cr_grid.js'; import './mini_page.js'; import './iframe.js'; import {DomRepeat, DomRepeatEvent, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {getTemplate} from './customize_backgrounds.html.js'; +import {getTemplate} from './customize_backgrounds.html.js'; import {loadTimeData} from './i18n_setup.js'; import {BackgroundCollection, CollectionImage, CustomizeDialogAction, PageHandlerRemote, Theme} from './new_tab_page.mojom-webui.js'; import {NewTabPageProxy} from './new_tab_page_proxy.js';
diff --git a/chrome/browser/resources/new_tab_page/customize_dialog.ts b/chrome/browser/resources/new_tab_page/customize_dialog.ts index b82151d..b2fc914e 100644 --- a/chrome/browser/resources/new_tab_page/customize_dialog.ts +++ b/chrome/browser/resources/new_tab_page/customize_dialog.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js'; import 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js'; import 'chrome://resources/cr_components/customize_themes/customize_themes.js';
diff --git a/chrome/browser/resources/new_tab_page/logo.ts b/chrome/browser/resources/new_tab_page/logo.ts index 2743709..4c427a1 100644 --- a/chrome/browser/resources/new_tab_page/logo.ts +++ b/chrome/browser/resources/new_tab_page/logo.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import './iframe.js'; import './doodle_share_dialog.js';
diff --git a/chrome/browser/resources/new_tab_page/modules/cart/module.ts b/chrome/browser/resources/new_tab_page/modules/cart/module.ts index 5fac0de..787a26d7 100644 --- a/chrome/browser/resources/new_tab_page/modules/cart/module.ts +++ b/chrome/browser/resources/new_tab_page/modules/cart/module.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import '../module_header.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js';
diff --git a/chrome/browser/resources/new_tab_page/modules/cart_v2/module.ts b/chrome/browser/resources/new_tab_page/modules/cart_v2/module.ts index e924cbc..0f6a4b6 100644 --- a/chrome/browser/resources/new_tab_page/modules/cart_v2/module.ts +++ b/chrome/browser/resources/new_tab_page/modules/cart_v2/module.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import '../module_header.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js';
diff --git a/chrome/browser/resources/new_tab_page/modules/modules.ts b/chrome/browser/resources/new_tab_page/modules/modules.ts index 69225e8e..bcd8da8 100644 --- a/chrome/browser/resources/new_tab_page/modules/modules.ts +++ b/chrome/browser/resources/new_tab_page/modules/modules.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_toast/cr_toast.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/browser/resources/new_tab_page/modules/recipes/module.ts b/chrome/browser/resources/new_tab_page/modules/recipes/module.ts index 7043ef9..08daa9f 100644 --- a/chrome/browser/resources/new_tab_page/modules/recipes/module.ts +++ b/chrome/browser/resources/new_tab_page/modules/recipes/module.ts
@@ -5,7 +5,7 @@ import '../module_header.js'; import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; import 'chrome://resources/cr_elements/cr_auto_img/cr_auto_img.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import {CrLazyRenderElement} from 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; import {DomRepeat, DomRepeatEvent, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/new_tab_page/realbox/realbox_action.ts b/chrome/browser/resources/new_tab_page/realbox/realbox_action.ts index fde5b66..41baf04 100644 --- a/chrome/browser/resources/new_tab_page/realbox/realbox_action.ts +++ b/chrome/browser/resources/new_tab_page/realbox/realbox_action.ts
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/new_tab_page/realbox/realbox_match.ts b/chrome/browser/resources/new_tab_page/realbox/realbox_match.ts index b69f6e2..bdb4757 100644 --- a/chrome/browser/resources/new_tab_page/realbox/realbox_match.ts +++ b/chrome/browser/resources/new_tab_page/realbox/realbox_match.ts
@@ -7,7 +7,7 @@ import './realbox_dropdown_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/password_manager/password_manager.ts b/chrome/browser/resources/password_manager/password_manager.ts index b0c4ef05..a00f95cf 100644 --- a/chrome/browser/resources/password_manager/password_manager.ts +++ b/chrome/browser/resources/password_manager/password_manager.ts
@@ -5,6 +5,6 @@ import './password_manager_app.js'; export {PasswordManagerAppElement} from './password_manager_app.js'; -export {Page, RouteObserverMixin, RouteObserverMixinInterface, Router} from './router.js'; +export {Page, Route, RouteObserverMixin, RouteObserverMixinInterface, Router, UrlParam} from './router.js'; export {PasswordManagerSideBarElement} from './side_bar.js'; export {PasswordManagerToolbarElement} from './toolbar.js';
diff --git a/chrome/browser/resources/password_manager/router.ts b/chrome/browser/resources/password_manager/router.ts index 1160055..bb3c4a5 100644 --- a/chrome/browser/resources/password_manager/router.ts +++ b/chrome/browser/resources/password_manager/router.ts
@@ -14,6 +14,15 @@ SETTINGS = 'settings', } +export enum UrlParam { + SEARCH_TERM = 'q', +} + +export class Route { + page: Page; + queryParameters: URLSearchParams; +} + /** * A helper object to manage in-page navigations. Since the Password Manager * page needs to support different urls for different subpages (like the checkup @@ -24,7 +33,8 @@ return routerInstance || (routerInstance = new Router()); } - private currentPage_: Page = Page.PASSWORDS; + private currentRoute_: + Route = {page: Page.PASSWORDS, queryParameters: new URLSearchParams()}; private routeObservers_: Set<RouteObserverMixinInterface> = new Set(); constructor() { @@ -44,51 +54,84 @@ assert(this.routeObservers_.delete(observer)); } - get currentPage(): Page { - return this.currentPage_; + get currentRoute(): Route { + return this.currentRoute_; } /** * Navigates to a page and pushes a new history entry. */ navigateTo(page: Page) { - if (page === this.currentPage_) { + if (page === this.currentRoute_.page) { return; } - this.currentPage_ = page; + const oldRoute = this.currentRoute_; + this.currentRoute_ = { + page: page, + queryParameters: new URLSearchParams(), + }; const path = '/' + page; const state = {url: path}; history.pushState(state, '', path); - this.notifyObservers_(); + this.notifyObservers_(oldRoute); } - private notifyObservers_() { - this.routeObservers_.forEach((observer) => { - observer.currentRouteChanged(this.currentPage_); - }); + /** + * Updates the URL parameters of the current route via replacing the + * window history state. This changes location.search but doesn't + * change the page itself, hence does not push a new route history entry. + * Notifies routeObservers_. + */ + updateRouterParams(params: URLSearchParams) { + let url: string = this.currentRoute_.page; + const queryString = params.toString(); + if (queryString) { + url += '?' + queryString; + } + window.history.replaceState(window.history.state, '', url); + + const oldRoute = this.currentRoute_; + this.currentRoute_ = { + page: oldRoute.page, + queryParameters: params, + }; + this.notifyObservers_(oldRoute); + } + + private notifyObservers_(oldRoute: Route) { + assert(oldRoute !== this.currentRoute_); + + for (const observer of this.routeObservers_) { + observer.currentRouteChanged(this.currentRoute_, oldRoute); + } } /** * Helper function to set the current page and notify all observers. */ private processRoute_() { + const oldRoute = this.currentRoute_; + this.currentRoute_ = { + page: oldRoute.page, + queryParameters: new URLSearchParams(location.search), + }; const section = location.pathname.substring(1).split('/')[0] || ''; switch (section) { case Page.PASSWORDS: - this.currentPage_ = Page.PASSWORDS; + this.currentRoute_.page = Page.PASSWORDS; break; case Page.CHECKUP: - this.currentPage_ = Page.CHECKUP; + this.currentRoute_.page = Page.CHECKUP; break; case Page.SETTINGS: - this.currentPage_ = Page.SETTINGS; + this.currentRoute_.page = Page.SETTINGS; break; default: - history.replaceState({}, '', this.currentPage_); + history.replaceState({}, '', this.currentRoute_.page); } - this.notifyObservers_(); + this.notifyObservers_(oldRoute); } } @@ -105,7 +148,9 @@ Router.getInstance().addObserver(this); - this.currentRouteChanged(Router.getInstance().currentPage); + this.currentRouteChanged( + Router.getInstance().currentRoute, + Router.getInstance().currentRoute); } override disconnectedCallback() { @@ -114,7 +159,7 @@ Router.getInstance().removeObserver(this); } - currentRouteChanged(_: Page): void { + currentRouteChanged(_newRoute: Route, _oldRoute: Route): void { assertNotReached(); } } @@ -123,5 +168,5 @@ }); export interface RouteObserverMixinInterface { - currentRouteChanged(page: Page): void; + currentRouteChanged(newRoute: Route, oldRoute: Route): void; }
diff --git a/chrome/browser/resources/password_manager/shared_style.css b/chrome/browser/resources/password_manager/shared_style.css index f1eb06c3..804da18c 100644 --- a/chrome/browser/resources/password_manager/shared_style.css +++ b/chrome/browser/resources/password_manager/shared_style.css
@@ -5,6 +5,6 @@ /* #css_wrapper_metadata_start * #type=style * #import=./shared_vars.css.js - * #import=chrome://resources/cr_elements/hidden_style_css.m.js + * #import=chrome://resources/cr_elements/cr_hidden_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #css_wrapper_metadata_end */
diff --git a/chrome/browser/resources/password_manager/side_bar.ts b/chrome/browser/resources/password_manager/side_bar.ts index 7866007..3c3b31d 100644 --- a/chrome/browser/resources/password_manager/side_bar.ts +++ b/chrome/browser/resources/password_manager/side_bar.ts
@@ -12,7 +12,7 @@ import {IronSelectorElement} from 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {Page, RouteObserverMixin, Router} from './router.js'; +import {Page, Route, RouteObserverMixin, Router} from './router.js'; import {getTemplate} from './side_bar.html.js'; export interface PasswordManagerSideBarElement { @@ -40,8 +40,8 @@ private selectedPage_: Page; - override currentRouteChanged(page: Page): void { - this.selectedPage_ = page; + override currentRouteChanged(route: Route, _: Route): void { + this.selectedPage_ = route.page; } private onSelectorActivate_(event: CustomEvent<{selected: Page}>) {
diff --git a/chrome/browser/resources/password_manager/toolbar.html b/chrome/browser/resources/password_manager/toolbar.html index 8aa345e..7ecbcdb 100644 --- a/chrome/browser/resources/password_manager/toolbar.html +++ b/chrome/browser/resources/password_manager/toolbar.html
@@ -16,6 +16,7 @@ </style> <cr-toolbar id="mainToolbar" disable-right-content-grow page-name="$i18n{title}" clear-label="$i18n{clearSearch}" - search-prompt="$i18n{searchPrompt}" autofocus> + search-prompt="$i18n{searchPrompt}" + autofocus autofocus on-search-changed="onSearchChanged_"> <cr-icon-button iron-icon="cr:help-outline"></cr-icon-button> </cr-toolbar>
diff --git a/chrome/browser/resources/password_manager/toolbar.ts b/chrome/browser/resources/password_manager/toolbar.ts index cb83227..90e5710 100644 --- a/chrome/browser/resources/password_manager/toolbar.ts +++ b/chrome/browser/resources/password_manager/toolbar.ts
@@ -5,11 +5,21 @@ import './shared_style.css.js'; import 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.js'; +import {CrToolbarElement} from 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar.js'; +import {CrToolbarSearchFieldElement} from 'chrome://resources/cr_elements/cr_toolbar/cr_toolbar_search_field.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {Route, RouteObserverMixin, Router, UrlParam} from './router.js'; import {getTemplate} from './toolbar.html.js'; -export class PasswordManagerToolbarElement extends PolymerElement { +export interface PasswordManagerToolbarElement { + $: { + mainToolbar: CrToolbarElement, + }; +} + +export class PasswordManagerToolbarElement extends RouteObserverMixin +(PolymerElement) { static get is() { return 'password-manager-toolbar'; } @@ -17,6 +27,31 @@ static get template() { return getTemplate(); } + + override currentRouteChanged(newRoute: Route, _oldRoute: Route): void { + this.updateSearchTerm(newRoute.queryParameters); + } + + get searchField(): CrToolbarSearchFieldElement { + return this.$.mainToolbar.getSearchField(); + } + + private onSearchChanged_(event: CustomEvent<string>) { + const newParams = Router.getInstance().currentRoute.queryParameters; + if (event.detail) { + newParams.set(UrlParam.SEARCH_TERM, event.detail); + } else { + newParams.delete(UrlParam.SEARCH_TERM); + } + Router.getInstance().updateRouterParams(newParams); + } + + private updateSearchTerm(query: URLSearchParams) { + const searchTerm = query.get(UrlParam.SEARCH_TERM) || ''; + if (searchTerm !== this.searchField.getValue()) { + this.searchField.setValue(searchTerm); + } + } } declare global {
diff --git a/chrome/browser/resources/pdf/elements/viewer-annotations-mode-dialog.ts b/chrome/browser/resources/pdf/elements/viewer-annotations-mode-dialog.ts index 0bfc80c..68b6d0b 100644 --- a/chrome/browser/resources/pdf/elements/viewer-annotations-mode-dialog.ts +++ b/chrome/browser/resources/pdf/elements/viewer-annotations-mode-dialog.ts
@@ -5,11 +5,12 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './viewer-annotations-mode-dialog.html.js'; export interface ViewerAnnotationsModeDialogElement {
diff --git a/chrome/browser/resources/pdf/elements/viewer-error-dialog.ts b/chrome/browser/resources/pdf/elements/viewer-error-dialog.ts index 030f1e18..fa9114b 100644 --- a/chrome/browser/resources/pdf/elements/viewer-error-dialog.ts +++ b/chrome/browser/resources/pdf/elements/viewer-error-dialog.ts
@@ -4,9 +4,10 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './viewer-error-dialog.html.js'; export class ViewerErrorDialogElement extends PolymerElement {
diff --git a/chrome/browser/resources/pdf/elements/viewer-password-dialog.ts b/chrome/browser/resources/pdf/elements/viewer-password-dialog.ts index 613f041..4a74000 100644 --- a/chrome/browser/resources/pdf/elements/viewer-password-dialog.ts +++ b/chrome/browser/resources/pdf/elements/viewer-password-dialog.ts
@@ -5,13 +5,14 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './viewer-password-dialog.html.js'; export interface ViewerPasswordDialogElement {
diff --git a/chrome/browser/resources/pdf/elements/viewer-pdf-sidenav.ts b/chrome/browser/resources/pdf/elements/viewer-pdf-sidenav.ts index d7bfe14..3f47f94d1 100644 --- a/chrome/browser/resources/pdf/elements/viewer-pdf-sidenav.ts +++ b/chrome/browser/resources/pdf/elements/viewer-pdf-sidenav.ts
@@ -8,8 +8,8 @@ import './viewer-document-outline.js'; import './viewer-thumbnail-bar.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/pdf/elements/viewer-properties-dialog.ts b/chrome/browser/resources/pdf/elements/viewer-properties-dialog.ts index 084d34c6..1e65d63 100644 --- a/chrome/browser/resources/pdf/elements/viewer-properties-dialog.ts +++ b/chrome/browser/resources/pdf/elements/viewer-properties-dialog.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js';
diff --git a/chrome/browser/resources/pdf/elements/viewer-zoom-toolbar.ts b/chrome/browser/resources/pdf/elements/viewer-zoom-toolbar.ts index a5cddb6..062cde4d 100644 --- a/chrome/browser/resources/pdf/elements/viewer-zoom-toolbar.ts +++ b/chrome/browser/resources/pdf/elements/viewer-zoom-toolbar.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import './icons.html.js'; import './viewer-zoom-button.js';
diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts index 940a00b..025b6bf 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.ts +++ b/chrome/browser/resources/pdf/pdf_viewer.ts
@@ -12,7 +12,7 @@ import './elements/viewer-toolbar.js'; import './elements/shared-vars.css.js'; import './pdf_viewer_shared_style.css.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {assert, assertNotReached} from 'chrome://resources/js/assert_ts.js';
diff --git a/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts b/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts index 27dfeda..efe6a12c 100644 --- a/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts +++ b/chrome/browser/resources/print_preview/ui/advanced_settings_dialog.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import './advanced_settings_item.js'; import './print_preview_search_box.js'; import './print_preview_shared.css.js';
diff --git a/chrome/browser/resources/print_preview/ui/advanced_settings_item.ts b/chrome/browser/resources/print_preview/ui/advanced_settings_item.ts index fc8f0fd8..093f8f0 100644 --- a/chrome/browser/resources/print_preview/ui/advanced_settings_item.ts +++ b/chrome/browser/resources/print_preview/ui/advanced_settings_item.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/search_highlight_style.css.js';
diff --git a/chrome/browser/resources/print_preview/ui/button_strip.ts b/chrome/browser/resources/print_preview/ui/button_strip.ts index 036211c2..a72cb855 100644 --- a/chrome/browser/resources/print_preview/ui/button_strip.ts +++ b/chrome/browser/resources/print_preview/ui/button_strip.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import '../strings.m.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog.ts b/chrome/browser/resources/print_preview/ui/destination_dialog.ts index 22925d57..4c01722 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog.ts +++ b/chrome/browser/resources/print_preview/ui/destination_dialog.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts index 4ff00b56..78843a3c 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_dialog_cros.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_dialog_style.css b/chrome/browser/resources/print_preview/ui/destination_dialog_style.css index 2130560d..3c656ef 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dialog_style.css +++ b/chrome/browser/resources/print_preview/ui/destination_dialog_style.css
@@ -4,8 +4,8 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/hidden_style_css.m.js - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_hidden_style.css.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #import=./throbber.css.js * #include=print-preview-shared cr-hidden-style throbber
diff --git a/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts b/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts index a431cdf..fec82ba 100644 --- a/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_dropdown_cros.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; // TODO(gavinwill): Remove iron-dropdown dependency https://crbug.com/1082587. import 'chrome://resources/polymer/v3_0/iron-dropdown/iron-dropdown.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_list.ts b/chrome/browser/resources/print_preview/ui/destination_list.ts index 1863b2f..aaf50c3 100644 --- a/chrome/browser/resources/print_preview/ui/destination_list.ts +++ b/chrome/browser/resources/print_preview/ui/destination_list.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; // <if expr="not is_chromeos">
diff --git a/chrome/browser/resources/print_preview/ui/destination_list_item_style.css b/chrome/browser/resources/print_preview/ui/destination_list_item_style.css index f7bbd6e7..e4f79d92 100644 --- a/chrome/browser/resources/print_preview/ui/destination_list_item_style.css +++ b/chrome/browser/resources/print_preview/ui/destination_list_item_style.css
@@ -4,8 +4,8 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/hidden_style_css.m.js - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_hidden_style.css.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #include=cr-hidden-style * #css_wrapper_metadata_end */
diff --git a/chrome/browser/resources/print_preview/ui/destination_select.ts b/chrome/browser/resources/print_preview/ui/destination_select.ts index e571b8d..4a6f3ca 100644 --- a/chrome/browser/resources/print_preview/ui/destination_select.ts +++ b/chrome/browser/resources/print_preview/ui/destination_select.ts
@@ -8,7 +8,7 @@ * Chrome OS and non-Chrome OS. */ -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/js/util.m.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_select_cros.ts b/chrome/browser/resources/print_preview/ui/destination_select_cros.ts index 70affd0..247845d1 100644 --- a/chrome/browser/resources/print_preview/ui/destination_select_cros.ts +++ b/chrome/browser/resources/print_preview/ui/destination_select_cros.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/util.m.js'; import 'chrome://resources/polymer/v3_0/iron-iconset-svg/iron-iconset-svg.js';
diff --git a/chrome/browser/resources/print_preview/ui/destination_select_style.css b/chrome/browser/resources/print_preview/ui/destination_select_style.css index 1a15b1ed..8599f1c 100644 --- a/chrome/browser/resources/print_preview/ui/destination_select_style.css +++ b/chrome/browser/resources/print_preview/ui/destination_select_style.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #include=cr-shared-style * #css_wrapper_metadata_end */
diff --git a/chrome/browser/resources/print_preview/ui/destination_settings.ts b/chrome/browser/resources/print_preview/ui/destination_settings.ts index 9c53c6a..7704425c 100644 --- a/chrome/browser/resources/print_preview/ui/destination_settings.ts +++ b/chrome/browser/resources/print_preview/ui/destination_settings.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; // <if expr="not is_chromeos"> import './destination_dialog.js';
diff --git a/chrome/browser/resources/print_preview/ui/duplex_settings.ts b/chrome/browser/resources/print_preview/ui/duplex_settings.ts index e55fb8d2..25131c6 100644 --- a/chrome/browser/resources/print_preview/ui/duplex_settings.ts +++ b/chrome/browser/resources/print_preview/ui/duplex_settings.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/polymer/v3_0/iron-iconset-svg/iron-iconset-svg.js';
diff --git a/chrome/browser/resources/print_preview/ui/link_container.ts b/chrome/browser/resources/print_preview/ui/link_container.ts index 2dc40ed7..0d35c8e 100644 --- a/chrome/browser/resources/print_preview/ui/link_container.ts +++ b/chrome/browser/resources/print_preview/ui/link_container.ts
@@ -3,8 +3,8 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './print_preview_vars.css.js'; import './throbber.css.js';
diff --git a/chrome/browser/resources/print_preview/ui/more_settings.ts b/chrome/browser/resources/print_preview/ui/more_settings.ts index 98a1aa1..d34df21e 100644 --- a/chrome/browser/resources/print_preview/ui/more_settings.ts +++ b/chrome/browser/resources/print_preview/ui/more_settings.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; import '../strings.m.js';
diff --git a/chrome/browser/resources/print_preview/ui/other_options_settings.ts b/chrome/browser/resources/print_preview/ui/other_options_settings.ts index 1206452..eb706c2b 100644 --- a/chrome/browser/resources/print_preview/ui/other_options_settings.ts +++ b/chrome/browser/resources/print_preview/ui/other_options_settings.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; import './print_preview_shared.css.js'; import './settings_section.js';
diff --git a/chrome/browser/resources/print_preview/ui/preview_area.ts b/chrome/browser/resources/print_preview/ui/preview_area.ts index 882c9ce..51e81a57 100644 --- a/chrome/browser/resources/print_preview/ui/preview_area.ts +++ b/chrome/browser/resources/print_preview/ui/preview_area.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './print_preview_vars.css.js'; import '../strings.m.js';
diff --git a/chrome/browser/resources/print_preview/ui/print_preview_shared.css b/chrome/browser/resources/print_preview/ui/print_preview_shared.css index 23dbc2c7..aca22f6 100644 --- a/chrome/browser/resources/print_preview/ui/print_preview_shared.css +++ b/chrome/browser/resources/print_preview/ui/print_preview_shared.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #import=./print_preview_vars.css.js * #include=cr-shared-style
diff --git a/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts b/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts index f09e0730..f31f67f 100644 --- a/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts +++ b/chrome/browser/resources/print_preview/ui/provisional_destination_resolver.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './print_preview_shared.css.js'; import './print_preview_vars.css.js';
diff --git a/chrome/browser/resources/print_preview/ui/sidebar.ts b/chrome/browser/resources/print_preview/ui/sidebar.ts index 547f665..5ad24f85 100644 --- a/chrome/browser/resources/print_preview/ui/sidebar.ts +++ b/chrome/browser/resources/print_preview/ui/sidebar.ts
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import './advanced_options_settings.js';
diff --git a/chrome/browser/resources/privacy_sandbox/privacy_sandbox_dialog_app.ts b/chrome/browser/resources/privacy_sandbox/privacy_sandbox_dialog_app.ts index b713272d6..e3f9330d 100644 --- a/chrome/browser/resources/privacy_sandbox/privacy_sandbox_dialog_app.ts +++ b/chrome/browser/resources/privacy_sandbox/privacy_sandbox_dialog_app.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './strings.m.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
diff --git a/chrome/browser/resources/settings/a11y_page/captions_subpage.ts b/chrome/browser/resources/settings/a11y_page/captions_subpage.ts index 1f85c6a..276452f 100644 --- a/chrome/browser/resources/settings/a11y_page/captions_subpage.ts +++ b/chrome/browser/resources/settings/a11y_page/captions_subpage.ts
@@ -8,7 +8,7 @@ * chrome://os-settings/manageAccessibility/captions on Chrome OS). */ -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '../controls/settings_slider.js'; import '../settings_shared.css.js'; import './live_caption_section.js';
diff --git a/chrome/browser/resources/settings/a11y_page/live_caption_section.ts b/chrome/browser/resources/settings/a11y_page/live_caption_section.ts index 39991b3fa..d520b686 100644 --- a/chrome/browser/resources/settings/a11y_page/live_caption_section.ts +++ b/chrome/browser/resources/settings/a11y_page/live_caption_section.ts
@@ -10,7 +10,7 @@ * other versions of Windows. */ -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '../controls/settings_toggle_button.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/about_page/about_page.ts b/chrome/browser/resources/settings/about_page/about_page.ts index ff95d13..f42c481d 100644 --- a/chrome/browser/resources/settings/about_page/about_page.ts +++ b/chrome/browser/resources/settings/about_page/about_page.ts
@@ -19,7 +19,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.ts b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.ts index 3aaa68c..4d807307 100644 --- a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.ts +++ b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.ts
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../controls/settings_slider.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.ts b/chrome/browser/resources/settings/appearance_page/appearance_page.ts index 575f9a9a..c1ee30be 100644 --- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts +++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_components/managed_dialog/managed_dialog.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import '../controls/controlled_radio_button.js'; import '../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts index 396e65d..5e2c597 100644 --- a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts +++ b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/autofill_page/autofill_page.ts b/chrome/browser/resources/settings/autofill_page/autofill_page.ts index c0b046d5..18d3ce5f 100644 --- a/chrome/browser/resources/settings/autofill_page/autofill_page.ts +++ b/chrome/browser/resources/settings/autofill_page/autofill_page.ts
@@ -152,6 +152,7 @@ params.set(PasswordViewPageUrlParams.ID, String(id)); Router.getInstance().navigateTo(routes.PASSWORD_VIEW, params); } + PasswordManagerImpl.getInstance().extendAuthValidity(); }) .catch(() => { if (Router.getInstance().getCurrentRoute() === routes.PASSWORD_VIEW) {
diff --git a/chrome/browser/resources/settings/autofill_page/autofill_section.ts b/chrome/browser/resources/settings/autofill_page/autofill_section.ts index 5bc80f2..405fe8b 100644 --- a/chrome/browser/resources/settings/autofill_page/autofill_section.ts +++ b/chrome/browser/resources/settings/autofill_page/autofill_section.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../settings_shared.css.js'; import '../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.ts b/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.ts index 6e7ec60..01eb9649 100644 --- a/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.ts +++ b/chrome/browser/resources/settings/autofill_page/credit_card_edit_dialog.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/autofill_page/password_check.ts b/chrome/browser/resources/settings/autofill_page/password_check.ts index c905150..bd3a4f6 100644 --- a/chrome/browser/resources/settings/autofill_page/password_check.ts +++ b/chrome/browser/resources/settings/autofill_page/password_check.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import '../settings_shared.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js';
diff --git a/chrome/browser/resources/settings/autofill_page/password_move_to_account_dialog.ts b/chrome/browser/resources/settings/autofill_page/password_move_to_account_dialog.ts index 7e81970..5293389 100644 --- a/chrome/browser/resources/settings/autofill_page/password_move_to_account_dialog.ts +++ b/chrome/browser/resources/settings/autofill_page/password_move_to_account_dialog.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './avatar_icon.js'; import '../site_favicon.js';
diff --git a/chrome/browser/resources/settings/autofill_page/password_remove_dialog.ts b/chrome/browser/resources/settings/autofill_page/password_remove_dialog.ts index 5201a81..4e00607 100644 --- a/chrome/browser/resources/settings/autofill_page/password_remove_dialog.ts +++ b/chrome/browser/resources/settings/autofill_page/password_remove_dialog.ts
@@ -13,7 +13,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './avatar_icon.js'; import {CrCheckboxElement} from 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js';
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_device_section.ts b/chrome/browser/resources/settings/autofill_page/passwords_device_section.ts index b0c28ba..b88d2d9 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_device_section.ts +++ b/chrome/browser/resources/settings/autofill_page/passwords_device_section.ts
@@ -12,7 +12,7 @@ */ import './passwords_list_handler.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../settings_shared.css.js'; import './avatar_icon.js'; import './passwords_shared.css.js';
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_list_handler.ts b/chrome/browser/resources/settings/autofill_page/passwords_list_handler.ts index 0d69430..7634f6b 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_list_handler.ts +++ b/chrome/browser/resources/settings/autofill_page/passwords_list_handler.ts
@@ -17,7 +17,7 @@ import './password_remove_dialog.js'; import './password_list_item.js'; import './password_edit_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_toast/cr_toast.js';
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_section.ts b/chrome/browser/resources/settings/autofill_page/passwords_section.ts index 73ba1af..eda754d4 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_section.ts +++ b/chrome/browser/resources/settings/autofill_page/passwords_section.ts
@@ -14,7 +14,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import '../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/autofill_page/payments_section.ts b/chrome/browser/resources/settings/autofill_page/payments_section.ts index ec8508fa..d61a3db 100644 --- a/chrome/browser/resources/settings/autofill_page/payments_section.ts +++ b/chrome/browser/resources/settings/autofill_page/payments_section.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/autofill_page/virtual_card_unenroll_dialog.ts b/chrome/browser/resources/settings/autofill_page/virtual_card_unenroll_dialog.ts index 0eecbe1..98320eb 100644 --- a/chrome/browser/resources/settings/autofill_page/virtual_card_unenroll_dialog.ts +++ b/chrome/browser/resources/settings/autofill_page/virtual_card_unenroll_dialog.ts
@@ -11,7 +11,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../settings_shared.css.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/browser/resources/settings/basic_page/basic_page.ts b/chrome/browser/resources/settings/basic_page/basic_page.ts index 34a89e6..7dfb875e 100644 --- a/chrome/browser/resources/settings/basic_page/basic_page.ts +++ b/chrome/browser/resources/settings/basic_page/basic_page.ts
@@ -6,8 +6,8 @@ * @fileoverview * 'settings-basic-page' is the settings page containing the actual settings. */ -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../appearance_page/appearance_page.js'; @@ -22,13 +22,13 @@ import '../search_page/search_page.js'; import '../settings_page/settings_section.js'; import '../settings_page_styles.css.js'; - // <if expr="not is_chromeos"> import '../default_browser_page/default_browser_page.js'; // </if> // <if expr="not chromeos_ash"> import '../languages_page/languages.js'; + // </if> import {assert} from 'chrome://resources/js/assert_ts.js';
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.ts b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.ts index 3c61832..d49e46bc2 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.ts +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.ts
@@ -5,7 +5,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
diff --git a/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js b/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js index ac72d148..92a29cf 100644 --- a/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js +++ b/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_components/chromeos/bluetooth/bluetooth_dialog.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import 'chrome://resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js';
diff --git a/chrome/browser/resources/settings/chromeos/device_page/power.js b/chrome/browser/resources/settings/chromeos/device_page/power.js index 8548b83..87569a95 100644 --- a/chrome/browser/resources/settings/chromeos/device_page/power.js +++ b/chrome/browser/resources/settings/chromeos/device_page/power.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/policy/cr_policy_indicator.js'; import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../../controls/settings_toggle_button.js'; import '../../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/cellular_networks_list.js b/chrome/browser/resources/settings/chromeos/internet_page/cellular_networks_list.js index c01e94b..8f9aaab 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/cellular_networks_list.js +++ b/chrome/browser/resources/settings/chromeos/internet_page/cellular_networks_list.js
@@ -12,7 +12,7 @@ import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/cr_elements/policy/cr_policy_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import '../os_settings_icons_css.js'; import './esim_install_error_dialog.js';
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/internet_subpage.js b/chrome/browser/resources/settings/chromeos/internet_page/internet_subpage.js index d69bc01..9e7edafb 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/internet_subpage.js +++ b/chrome/browser/resources/settings/chromeos/internet_page/internet_subpage.js
@@ -13,7 +13,7 @@ import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import 'chrome://resources/cr_elements/policy/cr_policy_indicator.js'; import 'chrome://resources/cr_elements/md_select.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/network_proxy_section.js b/chrome/browser/resources/settings/chromeos/internet_page/network_proxy_section.js index 82f2fef..57bc39b0 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/network_proxy_section.js +++ b/chrome/browser/resources/settings/chromeos/internet_page/network_proxy_section.js
@@ -12,7 +12,7 @@ import 'chrome://resources/cr_components/chromeos/network/network_proxy.m.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../../controls/extension_controlled_indicator.js'; import '../../settings_vars.css.js';
diff --git a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_notification_access_setup_dialog.js b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_notification_access_setup_dialog.js index 0aec6ba..e47153e 100644 --- a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_notification_access_setup_dialog.js +++ b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_notification_access_setup_dialog.js
@@ -11,7 +11,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import 'chrome://resources/cr_components/localized_link/localized_link.js'; import '../os_icons.js';
diff --git a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_permissions_setup_dialog.js b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_permissions_setup_dialog.js index 6c9ff35..7687df6 100644 --- a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_permissions_setup_dialog.js +++ b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_permissions_setup_dialog.js
@@ -12,7 +12,7 @@ import 'chrome://resources/cr_components/localized_link/localized_link.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './multidevice_screen_lock_subpage.js';
diff --git a/chrome/browser/resources/settings/chromeos/nearby_share_page/nearby_share_subpage.js b/chrome/browser/resources/settings/chromeos/nearby_share_page/nearby_share_subpage.js index 1545343..a83accc 100644 --- a/chrome/browser/resources/settings/chromeos/nearby_share_page/nearby_share_subpage.js +++ b/chrome/browser/resources/settings/chromeos/nearby_share_page/nearby_share_subpage.js
@@ -8,7 +8,7 @@ * Nearby Share feature. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../../controls/settings_toggle_button.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/change_dictation_locale_dialog.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/change_dictation_locale_dialog.js index 4fbc924..aa7b8a7 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/change_dictation_locale_dialog.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/change_dictation_locale_dialog.js
@@ -11,7 +11,7 @@ import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_scrollable_behavior.js'; import 'chrome://resources/cr_elements/cr_search_field/cr_search_field.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import 'chrome://resources/polymer/v3_0/paper-ripple/paper-ripple.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js index 0352263..d998033 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_dialog.js
@@ -11,7 +11,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_pane.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_pane.js index bac5d19..b8165557 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_pane.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_action_assignment_pane.js
@@ -11,7 +11,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../os_icons.js'; import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_setup_guide_dialog.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_setup_guide_dialog.js index a89d5164..51e7cca 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_setup_guide_dialog.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/switch_access_setup_guide_dialog.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../../controls/settings_slider.js'; import '../os_icons.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/main_view.js b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/main_view.js index 975a4f4..73c660d1 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/main_view.js +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/main_view.js
@@ -5,7 +5,7 @@ import './app_item.js'; import './shared_style.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import {alphabeticalSort} from 'chrome://resources/cr_components/app_management/util.js'; import {assert} from 'chrome://resources/js/assert.m.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js b/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js index eeb3c877e..68c3907 100644 --- a/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js +++ b/chrome/browser/resources/settings/chromeos/os_printing_page/cups_edit_printer_dialog.js
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import 'chrome://resources/cr_components/localized_link/localized_link.js'; import './cups_add_printer_dialog.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_printing_page/cups_printer_shared_css.js b/chrome/browser/resources/settings/chromeos/os_printing_page/cups_printer_shared_css.js index 237c3c2..18dac98 100644 --- a/chrome/browser/resources/settings/chromeos/os_printing_page/cups_printer_shared_css.js +++ b/chrome/browser/resources/settings/chromeos/os_printing_page/cups_printer_shared_css.js
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../../settings_shared.css.js'; const template = document.createElement('template');
diff --git a/chrome/browser/resources/settings/chromeos/os_privacy_page/smart_privacy_page.js b/chrome/browser/resources/settings/chromeos/os_privacy_page/smart_privacy_page.js index 64536e5..2679eaf 100644 --- a/chrome/browser/resources/settings/chromeos/os_privacy_page/smart_privacy_page.js +++ b/chrome/browser/resources/settings/chromeos/os_privacy_page/smart_privacy_page.js
@@ -7,7 +7,7 @@ * 'os-settings-smart-privacy-page' contains smart privacy settings. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-media-query/iron-media-query.js'; import '../../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_search_page/os_search_page.js b/chrome/browser/resources/settings/chromeos/os_search_page/os_search_page.js index 6433f07..e655753 100644 --- a/chrome/browser/resources/settings/chromeos/os_search_page/os_search_page.js +++ b/chrome/browser/resources/settings/chromeos/os_search_page/os_search_page.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './os_search_selection_dialog.js'; import '../../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_search_page/search_engine.js b/chrome/browser/resources/settings/chromeos/os_search_page/search_engine.js index 1ab422dd..f4e38aa9 100644 --- a/chrome/browser/resources/settings/chromeos/os_search_page/search_engine.js +++ b/chrome/browser/resources/settings/chromeos/os_search_page/search_engine.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './os_search_selection_dialog.js'; import '../../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_search_page/search_subpage.js b/chrome/browser/resources/settings/chromeos/os_search_page/search_subpage.js index 70dad3d..2ee5d702 100644 --- a/chrome/browser/resources/settings/chromeos/os_search_page/search_subpage.js +++ b/chrome/browser/resources/settings/chromeos/os_search_page/search_subpage.js
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import '../../controls/controlled_button.js'; import '../../controls/settings_toggle_button.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.ts b/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.ts index 1a6f8b2..72bdff5 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.ts +++ b/chrome/browser/resources/settings/chromeos/os_settings_main/os_settings_main.ts
@@ -7,7 +7,7 @@ * 'os-settings-main' displays the selected settings page. */ import 'chrome://resources/cr_components/managed_footnote/managed_footnote.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/js/search_highlight_utils.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.ts b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.ts index f4e9868..55c15b3 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.ts +++ b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.ts
@@ -8,7 +8,7 @@ */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.ts b/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.ts index 88fb5cc..61ca1ef5 100644 --- a/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.ts +++ b/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-media-query/iron-media-query.js';
diff --git a/chrome/browser/resources/settings/controls/password_prompt_dialog.ts b/chrome/browser/resources/settings/controls/password_prompt_dialog.ts index b246b8c..8d1e67c 100644 --- a/chrome/browser/resources/settings/controls/password_prompt_dialog.ts +++ b/chrome/browser/resources/settings/controls/password_prompt_dialog.ts
@@ -22,7 +22,7 @@ import '//resources/cr_elements/cr_button/cr_button.js'; import '//resources/cr_elements/cr_dialog/cr_dialog.js'; import '//resources/cr_elements/cr_input/cr_input.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '../settings_shared.css.js'; import {CrDialogElement} from '//resources/cr_elements/cr_dialog/cr_dialog.js';
diff --git a/chrome/browser/resources/settings/controls/settings_textarea.ts b/chrome/browser/resources/settings/controls/settings_textarea.ts index db33bda..5bc4bd8 100644 --- a/chrome/browser/resources/settings/controls/settings_textarea.ts +++ b/chrome/browser/resources/settings/controls/settings_textarea.ts
@@ -6,11 +6,12 @@ * @fileoverview 'settings-textarea' is a component similar to native textarea, * and inherits styling from cr-input. */ -import '//resources/cr_elements/hidden_style_css.m.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_hidden_style.css.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/cr_input/cr_input_style.css.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {getTemplate} from './settings_textarea.html.js'; export interface SettingsTextareaElement {
diff --git a/chrome/browser/resources/settings/default_browser_page/default_browser_page.ts b/chrome/browser/resources/settings/default_browser_page/default_browser_page.ts index f5f5979..006dafd 100644 --- a/chrome/browser/resources/settings/default_browser_page/default_browser_page.ts +++ b/chrome/browser/resources/settings/default_browser_page/default_browser_page.ts
@@ -8,7 +8,7 @@ * settings to change the default browser (i.e. which the OS will open). */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../icons.html.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/downloads_page/downloads_page.ts b/chrome/browser/resources/settings/downloads_page/downloads_page.ts index 36de034..b418216af 100644 --- a/chrome/browser/resources/settings/downloads_page/downloads_page.ts +++ b/chrome/browser/resources/settings/downloads_page/downloads_page.ts
@@ -8,7 +8,7 @@ * settings. */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../controls/controlled_button.js'; import '../controls/settings_toggle_button.js';
diff --git a/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_page.ts b/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_page.ts index 75094e0..1c6dd39 100644 --- a/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_page.ts +++ b/chrome/browser/resources/settings/incompatible_applications_page/incompatible_applications_page.ts
@@ -9,7 +9,7 @@ */ import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.ts b/chrome/browser/resources/settings/languages_page/languages_page.ts index ec8d3ec..32ad6d4 100644 --- a/chrome/browser/resources/settings/languages_page/languages_page.ts +++ b/chrome/browser/resources/settings/languages_page/languages_page.ts
@@ -15,7 +15,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js'; import 'chrome://resources/cr_elements/action_link.css.js';
diff --git a/chrome/browser/resources/settings/languages_page/spell_check_page.ts b/chrome/browser/resources/settings/languages_page/spell_check_page.ts index 1610efc3..f7555d21 100644 --- a/chrome/browser/resources/settings/languages_page/spell_check_page.ts +++ b/chrome/browser/resources/settings/languages_page/spell_check_page.ts
@@ -12,7 +12,7 @@ import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js'; import 'chrome://resources/cr_elements/action_link.css.js';
diff --git a/chrome/browser/resources/settings/languages_page/translate_page.ts b/chrome/browser/resources/settings/languages_page/translate_page.ts index 6ef2f54..3edcc2df 100644 --- a/chrome/browser/resources/settings/languages_page/translate_page.ts +++ b/chrome/browser/resources/settings/languages_page/translate_page.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js';
diff --git a/chrome/browser/resources/settings/on_startup_page/on_startup_page.ts b/chrome/browser/resources/settings/on_startup_page/on_startup_page.ts index f1f81fd..26e488db 100644 --- a/chrome/browser/resources/settings/on_startup_page/on_startup_page.ts +++ b/chrome/browser/resources/settings/on_startup_page/on_startup_page.ts
@@ -6,7 +6,7 @@ * @fileoverview * 'settings-on-startup-page' is a settings page. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../controls/controlled_radio_button.js'; import '../controls/extension_controlled_indicator.js';
diff --git a/chrome/browser/resources/settings/people_page/manage_profile.ts b/chrome/browser/resources/settings/people_page/manage_profile.ts index 2fd4e8e..f2a323a7 100644 --- a/chrome/browser/resources/settings/people_page/manage_profile.ts +++ b/chrome/browser/resources/settings/people_page/manage_profile.ts
@@ -9,7 +9,7 @@ */ import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_components/customize_themes/customize_themes.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/paper-styles/shadow.js';
diff --git a/chrome/browser/resources/settings/people_page/people_page.ts b/chrome/browser/resources/settings/people_page/people_page.ts index d4d1ae2..3decf1bb 100644 --- a/chrome/browser/resources/settings/people_page/people_page.ts +++ b/chrome/browser/resources/settings/people_page/people_page.ts
@@ -12,7 +12,7 @@ import 'chrome://resources/cr_elements/cr_toast/cr_toast.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/policy/cr_policy_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../controls/settings_toggle_button.js';
diff --git a/chrome/browser/resources/settings/people_page/signout_dialog.ts b/chrome/browser/resources/settings/people_page/signout_dialog.ts index 524df34..da3682c 100644 --- a/chrome/browser/resources/settings/people_page/signout_dialog.ts +++ b/chrome/browser/resources/settings/people_page/signout_dialog.ts
@@ -10,7 +10,7 @@ import '//resources/cr_elements/cr_checkbox/cr_checkbox.js'; import '//resources/cr_elements/cr_dialog/cr_dialog.js'; import '//resources/cr_elements/cr_expand_button/cr_expand_button.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import '//resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
diff --git a/chrome/browser/resources/settings/people_page/sync_account_control.ts b/chrome/browser/resources/settings/people_page/sync_account_control.ts index 566dc07..a4a7016 100644 --- a/chrome/browser/resources/settings/people_page/sync_account_control.ts +++ b/chrome/browser/resources/settings/people_page/sync_account_control.ts
@@ -10,7 +10,7 @@ import '//resources/cr_elements/cr_button/cr_button.js'; import '//resources/cr_elements/cr_icon_button/cr_icon_button.js'; import '//resources/cr_elements/icons.m.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import './profile_info_browser_proxy.js';
diff --git a/chrome/browser/resources/settings/people_page/sync_controls.ts b/chrome/browser/resources/settings/people_page/sync_controls.ts index 8dac328..75eff07 100644 --- a/chrome/browser/resources/settings/people_page/sync_controls.ts +++ b/chrome/browser/resources/settings/people_page/sync_controls.ts
@@ -7,7 +7,7 @@ import '//resources/cr_elements/cr_radio_button/cr_radio_button.js'; import '//resources/cr_elements/cr_radio_group/cr_radio_group.js'; import '//resources/cr_elements/cr_toggle/cr_toggle.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/people_page/sync_encryption_options.ts b/chrome/browser/resources/settings/people_page/sync_encryption_options.ts index 614d4da..5611a921 100644 --- a/chrome/browser/resources/settings/people_page/sync_encryption_options.ts +++ b/chrome/browser/resources/settings/people_page/sync_encryption_options.ts
@@ -6,7 +6,7 @@ import '//resources/cr_elements/cr_input/cr_input.js'; import '//resources/cr_elements/cr_radio_button/cr_radio_button.js'; import '//resources/cr_elements/cr_radio_group/cr_radio_group.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '../settings_shared.css.js'; import '../settings_vars.css.js';
diff --git a/chrome/browser/resources/settings/people_page/sync_page.ts b/chrome/browser/resources/settings/people_page/sync_page.ts index fd111a5..7951acbe 100644 --- a/chrome/browser/resources/settings/people_page/sync_page.ts +++ b/chrome/browser/resources/settings/people_page/sync_page.ts
@@ -8,7 +8,7 @@ import '//resources/cr_elements/cr_input/cr_input.js'; import '//resources/cr_elements/cr_link_row/cr_link_row.js'; import '//resources/cr_elements/icons.m.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/cr_elements/shared_vars_css.m.js'; import '//resources/cr_elements/cr_expand_button/cr_expand_button.js'; import '//resources/polymer/v3_0/iron-collapse/iron-collapse.js';
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_completion_link_row.ts b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_completion_link_row.ts index ee904f3..3f378f3 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_completion_link_row.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_completion_link_row.ts
@@ -9,7 +9,7 @@ */ import 'chrome://resources/cr_elements/cr_actionable_row_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_description_item.ts b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_description_item.ts index f03c0e4..ca84c1a 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_description_item.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_description_item.ts
@@ -7,7 +7,7 @@ * 'privacy-guide-description-item' is a bullet-point-style item in * the description of a privacy setting in the privacy guide. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import '../../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.ts b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.ts index ac0e7c1..0e6c358 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_dialog.ts
@@ -8,7 +8,7 @@ * various privacy settings. */ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../../prefs/prefs.js'; import '../../settings_shared.css.js'; import './privacy_guide_page.js';
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_fragment_shared.css b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_fragment_shared.css index 4722a27..685d17a8 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_fragment_shared.css +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_fragment_shared.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #import=../../settings_shared.css.js * #include=cr-shared-style settings-shared
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts index 5a3841a..d7ea851 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_guide/privacy_guide_page.ts
@@ -8,7 +8,7 @@ * various privacy settings. */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import '../../prefs/prefs.js'; import '../../settings_shared.css.js'; import 'chrome://resources/cr_elements/cr_view_manager/cr_view_manager.js';
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.ts b/chrome/browser/resources/settings/privacy_page/privacy_page.ts index 1e9e129..81a61ed6 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.ts +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../controls/settings_toggle_button.js'; import '../prefs/prefs.js';
diff --git a/chrome/browser/resources/settings/privacy_page/review_notification_permissions.ts b/chrome/browser/resources/settings/privacy_page/review_notification_permissions.ts index d4bfc58..70603e2 100644 --- a/chrome/browser/resources/settings/privacy_page/review_notification_permissions.ts +++ b/chrome/browser/resources/settings/privacy_page/review_notification_permissions.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; import '../settings_shared.css.js'; import '../i18n_setup.js';
diff --git a/chrome/browser/resources/settings/privacy_page/security_page.ts b/chrome/browser/resources/settings/privacy_page/security_page.ts index bc4dc965..9359c727 100644 --- a/chrome/browser/resources/settings/privacy_page/security_page.ts +++ b/chrome/browser/resources/settings/privacy_page/security_page.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './collapse_radio_button.js'; import './secure_dns.js'; import '../controls/settings_radio_group.js';
diff --git a/chrome/browser/resources/settings/privacy_sandbox/app.ts b/chrome/browser/resources/settings/privacy_sandbox/app.ts index 564c3bc..e743a270 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/app.ts +++ b/chrome/browser/resources/settings/privacy_sandbox/app.ts
@@ -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 'chrome://resources/cr_elements/cr_page_host_style.css.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import './icons.html.js'; import './interest_item.js';
diff --git a/chrome/browser/resources/settings/privacy_sandbox/interest_item.ts b/chrome/browser/resources/settings/privacy_sandbox/interest_item.ts index 56ad79c..baaf497 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/interest_item.ts +++ b/chrome/browser/resources/settings/privacy_sandbox/interest_item.ts
@@ -7,7 +7,7 @@ * 'privacy-sandbox-interest-item' is the custom element to show a topics or * fledge interest in the privacy sandbox. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import '../settings.js'; @@ -59,4 +59,4 @@ } customElements.define( - PrivacySandboxInterestItemElement.is, PrivacySandboxInterestItemElement); \ No newline at end of file + PrivacySandboxInterestItemElement.is, PrivacySandboxInterestItemElement);
diff --git a/chrome/browser/resources/settings/safety_check_page/safety_check_child.ts b/chrome/browser/resources/settings/safety_check_page/safety_check_child.ts index 47391d9..c71b423 100644 --- a/chrome/browser/resources/settings/safety_check_page/safety_check_child.ts +++ b/chrome/browser/resources/settings/safety_check_page/safety_check_child.ts
@@ -10,7 +10,7 @@ */ import 'chrome://resources/cr_elements/cr_actionable_row_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/settings/safety_check_page/safety_check_page.ts b/chrome/browser/resources/settings/safety_check_page/safety_check_page.ts index 7ae4089..7a6dde2 100644 --- a/chrome/browser/resources/settings/safety_check_page/safety_check_page.ts +++ b/chrome/browser/resources/settings/safety_check_page/safety_check_page.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
diff --git a/chrome/browser/resources/settings/search_engines_page/search_engines_page.ts b/chrome/browser/resources/settings/search_engines_page/search_engines_page.ts index 13201ecb..6070caae 100644 --- a/chrome/browser/resources/settings/search_engines_page/search_engines_page.ts +++ b/chrome/browser/resources/settings/search_engines_page/search_engines_page.ts
@@ -7,7 +7,7 @@ * containing search engines settings. */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/cr.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
diff --git a/chrome/browser/resources/settings/search_page/search_page.ts b/chrome/browser/resources/settings/search_page/search_page.ts index 83d96ad..67bdb12 100644 --- a/chrome/browser/resources/settings/search_page/search_page.ts +++ b/chrome/browser/resources/settings/search_page/search_page.ts
@@ -7,7 +7,7 @@ * 'settings-search-page' is the settings page containing search settings. */ import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js';
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.ts b/chrome/browser/resources/settings/settings_main/settings_main.ts index 0b58470..6090084 100644 --- a/chrome/browser/resources/settings/settings_main/settings_main.ts +++ b/chrome/browser/resources/settings/settings_main/settings_main.ts
@@ -7,8 +7,8 @@ * 'settings-main' displays the selected settings page. */ import 'chrome://resources/cr_components/managed_footnote/managed_footnote.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/js/search_highlight_utils.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/chrome/browser/resources/settings/settings_page/settings_subpage.ts b/chrome/browser/resources/settings/settings_page/settings_subpage.ts index 2133b0c..08c648c 100644 --- a/chrome/browser/resources/settings/settings_page/settings_subpage.ts +++ b/chrome/browser/resources/settings/settings_page/settings_subpage.ts
@@ -11,7 +11,7 @@ import '//resources/cr_elements/cr_icon_button/cr_icon_button.js'; import '//resources/cr_elements/cr_search_field/cr_search_field.js'; import '//resources/cr_elements/icons.m.js'; -import '//resources/cr_elements/shared_style_css.m.js'; +import '//resources/cr_elements/cr_shared_style.css.js'; import '//resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js'; import '../settings_shared.css.js'; import '../site_favicon.js';
diff --git a/chrome/browser/resources/settings/settings_shared.css b/chrome/browser/resources/settings/settings_shared.css index 4315a768..b6e75c0 100644 --- a/chrome/browser/resources/settings/settings_shared.css +++ b/chrome/browser/resources/settings/settings_shared.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=//resources/cr_elements/shared_style_css.m.js + * #import=//resources/cr_elements/cr_shared_style.css.js * #import=//resources/cr_elements/shared_vars_css.m.js * #import=//resources/cr_elements/search_highlight_style.css.js * #import=./settings_vars.css.js
diff --git a/chrome/browser/resources/settings/site_settings/chooser_exception_list.ts b/chrome/browser/resources/settings/site_settings/chooser_exception_list.ts index 158c19c..4534075f 100644 --- a/chrome/browser/resources/settings/site_settings/chooser_exception_list.ts +++ b/chrome/browser/resources/settings/site_settings/chooser_exception_list.ts
@@ -7,7 +7,7 @@ * 'chooser-exception-list' shows a list of chooser exceptions for a given * chooser type. */ -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/site_settings/chooser_exception_list_entry.ts b/chrome/browser/resources/settings/site_settings/chooser_exception_list_entry.ts index 55f6799..360c9b4 100644 --- a/chrome/browser/resources/settings/site_settings/chooser_exception_list_entry.ts +++ b/chrome/browser/resources/settings/site_settings/chooser_exception_list_entry.ts
@@ -8,7 +8,7 @@ * chooser type. */ import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/site_settings/protocol_handlers.ts b/chrome/browser/resources/settings/site_settings/protocol_handlers.ts index 8331e64..44347a3e 100644 --- a/chrome/browser/resources/settings/site_settings/protocol_handlers.ts +++ b/chrome/browser/resources/settings/site_settings/protocol_handlers.ts
@@ -13,7 +13,7 @@ import 'chrome://resources/cr_elements/cr_radio_group/cr_radio_group.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../controls/settings_toggle_button.js';
diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts index 8b4ed48..0e35b3fc 100644 --- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts
@@ -211,6 +211,9 @@ break; } this.set('pref_.controlledBy', controlledBy); + } else { + this.set('pref_.enforcement', undefined); + this.set('pref_.controlledBy', undefined); } const enabled = this.computeIsSettingEnabled(update.setting);
diff --git a/chrome/browser/resources/settings/site_settings/site_data.ts b/chrome/browser/resources/settings/site_settings/site_data.ts index 6c35608..6441a44 100644 --- a/chrome/browser/resources/settings/site_settings/site_data.ts +++ b/chrome/browser/resources/settings/site_settings/site_data.ts
@@ -11,7 +11,7 @@ import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_search_field/cr_search_field.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js'; import 'chrome://resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js';
diff --git a/chrome/browser/resources/settings/site_settings/site_data_details_subpage.ts b/chrome/browser/resources/settings/site_settings/site_data_details_subpage.ts index 1b26f01..8cfc33db 100644 --- a/chrome/browser/resources/settings/site_settings/site_data_details_subpage.ts +++ b/chrome/browser/resources/settings/site_settings/site_data_details_subpage.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/site_settings/site_data_entry.ts b/chrome/browser/resources/settings/site_settings/site_data_entry.ts index ca31209..ae33785 100644 --- a/chrome/browser/resources/settings/site_settings/site_data_entry.ts +++ b/chrome/browser/resources/settings/site_settings/site_data_entry.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import '../settings_shared.css.js';
diff --git a/chrome/browser/resources/settings/site_settings/site_details.ts b/chrome/browser/resources/settings/site_settings/site_details.ts index e1319dbb2..032feba 100644 --- a/chrome/browser/resources/settings/site_settings/site_details.ts +++ b/chrome/browser/resources/settings/site_settings/site_details.ts
@@ -14,7 +14,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '../icons.html.js';
diff --git a/chrome/browser/resources/settings/site_settings/site_entry.ts b/chrome/browser/resources/settings/site_settings/site_entry.ts index 77fd900..d3e5987 100644 --- a/chrome/browser/resources/settings/site_settings/site_entry.ts +++ b/chrome/browser/resources/settings/site_settings/site_entry.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import '../settings_shared.css.js'; import '../site_favicon.js';
diff --git a/chrome/browser/resources/settings/site_settings/site_list.ts b/chrome/browser/resources/settings/site_settings/site_list.ts index f7c7cfb..d031950 100644 --- a/chrome/browser/resources/settings/site_settings/site_list.ts +++ b/chrome/browser/resources/settings/site_settings/site_list.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/policy/cr_policy_pref_indicator.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import 'chrome://resources/polymer/v3_0/iron-list/iron-list.js';
diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts index 2099608..e085d44 100644 --- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/policy/cr_tooltip_icon.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; import '../settings_shared.css.js'; import '../i18n_setup.js';
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts index e235f22..075d2654 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts
@@ -10,7 +10,7 @@ import 'chrome://resources/cr_elements/cr_expand_button/cr_expand_button.js'; import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; import '../settings_shared.css.js'; import './recent_site_permissions.js';
diff --git a/chrome/browser/resources/side_panel/reading_list/app.ts b/chrome/browser/resources/side_panel/reading_list/app.ts index 2745de2..4dd1cb1 100644 --- a/chrome/browser/resources/side_panel/reading_list/app.ts +++ b/chrome/browser/resources/side_panel/reading_list/app.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/cr_elements/mwb_element_shared_style.css.js'; import 'chrome://resources/cr_elements/mwb_shared_style.css.js';
diff --git a/chrome/browser/resources/signin/profile_picker/profile_card.ts b/chrome/browser/resources/signin/profile_picker/profile_card.ts index 98b71977..d2719c7 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_card.ts +++ b/chrome/browser/resources/signin/profile_picker/profile_card.ts
@@ -4,8 +4,8 @@ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/icons.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import './profile_card_menu.js'; import './profile_picker_shared.css.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js';
diff --git a/chrome/browser/resources/signin/profile_picker/profile_card_menu.ts b/chrome/browser/resources/signin/profile_picker/profile_card_menu.ts index fb00fc454..dddb0c49 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_card_menu.ts +++ b/chrome/browser/resources/signin/profile_picker/profile_card_menu.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import 'chrome://resources/js/action_link.js'; import './profile_picker_shared.css.js';
diff --git a/chrome/browser/resources/signin/profile_picker/profile_creation_flow/local_profile_customization.ts b/chrome/browser/resources/signin/profile_picker/profile_creation_flow/local_profile_customization.ts index 88831b4..42e8cc3 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_creation_flow/local_profile_customization.ts +++ b/chrome/browser/resources/signin/profile_picker/profile_creation_flow/local_profile_customization.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_components/customize_themes/customize_themes.js'; import './profile_creation_shared.css.js'; import '../icons.js';
diff --git a/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts b/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts index 11e0702cc2..c90c7e9 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts +++ b/chrome/browser/resources/signin/profile_picker/profile_picker_main_view.ts
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import './icons.js';
diff --git a/chrome/browser/resources/signin/profile_picker/profile_picker_shared.css b/chrome/browser/resources/signin/profile_picker/profile_picker_shared.css index 81f1e437..6722dab 100644 --- a/chrome/browser/resources/signin/profile_picker/profile_picker_shared.css +++ b/chrome/browser/resources/signin/profile_picker/profile_picker_shared.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=chrome://resources/cr_elements/shared_style_css.m.js + * #import=chrome://resources/cr_elements/cr_shared_style.css.js * #import=chrome://resources/cr_elements/shared_vars_css.m.js * #include=cr-shared-style * #css_wrapper_metadata_end */
diff --git a/chrome/browser/resources/signin/signin_reauth/signin_reauth_app.ts b/chrome/browser/resources/signin/signin_reauth/signin_reauth_app.ts index 3860ac8..ba4d388 100644 --- a/chrome/browser/resources/signin/signin_reauth/signin_reauth_app.ts +++ b/chrome/browser/resources/signin/signin_reauth/signin_reauth_app.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js'; import './strings.m.js'; import './signin_shared.css.js';
diff --git a/chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html b/chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html index 1fc5664..849f73f 100644 --- a/chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html +++ b/chrome/browser/resources/signin/sync_confirmation/sync_confirmation_app.html
@@ -64,6 +64,7 @@ } .signin-intercept-design .heading { + font-size: 20px; line-height: 24px; margin-bottom: 24px; }
diff --git a/chrome/browser/resources/webui_gallery/demos/cr_input/cr_input_demo_component.ts b/chrome/browser/resources/webui_gallery/demos/cr_input/cr_input_demo_component.ts index 9ce2012..afdb87a9 100644 --- a/chrome/browser/resources/webui_gallery/demos/cr_input/cr_input_demo_component.ts +++ b/chrome/browser/resources/webui_gallery/demos/cr_input/cr_input_demo_component.ts
@@ -6,7 +6,7 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_icons_css.m.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js';
diff --git a/chrome/browser/resources/welcome/welcome_app.ts b/chrome/browser/resources/welcome/welcome_app.ts index e1749662..5d177648 100644 --- a/chrome/browser/resources/welcome/welcome_app.ts +++ b/chrome/browser/resources/welcome/welcome_app.ts
@@ -4,7 +4,7 @@ import 'chrome://resources/cr_elements/cr_toast/cr_toast.js'; import 'chrome://resources/cr_elements/cr_view_manager/cr_view_manager.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import './google_apps/nux_google_apps.js'; import './landing_view.js'; import './ntp_background/nux_ntp_background.js';
diff --git a/chrome/browser/resources/whats_new/whats_new_app.ts b/chrome/browser/resources/whats_new/whats_new_app.ts index 5707459..63d78d4 100644 --- a/chrome/browser/resources/whats_new/whats_new_app.ts +++ b/chrome/browser/resources/whats_new/whats_new_app.ts
@@ -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 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import './strings.m.js'; import {ClickInfo, Command} from 'chrome://resources/js/browser_command/browser_command.mojom-webui.js';
diff --git a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninChecker.java b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninChecker.java index 0b5200d..7cc8c7b 100644 --- a/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninChecker.java +++ b/chrome/browser/signin/services/android/java/src/org/chromium/chrome/browser/signin/services/SigninChecker.java
@@ -111,7 +111,9 @@ resigninAfterAccountRename(newAccountName, oldSyncConsent); } else { // Sign out if the current primary account is not renamed - mSigninManager.signOut(SignoutReason.ACCOUNT_REMOVED_FROM_DEVICE); + mSigninManager.runAfterOperationInProgress(() -> { + mSigninManager.signOut(SignoutReason.ACCOUNT_REMOVED_FROM_DEVICE); + }); } }); }
diff --git a/chrome/browser/sync/test/integration/two_client_web_apps_integration_test_mac_win_linux.cc b/chrome/browser/sync/test/integration/two_client_web_apps_integration_test_mac_win_linux.cc index e53f6f08..16afdac 100644 --- a/chrome/browser/sync/test/integration/two_client_web_apps_integration_test_mac_win_linux.cc +++ b/chrome/browser/sync/test/integration/two_client_web_apps_integration_test_mac_win_linux.cc
@@ -15,14 +15,7 @@ namespace { -// Flaky on Linux Asan/Tsan, crbug.com/1300208. -#if BUILDFLAG(IS_LINUX) && \ - (defined(THREAD_SANITIZER) || defined(ADDRESS_SANITIZER)) -#define MAYBE_WebAppIntegration DISABLED_WebAppIntegration -#else -#define MAYBE_WebAppIntegration WebAppIntegration -#endif -using MAYBE_WebAppIntegration = TwoClientWebAppsIntegrationTestBase; +using WebAppIntegration = TwoClientWebAppsIntegrationTestBase; // TODO(crbug.com/1301414): Mac shims failing to launch on Mac debug and ASAN. #if BUILDFLAG(IS_MAC) @@ -33,7 +26,7 @@ WAI_41_29StandaloneWindowed_42_40Client2_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_41_29StandaloneWindowed_42_40Client2_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -54,7 +47,7 @@ #define MAYBE_WAI_41_31Standalone_42_40Client2_45Standalone \ WAI_41_31Standalone_42_40Client2_45Standalone #endif -IN_PROC_BROWSER_TEST_F(MAYBE_WebAppIntegration, +IN_PROC_BROWSER_TEST_F(WebAppIntegration, MAYBE_WAI_41_31Standalone_42_40Client2_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -75,7 +68,7 @@ #define MAYBE_WAI_41_47Standalone_42_40Client2_45Standalone \ WAI_41_47Standalone_42_40Client2_45Standalone #endif -IN_PROC_BROWSER_TEST_F(MAYBE_WebAppIntegration, +IN_PROC_BROWSER_TEST_F(WebAppIntegration, MAYBE_WAI_41_47Standalone_42_40Client2_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -88,7 +81,7 @@ helper_.CheckAppInListNotLocallyInstalled(Site::kStandalone); } -IN_PROC_BROWSER_TEST_F(MAYBE_WebAppIntegration, +IN_PROC_BROWSER_TEST_F(WebAppIntegration, WAI_41_29StandaloneBrowser_42_40Client2_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -110,7 +103,7 @@ WAI_41_29NotPromotableWindowed_42_40Client2_45NotPromotable #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_41_29NotPromotableWindowed_42_40Client2_45NotPromotable) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -124,7 +117,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_41_29NotPromotableBrowser_42_40Client2_45NotPromotable) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -138,7 +131,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_46Standalone_7Standalone_11Standalone_37Standalone_18_19) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -158,7 +151,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_46Standalone_7Standalone_11Standalone_34Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -185,7 +178,7 @@ WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_46Standalone_7Standalone_11Standalone_1Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_46Standalone_7Standalone_11Standalone_1Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -204,7 +197,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_34Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -228,7 +221,7 @@ WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_1Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_1Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -244,7 +237,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_41_10Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -270,7 +263,7 @@ WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_41_43Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_41_43Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -288,7 +281,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_29StandaloneBrowser_11Standalone_7Standalone_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -306,7 +299,7 @@ } IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, WAI_29NotPromotableBrowser_11NotPromotable_7NotPromotable_40Client2_45NotPromotable_46NotPromotable_11NotPromotable_7NotPromotable_37NotPromotable_19) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -333,7 +326,7 @@ WAI_29NotPromotableWindowed_12NotPromotable_7NotPromotable_40Client2_45NotPromotable_46NotPromotable_12NotPromotable_7NotPromotable_37NotPromotable_17_20 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29NotPromotableWindowed_12NotPromotable_7NotPromotable_40Client2_45NotPromotable_46NotPromotable_12NotPromotable_7NotPromotable_37NotPromotable_17_20) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -361,7 +354,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_10Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_10Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -394,7 +387,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_43Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_43Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -427,7 +420,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_98Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_98Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -460,7 +453,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_37Standalone_17_20 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_37Standalone_17_20) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -491,7 +484,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_69Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_69Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -521,7 +514,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_35Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_35Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -551,7 +544,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_34Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_34Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -573,10 +566,16 @@ } // TODO(crbug.com/1301414): Mac shims failing to launch on Mac debug and ASAN. -// TODO(crbug.com/1341676): test is flaky on all platforms. +#if BUILDFLAG(IS_MAC) +#define MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24 \ + DISABLED_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24 +#else +#define MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24 \ + WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24 +#endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, - DISABLED_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24) { + WebAppIntegration, + MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or // `docs/webapps/integration-testing-framework` for more info. @@ -605,7 +604,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_34Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_34Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -632,7 +631,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_1Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_1Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -659,7 +658,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -688,7 +687,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_37Standalone_18_19 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_37Standalone_18_19) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -716,7 +715,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_10Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_10Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -745,7 +744,7 @@ WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_43Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_29StandaloneWindowed_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_43Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -774,7 +773,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_10Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_10Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -807,7 +806,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_43Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_43Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -840,7 +839,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_98Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_98Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -873,7 +872,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_37Standalone_17_20 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_37Standalone_17_20) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -904,7 +903,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_69Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_69Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -934,7 +933,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_35Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_35Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -964,7 +963,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_34Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_34Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -994,7 +993,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1024,7 +1023,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_34Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_34Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1051,7 +1050,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_1Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_1Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1078,7 +1077,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1107,7 +1106,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_37Standalone_18_19 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_37Standalone_18_19) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1135,7 +1134,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_10Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_10Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1164,7 +1163,7 @@ WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_43Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_31Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_43Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1193,7 +1192,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_10Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_10Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1226,7 +1225,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_43Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_43Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1259,7 +1258,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_98Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_40Client1_41_98Standalone_40Client2_102Standalone_107Standalone_46Standalone_106Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1292,7 +1291,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_37Standalone_17_20 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_37Standalone_17_20) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1323,7 +1322,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_69Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_69Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1353,7 +1352,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_35Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_35Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1383,7 +1382,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_34Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_34Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1413,7 +1412,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_46Standalone_7Standalone_12Standalone_1Standalone_24) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1443,7 +1442,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_34Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_34Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1470,7 +1469,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_1Standalone_22 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_1Standalone_22) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1497,7 +1496,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_10Standalone_15Standalone_40Client1_15Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1526,7 +1525,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_37Standalone_18_19 #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_37Standalone_18_19) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1554,7 +1553,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_10Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_10Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or @@ -1583,7 +1582,7 @@ WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_43Standalone_42_45Standalone #endif IN_PROC_BROWSER_TEST_F( - MAYBE_WebAppIntegration, + WebAppIntegration, MAYBE_WAI_47Standalone_24_12Standalone_7Standalone_112StandaloneNotShown_40Client2_45Standalone_41_43Standalone_42_45Standalone) { // Test contents are generated by script. Please do not modify! // See `docs/webapps/why-is-this-test-failing.md` or
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialogTest.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialogTest.java index 633e3cb..575dc56 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialogTest.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmManagedSyncDataDialogTest.java
@@ -46,7 +46,7 @@ */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -@Batch(ConfirmSyncDataIntegrationTest.CONFIRM_SYNC_DATA_BATCH_NAME) +@Batch(Batch.PER_CLASS) public class ConfirmManagedSyncDataDialogTest { private static final String TEST_DOMAIN = "test.domain.example.com";
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataIntegrationTest.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataIntegrationTest.java index a131e405..5cea9f27 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataIntegrationTest.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/ConfirmSyncDataIntegrationTest.java
@@ -58,10 +58,8 @@ */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -@Batch(ConfirmSyncDataIntegrationTest.CONFIRM_SYNC_DATA_BATCH_NAME) +@Batch(Batch.PER_CLASS) public class ConfirmSyncDataIntegrationTest extends BlankUiTestActivityTestCase { - public static final String CONFIRM_SYNC_DATA_BATCH_NAME = "confirm_sync_data"; - private static final String OLD_ACCOUNT_NAME = "test.account.old@gmail.com"; private static final String NEW_ACCOUNT_NAME = "test.account.new@gmail.com"; private static final String MANAGED_DOMAIN = "managed-domain.com";
diff --git a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java index 8fb6694f..4a30b13 100644 --- a/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java +++ b/chrome/browser/ui/android/signin/java/src/org/chromium/chrome/browser/ui/signin/fre/SigninFirstRunMediator.java
@@ -22,6 +22,7 @@ import org.chromium.chrome.browser.signin.services.ProfileDataCache; import org.chromium.chrome.browser.signin.services.SigninManager; import org.chromium.chrome.browser.signin.services.SigninManager.SignInCallback; +import org.chromium.chrome.browser.signin.services.SigninManager.SignOutCallback; import org.chromium.chrome.browser.signin.services.SigninPreferencesManager; import org.chromium.chrome.browser.ui.signin.R; import org.chromium.chrome.browser.ui.signin.account_picker.AccountPickerCoordinator; @@ -288,6 +289,11 @@ } private void handleContinueWithNative() { + if (mDestroyed) { + // FirstRunActivity was destroyed while we were waiting for native. + return; + } + assert mDelegate.getNativeInitializationPromise().isFulfilled(); // This is needed to get metrics/crash reports from the sign-in flow itself. @@ -319,7 +325,10 @@ AccountUtils.createAccountFromName(mSelectedAccountName), new SignInCallback() { @Override public void onSignInComplete() { - // Wait for sign-in to be complete before advancing to the next page. + if (mDestroyed) { + // FirstRunActivity was destroyed while we were waiting for sign-in. + return; + } mDelegate.advanceToNextPage(); } @@ -352,6 +361,11 @@ } private void handleDismissWithNative() { + if (mDestroyed) { + // FirstRunActivity was destroyed while we were waiting for native. + return; + } + assert mDelegate.getNativeInitializationPromise().isFulfilled(); mDelegate.recordFreProgressHistogram(MobileFreProgress.WELCOME_DISMISS); @@ -361,11 +375,17 @@ .getIdentityManager(Profile.getLastUsedRegularProfile()) .hasPrimaryAccount(ConsentLevel.SIGNIN)) { mModel.set(SigninFirstRunProperties.SHOW_SIGNIN_PROGRESS_SPINNER, true); + SignOutCallback signOutCallback = () -> { + if (mDestroyed) { + // FirstRunActivity was destroyed while we were waiting for the sign-out. + return; + } + + mDelegate.advanceToNextPage(); + }; IdentityServicesProvider.get() .getSigninManager(Profile.getLastUsedRegularProfile()) - .signOut(SignoutReason.ABORT_SIGNIN, - () - -> { mDelegate.advanceToNextPage(); }, + .signOut(SignoutReason.ABORT_SIGNIN, signOutCallback, /* forceWipeUserData= */ false); } else { mDelegate.advanceToNextPage();
diff --git a/chrome/browser/ui/android/webid/account_selection_view_android.cc b/chrome/browser/ui/android/webid/account_selection_view_android.cc index 57928d5..d755e67 100644 --- a/chrome/browser/ui/android/webid/account_selection_view_android.cc +++ b/chrome/browser/ui/android/webid/account_selection_view_android.cc
@@ -145,6 +145,12 @@ sign_in_mode == Account::SignInMode::kAuto); } +void AccountSelectionViewAndroid::ShowFailureDialog( + const std::string& rp_for_display, + const std::string& idp_for_display) { + // TODO(crbug.com/1357790): add support on Android. +} + void AccountSelectionViewAndroid::OnAccountSelected( JNIEnv* env, const JavaParamRef<jobjectArray>& account_string_fields,
diff --git a/chrome/browser/ui/android/webid/account_selection_view_android.h b/chrome/browser/ui/android/webid/account_selection_view_android.h index 4f425ce2..8667700c 100644 --- a/chrome/browser/ui/android/webid/account_selection_view_android.h +++ b/chrome/browser/ui/android/webid/account_selection_view_android.h
@@ -26,6 +26,8 @@ const content::IdentityProviderMetadata& idp_metadata, const content::ClientIdData& client_data, Account::SignInMode sign_in_mode) override; + void ShowFailureDialog(const std::string& rp_for_display, + const std::string& idp_for_display) override; void OnAccountSelected( JNIEnv* env,
diff --git a/chrome/browser/ui/app_list/search/files/drive_search_browsertest.cc b/chrome/browser/ui/app_list/search/files/drive_search_browsertest.cc index 47b2986..6fb8dd5 100644 --- a/chrome/browser/ui/app_list/search/files/drive_search_browsertest.cc +++ b/chrome/browser/ui/app_list/search/files/drive_search_browsertest.cc
@@ -14,14 +14,10 @@ // This class contains additional logic to set up DriveFS and enable testing for // Drive file search in the launcher. -// Parameterized by ProductivityLauncher feature. -class AppListDriveSearchBrowserTest - : public AppListSearchBrowserTest, - public ::testing::WithParamInterface<bool> { +class AppListDriveSearchBrowserTest : public AppListSearchBrowserTest { public: AppListDriveSearchBrowserTest() { - feature_list_.InitWithFeatureState(ash::features::kProductivityLauncher, - GetParam()); + feature_list_.InitWithFeatures({ash::features::kProductivityLauncher}, {}); } void SetUpInProcessBrowserTestFixture() override { @@ -56,12 +52,8 @@ fake_drivefs_helpers_; }; -INSTANTIATE_TEST_SUITE_P(ProductivityLauncher, - AppListDriveSearchBrowserTest, - ::testing::Bool()); - // Test that Drive files can be searched. -IN_PROC_BROWSER_TEST_P(AppListDriveSearchBrowserTest, FileSearch) { +IN_PROC_BROWSER_TEST_F(AppListDriveSearchBrowserTest, FileSearch) { base::ScopedAllowBlockingForTesting allow_blocking; drive::DriveIntegrationService* drive_service = @@ -82,7 +74,7 @@ } // Test that Drive folders can be searched. -IN_PROC_BROWSER_TEST_P(AppListDriveSearchBrowserTest, FolderSearch) { +IN_PROC_BROWSER_TEST_F(AppListDriveSearchBrowserTest, FolderSearch) { base::ScopedAllowBlockingForTesting allow_blocking; drive::DriveIntegrationService* drive_service = @@ -102,7 +94,7 @@ } // Test that files are ordered based on access time. -IN_PROC_BROWSER_TEST_P(AppListDriveSearchBrowserTest, ResultOrdering) { +IN_PROC_BROWSER_TEST_F(AppListDriveSearchBrowserTest, ResultOrdering) { base::ScopedAllowBlockingForTesting allow_blocking; drive::DriveIntegrationService* drive_service =
diff --git a/chrome/browser/ui/app_list/search/files/item_suggest_cache.h b/chrome/browser/ui/app_list/search/files/item_suggest_cache.h index 65ae73d..3e8e8261 100644 --- a/chrome/browser/ui/app_list/search/files/item_suggest_cache.h +++ b/chrome/browser/ui/app_list/search/files/item_suggest_cache.h
@@ -58,7 +58,7 @@ ItemSuggestCache( Profile* profile, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory); - ~ItemSuggestCache(); + virtual ~ItemSuggestCache(); ItemSuggestCache(const ItemSuggestCache&) = delete; ItemSuggestCache& operator=(const ItemSuggestCache&) = delete; @@ -73,8 +73,8 @@ // the cache has not been successfully updated. absl::optional<ItemSuggestCache::Results> GetResults(); - // Updates the cache by calling ItemSuggest. - void UpdateCache(); + // Updates the cache by calling ItemSuggest. Virtual for testing. + virtual void UpdateCache(); static absl::optional<ItemSuggestCache::Results> ConvertJsonForTest( const base::Value* value);
diff --git a/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.cc b/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.cc index d6131f3..f893f7d 100644 --- a/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.cc +++ b/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.cc
@@ -41,8 +41,6 @@ namespace app_list { namespace { -using ThrottleInterval = ZeroStateDriveProvider::ThrottleInterval; - constexpr char kSchema[] = "zero_state_drive://"; // How long to wait before making the first request for results from the @@ -67,21 +65,6 @@ kMaxValue = kDriveDisabled, }; -ThrottleInterval MinutesToThrottleInterval(const int minutes) { - switch (minutes) { - case 5: - return ThrottleInterval::kFiveMinutes; - case 10: - return ThrottleInterval::kTenMinutes; - case 15: - return ThrottleInterval::kFifteenMinutes; - case 30: - return ThrottleInterval::kThirtyMinutes; - default: - return ThrottleInterval::kUnknown; - } -} - void LogStatus(Status status) { base::UmaHistogramEnumeration("Apps.AppList.DriveZeroStateProvider.Status", status); @@ -196,8 +179,6 @@ ZeroStateDriveProvider::~ZeroStateDriveProvider() = default; void ZeroStateDriveProvider::OnFileSystemMounted() { - MaybeLogHypotheticalQuery(); - static const bool kUpdateCache = base::GetFieldTrialParamByFeatureAsBool( ash::features::kProductivityLauncher, "itemsuggest_query_on_filesystem_mounted", true); @@ -216,12 +197,11 @@ ash::features::kProductivityLauncher, "itemsuggest_query_on_session_state_changed", true); - // Perform a hypothetical query if the user has logged in. + // Update cache if the user has logged in. if (session_manager_->session_state() == - session_manager::SessionState::ACTIVE) { - MaybeLogHypotheticalQuery(); - if (kUpdateCache) - MaybeUpdateCache(); + session_manager::SessionState::ACTIVE && + kUpdateCache) { + MaybeUpdateCache(); } } @@ -231,18 +211,15 @@ ash::features::kProductivityLauncher, "itemsuggest_query_on_screen_idle_state_changed", true); - // Perform a hypothetical query if the screen changed from off to on. - if (screen_off_ && !proto.dimmed() && !proto.off()) { - MaybeLogHypotheticalQuery(); - if (kUpdateCache) - MaybeUpdateCache(); + // Update cache if the screen changed from off to on. + if (screen_off_ && !proto.dimmed() && !proto.off() && kUpdateCache) { + MaybeUpdateCache(); } screen_off_ = proto.off(); } void ZeroStateDriveProvider::ViewClosing() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - MaybeLogHypotheticalQuery(); static const bool kUpdateCache = base::GetFieldTrialParamByFeatureAsBool( ash::features::kProductivityLauncher, "itemsuggest_query_on_view_closing", @@ -405,21 +382,4 @@ } } -void ZeroStateDriveProvider::MaybeLogHypotheticalQuery() { - const auto now = base::TimeTicks::Now(); - const std::vector<int> throttle_intervals({5, 10, 15, 30}); - - for (const int interval : throttle_intervals) { - const bool is_first_query = last_hypothetical_query_.find(interval) == - last_hypothetical_query_.end(); - if (is_first_query || - now - last_hypothetical_query_[interval] >= base::Minutes(interval)) { - base::UmaHistogramEnumeration( - "Apps.AppList.DriveZeroStateProvider.HypotheticalQuery", - MinutesToThrottleInterval(interval)); - last_hypothetical_query_[interval] = now; - } - } -} - } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.h b/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.h index b0d5bfe..475b139 100644 --- a/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.h +++ b/chrome/browser/ui/app_list/search/files/zero_state_drive_provider.h
@@ -61,18 +61,6 @@ ash::AppListSearchResultType ResultType() const override; bool ShouldBlockZeroState() const override; - // The minimum time between hypothetical queries. - // These values persist to logs. Entries should not be renumbered and numeric - // values should never be reused. - enum class ThrottleInterval { - kUnknown = 0, - kFiveMinutes = 1, - kTenMinutes = 2, - kFifteenMinutes = 3, - kThirtyMinutes = 4, - kMaxValue = kThirtyMinutes, - }; - private: void OnFilePathsLocated( absl::optional<std::vector<drivefs::mojom::FilePathOrErrorPtr>> paths); @@ -95,16 +83,6 @@ // this does nothing. void MaybeUpdateCache(); - // We are intending to change the triggers of queries to ItemSuggest, but - // first want to know the QPS impact of the change. This method records - // metrics to track how many queries we will send under the proposed new - // logic. It does not actually make any queries. The new logic is as follows: - // - Query on login and wake from sleep. - // - Query on every launcher open. - // - Query at most every 5, 10 or 15 minutes. These are tracked separately in - // the metrics. - void MaybeLogHypotheticalQuery(); - Profile* const profile_; drive::DriveIntegrationService* const drive_service_; session_manager::SessionManager* const session_manager_; @@ -120,13 +98,7 @@ const base::Time construction_time_; base::TimeTicks query_start_time_; - // The time we last logged a hypothetical query, keyed by the minimum time - // between queries in minutes (5, 10 or 15 minutes). See - // MaybeLogHypotheticalQuery for details. - std::map<int, base::TimeTicks> last_hypothetical_query_; - - // Whether or not the screen is off due to idling. Used for logging a - // hypothetical query on wake. + // Whether or not the screen is off due to idling. bool screen_off_ = true; // A file needs to have been modified more recently than this to be considered
diff --git a/chrome/browser/ui/app_list/search/files/zero_state_drive_provider_unittest.cc b/chrome/browser/ui/app_list/search/files/zero_state_drive_provider_unittest.cc index 8253812d..60ab30b 100644 --- a/chrome/browser/ui/app_list/search/files/zero_state_drive_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/files/zero_state_drive_provider_unittest.cc
@@ -18,8 +18,18 @@ namespace app_list { namespace { -constexpr char kHypotheticalQueryHistogram[] = - "Apps.AppList.DriveZeroStateProvider.HypotheticalQuery"; +class TestItemSuggestCache : public ItemSuggestCache { + public: + explicit TestItemSuggestCache(Profile* profile) + : ItemSuggestCache(profile, nullptr) {} + TestItemSuggestCache(const TestItemSuggestCache&) = delete; + TestItemSuggestCache& operator=(const TestItemSuggestCache&) = delete; + ~TestItemSuggestCache() override = default; + + void UpdateCache() override { update_count_++; } + + int update_count_ = 0; +}; } // namespace @@ -28,25 +38,23 @@ void SetUp() override { profile_ = std::make_unique<TestingProfile>(); session_manager_ = std::make_unique<session_manager::SessionManager>(); + auto item_suggest_cache = + std::make_unique<TestItemSuggestCache>(profile_.get()); + item_suggest_cache_ = item_suggest_cache.get(); + provider_ = std::make_unique<ZeroStateDriveProvider>( profile_.get(), nullptr, drive::DriveIntegrationServiceFactory::GetForProfile(profile_.get()), - session_manager_.get(), - std::make_unique<ItemSuggestCache>(profile_.get(), nullptr)); + session_manager_.get(), std::move(item_suggest_cache)); } void FastForwardByMinutes(int minutes) { task_environment_.FastForwardBy(base::Minutes(minutes)); } - // Check the histogram count and then fast forward in order to bypass the - // throttling interval. - void ExpectHistogramCountAndWait(int count) { - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFiveMinutes, count); - FastForwardByMinutes(5); - } + void Wait() { task_environment_.RunUntilIdle(); } + + int update_count() const { return item_suggest_cache_->update_count_; } content::BrowserTaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; @@ -55,139 +63,74 @@ std::unique_ptr<session_manager::SessionManager> session_manager_; std::unique_ptr<ZeroStateDriveProvider> provider_; base::HistogramTester histogram_tester_; + + // Owned by |provider_|. + TestItemSuggestCache* item_suggest_cache_; }; -// Test that each of the trigger events logs a hypothetical query. -TEST_F(ZeroStateDriveProviderTest, HypotheticalQueryTriggers) { +// TODO(crbug.com/1348339): Add a test for a file mount-triggered update at +// construction time. + +// Test that each of the trigger events causes an update. +TEST_F(ZeroStateDriveProviderTest, UpdateCache) { + // Fast forward past the construction delay. + FastForwardByMinutes(1); + EXPECT_EQ(update_count(), 0); + provider_->OnFileSystemMounted(); - ExpectHistogramCountAndWait(1); + // File system mount updates are posted with a delay, so fast forward here. + FastForwardByMinutes(1); + EXPECT_EQ(update_count(), 1); provider_->ViewClosing(); - ExpectHistogramCountAndWait(2); + EXPECT_EQ(update_count(), 2); session_manager_->SetSessionState(session_manager::SessionState::ACTIVE); - provider_->OnSessionStateChanged(); - ExpectHistogramCountAndWait(3); + EXPECT_EQ(update_count(), 3); power_manager::ScreenIdleState idle_state; idle_state.set_dimmed(false); idle_state.set_off(false); provider_->ScreenIdleStateChanged(idle_state); - ExpectHistogramCountAndWait(4); + EXPECT_EQ(update_count(), 4); } -// Test that the minimum interval between queries is respected. -TEST_F(ZeroStateDriveProviderTest, HypotheticalQueryIntervals) { - histogram_tester_.ExpectTotalCount(kHypotheticalQueryHistogram, 0); +// Test that an update is triggered when the screen turns on. +TEST_F(ZeroStateDriveProviderTest, UpdateOnWake) { + // Fast forward past the construction delay. + FastForwardByMinutes(1); - provider_->ViewClosing(); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFiveMinutes, 1); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kTenMinutes, 1); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFifteenMinutes, 1); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kThirtyMinutes, 1); - - FastForwardByMinutes(5); - provider_->ViewClosing(); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFiveMinutes, 2); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kTenMinutes, 1); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFifteenMinutes, 1); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kThirtyMinutes, 1); - - FastForwardByMinutes(5); - provider_->ViewClosing(); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFiveMinutes, 3); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kTenMinutes, 2); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFifteenMinutes, 1); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kThirtyMinutes, 1); - - FastForwardByMinutes(5); - provider_->ViewClosing(); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFiveMinutes, 4); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kTenMinutes, 2); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFifteenMinutes, 2); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kThirtyMinutes, 1); - - FastForwardByMinutes(15); - provider_->ViewClosing(); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFiveMinutes, 5); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kTenMinutes, 3); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kFifteenMinutes, 3); - histogram_tester_.ExpectBucketCount( - kHypotheticalQueryHistogram, - ZeroStateDriveProvider::ThrottleInterval::kThirtyMinutes, 2); -} - -// Test that a hypothetical query is logged when the screen turns on. -TEST_F(ZeroStateDriveProviderTest, HypotheticalQueryOnWake) { power_manager::ScreenIdleState idle_state; - histogram_tester_.ExpectTotalCount(kHypotheticalQueryHistogram, 0); + EXPECT_EQ(update_count(), 0); // Turn the screen on. This logs a query since the screen state is default off // when the provider is initialized. idle_state.set_dimmed(false); idle_state.set_off(false); provider_->ScreenIdleStateChanged(idle_state); - ExpectHistogramCountAndWait(1); + EXPECT_EQ(update_count(), 1); // Dim the screen. idle_state.set_dimmed(true); provider_->ScreenIdleStateChanged(idle_state); - ExpectHistogramCountAndWait(1); + EXPECT_EQ(update_count(), 1); // Undim the screen. This should NOT log a query. idle_state.set_dimmed(false); provider_->ScreenIdleStateChanged(idle_state); - ExpectHistogramCountAndWait(1); + EXPECT_EQ(update_count(), 1); // Turn off the screen. idle_state.set_dimmed(true); idle_state.set_off(true); provider_->ScreenIdleStateChanged(idle_state); - ExpectHistogramCountAndWait(1); + EXPECT_EQ(update_count(), 1); // Turn on the screen. This logs a query. idle_state.set_dimmed(false); idle_state.set_off(false); provider_->ScreenIdleStateChanged(idle_state); - ExpectHistogramCountAndWait(2); + EXPECT_EQ(update_count(), 2); } } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/help_app_search_browsertest.cc b/chrome/browser/ui/app_list/search/help_app_search_browsertest.cc index fa3dc03..adf6994 100644 --- a/chrome/browser/ui/app_list/search/help_app_search_browsertest.cc +++ b/chrome/browser/ui/app_list/search/help_app_search_browsertest.cc
@@ -35,30 +35,16 @@ namespace app_list { -// Parameterized depending on whether productivity launcher is enabled. class HelpAppSearchBrowserTestBase : public AppListSearchBrowserTest { public: HelpAppSearchBrowserTestBase() { scoped_feature_list_.InitWithFeatures( {chromeos::features::kHelpAppLauncherSearch, - chromeos::features::kHelpAppDiscoverTab}, + chromeos::features::kHelpAppDiscoverTab, + ash::features::kProductivityLauncher}, {}); } - explicit HelpAppSearchBrowserTestBase(bool for_productivity_launcher) { - if (for_productivity_launcher) { - scoped_feature_list_.InitWithFeatures( - {chromeos::features::kHelpAppLauncherSearch, - chromeos::features::kHelpAppDiscoverTab, - ash::features::kProductivityLauncher}, - {}); - } else { - scoped_feature_list_.InitWithFeatures( - {chromeos::features::kHelpAppLauncherSearch, - chromeos::features::kHelpAppDiscoverTab}, - {ash::features::kProductivityLauncher}); - } - } ~HelpAppSearchBrowserTestBase() override = default; HelpAppSearchBrowserTestBase(const HelpAppSearchBrowserTestBase&) = delete; @@ -83,10 +69,8 @@ SearchResultsChangedWaiter results_waiter(GetClient()->search_controller(), result_types); GetClient()->ShowAppList(); - if (ash::features::IsProductivityLauncherEnabled()) { - ash::AppListTestApi().WaitForBubbleWindow( - /*wait_for_opening_animation=*/false); - } + ash::AppListTestApi().WaitForBubbleWindow( + /*wait_for_opening_animation=*/false); results_waiter.Wait(); } @@ -94,12 +78,9 @@ base::test::ScopedFeatureList scoped_feature_list_; }; -class HelpAppSearchBrowserTest : public HelpAppSearchBrowserTestBase, - public ::testing::WithParamInterface<bool> { +class HelpAppSearchBrowserTest : public HelpAppSearchBrowserTestBase { public: - HelpAppSearchBrowserTest() - : HelpAppSearchBrowserTestBase(/*for_productivity_launcher=*/GetParam()) { - } + HelpAppSearchBrowserTest() = default; // HelpAppSearchBrowserTestBase: void SetUpOnMainThread() override { @@ -111,73 +92,22 @@ // needs to be visible, which will only be the case if other continue // results exist - create search provider to inject continue section // results. - if (GetParam()) { - auto continue_section_provider = - std::make_unique<TestContinueFilesSearchProvider>(); - continue_section_provider_ = continue_section_provider.get(); - app_list::SearchController* search_controller = - AppListClientImpl::GetInstance()->search_controller(); - size_t group_id = search_controller->AddGroup(10); - search_controller->AddProvider(group_id, - std::move(continue_section_provider)); - } + auto continue_section_provider = + std::make_unique<TestContinueFilesSearchProvider>(); + continue_section_provider_ = continue_section_provider.get(); + app_list::SearchController* search_controller = + AppListClientImpl::GetInstance()->search_controller(); + size_t group_id = search_controller->AddGroup(10); + search_controller->AddProvider(group_id, + std::move(continue_section_provider)); } TestContinueFilesSearchProvider* continue_section_provider_ = nullptr; }; -INSTANTIATE_TEST_SUITE_P(ProductivityLauncher, - HelpAppSearchBrowserTest, - testing::Bool()); - -// Test that clicking the Discover tab suggestion chip launches the Help app on -// the Discover page. -IN_PROC_BROWSER_TEST_P(HelpAppSearchBrowserTest, - ClickingDiscoverTabSuggestionChipLaunchesHelpApp) { - ash::SystemWebAppManager::GetForTest(GetProfile()) - ->InstallSystemAppsForTesting(); - GetProfile()->GetPrefs()->SetInteger( - prefs::kDiscoverTabSuggestionChipTimesLeftToShow, 3); - - ShowAppListAndWaitForHelpAppZeroStateResults(); - - ChromeSearchResult* result = FindResult("help-app://discover"); - ASSERT_EQ(GetParam(), !result); - if (GetParam()) - return; - - EXPECT_EQ(result->title(), l10n_util::GetStringUTF16( - IDS_HELP_APP_DISCOVER_TAB_SUGGESTION_CHIP)); - EXPECT_EQ(result->metrics_type(), ash::HELP_APP_DISCOVER); - - // Open the search result. This should open the help app at the expected url. - size_t num_browsers = chrome::GetTotalBrowserCount(); - const GURL expected_url("chrome://help-app/discover"); - content::TestNavigationObserver navigation_observer(expected_url); - navigation_observer.StartWatchingNewWebContents(); - - GetClient()->OpenSearchResult( - GetClient()->GetModelUpdaterForTest()->model_id(), result->id(), - /*event_flags=*/0, ash::AppListLaunchedFrom::kLaunchedFromSuggestionChip, - ash::AppListLaunchType::kAppSearchResult, /*suggestion_index=*/0, - /*launch_as_default=*/false); - - navigation_observer.Wait(); - - EXPECT_EQ(num_browsers + 1, chrome::GetTotalBrowserCount()); - EXPECT_EQ(expected_url, chrome::FindLastActive() - ->tab_strip_model() - ->GetActiveWebContents() - ->GetVisibleURL()); - - // Clicking on the chip should stop showing it in the future. - EXPECT_EQ(0, GetProfile()->GetPrefs()->GetInteger( - prefs::kDiscoverTabSuggestionChipTimesLeftToShow)); -} - // Test that Help App shows up as Release notes if pref shows we have some times // left to show it. -IN_PROC_BROWSER_TEST_P(HelpAppSearchBrowserTest, +IN_PROC_BROWSER_TEST_F(HelpAppSearchBrowserTest, AppListSearchHasReleaseNotesSuggestionChip) { ash::SystemWebAppManager::GetForTest(GetProfile()) ->InstallSystemAppsForTesting(); @@ -188,21 +118,17 @@ auto* result = FindResult("help-app://updates"); ASSERT_TRUE(result); - EXPECT_EQ(result->title(), - GetParam() ? l10n_util::GetStringUTF16( - IDS_HELP_APP_WHATS_NEW_CONTINUE_TASK_TITLE) - : l10n_util::GetStringUTF16( - IDS_HELP_APP_WHATS_NEW_SUGGESTION_CHIP)); + EXPECT_EQ(result->title(), l10n_util::GetStringUTF16( + IDS_HELP_APP_WHATS_NEW_CONTINUE_TASK_TITLE)); EXPECT_EQ(result->metrics_type(), ash::HELP_APP_UPDATES); // Displayed in first position. EXPECT_EQ(result->position_priority(), 1.0f); - EXPECT_EQ(result->display_type(), - GetParam() ? DisplayType::kContinue : DisplayType::kChip); + EXPECT_EQ(result->display_type(), DisplayType::kContinue); } // Test that the number of times the suggestion chip should show decreases when // the chip is shown. -IN_PROC_BROWSER_TEST_P(HelpAppSearchBrowserTest, +IN_PROC_BROWSER_TEST_F(HelpAppSearchBrowserTest, ReleaseNotesDecreasesTimesShownOnAppListOpen) { ash::SystemWebAppManager::GetForTest(GetProfile()) ->InstallSystemAppsForTesting(); @@ -217,8 +143,7 @@ ShowAppListAndWaitForHelpAppZeroStateResults(); GetClient()->GetNotifier()->FireImpressionTimerForTesting( - GetParam() ? ash::AppListNotifier::Location::kContinue - : ash::AppListNotifier::Location::kChip); + ash::AppListNotifier::Location::kContinue); const int times_left_to_show = GetProfile()->GetPrefs()->GetInteger( prefs::kReleaseNotesSuggestionChipTimesLeftToShow); @@ -227,7 +152,7 @@ // Test that the number of times the suggestion chip should show decreases when // the chip is shown in tablet mode. -IN_PROC_BROWSER_TEST_P( +IN_PROC_BROWSER_TEST_F( HelpAppSearchBrowserTest, ReleaseNotesDecreasesTimesShownOnAppListOpenInTabletMode) { ash::SystemWebAppManager::GetForTest(GetProfile()) @@ -250,8 +175,7 @@ results_waiter.Wait(); GetClient()->GetNotifier()->FireImpressionTimerForTesting( - GetParam() ? ash::AppListNotifier::Location::kContinue - : ash::AppListNotifier::Location::kChip); + ash::AppListNotifier::Location::kContinue); const int times_left_to_show = GetProfile()->GetPrefs()->GetInteger( prefs::kReleaseNotesSuggestionChipTimesLeftToShow); @@ -260,7 +184,7 @@ // Test that clicking the Release Notes suggestion chip launches the Help app on // the What's New page. -IN_PROC_BROWSER_TEST_P(HelpAppSearchBrowserTest, +IN_PROC_BROWSER_TEST_F(HelpAppSearchBrowserTest, ClickingReleaseNotesSuggestionChipLaunchesHelpApp) { ash::SystemWebAppManager::GetForTest(GetProfile()) ->InstallSystemAppsForTesting(); @@ -298,7 +222,7 @@ } // Test that the help app provider provides list search results. -IN_PROC_BROWSER_TEST_P(HelpAppSearchBrowserTest, +IN_PROC_BROWSER_TEST_F(HelpAppSearchBrowserTest, HelpAppProviderProvidesListResults) { // Need this because it sets up the icon. ash::SystemWebAppManager::GetForTest(GetProfile())
diff --git a/chrome/browser/ui/browser_tab_strip_model_delegate.cc b/chrome/browser/ui/browser_tab_strip_model_delegate.cc index c3061e1a..ee8f1bf 100644 --- a/chrome/browser/ui/browser_tab_strip_model_delegate.cc +++ b/chrome/browser/ui/browser_tab_strip_model_delegate.cc
@@ -244,8 +244,7 @@ } bool BrowserTabStripModelDelegate::SupportsReadLater() { - return !browser_->profile()->IsGuestSession() && - !web_app::AppBrowserController::IsWebApp(browser_); + return !browser_->profile()->IsGuestSession() && !IsForWebApp(); } void BrowserTabStripModelDelegate::CacheWebContents( @@ -287,6 +286,10 @@ chrome::UnfollowSite(web_contents); } +bool BrowserTabStripModelDelegate::IsForWebApp() { + return web_app::AppBrowserController::IsWebApp(browser_); +} + //////////////////////////////////////////////////////////////////////////////// // BrowserTabStripModelDelegate, private:
diff --git a/chrome/browser/ui/browser_tab_strip_model_delegate.h b/chrome/browser/ui/browser_tab_strip_model_delegate.h index 2c110c1..2a31a05 100644 --- a/chrome/browser/ui/browser_tab_strip_model_delegate.h +++ b/chrome/browser/ui/browser_tab_strip_model_delegate.h
@@ -62,6 +62,7 @@ web_contents) override; void FollowSite(content::WebContents* web_contents) override; void UnfollowSite(content::WebContents* web_contents) override; + bool IsForWebApp() override; void CloseFrame();
diff --git a/chrome/browser/ui/fast_checkout/fast_checkout_controller.h b/chrome/browser/ui/fast_checkout/fast_checkout_controller.h index e77db1f..0ad4a3d 100644 --- a/chrome/browser/ui/fast_checkout/fast_checkout_controller.h +++ b/chrome/browser/ui/fast_checkout/fast_checkout_controller.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_UI_FAST_CHECKOUT_FAST_CHECKOUT_CONTROLLER_H_ #define CHROME_BROWSER_UI_FAST_CHECKOUT_FAST_CHECKOUT_CONTROLLER_H_ +#include <vector> + #include "base/memory/raw_ptr.h" #include "ui/gfx/native_widget_types.h" @@ -20,7 +22,9 @@ // Instructs the controller to show the stored autofill profiles and // credit cards to the user. - virtual void Show() = 0; + virtual void Show( + const std::vector<autofill::AutofillProfile*>& autofill_profiles, + const std::vector<autofill::CreditCard*>& credit_cards) = 0; // Informs the controller that the user has made a selection. virtual void OnOptionsSelected(
diff --git a/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.cc b/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.cc index bccc43c..b7969995 100644 --- a/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.cc +++ b/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.cc
@@ -5,8 +5,6 @@ #include "chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h" #include "chrome/browser/android/preferences/autofill/autofill_profile_bridge.h" -#include "chrome/browser/autofill/personal_data_manager_factory.h" -#include "chrome/browser/profiles/profile.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/data_model/credit_card.h" @@ -19,10 +17,10 @@ FastCheckoutControllerImpl::~FastCheckoutControllerImpl() = default; -void FastCheckoutControllerImpl::Show() { - GetOrCreateView()->Show(GetPersonalDataManager()->GetProfilesToSuggest(), - GetPersonalDataManager()->GetCreditCardsToSuggest( - /* include_server_cards= */ true)); +void FastCheckoutControllerImpl::Show( + const std::vector<autofill::AutofillProfile*>& autofill_profiles, + const std::vector<autofill::CreditCard*>& credit_cards) { + GetOrCreateView()->Show(autofill_profiles, credit_cards); } void FastCheckoutControllerImpl::OnOptionsSelected( @@ -44,14 +42,6 @@ return view_.get(); } -autofill::PersonalDataManager* -FastCheckoutControllerImpl::GetPersonalDataManager() { - Profile* profile = - Profile::FromBrowserContext(web_contents_->GetBrowserContext()); - return autofill::PersonalDataManagerFactory::GetForProfile( - profile->GetOriginalProfile()); -} - void FastCheckoutControllerImpl::OpenAutofillProfileSettings() { #if BUILDFLAG(IS_ANDROID) autofill::ShowAutofillProfileSettings(web_contents_);
diff --git a/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h b/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h index 64d33c27..c79c58f 100644 --- a/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h +++ b/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h
@@ -10,7 +10,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/fast_checkout/fast_checkout_view.h" -#include "components/autofill/core/browser/personal_data_manager.h" #include "ui/gfx/native_widget_types.h" namespace content { @@ -44,7 +43,8 @@ delete; // FastCheckoutController: - void Show() override; + void Show(const std::vector<autofill::AutofillProfile*>& autofill_profiles, + const std::vector<autofill::CreditCard*>& credit_cards) override; void OnOptionsSelected( std::unique_ptr<autofill::AutofillProfile> profile, std::unique_ptr<autofill::CreditCard> credit_card) override; @@ -61,9 +61,6 @@ // controller. virtual FastCheckoutView* GetOrCreateView(); - // Returns the current active personal data manager. - virtual autofill::PersonalDataManager* GetPersonalDataManager(); - private: // Weak pointer to the WebContents this class is tied to. const raw_ptr<content::WebContents> web_contents_;
diff --git a/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl_unittest.cc b/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl_unittest.cc index f222ba13..c8f30993 100644 --- a/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl_unittest.cc +++ b/chrome/browser/ui/fast_checkout/fast_checkout_controller_impl_unittest.cc
@@ -5,11 +5,9 @@ #include "chrome/browser/ui/fast_checkout/fast_checkout_controller_impl.h" #include <memory> -#include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/ui/fast_checkout/fast_checkout_view.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "components/autofill/core/browser/autofill_test_utils.h" -#include "components/autofill/core/browser/test_personal_data_manager.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -27,8 +25,8 @@ MOCK_METHOD(void, Show, - (const std::vector<autofill::AutofillProfile*>&, - const std::vector<autofill::CreditCard*>&), + (const std::vector<AutofillProfile*>&, + const std::vector<CreditCard*>&), (override)); }; @@ -46,24 +44,16 @@ class TestFastCheckoutControllerImpl : public FastCheckoutControllerImpl { public: - TestFastCheckoutControllerImpl( - content::WebContents* web_contents, - Delegate* delegate, - FastCheckoutView* view, - autofill::PersonalDataManager* personal_manager) - : FastCheckoutControllerImpl(web_contents, delegate), - view_(view), - personal_manager_(personal_manager) {} + TestFastCheckoutControllerImpl(content::WebContents* web_contents, + Delegate* delegate, + FastCheckoutView* view) + : FastCheckoutControllerImpl(web_contents, delegate), view_(view) {} ~TestFastCheckoutControllerImpl() override = default; FastCheckoutView* GetOrCreateView() override { return view_; } - autofill::PersonalDataManager* GetPersonalDataManager() override { - return personal_manager_; - } private: FastCheckoutView* view_; - autofill::PersonalDataManager* personal_manager_; }; } // namespace @@ -78,17 +68,11 @@ fast_checkout_controller_ = std::make_unique<TestFastCheckoutControllerImpl>( - web_contents(), &delegate_, &mock_view_, - &test_personal_data_manager_); - - test_personal_data_manager_.SetAutofillProfileEnabled(true); - test_personal_data_manager_.SetAutofillCreditCardEnabled(true); - test_personal_data_manager_.SetAutofillWalletImportEnabled(true); + web_contents(), &delegate_, &mock_view_); } MockFastCheckoutView mock_view_; MockFastCheckoutImplDelegate delegate_; - autofill::TestPersonalDataManager test_personal_data_manager_; // The object to be tested. std::unique_ptr<TestFastCheckoutControllerImpl> fast_checkout_controller_; }; @@ -96,20 +80,19 @@ TEST_F(FastCheckoutControllerImplTest, Show) { AutofillProfile profile1 = autofill::test::GetFullProfile(); AutofillProfile profile2 = autofill::test::GetFullProfile2(); - test_personal_data_manager_.AddProfile(profile1); - test_personal_data_manager_.AddProfile(profile2); + std::vector<autofill::AutofillProfile*> profiles = {&profile1, &profile2}; CreditCard credit_card1 = autofill::test::GetCreditCard(); CreditCard credit_card2 = autofill::test::GetCreditCard2(); - test_personal_data_manager_.AddCreditCard(credit_card1); - test_personal_data_manager_.AddCreditCard(credit_card2); + std::vector<autofill::CreditCard*> credit_cards = {&credit_card1, + &credit_card2}; EXPECT_CALL( mock_view_, Show(UnorderedElementsAre(Pointee(profile1), Pointee(profile2)), UnorderedElementsAre(Pointee(credit_card1), Pointee(credit_card2)))); - fast_checkout_controller_->Show(); + fast_checkout_controller_->Show(profiles, credit_cards); } TEST_F(FastCheckoutControllerImplTest, OnOptionsSelected) {
diff --git a/chrome/browser/ui/page_info/about_this_site_side_panel.h b/chrome/browser/ui/page_info/about_this_site_side_panel.h index a26424ed..03cf8a4 100644 --- a/chrome/browser/ui/page_info/about_this_site_side_panel.h +++ b/chrome/browser/ui/page_info/about_this_site_side_panel.h
@@ -5,16 +5,15 @@ #ifndef CHROME_BROWSER_UI_PAGE_INFO_ABOUT_THIS_SITE_SIDE_PANEL_H_ #define CHROME_BROWSER_UI_PAGE_INFO_ABOUT_THIS_SITE_SIDE_PANEL_H_ -#include "content/public/browser/page_navigator.h" +class GURL; namespace content { -struct OpenURLParams; class WebContents; } // namespace content // Implemented by about_this_site_side_panel_coordinator.cc in ui/views. void ShowAboutThisSiteSidePanel(content::WebContents* web_contents, - const content::OpenURLParams& params); + const GURL& more_about_url); void RegisterAboutThisSiteSidePanel(content::WebContents* web_contents, - const content::OpenURLParams& params); + const GURL& more_about_url); #endif
diff --git a/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.cc b/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.cc index 9016ff3a..f36bdef0 100644 --- a/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.cc +++ b/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.cc
@@ -15,6 +15,7 @@ #include "chrome/common/pref_names.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/page_info/core/about_this_site_service.h" +#include "components/page_info/core/features.h" #include "components/permissions/permission_decision_auto_blocker.h" #include "components/permissions/permission_manager.h" #include "components/permissions/permissions_client.h" @@ -125,20 +126,10 @@ void ChromePageInfoUiDelegate::OpenMoreAboutThisPageUrl( const GURL& url, const ui::Event& event) { - content::OpenURLParams url_params( - net::AppendOrReplaceQueryParameter( - url, page_info::AboutThisSiteRenderModeParameterName, - page_info::AboutThisSiteRenderModeParameterValue), - content::Referrer(), - ui::DispositionFromEventFlags(event.flags(), - WindowOpenDisposition::NEW_FOREGROUND_TAB), - ui::PAGE_TRANSITION_LINK, /*is_renderer_initiated=*/false); - - if (base::FeatureList::IsEnabled(features::kUnifiedSidePanel)) { - ShowAboutThisSiteSidePanel(web_contents_, url_params); - } else { - web_contents_->OpenURL(url_params); - } + DCHECK(base::FeatureList::IsEnabled(features::kUnifiedSidePanel)); + DCHECK( + base::FeatureList::IsEnabled(page_info::kPageInfoAboutThisSiteMoreInfo)); + ShowAboutThisSiteSidePanel(web_contents_, url); } #endif
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc index 9a3d753..a8eb718 100644 --- a/chrome/browser/ui/tabs/tab_menu_model.cc +++ b/chrome/browser/ui/tabs/tab_menu_model.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" #include "chrome/browser/ui/tabs/tab_utils.h" #include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/web_applications/web_app_tabbed_utils.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/generated_resources.h" #include "components/feed/feed_feature_list.h" @@ -70,7 +71,7 @@ add_to_existing_group_submenu_.get()); if (base::FeatureList::IsEnabled(features::kTabGroupsNewBadgePromo)) SetIsNewFeatureAt(GetItemCount() - 1, true); - } else { + } else if (!tab_strip->delegate()->IsForWebApp()) { AddItem(TabStripModel::CommandAddToNewGroup, l10n_util::GetPluralStringFUTF16( IDS_TAB_CXMENU_ADD_TAB_TO_NEW_GROUP, num_tabs)); @@ -87,35 +88,46 @@ } } - if (ExistingWindowSubMenuModel::ShouldShowSubmenu(tab_strip->profile())) { - // Create submenu with existing windows - add_to_existing_window_submenu_ = ExistingWindowSubMenuModel::Create( - delegate(), tab_menu_model_delegate_, tab_strip, index); - AddSubMenu(TabStripModel::CommandMoveToExistingWindow, - l10n_util::GetPluralStringFUTF16( - IDS_TAB_CXMENU_MOVETOANOTHERWINDOW, num_tabs), - add_to_existing_window_submenu_.get()); - } else { - AddItem(TabStripModel::CommandMoveTabsToNewWindow, - l10n_util::GetPluralStringFUTF16( - IDS_TAB_CXMENU_MOVE_TABS_TO_NEW_WINDOW, num_tabs)); + if (!tab_strip->delegate()->IsForWebApp()) { + if (ExistingWindowSubMenuModel::ShouldShowSubmenu(tab_strip->profile())) { + // Create submenu with existing windows + add_to_existing_window_submenu_ = ExistingWindowSubMenuModel::Create( + delegate(), tab_menu_model_delegate_, tab_strip, index); + AddSubMenu(TabStripModel::CommandMoveToExistingWindow, + l10n_util::GetPluralStringFUTF16( + IDS_TAB_CXMENU_MOVETOANOTHERWINDOW, num_tabs), + add_to_existing_window_submenu_.get()); + } else { + AddItem(TabStripModel::CommandMoveTabsToNewWindow, + l10n_util::GetPluralStringFUTF16( + IDS_TAB_CXMENU_MOVE_TABS_TO_NEW_WINDOW, num_tabs)); + } } AddSeparator(ui::NORMAL_SEPARATOR); AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); - AddItemWithStringId(TabStripModel::CommandDuplicate, - IDS_TAB_CXMENU_DUPLICATE); - bool will_pin = tab_strip->WillContextMenuPin(index); - AddItemWithStringId( - TabStripModel::CommandTogglePinned, - will_pin ? IDS_TAB_CXMENU_PIN_TAB : IDS_TAB_CXMENU_UNPIN_TAB); + + if (!(tab_strip->delegate()->IsForWebApp() && + web_app::IsPinnedHomeTab(tab_strip, index))) { + AddItemWithStringId(TabStripModel::CommandDuplicate, + IDS_TAB_CXMENU_DUPLICATE); + } + + if (!tab_strip->delegate()->IsForWebApp()) { + bool will_pin = tab_strip->WillContextMenuPin(index); + AddItemWithStringId( + TabStripModel::CommandTogglePinned, + will_pin ? IDS_TAB_CXMENU_PIN_TAB : IDS_TAB_CXMENU_UNPIN_TAB); + } + const bool will_mute = !chrome::AreAllSitesMuted(*tab_strip, indices); AddItem(TabStripModel::CommandToggleSiteMuted, will_mute ? l10n_util::GetPluralStringFUTF16( IDS_TAB_CXMENU_SOUND_MUTE_SITE, num_tabs) : l10n_util::GetPluralStringFUTF16( IDS_TAB_CXMENU_SOUND_UNMUTE_SITE, num_tabs)); - if (base::FeatureList::IsEnabled(feed::kWebUiFeed)) { + if (base::FeatureList::IsEnabled(feed::kWebUiFeed) && + !tab_strip->delegate()->IsForWebApp()) { const TabWebFeedFollowState follow_state = chrome::GetAggregatedFollowStateOfAllSites(*tab_strip, indices); if (follow_state == TabWebFeedFollowState::kNotFollowed) { @@ -141,7 +153,11 @@ } AddSeparator(ui::NORMAL_SEPARATOR); - AddItemWithStringId(TabStripModel::CommandCloseTab, IDS_TAB_CXMENU_CLOSETAB); + if (!(tab_strip->delegate()->IsForWebApp() && + web_app::IsPinnedHomeTab(tab_strip, index))) { + AddItemWithStringId(TabStripModel::CommandCloseTab, + IDS_TAB_CXMENU_CLOSETAB); + } AddItemWithStringId(TabStripModel::CommandCloseOtherTabs, IDS_TAB_CXMENU_CLOSEOTHERTABS); AddItemWithStringId(TabStripModel::CommandCloseTabsToRight,
diff --git a/chrome/browser/ui/tabs/tab_menu_model_unittest.cc b/chrome/browser/ui/tabs/tab_menu_model_unittest.cc index eeab4ac68..804169a 100644 --- a/chrome/browser/ui/tabs/tab_menu_model_unittest.cc +++ b/chrome/browser/ui/tabs/tab_menu_model_unittest.cc
@@ -9,10 +9,12 @@ #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/tabs/existing_base_sub_menu_model.h" #include "chrome/browser/ui/tabs/tab_menu_model_delegate.h" +#include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/menu_model_test.h" #include "components/feed/feed_feature_list.h" +#include "content/public/test/web_contents_tester.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/models/menu_model.h" @@ -252,3 +254,73 @@ .has_value()); } } + +class TabMenuModelTestTabStripModelDelegate : public TestTabStripModelDelegate { + public: + bool IsForWebApp() override { return true; } + + bool SupportsReadLater() override { return false; } +}; + +TEST_F(TabMenuModelTest, TabbedWebApp) { + // Create a tabbed web app window without home tab + TabMenuModelTestTabStripModelDelegate delegate; + TabStripModel strip(&delegate, profile()); + strip.AppendWebContents( + content::WebContentsTester::CreateTestWebContents(profile(), nullptr), + true); + + TabMenuModel model(&delegate_, browser()->tab_menu_model_delegate(), &strip, + 0); + + // When adding/removing a menu item, either update this count and add it to + // the list below or disable it for tabbed web apps. + EXPECT_EQ(model.GetItemCount(), 9u); + + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandNewTabToRight) + .has_value()); + EXPECT_EQ(model.GetTypeAt(1), ui::MenuModel::TYPE_SEPARATOR); + EXPECT_TRUE( + model.GetIndexOfCommandId(TabStripModel::CommandReload).has_value()); + EXPECT_TRUE( + model.GetIndexOfCommandId(TabStripModel::CommandDuplicate).has_value()); + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandToggleSiteMuted) + .has_value()); + EXPECT_EQ(model.GetTypeAt(5), ui::MenuModel::TYPE_SEPARATOR); + EXPECT_TRUE( + model.GetIndexOfCommandId(TabStripModel::CommandCloseTab).has_value()); + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandCloseOtherTabs) + .has_value()); + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandCloseTabsToRight) + .has_value()); +} + +TEST_F(TabMenuModelTest, TabbedWebAppHomeTab) { + TabMenuModelTestTabStripModelDelegate delegate; + TabStripModel strip(&delegate, profile()); + strip.AppendWebContents( + content::WebContentsTester::CreateTestWebContents(profile(), nullptr), + true); + // Pin the first tab so we get the pinned home tab menu. + strip.SetTabPinned(0, true); + + TabMenuModel model(&delegate_, browser()->tab_menu_model_delegate(), &strip, + 0); + + // When adding/removing a menu item, either update this count and add it to + // the list below or disable it for tabbed web apps. + EXPECT_EQ(model.GetItemCount(), 7u); + + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandNewTabToRight) + .has_value()); + EXPECT_EQ(model.GetTypeAt(1), ui::MenuModel::TYPE_SEPARATOR); + EXPECT_TRUE( + model.GetIndexOfCommandId(TabStripModel::CommandReload).has_value()); + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandToggleSiteMuted) + .has_value()); + EXPECT_EQ(model.GetTypeAt(4), ui::MenuModel::TYPE_SEPARATOR); + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandCloseOtherTabs) + .has_value()); + EXPECT_TRUE(model.GetIndexOfCommandId(TabStripModel::CommandCloseTabsToRight) + .has_value()); +}
diff --git a/chrome/browser/ui/tabs/tab_strip_model_delegate.h b/chrome/browser/ui/tabs/tab_strip_model_delegate.h index b445d85b..a5b5364 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_delegate.h +++ b/chrome/browser/ui/tabs/tab_strip_model_delegate.h
@@ -173,6 +173,9 @@ // Unfollows a web feed for the specified WebContents. virtual void UnfollowSite(content::WebContents* web_contents) = 0; + + // Returns whether this tab strip model is for a web app. + virtual bool IsForWebApp() = 0; }; #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_DELEGATE_H_
diff --git a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc index 094b73d..dc3c864 100644 --- a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc +++ b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.cc
@@ -111,3 +111,7 @@ void TestTabStripModelDelegate::UnfollowSite( content::WebContents* web_contents) {} + +bool TestTabStripModelDelegate::IsForWebApp() { + return false; +}
diff --git a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h index cb2b8bf5..402b2bc 100644 --- a/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h +++ b/chrome/browser/ui/tabs/test_tab_strip_model_delegate.h
@@ -56,6 +56,7 @@ web_contents) override; void FollowSite(content::WebContents* web_contents) override; void UnfollowSite(content::WebContents* web_contents) override; + bool IsForWebApp() override; }; #endif // CHROME_BROWSER_UI_TABS_TEST_TAB_STRIP_MODEL_DELEGATE_H_
diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc index 15edb31..109a8a0 100644 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.cc
@@ -174,11 +174,19 @@ // later steps. // See https://crbug.com/1287212 for details. const auto window_state = window->GetPlatformWindowState(); - const gfx::Insets insets = - (window_state == ui::PlatformWindowState::kUnknown || - window_state == ui::PlatformWindowState::kNormal) - ? layout->MirroredFrameBorderInsets() - : gfx::Insets(); + gfx::Insets insets = (window_state == ui::PlatformWindowState::kUnknown || + window_state == ui::PlatformWindowState::kNormal) + ? layout->MirroredFrameBorderInsets() + : gfx::Insets(); + const auto tiled_edges = browser_frame_->tiled_edges(); + if (tiled_edges.left) + insets.set_left(0); + if (tiled_edges.right) + insets.set_right(0); + if (tiled_edges.top) + insets.set_top(0); + if (tiled_edges.bottom) + insets.set_bottom(0); const gfx::Insets insets_px = gfx::ScaleToCeiledInsets(insets, scale); window->SetDecorationInsets(showing_frame ? &insets_px : nullptr); @@ -317,6 +325,12 @@ UpdateFrameHints(); } +void BrowserDesktopWindowTreeHostLinux::OnWindowTiledStateChanged( + ui::WindowTiledEdges new_tiled_edges) { + browser_frame_->set_tiled_edges(new_tiled_edges); + UpdateFrameHints(); +} + void BrowserDesktopWindowTreeHostLinux::OnNativeThemeUpdated( ui::NativeTheme* observed_theme) { UpdateFrameHints();
diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.h b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.h index 17704d2..8120c217 100644 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.h +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_linux.h
@@ -82,6 +82,7 @@ void OnBoundsChanged(const BoundsChange& change) override; void OnWindowStateChanged(ui::PlatformWindowState old_state, ui::PlatformWindowState new_state) override; + void OnWindowTiledStateChanged(ui::WindowTiledEdges new_tiled_edges) override; // ui::NativeThemeObserver: void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 8cff1d0..98ec5e5 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -21,7 +21,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window_state.h" -#include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host.h" #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/views/frame/browser_root_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h index 9bd58669..a16d08b 100644 --- a/chrome/browser/ui/views/frame/browser_frame.h +++ b/chrome/browser/ui/views/frame/browser_frame.h
@@ -12,7 +12,10 @@ #include "ui/views/context_menu_controller.h" #include "ui/views/widget/widget.h" -class BrowserDesktopWindowTreeHost; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#include "ui/base/ui_base_types.h" +#endif + class BrowserNonClientFrameView; class BrowserRootView; enum class BrowserThemeChangeType; @@ -60,6 +63,14 @@ ~BrowserFrame() override; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + // Returns which edges of the frame are tiled. + const ui::WindowTiledEdges& tiled_edges() const { return tiled_edges_; } + void set_tiled_edges(ui::WindowTiledEdges tiled_edges) { + tiled_edges_ = tiled_edges; + } +#endif + // Initialize the frame (creates the underlying native window). void InitBrowserFrame(); @@ -143,11 +154,6 @@ return native_browser_frame_; } - void set_browser_desktop_window_tree_host( - BrowserDesktopWindowTreeHost* browser_desktop_window_tree_host) { - browser_desktop_window_tree_host_ = browser_desktop_window_tree_host; - } - void SetTabDragKind(TabDragKind tab_drag_kind); TabDragKind tab_drag_kind() const { return tab_drag_kind_; } @@ -192,9 +198,6 @@ base::BindRepeating(&BrowserFrame::OnTouchUiChanged, base::Unretained(this))); - raw_ptr<BrowserDesktopWindowTreeHost> browser_desktop_window_tree_host_ = - nullptr; - // Indicates the drag state for this window. The value can be kWindowDrag // if the accociated browser is the dragged browser or kTabDrag // if this is the source browser that the drag window originates from. During @@ -203,6 +206,10 @@ // contents for smoother dragging. TabDragKind tab_drag_kind_ = TabDragKind::kNone; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + ui::WindowTiledEdges tiled_edges_; +#endif + #if BUILDFLAG(IS_CHROMEOS) // Store the number of virtual desks that currently exist. Used to determine // whether the system menu should be reset. If the value is -1, then either
diff --git a/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc b/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc index 007ccf9..4fd5867c 100644 --- a/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc +++ b/chrome/browser/ui/views/frame/browser_frame_view_layout_linux.cc
@@ -56,8 +56,8 @@ gfx::Rect frame_extents; const auto tiled_edges = delegate_->GetTiledEdges(); for (const auto& shadow_value : view_->GetShadowValues()) { - auto shadow_radius = shadow_value.blur() / 4; - gfx::InsetsF shadow_insets = + const auto shadow_radius = shadow_value.blur() / 4; + const gfx::InsetsF shadow_insets = gfx::InsetsF::TLBR(tiled_edges.top ? 0 : shadow_radius, tiled_edges.left ? 0 : shadow_radius, tiled_edges.bottom ? 0 : shadow_radius, @@ -70,10 +70,10 @@ } // The border must be at least as large as the input region. - auto insets = gfx::Insets::TLBR(tiled_edges.top ? 0 : kResizeBorder, - tiled_edges.left ? 0 : kResizeBorder, - tiled_edges.bottom ? 0 : kResizeBorder, - tiled_edges.right ? 0 : kResizeBorder); + const auto insets = gfx::Insets::TLBR(tiled_edges.top ? 0 : kResizeBorder, + tiled_edges.left ? 0 : kResizeBorder, + tiled_edges.bottom ? 0 : kResizeBorder, + tiled_edges.right ? 0 : kResizeBorder); gfx::Rect input_extents; input_extents.Inset(-insets); frame_extents.Union(input_extents);
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index 46a93d2..7ee9bd8 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -580,12 +580,14 @@ return false; } -#if BUILDFLAG(IS_LINUX) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) OpaqueBrowserFrameViewLayoutDelegate::TiledEdges OpaqueBrowserFrameView::GetTiledEdges() const { - // TODO(crbug.com/1355273): return the actual tiled state of the platform - // window. - return {}; + const auto edges = frame()->tiled_edges(); + return {.left = edges.left, + .right = edges.right, + .top = edges.top, + .bottom = edges.bottom}; } #endif
diff --git a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.cc b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.cc index 4efe093..abb74b0 100644 --- a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.cc +++ b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.cc
@@ -18,25 +18,38 @@ #include "components/page_info/core/about_this_site_service.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/page_navigator.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" +#include "net/base/url_util.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/vector_icons.h" +namespace { +content::OpenURLParams CreateOpenUrlParams(const GURL& url) { + return content::OpenURLParams( + net::AppendOrReplaceQueryParameter( + url, page_info::AboutThisSiteRenderModeParameterName, + page_info::AboutThisSiteRenderModeParameterValue), + content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, + ui::PAGE_TRANSITION_LINK, /*is_renderer_initiated=*/false); +} +} // namespace + void ShowAboutThisSiteSidePanel(content::WebContents* web_contents, - const content::OpenURLParams& params) { + const GURL& more_about_url) { // Create PanelCoordinator if it doesn't exist yet. AboutThisSideSidePanelCoordinator::CreateForWebContents(web_contents); AboutThisSideSidePanelCoordinator::FromWebContents(web_contents) - ->RegisterEntryAndShow(params); + ->RegisterEntryAndShow(more_about_url); } void RegisterAboutThisSiteSidePanel(content::WebContents* web_contents, - const content::OpenURLParams& params) { + const GURL& more_about_url) { // Create PanelCoordinator if it doesn't exist yet. AboutThisSideSidePanelCoordinator::CreateForWebContents(web_contents); AboutThisSideSidePanelCoordinator::FromWebContents(web_contents) - ->RegisterEntry(params); + ->RegisterEntry(more_about_url); } AboutThisSideSidePanelCoordinator::AboutThisSideSidePanelCoordinator( @@ -49,13 +62,14 @@ default; void AboutThisSideSidePanelCoordinator::RegisterEntry( - const content::OpenURLParams& params) { + const GURL& more_about_url) { auto* browser_view = GetBrowserView(); if (!browser_view) return; auto* registry = SidePanelRegistry::Get(web_contents()); - last_url_info_ = {web_contents()->GetLastCommittedURL(), params}; + last_url_info_ = {web_contents()->GetLastCommittedURL(), + CreateOpenUrlParams(more_about_url)}; registered_but_not_shown_ = true; // Check if the view is already registered. @@ -76,17 +90,17 @@ } void AboutThisSideSidePanelCoordinator::RegisterEntryAndShow( - const content::OpenURLParams& params) { + const GURL& more_about_url) { auto* browser_view = GetBrowserView(); if (!browser_view) return; - RegisterEntry(params); + RegisterEntry(more_about_url); registered_but_not_shown_ = false; if (about_this_site_side_panel_view_) { // Load params in view if view still exists. - about_this_site_side_panel_view_->OpenUrl(params); + about_this_site_side_panel_view_->OpenUrl(last_url_info_->url_params); } auto* side_panel_coordinator = browser_view->side_panel_coordinator();
diff --git a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.h b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.h index c26fd32..0309893 100644 --- a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.h +++ b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator.h
@@ -34,11 +34,11 @@ ~AboutThisSideSidePanelCoordinator() override; // Registers ATS entry in the side panel but does not show it. - void RegisterEntry(const content::OpenURLParams& params); + void RegisterEntry(const GURL& more_about_url); // Registers ATS entry in the side panel and shows side panel with ATS // selected if its not shown. - void RegisterEntryAndShow(const content::OpenURLParams& params); + void RegisterEntryAndShow(const GURL& more_about_url); private: friend class content::WebContentsUserData<AboutThisSideSidePanelCoordinator>;
diff --git a/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc new file mode 100644 index 0000000..045785c1 --- /dev/null +++ b/chrome/browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc
@@ -0,0 +1,93 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/page_info/about_this_site_side_panel.h" +#include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h" +#include "chrome/browser/ui/views/side_panel/side_panel_entry.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" +#include "components/page_info/core/features.h" +#include "components/page_info/core/proto/about_this_site_metadata.pb.h" +#include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/embedded_test_server.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::_; + +namespace { +const char kRegularUrl1[] = "a.test"; +const char kRegularUrl2[] = "b.test"; +const char kAboutThisSiteUrl[] = "c.test"; +} // namespace + +class AboutThisSiteSidePanelCoordinatorBrowserTest + : public InProcessBrowserTest { + protected: + void SetUp() override { + https_server_.SetSSLConfig(net::EmbeddedTestServer::CERT_TEST_NAMES); + https_server_.ServeFilesFromSourceDirectory(GetChromeTestDataDir()); + ASSERT_TRUE(https_server_.Start()); + SetUpFeatureList(); + InProcessBrowserTest::SetUp(); + } + + void SetUpOnMainThread() override { + host_resolver()->AddRule("*", "127.0.0.1"); + } + + GURL CreateUrl(const std::string& host) { + return https_server_.GetURL(host, "/title1.html"); + } + + page_info::proto::SiteInfo CreateSiteInfo() { + page_info::proto::SiteInfo info; + info.mutable_more_about()->set_url(CreateUrl(kAboutThisSiteUrl).spec()); + return info; + } + + content::WebContents* web_contents() { + return browser()->tab_strip_model()->GetActiveWebContents(); + } + + SidePanelCoordinator* side_panel_coordinator() { + return BrowserView::GetBrowserViewForBrowser(browser()) + ->side_panel_coordinator(); + } + + private: + virtual void SetUpFeatureList() { + feature_list_.InitWithFeatures( + {features::kUnifiedSidePanel, page_info::kPageInfoAboutThisSiteMoreInfo, + page_info::kPageInfoAboutThisSiteDescriptionPlaceholder}, + {}); + } + + base::test::ScopedFeatureList feature_list_; + net::EmbeddedTestServer https_server_{net::EmbeddedTestServer::TYPE_HTTPS}; +}; + +IN_PROC_BROWSER_TEST_F(AboutThisSiteSidePanelCoordinatorBrowserTest, + ShowAndClose) { + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), CreateUrl(kRegularUrl1))); + ASSERT_EQ(side_panel_coordinator()->GetCurrentEntryId(), absl::nullopt); + + // Test showing a sidepanel. + ShowAboutThisSiteSidePanel(web_contents(), CreateUrl(kAboutThisSiteUrl)); + EXPECT_TRUE(side_panel_coordinator()->IsSidePanelShowing()); + EXPECT_EQ(side_panel_coordinator()->GetCurrentEntryId(), + SidePanelEntry::Id::kAboutThisSite); + + // Check that it closes on navigation. + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), CreateUrl(kRegularUrl2))); + EXPECT_FALSE(side_panel_coordinator()->IsSidePanelShowing()); + EXPECT_EQ(side_panel_coordinator()->GetCurrentEntryId(), absl::nullopt); +} + +// TODO(crbug.com/1318000): Cover additional AboutThisSite side panel behavior.
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc index 400e34f0..5a87e87c 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h" #include "base/memory/raw_ptr.h" @@ -736,7 +737,8 @@ {page_info::kPageInfoAboutThisSiteEn, page_info::kPageInfoAboutThisSiteNonEn, page_info::kPageInfoAboutThisSiteMoreInfo, - page_info::kPageInfoAboutThisSiteDescriptionPlaceholder}, + page_info::kPageInfoAboutThisSiteDescriptionPlaceholder, + features::kUnifiedSidePanel}, {}); }
diff --git a/chrome/browser/ui/views/page_info/page_info_main_view.cc b/chrome/browser/ui/views/page_info/page_info_main_view.cc index b753db83..6bff9b2a 100644 --- a/chrome/browser/ui/views/page_info/page_info_main_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_main_view.cc
@@ -576,7 +576,8 @@ PageInfoHoverButton* about_this_site_button = nullptr; - if (base::FeatureList::IsEnabled(page_info::kPageInfoAboutThisSiteMoreInfo)) { + if (base::FeatureList::IsEnabled(page_info::kPageInfoAboutThisSiteMoreInfo) && + base::FeatureList::IsEnabled(features::kUnifiedSidePanel)) { const auto& description = info.has_description() ? base::UTF8ToUTF16(info.description().description())
diff --git a/chrome/browser/ui/views/webid/account_selection_bubble_view.cc b/chrome/browser/ui/views/webid/account_selection_bubble_view.cc index ec8ddeb..43e19a0 100644 --- a/chrome/browser/ui/views/webid/account_selection_bubble_view.cc +++ b/chrome/browser/ui/views/webid/account_selection_bubble_view.cc
@@ -425,6 +425,17 @@ has_sheet_ = true; } +void AccountSelectionBubbleView::ShowFailureDialog( + const std::u16string& rp_for_display, + const std::u16string& idp_for_display) { + const std::u16string title = l10n_util::GetStringFUTF16( + IDS_FAILURE_DIALOG_TITLE, rp_for_display, idp_for_display); + title_label_->SetText(title); + + SizeToContents(); + PreferredSizeChanged(); +} + gfx::Rect AccountSelectionBubbleView::GetBubbleBounds() { // The bubble initially looks like this relative to the contents_web_view: // |--------|
diff --git a/chrome/browser/ui/views/webid/account_selection_bubble_view.h b/chrome/browser/ui/views/webid/account_selection_bubble_view.h index 5bc78d8d..4f14ea22 100644 --- a/chrome/browser/ui/views/webid/account_selection_bubble_view.h +++ b/chrome/browser/ui/views/webid/account_selection_bubble_view.h
@@ -68,6 +68,8 @@ void ShowVerifyingSheet( const content::IdentityRequestAccount& account, const content::IdentityProviderMetadata& idp_metadata) override; + void ShowFailureDialog(const std::u16string& rp_for_display, + const std::u16string& idp_for_display) override; private: gfx::Rect GetBubbleBounds() override;
diff --git a/chrome/browser/ui/views/webid/account_selection_bubble_view_interface.h b/chrome/browser/ui/views/webid/account_selection_bubble_view_interface.h index c78fa1f..6a726ad 100644 --- a/chrome/browser/ui/views/webid/account_selection_bubble_view_interface.h +++ b/chrome/browser/ui/views/webid/account_selection_bubble_view_interface.h
@@ -28,6 +28,10 @@ virtual void ShowVerifyingSheet( const content::IdentityRequestAccount& account, const content::IdentityProviderMetadata& idp_metadata) = 0; + + // Updates the FedCM bubble to show the "failure" sheet. + virtual void ShowFailureDialog(const std::u16string& rp_for_display, + const std::u16string& idp_for_display) = 0; }; #endif // CHROME_BROWSER_UI_VIEWS_WEBID_ACCOUNT_SELECTION_BUBBLE_VIEW_INTERFACE_H_
diff --git a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc index a61fbda0..431f6618 100644 --- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc +++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
@@ -79,6 +79,24 @@ bubble_widget_->AddObserver(this); } +void FedCmAccountSelectionView::ShowFailureDialog( + const std::string& rp_etld_plus_one, + const std::string& idp_etld_plus_one) { + Browser* browser = + chrome::FindBrowserWithWebContents(delegate_->GetWebContents()); + // `browser` is null in unit tests. + if (browser) + browser->tab_strip_model()->AddObserver(this); + + bubble_widget_ = CreateBubble(browser, base::UTF8ToUTF16(rp_etld_plus_one), + base::UTF8ToUTF16(idp_etld_plus_one)) + ->GetWeakPtr(); + GetBubbleView()->ShowFailureDialog(base::UTF8ToUTF16(rp_etld_plus_one), + base::UTF8ToUTF16(idp_etld_plus_one)); + bubble_widget_->Show(); + bubble_widget_->AddObserver(this); +} + void FedCmAccountSelectionView::OnVisibilityChanged( content::Visibility visibility) { if (!bubble_widget_)
diff --git a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h index 65ebe005..c89a60d0 100644 --- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h +++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h
@@ -38,6 +38,8 @@ const content::IdentityProviderMetadata& idp_metadata, const content::ClientIdData& client_data, Account::SignInMode sign_in_mode) override; + void ShowFailureDialog(const std::string& rp_etld_plus_one, + const std::string& idp_etld_plus_one) override; // content::WebContentsObserver void OnVisibilityChanged(content::Visibility visibility) override;
diff --git a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc index ec1a1da..6ea45f2 100644 --- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc +++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop_unittest.cc
@@ -56,6 +56,9 @@ account_ids_ = {account.id}; } + void ShowFailureDialog(const std::u16string& rp_for_display, + const std::u16string& idp_for_display) override {} + bool show_back_button_{false}; bool show_verifying_sheet_{false}; std::vector<std::string> account_ids_;
diff --git a/chrome/browser/ui/web_applications/web_app_tabbed_utils.cc b/chrome/browser/ui/web_applications/web_app_tabbed_utils.cc index 62b084e..5d3224a 100644 --- a/chrome/browser/ui/web_applications/web_app_tabbed_utils.cc +++ b/chrome/browser/ui/web_applications/web_app_tabbed_utils.cc
@@ -14,6 +14,10 @@ return tab_strip_model->IsTabPinned(0); } +bool IsPinnedHomeTab(TabStripModel* tab_strip_model, int index) { + return HasPinnedHomeTab(tab_strip_model) && index == 0; +} + bool IsPinnedHomeTabUrl(const WebAppRegistrar& registrar, const AppId& app_id, GURL launch_url) {
diff --git a/chrome/browser/ui/web_applications/web_app_tabbed_utils.h b/chrome/browser/ui/web_applications/web_app_tabbed_utils.h index 6a36d173..2802358 100644 --- a/chrome/browser/ui/web_applications/web_app_tabbed_utils.h +++ b/chrome/browser/ui/web_applications/web_app_tabbed_utils.h
@@ -15,6 +15,9 @@ // Returns whether the web apps tab strip contains a pinned home tab. bool HasPinnedHomeTab(TabStripModel* tab_strip_model); +// Returns whether the tab at the given index is the pinned home tab. +bool IsPinnedHomeTab(TabStripModel* tab_strip_model, int index); + // Returns whether the given launch_url should be treated as the home tab URL. bool IsPinnedHomeTabUrl(const WebAppRegistrar& registrar, const AppId& app_id,
diff --git a/chrome/browser/ui/webid/account_selection_view.h b/chrome/browser/ui/webid/account_selection_view.h index fe5559470..a1e214fc 100644 --- a/chrome/browser/ui/webid/account_selection_view.h +++ b/chrome/browser/ui/webid/account_selection_view.h
@@ -66,6 +66,12 @@ const content::ClientIdData& client_data, Account::SignInMode sign_in_mode) = 0; + // Shows a failure UI when the accounts fetch is failed such that it is + // observable by users. This could happen when an IDP claims that the user is + // signed in but not respond with any user account during browser fetches. + virtual void ShowFailureDialog(const std::string& rp_for_display, + const std::string& idp_for_display) = 0; + protected: raw_ptr<Delegate> delegate_ = nullptr; };
diff --git a/chrome/browser/ui/webid/identity_dialog_controller.cc b/chrome/browser/ui/webid/identity_dialog_controller.cc index ba3ed4a..31782e9 100644 --- a/chrome/browser/ui/webid/identity_dialog_controller.cc +++ b/chrome/browser/ui/webid/identity_dialog_controller.cc
@@ -75,6 +75,20 @@ client_data, sign_in_mode); } +void IdentityDialogController::ShowFailureDialog( + content::WebContents* rp_web_contents, + const GURL& idp_url, + DismissCallback dismiss_callback) { + const GURL rp_url = rp_web_contents->GetLastCommittedURL(); + const std::string rp_for_display = FormatUrlForDisplay(rp_url); + const std::string idp_for_display = FormatUrlForDisplay(idp_url); + rp_web_contents_ = rp_web_contents; + on_dismiss_ = std::move(dismiss_callback); + if (!account_view_) + account_view_ = AccountSelectionView::Create(this); + account_view_->ShowFailureDialog(rp_for_display, idp_for_display); +} + void IdentityDialogController::OnAccountSelected(const Account& account) { on_dismiss_.Reset(); std::move(on_account_selection_)
diff --git a/chrome/browser/ui/webid/identity_dialog_controller.h b/chrome/browser/ui/webid/identity_dialog_controller.h index 7c3661c..0301746 100644 --- a/chrome/browser/ui/webid/identity_dialog_controller.h +++ b/chrome/browser/ui/webid/identity_dialog_controller.h
@@ -38,12 +38,16 @@ int GetBrandIconMinimumSize() override; int GetBrandIconIdealSize() override; + // content::IdentityRequestDialogController void ShowAccountsDialog( content::WebContents* rp_web_contents, const std::vector<content::IdentityProviderData>& identity_provider_data, content::IdentityRequestAccount::SignInMode sign_in_mode, AccountSelectionCallback on_selected, DismissCallback dismiss_callback) override; + void ShowFailureDialog(content::WebContents* rp_web_contents, + const GURL& idp_url, + DismissCallback dismiss_callback) override; // AccountSelectionView::Delegate: void OnAccountSelected(const Account& account) override;
diff --git a/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.cc b/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.cc index d8664408..227e1a4 100644 --- a/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.cc +++ b/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.cc
@@ -4,10 +4,14 @@ #include "chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.h" +#include "base/task/thread_pool.h" #include "chrome/browser/ash/file_manager/copy_or_move_io_task.h" #include "chrome/browser/ash/file_manager/fileapi_util.h" #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" #include "chrome/browser/chromeos/extensions/file_manager/event_router_factory.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" +#include "google_apis/common/task_util.h" namespace chromeos::cloud_upload { namespace { @@ -17,7 +21,7 @@ storage::FileSystemURL FilePathToFileSystemURL( Profile* profile, - storage::FileSystemContext* file_system_context, + scoped_refptr<storage::FileSystemContext> file_system_context, base::FilePath file_path) { GURL url; if (!file_manager::util::ConvertAbsoluteFilePathToFileSystemUrl( @@ -36,6 +40,16 @@ std::move(callback).Run(hosted_url); } +void CreateDirectoryOnIOThread( + scoped_refptr<storage::FileSystemContext> file_system_context, + storage::FileSystemURL destination_folder_url, + base::OnceCallback<void(base::File::Error)> complete_callback) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + file_system_context->operation_runner()->CreateDirectory( + destination_folder_url, /*exclusive=*/false, /*recursive=*/false, + std::move(complete_callback)); +} + } // namespace // static. @@ -60,8 +74,10 @@ } CloudUploadHandler::CloudUploadHandler(Profile* profile, - const storage::FileSystemURL& source_url) + const storage::FileSystemURL source_url) : profile_(profile), + file_system_context_( + file_manager::util::GetFileManagerFileSystemContext(profile)), drive_integration_service_( drive::DriveIntegrationServiceFactory::FindForProfile(profile)), source_url_(source_url) { @@ -124,29 +140,56 @@ return; } - // Filesystem context. - storage::FileSystemContext* file_system_context = - file_manager::util::GetFileSystemContextForSourceURL( - profile_, file_manager::util::GetFileManagerURL()); - - // Source and destination urls. - std::vector<storage::FileSystemURL> source_urls{source_url_}; + // Destination url. base::FilePath destination_folder_path = GenerateUploadFolderPath(profile_); if (destination_folder_path.empty()) { - LOG(ERROR) << "Unable to generate destination folder, the drive " - "integration service might not be available."; + LOG(ERROR) << "Unable to generate destination folder path, the drive " + "integration service might not be available"; OnEndUpload(GURL()); return; } storage::FileSystemURL destination_folder_url = FilePathToFileSystemURL( - profile_, file_system_context, destination_folder_path); + profile_, file_system_context_, destination_folder_path); + // TODO (b/243095484) Define error behavior. + if (!destination_folder_url.is_valid()) { + LOG(ERROR) << "Unable to generate destination folder URL"; + OnEndUpload(GURL()); + return; + } + + content::GetIOThreadTaskRunner({})->PostTask( + FROM_HERE, + base::BindOnce(&CreateDirectoryOnIOThread, file_system_context_, + destination_folder_url, + google_apis::CreateRelayCallback(base::BindOnce( + &CloudUploadHandler::OnDestinationDirectoryCreated, + this, destination_folder_url)))); +} + +void CloudUploadHandler::OnDestinationDirectoryCreated( + storage::FileSystemURL destination_folder_url, + base::File::Error error) { + if (error != base::File::FILE_OK) { + // TODO (b/243095484) Define error behavior. + LOG(ERROR) << "Unable to create destination folder"; + OnEndUpload(GURL()); + return; + } + if (!destination_folder_url.is_valid()) { + LOG(ERROR) << "Received destination URL is invalid"; + OnEndUpload(GURL()); + return; + } + + // Source URLs. + std::vector<storage::FileSystemURL> source_urls{source_url_}; // TODO (b/242685159) Change copy to move. std::unique_ptr<file_manager::io_task::IOTask> task = std::make_unique<file_manager::io_task::CopyOrMoveIOTask>( file_manager::io_task::OperationType::kCopy, std::move(source_urls), - std::move(destination_folder_url), profile_, file_system_context, - /*show_notifications=*/false); + std::move(destination_folder_url), profile_, file_system_context_, + /*show_notification=*/false); observed_task_id_ = io_task_controller_->Add(std::move(task)); } @@ -171,8 +214,8 @@ << " bytes transferred: " << status.bytes_transferred; if (observed_relative_drive_path_.empty()) { // TODO (b/242685536) Define multiple-file handling. - DCHECK(status.sources.size() == 1); - DCHECK(status.outputs.size() == 1); + DCHECK_EQ(status.sources.size(), 1); + DCHECK_EQ(status.outputs.size(), 1); if (!drive_integration_service_) { LOG(ERROR) << "No drive integration service";
diff --git a/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.h b/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.h index 674a12b2..bc85511 100644 --- a/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.h +++ b/chrome/browser/ui/webui/chromeos/cloud_upload/cloud_upload_handler.h
@@ -7,6 +7,7 @@ #include <memory> +#include "base/files/file.h" #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -16,6 +17,7 @@ #include "chrome/browser/chromeos/extensions/file_manager/scoped_suppress_drive_notifications_for_path.h" #include "chromeos/ash/components/drivefs/drivefs_host_observer.h" #include "chromeos/ash/components/drivefs/mojom/drivefs.mojom.h" +#include "storage/browser/file_system/file_system_context.h" #include "storage/browser/file_system/file_system_url.h" #include "url/gurl.h" @@ -48,8 +50,7 @@ private: friend base::RefCounted<CloudUploadHandler>; - CloudUploadHandler(Profile* profile, - const storage::FileSystemURL& source_url); + CloudUploadHandler(Profile* profile, const storage::FileSystemURL source_url); ~CloudUploadHandler() override; // Starts the upload workflow. Initiated by the `UploadToCloud` static method. @@ -58,6 +59,10 @@ // Ends upload and runs Upload callback. void OnEndUpload(GURL hosted_url); + void OnDestinationDirectoryCreated( + storage::FileSystemURL destination_folder_url, + base::File::Error error); + // IOTaskController::Observer: void OnIOTaskStatus( const file_manager::io_task::ProgressStatus& status) override; @@ -75,9 +80,10 @@ drivefs::mojom::FileMetadataPtr metadata); Profile* const profile_; + scoped_refptr<storage::FileSystemContext> file_system_context_; file_manager::io_task::IOTaskController* io_task_controller_; drive::DriveIntegrationService* const drive_integration_service_; - const storage::FileSystemURL& source_url_; + const storage::FileSystemURL source_url_; file_manager::io_task::IOTaskId observed_task_id_; base::FilePath observed_relative_drive_path_; bool error_found_;
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc index eda4061..3b20474 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc
@@ -96,7 +96,7 @@ source->SetDefaultResource(IDR_PASSWORD_CHANGE_HTML); - source->AddResourcePath("authenticator.js", + source->AddResourcePath("password_change_authenticator.js", IDR_PASSWORD_CHANGE_AUTHENTICATOR_JS); source->AddResourcePath("webview_saml_injected.js", IDR_GAIA_AUTH_WEBVIEW_SAML_INJECTED_JS);
diff --git a/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc index f3518d5..93a4ea0 100644 --- a/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc
@@ -16,90 +16,62 @@ #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" #include "chrome/grit/generated_resources.h" #include "components/login/localized_values_builder.h" -#include "services/device/public/mojom/input_service.mojom.h" namespace chromeos { -constexpr StaticOobeScreenId HIDDetectionView::kScreenId; - HIDDetectionScreenHandler::HIDDetectionScreenHandler() - : BaseScreenHandler(kScreenId) { - set_user_acted_method_path_deprecated("login.HIDDetectionScreen.userActed"); -} + : BaseScreenHandler(kScreenId) {} -HIDDetectionScreenHandler::~HIDDetectionScreenHandler() { - if (screen_) - screen_->OnViewDestroyed(this); -} +HIDDetectionScreenHandler::~HIDDetectionScreenHandler() = default; void HIDDetectionScreenHandler::Show() { - if (!IsJavascriptAllowed()) { - show_on_init_ = true; - return; - } - ShowInWebUI(); } -void HIDDetectionScreenHandler::Hide() { -} - -void HIDDetectionScreenHandler::Bind(HIDDetectionScreen* screen) { - screen_ = screen; - BaseScreenHandler::SetBaseScreenDeprecated(screen_); - if (IsJavascriptAllowed()) - InitializeDeprecated(); -} - -void HIDDetectionScreenHandler::Unbind() { - screen_ = nullptr; - BaseScreenHandler::SetBaseScreenDeprecated(nullptr); -} - void HIDDetectionScreenHandler::SetKeyboardState(const std::string& value) { keyboard_state_ = value; - CallJS("login.HIDDetectionScreen.setKeyboardState", value); + CallExternalAPI("setKeyboardState", value); } void HIDDetectionScreenHandler::SetMouseState(const std::string& value) { mouse_state_ = value; - CallJS("login.HIDDetectionScreen.setMouseState", value); + CallExternalAPI("setMouseState", value); } void HIDDetectionScreenHandler::SetTouchscreenDetectedState(bool value) { - CallJS("login.HIDDetectionScreen.setTouchscreenDetectedState", value); + CallExternalAPI("setTouchscreenDetectedState", value); } void HIDDetectionScreenHandler::SetKeyboardPinCode(const std::string& value) { keyboard_pin_code_ = value; - CallJS("login.HIDDetectionScreen.setKeyboardPinCode", value); + CallExternalAPI("setKeyboardPinCode", value); } void HIDDetectionScreenHandler::SetPinDialogVisible(bool value) { num_keys_entered_expected_ = value; - CallJS("login.HIDDetectionScreen.setPinDialogVisible", value); + CallExternalAPI("setPinDialogVisible", value); } void HIDDetectionScreenHandler::SetNumKeysEnteredPinCode(int value) { num_keys_entered_pin_code_ = value; - CallJS("login.HIDDetectionScreen.setNumKeysEnteredPinCode", value); + CallExternalAPI("setNumKeysEnteredPinCode", value); } void HIDDetectionScreenHandler::SetPointingDeviceName( const std::string& value) { mouse_device_name_ = value; - CallJS("login.HIDDetectionScreen.setPointingDeviceName", value); + CallExternalAPI("setPointingDeviceName", value); } void HIDDetectionScreenHandler::SetKeyboardDeviceName( const std::string& value) { keyboard_device_name_ = value; - CallJS("login.HIDDetectionScreen.setKeyboardDeviceName", value); + CallExternalAPI("setKeyboardDeviceName", value); } void HIDDetectionScreenHandler::SetContinueButtonEnabled(bool value) { continue_button_enabled_ = value; - CallJS("login.HIDDetectionScreen.setContinueButtonEnabled", value); + CallExternalAPI("setContinueButtonEnabled", value); } void HIDDetectionScreenHandler::DeclareLocalizedValues( @@ -149,40 +121,4 @@ BaseScreenHandler::GetAdditionalParameters(dict); } -void HIDDetectionScreenHandler::DeclareJSCallbacks() { - AddCallback( - "HIDDetectionScreen.emulateDevicesConnectedForTesting", - &HIDDetectionScreenHandler::HandleEmulateDevicesConnectedForTesting); -} - -void HIDDetectionScreenHandler::HandleEmulateDevicesConnectedForTesting() { - auto touchscreen = device::mojom::InputDeviceInfo::New(); - touchscreen->id = "fake_touchscreen"; - touchscreen->subsystem = device::mojom::InputDeviceSubsystem::SUBSYSTEM_INPUT; - touchscreen->type = device::mojom::InputDeviceType::TYPE_UNKNOWN; - touchscreen->is_touchscreen = true; - screen_->InputDeviceAddedForTesting(std::move(touchscreen)); // IN-TEST - - auto mouse = device::mojom::InputDeviceInfo::New(); - mouse->id = "fake_mouse"; - mouse->subsystem = device::mojom::InputDeviceSubsystem::SUBSYSTEM_INPUT; - mouse->type = device::mojom::InputDeviceType::TYPE_USB; - mouse->is_mouse = true; - screen_->InputDeviceAddedForTesting(std::move(mouse)); // IN-TEST - - auto keyboard = device::mojom::InputDeviceInfo::New(); - keyboard->id = "fake_keyboard"; - keyboard->subsystem = device::mojom::InputDeviceSubsystem::SUBSYSTEM_INPUT; - keyboard->type = device::mojom::InputDeviceType::TYPE_USB; - keyboard->is_keyboard = true; - screen_->InputDeviceAddedForTesting(std::move(keyboard)); // IN-TEST -} - -void HIDDetectionScreenHandler::InitializeDeprecated() { - if (show_on_init_) { - Show(); - show_on_init_ = false; - } -} - } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h index dee285a0..960407d 100644 --- a/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h
@@ -7,27 +7,22 @@ #include <memory> +#include "base/memory/weak_ptr.h" #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" -namespace ash { -class HIDDetectionScreen; -} - namespace chromeos { // Interface between HID detection screen and its representation, either WebUI // or Views one. Note, do not forget to call OnViewDestroyed in the // dtor. -class HIDDetectionView { +class HIDDetectionView : public base::SupportsWeakPtr<HIDDetectionView> { public: - constexpr static StaticOobeScreenId kScreenId{"hid-detection"}; + inline constexpr static StaticOobeScreenId kScreenId{"hid-detection", + "HIDDetectionScreen"}; - virtual ~HIDDetectionView() {} + virtual ~HIDDetectionView() = default; virtual void Show() = 0; - virtual void Hide() = 0; - virtual void Bind(ash::HIDDetectionScreen* screen) = 0; - virtual void Unbind() = 0; virtual void SetKeyboardState(const std::string& value) = 0; virtual void SetMouseState(const std::string& value) = 0; virtual void SetTouchscreenDetectedState(bool value) = 0; @@ -56,9 +51,6 @@ // HIDDetectionView implementation: void Show() override; - void Hide() override; - void Bind(ash::HIDDetectionScreen* screen) override; - void Unbind() override; void SetKeyboardState(const std::string& value) override; void SetMouseState(const std::string& value) override; void SetTouchscreenDetectedState(bool value) override; @@ -72,12 +64,8 @@ // BaseScreenHandler implementation: void DeclareLocalizedValues( ::login::LocalizedValuesBuilder* builder) override; - void DeclareJSCallbacks() override; - void InitializeDeprecated() override; - void GetAdditionalParameters(base::Value::Dict* dict) override; - // Emulate that a USB Mouse and a USB Keyboard are connected for testing. - void HandleEmulateDevicesConnectedForTesting(); + void GetAdditionalParameters(base::Value::Dict* dict) override; // State that has been exported to JS. Used by tests. std::string keyboard_state_for_test() const { return keyboard_state_; } @@ -111,11 +99,6 @@ std::string keyboard_device_name_; std::string keyboard_device_label_; bool continue_button_enabled_ = false; - - ash::HIDDetectionScreen* screen_ = nullptr; - - // If true, InitializeDeprecated() will call Show(). - bool show_on_init_ = false; }; } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc b/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc index 221bfe1..59b521b 100644 --- a/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/saml_challenge_key_handler.cc
@@ -59,6 +59,13 @@ UrlMatchesPattern( url, prefs->GetValueList(kContextAwareAccessSignalsAllowlistPref)); } + +void LogVerifiedAccessForSAMLDeviceTrustMatchesEndpoints(bool is_matching) { + base::UmaHistogramBoolean( + "Enterprise.VerifiedAccess.SAML.DeviceTrustMatchesEndpoints", + is_matching); +} + } // namespace SamlChallengeKeyHandler::SamlChallengeKeyHandler() = default; @@ -128,11 +135,13 @@ // for the same endpoint, since they are both reacting to the same VA // Challenge if (AreContextAwareAccessSignalsEnabledForUrl(url, profile_)) { + LogVerifiedAccessForSAMLDeviceTrustMatchesEndpoints(true); ReturnResult(attestation::TpmChallengeKeyResult::MakeError( attestation::TpmChallengeKeyResultCode::kDeviceTrustURLConflictError)); return; } + LogVerifiedAccessForSAMLDeviceTrustMatchesEndpoints(false); BuildChallengeResponse(); }
diff --git a/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.cc b/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.cc index 52b1df4..2839601 100644 --- a/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/ash/login/helper.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/quick_unlock/quick_unlock_utils.h" +#include "chrome/browser/ash/login/screens/hid_detection_screen.h" #include "chrome/browser/ash/login/screens/network_screen.h" #include "chrome/browser/ash/login/startup_utils.h" #include "chrome/browser/ash/login/ui/login_display_host.h" @@ -26,6 +27,7 @@ #include "chrome/browser/ui/ash/login_screen_client_impl.h" #include "chromeos/ash/components/assistant/buildflags.h" #include "components/account_id/account_id.h" +#include "services/device/public/mojom/input_service.mojom.h" namespace chromeos { @@ -52,6 +54,8 @@ // this one you need to add a function into login/test_api/test_api.js. AddCallback("OobeTestApi.getPrimaryDisplayName", &OobeTestAPIHandler::HandleGetPrimaryDisplayName); + AddCallback("OobeTestApi.emulateDevicesForTesting", + &OobeTestAPIHandler::EmulateDevicesConnectedForTesting); } void OobeTestAPIHandler::InitializeDeprecated() {} @@ -126,6 +130,32 @@ controller->SkipToLoginForTesting(); // IN-TEST } +void OobeTestAPIHandler::EmulateDevicesConnectedForTesting() { + HIDDetectionScreen* screen_ = static_cast<HIDDetectionScreen*>( + ash::WizardController::default_controller()->GetScreen( + HIDDetectionView::kScreenId)); + auto touchscreen = device::mojom::InputDeviceInfo::New(); + touchscreen->id = "fake_touchscreen"; + touchscreen->subsystem = device::mojom::InputDeviceSubsystem::SUBSYSTEM_INPUT; + touchscreen->type = device::mojom::InputDeviceType::TYPE_UNKNOWN; + touchscreen->is_touchscreen = true; + screen_->InputDeviceAddedForTesting(std::move(touchscreen)); // IN-TEST + + auto mouse = device::mojom::InputDeviceInfo::New(); + mouse->id = "fake_mouse"; + mouse->subsystem = device::mojom::InputDeviceSubsystem::SUBSYSTEM_INPUT; + mouse->type = device::mojom::InputDeviceType::TYPE_USB; + mouse->is_mouse = true; + screen_->InputDeviceAddedForTesting(std::move(mouse)); // IN-TEST + + auto keyboard = device::mojom::InputDeviceInfo::New(); + keyboard->id = "fake_keyboard"; + keyboard->subsystem = device::mojom::InputDeviceSubsystem::SUBSYSTEM_INPUT; + keyboard->type = device::mojom::InputDeviceType::TYPE_USB; + keyboard->is_keyboard = true; + screen_->InputDeviceAddedForTesting(std::move(keyboard)); // IN-TEST +} + void OobeTestAPIHandler::SkipPostLoginScreens() { ash::WizardController::default_controller() ->SkipPostLoginScreensForTesting(); // IN-TEST
diff --git a/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.h b/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.h index 591d91f..4a89879 100644 --- a/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/testapi/oobe_test_api_handler.h
@@ -36,6 +36,9 @@ void LoginAsGuest(); void ShowGaiaDialog(); void HandleGetPrimaryDisplayName(const std::string& callback_id); + + // Emulate that a USB Mouse and a USB Keyboard are connected for testing. + void EmulateDevicesConnectedForTesting(); void OnGetDisplayUnitInfoList( const std::string& callback_id, std::vector<crosapi::mojom::DisplayUnitInfoPtr> info_list);
diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc b/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc index 2703596..d44e254 100644 --- a/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc +++ b/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
@@ -139,7 +139,7 @@ IDS_SYNC_CONFIRMATION_TURN_ON_SYNC_BUTTON_LABEL); AddStringResource(source, "syncConfirmationUndoLabel", IDS_NO_THANKS); AddStringResource(source, "syncConfirmationSettingsLabel", - IDS_SYNC_CONFIRMATION_MANAGE_SYNC_BUTTON_LABEL); + IDS_SYNC_CONFIRMATION_SETTINGS_BUTTON_LABEL); source->AddResourcePath( "images/sync_confirmation_signin_intercept_illustration.svg",
diff --git a/chrome/browser/webid/federated_identity_sharing_permission_context.cc b/chrome/browser/webid/federated_identity_sharing_permission_context.cc index e6bdfdb..11e5aba 100644 --- a/chrome/browser/webid/federated_identity_sharing_permission_context.cc +++ b/chrome/browser/webid/federated_identity_sharing_permission_context.cc
@@ -14,6 +14,7 @@ namespace { const char kIdpOriginKey[] = "idp-origin"; +const char kIdpSigninStatusKey[] = "idp-signin-status"; } // namespace FederatedIdentitySharingPermissionContext:: @@ -44,3 +45,31 @@ GrantPermission(relying_party_requester, relying_party_embedder, identity_provider, account_id); } + +absl::optional<bool> +FederatedIdentitySharingPermissionContext::GetIdpSigninStatus( + const url::Origin& idp_origin) { + auto granted_object = GetGrantedObject(idp_origin, idp_origin.Serialize()); + + if (!granted_object) + return absl::nullopt; + + return granted_object->value.GetDict().FindBool(kIdpSigninStatusKey); +} + +void FederatedIdentitySharingPermissionContext::SetIdpSigninStatus( + const url::Origin& idp_origin, + bool idp_signin_status) { + auto granted_object = GetGrantedObject(idp_origin, idp_origin.Serialize()); + if (granted_object) { + base::Value new_object = granted_object->value.Clone(); + new_object.GetDict().Set(kIdpSigninStatusKey, idp_signin_status); + UpdateObjectPermission(idp_origin, granted_object->value, + std::move(new_object)); + } else { + base::Value::Dict new_object; + new_object.Set(kIdpOriginKey, idp_origin.Serialize()); + new_object.Set(kIdpSigninStatusKey, base::Value(idp_signin_status)); + GrantObjectPermission(idp_origin, base::Value(std::move(new_object))); + } +}
diff --git a/chrome/browser/webid/federated_identity_sharing_permission_context.h b/chrome/browser/webid/federated_identity_sharing_permission_context.h index 5c7a296..3d0abcd 100644 --- a/chrome/browser/webid/federated_identity_sharing_permission_context.h +++ b/chrome/browser/webid/federated_identity_sharing_permission_context.h
@@ -40,6 +40,10 @@ const url::Origin& relying_party_embedder, const url::Origin& identity_provider, const std::string& account_id) override; + absl::optional<bool> GetIdpSigninStatus( + const url::Origin& idp_origin) override; + void SetIdpSigninStatus(const url::Origin& idp_origin, + bool idp_signin_status) override; }; #endif // CHROME_BROWSER_WEBID_FEDERATED_IDENTITY_SHARING_PERMISSION_CONTEXT_H_
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index d085dc6..9622c01 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1661990255-a6f8a3a3876f160dae6a36c550300e8c582cc55d.profdata +chrome-linux-main-1662011668-7490d76e955eb1ad7fde735d4265bcab765cfb2a.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index a9de2dd..e774d8a 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1661990255-cbf0e7ac0633ed4442db30af30b81a945766e24d.profdata +chrome-mac-arm-main-1662011668-37b8c04bb903df4edb763c4f1b72b25537813da0.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 2f21a46e..ffe7da3 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1661990255-3afc45d42fd3f07d113492600a0ac324bf419efe.profdata +chrome-mac-main-1662011668-b3512a47c1332e82c8a4056905b299500d7ea6a7.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 492bf678..5355129 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1661990255-791bf470576c4b920bb985f881222f7144c94148.profdata +chrome-win32-main-1662011668-f10b363baa8e0d59042ea712edc8b55ffe269880.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 410898a..bc132d9 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1661990255-176dcf7eaca6cf768604447c442829d62c508d25.profdata +chrome-win64-main-1662001172-879a4acc0e472bda762534a6634a110f1e9178a6.profdata
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 78e4e71..167ec37d 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1748,6 +1748,7 @@ "../browser/devtools/protocol/devtools_protocol_browsertest.cc", "../browser/devtools/protocol/devtools_protocol_test_support.cc", "../browser/devtools/protocol/devtools_protocol_test_support.h", + "../browser/direct_sockets/direct_sockets_apitest.cc", "../browser/dom_distiller/distillable_page_utils_browsertest.cc", "../browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc", "../browser/dom_distiller/tab_utils_browsertest.cc", @@ -3334,6 +3335,7 @@ "../browser/ui/views/omnibox/omnibox_suggestion_button_row_browsertest.cc", "../browser/ui/views/page_action/pwa_install_view_browsertest.cc", "../browser/ui/views/page_action/zoom_view_browsertest.cc", + "../browser/ui/views/page_info/about_this_site_side_panel_coordinator_browsertest.cc", "../browser/ui/views/page_info/accuracy_tip_bubble_view_browsertest.cc", "../browser/ui/views/page_info/page_info_bubble_view_browsertest.cc", "../browser/ui/views/page_info/page_info_bubble_view_dialog_browsertest.cc",
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc index 93346fa..bf72b2b0 100644 --- a/chrome/test/chromedriver/session.cc +++ b/chrome/test/chromedriver/session.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/json/json_reader.h" +#include "base/json/json_writer.h" #include "base/lazy_instance.h" #include "base/logging.h" #include "base/threading/thread_local.h" @@ -158,15 +159,25 @@ } } +bool Session::BidiMapperIsLaunched() const { + return bidi_mapper_is_launched_; +} + void Session::OnBidiResponse(const std::string& payload) { - if (payload == "{\"launched\":true}") { - // TODO(chromedriver:4180): Prohibit any user command handling before we - // receive the "launched" event from the BiDiMapper. + absl::optional<base::Value> payload_parsed = + base::JSONReader::Read(payload, base::JSON_PARSE_CHROMIUM_EXTENSIONS); + if (!payload_parsed || !payload_parsed->is_dict()) { + LOG(WARNING) << "BiDi response is not a map: " << payload; + return; + } + + if (payload_parsed->GetDict().FindBool("launched").value_or(false)) { + bidi_mapper_is_launched_ = true; return; } // If there is no active bidi connections the events will be accumulated. - bidi_response_queue_.push(payload); + bidi_response_queue_.push(std::move(*payload_parsed)); for (; bidi_response_queue_.size() > kBidiQueueCapacity; bidi_response_queue_.pop()) { LOG(WARNING) << "BiDi response queue overflow, dropping the message: " @@ -206,24 +217,21 @@ // connections. The payload will have to be parsed and routed to the // appropriate connection. The events will have to be delivered to all // connections. + base::Value response_parsed = std::move(bidi_response_queue_.front()); + std::string response; + if (!base::JSONWriter::Write(response_parsed, &response)) { + LOG(WARNING) << "unable to serialize a BiDi response"; + continue; + } for (const BidiConnection& conn : bidi_connections_) { // If the callback fails (asynchronously) because the connection was // broken we simply ignore this fact as the message cannot be delivered // over that connection anyway. - std::string response = bidi_response_queue_.front(); conn.send_response.Run(response); - absl::optional<base::Value> responseParsed = base::JSONReader::Read( - response, base::JSON_PARSE_CHROMIUM_EXTENSIONS); - if (responseParsed && responseParsed->is_dict()) { - absl::optional<int> response_id = - responseParsed->GetDict().FindInt("id"); - if (response_id && *response_id == awaited_bidi_response_id) { - VLOG(0) << "awaited response is received!"; - awaited_bidi_response_id = -1; - // No "id" means that we are dealing with an event - } - } else { - LOG(WARNING) << "BiDi response is not a map"; + absl::optional<int> response_id = response_parsed.GetDict().FindInt("id"); + if (response_id && *response_id == awaited_bidi_response_id) { + awaited_bidi_response_id = -1; + // No "id" means that we are dealing with an event } } }
diff --git a/chrome/test/chromedriver/session.h b/chrome/test/chromedriver/session.h index 18c8b99..e954ec7 100644 --- a/chrome/test/chromedriver/session.h +++ b/chrome/test/chromedriver/session.h
@@ -102,6 +102,7 @@ std::string GetCurrentFrameId() const; std::vector<WebDriverLog*> GetAllLogs() const; + bool BidiMapperIsLaunched() const; void OnBidiResponse(const std::string& payload); void AddBidiConnection(int connection_id, SendTextFunc send_response, @@ -114,6 +115,7 @@ bool webSocketUrl = false; bool quit; bool detach; + bool bidi_mapper_is_launched_ = false; int awaited_bidi_response_id = -1; std::unique_ptr<Chrome> chrome; std::string window; @@ -175,7 +177,7 @@ std::vector<BidiConnection> bidi_connections_; // If there is no active connections the messages from Chrome are accumulated // in this queue until a connection is created or the queue overflows. - std::queue<std::string> bidi_response_queue_; + std::queue<base::Value> bidi_response_queue_; }; Session* GetThreadLocalSession();
diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc index c418a185..2cd835c 100644 --- a/chrome/test/chromedriver/session_commands.cc +++ b/chrome/test/chromedriver/session_commands.cc
@@ -11,6 +11,7 @@ #include "base/bind.h" #include "base/callback.h" +#include "base/callback_forward.h" #include "base/files/file_util.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -407,6 +408,18 @@ return status; } + base::RepeatingCallback<Status(bool*)> bidi_mapper_is_launched = + base::BindRepeating( + [](Session* session, bool* condition_is_met) { + *condition_is_met = session->BidiMapperIsLaunched(); + return Status{kOk}; + }, + base::Unretained(session)); + // Assume that BiDiMapper initialization requires the same time as a regular + // script + web_view->HandleEventsUntil(bidi_mapper_is_launched, + Timeout(session->script_timeout)); + { // Create a new tab because the default one is occupied by the BiDiMapper std::string web_view_id;
diff --git a/chrome/test/data/devtools/pause_when_script_is_running.html b/chrome/test/data/devtools/pause_when_script_is_running.html deleted file mode 100644 index 380d8e1..0000000 --- a/chrome/test/data/devtools/pause_when_script_is_running.html +++ /dev/null
@@ -1,13 +0,0 @@ -<html> -<head> -<script> -function handleClick() { - while(true) { - } -} -</script> -</head> -<body> -<input type='button' onclick='handleClick()' value='Test'/> -</body> -</html> \ No newline at end of file
diff --git a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_search_test.js b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_search_test.js index 528542e..6aa5c19 100644 --- a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_search_test.js +++ b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_search_test.js
@@ -7,9 +7,9 @@ import {assert} from 'chrome://resources/js/assert.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {assertEquals, assertGT} from '../../chai_assert.js'; +import {assertEquals, assertGT, assertNotEquals} from '../../chai_assert.js'; -import {deepQuerySelector, waitWithTimeout} from './emoji_picker_test_util.js'; +import {deepQuerySelector, waitForCondition, waitWithTimeout} from './emoji_picker_test_util.js'; const ACTIVE_CATEGORY_BUTTON = 'category-button-active'; @@ -64,9 +64,10 @@ test( 'If matching, search should return both emoji and emoticon results.', - () => { - emojiSearch.search = 'face'; - flush(); + async () => { + emojiSearch.setSearchQuery('face'); + await waitForCondition( + () => findInEmojiPicker('emoji-search', 'emoji-group')); const emojiResults = findInEmojiPicker('emoji-search', 'emoji-group') .shadowRoot.querySelectorAll('.emoji-button'); assertGT(emojiResults.length, 0); @@ -79,11 +80,11 @@ test( 'Search should display meaningful output when no result is found.', - () => { - emojiSearch.search = 'zyxt'; - flush(); + async () => { + emojiSearch.setSearchQuery('zyxt'); + await waitForCondition( + () => findInEmojiPicker('emoji-search', '.no-result')); const message = findInEmojiPicker('emoji-search', '.no-result'); - assert(message); assertEquals(message.innerText, 'No result found'); }); @@ -91,8 +92,9 @@ 'If there is only one emoji returned, pressing Enter triggers the ' + 'clicking event.', async () => { - emojiSearch.search = 'zombi'; - await flush(); + emojiSearch.setSearchQuery('zombi'); + await waitForCondition( + () => findInEmojiPicker('emoji-search', 'emoji-group')); const enterEvent = new KeyboardEvent( 'keydown', {cancelable: true, key: 'Enter', keyCode: 13}); const buttonClickPromise = new Promise( @@ -112,8 +114,9 @@ 'If there is only emoticon returned, pressing Enter triggers the ' + 'clicking event.', async () => { - emojiSearch.search = 'cat'; - await flush(); + emojiSearch.setSearchQuery('cat'); + await waitForCondition( + () => findInEmojiPicker('emoji-search', 'emoji-group')); const enterEvent = new KeyboardEvent( 'keydown', {cancelable: true, key: 'Enter', keyCode: 13}); @@ -129,4 +132,4 @@ buttonClickPromise, 1000, 'Failed to receive emoji button click event.'); }); -}); \ No newline at end of file +});
diff --git a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js index 8d60aa03..8fb24d5 100644 --- a/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js +++ b/chrome/test/data/webui/chromeos/emoji_picker/emoji_picker_test.js
@@ -383,16 +383,17 @@ const search = findInEmojiPicker('emoji-search'); // This particular emoji only appears in the third tab of the test // ordering - search.search = 'face with tears of joy'; + search.$['search'].setValue('face with tears of joy'); - await waitForCondition( - () => search.getNumSearchResults() > 0, 'no search get any results', - 1000); + await waitForCondition(() => search.searchResults); assertGT(search.getNumSearchResults(), 0); }); test('finds no results for garbage search', async () => { const search = findInEmojiPicker('emoji-search'); - search.search = 'THIS string should not match anything'; + search.$['search'].setValue('THIS string should not match anything'); + + await waitForCondition( + () => findInEmojiPicker('emoji-search', '.no-result')); assertEquals(search.getNumSearchResults(), 0); }); });
diff --git a/chrome/test/data/webui/password_manager/BUILD.gn b/chrome/test/data/webui/password_manager/BUILD.gn index bbd37f2e..f067f6e78 100644 --- a/chrome/test/data/webui/password_manager/BUILD.gn +++ b/chrome/test/data/webui/password_manager/BUILD.gn
@@ -23,6 +23,7 @@ in_files = [ "password_manager_app_test.ts", + "password_manager_routing_test.ts", "password_manager_side_bar_test.ts", ]
diff --git a/chrome/test/data/webui/password_manager/password_manager_app_test.ts b/chrome/test/data/webui/password_manager/password_manager_app_test.ts index 09eeaf5..e05bca9 100644 --- a/chrome/test/data/webui/password_manager/password_manager_app_test.ts +++ b/chrome/test/data/webui/password_manager/password_manager_app_test.ts
@@ -4,9 +4,9 @@ import 'chrome://password-manager/password_manager.js'; -import {PasswordManagerAppElement} from 'chrome://password-manager/password_manager.js'; -import {assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {isVisible} from 'chrome://webui-test/test_util.js'; +import {PasswordManagerAppElement, Router, UrlParam} from 'chrome://password-manager/password_manager.js'; +import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {flushTasks, isVisible} from 'chrome://webui-test/test_util.js'; suite('PasswordManagerAppTest', function() { let app: PasswordManagerAppElement; @@ -15,6 +15,7 @@ document.body.innerHTML = ''; app = document.createElement('password-manager-app'); document.body.appendChild(app); + return flushTasks(); }); test('check layout', function() { @@ -22,4 +23,21 @@ assertTrue(isVisible(app.$.sidebar)); assertTrue(isVisible(app.$.toolbar)); }); + + test('UI search box updates URL parameters', function() { + app.$.toolbar.$.mainToolbar.getSearchField().setValue('hello'); + + assertEquals( + 'hello', + String(Router.getInstance().currentRoute.queryParameters.get( + UrlParam.SEARCH_TERM))); + }); + + test('URL parameters update UI search box', function() { + const query = new URLSearchParams(); + query.set(UrlParam.SEARCH_TERM, 'test'); + Router.getInstance().updateRouterParams(query); + assertEquals( + 'test', app.$.toolbar.$.mainToolbar.getSearchField().getValue()); + }); });
diff --git a/chrome/test/data/webui/password_manager/password_manager_browsertest.js b/chrome/test/data/webui/password_manager/password_manager_browsertest.js index c0ec890c..89f85a2 100644 --- a/chrome/test/data/webui/password_manager/password_manager_browsertest.js +++ b/chrome/test/data/webui/password_manager/password_manager_browsertest.js
@@ -25,6 +25,7 @@ [['App', 'password_manager_app_test.js'], ['SideBar', 'password_manager_side_bar_test.js'], + ['Routing', 'password_manager_routing_test.js'], ].forEach(test => registerTest(...test));
diff --git a/chrome/test/data/webui/password_manager/password_manager_routing_test.ts b/chrome/test/data/webui/password_manager/password_manager_routing_test.ts new file mode 100644 index 0000000..c159627c --- /dev/null +++ b/chrome/test/data/webui/password_manager/password_manager_routing_test.ts
@@ -0,0 +1,67 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://password-manager/password_manager.js'; + +import {Page, Route, RouteObserverMixin, Router, UrlParam} from 'chrome://password-manager/password_manager.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {assertEquals, assertFalse} from 'chrome://webui-test/chai_assert.js'; +import {flushTasks} from 'chrome://webui-test/test_util.js'; + +const TestElementBase = RouteObserverMixin(PolymerElement); +class TestElement extends TestElementBase { + static get properties() { + return { + newRoute: Object, + oldRoute: Object, + }; + } + + newRoute: Route|undefined; + oldRoute: Route|undefined; + + override currentRouteChanged(newRoute: Route, oldRoute: Route): void { + this.newRoute = newRoute; + this.oldRoute = oldRoute; + } +} +customElements.define('test-element', TestElement); + +suite('PasswordManagerAppTest', function() { + let testElement: TestElement; + + setup(function() { + document.body.innerHTML = ''; + testElement = document.createElement('test-element') as TestElement; + document.body.appendChild(testElement); + return flushTasks(); + }); + + test('navigating notifies observers', function() { + Router.getInstance().navigateTo(Page.CHECKUP); + assertEquals(Page.CHECKUP, Router.getInstance().currentRoute.page); + assertEquals(Page.CHECKUP, testElement.newRoute!.page); + assertEquals(Page.PASSWORDS, testElement.oldRoute!.page); + assertFalse(testElement.newRoute === testElement.oldRoute); + }); + + test('update Params notifies Observers', function() { + const newParams = new URLSearchParams(); + newParams.set(UrlParam.SEARCH_TERM, 'test'); + Router.getInstance().updateRouterParams(newParams); + + assertEquals(newParams, Router.getInstance().currentRoute.queryParameters); + assertEquals(newParams, testElement.newRoute!.queryParameters); + assertFalse(testElement.newRoute === testElement.oldRoute); + }); + + test('Invalid path corrected', function() { + history.replaceState({}, '', 'invalid-page'); + + // Create a new router to simulate opening on the invalid page. + const router = new Router(); + assertEquals(location.pathname, '/passwords'); + assertEquals(Page.PASSWORDS, router.currentRoute.page); + }); +});
diff --git a/chrome/test/data/webui/password_manager/password_manager_side_bar_test.ts b/chrome/test/data/webui/password_manager/password_manager_side_bar_test.ts index 4df273e..c549623 100644 --- a/chrome/test/data/webui/password_manager/password_manager_side_bar_test.ts +++ b/chrome/test/data/webui/password_manager/password_manager_side_bar_test.ts
@@ -29,18 +29,18 @@ const differentPage = page === Page.PASSWORDS ? Page.CHECKUP : Page.PASSWORDS; Router.getInstance().navigateTo(differentPage); - assertEquals(differentPage, Router.getInstance().currentPage); + assertEquals(differentPage, Router.getInstance().currentRoute.page); const element = sidebar.shadowRoot!.querySelector<HTMLElement>(`#${page}`)!; element.click(); - assertEquals(page, Router.getInstance().currentPage); + assertEquals(page, Router.getInstance().currentRoute.page); })); [Page.PASSWORDS, Page.CHECKUP, Page.SETTINGS].forEach( page => test(`navigating to ${page} updates selected item`, function() { Router.getInstance().navigateTo(page); - assertEquals(page, Router.getInstance().currentPage); + assertEquals(page, Router.getInstance().currentRoute.page); assertEquals(page, (sidebar.$.menu.selectedItem as HTMLElement).id); })); });
diff --git a/chrome/test/data/webui/settings/settings_category_default_radio_group_tests.ts b/chrome/test/data/webui/settings/settings_category_default_radio_group_tests.ts index e41b395..30f5471e 100644 --- a/chrome/test/data/webui/settings/settings_category_default_radio_group_tests.ts +++ b/chrome/test/data/webui/settings/settings_category_default_radio_group_tests.ts
@@ -4,8 +4,8 @@ // clang-format off import {ContentSetting, ContentSettingProvider, ContentSettingsTypes, SettingsCategoryDefaultRadioGroupElement, SiteSettingsPrefsBrowserProxyImpl} from 'chrome://settings/lazy_load.js'; - -import {assertEquals, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {assertEquals, assertNotEquals, assertTrue, assertFalse} from 'chrome://webui-test/chai_assert.js'; +import {flushTasks} from 'chrome://webui-test/test_util.js'; import {TestSiteSettingsPrefsBrowserProxy} from './test_site_settings_prefs_browser_proxy.js'; import {createContentSettingTypeToValuePair, createDefaultContentSetting, createSiteSettingsPrefs, SiteSettingsPref} from './test_util.js'; @@ -155,7 +155,7 @@ const enforcedPrefs = createSiteSettingsPrefs( [createContentSettingTypeToValuePair( ContentSettingsTypes.GEOLOCATION, createDefaultContentSetting({ - setting: ContentSetting.ASK, + setting: ContentSetting.BLOCK, source: ContentSettingProvider.EXTENSION, }))], []); @@ -164,7 +164,18 @@ testElement.category = ContentSettingsTypes.GEOLOCATION; await browserProxy.whenCalled('getDefaultValueForContentType'); + assertTrue(testElement.$.disabledRadioOption.checked); assertTrue(testElement.$.enabledRadioOption.disabled); assertTrue(testElement.$.disabledRadioOption.disabled); + + // Stop enforcement. + const enabledPref = + createPref(ContentSettingsTypes.GEOLOCATION, ContentSetting.ASK); + browserProxy.setPrefs(enabledPref); + + await flushTasks(); + assertTrue(testElement.$.enabledRadioOption.checked); + assertFalse(testElement.$.enabledRadioOption.disabled); + assertFalse(testElement.$.disabledRadioOption.disabled); }); });
diff --git a/chrome/test/data/webui/signin/sync_confirmation_test.ts b/chrome/test/data/webui/signin/sync_confirmation_test.ts index 4aaa503d..9f7b1df 100644 --- a/chrome/test/data/webui/signin/sync_confirmation_test.ts +++ b/chrome/test/data/webui/signin/sync_confirmation_test.ts
@@ -20,7 +20,6 @@ const SIGNIN_INTERCEPT_CONSENT_CONFIRMATION = 'Turn on sync'; const SETTINGS_CONSENT_CONFIRMATION = 'Settings'; -const MANAGE_SYNC_CONSENT_CONFIRMATION = 'Manage sync'; const SYNC_SETTINGS_CONSENT_CONFIRMATION = 'Sync settings'; const CONSENT_DESCRIPTION_TEXTS = [ @@ -148,9 +147,7 @@ app.shadowRoot!.querySelector<HTMLElement>('#settingsButton')!.click(); const [description, confirmation] = await browserProxy.whenCalled('goToSettings'); - if (isSigninInterceptFreEnabled) { - assertEquals(MANAGE_SYNC_CONSENT_CONFIRMATION, confirmation); - } else if (isModalDialogDesignEnabled) { + if (isModalDialogDesignEnabled) { assertEquals(SETTINGS_CONSENT_CONFIRMATION, confirmation); } else { assertEquals(SYNC_SETTINGS_CONSENT_CONFIRMATION, confirmation);
diff --git a/chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.cc b/chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.cc index f7df29f..6288f78 100644 --- a/chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.cc +++ b/chromeos/ash/components/dbus/userdataauth/fake_userdataauth_client.cc
@@ -768,6 +768,7 @@ std::string auth_session_id = base::StringPrintf(kAuthSessionIdTemplate, next_auth_session_id_++); + DCHECK_EQ(request.intent(), user_data_auth::AUTH_INTENT_DECRYPT); DCHECK_EQ(auth_sessions_.count(auth_session_id), 0u); AuthSessionData& session = auth_sessions_[auth_session_id]; session.id = auth_session_id;
diff --git a/chromeos/tast_control.gni b/chromeos/tast_control.gni index baaf55a..9db1489 100644 --- a/chromeos/tast_control.gni +++ b/chromeos/tast_control.gni
@@ -10,35 +10,8 @@ # list and cite a bug. tast_disabled_tests_from_chrome_all = [ # crbug.com/1356506, b/244390715 - "inputs.PhysicalKeyboardAutocorrect.en_us_1", - "inputs.PhysicalKeyboardAutocorrect.en_us_2", - "inputs.PhysicalKeyboardJapaneseTyping.us", - "inputs.PhysicalKeyboardPinyinTyping.simplified", - "inputs.VirtualKeyboardAccent", - "inputs.VirtualKeyboardAccessibility", - "inputs.VirtualKeyboardAutoShift", - "inputs.VirtualKeyboardChangeInput.a11y", - "inputs.VirtualKeyboardChangeInput.tablet", - "inputs.VirtualKeyboardDeadKeys.catalan", - "inputs.VirtualKeyboardDeadKeys.french", - "inputs.VirtualKeyboardEnglishSettings", - "inputs.VirtualKeyboardFloat.tablet", - "inputs.VirtualKeyboardGlideTyping.clamshell_a11y_docked", - "inputs.VirtualKeyboardGlideTyping.clamshell_a11y_floating", - "inputs.VirtualKeyboardGlideTyping.tablet_docked", - "inputs.VirtualKeyboardGlideTyping.tablet_floating", - "inputs.VirtualKeyboardHandwriting.docked", - "inputs.VirtualKeyboardHandwriting.floating", - "inputs.VirtualKeyboardJapaneseInputMode", - "inputs.VirtualKeyboardLoginScreen.clamshell", - "inputs.VirtualKeyboardLoginScreen.tablet", - "inputs.VirtualKeyboardMultipaste", - "inputs.VirtualKeyboardMultipasteSuggestion.lacros", - "inputs.VirtualKeyboardOverscroll.clamshell", - "inputs.VirtualKeyboardTypingIME", - "inputs.VirtualKeyboardTypingOmnibox", - "inputs.VirtualKeyboardTypingOmnibox.guest", - "inputs.VirtualKeyboardTypingUserMode.incognito", + "inputs.PhysicalKeyboard*", + "inputs.VirtualKeyboard*", # b/243766745 "inputs.InputMethodShelfInputs", @@ -268,6 +241,9 @@ # https://crbug.com/1354215 "lacros.Basic", + + # https://crbug.com/1352525 + "apps.ContentPreview", ] # To create filters to be used on specific builders add them like this:
diff --git a/components/autofill_assistant/browser/BUILD.gn b/components/autofill_assistant/browser/BUILD.gn index 2a8f0be..ac706ca4 100644 --- a/components/autofill_assistant/browser/BUILD.gn +++ b/components/autofill_assistant/browser/BUILD.gn
@@ -31,12 +31,6 @@ sources = [ "parse_jspb_test.proto" ] } -# TODO(crbug.com/1344231): Remove once this config is no longer used in this -# file. -config("allowshadowing") { - cflags = [ "-Wno-shadow" ] -} - static_library("browser") { sources = [ "actions/action.cc", @@ -409,10 +403,6 @@ "//services/metrics/public/cpp:ukm_builders", "//third_party/re2", ] - - # TODO(crbug.com/1344231): Remove once all files in this target can compile - # with -Wshadow. Placed last to take precedence over the noshadowing config. - configs += [ ":allowshadowing" ] } static_library("unit_test_support") {
diff --git a/components/autofill_assistant/browser/service/no_round_trip_service.cc b/components/autofill_assistant/browser/service/no_round_trip_service.cc index 723979e..a7a0f81f 100644 --- a/components/autofill_assistant/browser/service/no_round_trip_service.cc +++ b/components/autofill_assistant/browser/service/no_round_trip_service.cc
@@ -164,9 +164,6 @@ return; } - ServiceRequestSender::ResponseInfo response_info; - response_info.encoded_body_length = 0; - for (const auto& routine : script_store_->GetRoutines()) { if (!routine.has_script_path() || routine.script_path() != script_path) { continue;
diff --git a/components/policy/test_support/fake_dmserver.cc b/components/policy/test_support/fake_dmserver.cc index 6bde386..2928793 100644 --- a/components/policy/test_support/fake_dmserver.cc +++ b/components/policy/test_support/fake_dmserver.cc
@@ -31,6 +31,7 @@ constexpr char kStateKeysKey[] = "state_keys"; constexpr char kAllowedPolicyTypesKey[] = "allowed_policy_types"; constexpr char kPoliciesKey[] = "policies"; +constexpr char kExternalPoliciesKey[] = "external_policies"; constexpr char kManagedUsersKey[] = "managed_users"; constexpr char kPolicyUserKey[] = "policy_user"; @@ -157,7 +158,7 @@ const std::string* entity_id, const std::string* serialized_proto) { if (!policy_type || !serialized_proto) { - LOG(ERROR) << "Coudln't find the policy type or value fields"; + LOG(ERROR) << "Couldn't find the policy type or value fields"; return false; } std::string decoded_proto; @@ -174,6 +175,25 @@ return true; } +bool FakeDMServer::SetExternalPolicyPayload( + const std::string* policy_type, + const std::string* entity_id, + const std::string* serialized_raw_policy) { + if (!policy_type || !entity_id || !serialized_raw_policy) { + LOG(ERROR) << "Couldn't find the policy type or entity id or value fields"; + return false; + } + std::string decoded_raw_policy; + if (!base::Base64Decode(*serialized_raw_policy, &decoded_raw_policy)) { + LOG(ERROR) << "Unable to base64 decode validation value from " + << *serialized_raw_policy; + return false; + } + EmbeddedPolicyTestServer::UpdateExternalPolicy(*policy_type, *entity_id, + decoded_raw_policy); + return true; +} + bool FakeDMServer::ReadPolicyBlobFile() { base::FilePath policy_blob_file(policy_blob_path_); if (!base::PathExists(policy_blob_file)) { @@ -235,6 +255,23 @@ } } + base::Value::List* external_policies = dict.FindList(kExternalPoliciesKey); + if (external_policies) { + for (const base::Value& policy : *external_policies) { + if (!policy.is_dict()) { + LOG(ERROR) << "The current external policy isn't dict"; + return false; + } + if (!SetExternalPolicyPayload( + policy.GetDict().FindString(kPolicyTypeKey), + policy.GetDict().FindString(kEntityIdKey), + policy.GetDict().FindString(kPolicyValueKey))) { + LOG(ERROR) << "Failed to set the external policy"; + return false; + } + } + } + return true; }
diff --git a/components/policy/test_support/fake_dmserver.h b/components/policy/test_support/fake_dmserver.h index b19fe72..25b6fbd 100644 --- a/components/policy/test_support/fake_dmserver.h +++ b/components/policy/test_support/fake_dmserver.h
@@ -29,16 +29,23 @@ "policy_type" : "google/chromeos/user", "value" : "base64 encoded proto message", }, - { + { "policy_type" : "google/chromeos/device", "value" : "base64 encoded proto message", }, - { + { "policy_type" : "google/chromeos/publicaccount", "entity_id" : "accountid@managedchrome.com", "value" : "base64 encoded proto message", } ], + "external_policies" : [ + { + "policy_type" : "google/chrome/extension", + "entity_id" : "extension_id", + "value" : "base64 encoded raw json value", + } + ], "managed_users" : [ "secret123456" ], @@ -90,6 +97,11 @@ bool SetPolicyPayload(const std::string* policy_type, const std::string* entity_id, const std::string* serialized_proto); + // Sets the external policy payload in the policy storage, it will return true + // if it's able to set the policy and false otherwise. + bool SetExternalPolicyPayload(const std::string* policy_type, + const std::string* entity_id, + const std::string* serialized_raw_policy); // Reads and sets the values in the policy blob file, it will return true if // the policy blob file doesn't exist yet or all the values are read // correctly, and false otherwise.
diff --git a/components/policy/test_support/fake_dmserver_unittest.cc b/components/policy/test_support/fake_dmserver_unittest.cc index c0ef43d..dd7068dc 100644 --- a/components/policy/test_support/fake_dmserver_unittest.cc +++ b/components/policy/test_support/fake_dmserver_unittest.cc
@@ -22,6 +22,7 @@ #include "base/test/mock_callback.h" #include "base/test/task_environment.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" +#include "components/policy/proto/chrome_extension_policy.pb.h" #include "components/policy/proto/device_management_backend.pb.h" #include "components/policy/test_support/client_storage.h" #include "components/policy/test_support/embedded_policy_test_server.h" @@ -52,6 +53,53 @@ std::move(callback).Run(); } +constexpr base::StringPiece kRawExtensionPolicyPayload = + R"({ + "VisibleStringPolicy": { + "Value": "notsecret" + }, + "SensitiveStringPolicy": { + "Value": "secret" + }, + "VisibleDictPolicy": { + "Value": { + "some_bool": true, + "some_string": "notsecret" + } + }, + "SensitiveDictPolicy": { + "Value": { + "some_bool": true, + "some_string": "secret" + } + } + })"; +constexpr base::StringPiece kPolicyBlobForExternalPolicy = + R"( + { + "managed_users" : [ "*" ], + "policy_user" : "tast-user@managedchrome.com", + "external_policies": [ + { + "entity_id": "ibdnofdagboejmpijdiknapcihkomkki", + "policy_type": "google/chrome/extension", + "value": "ewogICAgICAiVmlzaWJsZVN0cmluZ1BvbGljeSI6IHsKICAgICAgICAiVm)" + R"(FsdWUiOiAibm90c2VjcmV0IgogICAgICB9LAogICAgICAiU2Vuc2l0aXZlU3RyaW5nUG9sa)" + R"(WN5IjogewogICAgICAgICJWYWx1ZSI6ICJzZWNyZXQiCiAgICAgIH0sCiAgICAgICJWaXNp)" + R"(YmxlRGljdFBvbGljeSI6IHsKICAgICAgICAiVmFsdWUiOiB7CiAgICAgICAgICAic29tZV9)" + R"(ib29sIjogdHJ1ZSwKICAgICAgICAgICJzb21lX3N0cmluZyI6ICJub3RzZWNyZXQiCiAgIC)" + R"(AgICAgfQogICAgICB9LAogICAgICAiU2Vuc2l0aXZlRGljdFBvbGljeSI6IHsKICAgICAgI)" + R"(CAiVmFsdWUiOiB7CiAgICAgICAgICAic29tZV9ib29sIjogdHJ1ZSwKICAgICAgICAgICJz)" + R"(b21lX3N0cmluZyI6ICJzZWNyZXQiCiAgICAgICAgfQogICAgICB9CiAgICB9" + } + ] + } + )"; +constexpr base::StringPiece kSHA256HashForExtensionPolicyPayload( + "\x1e\x95\xf3\xeb\x42\xcc\x72\x2c\x83\xdb\x2d\x1c\xb1\xca\xfa\x2b\x78\x1e" + "\x4b\x91\x2b\x73\x1a\x5c\x85\x72\xa8\xf2\x87\x4a\xbc\x44", + 32); + } // namespace // TODO(b/239676448): Add missing unittest for Writing to Pipe. @@ -396,6 +444,46 @@ "MvZW50ZXJwcmlzZS9wcmludGVycy5qc29uIn0="); } +TEST_F(FakeDMServerTest, HandleExternalPolicyRequest_Succeeds) { + FakeDMServer fake_dmserver(policy_blob_path_.MaybeAsASCII(), + client_state_path_.MaybeAsASCII()); + EXPECT_TRUE(fake_dmserver.Start()); + + ASSERT_TRUE(base::WriteFile(policy_blob_path_, kPolicyBlobForExternalPolicy)); + ASSERT_TRUE(base::WriteFile(client_state_path_, R"( + { + "fake_device_id" : { + "device_id" : "fake_device_id", + "device_token" : "fake_device_token", + "machine_name" : "fake_machine_name", + "username" : "tast-user@managedchrome.com", + "state_keys" : [ "fake_state_key" ], + "allowed_policy_types" : [ "google/chrome/extension", + "google/chromeos/user" ] + } + } + )")); + EXPECT_EQ(SendRequest(fake_dmserver.GetServiceURL(), + "/?apptype=Chrome&deviceid=fake_device_id&devicetype=2&" + "oauth_token=fake_policy_token&request=policy"), + net::HTTP_OK); + + std::string policy_data = fake_dmserver.policy_storage()->GetPolicyPayload( + "google/chrome/extension", "ibdnofdagboejmpijdiknapcihkomkki"); + ASSERT_FALSE(policy_data.empty()); + enterprise_management::ExternalPolicyData data; + ASSERT_TRUE(data.ParseFromString(policy_data)); + EXPECT_EQ(data.secure_hash(), kSHA256HashForExtensionPolicyPayload); + // TODO(b/240445061): Write an integration test that issues a request to the + // returned URL and verifies that it returns correct policy. + ASSERT_TRUE(data.has_download_url()); + + std::string extension_policy_payload = + fake_dmserver.policy_storage()->GetExternalPolicyPayload( + "google/chrome/extension", "ibdnofdagboejmpijdiknapcihkomkki"); + EXPECT_EQ(extension_policy_payload, kRawExtensionPolicyPayload); +} + TEST_F(FakeDMServerTest, ReadPolicyBlobFile_WithWrongJSONData_Fails) { FakeDMServer fake_dmserver(policy_blob_path_.MaybeAsASCII(), client_state_path_.MaybeAsASCII()); @@ -437,6 +525,23 @@ net::HTTP_INTERNAL_SERVER_ERROR); } +TEST_F(FakeDMServerTest, ReadPolicyBlobFile_WithNonDictExternalPolicies_Fails) { + FakeDMServer fake_dmserver(policy_blob_path_.MaybeAsASCII(), + client_state_path_.MaybeAsASCII()); + EXPECT_TRUE(fake_dmserver.Start()); + + ASSERT_TRUE(base::WriteFile(policy_blob_path_, R"( + { + "managed_users" : [ "*" ], + "external_policies" : [ "1", "2" ] + } + )")); + EXPECT_EQ(SendRequest(fake_dmserver.GetServiceURL(), + "/?apptype=Chrome&deviceid=fake_device_id&devicetype=2&" + "oauth_token=fake_policy_token&request=policy"), + net::HTTP_INTERNAL_SERVER_ERROR); +} + TEST_F(FakeDMServerTest, SetPolicyPayload_WithoutValueOrTypeField_Fails) { FakeDMServer fake_dmserver(policy_blob_path_.MaybeAsASCII(), client_state_path_.MaybeAsASCII()); @@ -475,4 +580,51 @@ net::HTTP_INTERNAL_SERVER_ERROR); } +TEST_F(FakeDMServerTest, + SetExternalPolicyPayload_WithoutValueOrTypeField_Fails) { + FakeDMServer fake_dmserver(policy_blob_path_.MaybeAsASCII(), + client_state_path_.MaybeAsASCII()); + EXPECT_TRUE(fake_dmserver.Start()); + + ASSERT_TRUE(base::WriteFile(policy_blob_path_, R"( + { + "managed_users" : [ "*" ], + "external_policies" : [ + { + "wrong type" : "google/chrome/extension", + "wrong id" : "random id", + "wrong value" : "!@#$%^&*" + } + ] + } + )")); + EXPECT_EQ(SendRequest(fake_dmserver.GetServiceURL(), + "/?apptype=Chrome&deviceid=fake_device_id&devicetype=2&" + "oauth_token=fake_policy_token&request=policy"), + net::HTTP_INTERNAL_SERVER_ERROR); +} + +TEST_F(FakeDMServerTest, SetExternalPolicyPayload_WithNonBase64Value_Fails) { + FakeDMServer fake_dmserver(policy_blob_path_.MaybeAsASCII(), + client_state_path_.MaybeAsASCII()); + EXPECT_TRUE(fake_dmserver.Start()); + + ASSERT_TRUE(base::WriteFile(policy_blob_path_, R"( + { + "managed_users" : [ "*" ], + "external_policies" : [ + { + "policy_type" : "google/chrome/extension", + "entity_id" : "random_id", + "value" : "!@#$%^&*" + } + ] + } + )")); + EXPECT_EQ(SendRequest(fake_dmserver.GetServiceURL(), + "/?apptype=Chrome&deviceid=fake_device_id&devicetype=2&" + "oauth_token=fake_policy_token&request=policy"), + net::HTTP_INTERNAL_SERVER_ERROR); +} + } // namespace fakedms
diff --git a/components/viz/service/display/direct_renderer.cc b/components/viz/service/display/direct_renderer.cc index 589fd71..04c22bd 100644 --- a/components/viz/service/display/direct_renderer.cc +++ b/components/viz/service/display/direct_renderer.cc
@@ -27,11 +27,13 @@ #include "components/viz/common/quads/compositor_render_pass_draw_quad.h" #include "components/viz/common/quads/draw_quad.h" #include "components/viz/common/quads/solid_color_draw_quad.h" +#include "components/viz/common/resources/platform_color.h" #include "components/viz/common/viz_utils.h" #include "components/viz/service/display/bsp_tree.h" #include "components/viz/service/display/bsp_walk_action.h" #include "components/viz/service/display/output_surface.h" #include "components/viz/service/display/skia_output_surface.h" +#include "gpu/command_buffer/common/capabilities.h" #include "media/base/video_util.h" #include "ui/gfx/geometry/quad_f.h" #include "ui/gfx/geometry/rect_conversions.h" @@ -602,6 +604,7 @@ } void DirectRenderer::DrawRenderPass(const AggregatedRenderPass* render_pass) { + current_frame()->current_render_pass = render_pass; TRACE_EVENT0("viz", "DirectRenderer::DrawRenderPass"); if (CanSkipRenderPass(render_pass)) { skipped_render_pass_ids_.insert(render_pass->id); @@ -748,7 +751,6 @@ void DirectRenderer::UseRenderPass(const AggregatedRenderPass* render_pass) { bool is_root = render_pass == current_frame()->root_render_pass; - current_frame()->current_render_pass = render_pass; // The root render pass will be either bound to the buffer allocated by // the SkiaOutputSurface, or if the renderer allocatates images then the root // render pass buffer will be allocated in @@ -772,8 +774,12 @@ enlarge_pass_texture_amount_.height()); } - AllocateRenderPassResourceIfNeeded(render_pass->id, - {size, render_pass->generate_mipmap}); + auto color_space = CurrentRenderPassColorSpace(); + auto format = GetColorSpaceResourceFormat(color_space); + + AllocateRenderPassResourceIfNeeded( + render_pass->id, + {size, render_pass->generate_mipmap, format, color_space}); // TODO(crbug.com/582554): This change applies only when Vulkan is enabled and // it will be removed once SkiaRenderer has complete support for Vulkan. @@ -906,7 +912,7 @@ } gfx::Size DirectRenderer::CalculateTextureSizeForRenderPass( - const AggregatedRenderPass* render_pass) { + const AggregatedRenderPass* render_pass) const { // Round the size of the render pass backings to a multiple of 64 pixels. This // reduces memory fragmentation. https://crbug.com/146070. This also allows // backings to be more easily reused during a resize operation. @@ -1045,6 +1051,25 @@ current_frame()->current_render_pass->content_color_usage); } +ResourceFormat DirectRenderer::GetColorSpaceResourceFormat( + gfx::ColorSpace color_space) const { + // TODO(penghuang): check supported format correctly. + gpu::Capabilities caps; + caps.texture_format_bgra8888 = true; + +#if BUILDFLAG(IS_CHROMEOS_LACROS) + // TODO(crbug.com/1317015): add support RGBA_F16 in LaCrOS. + auto format = color_space.IsHDR() + ? RGBA_1010102 + : PlatformColor::BestSupportedTextureFormat(caps); +#else + auto format = color_space.IsHDR() + ? RGBA_F16 + : PlatformColor::BestSupportedTextureFormat(caps); +#endif + return format; +} + DelegatedInkPointRendererBase* DirectRenderer::GetDelegatedInkPointRenderer( bool create_if_necessary) { return nullptr;
diff --git a/components/viz/service/display/direct_renderer.h b/components/viz/service/display/direct_renderer.h index d8df093..efa64b3 100644 --- a/components/viz/service/display/direct_renderer.h +++ b/components/viz/service/display/direct_renderer.h
@@ -193,6 +193,8 @@ struct RenderPassRequirements { gfx::Size size; bool generate_mipmap = false; + ResourceFormat format; + gfx::ColorSpace color_space; }; static gfx::RectF QuadVertexRect(); @@ -217,7 +219,7 @@ void SetScissorTestRectInDrawSpace(const gfx::Rect& draw_space_rect); gfx::Size CalculateTextureSizeForRenderPass( - const AggregatedRenderPass* render_pass); + const AggregatedRenderPass* render_pass) const; gfx::Size CalculateSizeForOutputSurface( const gfx::Size& device_viewport_size); @@ -308,6 +310,7 @@ return CurrentRenderPassColorSpace().ToSkColorSpace( CurrentFrameSDRWhiteLevel()); } + ResourceFormat GetColorSpaceResourceFormat(gfx::ColorSpace color_space) const; const raw_ptr<const RendererSettings> settings_; // Points to the viz-global singleton.
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc index 1b18cc6..a06b697 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc
@@ -3079,6 +3079,12 @@ render_passes_in_frame) { std::vector<AggregatedRenderPassId> passes_to_delete; for (const auto& pair : render_pass_backings_) { + // Buffers for root render pass backings are managed by |buffer_queue_|, not + // DisplayResourceProvider, so we should not destroy them here. + const RenderPassBacking& backing = pair.second; + if (backing.is_root) + continue; + auto render_pass_it = render_passes_in_frame.find(pair.first); if (render_pass_it == render_passes_in_frame.end()) { passes_to_delete.push_back(pair.first); @@ -3086,12 +3092,16 @@ } const RenderPassRequirements& requirements = render_pass_it->second; - const RenderPassBacking& backing = pair.second; bool size_appropriate = backing.size.width() >= requirements.size.width() && backing.size.height() >= requirements.size.height(); bool mipmap_appropriate = !requirements.generate_mipmap || backing.generate_mipmap; - if (!size_appropriate || !mipmap_appropriate) + bool no_change_in_format = requirements.format == backing.format; + bool no_change_in_color_space = + requirements.color_space == backing.color_space; + + if (!size_appropriate || !mipmap_appropriate || !no_change_in_format || + !no_change_in_color_space) passes_to_delete.push_back(pair.first); } @@ -3100,11 +3110,7 @@ for (size_t i = 0; i < passes_to_delete.size(); ++i) { auto it = render_pass_backings_.find(passes_to_delete[i]); auto& backing = it->second; - // Buffers for root render pass backings are managed by |buffer_queue_|, not - // DisplayResourceProvider, so we should not destroy them here. - if (!backing.is_root) { - skia_output_surface_->DestroySharedImage(backing.mailbox); - } + skia_output_surface_->DestroySharedImage(backing.mailbox); render_pass_backings_.erase(it); } @@ -3135,20 +3141,8 @@ } auto color_space = CurrentRenderPassColorSpace(); - // TODO(penghuang): check supported format correctly. - gpu::Capabilities caps; - caps.texture_format_bgra8888 = true; + auto format = GetColorSpaceResourceFormat(color_space); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // TODO(crbug.com/1317015): add support RGBA_F16 in LaCrOS. - auto format = color_space.IsHDR() - ? RGBA_1010102 - : PlatformColor::BestSupportedTextureFormat(caps); -#else - auto format = color_space.IsHDR() - ? RGBA_F16 - : PlatformColor::BestSupportedTextureFormat(caps); -#endif uint32_t usage = gpu::SHARED_IMAGE_USAGE_DISPLAY; if (requirements.generate_mipmap) usage |= gpu::SHARED_IMAGE_USAGE_MIPMAP;
diff --git a/components/viz/service/display/software_renderer.h b/components/viz/service/display/software_renderer.h index 45e6437..c81ad4e 100644 --- a/components/viz/service/display/software_renderer.h +++ b/components/viz/service/display/software_renderer.h
@@ -124,7 +124,7 @@ raw_ptr<SoftwareOutputDevice> output_device_; raw_ptr<SkCanvas> root_canvas_ = nullptr; - raw_ptr<SkCanvas> current_canvas_ = nullptr; + raw_ptr<SkCanvas, DanglingUntriaged> current_canvas_ = nullptr; SkPaint current_paint_; SkSamplingOptions current_sampling_; std::unique_ptr<SkCanvas> current_framebuffer_canvas_;
diff --git a/components/viz/service/display_embedder/image_context_impl.h b/components/viz/service/display_embedder/image_context_impl.h index dd33929..7f4cf5d 100644 --- a/components/viz/service/display_embedder/image_context_impl.h +++ b/components/viz/service/display_embedder/image_context_impl.h
@@ -129,7 +129,8 @@ // The |promise_image_texture| is used for fulfilling the promise image. It is // used on GPU thread. - raw_ptr<SkPromiseImageTexture> promise_image_texture_ = nullptr; + raw_ptr<SkPromiseImageTexture, DanglingUntriaged> promise_image_texture_ = + nullptr; }; } // namespace viz
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index 8566ac7..d9ac2b0 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -997,10 +997,8 @@ base::BindRepeating(&BrowsingTopicsDocumentHost::CreateMojoService)); } #if !BUILDFLAG(IS_ANDROID) - if (SiteIsolationPolicy::IsApplicationIsolationLevelEnabled()) { - map->Add<blink::mojom::DirectSocketsService>( - base::BindRepeating(&DirectSocketsServiceImpl::CreateForFrame)); - } + map->Add<blink::mojom::DirectSocketsService>( + base::BindRepeating(&DirectSocketsServiceImpl::CreateForFrame)); map->Add<media::mojom::SpeechRecognitionContext>(base::BindRepeating( &EmptyBinderForFrame<media::mojom::SpeechRecognitionContext>)); map->Add<media::mojom::SpeechRecognitionClientBrowserInterface>(
diff --git a/content/browser/direct_sockets/direct_sockets_open_browsertest.cc b/content/browser/direct_sockets/direct_sockets_open_browsertest.cc index 2bad550..528cb6fa 100644 --- a/content/browser/direct_sockets/direct_sockets_open_browsertest.cc +++ b/content/browser/direct_sockets/direct_sockets_open_browsertest.cc
@@ -52,6 +52,7 @@ #include "services/network/test/test_udp_socket.h" #include "testing/gmock/include/gmock/gmock-matchers.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom.h" #include "url/gurl.h" // The tests in this file use a mock implementation of NetworkContext, to test @@ -63,8 +64,10 @@ namespace { +using ProtocolType = blink::mojom::DirectSocketProtocolType; + struct RecordedCall { - DirectSocketsServiceImpl::ProtocolType protocol_type; + ProtocolType protocol_type; std::string remote_address; uint16_t remote_port; @@ -177,8 +180,7 @@ CreateTCPConnectedSocketCallback callback) override { const net::IPEndPoint& peer_addr = remote_addr_list.front(); Record(RecordedCall{ - DirectSocketsServiceImpl::ProtocolType::kTcp, - peer_addr.address().ToString(), peer_addr.port(), + ProtocolType::kTcp, peer_addr.address().ToString(), peer_addr.port(), tcp_connected_socket_options->send_buffer_size, tcp_connected_socket_options->receive_buffer_size, tcp_connected_socket_options->no_delay, @@ -220,13 +222,12 @@ const net::Error result = (remote_addr.port() == 0) ? net::ERR_INVALID_ARGUMENT : network_context_->result(); - network_context_->Record( - RecordedCall{DirectSocketsServiceImpl::ProtocolType::kUdp, - remote_addr.address().ToString(), - remote_addr.port(), - socket_options->send_buffer_size, - socket_options->receive_buffer_size, - {}}); + network_context_->Record(RecordedCall{ProtocolType::kUdp, + remote_addr.address().ToString(), + remote_addr.port(), + socket_options->send_buffer_size, + socket_options->receive_buffer_size, + {}}); base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, @@ -304,8 +305,6 @@ ::testing::HasSubstr("keepAliveDelay must be no less than")); } -using ProtocolType = DirectSocketsServiceImpl::ProtocolType; - class DirectSocketsOpenCannotConnectBrowserTest : public DirectSocketsOpenBrowserTest, public testing::WithParamInterface<ProtocolType> { @@ -333,15 +332,13 @@ void RunTest() { const auto protocol = GetParam(); - const std::string type = - protocol == DirectSocketsServiceImpl::ProtocolType::kTcp ? "Tcp" - : "Udp"; + const std::string type = protocol == ProtocolType::kTcp ? "Tcp" : "Udp"; const std::string expected_result = base::StringPrintf( "open%s failed: NetworkError: Network Error.", type.c_str()); const std::string example_hostname = "mail.example.com"; const std::string script = - protocol == DirectSocketsServiceImpl::ProtocolType::kTcp + protocol == ProtocolType::kTcp ? base::StringPrintf("openTcp('%s', 993)", example_hostname.c_str()) : base::StringPrintf( "openUdp({ remoteAddress: '%s', remotePort: 993 })", @@ -406,7 +403,7 @@ DCHECK_EQ(1U, mock_network_context.history().size()); const RecordedCall& call = mock_network_context.history()[0]; - EXPECT_EQ(DirectSocketsServiceImpl::ProtocolType::kTcp, call.protocol_type); + EXPECT_EQ(ProtocolType::kTcp, call.protocol_type); EXPECT_EQ("12.34.56.78", call.remote_address); EXPECT_EQ(9012, call.remote_port); EXPECT_EQ(3456, call.send_buffer_size); @@ -443,7 +440,7 @@ DCHECK_EQ(1U, mock_network_context.history().size()); const RecordedCall& call = mock_network_context.history()[0]; - EXPECT_EQ(DirectSocketsServiceImpl::ProtocolType::kTcp, call.protocol_type); + EXPECT_EQ(ProtocolType::kTcp, call.protocol_type); EXPECT_EQ("fedc:ba98:7654:3210:fedc:ba98:7654:3210", call.remote_address); EXPECT_EQ(789, call.remote_port); EXPECT_EQ(1243, call.send_buffer_size); @@ -474,7 +471,7 @@ ASSERT_EQ(1U, mock_network_context.history().size()); const RecordedCall& call = mock_network_context.history()[0]; - EXPECT_EQ(DirectSocketsServiceImpl::ProtocolType::kTcp, call.protocol_type); + EXPECT_EQ(ProtocolType::kTcp, call.protocol_type); EXPECT_EQ("fedc:ba98:7654:3210:fedc:ba98:7654:3210", call.remote_address); EXPECT_EQ(789, call.remote_port); EXPECT_EQ(1243, call.send_buffer_size); @@ -538,7 +535,7 @@ ASSERT_EQ(1U, mock_network_context.history().size()); const RecordedCall& call = mock_network_context.history()[0]; - EXPECT_EQ(DirectSocketsServiceImpl::ProtocolType::kUdp, call.protocol_type); + EXPECT_EQ(ProtocolType::kUdp, call.protocol_type); EXPECT_EQ("12.34.56.78", call.remote_address); EXPECT_EQ(9012, call.remote_port); EXPECT_EQ(3456, call.send_buffer_size); @@ -568,7 +565,7 @@ DCHECK_EQ(1U, mock_network_context.history().size()); const RecordedCall& call = mock_network_context.history()[0]; - EXPECT_EQ(DirectSocketsServiceImpl::ProtocolType::kUdp, call.protocol_type); + EXPECT_EQ(ProtocolType::kUdp, call.protocol_type); EXPECT_EQ("fedc:ba98:7654:3210:fedc:ba98:7654:3210", call.remote_address); EXPECT_EQ(789, call.remote_port); EXPECT_EQ(1243, call.send_buffer_size);
diff --git a/content/browser/direct_sockets/direct_sockets_service_impl.cc b/content/browser/direct_sockets/direct_sockets_service_impl.cc index 21abff3..7f7bc4a 100644 --- a/content/browser/direct_sockets/direct_sockets_service_impl.cc +++ b/content/browser/direct_sockets/direct_sockets_service_impl.cc
@@ -19,11 +19,13 @@ #include "content/browser/renderer_host/frame_tree_node.h" #include "content/browser/url_loader_factory_params_helper.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/direct_sockets_delegate.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" +#include "mojo/public/cpp/bindings/message.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "mojo/public/cpp/system/data_pipe.h" #include "net/base/address_list.h" @@ -37,6 +39,7 @@ #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/tcp_socket.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom-shared.h" #include "url/url_constants.h" using blink::mojom::DirectSocketFailureType; @@ -69,6 +72,12 @@ return network_context; } +bool IsFrameSufficientlyIsolated(content::RenderFrameHost* frame) { + return frame->GetWebExposedIsolationLevel() >= + content::RenderFrameHost::WebExposedIsolationLevel:: + kMaybeIsolatedApplication; +} + } // namespace DirectSocketsServiceImpl::DirectSocketsServiceImpl(RenderFrameHost& frame_host) @@ -79,12 +88,18 @@ // static void DirectSocketsServiceImpl::CreateForFrame( - RenderFrameHost* render_frame_host, + RenderFrameHost* frame, mojo::PendingReceiver<blink::mojom::DirectSocketsService> receiver) { DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!IsFrameSufficientlyIsolated(frame)) { + return; + } mojo::MakeSelfOwnedReceiver( - std::make_unique<DirectSocketsServiceImpl>(*render_frame_host), - std::move(receiver)); + std::make_unique<DirectSocketsServiceImpl>(*frame), std::move(receiver)); +} + +content::DirectSocketsDelegate* DirectSocketsServiceImpl::GetDelegate() { + return GetContentClient()->browser()->GetDirectSocketsDelegate(); } void DirectSocketsServiceImpl::OpenTcpSocket( @@ -92,15 +107,24 @@ mojo::PendingReceiver<network::mojom::TCPConnectedSocket> receiver, mojo::PendingRemote<network::mojom::SocketObserver> observer, OpenTcpSocketCallback callback) { - if (!frame_host_ || frame_host_->GetWebExposedIsolationLevel() < - RenderFrameHost::WebExposedIsolationLevel:: - kMaybeIsolatedApplication) { - mojo::ReportBadMessage("Insufficient isolation to open socket."); + if (!GetNetworkContext()) { + mojo::ReportBadMessage("Invalid request to open socket"); return; } - if (!GetNetworkContext()) { - mojo::ReportBadMessage("Invalid request to open socket"); + if (!IsFrameSufficientlyIsolated(frame_host_)) { + mojo::ReportBadMessage("Insufficient isolation to open socket"); + return; + } + + if (auto* delegate = GetDelegate(); + delegate && + !delegate->ValidateAddressAndPort( + frame_host_, options->remote_hostname, options->remote_port, + blink::mojom::DirectSocketProtocolType::kTcp)) { + std::move(callback).Run(net::ERR_ACCESS_DENIED, absl::nullopt, + absl::nullopt, mojo::ScopedDataPipeConsumerHandle(), + mojo::ScopedDataPipeProducerHandle()); return; } @@ -115,15 +139,23 @@ mojo::PendingReceiver<blink::mojom::DirectUDPSocket> receiver, mojo::PendingRemote<network::mojom::UDPSocketListener> listener, OpenUdpSocketCallback callback) { - if (!frame_host_ || frame_host_->GetWebExposedIsolationLevel() < - RenderFrameHost::WebExposedIsolationLevel:: - kMaybeIsolatedApplication) { - mojo::ReportBadMessage("Insufficient isolation to open socket."); + if (!GetNetworkContext()) { + mojo::ReportBadMessage("Invalid request to open socket"); return; } - if (!GetNetworkContext()) { - mojo::ReportBadMessage("Invalid request to open socket"); + if (!IsFrameSufficientlyIsolated(frame_host_)) { + mojo::ReportBadMessage("Insufficient isolation to open socket"); + return; + } + + if (auto* delegate = GetDelegate(); + delegate && + !delegate->ValidateAddressAndPort( + frame_host_, options->remote_hostname, options->remote_port, + blink::mojom::DirectSocketProtocolType::kUdp)) { + std::move(callback).Run(net::ERR_ACCESS_DENIED, absl::nullopt, + absl::nullopt); return; }
diff --git a/content/browser/direct_sockets/direct_sockets_service_impl.h b/content/browser/direct_sockets/direct_sockets_service_impl.h index 85f782e..133a13a 100644 --- a/content/browser/direct_sockets/direct_sockets_service_impl.h +++ b/content/browser/direct_sockets/direct_sockets_service_impl.h
@@ -12,6 +12,7 @@ #include "base/run_loop.h" #include "content/browser/direct_sockets/direct_udp_socket_impl.h" #include "content/common/content_export.h" +#include "content/public/browser/direct_sockets_delegate.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents_observer.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -37,11 +38,6 @@ : public blink::mojom::DirectSocketsService, public WebContentsObserver { public: - enum class ProtocolType { kTcp, kUdp }; - - using PermissionCallback = base::RepeatingCallback<net::Error( - const blink::mojom::DirectSocketOptions&)>; - explicit DirectSocketsServiceImpl(RenderFrameHost& frame_host); ~DirectSocketsServiceImpl() override; @@ -49,9 +45,11 @@ DirectSocketsServiceImpl& operator=(const DirectSocketsServiceImpl&) = delete; static void CreateForFrame( - RenderFrameHost* render_frame_host, + RenderFrameHost* frame, mojo::PendingReceiver<blink::mojom::DirectSocketsService> receiver); + static content::DirectSocketsDelegate* GetDelegate(); + // blink::mojom::DirectSocketsService override: void OpenTcpSocket( blink::mojom::DirectSocketOptionsPtr options,
diff --git a/content/browser/direct_sockets/direct_sockets_test_utils.cc b/content/browser/direct_sockets/direct_sockets_test_utils.cc index bab5a01e..f09fcf9 100644 --- a/content/browser/direct_sockets/direct_sockets_test_utils.cc +++ b/content/browser/direct_sockets/direct_sockets_test_utils.cc
@@ -209,7 +209,7 @@ return true; } -blink::ParsedPermissionsPolicy +absl::optional<blink::ParsedPermissionsPolicy> IsolatedAppContentBrowserClient::GetPermissionsPolicyForIsolatedApp( content::BrowserContext* browser_context, const url::Origin& app_origin) {
diff --git a/content/browser/direct_sockets/direct_sockets_test_utils.h b/content/browser/direct_sockets/direct_sockets_test_utils.h index 1a5f414..5ba8238 100644 --- a/content/browser/direct_sockets/direct_sockets_test_utils.h +++ b/content/browser/direct_sockets/direct_sockets_test_utils.h
@@ -199,9 +199,9 @@ bool ShouldUrlUseApplicationIsolationLevel(BrowserContext* browser_context, const GURL& url) override; - blink::ParsedPermissionsPolicy GetPermissionsPolicyForIsolatedApp( - content::BrowserContext* browser_context, - const url::Origin& app_origin) override; + absl::optional<blink::ParsedPermissionsPolicy> + GetPermissionsPolicyForIsolatedApp(content::BrowserContext* browser_context, + const url::Origin& app_origin) override; }; } // namespace content::test
diff --git a/content/browser/direct_sockets/resolve_host_and_open_socket.cc b/content/browser/direct_sockets/resolve_host_and_open_socket.cc index 1671db77..c42c111 100644 --- a/content/browser/direct_sockets/resolve_host_and_open_socket.cc +++ b/content/browser/direct_sockets/resolve_host_and_open_socket.cc
@@ -10,6 +10,7 @@ #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "content/browser/direct_sockets/direct_sockets_service_impl.h" +#include "content/public/browser/direct_sockets_delegate.h" #include "net/base/ip_endpoint.h" #include "net/http/http_response_headers.h" #include "net/net_buildflags.h" @@ -80,7 +81,7 @@ DCHECK(!receiver_.is_bound()); DCHECK(!resolver_.is_bound()); - if (net::IPAddress().AssignFromIPLiteral(*options_->remote_hostname)) { + if (net::IPAddress().AssignFromIPLiteral(options_->remote_hostname)) { is_raw_address_ = true; } @@ -90,7 +91,7 @@ network::mojom::ResolveHostParametersPtr parameters = network::mojom::ResolveHostParameters::New(); #if BUILDFLAG(ENABLE_MDNS) - if (ResemblesMulticastDNSName(*options_->remote_hostname)) { + if (ResemblesMulticastDNSName(options_->remote_hostname)) { parameters->source = net::HostResolverSource::MULTICAST_DNS; is_mdns_name_ = true; } @@ -98,7 +99,7 @@ // Intentionally using a HostPortPair because scheme isn't specified. resolver_->ResolveHost( network::mojom::HostResolverHost::NewHostPortPair( - net::HostPortPair(*options_->remote_hostname, options_->remote_port)), + net::HostPortPair(options_->remote_hostname, options_->remote_port)), net::NetworkIsolationKey::CreateTransient(), std::move(parameters), receiver_.BindNewPipeAndPassRemote()); receiver_.set_disconnect_handler( @@ -128,6 +129,23 @@ DCHECK(receiver_.is_bound()); receiver_.reset(); + if (!service_) { + OpenSocket(net::ERR_UNEXPECTED, {}); + return; + } + + auto* frame = service_->GetFrameHost(); + if (!frame) { + OpenSocket(net::ERR_UNEXPECTED, {}); + return; + } + + if (auto* delegate = DirectSocketsServiceImpl::GetDelegate(); + delegate && delegate->ShouldSkipPostResolveChecks(frame)) { + OpenSocket(result, resolved_addresses); + return; + } + // Reject hostnames that resolve to non-public exception unless a raw IP // address or a *.local hostname is entered by the user. if (!is_raw_address_ && !is_mdns_name_ && resolved_addresses && @@ -144,7 +162,7 @@ // Delegates to OpenSocket(...) after the check. // We cannot use the resolved address here since it causes problems // with SSL :( - PerformCORSCheck(*options_->remote_hostname, *resolved_addresses); + PerformCORSCheck(options_->remote_hostname, *resolved_addresses); return; } } @@ -155,16 +173,7 @@ void ResolveHostAndOpenSocket::PerformCORSCheck( const std::string& address, net::AddressList resolved_addresses) { - if (!service_) { - OpenSocket(net::ERR_UNEXPECTED, {}); - return; - } - auto* frame = service_->GetFrameHost(); - if (!frame) { - OpenSocket(net::ERR_UNEXPECTED, {}); - return; - } mojo::Remote<network::mojom::URLLoaderFactory> factory; frame->CreateNetworkServiceDefaultFactory(
diff --git a/content/browser/geolocation/geolocation_service_impl.cc b/content/browser/geolocation/geolocation_service_impl.cc index 5e4cf730..1cfcfe18 100644 --- a/content/browser/geolocation/geolocation_service_impl.cc +++ b/content/browser/geolocation/geolocation_service_impl.cc
@@ -99,9 +99,9 @@ if (permission_status != blink::mojom::PermissionStatus::GRANTED) return; - const auto& origin = - render_frame_host_->GetMainFrame()->GetLastCommittedOrigin(); - geolocation_context_->BindGeolocation(std::move(receiver), origin.GetURL()); + const auto& requesting_url = + render_frame_host_->GetMainFrame()->GetLastCommittedURL(); + geolocation_context_->BindGeolocation(std::move(receiver), requesting_url); } } // namespace content
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index 39446b941..c9ae31db 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -305,7 +305,7 @@ base::FEATURE_DISABLED_BY_DEFAULT #endif }; -} +} // namespace features namespace content { @@ -9174,11 +9174,13 @@ auto isolation_info = GetSiteInstance()->GetWebExposedIsolationInfo(); RenderFrameHostImpl* parent_frame_host = GetParentOrOuterDocument(); - blink::ParsedPermissionsPolicy manifest_policy; + absl::optional<blink::ParsedPermissionsPolicy> manifest_policy; if (!parent_frame_host && isolation_info.is_isolated_application()) { - manifest_policy = - GetContentClient()->browser()->GetPermissionsPolicyForIsolatedApp( - GetBrowserContext(), isolation_info.origin()); + if (auto isolated_app_permissions_policy = + GetContentClient()->browser()->GetPermissionsPolicyForIsolatedApp( + GetBrowserContext(), isolation_info.origin())) { + manifest_policy = std::move(isolated_app_permissions_policy); + } } // TODO(crbug.com/1126305): Once the Prerender2 moves to use the MPArch, we @@ -10431,12 +10433,13 @@ if (!parent_frame_host && isolation_info.is_isolated_application()) { // In Isolated Apps, the top level frame should use the policy declared in // the Web App Manifest. - blink::ParsedPermissionsPolicy manifest_policy = - GetContentClient()->browser()->GetPermissionsPolicyForIsolatedApp( - GetBrowserContext(), isolation_info.origin()); - permissions_policy_ = blink::PermissionsPolicy::CreateFromParsedPolicy( - manifest_policy, last_committed_origin_); - return; + if (auto isolated_app_permissions_policy = + GetContentClient()->browser()->GetPermissionsPolicyForIsolatedApp( + GetBrowserContext(), isolation_info.origin())) { + permissions_policy_ = blink::PermissionsPolicy::CreateFromParsedPolicy( + *isolated_app_permissions_policy, last_committed_origin_); + return; + } } const blink::PermissionsPolicy* parent_policy = @@ -12239,7 +12242,7 @@ blink::mojom::ServiceWorkerContainerInfoForClientPtr container_info, mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, const base::UnguessableToken& devtools_navigation_token) { TRACE_EVENT0("navigation", "RenderFrameHostImpl::SendCommitNavigation");
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index 27116b4..f9be00f 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -105,6 +105,7 @@ #include "third_party/blink/public/common/frame/frame_owner_element_type.h" #include "third_party/blink/public/common/frame/fullscreen_request_token.h" #include "third_party/blink/public/common/permissions_policy/permissions_policy.h" +#include "third_party/blink/public/common/permissions_policy/permissions_policy_declaration.h" #include "third_party/blink/public/common/scheduler/web_scheduler_tracked_feature.h" #include "third_party/blink/public/common/storage_key/storage_key.h" #include "third_party/blink/public/mojom/back_forward_cache_not_restored_reasons.mojom.h" @@ -2587,8 +2588,7 @@ blink::mojom::ServiceWorkerContainerInfoForClientPtr container_info, mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, - const std::vector<blink::ParsedPermissionsPolicyDeclaration>& - permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, const base::UnguessableToken& devtools_navigation_token); virtual void SendCommitFailedNavigation(
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 24a1e12..b9a9aef 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -383,6 +383,13 @@ device_scale_factor_ = GetDeviceScaleFactor(); + // If HiDPI capture mode is active for the parent, propagate the scale + // override to the popup window also. Its content was created assuming + // that the new window will share the parent window's scale. See + // https://crbug.com/1354703 . + SetScaleOverrideForCapture( + popup_parent_host_view_->GetScaleOverrideForCapture()); + auto* cursor_client = aura::client::GetCursorClient(root); if (cursor_client) UpdateSystemCursorSize(cursor_client->GetSystemCursorSize());
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 1773eb6..5583b24d 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -407,6 +407,13 @@ // the white background on popup open when dark color-scheme is used. SetContentBackgroundColor(SK_ColorTRANSPARENT); + // If HiDPI capture mode is active for the parent, propagate the scale + // override to the popup window also. Its content was created assuming + // that the new window will share the parent window's scale. See + // https://crbug.com/1354703 . + scale_override_for_capture_ = + popup_parent_host_view_->GetScaleOverrideForCapture(); + // This path is used by the time/date picker. ns_view_->InitAsPopup(pos, popup_parent_host_view_->ns_view_id_); }
diff --git a/content/browser/service_worker/service_worker_test_utils.cc b/content/browser/service_worker/service_worker_test_utils.cc index e46c97f..0ee9129 100644 --- a/content/browser/service_worker/service_worker_test_utils.cc +++ b/content/browser/service_worker/service_worker_test_utils.cc
@@ -92,7 +92,7 @@ mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, const base::UnguessableToken& devtools_navigation_token, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host, mojom::CookieManagerInfoPtr cookie_manager_info,
diff --git a/content/browser/webid/fedcm_metrics.h b/content/browser/webid/fedcm_metrics.h index 97bcd69..01ee6156 100644 --- a/content/browser/webid/fedcm_metrics.h +++ b/content/browser/webid/fedcm_metrics.h
@@ -52,8 +52,9 @@ kUserInterfaceTimedOut, // obsolete kRpPageNotVisible, kShouldEmbargo, + kNotSignedInWithIdp, - kMaxValue = kShouldEmbargo + kMaxValue = kNotSignedInWithIdp }; // This enum describes whether user sign-in states between IDP and browser
diff --git a/content/browser/webid/federated_auth_request_impl.cc b/content/browser/webid/federated_auth_request_impl.cc index 7f26f3d3..e5b18eb 100644 --- a/content/browser/webid/federated_auth_request_impl.cc +++ b/content/browser/webid/federated_auth_request_impl.cc
@@ -282,6 +282,22 @@ return kMaxRejectionTime * base::RandDouble(); } +bool ShouldFailIfNotSignedInWithIdp( + const GURL& idp_url, + FederatedIdentitySharingPermissionContextDelegate* + sharing_permission_delegate) { + if (!IsFedCmIdpSigninStatusEnabled()) + return false; + + const url::Origin idp_origin = url::Origin::Create(idp_url); + const absl::optional<bool> idp_signin_status = + sharing_permission_delegate->GetIdpSigninStatus(idp_origin); + if (!idp_signin_status.value_or(true)) + return true; + + return false; +} + } // namespace FederatedAuthRequestImpl::IdentityProviderInfo::IdentityProviderInfo() = @@ -449,6 +465,14 @@ return; } + if (ShouldFailIfNotSignedInWithIdp(idp_ptr->config_url, + sharing_permission_delegate_)) { + CompleteRequestWithError(FederatedAuthRequestResult::kError, + TokenStatus::kNotSignedInWithIdp, + /*should_delay_callback=*/true); + return; + } + request_dialog_controller_ = CreateDialogController(); idp_info_[idp_ptr->config_url].provider = *idp_ptr; @@ -718,11 +742,7 @@ weak_ptr_factory_.GetWeakPtr(), idp_info_[idp_info.provider.config_url])); } else { - network_manager_->SendAccountsRequest( - idp_info.endpoints.accounts, idp_info.provider.client_id, - base::BindOnce(&FederatedAuthRequestImpl::OnAccountsResponseReceived, - weak_ptr_factory_.GetWeakPtr(), - idp_info_[idp_info.provider.config_url])); + MaybeFetchAccounts(idp_info); } } @@ -733,6 +753,21 @@ // TODO(yigu): Clean up the client metadata related errors for metrics and // console logs. client_metadata_ = data; + MaybeFetchAccounts(idp_info); +} + +void FederatedAuthRequestImpl::MaybeFetchAccounts( + const IdentityProviderInfo& idp_info) { + // Make sure that we don't fetch accounts if the IDP sign-in bit is reset to + // false during the API call. e.g. by the login/logout HEADER. + if (ShouldFailIfNotSignedInWithIdp(idp_info.provider.config_url, + sharing_permission_delegate_)) { + CompleteRequestWithError(FederatedAuthRequestResult::kError, + TokenStatus::kNotSignedInWithIdp, + /*should_delay_callback=*/true); + return; + } + network_manager_->SendAccountsRequest( idp_info.endpoints.accounts, idp_info.provider.client_id, base::BindOnce(&FederatedAuthRequestImpl::OnAccountsResponseReceived, @@ -740,33 +775,74 @@ idp_info_[idp_info.provider.config_url])); } +void FederatedAuthRequestImpl::HandleAccountsFetchFailure( + const GURL& idp_url, + blink::mojom::FederatedAuthRequestResult result, + absl::optional<TokenStatus> token_status) { + if (!IsFedCmIdpSigninStatusEnabled()) { + CompleteRequestWithError(result, token_status, + /*should_delay_callback=*/true); + return; + } + + const url::Origin idp_origin = url::Origin::Create(idp_url); + const absl::optional<bool> idp_signin_status = + sharing_permission_delegate_->GetIdpSigninStatus(idp_origin); + // Ensures that we only fetch accounts unconditionally once. + if (!idp_signin_status.has_value()) { + sharing_permission_delegate_->SetIdpSigninStatus(idp_origin, false); + CompleteRequestWithError(result, token_status, + /*should_delay_callback=*/true); + return; + } + + sharing_permission_delegate_->SetIdpSigninStatus(idp_origin, false); + // TODO(crbug.com/1357790): we should figure out how to handle multiple IDP + // w.r.t. showing a static failure UI. e.g. one IDP is always successful and + // one always returns 404. + WebContents* rp_web_contents = + WebContents::FromRenderFrameHost(&render_frame_host()); + DCHECK(render_frame_host().GetMainFrame()->IsInPrimaryMainFrame()); + + request_dialog_controller_->ShowFailureDialog( + rp_web_contents, idp_url, + base::BindOnce( + &FederatedAuthRequestImpl::OnDismissFailureDialog, + weak_ptr_factory_.GetWeakPtr(), FederatedAuthRequestResult::kError, + TokenStatus::kNotSignedInWithIdp, /*should_delay_callback=*/true)); +} + void FederatedAuthRequestImpl::OnAccountsResponseReceived( const IdentityProviderInfo& idp_info, IdpNetworkRequestManager::FetchStatus status, IdpNetworkRequestManager::AccountList accounts) { switch (status) { case IdpNetworkRequestManager::FetchStatus::kHttpNotFoundError: { - CompleteRequestWithError( + HandleAccountsFetchFailure( + idp_info.provider.config_url, FederatedAuthRequestResult::kErrorFetchingAccountsHttpNotFound, - TokenStatus::kAccountsHttpNotFound, - /*should_delay_callback=*/true); + TokenStatus::kAccountsHttpNotFound); return; } case IdpNetworkRequestManager::FetchStatus::kNoResponseError: { - CompleteRequestWithError( + HandleAccountsFetchFailure( + idp_info.provider.config_url, FederatedAuthRequestResult::kErrorFetchingAccountsNoResponse, - TokenStatus::kAccountsNoResponse, - /*should_delay_callback=*/true); + TokenStatus::kAccountsNoResponse); return; } case IdpNetworkRequestManager::FetchStatus::kInvalidResponseError: { - CompleteRequestWithError( + HandleAccountsFetchFailure( + idp_info.provider.config_url, FederatedAuthRequestResult::kErrorFetchingAccountsInvalidResponse, - TokenStatus::kAccountsInvalidResponse, - /*should_delay_callback=*/true); + TokenStatus::kAccountsInvalidResponse); return; } case IdpNetworkRequestManager::FetchStatus::kSuccess: { + const url::Origin idp_origin = + url::Origin::Create(idp_info.provider.config_url); + sharing_permission_delegate_->SetIdpSigninStatus(idp_origin, true); + bool is_visible = (render_frame_host().IsActive() && render_frame_host().GetVisibilityState() == content::PageVisibilityState::kVisible); @@ -909,6 +985,14 @@ weak_ptr_factory_.GetWeakPtr(), idp_info.provider)); } +void FederatedAuthRequestImpl::OnDismissFailureDialog( + blink::mojom::FederatedAuthRequestResult result, + absl::optional<TokenStatus> token_status, + bool should_delay_callback, + IdentityRequestDialogController::DismissReason dismiss_reason) { + CompleteRequest(result, token_status, /*token=*/"", should_delay_callback); +} + void FederatedAuthRequestImpl::OnDialogDismissed( IdentityRequestDialogController::DismissReason dismiss_reason) { // Clicking the close button and swiping away the account chooser are more @@ -1078,7 +1162,7 @@ blink::mojom::FederatedAuthRequestResult result, absl::optional<TokenStatus> token_status, bool should_delay_callback) { - CompleteRequest(result, token_status, /*id_token=*/"", should_delay_callback); + CompleteRequest(result, token_status, /*token=*/"", should_delay_callback); } void FederatedAuthRequestImpl::CompleteRequest(
diff --git a/content/browser/webid/federated_auth_request_impl.h b/content/browser/webid/federated_auth_request_impl.h index c96a5c6..f31237d2 100644 --- a/content/browser/webid/federated_auth_request_impl.h +++ b/content/browser/webid/federated_auth_request_impl.h
@@ -129,6 +129,16 @@ IdpNetworkRequestManager::FetchStatus status, IdpNetworkRequestManager::ClientMetadata data); + // Only send accounts fetch request if the user is signed in with the IDP or + // the IDP is used in FedCM for the first time. + void MaybeFetchAccounts(const IdentityProviderInfo& idp_info); + // Updates the IdpSigninStatus in case of accounts fetch failure and shows a + // failure UI if applicable. + void HandleAccountsFetchFailure( + const GURL& idp_url, + blink::mojom::FederatedAuthRequestResult result, + absl::optional<content::FedCmRequestIdTokenStatus> token_status); + void OnAccountsResponseReceived( const IdentityProviderInfo& idp_info, IdpNetworkRequestManager::FetchStatus status, @@ -136,6 +146,11 @@ void OnAccountSelected(const IdentityProviderInfo& idp_info, const std::string& account_id, bool is_sign_in); + void OnDismissFailureDialog( + blink::mojom::FederatedAuthRequestResult result, + absl::optional<content::FedCmRequestIdTokenStatus> token_status, + bool should_delay_callback, + IdentityRequestDialogController::DismissReason dismiss_reason); void OnDialogDismissed( IdentityRequestDialogController::DismissReason dismiss_reason); void CompleteTokenRequest(const blink::mojom::IdentityProvider& idp,
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index 2d4441b..14978833 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -2100,4 +2100,101 @@ EXPECT_EQ(multiple_accounts[2].id, "other_account_id"); } +// Test that first API call with a given IDP is not affected by the +// IdpSigninStatus bit. +TEST_F(FederatedAuthRequestImplTest, IdpSigninStatusTestFirstTimeFetchSuccess) { + base::test::ScopedFeatureList list; + list.InitAndEnableFeatureWithParameters( + features::kFedCm, + {{features::kFedCmIdpSigninStatusFieldTrialParamName, "true"}}); + + EXPECT_CALL(*mock_sharing_permission_delegate_, + SetIdpSigninStatus(OriginFromString(kProviderUrlFull), true)) + .Times(1); + + std::unique_ptr<IdpNetworkRequestManagerParamChecker> checker = + std::make_unique<IdpNetworkRequestManagerParamChecker>(); + checker->SetExpectations( + kDefaultRequestParameters.identity_providers[0].client_id, + kConfigurationValid.accounts[0].id); + SetNetworkRequestManager(std::move(checker)); + + RunAuthTest(kDefaultRequestParameters, kExpectationSuccess, + kConfigurationValid); +} + +// Test that first API call with a given IDP will not show a UI in case of +// failure during fetching accounts. +TEST_F(FederatedAuthRequestImplTest, + IdpSigninStatusTestFirstTimeFetchNoFailureUi) { + base::test::ScopedFeatureList list; + list.InitAndEnableFeatureWithParameters( + features::kFedCm, + {{features::kFedCmIdpSigninStatusFieldTrialParamName, "true"}}); + + EXPECT_CALL(*mock_sharing_permission_delegate_, + SetIdpSigninStatus(OriginFromString(kProviderUrlFull), false)) + .Times(1); + EXPECT_CALL(*mock_dialog_controller_, ShowFailureDialog(_, _, _)).Times(0); + MockConfiguration configuration = kConfigurationValid; + configuration.accounts_response = FetchStatus::kInvalidResponseError; + RequestExpectations expectations = { + RequestTokenStatus::kError, + FederatedAuthRequestResult::kErrorFetchingAccountsInvalidResponse, + FetchedEndpoint::MANIFEST | FetchedEndpoint::CLIENT_METADATA | + FetchedEndpoint::ACCOUNTS | FetchedEndpoint::MANIFEST_LIST}; + RunAuthTest(kDefaultRequestParameters, expectations, configuration); +} + +// Test that a failure UI will be displayed if the accounts fetch is failed but +// the IdpSigninStatus claims that the user is signed in. +TEST_F(FederatedAuthRequestImplTest, IdpSigninStatusTestShowFailureUi) { + base::test::ScopedFeatureList list; + list.InitAndEnableFeatureWithParameters( + features::kFedCm, + {{features::kFedCmIdpSigninStatusFieldTrialParamName, "true"}}); + + EXPECT_CALL(*mock_dialog_controller_, ShowFailureDialog(_, _, _)) + .WillOnce( + Invoke([&](content::WebContents* rp_web_contents, const GURL& idp_url, + IdentityRequestDialogController::DismissCallback + dismiss_callback) { + std::move(dismiss_callback).Run(DismissReason::CLOSE_BUTTON); + })); + + EXPECT_CALL(*mock_sharing_permission_delegate_, + GetIdpSigninStatus(OriginFromString(kProviderUrlFull))) + .WillRepeatedly(Return(true)); + + MockConfiguration configuration = kConfigurationValid; + configuration.accounts_response = FetchStatus::kInvalidResponseError; + RequestExpectations expectations = { + RequestTokenStatus::kError, FederatedAuthRequestResult::kError, + FetchedEndpoint::MANIFEST | FetchedEndpoint::CLIENT_METADATA | + FetchedEndpoint::ACCOUNTS | FetchedEndpoint::MANIFEST_LIST}; + RunAuthTest(kDefaultRequestParameters, expectations, configuration); +} + +// Test that API calls will fail before sending any network request if +// IdpSigninStatus shows that the user is not signed in with the IDP. No failure +// UI is displayed. +TEST_F(FederatedAuthRequestImplTest, + IdpSigninStatusTestApiFailedIfUserNotSignedInWithIdp) { + base::test::ScopedFeatureList list; + list.InitAndEnableFeatureWithParameters( + features::kFedCm, + {{features::kFedCmIdpSigninStatusFieldTrialParamName, "true"}}); + + EXPECT_CALL(*mock_sharing_permission_delegate_, + GetIdpSigninStatus(OriginFromString(kProviderUrlFull))) + .WillOnce(Return(false)); + + EXPECT_CALL(*mock_dialog_controller_, ShowFailureDialog(_, _, _)).Times(0); + MockConfiguration configuration = kConfigurationValid; + RequestExpectations expectations = {RequestTokenStatus::kError, + FederatedAuthRequestResult::kError, + /*fetched_endpoints=*/0}; + RunAuthTest(kDefaultRequestParameters, expectations, configuration); +} + } // namespace content
diff --git a/content/browser/webid/flags.cc b/content/browser/webid/flags.cc index 65beb27..bd9081f 100644 --- a/content/browser/webid/flags.cc +++ b/content/browser/webid/flags.cc
@@ -30,4 +30,10 @@ features::kFedCmMultipleIdentityProviders); } +bool IsFedCmIdpSigninStatusEnabled() { + return GetFieldTrialParamByFeatureAsBool( + features::kFedCm, features::kFedCmIdpSigninStatusFieldTrialParamName, + false); +} + } // namespace content
diff --git a/content/browser/webid/flags.h b/content/browser/webid/flags.h index 67b3613..e4d348b 100644 --- a/content/browser/webid/flags.h +++ b/content/browser/webid/flags.h
@@ -21,6 +21,9 @@ // Whether multiple identity providers are enabled. bool IsFedCmMultipleIdentityProvidersEnabled(); +// Whether IdpSigninStatus is enabled. +bool IsFedCmIdpSigninStatusEnabled(); + } // namespace content #endif // CONTENT_BROWSER_WEBID_FLAGS_H_
diff --git a/content/browser/webid/test/mock_identity_request_dialog_controller.cc b/content/browser/webid/test/mock_identity_request_dialog_controller.cc index 43d1512..c658e429 100644 --- a/content/browser/webid/test/mock_identity_request_dialog_controller.cc +++ b/content/browser/webid/test/mock_identity_request_dialog_controller.cc
@@ -4,8 +4,6 @@ #include "content/browser/webid/test/mock_identity_request_dialog_controller.h" -#include "url/gurl.h" - namespace content { MockIdentityRequestDialogController::MockIdentityRequestDialogController() =
diff --git a/content/browser/webid/test/mock_identity_request_dialog_controller.h b/content/browser/webid/test/mock_identity_request_dialog_controller.h index 2cfc527..b9f6f43 100644 --- a/content/browser/webid/test/mock_identity_request_dialog_controller.h +++ b/content/browser/webid/test/mock_identity_request_dialog_controller.h
@@ -31,6 +31,8 @@ AccountSelectionCallback, DismissCallback)); MOCK_METHOD0(DestructorCalled, void()); + MOCK_METHOD3(ShowFailureDialog, + void(WebContents*, const GURL&, DismissCallback)); }; } // namespace content
diff --git a/content/browser/webid/test/mock_sharing_permission_delegate.h b/content/browser/webid/test/mock_sharing_permission_delegate.h index 64b79e2..8fbeb30 100644 --- a/content/browser/webid/test/mock_sharing_permission_delegate.h +++ b/content/browser/webid/test/mock_sharing_permission_delegate.h
@@ -36,6 +36,8 @@ const url::Origin& identity_provider, const std::string& account_id), (override)); + MOCK_METHOD1(GetIdpSigninStatus, absl::optional<bool>(const url::Origin&)); + MOCK_METHOD2(SetIdpSigninStatus, void(const url::Origin&, bool)); }; } // namespace content
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 954551a..a2e4a00 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -213,6 +213,7 @@ {wf::EnableDevicePosture, features::kDevicePosture}, {wf::EnableDigitalGoodsAPI, features::kDigitalGoodsApi, kSetOnlyIfOverridden}, + {wf::EnableDirectSockets, features::kIsolatedWebApps}, {wf::EnableDocumentPictureInPictureAPI, features::kDocumentPictureInPictureAPI}, {wf::EnableDocumentPolicy, features::kDocumentPolicy}, @@ -607,6 +608,11 @@ false)) { WebRuntimeFeatures::EnableFedCmIframeSupport(true); } + if (base::GetFieldTrialParamByFeatureAsBool( + features::kFedCm, + features::kFedCmIdpSigninStatusFieldTrialParamName, false)) { + WebRuntimeFeatures::EnableFedCmIdpSigninStatus(true); + } } // (b/239679616) kWebGPUService can be controlled by finch. So switching off
diff --git a/content/common/navigation_client.mojom b/content/common/navigation_client.mojom index c55bfc4..7b55318 100644 --- a/content/common/navigation_client.mojom +++ b/content/common/navigation_client.mojom
@@ -259,7 +259,7 @@ blink.mojom.ServiceWorkerContainerInfoForClient? container_info, pending_remote<network.mojom.URLLoaderFactory>? prefetch_loader_factory, mojo_base.mojom.UnguessableToken devtools_navigation_token, - array<blink.mojom.ParsedPermissionsPolicyDeclaration> permissions_policy, + array<blink.mojom.ParsedPermissionsPolicyDeclaration>? permissions_policy, blink.mojom.PolicyContainer policy_container, pending_remote<blink.mojom.CodeCacheHost>? code_cache_host, CookieManagerInfo? cookie_manager_info,
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn index 4449835..fae7d53 100644 --- a/content/public/browser/BUILD.gn +++ b/content/public/browser/BUILD.gn
@@ -616,6 +616,8 @@ if (!is_android) { sources += [ + "direct_sockets_delegate.h", + # Some Web Authentication related targets only apply to desktop because # Android provides its own native implementation of that API. "web_authentication_request_proxy.h",
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 1bf024d..1e6bbfd6 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -248,7 +248,7 @@ return 0; } -blink::ParsedPermissionsPolicy +absl::optional<blink::ParsedPermissionsPolicy> ContentBrowserClient::GetPermissionsPolicyForIsolatedApp( content::BrowserContext* browser_context, const url::Origin& app_origin) { @@ -639,6 +639,12 @@ return nullptr; } +#if !BUILDFLAG(IS_ANDROID) +DirectSocketsDelegate* ContentBrowserClient::GetDirectSocketsDelegate() { + return nullptr; +} +#endif + base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() { return base::FilePath(); } @@ -1344,14 +1350,6 @@ return nullptr; } -void ContentBrowserClient::ShowDirectSocketsConnectionDialog( - content::RenderFrameHost* owner, - const std::string& address, - base::OnceCallback<void(bool, const std::string&, const std::string&)> - callback) { - std::move(callback).Run(false, std::string(), std::string()); -} - bool ContentBrowserClient::IsFindInPageDisabledForOrigin( const url::Origin& origin) { return false;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index cf95c5d..b4d22a8 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -203,6 +203,7 @@ class ClientCertificateDelegate; class ControllerPresentationServiceDelegate; class DevToolsManagerDelegate; +class DirectSocketsDelegate; class DocumentOverlayWindow; class DocumentPictureInPictureWindowController; class FeatureObserverClient; @@ -538,10 +539,12 @@ virtual size_t GetProcessCountToIgnoreForLimit(); // Returns the base permissions policy that is declared in an isolated app's - // Web App Manifest. - virtual blink::ParsedPermissionsPolicy GetPermissionsPolicyForIsolatedApp( - content::BrowserContext* browser_context, - const url::Origin& app_origin); + // Web App Manifest. The embedder might choose to return an absl::nullopt in + // specific cases -- then the default non-isolated permissions policy will be + // applied. + virtual absl::optional<blink::ParsedPermissionsPolicy> + GetPermissionsPolicyForIsolatedApp(content::BrowserContext* browser_context, + const url::Origin& app_origin); // Returns whether a new process should be created or an existing one should // be reused based on the URL we want to load. This should return false, @@ -1022,6 +1025,12 @@ // Allows the embedder to return a TTS platform implementation. virtual TtsPlatform* GetTtsPlatform(); +#if !BUILDFLAG(IS_ANDROID) + // Allows the embedder to return a DirectSocketsDelegate + // implementation. + virtual DirectSocketsDelegate* GetDirectSocketsDelegate(); +#endif + // Called by WebContents to override the WebKit preferences that are used by // the renderer. The content layer will add its own settings, and then it's up // to the embedder to update it if it wants. @@ -2251,17 +2260,6 @@ virtual std::unique_ptr<PrefetchServiceDelegate> CreatePrefetchServiceDelegate(BrowserContext* browser_context); - // Allows the embedder to show a dialog that will be used to control whether a - // connection through the Direct Sockets API is permitted. If the connection - // is permitted, the remote address and port that the user input will be sent - // back to the caller through callback. - virtual void ShowDirectSocketsConnectionDialog( - RenderFrameHost* owner, - const std::string& address, - base::OnceCallback<void(bool accepted, - const std::string& address, - const std::string& port)> callback); - // Returns true if find-in-page should be disabled for a given `origin`. virtual bool IsFindInPageDisabledForOrigin(const url::Origin& origin);
diff --git a/content/public/browser/direct_sockets_delegate.h b/content/public/browser/direct_sockets_delegate.h new file mode 100644 index 0000000..f6beaf9 --- /dev/null +++ b/content/public/browser/direct_sockets_delegate.h
@@ -0,0 +1,38 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_BROWSER_DIRECT_SOCKETS_DELEGATE_H_ +#define CONTENT_PUBLIC_BROWSER_DIRECT_SOCKETS_DELEGATE_H_ + +#include <cstdint> +#include <string> + +#include "content/common/content_export.h" +#include "third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom-shared.h" + +namespace content { + +class RenderFrameHost; + +// Allows the embedder to alter the logic of some operations in +// content::DirectSocketsServiceImpl. +class CONTENT_EXPORT DirectSocketsDelegate { + public: + virtual ~DirectSocketsDelegate() = default; + + // Allows embedders to introduce additional rules for specific + // addresses/ports. + virtual bool ValidateAddressAndPort( + content::RenderFrameHost*, + const std::string& address, + uint16_t port, + blink::mojom::DirectSocketProtocolType) const = 0; + + // If yes, skips post-resolve checks for Direct TCP/UDP sockets. + virtual bool ShouldSkipPostResolveChecks(content::RenderFrameHost*) const = 0; +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_BROWSER_DIRECT_SOCKETS_DELEGATE_H_
diff --git a/content/public/browser/federated_identity_sharing_permission_context_delegate.h b/content/public/browser/federated_identity_sharing_permission_context_delegate.h index a0e27edb..a1aab5eb 100644 --- a/content/public/browser/federated_identity_sharing_permission_context_delegate.h +++ b/content/public/browser/federated_identity_sharing_permission_context_delegate.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_PUBLIC_BROWSER_FEDERATED_IDENTITY_SHARING_PERMISSION_CONTEXT_DELEGATE_H_ #define CONTENT_PUBLIC_BROWSER_FEDERATED_IDENTITY_SHARING_PERMISSION_CONTEXT_DELEGATE_H_ +#include "third_party/abseil-cpp/absl/types/optional.h" #include "url/origin.h" namespace content { @@ -32,6 +33,17 @@ const url::Origin& relying_party_embedder, const url::Origin& identity_provider, const std::string& account_id) = 0; + + // Returns whether the user is signed in with the IDP. If unknown, return + // absl::nullopt. + virtual absl::optional<bool> GetIdpSigninStatus( + const url::Origin& idp_origin) = 0; + + // Updates the IDP sign-in status. This could be called by + // 1. IdpSigninStatus API + // 2. fetching accounts response callback + virtual void SetIdpSigninStatus(const url::Origin& idp_origin, + bool idp_signin_status) = 0; }; } // namespace content
diff --git a/content/public/browser/identity_request_dialog_controller.cc b/content/public/browser/identity_request_dialog_controller.cc index 3d3678c3..169bbf1 100644 --- a/content/public/browser/identity_request_dialog_controller.cc +++ b/content/public/browser/identity_request_dialog_controller.cc
@@ -74,7 +74,7 @@ } void IdentityRequestDialogController::ShowAccountsDialog( - content::WebContents* rp_web_contents, + WebContents* rp_web_contents, const std::vector<IdentityProviderData>& identity_provider_data, IdentityRequestAccount::SignInMode sign_in_mode, AccountSelectionCallback on_selected, @@ -82,4 +82,11 @@ std::move(dismiss_callback).Run(DismissReason::OTHER); } +void IdentityRequestDialogController::ShowFailureDialog( + WebContents* rp_web_contents, + const GURL& idp_for_display, + DismissCallback dismiss_callback) { + std::move(dismiss_callback).Run(DismissReason::OTHER); +} + } // namespace content
diff --git a/content/public/browser/identity_request_dialog_controller.h b/content/public/browser/identity_request_dialog_controller.h index b0e4d9f3..8a46355 100644 --- a/content/public/browser/identity_request_dialog_controller.h +++ b/content/public/browser/identity_request_dialog_controller.h
@@ -143,11 +143,18 @@ // is called with the selected account id or empty string otherwise. // |sign_in_mode| represents whether this is an auto sign in flow. virtual void ShowAccountsDialog( - content::WebContents* rp_web_contents, + WebContents* rp_web_contents, const std::vector<IdentityProviderData>& identity_provider_data, IdentityRequestAccount::SignInMode sign_in_mode, AccountSelectionCallback on_selected, DismissCallback dismiss_callback); + + // Shows a failure UI when the accounts fetch is failed such that it is + // observable by users. This could happen when an IDP claims that the user is + // signed in but not respond with any user account during browser fetches. + virtual void ShowFailureDialog(WebContents* rp_web_contents, + const GURL& idp_for_display, + DismissCallback dismiss_callback); }; } // namespace content
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index ccde765..26883bb 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -354,6 +354,10 @@ const base::Feature kFedCmMultipleIdentityProviders{ "FedCmMultipleIdentityProviders", base::FEATURE_DISABLED_BY_DEFAULT}; +// Field trial boolean parameter which indicates whether IdpSigninStatus API is +// used in FedCM API. +const char kFedCmIdpSigninStatusFieldTrialParamName[] = "IdpSigninStatus"; + // Enables usage of First Party Sets to determine cookie availability. constexpr base::Feature kFirstPartySets{"FirstPartySets", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 00eb05a..305a739 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -90,6 +90,7 @@ CONTENT_EXPORT extern const char kFedCmAutoSigninFieldTrialParamName[]; CONTENT_EXPORT extern const char kFedCmIdpSignoutFieldTrialParamName[]; CONTENT_EXPORT extern const char kFedCmIframeSupportFieldTrialParamName[]; +CONTENT_EXPORT extern const char kFedCmIdpSigninStatusFieldTrialParamName[]; CONTENT_EXPORT extern const base::Feature kFedCmManifestValidation; CONTENT_EXPORT extern const base::Feature kFedCmMultipleIdentityProviders; CONTENT_EXPORT extern const base::Feature kFirstPartySets;
diff --git a/content/renderer/navigation_client.cc b/content/renderer/navigation_client.cc index c8d1327..553dab4 100644 --- a/content/renderer/navigation_client.cc +++ b/content/renderer/navigation_client.cc
@@ -38,7 +38,7 @@ mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, const base::UnguessableToken& devtools_navigation_token, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host, mojom::CookieManagerInfoPtr cookie_manager_info,
diff --git a/content/renderer/navigation_client.h b/content/renderer/navigation_client.h index 0d5d7e7aa..7da0d22 100644 --- a/content/renderer/navigation_client.h +++ b/content/renderer/navigation_client.h
@@ -38,7 +38,7 @@ mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, const base::UnguessableToken& devtools_navigation_token, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host, mojom::CookieManagerInfoPtr cookie_manager_info,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 51ce1b7..544b62e 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -2569,7 +2569,7 @@ mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, const base::UnguessableToken& devtools_navigation_token, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host, mojom::CookieManagerInfoPtr cookie_manager_info, @@ -2612,7 +2612,9 @@ navigation_params.get()); navigation_params->policy_container = ToWebPolicyContainer(std::move(policy_container)); - if (blink::IsIsolatedApplication() && frame_->IsOutermostMainFrame()) { + + if (blink::IsIsolatedApplication() && frame_->IsOutermostMainFrame() && + permissions_policy) { navigation_params->permissions_policy_override = permissions_policy; }
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 1e00126..45c7855 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -148,7 +148,7 @@ namespace url { class Origin; class SchemeHostPort; -} +} // namespace url namespace content { @@ -441,7 +441,7 @@ mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, const base::UnguessableToken& devtools_navigation_token, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host, mojom::CookieManagerInfoPtr cookie_manager_info, @@ -1292,17 +1292,19 @@ // 1.) RenderFrameHostImpl::BeginNavigation() accepts an always-bound remote // to the RenderFrameImpl's `navigation_client_impl_`. // 2.) In `NavigationRequest::ctor()`, the request consumes the - // NavigationClient remote, and `NavigationRequest::SetNavigationClient()` - // assigns `NavigationRequest::request_navigation_client_` to it. - // 3.) Eventually, `NavigationRequest` picks a `RenderFrameHostImpl` to commit + // NavigationClient remote, and + // `NavigationRequest::SetNavigationClient()` assigns + // `NavigationRequest::request_navigation_client_` to it. + // 3.) Eventually, `NavigationRequest` picks a `RenderFrameHostImpl` to + // commit // to. In `NavigationRequest::CommitNavigation()`, the request needs to // set its `commit_navigation_client_` to the `NavigationClient` // implementation in the target RenderFrameImpl. If we detect that the // navigation will commit to the same frame that // `NavigationRequest::request_navigation_client_` points to, then the // browser will reuse the request navigation client as the commit one. - // Otherwise, it requests a *new* client from the renderer, to act as the - // target RenderFrameImpl's `NavigationClient`. + // Otherwise, it requests a *new* client from the renderer, to act as + // the target RenderFrameImpl's `NavigationClient`. // // ## Navigation Cancellation ## // Cancellation is signalled by closing the NavigationClient message pipe.
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc index 028c4c2..e5155ef 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc
@@ -760,14 +760,14 @@ } } -blink::ParsedPermissionsPolicy +absl::optional<blink::ParsedPermissionsPolicy> ShellContentBrowserClient::GetPermissionsPolicyForIsolatedApp( content::BrowserContext* browser_context, const url::Origin& app_origin) { blink::ParsedPermissionsPolicyDeclaration decl( blink::mojom::PermissionsPolicyFeature::kDirectSockets, {app_origin}, /*matches_all_origins=*/false, /*matches_opaque_src=*/false); - return {decl}; + return {{decl}}; } } // namespace content
diff --git a/content/shell/browser/shell_content_browser_client.h b/content/shell/browser/shell_content_browser_client.h index 45526bf..2946babd 100644 --- a/content/shell/browser/shell_content_browser_client.h +++ b/content/shell/browser/shell_content_browser_client.h
@@ -142,9 +142,9 @@ // Turns on features via permissions policy for Isolated App // Web Platform Tests. - blink::ParsedPermissionsPolicy GetPermissionsPolicyForIsolatedApp( - content::BrowserContext* browser_context, - const url::Origin& app_origin) override; + absl::optional<blink::ParsedPermissionsPolicy> + GetPermissionsPolicyForIsolatedApp(content::BrowserContext* browser_context, + const url::Origin& app_origin) override; void CreateFeatureListAndFieldTrials();
diff --git a/content/shell/browser/shell_federated_permission_context.cc b/content/shell/browser/shell_federated_permission_context.cc index 10422fe..36e6cffe 100644 --- a/content/shell/browser/shell_federated_permission_context.cc +++ b/content/shell/browser/shell_federated_permission_context.cc
@@ -28,6 +28,23 @@ void ShellFederatedPermissionContext::RemoveEmbargoAndResetCounts( const url::Origin& relying_party_embedder) {} +absl::optional<bool> ShellFederatedPermissionContext::GetIdpSigninStatus( + const url::Origin& idp_origin) { + auto idp_signin_status = idp_signin_status_.find(idp_origin.Serialize()); + if (idp_signin_status != idp_signin_status_.end()) { + return idp_signin_status->second; + } else { + return absl::nullopt; + } +} + +void ShellFederatedPermissionContext::SetIdpSigninStatus( + const url::Origin& idp_origin, + bool idp_signin_status) { + idp_signin_status_.insert( + std::pair(idp_origin.Serialize(), idp_signin_status)); +} + bool ShellFederatedPermissionContext::HasSharingPermission( const url::Origin& relying_party_requester, const url::Origin& relying_party_embedder,
diff --git a/content/shell/browser/shell_federated_permission_context.h b/content/shell/browser/shell_federated_permission_context.h index c6f5e54..5fcfd6d5f 100644 --- a/content/shell/browser/shell_federated_permission_context.h +++ b/content/shell/browser/shell_federated_permission_context.h
@@ -5,6 +5,7 @@ #ifndef CONTENT_SHELL_BROWSER_SHELL_FEDERATED_PERMISSION_CONTEXT_H_ #define CONTENT_SHELL_BROWSER_SHELL_FEDERATED_PERMISSION_CONTEXT_H_ +#include <map> #include <set> #include <string> #include <tuple> @@ -33,6 +34,10 @@ const url::Origin& relying_party_embedder) override; void RemoveEmbargoAndResetCounts( const url::Origin& relying_party_embedder) override; + absl::optional<bool> GetIdpSigninStatus( + const url::Origin& idp_origin) override; + void SetIdpSigninStatus(const url::Origin& idp_origin, + bool idp_signin_status) override; // FederatedIdentitySharingPermissionContextDelegate bool HasSharingPermission(const url::Origin& relying_party_requester, @@ -65,6 +70,8 @@ sharing_permissions_; // Tuples of <RP requester, IDP, Account> std::set<std::tuple<std::string, std::string, std::string>> active_sessions_; + // Map of <IDP, IDPSigninStatus> + std::map<std::string, absl::optional<bool>> idp_signin_status_; }; } // namespace content
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc index cf18dcfa..c079fb9 100644 --- a/content/test/test_render_frame_host.cc +++ b/content/test/test_render_frame_host.cc
@@ -586,7 +586,7 @@ blink::mojom::ServiceWorkerContainerInfoForClientPtr container_info, mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, const base::UnguessableToken& devtools_navigation_token) { CHECK(navigation_client);
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h index 46bb150..8c73ed6 100644 --- a/content/test/test_render_frame_host.h +++ b/content/test/test_render_frame_host.h
@@ -267,7 +267,7 @@ blink::mojom::ServiceWorkerContainerInfoForClientPtr container_info, mojo::PendingRemote<network::mojom::URLLoaderFactory> prefetch_loader_factory, - const blink::ParsedPermissionsPolicy& permissions_policy, + const absl::optional<blink::ParsedPermissionsPolicy>& permissions_policy, blink::mojom::PolicyContainerPtr policy_container, const base::UnguessableToken& devtools_navigation_token) override; void SendCommitFailedNavigation(
diff --git a/device/bluetooth/floss/floss_adapter_client.cc b/device/bluetooth/floss/floss_adapter_client.cc index 42c058a..61553a4 100644 --- a/device/bluetooth/floss/floss_adapter_client.cc +++ b/device/bluetooth/floss/floss_adapter_client.cc
@@ -169,25 +169,6 @@ return; } - dbus::MethodCall mc_get_address(kAdapterInterface, adapter::kGetAddress); - object_proxy->CallMethodWithErrorResponse( - &mc_get_address, kDBusTimeoutMs, - base::BindOnce(&FlossAdapterClient::HandleGetAddress, - weak_ptr_factory_.GetWeakPtr())); - - dbus::MethodCall mc_get_name(kAdapterInterface, adapter::kGetName); - object_proxy->CallMethodWithErrorResponse( - &mc_get_name, kDBusTimeoutMs, - base::BindOnce(&FlossAdapterClient::HandleGetName, - weak_ptr_factory_.GetWeakPtr())); - - dbus::MethodCall mc_get_discoverable(kAdapterInterface, - adapter::kGetDiscoverable); - object_proxy->CallMethodWithErrorResponse( - &mc_get_discoverable, kDBusTimeoutMs, - base::BindOnce(&FlossAdapterClient::HandleGetDiscoverable, - weak_ptr_factory_.GetWeakPtr())); - dbus::ExportedObject* callbacks = bus_->GetExportedObject(dbus::ObjectPath(kExportedCallbacksPath)); if (!callbacks) { @@ -203,24 +184,6 @@ base::BindOnce(&HandleExported, adapter::kOnAdapterPropertyChanged)); callbacks->ExportMethod( - adapter::kCallbackInterface, adapter::kOnAddressChanged, - base::BindRepeating(&FlossAdapterClient::OnAddressChanged, - weak_ptr_factory_.GetWeakPtr()), - base::BindOnce(&HandleExported, adapter::kOnAddressChanged)); - - callbacks->ExportMethod( - adapter::kCallbackInterface, adapter::kOnNameChanged, - base::BindRepeating(&FlossAdapterClient::OnNameChanged, - weak_ptr_factory_.GetWeakPtr()), - base::BindOnce(&HandleExported, adapter::kOnNameChanged)); - - callbacks->ExportMethod( - adapter::kCallbackInterface, adapter::kOnDiscoverableChanged, - base::BindRepeating(&FlossAdapterClient::OnDiscoverableChanged, - weak_ptr_factory_.GetWeakPtr()), - base::BindOnce(&HandleExported, adapter::kOnDiscoverableChanged)); - - callbacks->ExportMethod( adapter::kCallbackInterface, adapter::kOnDeviceFound, base::BindRepeating(&FlossAdapterClient::OnDeviceFound, weak_ptr_factory_.GetWeakPtr()), @@ -262,6 +225,23 @@ weak_ptr_factory_.GetWeakPtr()), base::BindOnce(&HandleExported, adapter::kOnDeviceDisconnected)); + property_address_.Init( + this, bus_, service_name_, adapter_path_, + dbus::ObjectPath(kExportedCallbacksPath), + base::BindRepeating(&FlossAdapterClient::OnAddressChanged, + weak_ptr_factory_.GetWeakPtr())); + + property_name_.Init(this, bus_, service_name_, adapter_path_, + dbus::ObjectPath(kExportedCallbacksPath), + base::BindRepeating(&FlossAdapterClient::OnNameChanged, + weak_ptr_factory_.GetWeakPtr())); + + property_discoverable_.Init( + this, bus_, service_name_, adapter_path_, + dbus::ObjectPath(kExportedCallbacksPath), + base::BindRepeating(&FlossAdapterClient::OnDiscoverableChanged, + weak_ptr_factory_.GetWeakPtr())); + dbus::MethodCall register_callback(kAdapterInterface, adapter::kRegisterCallback); @@ -311,117 +291,21 @@ std::move(response_sender).Run(dbus::Response::FromMethodCall(method_call)); } -void FlossAdapterClient::HandleGetAddress(dbus::Response* response, - dbus::ErrorResponse* error_response) { - if (!response) { - LogErrorResponse("FlossAdapterClient::HandleGetAddress", error_response); - return; - } - - dbus::MessageReader msg(response); - std::string address; - - if (msg.PopString(&address)) { - adapter_address_ = address; - for (auto& observer : observers_) { - observer.AdapterAddressChanged(adapter_address_); - } - } -} - -void FlossAdapterClient::OnAddressChanged( - dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender response_sender) { - dbus::MessageReader msg(method_call); - std::string address; - - if (!msg.PopString(&address)) { - std::move(response_sender) - .Run(dbus::ErrorResponse::FromMethodCall( - method_call, kErrorInvalidParameters, std::string())); - return; - } - - adapter_address_ = address; +void FlossAdapterClient::OnAddressChanged(const std::string& address) { + VLOG(1) << "Adapter address updated to " << address; for (auto& observer : observers_) { - observer.AdapterAddressChanged(adapter_address_); - } - - std::move(response_sender).Run(dbus::Response::FromMethodCall(method_call)); -} - -void FlossAdapterClient::HandleGetName(dbus::Response* response, - dbus::ErrorResponse* error_response) { - if (!response) { - LogErrorResponse("FlossAdapterClient::HandleGetName", error_response); - return; - } - - dbus::MessageReader msg(response); - std::string name; - - if (msg.PopString(&name)) { - adapter_name_ = name; + observer.AdapterAddressChanged(address); } } -void FlossAdapterClient::OnNameChanged( - dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender response_sender) { - dbus::MessageReader msg(method_call); - std::string name; - - if (!msg.PopString(&name)) { - std::move(response_sender) - .Run(dbus::ErrorResponse::FromMethodCall( - method_call, kErrorInvalidParameters, std::string())); - return; - } - - adapter_name_ = name; - - std::move(response_sender).Run(dbus::Response::FromMethodCall(method_call)); +void FlossAdapterClient::OnNameChanged(const std::string& name) { + VLOG(1) << "Adapter name updated to " << name; } -void FlossAdapterClient::HandleGetDiscoverable( - dbus::Response* response, - dbus::ErrorResponse* error_response) { - if (!response) { - LogErrorResponse("FlossAdapterClient::HandleGetDiscoverable", - error_response); - return; - } - - dbus::MessageReader reader(response); - bool discoverable; - - if (ReadAllDBusParams(&reader, &discoverable)) { - adapter_discoverable_ = discoverable; - for (auto& observer : observers_) { - observer.DiscoverableChanged(adapter_discoverable_); - } - } -} - -void FlossAdapterClient::OnDiscoverableChanged( - dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender response_sender) { - dbus::MessageReader reader(method_call); - bool discoverable; - - if (!ReadAllDBusParams(&reader, &discoverable)) { - std::move(response_sender) - .Run(dbus::ErrorResponse::FromMethodCall( - method_call, kErrorInvalidParameters, std::string())); - return; - } - - adapter_discoverable_ = discoverable; +void FlossAdapterClient::OnDiscoverableChanged(const bool& discoverable) { for (auto& observer : observers_) { - observer.DiscoverableChanged(adapter_discoverable_); + observer.DiscoverableChanged(discoverable); } - - std::move(response_sender).Run(dbus::Response::FromMethodCall(method_call)); } void FlossAdapterClient::OnDiscoveringChanged(
diff --git a/device/bluetooth/floss/floss_adapter_client.h b/device/bluetooth/floss/floss_adapter_client.h index fcaa173..af0bb8f 100644 --- a/device/bluetooth/floss/floss_adapter_client.h +++ b/device/bluetooth/floss/floss_adapter_client.h
@@ -148,17 +148,17 @@ void RemoveObserver(Observer* observer); // Get the address of this adapter. - const std::string& GetAddress() const { return adapter_address_; } + const std::string& GetAddress() const { return property_address_.Get(); } // Get the name of this adapter. - const std::string& GetName() const { return adapter_name_; } + const std::string& GetName() const { return property_name_.Get(); } // Set the name of this adapter. virtual void SetName(ResponseCallback<Void> callback, const std::string& name); // Get whether adapter is discoverable. - bool GetDiscoverable() const { return adapter_discoverable_; } + bool GetDiscoverable() const { return property_discoverable_.Get(); } // Set whether adapter is discoverable. virtual void SetDiscoverable(ResponseCallback<Void> callback, @@ -248,35 +248,19 @@ protected: friend class FlossAdapterClientTest; - // Handle response to |GetAddress| DBus method call. - void HandleGetAddress(dbus::Response* response, - dbus::ErrorResponse* error_response); - // Handle callback |OnAdapterPropertyChanged| on exported object path. void OnAdapterPropertyChanged( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender); - // Handle callback |OnAddressChanged| on exported object path. - void OnAddressChanged(dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender response_sender); + // When address property is updated. + void OnAddressChanged(const std::string& address); - // Handle response to |GetName| DBus method call. - void HandleGetName(dbus::Response* response, - dbus::ErrorResponse* error_response); + // When name property is updated. + void OnNameChanged(const std::string& name); - // Handle callback |OnNameChanged| on exported object path. - void OnNameChanged(dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender response_sender); - - // Handle response to |GetDiscoverable| DBus method call. - void HandleGetDiscoverable(dbus::Response* response, - dbus::ErrorResponse* error_response); - - // Handle callback |OnDiscoverableChanged| on exported object path. - void OnDiscoverableChanged( - dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender response_sender); + // When discoverable property is updated. + void OnDiscoverableChanged(const bool& discoverable); // Handle callback |OnDiscoveringChanged| on exported object path. void OnDiscoveringChanged( @@ -326,15 +310,6 @@ // Service which implements the adapter interface. std::string service_name_; - // Address of adapter. - std::string adapter_address_; - - // Name of adapter. - std::string adapter_name_; - - // Whether adapter is discoverable. - bool adapter_discoverable_; - private: FRIEND_TEST_ALL_PREFIXES(FlossAdapterClientTest, CallAdapterMethods); @@ -346,6 +321,18 @@ adapter_path_, member, args...); } + FlossProperty<std::string> property_address_{ + kAdapterInterface, adapter::kCallbackInterface, adapter::kGetAddress, + adapter::kOnAddressChanged}; + + FlossProperty<std::string> property_name_{ + kAdapterInterface, adapter::kCallbackInterface, adapter::kGetName, + adapter::kOnNameChanged}; + + FlossProperty<bool> property_discoverable_{ + kAdapterInterface, adapter::kCallbackInterface, adapter::kGetDiscoverable, + adapter::kOnDiscoverableChanged}; + // Object path for exported callbacks registered against adapter interface. static const char kExportedCallbacksPath[];
diff --git a/device/bluetooth/floss/floss_dbus_client.h b/device/bluetooth/floss/floss_dbus_client.h index 1c54f7fb..fd2ec98d 100644 --- a/device/bluetooth/floss/floss_dbus_client.h +++ b/device/bluetooth/floss/floss_dbus_client.h
@@ -13,6 +13,7 @@ #include "base/logging.h" #include "base/types/expected.h" #include "dbus/bus.h" +#include "dbus/exported_object.h" #include "dbus/message.h" #include "dbus/object_proxy.h" #include "device/bluetooth/bluetooth_device.h" @@ -610,6 +611,127 @@ dbus::ErrorResponse* error_response); }; +// Utility to keep a property that takes care of getting the initial value, +// monitoring for updates, and notifying when value is updated. +// +// In Floss API, it is a pattern to abstract a value as a "property". These +// values always have: +// * A getter: A method exposed by Floss daemon to get current value. +// * An update callback: A method to be called by Floss daemon to client when +// the value is updated. +// +// To simplify repetitive code performing common operations above, use this +// utility by just specifying the property getter, update method, and the +// interface names. +// +// |T| is the type of the property. +template <typename T> +class FlossProperty { + public: + // Instantiates a property, given: + // |interface| - The D-Bus interface of the getter. + // |callback_interface| - The D-Bus interface of the value update method. + // |getter| - The method name of the getter. + // |on_update| - The method name of the value update. + FlossProperty(const char* interface, + const char* callback_interface, + const char* getter, + const char* on_update) + : interface_(interface), + callback_interface_(callback_interface), + getter_(getter), + on_update_(on_update) {} + + // Initializes the property. Once Init-ed, it takes care of getting the + // initial value, keeping it updated, notifying when there is an update. + // |bus| - D-Bus connection. + // |service_name| - Floss daemon D-Bus name. + // |path| - Object path where the getter is available. + // |callback_path| - Object path where the daemon calls back on value updates. + // |update_callback| - Caller can provide this to be notified when there are + // updates. + void Init(FlossDBusClient* client, + raw_ptr<dbus::Bus> bus, + const std::string& service_name, + const dbus::ObjectPath& path, + const dbus::ObjectPath& callback_path, + base::RepeatingCallback<void(const T&)> update_callback) { + update_callback_ = update_callback; + + // Get the initial value. + client->CallMethod(base::BindOnce(&FlossProperty::OnGetInitialValue, + weak_ptr_factory_.GetWeakPtr()), + bus, service_name, interface_, path, getter_); + + // Listen for property updates. + dbus::ExportedObject* exported_object = + bus->GetExportedObject(callback_path); + if (!exported_object) { + LOG(ERROR) << "Could not export callback to listen for property updates" + << callback_path.value(); + return; + } + + exported_object->ExportMethod( + callback_interface_, on_update_, + base::BindRepeating(&FlossProperty::OnValueUpdated, + weak_ptr_factory_.GetWeakPtr()), + base::DoNothing()); + } + + // Returns the current value of this property. + const T& Get() const { return value_; } + + private: + void OnGetInitialValue(DBusResult<T> ret) { + if (!ret.has_value()) { + LOG(ERROR) << "Error getting initial value"; + return; + } + + UpdateValue(std::move(*ret)); + } + + void OnValueUpdated(dbus::MethodCall* method_call, + dbus::ExportedObject::ResponseSender response_sender) { + T data; + dbus::MessageReader reader(method_call); + if (!FlossDBusClient::ReadDBusParam(&reader, &data)) { + std::move(response_sender) + .Run(dbus::ErrorResponse::FromMethodCall( + method_call, floss::FlossDBusClient::kErrorInvalidParameters, + "Error parsing property value")); + return; + } + + UpdateValue(std::move(data)); + + std::move(response_sender).Run(dbus::Response::FromMethodCall(method_call)); + } + + void UpdateValue(T val) { + value_ = std::move(val); + update_callback_.Run(value_); + } + + // Interfaces. + const char* interface_; + const char* callback_interface_; + + // Method names. + const char* getter_; + const char* on_update_; + + // Keeps the property value. + T value_; + + // To update caller when property is updated. + base::RepeatingCallback<void(const T&)> update_callback_; + + // WeakPtrFactory must be last. + base::WeakPtrFactory<FlossProperty> weak_ptr_factory_{this}; +}; + } // namespace floss #endif // DEVICE_BLUETOOTH_FLOSS_FLOSS_DBUS_CLIENT_H_
diff --git a/docs/telemetry_extension/README.md b/docs/telemetry_extension/README.md index 641c239..8e4a9f6e 100644 --- a/docs/telemetry_extension/README.md +++ b/docs/telemetry_extension/README.md
@@ -247,8 +247,8 @@ Q: I found a bug, how do I report it?<br> A: Thank you for your contribution. Please create a new bug with the description and logs (if possible) on our -[bugtracker](https://b.corp.google.com/components/1225577). You need a partner -account to do that. +[bugtracker](https://partnerissuetracker.corp.google.com/issues/new?component=1225577&template=1725782). +You need a partner account to do that. Q: Have a question?<br> A: Please reach out to cros-oem-services-team@google.com.
diff --git a/extensions/browser/api/alarms/alarms_api.cc b/extensions/browser/api/alarms/alarms_api.cc index ce4dc5eb..9497724 100644 --- a/extensions/browser/api/alarms/alarms_api.cc +++ b/extensions/browser/api/alarms/alarms_api.cc
@@ -39,8 +39,9 @@ *error = kBothRelativeAndAbsoluteTime; return false; } - if (create_info.delay_in_minutes == NULL && create_info.when == NULL && - create_info.period_in_minutes == NULL) { + if (!create_info.delay_in_minutes.has_value() && + !create_info.when.has_value() && + !create_info.period_in_minutes.has_value()) { *error = kNoScheduledTime; return false; }
diff --git a/extensions/browser/api/declarative_net_request/flat_ruleset_indexer_unittest.cc b/extensions/browser/api/declarative_net_request/flat_ruleset_indexer_unittest.cc index 16e9649b6..ecfa9100 100644 --- a/extensions/browser/api/declarative_net_request/flat_ruleset_indexer_unittest.cc +++ b/extensions/browser/api/declarative_net_request/flat_ruleset_indexer_unittest.cc
@@ -88,7 +88,7 @@ } // Helper to create a generic URLTransform. -std::unique_ptr<dnr_api::URLTransform> CreateUrlTransform() { +dnr_api::URLTransform CreateUrlTransform() { const char* transform = R"( { "scheme" : "http", @@ -116,7 +116,7 @@ auto result = dnr_api::URLTransform::FromValue(*value, &error); CHECK(result); CHECK(error.empty()); - return result; + return std::move(*result); } // Helper to verify the indexed form of URlTransform created by @@ -181,7 +181,7 @@ std::vector<std::string> excluded_domains, absl::optional<std::string> redirect_url, dnr_api::RuleActionType action_type, - std::unique_ptr<dnr_api::URLTransform> url_transform, + absl::optional<dnr_api::URLTransform> url_transform, absl::optional<std::string> regex_substitution, std::vector<dnr_api::ModifyHeaderInfo> request_headers, std::vector<dnr_api::ModifyHeaderInfo> response_headers) { @@ -432,15 +432,15 @@ flat_rule::ElementType_OBJECT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_NONE, flat_rule::AnchorType_BOUNDARY, "google.com", {"a.com"}, {"x.a.com"}, - absl::nullopt, dnr_api::RULE_ACTION_TYPE_BLOCK, nullptr, absl::nullopt, - {}, {})); + absl::nullopt, dnr_api::RULE_ACTION_TYPE_BLOCK, absl::nullopt, + absl::nullopt, {}, {})); rules_to_index.push_back(CreateIndexedRule( 2, kMinValidPriority, flat_rule::OptionFlag_APPLIES_TO_THIRD_PARTY, flat_rule::ElementType_IMAGE | flat_rule::ElementType_WEBSOCKET, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_WILDCARDED, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, "*google*", - {"a.com"}, {}, absl::nullopt, dnr_api::RULE_ACTION_TYPE_BLOCK, nullptr, - absl::nullopt, {}, {})); + {"a.com"}, {}, absl::nullopt, dnr_api::RULE_ACTION_TYPE_BLOCK, + absl::nullopt, absl::nullopt, {}, {})); // Redirect rules. rules_to_index.push_back(CreateIndexedRule( @@ -448,7 +448,7 @@ flat_rule::ElementType_IMAGE, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_SUBDOMAIN, flat_rule::AnchorType_BOUNDARY, "google.com", {}, {}, - "http://example1.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, nullptr, + "http://example1.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, absl::nullopt, absl::nullopt, {}, {})); rules_to_index.push_back(CreateIndexedRule( 10, 2, flat_rule::OptionFlag_NONE, @@ -456,12 +456,12 @@ flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, "example1", {}, {"a.com"}, "http://example2.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, - nullptr, absl::nullopt, {}, {})); + absl::nullopt, absl::nullopt, {}, {})); rules_to_index.push_back(CreateIndexedRule( 9, 3, flat_rule::OptionFlag_NONE, flat_rule::ElementType_NONE, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_WILDCARDED, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, "*", {}, {}, - "http://example2.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, nullptr, + "http://example2.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, absl::nullopt, absl::nullopt, {}, {})); rules_to_index.push_back(CreateIndexedRule( 100, 3, flat_rule::OptionFlag_NONE, flat_rule::ElementType_NONE, @@ -477,7 +477,7 @@ flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_SUBDOMAIN, flat_rule::AnchorType_NONE, "example1.com", {"xyz.com"}, {}, absl::nullopt, - dnr_api::RULE_ACTION_TYPE_ALLOW, nullptr, absl::nullopt, {}, {})); + dnr_api::RULE_ACTION_TYPE_ALLOW, absl::nullopt, absl::nullopt, {}, {})); rules_to_index.push_back(CreateIndexedRule( 16, kMinValidPriority, flat_rule::OptionFlag_IS_ALLOWLIST | @@ -485,15 +485,15 @@ flat_rule::ElementType_IMAGE, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, "example3", {}, {}, absl::nullopt, - dnr_api::RULE_ACTION_TYPE_ALLOW, nullptr, absl::nullopt, {}, {})); + dnr_api::RULE_ACTION_TYPE_ALLOW, absl::nullopt, absl::nullopt, {}, {})); // Allow all requests rule. rules_to_index.push_back(CreateIndexedRule( 22, 3, flat_rule::OptionFlag_NONE, flat_rule::ElementType_SUBDOCUMENT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, "example.com", {}, - {}, absl::nullopt, dnr_api::RULE_ACTION_TYPE_ALLOWALLREQUESTS, nullptr, - absl::nullopt, {}, {})); + {}, absl::nullopt, dnr_api::RULE_ACTION_TYPE_ALLOWALLREQUESTS, + absl::nullopt, absl::nullopt, {}, {})); // Modify headers rules. std::vector<dnr_api::ModifyHeaderInfo> request_headers_1; @@ -515,7 +515,7 @@ flat_rule::ElementType_SUBDOCUMENT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_SUBDOMAIN, flat_rule::AnchorType_NONE, "example.com", {}, {}, absl::nullopt, - dnr_api::RULE_ACTION_TYPE_MODIFYHEADERS, nullptr, absl::nullopt, + dnr_api::RULE_ACTION_TYPE_MODIFYHEADERS, absl::nullopt, absl::nullopt, std::move(request_headers_1), std::move(response_headers_1))); std::vector<dnr_api::ModifyHeaderInfo> request_headers_2; @@ -527,7 +527,7 @@ flat_rule::ElementType_SUBDOCUMENT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_SUBSTRING, flat_rule::AnchorType_SUBDOMAIN, flat_rule::AnchorType_NONE, "example.com", {}, {}, absl::nullopt, - dnr_api::RULE_ACTION_TYPE_MODIFYHEADERS, nullptr, absl::nullopt, + dnr_api::RULE_ACTION_TYPE_MODIFYHEADERS, absl::nullopt, absl::nullopt, std::move(request_headers_2), {})); // Note: It's unsafe to store/return pointers to a mutable vector since the @@ -560,15 +560,15 @@ flat_rule::ElementType_OBJECT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_REGEXP, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, R"(^https://(abc|def))", {"a.com"}, - {"x.a.com"}, absl::nullopt, dnr_api::RULE_ACTION_TYPE_BLOCK, nullptr, - absl::nullopt, {}, {})); + {"x.a.com"}, absl::nullopt, dnr_api::RULE_ACTION_TYPE_BLOCK, + absl::nullopt, absl::nullopt, {}, {})); // Redirect rule. rules_to_index.push_back(CreateIndexedRule( 15, 2, flat_rule::OptionFlag_APPLIES_TO_FIRST_PARTY, flat_rule::ElementType_IMAGE, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_REGEXP, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, R"(^(http|https))", {}, {}, - "http://example1.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, nullptr, + "http://example1.com", dnr_api::RULE_ACTION_TYPE_REDIRECT, absl::nullopt, absl::nullopt, {}, {})); // Regex substitution rule. rules_to_index.push_back(CreateIndexedRule( @@ -576,7 +576,7 @@ flat_rule::ElementType_SCRIPT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_REGEXP, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, R"((\d+\).google.com)", {}, {}, absl::nullopt, - dnr_api::RULE_ACTION_TYPE_REDIRECT, nullptr, + dnr_api::RULE_ACTION_TYPE_REDIRECT, absl::nullopt, R"(http://redirect.com?num=\1)", {}, {})); // Modify headers rule. @@ -590,7 +590,7 @@ flat_rule::ElementType_SUBDOCUMENT, flat_rule::ActivationType_NONE, flat_rule::UrlPatternType_REGEXP, flat_rule::AnchorType_NONE, flat_rule::AnchorType_NONE, "*", {}, {}, absl::nullopt, - dnr_api::RULE_ACTION_TYPE_MODIFYHEADERS, nullptr, absl::nullopt, + dnr_api::RULE_ACTION_TYPE_MODIFYHEADERS, absl::nullopt, absl::nullopt, std::move(request_headers), {})); flatbuffers::DetachedBuffer buffer;
diff --git a/extensions/browser/api/declarative_net_request/indexed_rule.cc b/extensions/browser/api/declarative_net_request/indexed_rule.cc index 33313760..66d69a63 100644 --- a/extensions/browser/api/declarative_net_request/indexed_rule.cc +++ b/extensions/browser/api/declarative_net_request/indexed_rule.cc
@@ -373,7 +373,7 @@ } if (redirect.transform) { - indexed_rule->url_transform = std::move(redirect.transform); + indexed_rule->url_transform = std::move(*redirect.transform); return ValidateTransform(*indexed_rule->url_transform); }
diff --git a/extensions/browser/api/declarative_net_request/indexed_rule.h b/extensions/browser/api/declarative_net_request/indexed_rule.h index 4c70cf5..67fa8e30 100644 --- a/extensions/browser/api/declarative_net_request/indexed_rule.h +++ b/extensions/browser/api/declarative_net_request/indexed_rule.h
@@ -7,7 +7,6 @@ #include <stdint.h> #include <string> -#include <vector> #include "base/containers/flat_set.h" #include "components/url_pattern_index/flat/url_pattern_index_generated.h" @@ -73,7 +72,7 @@ // The regex substitution for this rule. absl::optional<std::string> regex_substitution; // UrlTransform for this rule. - std::unique_ptr<api::declarative_net_request::URLTransform> url_transform; + absl::optional<api::declarative_net_request::URLTransform> url_transform; // List of request headers to modify. Valid iff this is a modify headers rule. std::vector<api::declarative_net_request::ModifyHeaderInfo> request_headers;
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn index 65cee807..70df6350 100644 --- a/google_apis/BUILD.gn +++ b/google_apis/BUILD.gn
@@ -83,9 +83,6 @@ assert( use_official_google_api_keys || !is_chrome_branded || is_ios || is_fuchsia) -# This arg should always be false on iOS. See https://crbug.com/1183709. -assert(!use_official_google_api_keys || !is_ios) - config("key_defines") { defines = []
diff --git a/gpu/command_buffer/service/raster_decoder.cc b/gpu/command_buffer/service/raster_decoder.cc index a6f49a3..4ca099f 100644 --- a/gpu/command_buffer/service/raster_decoder.cc +++ b/gpu/command_buffer/service/raster_decoder.cc
@@ -253,9 +253,10 @@ } private: - raw_ptr<SharedImageRepresentationFactory> shared_image_factory_; + raw_ptr<SharedImageRepresentationFactory, DanglingUntriaged> + shared_image_factory_; scoped_refptr<SharedContextState> shared_context_state_; - raw_ptr<SkSurface> output_surface_; + raw_ptr<SkSurface, DanglingUntriaged> output_surface_; raw_ptr<std::vector<GrBackendSemaphore>> end_semaphores_; raw_ptr<gles2::ErrorState> error_state_;
diff --git a/gpu/command_buffer/service/shared_image/shared_image_representation.h b/gpu/command_buffer/service/shared_image/shared_image_representation.h index d2d8a5d..fb21193 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_representation.h +++ b/gpu/command_buffer/service/shared_image/shared_image_representation.h
@@ -133,7 +133,7 @@ }; private: - const raw_ptr<SharedImageManager> manager_; + const raw_ptr<SharedImageManager, DanglingUntriaged> manager_; const raw_ptr<SharedImageBacking, DanglingUntriaged> backing_; const raw_ptr<MemoryTypeTracker> tracker_; bool has_context_ = true;
diff --git a/infra/config/generated/builders/reclient/Linux Builder reclient staging untrusted/properties.json b/infra/config/generated/builders/reclient/Linux Builder reclient staging untrusted/properties.json index 0110791..4dfeabf 100644 --- a/infra/config/generated/builders/reclient/Linux Builder reclient staging untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Linux Builder reclient staging untrusted/properties.json
@@ -43,6 +43,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Linux Builder reclient staging/properties.json b/infra/config/generated/builders/reclient/Linux Builder reclient staging/properties.json index 6390cc9b..b91fd97 100644 --- a/infra/config/generated/builders/reclient/Linux Builder reclient staging/properties.json +++ b/infra/config/generated/builders/reclient/Linux Builder reclient staging/properties.json
@@ -43,6 +43,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Linux Builder reclient test untrusted/properties.json b/infra/config/generated/builders/reclient/Linux Builder reclient test untrusted/properties.json index f8baebe..922de52 100644 --- a/infra/config/generated/builders/reclient/Linux Builder reclient test untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Linux Builder reclient test untrusted/properties.json
@@ -43,6 +43,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Linux Builder reclient test/properties.json b/infra/config/generated/builders/reclient/Linux Builder reclient test/properties.json index 669bb9e..c7fae09 100644 --- a/infra/config/generated/builders/reclient/Linux Builder reclient test/properties.json +++ b/infra/config/generated/builders/reclient/Linux Builder reclient test/properties.json
@@ -43,6 +43,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Mac Builder reclient staging untrusted/properties.json b/infra/config/generated/builders/reclient/Mac Builder reclient staging untrusted/properties.json index ea3b558d..077e58d5 100644 --- a/infra/config/generated/builders/reclient/Mac Builder reclient staging untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Mac Builder reclient staging untrusted/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Mac Builder reclient staging/properties.json b/infra/config/generated/builders/reclient/Mac Builder reclient staging/properties.json index 306ee40..fe42870 100644 --- a/infra/config/generated/builders/reclient/Mac Builder reclient staging/properties.json +++ b/infra/config/generated/builders/reclient/Mac Builder reclient staging/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Mac Builder reclient test untrusted/properties.json b/infra/config/generated/builders/reclient/Mac Builder reclient test untrusted/properties.json index a7ec6871..d44906d1 100644 --- a/infra/config/generated/builders/reclient/Mac Builder reclient test untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Mac Builder reclient test untrusted/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Mac Builder reclient test/properties.json b/infra/config/generated/builders/reclient/Mac Builder reclient test/properties.json index 5f60cef..756db4aa5 100644 --- a/infra/config/generated/builders/reclient/Mac Builder reclient test/properties.json +++ b/infra/config/generated/builders/reclient/Mac Builder reclient test/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging untrusted/properties.json b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging untrusted/properties.json index 81e67ff..310c01c 100644 --- a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging untrusted/properties.json
@@ -47,6 +47,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging/properties.json b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging/properties.json index ad84af5..2dcb2f7 100644 --- a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging/properties.json +++ b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient staging/properties.json
@@ -47,6 +47,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test untrusted/properties.json b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test untrusted/properties.json index 55d85f6..d50e199 100644 --- a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test untrusted/properties.json
@@ -47,6 +47,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test/properties.json b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test/properties.json index 441ce26f1..57d152b 100644 --- a/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test/properties.json +++ b/infra/config/generated/builders/reclient/Simple Chrome Builder reclient test/properties.json
@@ -47,6 +47,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Win x64 Builder reclient staging untrusted/properties.json b/infra/config/generated/builders/reclient/Win x64 Builder reclient staging untrusted/properties.json index aae9424..fa1179b 100644 --- a/infra/config/generated/builders/reclient/Win x64 Builder reclient staging untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Win x64 Builder reclient staging untrusted/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Win x64 Builder reclient staging/properties.json b/infra/config/generated/builders/reclient/Win x64 Builder reclient staging/properties.json index 46100e66..52f54e96 100644 --- a/infra/config/generated/builders/reclient/Win x64 Builder reclient staging/properties.json +++ b/infra/config/generated/builders/reclient/Win x64 Builder reclient staging/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Win x64 Builder reclient test untrusted/properties.json b/infra/config/generated/builders/reclient/Win x64 Builder reclient test untrusted/properties.json index 977f7697..a20885d 100644 --- a/infra/config/generated/builders/reclient/Win x64 Builder reclient test untrusted/properties.json +++ b/infra/config/generated/builders/reclient/Win x64 Builder reclient test untrusted/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/Win x64 Builder reclient test/properties.json b/infra/config/generated/builders/reclient/Win x64 Builder reclient test/properties.json index 2e0af97c..a03ab5d 100644 --- a/infra/config/generated/builders/reclient/Win x64 Builder reclient test/properties.json +++ b/infra/config/generated/builders/reclient/Win x64 Builder reclient test/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/ios-simulator reclient staging untrusted/properties.json b/infra/config/generated/builders/reclient/ios-simulator reclient staging untrusted/properties.json index 2045994..792facc 100644 --- a/infra/config/generated/builders/reclient/ios-simulator reclient staging untrusted/properties.json +++ b/infra/config/generated/builders/reclient/ios-simulator reclient staging untrusted/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/ios-simulator reclient staging/properties.json b/infra/config/generated/builders/reclient/ios-simulator reclient staging/properties.json index 4e570ca..5c1dffe 100644 --- a/infra/config/generated/builders/reclient/ios-simulator reclient staging/properties.json +++ b/infra/config/generated/builders/reclient/ios-simulator reclient staging/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/ios-simulator reclient test untrusted/properties.json b/infra/config/generated/builders/reclient/ios-simulator reclient test untrusted/properties.json index 334ae5e..2730e441 100644 --- a/infra/config/generated/builders/reclient/ios-simulator reclient test untrusted/properties.json +++ b/infra/config/generated/builders/reclient/ios-simulator reclient test untrusted/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/ios-simulator reclient test/properties.json b/infra/config/generated/builders/reclient/ios-simulator reclient test/properties.json index 177dd52..db5c371 100644 --- a/infra/config/generated/builders/reclient/ios-simulator reclient test/properties.json +++ b/infra/config/generated/builders/reclient/ios-simulator reclient test/properties.json
@@ -45,6 +45,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging untrusted/properties.json b/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging untrusted/properties.json index 052d39a..c61c76d 100644 --- a/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging untrusted/properties.json +++ b/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging untrusted/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging/properties.json b/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging/properties.json index 059d42c3..55d0960 100644 --- a/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging/properties.json +++ b/infra/config/generated/builders/reclient/mac-arm64-rel reclient staging/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/mac-arm64-rel reclient test untrusted/properties.json b/infra/config/generated/builders/reclient/mac-arm64-rel reclient test untrusted/properties.json index b94ed01..9386cc2 100644 --- a/infra/config/generated/builders/reclient/mac-arm64-rel reclient test untrusted/properties.json +++ b/infra/config/generated/builders/reclient/mac-arm64-rel reclient test untrusted/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-untrusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/generated/builders/reclient/mac-arm64-rel reclient test/properties.json b/infra/config/generated/builders/reclient/mac-arm64-rel reclient test/properties.json index f97086c..85cf77c 100644 --- a/infra/config/generated/builders/reclient/mac-arm64-rel reclient test/properties.json +++ b/infra/config/generated/builders/reclient/mac-arm64-rel reclient test/properties.json
@@ -44,6 +44,7 @@ } }, "$build/reclient": { + "enable_deps_cache_on_win": true, "instance": "rbe-chromium-trusted-test", "metrics_project": "chromium-reclient-metrics" },
diff --git a/infra/config/lib/builders.star b/infra/config/lib/builders.star index 738af4f..5765e71 100644 --- a/infra/config/lib/builders.star +++ b/infra/config/lib/builders.star
@@ -283,7 +283,7 @@ return code_coverage or None -def _reclient_property(*, instance, service, jobs, rewrapper_env, profiler_service, publish_trace, cache_silo, ensure_verified, bootstrap_env): +def _reclient_property(*, bucket, instance, service, jobs, rewrapper_env, profiler_service, publish_trace, cache_silo, ensure_verified, bootstrap_env): reclient = {} instance = defaults.get_value("reclient_instance", instance) if not instance: @@ -321,6 +321,11 @@ ensure_verified = defaults.get_value("reclient_ensure_verified", ensure_verified) if ensure_verified: reclient["ensure_verified"] = True + + # TODO(crbug.com/1350867): remove this after performance check with + # deps cache. + if bucket == "reclient": + reclient["enable_deps_cache_on_win"] = True return reclient ################################################################################ @@ -742,6 +747,9 @@ publish_trace = reclient_publish_trace, cache_silo = reclient_cache_silo, ensure_verified = reclient_ensure_verified, + # TODO(crbug.com/1350867): remove this after performance check with + # deps cache. + bucket = bucket, ) if reclient != None: properties["$build/reclient"] = reclient
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm b/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm index eb693fd..bbb3f3c 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_egtest.mm
@@ -697,7 +697,8 @@ // fied, Select button should be hidden & SelectAll button should be displayed. // If the selected text is the entire omnibox field, select & SelectAll button // should be hidden. -- (void)testSelection { +// TODO(crbug.com/1358818): Disabled due to flakiness. Re-enabled when fixed. +- (void)DISABLED_testSelection { // TODO(crbug.com/1209342): test failing on ipad device #if !TARGET_IPHONE_SIMULATOR if ([ChromeEarlGrey isIPadIdiom]) {
diff --git a/ios/chrome/browser/ui/open_in/open_in_controller_egtest.mm b/ios/chrome/browser/ui/open_in/open_in_controller_egtest.mm index c0aaac1..49ec9b0 100644 --- a/ios/chrome/browser/ui/open_in/open_in_controller_egtest.mm +++ b/ios/chrome/browser/ui/open_in/open_in_controller_egtest.mm
@@ -133,7 +133,8 @@ } // Tests that open in button do not appears when opening a MOV file. -- (void)testOpenInMOV { +// TODO(crbug.com/1358830): Disabled due to flakiness. Re-enabled when fixed. +- (void)DISABLED_testOpenInMOV { [ChromeEarlGrey loadURL:self.testServer->GetURL(kMOVPath)]; [[EarlGrey selectElementWithMatcher:chrome_test_util::OpenInButton()] assertWithMatcher:grey_nil()];
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_egtest.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_egtest.mm index 22e7128..abb6e773 100644 --- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_egtest.mm +++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_egtest.mm
@@ -517,7 +517,8 @@ } // Tests share button is enabled only on pages that can be shared. -- (void)testShareButton { +// TODO(crbug.com/1358827): Disabled due to flakiness. Re-enabled when fixed. +- (void)DISABLED_testShareButton { if (![ChromeEarlGrey isIPadIdiom]) { // If this test is run on an iPhone, rotate it to have the unsplit toolbar. [EarlGrey rotateDeviceToOrientation:UIDeviceOrientationLandscapeLeft
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 649fc59..5741a56b 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 @@ -bab5002f6c4ea45887b6e62d2a2a1065a33c818d \ No newline at end of file +26a311fa4c5c585197c5b42fbf602ba7a2adc62a \ 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 17682d4..4708c76 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 @@ -aa84d18d59c791cee864a2633902a16689451132 \ No newline at end of file +64b64e7b450c1c3d79e81f65b089db3dd65ee1e0 \ 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 981b99f..5bf8f15 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 @@ -7b01cbf852c67bb4f5187bc25666aad3e71bffcc \ No newline at end of file +e6642a8a6628a5c45caf6dae679e03fc5ff6247b \ 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 94093c1..d455e39 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 @@ -151e4c3d3bdcd9180b9176f44c15e99cd31c3e98 \ No newline at end of file +e4b2ac3c9fa9517b25e9b49d0e09e342d15d7692 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 index 889bf3bb..6d110e1 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -c372c6505a6683eeec9d13676354346d02a0de85 \ No newline at end of file +5cd7a23a3549d873a2d74143ebd3c0bc74a12968 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 index e2533d3..bd0cf1f2 100644 --- a/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_dogfood_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -c0e54f777d15a73633f321c1c4f734f846a35fe3 \ No newline at end of file +c7935bab7b7eccc93b15244ff3bb44dfecb8cb22 \ 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 4f1cdb38..84887e03 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 @@ -c4cb357821b36854732230c05ec085a98403a02f \ No newline at end of file +32905fd67563aac1970a3ea7bab71e2127964dbd \ 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 1387755..7d8c276 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 @@ -15e32bd9de5da540f4ec7d8556e2d23a68f2f8ff \ No newline at end of file +c78821a0b9feff242605ef4c257a831814acc335 \ 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 79998065..5bec5568 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 @@ -ff8208e0fbafacf4c0b3999941965ee52696fd75 \ No newline at end of file +bcaf2e6c66ae2de231af32c2acd65f7691aef2e0 \ 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 46d43a3..85c96cb5 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 @@ -25e781ed6f03599f80d5b0fe40ec2b4ac55abece \ No newline at end of file +a888b4601280602eeab13bf41752f7bc2d9842cc \ No newline at end of file
diff --git a/media/base/audio_buffer_converter.cc b/media/base/audio_buffer_converter.cc index a62b611..43d98df 100644 --- a/media/base/audio_buffer_converter.cc +++ b/media/base/audio_buffer_converter.cc
@@ -140,14 +140,14 @@ Flush(); audio_converter_.reset(); input_params_.Reset( - input_params_.format(), buffer.channel_layout(), buffer.sample_rate(), + input_params_.format(), {buffer.channel_layout(), buffer.channel_count()}, + buffer.sample_rate(), // If resampling is needed and the FIFO disabled, the AudioConverter will // always request SincResampler::kDefaultRequestSize frames. Otherwise it // will use the output frame size. buffer.sample_rate() == output_params_.sample_rate() ? output_params_.frames_per_buffer() : SincResampler::kDefaultRequestSize); - input_params_.set_channels_for_discrete(buffer.channel_count()); io_sample_rate_ratio_ = static_cast<double>(input_params_.sample_rate()) / output_params_.sample_rate();
diff --git a/media/base/audio_buffer_converter_unittest.cc b/media/base/audio_buffer_converter_unittest.cc index a72a170..e753676 100644 --- a/media/base/audio_buffer_converter_unittest.cc +++ b/media/base/audio_buffer_converter_unittest.cc
@@ -19,7 +19,7 @@ // Important: Use an odd buffer size here so SIMD issues are caught. const int kOutFrameSize = 441; const int kOutSampleRate = 44100; -const ChannelLayout kOutChannelLayout = CHANNEL_LAYOUT_STEREO; +constexpr ChannelLayout kOutChannelLayout = CHANNEL_LAYOUT_STEREO; const int kOutChannelCount = 2; static scoped_refptr<AudioBuffer> MakeTestBuffer(int sample_rate, @@ -38,7 +38,7 @@ expected_output_frames_(0.0), output_frames_(0), output_params_(AudioParameters::AUDIO_PCM_LOW_LATENCY, - kOutChannelLayout, + ChannelLayoutConfig::FromLayout<kOutChannelLayout>(), kOutSampleRate, kOutFrameSize) { audio_buffer_converter_ = @@ -208,8 +208,7 @@ TEST_F(AudioBufferConverterTest, DiscreteChannelLayout) { output_params_ = AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, - CHANNEL_LAYOUT_DISCRETE, kOutSampleRate, 512); - output_params_.set_channels_for_discrete(2); + {CHANNEL_LAYOUT_DISCRETE, 2}, kOutSampleRate, 512); audio_buffer_converter_ = std::make_unique<AudioBufferConverter>(output_params_); AddInput(MakeTestBuffer(kOutSampleRate, CHANNEL_LAYOUT_STEREO, 2, 512)); @@ -217,10 +216,10 @@ } TEST_F(AudioBufferConverterTest, LargeBuffersResampling) { - output_params_ = AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, - kOutChannelLayout, - kOutSampleRate, - 2048); + output_params_ = + AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, + ChannelLayoutConfig::FromLayout<kOutChannelLayout>(), + kOutSampleRate, 2048); audio_buffer_converter_ = std::make_unique<AudioBufferConverter>(output_params_);
diff --git a/media/base/audio_bus_unittest.cc b/media/base/audio_bus_unittest.cc index 753b407..b20582d 100644 --- a/media/base/audio_bus_unittest.cc +++ b/media/base/audio_bus_unittest.cc
@@ -24,7 +24,7 @@ namespace media { static const int kChannels = 6; -static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_5_1; +static constexpr ChannelLayout kChannelLayout = CHANNEL_LAYOUT_5_1; // Use a buffer size which is intentionally not a multiple of kChannelAlignment. static const int kFrameCount = media::AudioBus::kChannelAlignment * 32 - 1; static const int kSampleRate = 48000; @@ -141,7 +141,8 @@ // Verify Create(...) using AudioParameters works as advertised. TEST_F(AudioBusTest, CreateUsingAudioParameters) { std::unique_ptr<AudioBus> bus = AudioBus::Create( - AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, + AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), kSampleRate, kFrameCount)); VerifyChannelAndFrameCount(bus.get()); VerifyReadWriteAndAlignment(bus.get()); @@ -187,7 +188,8 @@ // Verify an AudioBus created via wrapping a memory block works as advertised. TEST_F(AudioBusTest, WrapMemory) { - AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), kSampleRate, kFrameCount); int data_size = AudioBus::CalculateMemorySize(params); std::unique_ptr<float, base::AlignedFreeDeleter> data(static_cast<float*>( @@ -215,7 +217,8 @@ TEST_F(AudioBusTest, CopyTo) { // Create one bus with AudioParameters and the other through direct values to // test for parity between the Create() functions. - AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), kSampleRate, kFrameCount); std::unique_ptr<AudioBus> bus1 = AudioBus::Create(kChannels, kFrameCount); std::unique_ptr<AudioBus> bus2 = AudioBus::Create(params);
diff --git a/media/base/audio_converter_perftest.cc b/media/base/audio_converter_perftest.cc index 75f0288..5a6e93a 100644 --- a/media/base/audio_converter_perftest.cc +++ b/media/base/audio_converter_perftest.cc
@@ -55,9 +55,10 @@ // Create input and output parameters to convert between the two most common // sets of parameters (as indicated via UMA data). AudioParameters input_params(AudioParameters::AUDIO_PCM_LINEAR, - CHANNEL_LAYOUT_MONO, 48000, 2048); + media::ChannelLayoutConfig::Mono(), 48000, 2048); AudioParameters output_params(AudioParameters::AUDIO_PCM_LINEAR, - CHANNEL_LAYOUT_STEREO, 44100, 440); + media::ChannelLayoutConfig::Stereo(), 44100, + 440); RunConvertBenchmark(input_params, output_params, false, "convert"); } @@ -66,11 +67,11 @@ // Create input and output parameters to convert between common buffer sizes // without any resampling for the FIFO vs no FIFO benchmarks. AudioParameters input_params(AudioParameters::AUDIO_PCM_LINEAR, - CHANNEL_LAYOUT_STEREO, - 44100, + media::ChannelLayoutConfig::Stereo(), 44100, 2048); AudioParameters output_params(AudioParameters::AUDIO_PCM_LINEAR, - CHANNEL_LAYOUT_STEREO, 44100, 440); + media::ChannelLayoutConfig::Stereo(), 44100, + 440); RunConvertBenchmark(input_params, output_params, true, "convert_fifo_only"); RunConvertBenchmark(input_params, output_params, false,
diff --git a/media/base/audio_converter_unittest.cc b/media/base/audio_converter_unittest.cc index b7a8240..ccbabe4e 100644 --- a/media/base/audio_converter_unittest.cc +++ b/media/base/audio_converter_unittest.cc
@@ -22,7 +22,7 @@ static const int kConvertCycles = 3; // Parameters used for testing. -static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; +static constexpr ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; static const int kHighLatencyBufferSize = 2048; static const int kLowLatencyBufferSize = 256; static const int kSampleRate = 48000; @@ -30,15 +30,17 @@ // Number of full sine wave cycles for each Render() call. static const int kSineCycles = 4; -// Tuple of <input rate, output rate, output channel layout, epsilon>. -typedef std::tuple<int, int, ChannelLayout, double> AudioConverterTestData; +// Tuple of <input rate, output rate, output channel layout config, epsilon>. +typedef std::tuple<int, int, ChannelLayoutConfig, double> + AudioConverterTestData; class AudioConverterTest : public testing::TestWithParam<AudioConverterTestData> { public: AudioConverterTest() : epsilon_(std::get<3>(GetParam())) { // Create input and output parameters based on test parameters. input_parameters_ = - AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, + AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), std::get<0>(GetParam()), kHighLatencyBufferSize); output_parameters_ = AudioParameters( AudioParameters::AUDIO_PCM_LOW_LATENCY, std::get<2>(GetParam()), @@ -200,13 +202,11 @@ // Choose input and output parameters such that the transform must make // multiple calls to fill the buffer. AudioParameters input_parameters(AudioParameters::AUDIO_PCM_LINEAR, - CHANNEL_LAYOUT_DISCRETE, kSampleRate, + {CHANNEL_LAYOUT_DISCRETE, 10}, kSampleRate, kLowLatencyBufferSize); - input_parameters.set_channels_for_discrete(10); AudioParameters output_parameters(AudioParameters::AUDIO_PCM_LINEAR, - CHANNEL_LAYOUT_DISCRETE, kSampleRate * 2, - kHighLatencyBufferSize); - output_parameters.set_channels_for_discrete(5); + {CHANNEL_LAYOUT_DISCRETE, 5}, + kSampleRate * 2, kHighLatencyBufferSize); AudioConverter converter(input_parameters, output_parameters, false); FakeAudioRenderCallback callback(0.2, kSampleRate); @@ -257,12 +257,18 @@ AudioConverterTest, testing::Values( // No resampling. No channel mixing. - std::make_tuple(44100, 44100, CHANNEL_LAYOUT_STEREO, 0.00000048), + std::make_tuple(44100, + 44100, + ChannelLayoutConfig::Stereo(), + 0.00000048), // Upsampling. Channel upmixing. - std::make_tuple(44100, 48000, CHANNEL_LAYOUT_QUAD, 0.033), + std::make_tuple(44100, + 48000, + ChannelLayoutConfig::FromLayout<CHANNEL_LAYOUT_QUAD>(), + 0.033), // Downsampling. Channel downmixing. - std::make_tuple(48000, 41000, CHANNEL_LAYOUT_MONO, 0.042))); + std::make_tuple(48000, 41000, ChannelLayoutConfig::Mono(), 0.042))); } // namespace media
diff --git a/media/base/audio_renderer_mixer_input_unittest.cc b/media/base/audio_renderer_mixer_input_unittest.cc index 5884bb73..864906f 100644 --- a/media/base/audio_renderer_mixer_input_unittest.cc +++ b/media/base/audio_renderer_mixer_input_unittest.cc
@@ -26,7 +26,7 @@ static const int kBufferSize = 8192; static const base::UnguessableToken kFrameToken = base::UnguessableToken::Create(); -static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; +static constexpr ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; static const char kDefaultDeviceId[] = "default"; static const char kAnotherDeviceId[] = "another"; static const char kUnauthorizedDeviceId[] = "unauthorized"; @@ -37,7 +37,8 @@ public: AudioRendererMixerInputTest() { audio_parameters_ = - AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, + AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), kSampleRate, kBufferSize); CreateMixerInput(kDefaultDeviceId);
diff --git a/media/base/audio_renderer_mixer_unittest.cc b/media/base/audio_renderer_mixer_unittest.cc index d094586..d5cbf57 100644 --- a/media/base/audio_renderer_mixer_unittest.cc +++ b/media/base/audio_renderer_mixer_unittest.cc
@@ -34,7 +34,7 @@ const int kMixerCycles = 3; // Parameters used for testing. -const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; +constexpr ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; const int kHighLatencyBufferSize = 8192; const int kLowLatencyBufferSize = 256; @@ -61,13 +61,15 @@ const int* const sample_rates = std::get<0>(GetParam()); size_t sample_rates_count = std::get<1>(GetParam()); for (size_t i = 0; i < sample_rates_count; ++i) - input_parameters_.push_back( - AudioParameters(AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, - sample_rates[i], kHighLatencyBufferSize)); + input_parameters_.emplace_back( + AudioParameters::AUDIO_PCM_LINEAR, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), sample_rates[i], + kHighLatencyBufferSize); // Create output parameters based on test parameters. output_parameters_ = - AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, kChannelLayout, + AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, + ChannelLayoutConfig::FromLayout<kChannelLayout>(), std::get<2>(GetParam()), kLowLatencyBufferSize); sink_ = new MockAudioRendererSink();
diff --git a/media/base/channel_mixer_unittest.cc b/media/base/channel_mixer_unittest.cc index 56facff..bb57cb47 100644 --- a/media/base/channel_mixer_unittest.cc +++ b/media/base/channel_mixer_unittest.cc
@@ -105,19 +105,17 @@ int input_channels = GetParam().input_channels; std::unique_ptr<AudioBus> input_bus = AudioBus::Create(input_channels, kFrames); - AudioParameters input_audio(AudioParameters::AUDIO_PCM_LINEAR, input_layout, + AudioParameters input_audio(AudioParameters::AUDIO_PCM_LINEAR, + {input_layout, input_channels}, AudioParameters::kAudioCDSampleRate, kFrames); - if (input_layout == CHANNEL_LAYOUT_DISCRETE) - input_audio.set_channels_for_discrete(input_channels); ChannelLayout output_layout = GetParam().output_layout; int output_channels = GetParam().output_channels; std::unique_ptr<AudioBus> output_bus = AudioBus::Create(output_channels, kFrames); - AudioParameters output_audio(AudioParameters::AUDIO_PCM_LINEAR, output_layout, + AudioParameters output_audio(AudioParameters::AUDIO_PCM_LINEAR, + {output_layout, output_channels}, AudioParameters::kAudioCDSampleRate, kFrames); - if (output_layout == CHANNEL_LAYOUT_DISCRETE) - output_audio.set_channels_for_discrete(output_channels); const float* channel_values = GetParam().channel_values; ASSERT_EQ(input_bus->channels(), GetParam().num_channel_values);
diff --git a/media/base/converting_audio_fifo.cc b/media/base/converting_audio_fifo.cc index e74b5a7..33b6a30 100644 --- a/media/base/converting_audio_fifo.cc +++ b/media/base/converting_audio_fifo.cc
@@ -134,7 +134,7 @@ // Both the format and the sample rate are unused for mixing, but we still // need to pass a value below. mixer_input_params_.Reset(input_params_.format(), - GuessChannelLayout(incoming_channels), + ChannelLayoutConfig::Guess(incoming_channels), incoming_channels, input_params_.sample_rate()); mixer_ = std::make_unique<ChannelMixer>(mixer_input_params_, input_params_);
diff --git a/media/base/converting_audio_fifo_unittest.cc b/media/base/converting_audio_fifo_unittest.cc index 1efff7c8..491f6be6 100644 --- a/media/base/converting_audio_fifo_unittest.cc +++ b/media/base/converting_audio_fifo_unittest.cc
@@ -14,6 +14,7 @@ #include "base/test/bind.h" #include "base/time/time.h" #include "media/base/audio_bus.h" +#include "media/base/audio_parameters.h" #include "testing/gtest/include/gtest/gtest.h" namespace media { @@ -29,7 +30,7 @@ const AudioParameters kDefaultParams = AudioParameters(AudioParameters::Format::AUDIO_PCM_LINEAR, - GuessChannelLayout(kDefaultChannels), + ChannelLayoutConfig::Guess(kDefaultChannels), kInputSampleRate, kDefaultFrames); @@ -52,7 +53,7 @@ AudioParameters TestOutputParams() { return AudioParameters(AudioParameters::Format::AUDIO_PCM_LINEAR, - GuessChannelLayout(output_channels()), + ChannelLayoutConfig::Guess(output_channels()), output_sample_rate(), output_frames()); }
diff --git a/media/base/fake_audio_renderer_sink.cc b/media/base/fake_audio_renderer_sink.cc index ff9af5b..e6b077c5 100644 --- a/media/base/fake_audio_renderer_sink.cc +++ b/media/base/fake_audio_renderer_sink.cc
@@ -14,7 +14,7 @@ FakeAudioRendererSink::FakeAudioRendererSink() : FakeAudioRendererSink( AudioParameters(AudioParameters::AUDIO_FAKE, - CHANNEL_LAYOUT_STEREO, + ChannelLayoutConfig::Stereo(), AudioParameters::kTelephoneSampleRate, 1)) {}
diff --git a/media/base/fake_audio_worker_unittest.cc b/media/base/fake_audio_worker_unittest.cc index 355fed2..e8d794a 100644 --- a/media/base/fake_audio_worker_unittest.cc +++ b/media/base/fake_audio_worker_unittest.cc
@@ -32,7 +32,10 @@ class FakeAudioWorkerTest : public testing::Test { public: FakeAudioWorkerTest() - : params_(AudioParameters::AUDIO_FAKE, CHANNEL_LAYOUT_STEREO, 44100, 128), + : params_(AudioParameters::AUDIO_FAKE, + ChannelLayoutConfig::Stereo(), + 44100, + 128), fake_worker_(task_environment_.GetMainThreadTaskRunner(), params_) { time_between_callbacks_ = base::Microseconds( params_.frames_per_buffer() * base::Time::kMicrosecondsPerSecond / @@ -176,7 +179,10 @@ class FakeAudioWorkerMockTaskTest : public testing::Test { public: FakeAudioWorkerMockTaskTest() - : params_(AudioParameters::AUDIO_FAKE, CHANNEL_LAYOUT_STEREO, 44100, 128), + : params_(AudioParameters::AUDIO_FAKE, + ChannelLayoutConfig::Stereo(), + 44100, + 128), fake_worker_(task_runner_, params_) { DCHECK(!global_clock_); global_clock_ = task_runner_->GetMockTickClock();
diff --git a/media/base/mock_audio_renderer_sink.cc b/media/base/mock_audio_renderer_sink.cc index 4c7c656d..58adfadc 100644 --- a/media/base/mock_audio_renderer_sink.cc +++ b/media/base/mock_audio_renderer_sink.cc
@@ -20,7 +20,7 @@ device_id, device_status, AudioParameters(AudioParameters::AUDIO_FAKE, - CHANNEL_LAYOUT_STEREO, + ChannelLayoutConfig::Stereo(), AudioParameters::kTelephoneSampleRate, 1)) {}
diff --git a/media/base/silent_sink_suspender_unittest.cc b/media/base/silent_sink_suspender_unittest.cc index e9a69e3b..85dbedbcb 100644 --- a/media/base/silent_sink_suspender_unittest.cc +++ b/media/base/silent_sink_suspender_unittest.cc
@@ -19,7 +19,10 @@ class SilentSinkSuspenderTest : public testing::Test { public: SilentSinkSuspenderTest() - : params_(AudioParameters::AUDIO_FAKE, CHANNEL_LAYOUT_MONO, 44100, 128), + : params_(AudioParameters::AUDIO_FAKE, + ChannelLayoutConfig::Mono(), + 44100, + 128), mock_sink_(new testing::StrictMock<MockAudioRendererSink>()), fake_callback_(0.1, params_.sample_rate()), temp_bus_(AudioBus::Create(params_)),
diff --git a/media/base/test_helpers.cc b/media/base/test_helpers.cc index 3a870c0..a4d4878 100644 --- a/media/base/test_helpers.cc +++ b/media/base/test_helpers.cc
@@ -308,7 +308,7 @@ // static AudioParameters TestAudioParameters::Normal() { return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, - CHANNEL_LAYOUT_STEREO, 48000, 2048); + ChannelLayoutConfig::Stereo(), 48000, 2048); } template <class T>
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc index c97d695..8b6548f 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -570,6 +570,9 @@ return false; } + if (spatial_layer_resolutions.empty()) + return false; + scoped_refptr<VASurface> source_surface; { TRACE_EVENT0("media,gpu", "VAVEA::ImportGpuMemoryBufferToVASurface"); @@ -593,30 +596,36 @@ // Create input and reconstructed surfaces. TRACE_EVENT1("media,gpu", "VAVEA::ConstructSurfaces", "layers", spatial_layer_resolutions.size()); - input_surfaces->reserve(spatial_layer_resolutions.size()); - reconstructed_surfaces->reserve(spatial_layer_resolutions.size()); - for (const gfx::Size& encode_size : spatial_layer_resolutions) { - const bool engage_vpp = frame.visible_rect() != gfx::Rect(encode_size); + input_surfaces->resize(spatial_layer_resolutions.size()); + reconstructed_surfaces->resize(spatial_layer_resolutions.size()); + + // Process from uppermost layer, then use immediate upper layer as vpp source + // surface if applicable. + auto source_rect = frame.visible_rect(); + for (size_t i = spatial_layer_resolutions.size() - 1; i != std::variant_npos; + --i) { + const gfx::Size& encode_size = spatial_layer_resolutions[i]; + const bool engage_vpp = source_rect != gfx::Rect(encode_size); + // Crop and Scale input surface to a surface whose size is |encode_size|. // The size of a reconstructed surface is also |encode_size|. if (engage_vpp) { - auto blit_surface = ExecuteBlitSurface(*source_surface, - frame.visible_rect(), encode_size); - if (!blit_surface) - return false; - - input_surfaces->push_back(std::move(blit_surface)); + if (i + 1 < spatial_layer_resolutions.size()) { + source_surface = input_surfaces->at(i + 1); + source_rect = gfx::Rect(source_surface->size()); + } + input_surfaces->at(i) = + ExecuteBlitSurface(*source_surface, source_rect, encode_size); } else { - input_surfaces->emplace_back(source_surface); + input_surfaces->at(i) = source_surface; } - reconstructed_surfaces->emplace_back(CreateEncodeSurface(encode_size)); - if (!reconstructed_surfaces->back()) + reconstructed_surfaces->at(i) = CreateEncodeSurface(encode_size); + + if (!input_surfaces->at(i) || !reconstructed_surfaces->at(i)) return false; } - DCHECK(!base::Contains(*input_surfaces, nullptr)); - DCHECK(!base::Contains(*reconstructed_surfaces, nullptr)); return true; }
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator_unittest.cc index 55029d55..5a9e1d4 100644 --- a/media/gpu/vaapi/vaapi_video_encode_accelerator_unittest.cc +++ b/media/gpu/vaapi/vaapi_video_encode_accelerator_unittest.cc
@@ -506,7 +506,7 @@ std::vector<gfx::Size> svc_resolutions = GetDefaultSVCResolutions(num_spatial_layers); // Create Surfaces. - for (size_t i = 0; i < num_spatial_layers; ++i) { + for (size_t i = num_spatial_layers - 1; i != std::variant_npos; --i) { if (i < num_spatial_layers - 1) { if (va_vpp_dest_surface_ids_[i] == VA_INVALID_ID) { EXPECT_CALL( @@ -529,10 +529,10 @@ return va_surfaces; })); } - absl::optional<gfx::Rect> default_rect = gfx::Rect(kDefaultEncodeSize); + absl::optional<gfx::Rect> src_rect = gfx::Rect(svc_resolutions[i + 1]); absl::optional<gfx::Rect> layer_rect = gfx::Rect(svc_resolutions[i]); EXPECT_CALL(*mock_vpp_vaapi_wrapper_, - DoBlitSurface(_, _, default_rect, layer_rect, + DoBlitSurface(_, _, src_rect, layer_rect, VideoRotation::VIDEO_ROTATION_0)) .WillOnce(Return(true)); } @@ -565,9 +565,6 @@ } } - for (size_t i = 0; i < num_spatial_layers; ++i) { - } - // Create CodedBuffers in creating EncodeJobs. constexpr VABufferID kCodedBufferIds[] = {123, 124, 125}; for (size_t i = 0; i < num_spatial_layers; ++i) {
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index 9685cbd..a2ad488f 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc
@@ -2534,13 +2534,16 @@ "net", "has called DoneWithEntry", has_called_done_with_entry_since_last_do_cache_read_data_); + const char* writers_done_writing_to_entry_history = "N/A."; if (entry_) { const auto& call_history = entry_->writers_done_writing_to_entry_history; - SCOPED_CRASH_KEY_STRING32("net", "WritersDoneWritingToEntry is...", - !call_history.has_value() ? "not called" - : call_history.value() ? "called with success" - : "called with error"); + writers_done_writing_to_entry_history = + !call_history.has_value() ? "not called." + : call_history.value() ? "called with success." + : "called with error."; } + SCOPED_CRASH_KEY_STRING32("net", "WritersDoneWritingToEntry is ", + writers_done_writing_to_entry_history); CHECK_EQ(do_cache_read_data_last_call_, DoCacheReadDataLastCall::kDoCacheReadData);
diff --git a/net/http/http_cache_writers.h b/net/http/http_cache_writers.h index 5e5bb3a..89883373 100644 --- a/net/http/http_cache_writers.h +++ b/net/http/http_cache_writers.h
@@ -252,7 +252,7 @@ raw_ptr<HttpCache> const cache_ = nullptr; // Owner of |this|. - raw_ptr<ActiveEntry> const entry_ = nullptr; + raw_ptr<ActiveEntry, DanglingUntriaged> const entry_ = nullptr; std::unique_ptr<HttpTransaction> network_transaction_;
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index 027dbb6..125de01 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h
@@ -955,7 +955,7 @@ // Never access methods of the |delegate_| directly. Always use the // Notify... methods for this. - raw_ptr<Delegate> delegate_; + raw_ptr<Delegate, DanglingUntriaged> delegate_; const bool is_for_websockets_;
diff --git a/net/websockets/websocket_basic_handshake_stream.h b/net/websockets/websocket_basic_handshake_stream.h index 56fc995..86bda05f 100644 --- a/net/websockets/websocket_basic_handshake_stream.h +++ b/net/websockets/websocket_basic_handshake_stream.h
@@ -125,7 +125,8 @@ // Owned by another object. // |connect_delegate| will live during the lifetime of this object. - const raw_ptr<WebSocketStream::ConnectDelegate> connect_delegate_; + const raw_ptr<WebSocketStream::ConnectDelegate, DanglingUntriaged> + connect_delegate_; // This is stored in SendRequest() for use by ReadResponseHeaders(). raw_ptr<HttpResponseInfo> http_response_info_ = nullptr; @@ -153,7 +154,7 @@ // to avoid including extension-related header files here. std::unique_ptr<WebSocketExtensionParams> extension_params_; - const raw_ptr<WebSocketStreamRequestAPI> stream_request_; + const raw_ptr<WebSocketStreamRequestAPI, DanglingUntriaged> stream_request_; const raw_ptr<WebSocketEndpointLockManager> websocket_endpoint_lock_manager_;
diff --git a/net/websockets/websocket_handshake_stream_create_helper.h b/net/websockets/websocket_handshake_stream_create_helper.h index 1b7083b..3c4c5d9 100644 --- a/net/websockets/websocket_handshake_stream_create_helper.h +++ b/net/websockets/websocket_handshake_stream_create_helper.h
@@ -58,9 +58,10 @@ std::set<std::string> dns_aliases) override; private: - const raw_ptr<WebSocketStream::ConnectDelegate> connect_delegate_; + const raw_ptr<WebSocketStream::ConnectDelegate, DanglingUntriaged> + connect_delegate_; const std::vector<std::string> requested_subprotocols_; - const raw_ptr<WebSocketStreamRequestAPI> request_; + const raw_ptr<WebSocketStreamRequestAPI, DanglingUntriaged> request_; }; } // namespace net
diff --git a/services/device/geolocation/geolocation_context.cc b/services/device/geolocation/geolocation_context.cc index a41139a..6543569 100644 --- a/services/device/geolocation/geolocation_context.cc +++ b/services/device/geolocation/geolocation_context.cc
@@ -25,7 +25,7 @@ void GeolocationContext::BindGeolocation( mojo::PendingReceiver<mojom::Geolocation> receiver, - const GURL& requesting_origin) { + const GURL& requesting_url) { GeolocationImpl* impl = new GeolocationImpl(std::move(receiver), this); impls_.push_back(base::WrapUnique<GeolocationImpl>(impl)); if (geoposition_override_)
diff --git a/services/device/geolocation/geolocation_context.h b/services/device/geolocation/geolocation_context.h index ecde841c..0f2a118 100644 --- a/services/device/geolocation/geolocation_context.h +++ b/services/device/geolocation/geolocation_context.h
@@ -34,7 +34,7 @@ // mojom::GeolocationContext implementation: void BindGeolocation(mojo::PendingReceiver<mojom::Geolocation> receiver, - const GURL& requesting_origin) override; + const GURL& requesting_url) override; void SetOverride(mojom::GeopositionPtr geoposition) override; void ClearOverride() override;
diff --git a/services/device/public/cpp/test/scoped_geolocation_overrider.cc b/services/device/public/cpp/test/scoped_geolocation_overrider.cc index ddb67d0..41b2bcf 100644 --- a/services/device/public/cpp/test/scoped_geolocation_overrider.cc +++ b/services/device/public/cpp/test/scoped_geolocation_overrider.cc
@@ -41,7 +41,7 @@ // mojom::GeolocationContext implementation: void BindGeolocation(mojo::PendingReceiver<mojom::Geolocation> receiver, - const GURL& requesting_origin) override; + const GURL& requesting_url) override; void SetOverride(mojom::GeopositionPtr geoposition) override; void ClearOverride() override;
diff --git a/services/device/public/mojom/geolocation_context.mojom b/services/device/public/mojom/geolocation_context.mojom index 1917b33..256e4e1 100644 --- a/services/device/public/mojom/geolocation_context.mojom +++ b/services/device/public/mojom/geolocation_context.mojom
@@ -13,11 +13,11 @@ // instances created by this context. interface GeolocationContext { // Creates a Geolocation instance that is bound to the |request|. - // The |origin| is the origin of the top-level frame which the |request| from, + // The |url| is the URL of the top-level frame which the |request| from, // it is only used for |InstalledWebappGeolocationContext| to separate request // from different Trusted Web Activity client apps. BindGeolocation(pending_receiver<Geolocation> receiver, - url.mojom.Url origin); + url.mojom.Url url); // Enables geolocation override. This method can be used to trigger possible // location-specific behavior in GeolocationImpl created by this
diff --git a/services/network/conditional_cache_deletion_helper.h b/services/network/conditional_cache_deletion_helper.h index 3545f295..c37a2ee 100644 --- a/services/network/conditional_cache_deletion_helper.h +++ b/services/network/conditional_cache_deletion_helper.h
@@ -58,7 +58,7 @@ base::OnceClosure completion_callback_; std::unique_ptr<disk_cache::Backend::Iterator> iterator_; - raw_ptr<disk_cache::Entry> previous_entry_ = nullptr; + raw_ptr<disk_cache::Entry, DanglingUntriaged> previous_entry_ = nullptr; base::WeakPtrFactory<ConditionalCacheDeletionHelper> weak_factory_{this}; };
diff --git a/services/tracing/perfetto/privacy_filtered_fields-inl.h b/services/tracing/perfetto/privacy_filtered_fields-inl.h index 7535a076..2b5be1f 100644 --- a/services/tracing/perfetto/privacy_filtered_fields-inl.h +++ b/services/tracing/perfetto/privacy_filtered_fields-inl.h
@@ -593,7 +593,7 @@ // Proto Message: TracePacket constexpr int kTracePacketIndices[] = {6, 8, 10, 11, 12, 13, 35, 36, 41, 42, - 43, 44, 51, 54, 56, 58, 59, 60, -1}; + 43, 44, 51, 54, 56, 58, 59, 60, 87, -1}; constexpr MessageInfo const* kTracePacketComplexMessages[] = { &kClockSnapshot, nullptr, @@ -612,7 +612,8 @@ &kHeapGraph, nullptr, &kTracePacketDefaults, - &kTrackDescriptor}; + &kTrackDescriptor, + nullptr}; constexpr MessageInfo kTracePacket = {kTracePacketIndices, kTracePacketComplexMessages};
diff --git a/testing/buildbot/filters/android.emulator_n.chrome_public_test_apk.filter b/testing/buildbot/filters/android.emulator_n.chrome_public_test_apk.filter index 26c6dd6..dc91465f 100644 --- a/testing/buildbot/filters/android.emulator_n.chrome_public_test_apk.filter +++ b/testing/buildbot/filters/android.emulator_n.chrome_public_test_apk.filter
@@ -24,6 +24,3 @@ # TODO(crbug/1349958) -org.chromium.chrome.browser.autofill_assistant.AutofillAssistantOverlayIntegrationTest.testShowCastOnIFrameElementInScrollIFrame - -# TODO(crbug/1349966) --org.chromium.chrome.browser.signin.SyncConsentFragmentTest.testFRESyncConsentScreenWhenSelectedAccountIsRemoved
diff --git a/third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom b/third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom index 9fedb78..76e696ef6 100644 --- a/third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom +++ b/third_party/blink/public/mojom/direct_sockets/direct_sockets.mojom
@@ -25,11 +25,16 @@ kEnterprisePolicy = 6 }; +enum DirectSocketProtocolType { + kTcp = 0, + kUdp = 1, +}; + struct DirectSocketOptions { string? local_hostname; uint16 local_port = 0; - string? remote_hostname; + string remote_hostname; uint16 remote_port = 0; int32 send_buffer_size = 0;
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom index 026a6b9..4538070 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -3666,6 +3666,7 @@ kLCPCandidateImageFromOriginDirtyStyle = 4345, kV8TurboFanOsrCompileStarted = 4346, kV8Document_HasRedemptionRecord_Method = 4347, + kDeferredShaping2ReshapedByLastResort = 4348, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h index aef9218..d6c6e2f 100644 --- a/third_party/blink/public/platform/web_runtime_features.h +++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -113,6 +113,7 @@ BLINK_PLATFORM_EXPORT static void EnableFedCmIdpSignout(bool); BLINK_PLATFORM_EXPORT static void EnableFedCmIframeSupport(bool); BLINK_PLATFORM_EXPORT static void EnableFedCmMultipleIdentityProviders(bool); + BLINK_PLATFORM_EXPORT static void EnableFedCmIdpSigninStatus(bool); BLINK_PLATFORM_EXPORT static void EnableFencedFrames(bool); BLINK_PLATFORM_EXPORT static bool IsFencedFramesEnabled(); BLINK_PLATFORM_EXPORT static void EnableFileSystem(bool);
diff --git a/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h b/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h index e45c359..0ff54cbb 100644 --- a/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h +++ b/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h
@@ -71,14 +71,8 @@ MediaStreamVideoSource& operator=(const MediaStreamVideoSource&) = delete; ~MediaStreamVideoSource() override; - // Returns the MediaStreamVideoSource object owned by |source|. - // - // TODO(https://crbug.com/714136): Replace uses of this method in favor of - // the variant below. - static MediaStreamVideoSource* GetVideoSource( - const WebMediaStreamSource& source); - #if INSIDE_BLINK + // Returns the MediaStreamVideoSource object owned by |source|. static MediaStreamVideoSource* GetVideoSource(MediaStreamSource* source); #endif @@ -166,13 +160,6 @@ // must return a value. virtual absl::optional<media::VideoCaptureFormat> GetCurrentFormat() const; - // Implementations must return the capture parameters if available. - // Implementations supporting devices of type MEDIA_DEVICE_VIDEO_CAPTURE - // must return a value. The format in the returned VideoCaptureParams must - // coincide with the value returned by GetCurrentFormat(). - virtual absl::optional<media::VideoCaptureParams> GetCurrentCaptureParams() - const; - // Returns true if encoded output can be enabled in the source. virtual bool SupportsEncodedOutput() const;
diff --git a/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc b/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc index 3bb0b9b..8c15bfe 100644 --- a/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc +++ b/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc
@@ -76,6 +76,7 @@ #include "third_party/blink/renderer/core/html/html_div_element.h" #include "third_party/blink/renderer/core/html/html_element.h" #include "third_party/blink/renderer/core/html/html_li_element.h" +#include "third_party/blink/renderer/core/html/html_object_element.h" #include "third_party/blink/renderer/core/html/html_quote_element.h" #include "third_party/blink/renderer/core/html/html_span_element.h" #include "third_party/blink/renderer/core/html_names.h" @@ -981,7 +982,11 @@ // Should assert isLayoutBlockFlow || isInlineFlow when deletion improves. See // 4244964. - DCHECK(container->GetLayoutObject()) << container; + // Note: When `container` is newly created <object> as fallback content, it + // isn't associated to layout object. See http://crbug.com/1357082 + DCHECK(container->GetLayoutObject() || + Traversal<HTMLObjectElement>::FirstAncestor(*container)) + << container; auto* placeholder = MakeGarbageCollected<HTMLBRElement>(GetDocument()); AppendNode(placeholder, container, editing_state);
diff --git a/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.cc b/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.cc index 80d5e83..b8eb4f7 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.cc +++ b/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.cc
@@ -39,7 +39,6 @@ #include "third_party/blink/renderer/core/editing/visible_units.h" #include "third_party/blink/renderer/core/html/html_br_element.h" #include "third_party/blink/renderer/core/html/html_element.h" -#include "third_party/blink/renderer/core/html/html_object_element.h" #include "third_party/blink/renderer/core/html/html_quote_element.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/layout/layout_object.h" @@ -175,12 +174,6 @@ AppendNode(&child, parent, editing_state); if (editing_state->IsAborted()) return nullptr; - if (auto* html_object = DynamicTo<HTMLObjectElement>(ancestor)) { - if (html_object->UseFallbackContent()) { - To<HTMLObjectElement>(child).RenderFallbackContent( - HTMLObjectElement::ErrorEventPolicy::kDoNotDispatch); - } - } parent = &child; }
diff --git a/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command_test.cc b/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command_test.cc index 6d0ce13a..06854d4 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command_test.cc +++ b/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command_test.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.h" +#include "third_party/blink/renderer/core/dom/text.h" #include "third_party/blink/renderer/core/editing/ephemeral_range.h" #include "third_party/blink/renderer/core/editing/frame_selection.h" #include "third_party/blink/renderer/core/editing/selection_template.h" @@ -106,4 +107,26 @@ GetSelectionTextFromBody()); } +// http://crbug.com/1357082 +TEST_F(InsertParagraphSeparatorCommandTest, CrashWithObjectWithFloat) { + InsertStyleElement("object { float: right; }"); + GetDocument().setDesignMode("on"); + Selection().SetSelection( + SetSelectionTextToBody("<object><b>|ABC</b></object>"), + SetSelectionOptions()); + base::RunLoop().RunUntilIdle(); // prepare <object> fallback content + + Element& object_element = *GetDocument().QuerySelector("object"); + object_element.appendChild(Text::Create(GetDocument(), "XYZ")); + + auto* command = + MakeGarbageCollected<InsertParagraphSeparatorCommand>(GetDocument()); + + EXPECT_TRUE(command->Apply()); + EXPECT_EQ( + "<object><b><br></b></object>" + "<object><b>|ABC</b>XYZ</object>", + GetSelectionTextFromBody()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 252f70a..b9c8730 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -3826,6 +3826,8 @@ document->LayoutViewportWasResized(); if (frame_->IsMainFrame()) TextAutosizer::UpdatePageInfoInAllFrames(frame_); + if (auto* ds_controller = DeferredShapingController::From(*document)) + ds_controller->OnResizeFrame(); } void LocalFrameView::DidChangeScrollOffset() {
diff --git a/third_party/blink/renderer/core/frame/remote_frame.cc b/third_party/blink/renderer/core/frame/remote_frame.cc index b22d6eb..381083cd 100644 --- a/third_party/blink/renderer/core/frame/remote_frame.cc +++ b/third_party/blink/renderer/core/frame/remote_frame.cc
@@ -772,12 +772,10 @@ void RemoteFrame::UpdateOpener( const absl::optional<blink::FrameToken>& opener_frame_token) { - if (auto* web_frame = WebFrame::FromCoreFrame(this)) { - Frame* opener_frame = nullptr; - if (opener_frame_token) - opener_frame = Frame::ResolveFrame(opener_frame_token.value()); - SetOpenerDoNotNotify(opener_frame); - } + Frame* opener_frame = nullptr; + if (opener_frame_token) + opener_frame = Frame::ResolveFrame(opener_frame_token.value()); + SetOpenerDoNotNotify(opener_frame); } gfx::Size RemoteFrame::GetOutermostMainFrameSize() const { @@ -798,21 +796,18 @@ if (Opener() == opener_frame) return; - auto* web_frame = WebFrame::FromCoreFrame(this); - if (web_frame) { - // A proxy shouldn't normally be disowning its opener. It is possible to - // get here when a proxy that is being detached clears its opener, in - // which case there is no need to notify the browser process. - if (opener_frame) { - // Only a LocalFrame (i.e., the caller of window.open) should be able to - // update another frame's opener. - DCHECK(opener_frame->IsLocalFrame()); - GetRemoteFrameHostRemote().DidChangeOpener( - opener_frame - ? absl::optional<blink::LocalFrameToken>( - opener_frame->GetFrameToken().GetAs<LocalFrameToken>()) - : absl::nullopt); - } + // A proxy shouldn't normally be disowning its opener. It is possible to + // get here when a proxy that is being detached clears its opener, in + // which case there is no need to notify the browser process. + if (opener_frame) { + // Only a LocalFrame (i.e., the caller of window.open) should be able to + // update another frame's opener. + DCHECK(opener_frame->IsLocalFrame()); + GetRemoteFrameHostRemote().DidChangeOpener( + opener_frame + ? absl::optional<blink::LocalFrameToken>( + opener_frame->GetFrameToken().GetAs<LocalFrameToken>()) + : absl::nullopt); } SetOpenerDoNotNotify(opener_frame); }
diff --git a/third_party/blink/renderer/core/layout/deferred_shaping_controller.cc b/third_party/blink/renderer/core/layout/deferred_shaping_controller.cc index 25902078..799d45a1e 100644 --- a/third_party/blink/renderer/core/layout/deferred_shaping_controller.cc +++ b/third_party/blink/renderer/core/layout/deferred_shaping_controller.cc
@@ -11,6 +11,8 @@ namespace blink { +constexpr base::TimeDelta kMaximumDeferDuration = base::Seconds(5); + // static DeferredShapingController* DeferredShapingController::From( const Document& document) { @@ -58,6 +60,11 @@ DEFERRED_SHAPING_VLOG(1) << "Deferred " << deferred_elements_.size() << " elements"; UseCounter::Count(*document_, WebFeature::kDeferredShapingWorked); + reshaping_task_handle_ = PostDelayedCancellableTask( + *document_->GetTaskRunner(TaskType::kInternalDefault), FROM_HERE, + WTF::Bind(&DeferredShapingController::ReshapeAllDeferred, + WrapWeakPersistent(this), ReshapeReason::kLastResort), + kMaximumDeferDuration); } void DeferredShapingController::OnFirstContentfulPaint() { @@ -68,16 +75,17 @@ if (!default_allow_deferred_shaping_ && deferred_elements_.IsEmpty()) return; default_allow_deferred_shaping_ = false; + // Cancels the last resort task. + reshaping_task_handle_.Cancel(); reshaping_task_handle_ = PostCancellableTask( *document_->GetTaskRunner(TaskType::kInternalDefault), FROM_HERE, WTF::Bind(&DeferredShapingController::ReshapeAllDeferred, WrapWeakPersistent(this), ReshapeReason::kFcp)); } -void DeferredShapingController::ReshapeAllDeferred(ReshapeReason reason) { - default_allow_deferred_shaping_ = false; +size_t DeferredShapingController::ReshapeAllDeferredInternal() { if (deferred_elements_.IsEmpty()) - return; + return 0; size_t count = 0; for (auto& element : deferred_elements_) { if (!element->isConnected()) @@ -94,6 +102,12 @@ box->ClearLayoutResults(); } deferred_elements_.clear(); + return count; +} + +void DeferredShapingController::ReshapeAllDeferred(ReshapeReason reason) { + default_allow_deferred_shaping_ = false; + size_t count = ReshapeAllDeferredInternal(); if (count == 0) return; @@ -128,6 +142,10 @@ reason_string = "inspector"; feature = WebFeature::kDeferredShaping2ReshapedByInspector; break; + case ReshapeReason::kLastResort: + reason_string = "the last resort"; + feature = WebFeature::kDeferredShaping2ReshapedByLastResort; + break; case ReshapeReason::kPrinting: reason_string = "printing"; feature = WebFeature::kDeferredShaping2ReshapedByPrinting; @@ -161,4 +179,15 @@ ReshapeAllDeferred(ReshapeReason::kGeometryApi); } +void DeferredShapingController::OnResizeFrame() { + // This function does not clear default_allow_deferred_shaping_. + // We don't need precise geometry of a specific element, and it's ok + // to defer elements after the resize. + size_t count = ReshapeAllDeferredInternal(); + if (count <= 0) + return; + DEFERRED_SHAPING_VLOG(1) << "Reshaped all " << count + << " elements by resizing"; +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/deferred_shaping_controller.h b/third_party/blink/renderer/core/layout/deferred_shaping_controller.h index e4efaa9..c05aad9 100644 --- a/third_party/blink/renderer/core/layout/deferred_shaping_controller.h +++ b/third_party/blink/renderer/core/layout/deferred_shaping_controller.h
@@ -33,6 +33,7 @@ kFocus, kGeometryApi, kInspector, + kLastResort, kPrinting, kScrollingApi, }; @@ -106,8 +107,11 @@ // height. void ReshapeDeferredForHeight(const LayoutObject& object); void OnFirstContentfulPaint(); + void OnResizeFrame(); private: + size_t ReshapeAllDeferredInternal(); + Member<Document> document_; TaskHandle reshaping_task_handle_; HeapHashSet<Member<Element>> deferred_elements_;
diff --git a/third_party/blink/renderer/core/layout/deferred_shaping_test.cc b/third_party/blink/renderer/core/layout/deferred_shaping_test.cc index 8d7341a..3fcff21 100644 --- a/third_party/blink/renderer/core/layout/deferred_shaping_test.cc +++ b/third_party/blink/renderer/core/layout/deferred_shaping_test.cc
@@ -559,4 +559,20 @@ // PASS if no crash. } +TEST_F(DeferredShapingTest, ResizeFrame) { + SetBodyInnerHTML(R"HTML( + <div style="height:600px"></div> + <div id="target" style="height:800px">IFC</div> + <div id="target2">IFC2</div> + )HTML"); + UpdateAllLifecyclePhasesForTest(); + EXPECT_TRUE(IsDefer("target")); + + GetFrame().View()->SetLayoutSizeFixedToFrameSize(false); + GetFrame().View()->SetLayoutSize({800, 1200}); + UpdateAllLifecyclePhasesForTest(); + EXPECT_FALSE(IsDefer("target")); + EXPECT_TRUE(IsDefer("target2")); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc index fd31162..5ed6e08 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc
@@ -531,11 +531,8 @@ void NGInlineNode::ShapeTextOrDefer(const NGConstraintSpace& space) const { if (Data().shaping_state_ != NGInlineNodeData::kShapingNone) { - if (ShouldBeReshaped()) { - ShapeTextIncludingFirstLine(NGInlineNodeData::kShapingDone, MutableData(), - nullptr, nullptr); - } - return; + if (!ShouldBeReshaped()) + return; } NGInlineNodeData* data = MutableData();
diff --git a/third_party/blink/renderer/core/loader/web_bundle/web_bundle_loader.h b/third_party/blink/renderer/core/loader/web_bundle/web_bundle_loader.h index 0c5c533..f405a7d 100644 --- a/third_party/blink/renderer/core/loader/web_bundle/web_bundle_loader.h +++ b/third_party/blink/renderer/core/loader/web_bundle/web_bundle_loader.h
@@ -51,7 +51,7 @@ void OnWebBundleLoadFinished(bool success) override; const KURL& url() const { return url_; } - scoped_refptr<SecurityOrigin> GetSecurityOrigin() const { + scoped_refptr<const SecurityOrigin> GetSecurityOrigin() const { return security_origin_; } const base::UnguessableToken& WebBundleToken() const { @@ -69,7 +69,7 @@ Member<ThreadableLoader> loader_; LoadState load_state_ = LoadState::kInProgress; KURL url_; - scoped_refptr<SecurityOrigin> security_origin_; + scoped_refptr<const SecurityOrigin> security_origin_; base::UnguessableToken web_bundle_token_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; // We need ReceiverSet here because WebBundleHandle is cloned when
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index d13a58f..4fbf34b 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -2430,13 +2430,24 @@ } void AXObjectCacheImpl::ProcessDeferredAccessibilityEvents(Document& document) { + ProcessDeferredAccessibilityEventsImpl(document); + + // Accessibility is now clean: AXObjects can be safely traversed and + // AXObject's properties can be safely fetched. + for (auto agent : agents_) + agent->AXReadyCallback(document); + + // TODO(chrishtr) Accessibility serializations should happen now, on the + // condition that enough time has passed since the last serialization. +} + +void AXObjectCacheImpl::ProcessDeferredAccessibilityEventsImpl( + Document& document) { TRACE_EVENT0("accessibility", "ProcessDeferredAccessibilityEvents"); - if (document.Lifecycle().GetState() != DocumentLifecycle::kInAccessibility) { - NOTREACHED() << "Deferred events should only be processed during the " - "accessibility document lifecycle."; - return; - } + DCHECK(document.Lifecycle().GetState() == DocumentLifecycle::kInAccessibility) + << "Deferred events should only be processed during the " + "accessibility document lifecycle."; // When tree updates are paused, IsDirty() will return false. In this // situation we should not return early because we would never trigger the
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h index 6d58e9f..bdb5450f 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h
@@ -91,6 +91,9 @@ void AddInspectorAgent(InspectorAccessibilityAgent*); void RemoveInspectorAgent(InspectorAccessibilityAgent*); + // Ensure that a call to ProcessDeferredAccessibilityEvents() will occur soon. + void ScheduleVisualUpdate(Document& document); + void Dispose() override; void Freeze() override { is_frozen_ = true; } @@ -179,6 +182,7 @@ const LayoutRect&) override; void InlineTextBoxesUpdated(LayoutObject*) override; + // Called during the accessibility lifecycle to refresh the AX tree. void ProcessDeferredAccessibilityEvents(Document&) override; // Is there work to be done when layout becomes clean? bool IsDirty() const override; @@ -424,6 +428,7 @@ private: mojo::Remote<mojom::blink::RenderAccessibilityHost>& GetOrCreateRemoteRenderAccessibilityHost(); + void ProcessDeferredAccessibilityEventsImpl(Document&); HeapHashSet<WeakMember<InspectorAccessibilityAgent>> agents_; @@ -627,7 +632,6 @@ // setting enabled, or where there is no active ancestral aria-modal dialog. AXObject* AncestorAriaModalDialog(Node* node); - void ScheduleVisualUpdate(Document& document); void FireTreeUpdatedEventImmediately( Document& document, ax::mojom::blink::EventFrom event_from,
diff --git a/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h b/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h index 8f19fe3..737983a 100644 --- a/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h +++ b/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h
@@ -77,8 +77,17 @@ std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>*) override; + // An event was fired on the given AXObject, which should now also be + // considered modified (as if AXObjectModified was called on it). void AXEventFired(AXObject* object, ax::mojom::blink::Event event); + + // The given AXObject (and possibly entire |subtree|) has changed. void AXObjectModified(AXObject* object, bool subtree); + + // Called by the AXObjectCache when a11y is clean and it is safe to traverse + // the a11y tree and fetch object properties. + void AXReadyCallback(Document& document) {} + void RefreshFrontendNodes(TimerBase*); private:
diff --git a/third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl b/third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl index 2e8e24a..787d32d 100644 --- a/third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl +++ b/third_party/blink/renderer/modules/direct_sockets/tcp_socket.idl
@@ -8,6 +8,7 @@ Exposed=(Window,Worker), ActiveScriptWrappable, SecureContext, + RuntimeEnabled=DirectSockets, IsolatedApplication ] interface TCPSocket { [CallWith=ScriptState, RaisesException]
diff --git a/third_party/blink/renderer/modules/direct_sockets/udp_socket.idl b/third_party/blink/renderer/modules/direct_sockets/udp_socket.idl index 9d79322..9c3aa82 100644 --- a/third_party/blink/renderer/modules/direct_sockets/udp_socket.idl +++ b/third_party/blink/renderer/modules/direct_sockets/udp_socket.idl
@@ -8,6 +8,7 @@ Exposed=(Window,Worker), ActiveScriptWrappable, SecureContext, + RuntimeEnabled=DirectSockets, IsolatedApplication ] interface UDPSocket { [CallWith=ScriptState, RaisesException]
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc index a95cb91..579e1b4 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc
@@ -185,12 +185,6 @@ return capture_params_.requested_format; } -absl::optional<media::VideoCaptureParams> -MediaStreamVideoCapturerSource::GetCurrentCaptureParams() const { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - return capture_params_; -} - void MediaStreamVideoCapturerSource::ChangeSourceImpl( const MediaStreamDevice& new_device) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h index cd1f677..e425819 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h
@@ -92,8 +92,6 @@ void StopSourceForRestartImpl() override; void RestartSourceImpl(const media::VideoCaptureFormat& new_format) override; absl::optional<media::VideoCaptureFormat> GetCurrentFormat() const override; - absl::optional<media::VideoCaptureParams> GetCurrentCaptureParams() - const override; void ChangeSourceImpl(const MediaStreamDevice& new_device) override; #if !BUILDFLAG(IS_ANDROID) void Crop(const base::Token& crop_id,
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc index 0436d7b..50d3e36 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc
@@ -184,7 +184,7 @@ EXPECT_EQ(MediaStreamSource::kReadyStateLive, stream_source_->GetReadyState()); EXPECT_FALSE(source_stopped_); - EXPECT_TRUE(video_capturer_source_->GetCurrentCaptureParams().has_value()); + EXPECT_TRUE(video_capturer_source_->GetCurrentFormat().has_value()); // If the delegate stops, the source should stop. EXPECT_CALL(mock_delegate(), MockStopCapture());
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc index 06ef8e1c..089b172 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_source.cc
@@ -33,15 +33,6 @@ // static MediaStreamVideoSource* MediaStreamVideoSource::GetVideoSource( - const WebMediaStreamSource& source) { - if (source.IsNull() || source.GetType() != WebMediaStreamSource::kTypeVideo) { - return nullptr; - } - return static_cast<MediaStreamVideoSource*>(source.GetPlatformSource()); -} - -// static -MediaStreamVideoSource* MediaStreamVideoSource::GetVideoSource( MediaStreamSource* source) { if (!source || source->GetType() != MediaStreamSource::kTypeVideo) { return nullptr; @@ -375,12 +366,6 @@ return absl::optional<media::VideoCaptureFormat>(); } -absl::optional<media::VideoCaptureParams> -MediaStreamVideoSource::GetCurrentCaptureParams() const { - DCHECK(GetTaskRunner()->BelongsToCurrentThread()); - return absl::optional<media::VideoCaptureParams>(); -} - size_t MediaStreamVideoSource::CountEncodedSinks() const { return std::accumulate(tracks_.begin(), tracks_.end(), size_t(0), [](size_t accum, MediaStreamVideoTrack* track) {
diff --git a/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.cc b/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.cc index 12e34188..5a49cb6 100644 --- a/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.cc +++ b/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.cc
@@ -101,13 +101,6 @@ return absl::optional<media::VideoCaptureFormat>(format_); } -absl::optional<media::VideoCaptureParams> -MockMediaStreamVideoSource::GetCurrentCaptureParams() const { - media::VideoCaptureParams params; - params.requested_format = format_; - return params; -} - void MockMediaStreamVideoSource::DeliverVideoFrame( scoped_refptr<media::VideoFrame> frame) { DCHECK(!is_stopped_for_restart_);
diff --git a/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h b/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h index edd7df7..0195d28 100644 --- a/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h +++ b/third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h
@@ -78,8 +78,6 @@ // Implements blink::MediaStreamVideoSource. void RequestRefreshFrame() override; - absl::optional<media::VideoCaptureParams> GetCurrentCaptureParams() - const override; void OnHasConsumers(bool has_consumers) override; base::WeakPtr<MediaStreamVideoSource> GetWeakPtr() const override;
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_client_test.cc b/third_party/blink/renderer/modules/mediastream/user_media_client_test.cc index d937d55..2f9c61476 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_client_test.cc +++ b/third_party/blink/renderer/modules/mediastream/user_media_client_test.cc
@@ -554,11 +554,16 @@ } void CallGetOpenDevice( + const MediaConstraints& audio, + const MediaConstraints& video, const base::UnguessableToken& session_id, const base::UnguessableToken& transfer_id, TransferredMediaStreamTrack* transferred_media_stream_track) { - UserMediaRequest* user_media_request = UserMediaRequest::CreateForTesting( - CreateDefaultConstraints(), CreateDefaultConstraints()); + UserMediaRequest* user_media_request = + MakeGarbageCollected<UserMediaRequest>( + nullptr, nullptr, UserMediaRequestType::kDisplayMedia, audio, video, + /*should_prefer_current_tab=*/false, + /*auto_select_all_screens=*/false, nullptr, IdentifiableSurface()); user_media_request->SetTransferData(session_id, transfer_id, transferred_media_stream_track); @@ -787,8 +792,9 @@ stream_devices.video_device.value().set_session_id(data.session_id); mock_dispatcher_host_.SetStreamDevices(stream_devices); - user_media_client_impl_->CallGetOpenDevice(data.session_id, data.transfer_id, - transferred_media_stream_track); + user_media_client_impl_->CallGetOpenDevice( + MediaConstraints(), CreateDefaultConstraints(), data.session_id, + data.transfer_id, transferred_media_stream_track); StartMockedVideoSource(); EXPECT_EQ(kRequestSucceeded, request_state()); @@ -821,8 +827,9 @@ stream_devices.audio_device.value().set_session_id(data.session_id); mock_dispatcher_host_.SetStreamDevices(stream_devices); - user_media_client_impl_->CallGetOpenDevice(data.session_id, data.transfer_id, - transferred_media_stream_track); + user_media_client_impl_->CallGetOpenDevice( + CreateDefaultConstraints(), MediaConstraints(), data.session_id, + data.transfer_id, transferred_media_stream_track); EXPECT_EQ(kRequestSucceeded, request_state()); EXPECT_EQ("microphone",
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_processor.cc b/third_party/blink/renderer/modules/mediastream/user_media_processor.cc index 3751243..884a1c2 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_processor.cc +++ b/third_party/blink/renderer/modules/mediastream/user_media_processor.cc
@@ -1061,6 +1061,8 @@ OnStreamGenerated(request_id, result, response->label, std::move(stream_devices_set), response->pan_tilt_zoom_allowed); + current_request_info_->request()->FinalizeTransferredTrackInitialization( + *current_request_info_->descriptors()); } void UserMediaProcessor::OnStreamGenerated( @@ -1765,7 +1767,11 @@ MediaStreamRequestResultToString(MediaStreamRequestResult::OK))); blink::LogUserMediaRequestResult(MediaStreamRequestResult::OK); DeleteUserMediaRequest(user_media_request); - user_media_request->Succeed(*components); + if (!user_media_request->IsTransferredTrackRequest()) { + // For transferred tracks, user_media_request has already been resolved in + // FinalizeTransferredTrackInitialization. + user_media_request->Succeed(*components); + } } void UserMediaProcessor::GetUserMediaRequestFailed(
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_request.cc b/third_party/blink/renderer/modules/mediastream/user_media_request.cc index c73be38..a8c141e 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_request.cc +++ b/third_party/blink/renderer/modules/mediastream/user_media_request.cc
@@ -654,21 +654,13 @@ void UserMediaRequest::Succeed( const MediaStreamDescriptorVector& streams_descriptors) { DCHECK(!is_resolved_); - DCHECK(transferred_track_ == nullptr || streams_descriptors.size() == 1u); + DCHECK(transferred_track_ == nullptr); if (!GetExecutionContext()) return; - if (transferred_track_) { - MediaStream::Create(GetExecutionContext(), streams_descriptors[0], - transferred_track_, - WTF::Bind(&UserMediaRequest::OnMediaStreamInitialized, - WrapPersistent(this))); - } else { - MediaStreamSet::Create( - GetExecutionContext(), streams_descriptors, - WTF::Bind(&UserMediaRequest::OnMediaStreamsInitialized, - WrapPersistent(this))); - } + MediaStreamSet::Create(GetExecutionContext(), streams_descriptors, + WTF::Bind(&UserMediaRequest::OnMediaStreamsInitialized, + WrapPersistent(this))); } void UserMediaRequest::OnMediaStreamInitialized(MediaStream* stream) { @@ -795,6 +787,19 @@ transferred_track_->SetComponentImplementation(component); } +void UserMediaRequest::FinalizeTransferredTrackInitialization( + const MediaStreamDescriptorVector& streams_descriptors) { + DCHECK(transferred_track_); + DCHECK_EQ(streams_descriptors.size(), 1u); + if (!GetExecutionContext()) + return; + + MediaStream::Create(GetExecutionContext(), streams_descriptors[0], + transferred_track_, + WTF::Bind(&UserMediaRequest::OnMediaStreamInitialized, + WrapPersistent(this))); +} + void UserMediaRequest::Trace(Visitor* visitor) const { visitor->Trace(client_); visitor->Trace(callbacks_);
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_request.h b/third_party/blink/renderer/modules/mediastream/user_media_request.h index b320af0..11483d5 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_request.h +++ b/third_party/blink/renderer/modules/mediastream/user_media_request.h
@@ -192,6 +192,10 @@ return !!transferred_track_session_id_; } void SetTransferredTrackComponent(MediaStreamComponent* component); + // Completes the re-creation of the transferred MediaStreamTrack by + // constructing the MediaStreamTrackImpl object. + void FinalizeTransferredTrackInitialization( + const MediaStreamDescriptorVector& streams_descriptors); void Trace(Visitor*) const override;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.cc b/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.cc index 6dfa7545..5e0b888 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.cc
@@ -15,7 +15,6 @@ X(maxTextureDimension3D) \ X(maxTextureArrayLayers) \ X(maxBindGroups) \ - X(maxBindingsPerBindGroup) \ X(maxDynamicUniformBuffersPerPipelineLayout) \ X(maxDynamicStorageBuffersPerPipelineLayout) \ X(maxSampledTexturesPerShaderStage) \
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.h b/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.h index a43cdb4..149cde41 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.h
@@ -34,7 +34,6 @@ unsigned maxTextureDimension3D() const; unsigned maxTextureArrayLayers() const; unsigned maxBindGroups() const; - unsigned maxBindingsPerBindGroup() const; unsigned maxDynamicUniformBuffersPerPipelineLayout() const; unsigned maxDynamicStorageBuffersPerPipelineLayout() const; unsigned maxSampledTexturesPerShaderStage() const;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.idl b/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.idl index a94ae285..c6c19bf 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.idl +++ b/third_party/blink/renderer/modules/webgpu/gpu_supported_limits.idl
@@ -13,7 +13,6 @@ readonly attribute unsigned long maxTextureDimension3D; readonly attribute unsigned long maxTextureArrayLayers; readonly attribute unsigned long maxBindGroups; - readonly attribute unsigned long maxBindingsPerBindGroup; readonly attribute unsigned long maxDynamicUniformBuffersPerPipelineLayout; readonly attribute unsigned long maxDynamicStorageBuffersPerPipelineLayout; readonly attribute unsigned long maxSampledTexturesPerShaderStage;
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc index e635b0d..472f89e 100644 --- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc +++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -667,6 +667,10 @@ RuntimeEnabledFeatures::SetFedCmMultipleIdentityProvidersEnabled(enable); } +void WebRuntimeFeatures::EnableFedCmIdpSigninStatus(bool enable) { + RuntimeEnabledFeatures::SetFedCmIdpSigninStatusEnabled(enable); +} + void WebRuntimeFeatures::EnableDocumentTransition(bool enable) { RuntimeEnabledFeatures::SetDocumentTransitionEnabled(enable); }
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 1a1bd4b0a..b82ca1d 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -836,7 +836,7 @@ }, { name: "DirectSockets", - status: "test", + status: "experimental", }, { name: "DisableDifferentOriginSubframeDialogSuppression", @@ -990,6 +990,10 @@ status: "test", }, { + name: "FedCmIdpSigninStatus", + status: "test", + }, + { name: "FedCmIdpSignout", status: "test", },
diff --git a/third_party/blink/renderer/platform/video_capture/video_capture_impl.cc b/third_party/blink/renderer/platform/video_capture/video_capture_impl.cc index 0b0cabc..ed311fd 100644 --- a/third_party/blink/renderer/platform/video_capture/video_capture_impl.cc +++ b/third_party/blink/renderer/platform/video_capture/video_capture_impl.cc
@@ -113,6 +113,9 @@ VideoFrameBufferHandleType buffer_type() const { return buffer_type_; } const uint8_t* data() const { return data_; } size_t data_size() const { return data_size_; } + const base::ReadOnlySharedMemoryRegion* read_only_shmem_region() const { + return &read_only_shmem_region_; + } const Vector<gpu::MailboxHolder>& mailbox_holders() const { return mailbox_holders_; } @@ -194,6 +197,7 @@ DCHECK(read_only_mapping_.IsValid()); data_ = read_only_mapping_.GetMemoryAsSpan<uint8_t>().data(); data_size_ = read_only_mapping_.size(); + read_only_shmem_region_ = std::move(region); } void InitializeFromMailbox( @@ -230,6 +234,7 @@ base::WritableSharedMemoryMapping writable_mapping_; // Only valid for |buffer_type_ == READ_ONLY_SHMEM_REGION|. + base::ReadOnlySharedMemoryRegion read_only_shmem_region_; base::ReadOnlySharedMemoryMapping read_only_mapping_; // Only valid for |buffer_type == GPU_MEMORY_BUFFER_HANDLE| @@ -333,6 +338,7 @@ frame_info_->visible_rect.size(), const_cast<uint8_t*>(buffer_context_->data()), buffer_context_->data_size(), frame_info_->timestamp); + frame_->BackWithSharedMemory(buffer_context_->read_only_shmem_region()); break; case VideoFrameBufferHandleType::kSharedMemoryViaRawFileDescriptor: NOTREACHED();
diff --git a/third_party/blink/renderer/platform/webrtc/peer_connection_remote_audio_source.cc b/third_party/blink/renderer/platform/webrtc/peer_connection_remote_audio_source.cc index 4daf0d8..dc839af 100644 --- a/third_party/blink/renderer/platform/webrtc/peer_connection_remote_audio_source.cc +++ b/third_party/blink/renderer/platform/webrtc/peer_connection_remote_audio_source.cc
@@ -159,9 +159,10 @@ params.channels() != channels_int || params.sample_rate() != sample_rate || params.frames_per_buffer() != frames_int) { - MediaStreamAudioSource::SetFormat(media::AudioParameters( - media::AudioParameters::AUDIO_PCM_LOW_LATENCY, - media::GuessChannelLayout(channels_int), sample_rate, frames_int)); + MediaStreamAudioSource::SetFormat( + media::AudioParameters(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, + media::ChannelLayoutConfig::Guess(channels_int), + sample_rate, frames_int)); } MediaStreamAudioSource::DeliverDataToTracks(*audio_bus_, playout_time);
diff --git a/third_party/zlib/contrib/tests/fuzzers/BUILD.gn b/third_party/zlib/contrib/tests/fuzzers/BUILD.gn index 10abe00..6e5cbac 100644 --- a/third_party/zlib/contrib/tests/fuzzers/BUILD.gn +++ b/third_party/zlib/contrib/tests/fuzzers/BUILD.gn
@@ -18,6 +18,11 @@ deps = [ "../../../:zlib" ] } +fuzzer_test("zlib_inflate_with_header_fuzzer") { + sources = [ "inflate_with_header_fuzzer.cc" ] + deps = [ "../../../:zlib" ] +} + fuzzer_test("zlib_streaming_inflate_fuzzer") { sources = [ "streaming_inflate_fuzzer.cc" ] deps = [ "../../../:zlib" ]
diff --git a/third_party/zlib/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc b/third_party/zlib/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc new file mode 100644 index 0000000..be643e4 --- /dev/null +++ b/third_party/zlib/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc
@@ -0,0 +1,87 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <algorithm> +#include <memory> + +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + +#include <fuzzer/FuzzedDataProvider.h> + +#include "third_party/zlib/zlib.h" + +// Fuzzer builds often have NDEBUG set, so roll our own assert macro. +#define ASSERT(cond) \ + do { \ + if (!(cond)) { \ + fprintf(stderr, "%s:%d Assert failed: %s\n", __FILE__, __LINE__, #cond); \ + exit(1); \ + } \ + } while (0) + +static void chunked_inflate(gz_header* header, + uint8_t* data, + size_t size, + size_t in_chunk_size, + size_t out_chunk_size) { + z_stream stream; + stream.next_in = data; + stream.avail_in = 0; + stream.zalloc = Z_NULL; + stream.zfree = Z_NULL; + + static const int kDefaultWindowBits = MAX_WBITS; + static const int kGzipOrZlibHeader = 32; + ASSERT(inflateInit2(&stream, kDefaultWindowBits + kGzipOrZlibHeader) == Z_OK); + ASSERT(inflateGetHeader(&stream, header) == Z_OK); + + auto out_buffer = std::make_unique<uint8_t[]>(out_chunk_size); + while (true) { + stream.next_in = &data[stream.total_in]; + stream.avail_in = std::min(in_chunk_size, size - stream.total_in); + stream.next_out = out_buffer.get(); + stream.avail_out = out_chunk_size; + + if (inflate(&stream, stream.avail_in == 0 ? Z_SYNC_FLUSH : Z_NO_FLUSH) != + Z_OK) { + break; + } + } + + inflateEnd(&stream); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + FuzzedDataProvider fdp(data, size); + + // Fuzz zlib's inflate() with inflateGetHeader() enabled, various sizes for + // the gz_header field sizes, and various-sized chunks for input/output. This + // would have found CVE-2022-37434 which was a heap buffer read overflow when + // filling in gz_header's extra field. + + gz_header header; + header.extra_max = fdp.ConsumeIntegralInRange(0, 100000); + header.name_max = fdp.ConsumeIntegralInRange(0, 100000); + header.comm_max = fdp.ConsumeIntegralInRange(0, 100000); + + auto extra_buf = std::make_unique<uint8_t[]>(header.extra_max); + auto name_buf = std::make_unique<uint8_t[]>(header.name_max); + auto comment_buf = std::make_unique<uint8_t[]>(header.comm_max); + + header.extra = extra_buf.get(); + header.name = name_buf.get(); + header.comment = comment_buf.get(); + + int in_chunk_size = fdp.ConsumeIntegralInRange(1, 4097); + int out_chunk_size = fdp.ConsumeIntegralInRange(1, 4097); + std::vector<uint8_t> remaining_data = fdp.ConsumeRemainingBytes<uint8_t>(); + + chunked_inflate(&header, remaining_data.data(), remaining_data.size(), + in_chunk_size, out_chunk_size); + + return 0; +}
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 55d2e0f..c3c3c3a 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -28831,14 +28831,6 @@ <int value="5" label="Drive disabled"/> </enum> -<enum name="DriveZeroStateProviderThrottleInterval"> - <int value="0" label="Unknown"/> - <int value="1" label="5 minutes"/> - <int value="2" label="10 minutes"/> - <int value="3" label="15 minutes"/> - <int value="4" label="30 minutes"/> -</enum> - <enum name="DspHotwordDetectionStatus"> <int value="0" label="HARDWARE_ACCEPTED"/> <int value="1" label="SOFTWARE_REJECTED"/> @@ -41238,6 +41230,7 @@ <int value="4345" label="LCPCandidateImageFromOriginDirtyStyle"/> <int value="4346" label="V8TurboFanOsrCompileStarted"/> <int value="4347" label="V8Document_HasRedemptionRecord_Method"/> + <int value="4348" label="DeferredShaping2ReshapedByLastResort"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -41428,6 +41421,7 @@ <int value="29" label="UserInterfaceTimedOut"/> <int value="30" label="RpPageNotVisible"/> <int value="31" label="ShouldEmbargo"/> + <int value="32" label="NotSignedInWithIdp"/> </enum> <enum name="FedCmRevokeStatus">
diff --git a/tools/metrics/histograms/metadata/apps/histograms.xml b/tools/metrics/histograms/metadata/apps/histograms.xml index ddf0974..0551314 100644 --- a/tools/metrics/histograms/metadata/apps/histograms.xml +++ b/tools/metrics/histograms/metadata/apps/histograms.xml
@@ -467,18 +467,6 @@ </summary> </histogram> -<histogram name="Apps.AppList.DriveZeroStateProvider.HypotheticalQuery" - enum="DriveZeroStateProviderThrottleInterval" expires_after="2023-02-12"> - <owner>tby@chromium.org</owner> - <owner>thanhdng@chromium.org</owner> - <owner>wrong@chromium.org</owner> - <summary> - We intend to change the query trigger logic for ItemSuggest. This records an - event each time we would query ItemSuggest under the new logic, recorded - separately for each throttling interval. To be used for evaluating QPS. - </summary> -</histogram> - <histogram name="Apps.AppList.DriveZeroStateProvider.Latency" units="ms" expires_after="2023-02-12"> <owner>tby@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index cdc828b..61b41fa 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -2307,6 +2307,19 @@ <summary>Tracks the sign-in events on an enrolled device.</summary> </histogram> +<histogram name="Enterprise.VerifiedAccess.SAML.DeviceTrustMatchesEndpoints" + enum="Boolean" expires_after="2023-08-01"> + <owner>lmasopust@google.com</owner> + <owner>rodmartin@chromium.org</owner> + <owner>cbe-device-trust-eng@google.com</owner> + <summary> + Recorded when building a response for a challenge from Verified Access + server for remote attestation during SAML authentication. This captures if + Device Trust is configured alongside Verified Access for the current + endpoint or not. + </summary> +</histogram> + <histogram name="Enterprise.VPDCacheReadResult" enum="VPDCacheReadResult" expires_after="2023-01-01"> <owner>vsavu@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index 4fbe1415..391c8670 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -1134,6 +1134,17 @@ </summary> </histogram> +<histogram name="PasswordManager.CanUseBiometricsMac" enum="BooleanSuccess" + expires_after="M112"> + <owner>vsemeniuk@google.com</owner> + <owner>kazinova@google.com</owner> + <owner>sygiet@google.com</owner> + <summary> + If user have enabled biometric authentication on their device. It is + recorded whenever BiometricAuthenticatorMac::CanAuthenticate is called. + </summary> +</histogram> + <histogram name="PasswordManager.CapabilitiesService.HttpResponseCode" enum="HttpResponseCode" expires_after="2023-02-14"> <owner>vizcay@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/signin/histograms.xml b/tools/metrics/histograms/metadata/signin/histograms.xml index 4afa51e5..0569189b 100644 --- a/tools/metrics/histograms/metadata/signin/histograms.xml +++ b/tools/metrics/histograms/metadata/signin/histograms.xml
@@ -1255,7 +1255,7 @@ </histogram> <histogram name="Signin.UserRequestedWipeDataOnSignout" enum="BooleanRequested" - expires_after="2022-10-09"> + expires_after="2023-10-09"> <owner>triploblastic@google.com</owner> <owner>bsazonov@chromium.org</owner> <summary>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 6ddb6f61..d598ee5d 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,24 +5,24 @@ "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm64/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "win": { - "hash": "558209a5f281ce750fbd7dbd1ec77a2e89a87171", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/85910f22b620e71323e7681d8b3c6689aaf4aa1a/trace_processor_shell.exe" + "hash": "7664ca70d949b01cff796606ac683dc9a78edc6a", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/d440eedcd02a42ff9696198bd7f7ee3693a0cb42/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "mac": { - "hash": "a8799c1d5dfcbb98688649856f527dc412f45364", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/85910f22b620e71323e7681d8b3c6689aaf4aa1a/trace_processor_shell" + "hash": "01f45911243f77f13533d8b5e4b31e2f06f30af9", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/d440eedcd02a42ff9696198bd7f7ee3693a0cb42/trace_processor_shell" }, "mac_arm64": { "hash": "e1ad4861384b06d911a65f035317914b8cc975c6", "full_remote_path": "perfetto-luci-artifacts/v25.0/mac-arm64/trace_processor_shell" }, "linux": { - "hash": "14da0c92972850febdbc2e7c611ce51ddbf657c4", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/85910f22b620e71323e7681d8b3c6689aaf4aa1a/trace_processor_shell" + "hash": "28c5f7aad740c980709a77956c8545b9f25d7e58", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/e5f4582104f08abdd38246c6085684dc1c4e8112/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/ui/base/ui_base_types.h b/ui/base/ui_base_types.h index de4a1a4..47a6b05c 100644 --- a/ui/base/ui_base_types.h +++ b/ui/base/ui_base_types.h
@@ -9,6 +9,8 @@ #include <type_traits> #include "base/component_export.h" +#include "build/build_config.h" +#include "build/chromeos_buildflags.h" #include "ui/gfx/geometry/rect.h" namespace ui { @@ -35,6 +37,21 @@ SHOW_STATE_END = 6 // The end of show state enum. }; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +// Specifies which edges of the window are tiled. +struct WindowTiledEdges { + bool left{false}; + bool right{false}; + bool top{false}; + bool bottom{false}; + + bool operator!=(const WindowTiledEdges& other) const { + return left != other.left || right != other.right || top != other.top || + bottom != other.bottom; + } +}; +#endif // IS_LINUX || IS_CHROMEOS_LACROS + // Dialog button identifiers used to specify which buttons to show the user. enum DialogButton { DIALOG_BUTTON_NONE = 0,
diff --git a/ui/file_manager/file_manager/foreground/elements/files_format_dialog.js b/ui/file_manager/file_manager/foreground/elements/files_format_dialog.js index 163db047..578356b 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_format_dialog.js +++ b/ui/file_manager/file_manager/foreground/elements/files_format_dialog.js
@@ -8,7 +8,7 @@ import 'chrome://resources/cr_elements/icons.m.js'; import 'chrome://resources/cr_elements/md_select.css.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; -import 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
diff --git a/ui/file_manager/file_manager/foreground/elements/files_toast.js b/ui/file_manager/file_manager/foreground/elements/files_toast.js index 5a958ac..42b48ff 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_toast.js +++ b/ui/file_manager/file_manager/foreground/elements/files_toast.js
@@ -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 'chrome://resources/cr_elements/shared_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_shared_style.css.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_toast/cr_toast.js';
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc index 6409019f..b64cecb6 100644 --- a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc +++ b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.cc
@@ -71,6 +71,12 @@ receiver_.reset(); } +void WaylandBufferManagerHost::OnCommitOverlayError( + const std::string& message) { + error_message_ = message; + TerminateGpuProcess(); +} + wl::BufferFormatsWithModifiersMap WaylandBufferManagerHost::GetSupportedBufferFormats() const { return connection_->wayland_buffer_factory()->GetSupportedBufferFormats(); @@ -279,13 +285,6 @@ if (!window) return; - for (auto& overlay : overlays) { - if (!ValidateOverlayData(overlay)) { - TerminateGpuProcess(); - return; - } - } - window->CommitOverlays(frame_id, overlays); } @@ -407,23 +406,6 @@ return error_message_.empty(); } -bool WaylandBufferManagerHost::ValidateOverlayData( - const wl::WaylandOverlayConfig& overlay_data) { - if (std::isnan(overlay_data.bounds_rect.x()) || - std::isnan(overlay_data.bounds_rect.y()) || - std::isnan(overlay_data.bounds_rect.width()) || - std::isnan(overlay_data.bounds_rect.height()) || - std::isinf(overlay_data.bounds_rect.x()) || - std::isinf(overlay_data.bounds_rect.y()) || - std::isinf(overlay_data.bounds_rect.width()) || - std::isinf(overlay_data.bounds_rect.height())) { - error_message_ = "Overlay bounds_rect is invalid (NaN or infinity)."; - return false; - } - - return true; -} - void WaylandBufferManagerHost::OnSubmission(gfx::AcceleratedWidget widget, uint32_t frame_id, const gfx::SwapResult& swap_result,
diff --git a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h index 0109078b..84928c9 100644 --- a/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h +++ b/ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h
@@ -60,6 +60,9 @@ // destroyed. void OnChannelDestroyed(); + // Called by WaylandFrameManager if overlay data is invalid. + void OnCommitOverlayError(const std::string& message); + // Returns supported buffer formats either from zwp_linux_dmabuf or wl_drm. wl::BufferFormatsWithModifiersMap GetSupportedBufferFormats() const; @@ -154,7 +157,6 @@ uint32_t buffer_id); bool ValidateDataFromGpu(const gfx::Size& size, uint32_t buffer_id); bool ValidateBufferExistence(uint32_t buffer_id); - bool ValidateOverlayData(const wl::WaylandOverlayConfig& overlay_data); // Terminates the GPU process on invalid data received void TerminateGpuProcess();
diff --git a/ui/ozone/platform/wayland/host/wayland_frame_manager.cc b/ui/ozone/platform/wayland/host/wayland_frame_manager.cc index 1985bd0d..6dd6d50 100644 --- a/ui/ozone/platform/wayland/host/wayland_frame_manager.cc +++ b/ui/ozone/platform/wayland/host/wayland_frame_manager.cc
@@ -25,6 +25,16 @@ constexpr uint32_t kMaxNumberOfFrames = 20u; +constexpr char kBoundsRectNanOrInf[] = + "Overlay bounds_rect is invalid (NaN or infinity)."; + +bool ValidateRect(const gfx::RectF& rect) { + return !std::isnan(rect.x()) && !std::isnan(rect.y()) && + !std::isnan(rect.width()) && !std::isnan(rect.height()) && + !std::isinf(rect.x()) && !std::isinf(rect.y()) && + !std::isinf(rect.width()) && !std::isinf(rect.height()); +} + uint32_t GetPresentationKindFlags(uint32_t flags) { // Wayland spec has different meaning of VSync. In Chromium, VSync means to // update the begin frame vsync timing based on presentation feedback. @@ -144,7 +154,11 @@ // ack_configure requests being issued. const wl::WaylandOverlayConfig& config = frame->root_config; if (!frame->buffer_lost && !!config.buffer_id) { - window_->UpdateVisualSize(gfx::ToRoundedSize(config.bounds_rect.size())); + if (!ValidateRect(config.bounds_rect)) { + fatal_error_message_ = kBoundsRectNanOrInf; + } else { + window_->UpdateVisualSize(gfx::ToRoundedSize(config.bounds_rect.size())); + } } // Skip this frame if: @@ -154,13 +168,21 @@ // is still out-of-sync with the pending configure sequences received from // the Wayland compositor. This avoids protocol errors as observed in // https://crbug.com/1313023. - if (frame->buffer_lost || !window_->IsSurfaceConfigured()) + // 3. A fatal error message has been set. + if (!fatal_error_message_.empty() || frame->buffer_lost || + !window_->IsSurfaceConfigured()) DiscardFrame(std::move(pending_frames_.front())); else PlayBackFrame(std::move(pending_frames_.front())); pending_frames_.pop_front(); + if (!fatal_error_message_.empty()) { + connection_->buffer_manager_host()->OnCommitOverlayError( + fatal_error_message_); + return; + } + // wl_frame_callback drives the continuous playback of frames, if the frame we // just played-back did not set up a wl_frame_callback, we should playback // another frame. @@ -210,11 +232,17 @@ config.bounds_rect, root_config.bounds_rect, root_config.surface_scale_factor, nullptr, reference_above); ApplySurfaceConfigure(frame.get(), surface, config, true); + // A fatal error happened. Must stop the playback and terminate the gpu + // process as it might have been compromised. + if (!fatal_error_message_.empty()) + return; reference_above = subsurface; surface->Commit(false); } } + DCHECK(fatal_error_message_.empty()); + if (empty_frame) { // GPU channel has been destroyed. Do nothing for empty frames except that // the frame should be marked as failed if it hasn't been presented yet. @@ -223,6 +251,10 @@ } else { // Opaque region is set during UpdateVisualSize() no need to set it again. ApplySurfaceConfigure(frame.get(), root_surface, root_config, false); + // A fatal error happened. Must stop the playback and terminate the gpu + // process as it might have been compromised. + if (!fatal_error_message_.empty()) + return; } DCHECK(empty_frame || !connection_->presentation() || @@ -257,6 +289,15 @@ if (!config.buffer_id) return; + if (!ValidateRect(config.bounds_rect)) { + DCHECK(fatal_error_message_.empty()); + // A fatal error must be set here and handled outside the Playback method as + // terminating the gpu during the playback is illegal - a pending frame will + // DCHECK in ::ClearStates. + fatal_error_message_ = kBoundsRectNanOrInf; + return; + } + static const wl_callback_listener frame_listener = { &WaylandFrameManager::FrameCallbackDone}; static const wp_presentation_feedback_listener feedback_listener = { @@ -667,6 +708,10 @@ } void WaylandFrameManager::ClearStates(bool closing) { + // Clear the previous fatal error message as it might have been set during + // a playback. + fatal_error_message_.clear(); + for (auto& frame : submitted_frames_) { frame->wl_frame_callback.reset(); for (auto& submitted : frame->submitted_buffers)
diff --git a/ui/ozone/platform/wayland/host/wayland_frame_manager.h b/ui/ozone/platform/wayland/host/wayland_frame_manager.h index 2fcace1..177c480 100644 --- a/ui/ozone/platform/wayland/host/wayland_frame_manager.h +++ b/ui/ozone/platform/wayland/host/wayland_frame_manager.h
@@ -191,6 +191,9 @@ // Non-owned pointer to the main connection. const raw_ptr<WaylandConnection> connection_; + // Set when invalid frame data is sent and the gpu process must be terminated. + std::string fatal_error_message_; + base::WeakPtrFactory<WaylandFrameManager> weak_factory_; };
diff --git a/ui/ozone/platform/wayland/host/wayland_popup.cc b/ui/ozone/platform/wayland/host/wayland_popup.cc index 8f9f77e7..104982c6 100644 --- a/ui/ozone/platform/wayland/host/wayland_popup.cc +++ b/ui/ozone/platform/wayland/host/wayland_popup.cc
@@ -252,14 +252,9 @@ void WaylandPopup::SetWindowGeometry(gfx::Rect bounds_dip) { DCHECK(shell_popup_); - gfx::Point p; - // TODO(crbug.com/1306688): Use DIP for frame insets. - if (frame_insets_px() && !frame_insets_px()->IsEmpty()) { - p = gfx::ScaleToRoundedPoint( - {frame_insets_px()->left(), frame_insets_px()->top()}, - 1.f / window_scale()); - } - shell_popup_->SetWindowGeometry({p, bounds_dip.size()}); + const auto insets = GetDecorationInsetsInDIP(); + shell_popup_->SetWindowGeometry( + {{insets.left(), insets.top()}, bounds_dip.size()}); } void WaylandPopup::AckConfigure(uint32_t serial) {
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc index 61edf372..69c311553 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc
@@ -400,6 +400,14 @@ const bool did_active_change = is_active_ != window_states.is_activated; is_active_ = window_states.is_activated; + // The tiled state affects the window geometry, so apply it here. + if (window_states.tiled_edges != tiled_state_) { + // This configure changes the decoration insets. We should adjust the + // bounds appropriately. + tiled_state_ = window_states.tiled_edges; + delegate()->OnWindowTiledStateChanged(window_states.tiled_edges); + } + // Rather than call SetBounds here for every configure event, just save the // most recent bounds, and have WaylandConnection call ApplyPendingBounds // when it has finished processing events. We may get many configure events @@ -417,10 +425,9 @@ gfx::Rect bounds_dip(pending_bounds_dip()); if (width_dip > 1 && height_dip > 1) { bounds_dip.SetRect(x, y, width_dip, height_dip); - // TODO(crbug.com/3651999): Change SetDecorationInsets to take DIP. - if (ShouldSetBounds(state_) && frame_insets_px()) { - bounds_dip.Inset( - -gfx::ScaleToRoundedInsets(*frame_insets_px(), 1.f / window_scale())); + const auto insets = GetDecorationInsetsInDIP(); + if (ShouldSetBounds(state_) && !insets.IsEmpty()) { + bounds_dip.Inset(-insets); bounds_dip.set_origin({x, y}); } } else if (ShouldSetBounds(state_)) { @@ -547,10 +554,9 @@ gfx::Rect geometry_dip(bounds_dip.size()); - if (state_ == PlatformWindowState::kNormal && frame_insets_px()) { - geometry_dip.Inset( - gfx::ScaleToRoundedInsets(*frame_insets_px(), 1.f / window_scale())); - } + const auto insets = GetDecorationInsetsInDIP(); + if (state_ == PlatformWindowState::kNormal && !insets.IsEmpty()) + geometry_dip.Inset(insets); shell_toplevel_->SetWindowGeometry(geometry_dip); }
diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h index 9a38b72..8d4c571 100644 --- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.h +++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.h
@@ -224,6 +224,9 @@ // Contains the previous state of the window. PlatformWindowState previous_state_ = PlatformWindowState::kUnknown; + // Contains the current state of the tiled edges. + WindowTiledEdges tiled_state_; + bool is_active_ = false; #if BUILDFLAG(IS_CHROMEOS_LACROS)
diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc index d200659..b690546 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.cc +++ b/ui/ozone/platform/wayland/host/wayland_window.cc
@@ -677,6 +677,12 @@ void WaylandWindow::UpdateDecorations() {} +gfx::Insets WaylandWindow::GetDecorationInsetsInDIP() const { + return frame_insets_px_.has_value() + ? gfx::ScaleToRoundedInsets(*frame_insets_px_, 1.f / window_scale_) + : gfx::Insets{}; +} + WaylandWindow* WaylandWindow::GetRootParentWindow() { return parent_window_ ? parent_window_->GetRootParentWindow() : this; }
diff --git a/ui/ozone/platform/wayland/host/wayland_window.h b/ui/ozone/platform/wayland/host/wayland_window.h index 91e6e80..612748d2 100644 --- a/ui/ozone/platform/wayland/host/wayland_window.h +++ b/ui/ozone/platform/wayland/host/wayland_window.h
@@ -21,6 +21,7 @@ #include "base/task/single_thread_task_runner.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h" +#include "ui/base/ui_base_types.h" #include "ui/events/event_target.h" #include "ui/events/platform/platform_event_dispatcher.h" #include "ui/gfx/geometry/insets.h" @@ -150,11 +151,6 @@ // The pixel size of the buffer for the surface. gfx::Size visual_size_px() const { return visual_size_px_; } - absl::optional<gfx::Insets> frame_insets_px() const { - return frame_insets_px_; - } - void set_frame_insets_px(gfx::Insets insets) { frame_insets_px_ = insets; } - bool received_configure_event() const { return received_configure_event_; } // Remove WaylandOutput associated with WaylandSurface of this window. @@ -229,12 +225,7 @@ bool is_snapped_primary = false; bool is_snapped_secondary = false; bool is_floated = false; - struct { - bool left = false; - bool right = false; - bool top = false; - bool bottom = false; - } tiled_edges; + WindowTiledEdges tiled_edges; }; virtual void HandleToplevelConfigure(int32_t width, @@ -297,6 +288,9 @@ // Updates the window decorations, if possible at the moment. virtual void UpdateDecorations(); + // Returns the effective decoration insets. + gfx::Insets GetDecorationInsetsInDIP() const; + // Returns a root parent window within the same hierarchy. WaylandWindow* GetRootParentWindow(); @@ -409,6 +403,8 @@ FRIEND_TEST_ALL_PREFIXES(WaylandScreenTest, SetWindowScale); FRIEND_TEST_ALL_PREFIXES(WaylandBufferManagerTest, CanSubmitOverlayPriority); FRIEND_TEST_ALL_PREFIXES(WaylandBufferManagerTest, CanSetRoundedCorners); + FRIEND_TEST_ALL_PREFIXES(WaylandBufferManagerTest, + CommitOverlaysNonsensicalBoundsRect); // Initializes the WaylandWindow with supplied properties. bool Initialize(PlatformWindowInitProperties properties);
diff --git a/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc b/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc index 3b9dfd2..c5ec275 100644 --- a/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc +++ b/ui/ozone/platform/wayland/test/wayland_drag_drop_test.cc
@@ -25,6 +25,21 @@ namespace ui { +TestWaylandOSExchangeDataProvideFactory:: + TestWaylandOSExchangeDataProvideFactory() { + SetInstance(this); +} + +TestWaylandOSExchangeDataProvideFactory:: + ~TestWaylandOSExchangeDataProvideFactory() { + SetInstance(nullptr); +} + +std::unique_ptr<OSExchangeDataProvider> +TestWaylandOSExchangeDataProvideFactory::CreateProvider() { + return std::make_unique<WaylandExchangeDataProvider>(); +} + WaylandDragDropTest::WaylandDragDropTest() = default; WaylandDragDropTest::~WaylandDragDropTest() = default;
diff --git a/ui/ozone/platform/wayland/test/wayland_drag_drop_test.h b/ui/ozone/platform/wayland/test/wayland_drag_drop_test.h index f825fe67..ae379cf 100644 --- a/ui/ozone/platform/wayland/test/wayland_drag_drop_test.h +++ b/ui/ozone/platform/wayland/test/wayland_drag_drop_test.h
@@ -10,6 +10,7 @@ #include "base/callback_forward.h" #include "base/memory/raw_ptr.h" #include "testing/gmock/include/gmock/gmock.h" +#include "ui/base/dragdrop/os_exchange_data_provider_factory_ozone.h" #include "ui/ozone/platform/wayland/test/test_data_device.h" #include "ui/ozone/platform/wayland/test/test_data_source.h" #include "ui/ozone/platform/wayland/test/wayland_test.h" @@ -27,6 +28,15 @@ class WaylandWindow; +class TestWaylandOSExchangeDataProvideFactory + : public OSExchangeDataProviderFactoryOzone { + public: + TestWaylandOSExchangeDataProvideFactory(); + ~TestWaylandOSExchangeDataProvideFactory() override; + + std::unique_ptr<OSExchangeDataProvider> CreateProvider() override; +}; + // Base class for Wayland drag-and-drop tests. Public methods allow test code to // emulate dnd-related events from the test compositor and can be used in both // data and window dragging test cases. @@ -100,6 +110,9 @@ raw_ptr<wl::TestTouch> touch_; uint32_t current_serial_; + + private: + TestWaylandOSExchangeDataProvideFactory os_exchange_factory_; }; } // namespace ui
diff --git a/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc b/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc index e7ca8bc..ab403812 100644 --- a/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc +++ b/ui/ozone/platform/wayland/wayland_buffer_manager_unittest.cc
@@ -573,24 +573,82 @@ window_->GetBoundsInPixels().width(), std::numeric_limits<float>::infinity())}; - for (const auto& bounds_rect : bounds_rect_test_data) { - CreateDmabufBasedBufferAndSetTerminateExpectation(false /*fail*/, 1u); - ProcessCreatedBufferResourcesWithExpectation(1u /* expected size */, - false /* fail */); + constexpr bool config[2] = {/*root_has_nan_bounds=*/true, + /*non_root_overlay_has_nan_bounds=*/false}; + constexpr uint32_t kBufferId1 = 1; + constexpr uint32_t kBufferId2 = 2; + constexpr uint32_t kBufferId3 = 3; - // Can't commit for bounds rect containing NaN - SetTerminateCallbackExpectationAndDestroyChannel(&callback_, true /*fail*/); + for (bool should_root_have_nan_bounds : config) { + for (const auto& faulty_bounds_rect : bounds_rect_test_data) { + CreateDmabufBasedBufferAndSetTerminateExpectation(false /*fail*/, + kBufferId1); + CreateDmabufBasedBufferAndSetTerminateExpectation(false /*fail*/, + kBufferId2); + CreateDmabufBasedBufferAndSetTerminateExpectation(false /*fail*/, + kBufferId3); + ProcessCreatedBufferResourcesWithExpectation(3u /* expected size */, + false /* fail */); - std::vector<wl::WaylandOverlayConfig> overlay_configs; - overlay_configs.emplace_back( - CreateBasicWaylandOverlayConfig(1u, 1u, bounds_rect)); - buffer_manager_gpu_->CommitOverlays(window_->GetWidget(), 1u, - std::move(overlay_configs)); + // Can't commit for bounds rect containing NaN + SetTerminateCallbackExpectationAndDestroyChannel(&callback_, + true /*fail*/); - Sync(); + size_t z_order = 0; + std::vector<wl::WaylandOverlayConfig> overlay_configs; + if (should_root_have_nan_bounds) { + // The root surface has nan bounds. + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + INT32_MIN, kBufferId1, faulty_bounds_rect)); + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + z_order++, kBufferId2, window_->GetBoundsInPixels())); + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + z_order++, kBufferId3, window_->GetBoundsInPixels())); + } else { + // Overlays have nan bounds. Given playback starts with the biggest + // z-order number, add two more overlays around the faulty overlay + // config so that the test ensures no further playback happens and it + // doesn't crash. + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + INT32_MIN, kBufferId1, window_->GetBoundsInPixels())); + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + z_order++, kBufferId2, window_->GetBoundsInPixels())); + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + z_order++, kBufferId3, faulty_bounds_rect)); + overlay_configs.emplace_back(CreateBasicWaylandOverlayConfig( + z_order++, kBufferId2, window_->GetBoundsInPixels())); + } + buffer_manager_gpu_->CommitOverlays(window_->GetWidget(), 1u, + std::move(overlay_configs)); - EXPECT_EQ("Overlay bounds_rect is invalid (NaN or infinity).", - channel_destroyed_error_message_); + Sync(); + + if (!should_root_have_nan_bounds && + !connection_->linux_explicit_synchronization_v1()) { + // This case submits kBufferId2 twice. So, a second handle is requested + // during a frame playback if explicit sync is unavailable. + ProcessCreatedBufferResourcesWithExpectation(1u /* expected size */, + false /* fail */); + Sync(); + } + + EXPECT_EQ("Overlay bounds_rect is invalid (NaN or infinity).", + channel_destroyed_error_message_); + + // Clear all the possible frame and release callbacks. + auto* mock_surface = server_.GetObject<wl::MockSurface>( + window_->root_surface()->GetSurfaceId()); + for (auto& subsurface : window_->wayland_subsurfaces_) { + auto* mock_surface_of_subsurface = server_.GetObject<wl::MockSurface>( + subsurface->wayland_surface()->GetSurfaceId()); + EXPECT_TRUE(mock_surface_of_subsurface); + mock_surface_of_subsurface->SendFrameCallback(); + mock_surface_of_subsurface->ClearBufferReleases(); + } + + mock_surface->SendFrameCallback(); + mock_surface->ClearBufferReleases(); + } } }
diff --git a/ui/platform_window/platform_window_delegate.cc b/ui/platform_window/platform_window_delegate.cc index 33c4d35..50d1dc52 100644 --- a/ui/platform_window/platform_window_delegate.cc +++ b/ui/platform_window/platform_window_delegate.cc
@@ -15,6 +15,11 @@ PlatformWindowDelegate::~PlatformWindowDelegate() = default; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +void PlatformWindowDelegate::OnWindowTiledStateChanged( + WindowTiledEdges new_tiled_edges) {} +#endif + absl::optional<gfx::Size> PlatformWindowDelegate::GetMinimumSizeForWindow() { return absl::nullopt; }
diff --git a/ui/platform_window/platform_window_delegate.h b/ui/platform_window/platform_window_delegate.h index b5baa7ab..d860309 100644 --- a/ui/platform_window/platform_window_delegate.h +++ b/ui/platform_window/platform_window_delegate.h
@@ -7,6 +7,7 @@ #include "base/component_export.h" #include "build/build_config.h" +#include "build/chromeos_buildflags.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/ui_base_types.h" #include "ui/gfx/geometry/rect.h" @@ -94,6 +95,11 @@ virtual void OnWindowStateChanged(PlatformWindowState old_state, PlatformWindowState new_state) = 0; +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + // Notifies the delegate that the tiled state of the window edges has changed. + virtual void OnWindowTiledStateChanged(WindowTiledEdges new_tiled_edges); +#endif + virtual void OnLostCapture() = 0; virtual void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) = 0;
diff --git a/ui/webui/resources/BUILD.gn b/ui/webui/resources/BUILD.gn index 2f50ce9..38fd399 100644 --- a/ui/webui/resources/BUILD.gn +++ b/ui/webui/resources/BUILD.gn
@@ -281,9 +281,7 @@ if (include_polymer) { generate_definitions_js_files += [ "cr_elements/cr_icons_css.m.js", - "cr_elements/hidden_style_css.m.js", "cr_elements/icons.m.js", - "cr_elements/shared_style_css.m.js", "cr_elements/shared_vars_css.m.js", ]
diff --git a/ui/webui/resources/cr_components/app_management/app_management_shared_style.css b/ui/webui/resources/cr_components/app_management/app_management_shared_style.css index d96b57e..d8a539d 100644 --- a/ui/webui/resources/cr_components/app_management/app_management_shared_style.css +++ b/ui/webui/resources/cr_components/app_management/app_management_shared_style.css
@@ -5,7 +5,7 @@ /* #css_wrapper_metadata_start * #type=style * #import=./shared_vars.css.js - * #import=//resources/cr_elements/shared_style_css.m.js + * #import=//resources/cr_elements/cr_shared_style.css.js * #import=//resources/cr_elements/shared_vars_css.m.js * #include=cr-shared-style * #css_wrapper_metadata_end */
diff --git a/ui/webui/resources/cr_components/certificate_manager/certificate_manager.ts b/ui/webui/resources/cr_components/certificate_manager/certificate_manager.ts index 8acc530..eb1064c 100644 --- a/ui/webui/resources/cr_components/certificate_manager/certificate_manager.ts +++ b/ui/webui/resources/cr_components/certificate_manager/certificate_manager.ts
@@ -6,7 +6,7 @@ * @fileoverview The 'certificate-manager' component manages SSL certificates. */ import '../../cr_elements/cr_tabs/cr_tabs.js'; -import '../../cr_elements/hidden_style_css.m.js'; +import '../../cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js'; import './ca_trust_edit_dialog.js'; import './certificate_delete_confirmation_dialog.js'; @@ -16,6 +16,7 @@ import './certificates_error_dialog.js'; // <if expr="is_chromeos"> import './certificate_provisioning_list.js'; + // </if> import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_components/certificate_manager/certificate_provisioning_list.ts b/ui/webui/resources/cr_components/certificate_manager/certificate_provisioning_list.ts index b11200a..c2d895a 100644 --- a/ui/webui/resources/cr_components/certificate_manager/certificate_provisioning_list.ts +++ b/ui/webui/resources/cr_components/certificate_manager/certificate_provisioning_list.ts
@@ -6,7 +6,7 @@ * @fileoverview 'certificate-provisioning-list' is an element that displays a * list of certificate provisioning processes. */ -import '../../cr_elements/shared_style_css.m.js'; +import '../../cr_elements/cr_shared_style.css.js'; import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import './certificate_provisioning_details_dialog.js'; import './certificate_provisioning_entry.js';
diff --git a/ui/webui/resources/cr_components/certificate_manager/certificate_shared.css b/ui/webui/resources/cr_components/certificate_manager/certificate_shared.css index ac8c65d..e9530cba 100644 --- a/ui/webui/resources/cr_components/certificate_manager/certificate_shared.css +++ b/ui/webui/resources/cr_components/certificate_manager/certificate_shared.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=../../cr_elements/shared_style_css.m.js + * #import=../../cr_elements/cr_shared_style.css.js * #include=cr-shared-style * #css_wrapper_metadata_end */
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_battery_icon_percentage.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_battery_icon_percentage.js index 309ea27..cd81751a 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_battery_icon_percentage.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_battery_icon_percentage.js
@@ -9,7 +9,7 @@ * type. */ -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import './bluetooth_icons.js'; import {I18nBehavior, I18nBehaviorInterface} from '//resources/js/i18n_behavior.m.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_device_battery_info.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_device_battery_info.js index 47697f8..ff58541f 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_device_battery_info.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_device_battery_info.js
@@ -7,7 +7,7 @@ * View displaying Bluetooth device battery information. */ -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import './bluetooth_battery_icon_percentage.js'; import {html, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_dialog.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_dialog.js index 9e6942d2..5852efd 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_dialog.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_dialog.js
@@ -12,7 +12,7 @@ import '../../../cr_elements/cr_button/cr_button.js'; import '../../../cr_elements/cr_dialog/cr_dialog.js'; import '../../../cr_elements/cr_input/cr_input.js'; -import '../../../cr_elements/hidden_style_css.m.js'; +import '../../../cr_elements/cr_hidden_style.css.js'; import '../../../js/cr.m.js'; import '//resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import '//resources/polymer/v3_0/iron-list/iron-list.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_confirm_code_page.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_confirm_code_page.js index 2ef00ad2..d687908 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_confirm_code_page.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_confirm_code_page.js
@@ -9,7 +9,7 @@ */ import './bluetooth_base_page.js'; -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import '../../../cr_elements/cr_input/cr_input.js'; import {I18nBehavior, I18nBehaviorInterface} from '//resources/js/i18n_behavior.m.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_item.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_item.js index 3ab6d527..0f4e879 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_item.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_item.js
@@ -7,7 +7,7 @@ * UI element to show a list of discovered Bluetooth devices and initiate * pairing to a device. */ -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import './bluetooth_icon.js'; import {I18nBehavior, I18nBehaviorInterface} from '//resources/js/i18n_behavior.m.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js index 6b2d4dc..df183d0 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js
@@ -9,7 +9,7 @@ */ import './bluetooth_base_page.js'; import './bluetooth_pairing_device_item.js'; -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import '//resources/polymer/v3_0/iron-list/iron-list.js'; import '../../localized_link/localized_link.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_enter_code_page.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_enter_code_page.js index b1b547e99..6f832a7 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_enter_code_page.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_enter_code_page.js
@@ -9,7 +9,7 @@ */ import './bluetooth_base_page.js'; -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import '//resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; import {I18nBehavior, I18nBehaviorInterface} from '//resources/js/i18n_behavior.m.js';
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_request_code_page.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_request_code_page.js index 56f7bad1..c0aa071 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_request_code_page.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_request_code_page.js
@@ -9,7 +9,7 @@ */ import './bluetooth_base_page.js'; -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import '../../../cr_elements/cr_input/cr_input.js'; import {I18nBehavior, I18nBehaviorInterface} from '//resources/js/i18n_behavior.m.js';
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/BUILD.gn b/ui/webui/resources/cr_components/chromeos/cellular_setup/BUILD.gn index a41394c..39ec741 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/BUILD.gn +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/BUILD.gn
@@ -352,6 +352,7 @@ html_file = "profile_discovery_list_page.html" html_type = "dom-module" namespace_rewrites = cr_components_chromeos_namespace_rewrites + migrated_imports = cr_components_migrated_imports auto_imports = cr_components_chromeos_auto_imports } @@ -361,6 +362,7 @@ html_type = "dom-module" namespace_rewrites = cr_components_chromeos_namespace_rewrites auto_imports = cr_components_chromeos_auto_imports + migrated_imports = cr_components_migrated_imports } polymer_modulizer("psim_flow_ui") {
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/button_bar.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/button_bar.html index d4f1204..fb325d7 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/button_bar.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/button_bar.html
@@ -3,7 +3,7 @@ <link rel="import" href="cellular_types.html"> <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="../../../cr_elements/cr_button/cr_button.html"> -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../../cr_elements/shared_vars_css.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_eid_dialog.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_eid_dialog.html index c78a9dd..f7d18bd 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_eid_dialog.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/cellular_eid_dialog.html
@@ -3,7 +3,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> <dom-module id="cellular-eid-dialog"> @@ -72,4 +72,4 @@ </cr-dialog> </template> <script src="cellular_eid_dialog.js"></script> -</dom-module> \ No newline at end of file +</dom-module>
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/profile_discovery_list_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/profile_discovery_list_page.html index 7fa9072..13d1a01 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/profile_discovery_list_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/profile_discovery_list_page.html
@@ -1,7 +1,7 @@ <link rel="import" href="../../../html/polymer.html"> <link rel="import" href="../../../html/i18n_behavior.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="base_page.html"> <link rel="import" href="profile_discovery_list_item.html">
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/provisioning_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/provisioning_page.html index 95978cc..f3b3be2e 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/provisioning_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/provisioning_page.html
@@ -6,7 +6,7 @@ <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="../../../html/load_time_data.html"> <link rel="import" href="../../../html/assert.html"> -<link rel="import" href="../../../cr_elements/hidden_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_hidden_style.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
diff --git a/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html b/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html index c2333f3c..0d80ceae 100644 --- a/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html +++ b/ui/webui/resources/cr_components/chromeos/cellular_setup/setup_loading_page.html
@@ -3,7 +3,7 @@ <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="base_page.html"> <link rel="import" href="cellular_setup_delegate.html"> -<link rel="import" href="../../../cr_elements/hidden_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_hidden_style.css.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/cr_elements/cr_lottie/cr_lottie.html">
diff --git a/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_shared_css.html b/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_shared_css.html index 1e2f34d..07ab97f 100644 --- a/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_shared_css.html +++ b/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_shared_css.html
@@ -1,6 +1,6 @@ <link rel="import" href="../../../html/polymer.html"> -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../../cr_elements/shared_vars_css.html"> <link rel="import" href="../../../cr_elements/md_select.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/BUILD.gn b/ui/webui/resources/cr_components/chromeos/network/BUILD.gn index fc375a22..f51b425 100644 --- a/ui/webui/resources/cr_components/chromeos/network/BUILD.gn +++ b/ui/webui/resources/cr_components/chromeos/network/BUILD.gn
@@ -526,6 +526,7 @@ html_file = "network_icon.html" html_type = "dom-module" auto_imports = cr_components_chromeos_auto_imports + migrated_imports = cr_components_migrated_imports } polymer_modulizer("network_icons") { @@ -622,6 +623,7 @@ js_file = "network_shared_css.m.js" html_file = "network_shared_css.html" html_type = "style-module" + migrated_imports = cr_components_migrated_imports } polymer_modulizer("network_siminfo") {
diff --git a/ui/webui/resources/cr_components/chromeos/network/cr_policy_network_indicator_mojo.html b/ui/webui/resources/cr_components/chromeos/network/cr_policy_network_indicator_mojo.html index 62cddfd..763ef481 100644 --- a/ui/webui/resources/cr_components/chromeos/network/cr_policy_network_indicator_mojo.html +++ b/ui/webui/resources/cr_components/chromeos/network/cr_policy_network_indicator_mojo.html
@@ -1,6 +1,6 @@ <link rel="import" href="../../../html/polymer.html"> -<link rel="import" href="../../../cr_elements/hidden_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_hidden_style.css.html"> <link rel="import" href="../../../cr_elements/policy/cr_policy_indicator_behavior.html"> <link rel="import" href="../../../cr_elements/policy/cr_tooltip_icon.html"> <link rel="import" href="cr_policy_network_behavior_mojo.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_choose_mobile.html b/ui/webui/resources/cr_components/chromeos/network/network_choose_mobile.html index fe92448..99a1bbcc 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_choose_mobile.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_choose_mobile.html
@@ -2,7 +2,7 @@ <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/md_select.css.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.html"> <link rel="import" href="chrome://resources/mojo/services/network/public/mojom/ip_address.mojom.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_config_select.html b/ui/webui/resources/cr_components/chromeos/network/network_config_select.html index d97efa75..0fb107d 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_config_select.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_config_select.html
@@ -3,7 +3,7 @@ <link rel="import" href="chrome://resources/cr_elements/md_select.css.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_tooltip_icon.html"> <link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> -<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="cr_policy_network_behavior_mojo.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_icon.html b/ui/webui/resources/cr_components/chromeos/network/network_icon.html index a0bbd36..54a088c9 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_icon.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_icon.html
@@ -1,7 +1,7 @@ <link rel="import" href="../../../html/polymer.html"> <link rel="import" href="../../chromeos/network/network_icons.html"> -<link rel="import" href="../../../cr_elements/hidden_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_hidden_style.css.html"> <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/load_time_data.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_list.html b/ui/webui/resources/cr_components/chromeos/network/network_list.html index b3fc89a..15c5b146 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_list.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_list.html
@@ -4,7 +4,7 @@ <link rel="import" href="network_list_types.html"> <link rel="import" href="onc_mojo.html"> <link rel="import" href="../../../cr_elements/cr_scrollable_behavior.html"> -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="../../../html/list_property_update_behavior.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_list_item.html b/ui/webui/resources/cr_components/chromeos/network/network_list_item.html index 3f5766b8..b164331 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_list_item.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_list_item.html
@@ -9,7 +9,7 @@ <link rel="import" href="../../../cr_elements/cr_icon_button/cr_icon_button.html"> <link rel="import" href="../../../cr_elements/icons.html"> <link rel="import" href="../../../cr_elements/policy/cr_policy_indicator.html"> -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../../cr_elements/shared_vars_css.html"> <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="../../../html/cr/ui/focus_row_behavior.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_property_list_mojo.html b/ui/webui/resources/cr_components/chromeos/network/network_property_list_mojo.html index e8b536e..18bae73 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_property_list_mojo.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_property_list_mojo.html
@@ -3,7 +3,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="../../../cr_elements/cr_input/cr_input.html"> -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="cr_policy_network_behavior_mojo.html"> <link rel="import" href="cr_policy_network_indicator_mojo.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_proxy.html b/ui/webui/resources/cr_components/chromeos/network/network_proxy.html index 4400a42..5fb1231 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_proxy.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_proxy.html
@@ -3,7 +3,7 @@ <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html"> -<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_hidden_style.css.html"> <link rel="import" href="chrome://resources/cr_elements/md_select.css.html"> <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.html b/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.html index bef05a54..88dc13a1 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_proxy_exclusions.html
@@ -1,7 +1,7 @@ <link rel="import" href="../../../html/polymer.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html"> -<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_hidden_style.css.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="network_shared_css.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_shared_css.html b/ui/webui/resources/cr_components/chromeos/network/network_shared_css.html index 64b76de8..6749483 100644 --- a/ui/webui/resources/cr_components/chromeos/network/network_shared_css.html +++ b/ui/webui/resources/cr_components/chromeos/network/network_shared_css.html
@@ -1,4 +1,4 @@ -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <!-- Common styles for network elements. -->
diff --git a/ui/webui/resources/cr_components/chromeos/network/sim_lock_dialogs.html b/ui/webui/resources/cr_components/chromeos/network/sim_lock_dialogs.html index bd2b6a2a..d4aefe4 100644 --- a/ui/webui/resources/cr_components/chromeos/network/sim_lock_dialogs.html +++ b/ui/webui/resources/cr_components/chromeos/network/sim_lock_dialogs.html
@@ -3,7 +3,7 @@ <link rel="import" href="../../../cr_elements/cr_button/cr_button.html"> <link rel="import" href="../../../cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="../../../cr_elements/icons.html"> -<link rel="import" href="../../../cr_elements/shared_style_css.html"> +<link rel="import" href="../../../cr_elements/cr_shared_style.css.html"> <link rel="import" href="../../../html/assert.html"> <link rel="import" href="../../../html/i18n_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
diff --git a/ui/webui/resources/cr_components/chromeos/network_health/network_health_summary.js b/ui/webui/resources/cr_components/chromeos/network_health/network_health_summary.js index c9249e9..0a88e4f8 100644 --- a/ui/webui/resources/cr_components/chromeos/network_health/network_health_summary.js +++ b/ui/webui/resources/cr_components/chromeos/network_health/network_health_summary.js
@@ -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 '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import '../network/network_shared_css.m.js'; import {html, Polymer} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_components/chromeos/os_cr_components.gni b/ui/webui/resources/cr_components/chromeos/os_cr_components.gni index 5ca25465..6e3fc846 100644 --- a/ui/webui/resources/cr_components/chromeos/os_cr_components.gni +++ b/ui/webui/resources/cr_components/chromeos/os_cr_components.gni
@@ -75,11 +75,13 @@ "ui/webui/resources/cr_elements/action_link.css.html", "ui/webui/resources/cr_elements/cr_button/cr_button.html", "ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html", + "ui/webui/resources/cr_elements/cr_hidden_style.css.html", "ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.html", "ui/webui/resources/cr_elements/cr_input/cr_input.html", "ui/webui/resources/cr_elements/cr_lottie/cr_lottie.html", "ui/webui/resources/cr_elements/cr_radio_button/cr_radio_button.html", "ui/webui/resources/cr_elements/cr_radio_group/cr_radio_group.html", + "ui/webui/resources/cr_elements/cr_shared_style.css.html", "ui/webui/resources/cr_elements/cr_scrollable_behavior.html", "ui/webui/resources/cr_elements/cr_toggle/cr_toggle.html", "ui/webui/resources/cr_elements/md_select.css.html",
diff --git a/ui/webui/resources/cr_components/chromeos/smb_shares/add_smb_share_dialog.js b/ui/webui/resources/cr_components/chromeos/smb_shares/add_smb_share_dialog.js index a75be32..2a71b27 100644 --- a/ui/webui/resources/cr_components/chromeos/smb_shares/add_smb_share_dialog.js +++ b/ui/webui/resources/cr_components/chromeos/smb_shares/add_smb_share_dialog.js
@@ -15,7 +15,7 @@ import '../../../cr_elements/cr_input/cr_input.js'; import '../../../cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.js'; import '../../../cr_elements/icons.m.js'; -import '../../../cr_elements/shared_style_css.m.js'; +import '../../../cr_elements/cr_shared_style.css.js'; import '../../../cr_elements/shared_vars_css.m.js'; import '../../../cr_elements/md_select.css.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/ui/webui/resources/cr_components/customize_themes/customize_themes.ts b/ui/webui/resources/cr_components/customize_themes/customize_themes.ts index 2eb816b..0536c75 100644 --- a/ui/webui/resources/cr_components/customize_themes/customize_themes.ts +++ b/ui/webui/resources/cr_components/customize_themes/customize_themes.ts
@@ -8,7 +8,7 @@ import '../../cr_elements/cr_icons_css.m.js'; import '../../cr_elements/cr_grid/cr_grid.js'; import '../../cr_elements/shared_vars_css.m.js'; -import '../../cr_elements/shared_style_css.m.js'; +import '../../cr_elements/cr_shared_style.css.js'; import './theme_icon.js'; import '//resources/polymer/v3_0/paper-tooltip/paper-tooltip.js';
diff --git a/ui/webui/resources/cr_components/help_bubble/help_bubble.ts b/ui/webui/resources/cr_components/help_bubble/help_bubble.ts index 9a4b4b2..4be1e37 100644 --- a/ui/webui/resources/cr_components/help_bubble/help_bubble.ts +++ b/ui/webui/resources/cr_components/help_bubble/help_bubble.ts
@@ -10,7 +10,7 @@ */ import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import 'chrome://resources/cr_elements/icons.m.js'; import {CrButtonElement} from '//resources/cr_elements/cr_button/cr_button.js'; @@ -20,7 +20,7 @@ import {DomRepeatEvent, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {getTemplate} from './help_bubble.html.js'; -import {HelpBubbleButtonParams, HelpBubbleArrowPosition, Progress} from './help_bubble.mojom-webui.js'; +import {HelpBubbleArrowPosition, HelpBubbleButtonParams, Progress} from './help_bubble.mojom-webui.js'; const ANCHOR_HIGHLIGHT_CLASS = 'help-anchor-highlight';
diff --git a/ui/webui/resources/cr_components/history_clusters/history_clusters_shared_style.css b/ui/webui/resources/cr_components/history_clusters/history_clusters_shared_style.css index 2e82ab4..78ecb6f 100644 --- a/ui/webui/resources/cr_components/history_clusters/history_clusters_shared_style.css +++ b/ui/webui/resources/cr_components/history_clusters/history_clusters_shared_style.css
@@ -4,7 +4,7 @@ /* #css_wrapper_metadata_start * #type=style - * #import=../../cr_elements/shared_style_css.m.js + * #import=../../cr_elements/cr_shared_style.css.js * #import=../../cr_elements/shared_vars_css.m.js * #import=./shared_vars.css.js * #include=cr-shared-style cr-hidden-style
diff --git a/ui/webui/resources/cr_components/localized_link/localized_link.ts b/ui/webui/resources/cr_components/localized_link/localized_link.ts index 4c0cfc0a..acc55fa 100644 --- a/ui/webui/resources/cr_components/localized_link/localized_link.ts +++ b/ui/webui/resources/cr_components/localized_link/localized_link.ts
@@ -21,7 +21,7 @@ */ import '../../cr_elements/shared_vars_css.m.js'; -import '../../cr_elements/shared_style_css.m.js'; +import '../../cr_elements/cr_shared_style.css.js'; import {assert, assertNotReached} from '//resources/js/assert.m.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_components/most_visited/most_visited.ts b/ui/webui/resources/cr_components/most_visited/most_visited.ts index a62d192f..063da66 100644 --- a/ui/webui/resources/cr_components/most_visited/most_visited.ts +++ b/ui/webui/resources/cr_components/most_visited/most_visited.ts
@@ -9,7 +9,7 @@ import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js'; import 'chrome://resources/cr_elements/cr_toast/cr_toast.js'; -import 'chrome://resources/cr_elements/hidden_style_css.m.js'; +import 'chrome://resources/cr_elements/cr_hidden_style.css.js'; import {CrActionMenuElement} from 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js';
diff --git a/ui/webui/resources/cr_elements/BUILD.gn b/ui/webui/resources/cr_elements/BUILD.gn index daa8076..2d3d326 100644 --- a/ui/webui/resources/cr_elements/BUILD.gn +++ b/ui/webui/resources/cr_elements/BUILD.gn
@@ -88,12 +88,10 @@ out_manifest = "$target_gen_dir/$preprocess_gen_manifest" in_files = [ "cr_icons_css.m.js", - "hidden_style_css.m.js", "icons.m.js", "policy/cr_policy_indicator.js", "policy/cr_policy_pref_indicator.js", "policy/cr_tooltip_icon.js", - "shared_style_css.m.js", "shared_vars_css.m.js", ] @@ -121,18 +119,6 @@ html_type = "custom-style" } - polymer_modulizer("shared_style_css") { - js_file = "shared_style_css.m.js" - html_file = "shared_style_css.html" - html_type = "style-module" - } - - polymer_modulizer("hidden_style_css") { - js_file = "hidden_style_css.m.js" - html_file = "hidden_style_css.html" - html_type = "style-module" - } - polymer_modulizer("cr_icons_css") { js_file = "cr_icons_css.m.js" html_file = "cr_icons_css.html" @@ -150,9 +136,7 @@ group("custom_elements") { public_deps = [ ":cr_icons_css_module", - ":hidden_style_css_module", ":icons_module", - ":shared_style_css_module", ":shared_vars_css_module", "policy:web_components", ]
diff --git a/ui/webui/resources/cr_elements/cr_button/cr_button.ts b/ui/webui/resources/cr_elements/cr_button/cr_button.ts index 27b6cb5..503e736 100644 --- a/ui/webui/resources/cr_elements/cr_button/cr_button.ts +++ b/ui/webui/resources/cr_elements/cr_button/cr_button.ts
@@ -8,7 +8,7 @@ * enter to effectively click the button and fire a 'click' event. */ import '//resources/polymer/v3_0/paper-styles/color.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../shared_vars_css.m.js'; import {PaperRippleBehavior} from '//resources/polymer/v3_0/paper-behaviors/paper-ripple-behavior.js';
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.ts b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.ts index 1f7c2aa..7ea0145 100644 --- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.ts +++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.ts
@@ -21,7 +21,7 @@ */ import '../cr_icon_button/cr_icon_button.js'; import '../cr_icons_css.m.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../shared_vars_css.m.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_elements/cr_elements.gni b/ui/webui/resources/cr_elements/cr_elements.gni index 81dbd74..8d013a5 100644 --- a/ui/webui/resources/cr_elements/cr_elements.gni +++ b/ui/webui/resources/cr_elements/cr_elements.gni
@@ -104,9 +104,11 @@ css_files = [ "action_link.css", "cr_actionable_row_style.css", + "cr_hidden_style.css", "cr_nav_menu_item_style.css", "cr_page_host_style.css", "cr_radio_button/cr_radio_button_style.css", + "cr_shared_style.css", "md_select.css", "mwb_element_shared_style.css", "mwb_shared_style.css",
diff --git a/ui/webui/resources/cr_elements/cr_hidden_style.css b/ui/webui/resources/cr_elements/cr_hidden_style.css new file mode 100644 index 0000000..994bfd6 --- /dev/null +++ b/ui/webui/resources/cr_elements/cr_hidden_style.css
@@ -0,0 +1,15 @@ +/* Copyright 2022 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +/* #css_wrapper_metadata_start + * #type=style + * #scheme=relative + * #css_wrapper_metadata_end */ + +/* Included here so we don't have to include "iron-positioning" in every + * stylesheet. See crbug.com/498405. */ +[hidden], +:host([hidden]) { + display: none !important; +}
diff --git a/ui/webui/resources/cr_elements/cr_input/cr_input.ts b/ui/webui/resources/cr_elements/cr_input/cr_input.ts index 7b4df1fe..3dcaa6d 100644 --- a/ui/webui/resources/cr_elements/cr_input/cr_input.ts +++ b/ui/webui/resources/cr_elements/cr_input/cr_input.ts
@@ -3,8 +3,8 @@ // found in the LICENSE file. import '//resources/polymer/v3_0/paper-styles/color.js'; -import '../hidden_style_css.m.js'; -import '../shared_style_css.m.js'; +import '../cr_hidden_style.css.js'; +import '../cr_shared_style.css.js'; import '../shared_vars_css.m.js'; import './cr_input_style.css.js';
diff --git a/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.ts b/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.ts index 9b841eed..0407420 100644 --- a/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.ts +++ b/ui/webui/resources/cr_elements/cr_link_row/cr_link_row.ts
@@ -11,9 +11,9 @@ */ import '../cr_actionable_row_style.css.js'; import '../cr_icon_button/cr_icon_button.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../icons.m.js'; -import '../shared_style_css.m.js'; +import '../cr_shared_style.css.js'; import '../shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.ts b/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.ts index 2ec1bb07..d139729 100644 --- a/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.ts +++ b/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.ts
@@ -9,7 +9,7 @@ import '../cr_button/cr_button.js'; import '../shared_vars_css.m.js'; -import '../shared_style_css.m.js'; +import '../cr_shared_style.css.js'; import '//resources/polymer/v3_0/paper-styles/color.js'; import '//resources/polymer/v3_0/paper-tooltip/paper-tooltip.js'; import './cr_profile_avatar_selector_grid.js';
diff --git a/ui/webui/resources/cr_elements/cr_radio_button/cr_radio_button.ts b/ui/webui/resources/cr_elements/cr_radio_button/cr_radio_button.ts index 9a67e44..ab160fb 100644 --- a/ui/webui/resources/cr_elements/cr_radio_button/cr_radio_button.ts +++ b/ui/webui/resources/cr_elements/cr_radio_button/cr_radio_button.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import '//resources/polymer/v3_0/paper-styles/color.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../shared_vars_css.m.js'; import './cr_radio_button_style.css.js';
diff --git a/ui/webui/resources/cr_elements/cr_scrollable_behavior.js b/ui/webui/resources/cr_elements/cr_scrollable_behavior.js index ea723d3..12e60ba 100644 --- a/ui/webui/resources/cr_elements/cr_scrollable_behavior.js +++ b/ui/webui/resources/cr_elements/cr_scrollable_behavior.js
@@ -8,7 +8,7 @@ * Any containers with the 'scrollable' attribute set will have the following * classes toggled appropriately: can-scroll, is-scrolled, scrolled-to-bottom. * These classes are used to style the container div and list elements - * appropriately, see shared_style_css.html. + * appropriately, see cr_shared_style.css. * * The associated HTML should look something like: * <div id="container" scrollable>
diff --git a/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.ts b/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.ts index 241a5a8..946ad7e 100644 --- a/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.ts +++ b/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.ts
@@ -12,7 +12,7 @@ import '../cr_input/cr_input.js'; import '../cr_input/cr_input_style.css.js'; import '../icons.m.js'; -import '../shared_style_css.m.js'; +import '../cr_shared_style.css.js'; import '../shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/ui/webui/resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.ts b/ui/webui/resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.ts index 1bfd96c..924bcc3ec 100644 --- a/ui/webui/resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.ts +++ b/ui/webui/resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.ts
@@ -15,9 +15,9 @@ * used to disable certain user actions when the dropdown is invalid. */ import '../cr_input/cr_input.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../icons.m.js'; -import '../shared_style_css.m.js'; +import '../cr_shared_style.css.js'; import '../shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-dropdown/iron-dropdown.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js';
diff --git a/ui/webui/resources/cr_elements/cr_shared_style.css b/ui/webui/resources/cr_elements/cr_shared_style.css new file mode 100644 index 0000000..e4d701b --- /dev/null +++ b/ui/webui/resources/cr_elements/cr_shared_style.css
@@ -0,0 +1,188 @@ +/* Copyright 2022 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +/* #css_wrapper_metadata_start + * #type=style + * #import=./shared_vars_css.m.js + * #import=./cr_hidden_style.css.js + * #import=./cr_icons_css.m.js + * #scheme=relative + * #include=cr-hidden-style cr-icons + * #css_wrapper_metadata_end */ + +html, +:host { + --scrollable-border-color: var(--google-grey-300); +} + +@media (prefers-color-scheme: dark) { + html, + :host { + --scrollable-border-color: var(--google-grey-700); + } +} + +[actionable] { + cursor: pointer; +} + +/* Horizontal rule line. */ +.hr { + border-top: var(--cr-separator-line); +} + +iron-list.cr-separators > *:not([first]) { + border-top: var(--cr-separator-line); +} + +[scrollable] { + border-color: transparent; + border-style: solid; + border-width: 1px 0; + overflow-y: auto; +} +[scrollable].is-scrolled { + border-top-color: var(--scrollable-border-color); +} +[scrollable].can-scroll:not(.scrolled-to-bottom) { + border-bottom-color: var(--scrollable-border-color); +} +[scrollable] iron-list > :not(.no-outline):focus, +[selectable]:focus, +[selectable] > :focus { + background-color: var(--cr-focused-item-color); + outline: none; +} + +.scroll-container { + display: flex; + flex-direction: column; + min-height: 1px; +} + +[selectable] > * { + cursor: pointer; +} + +.cr-centered-card-container { + box-sizing: border-box; + display: block; + height: inherit; + margin: 0 auto; + max-width: var(--cr-centered-card-max-width); + min-width: 550px; + position: relative; + width: calc(100% * var(--cr-centered-card-width-percentage)); +} + +.cr-container-shadow { + box-shadow: inset 0 5px 6px -3px rgba(0, 0, 0, .4); + height: var(--cr-container-shadow-height); + left: 0; + margin: 0 0 var(--cr-container-shadow-margin); + opacity: 0; + pointer-events: none; + position: relative; + right: 0; + top: 0; + transition: opacity 500ms; + z-index: 1; +} + +/** Styles for elements that implement the CrContainerShadowBehavior */ +#cr-container-shadow-bottom { + margin-bottom: 0; + margin-top: var(--cr-container-shadow-margin); + transform: scaleY(-1); +} + +#cr-container-shadow-top.has-shadow, +#cr-container-shadow-bottom.has-shadow { + opacity: var(--cr-container-shadow-max-opacity); +} + +.cr-row { + align-items: center; + border-top: var(--cr-separator-line); + display: flex; + min-height: var(--cr-section-min-height); + padding: 0 var(--cr-section-padding); +} + +.cr-row.first, +.cr-row.continuation { + border-top: none; +} + +.cr-row-gap { + padding-inline-start: 16px; +} + +.cr-button-gap { + margin-inline-start: 8px; +} + +paper-tooltip::part(tooltip) { + border-radius: var(--paper-tooltip-border-radius, 2px); + font-size: 92.31%; /* Effectively 12px if the host default is 13px. */ + font-weight: 500; + max-width: 330px; + min-width: var(--paper-tooltip-min-width, 200px); + padding: var(--paper-tooltip-padding, 10px 8px); +} + +/* Typography */ + +.cr-padded-text { + padding-block-end: var(--cr-section-vertical-padding); + padding-block-start: var(--cr-section-vertical-padding); +} + +.cr-title-text { + color: var(--cr-title-text-color); + font-size: 107.6923%; /* Go to 14px from 13px. */ + font-weight: 500; +} + +.cr-secondary-text { + color: var(--cr-secondary-text-color); + font-weight: 400; +} + +.cr-form-field-label { + color: var(--cr-form-field-label-color); + display: block; + font-size: var(--cr-form-field-label-font-size); + font-weight: 500; + letter-spacing: .4px; + line-height: var(--cr-form-field-label-line-height); + margin-bottom: 8px; +} + +.cr-vertical-tab { + align-items: center; + display: flex; +} + +.cr-vertical-tab::before { + border-radius: 0 3px 3px 0; + content: ''; + display: block; + flex-shrink: 0; + height: var(--cr-vertical-tab-height, 100%); + width: 4px; +} + +.cr-vertical-tab.selected::before { + background: var(--cr-vertical-tab-selected-color, var(--cr-checked-color)); +} + +:host-context([dir=rtl]) .cr-vertical-tab::before { + /* Border-radius based on block/inline is not yet supported. */ + transform: scaleX(-1); +} + +.iph-anchor-highlight { + background-color: var(--cr-iph-anchor-highlight-color); +}
diff --git a/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts b/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts index ab7cd7b1..480f764f 100644 --- a/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts +++ b/ui/webui/resources/cr_elements/cr_slider/cr_slider.ts
@@ -7,7 +7,7 @@ * a continuous or discrete range of numbers. */ import '../../js/cr.m.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../shared_vars_css.m.js'; import {PaperRippleBehavior} from '//resources/polymer/v3_0/paper-behaviors/paper-ripple-behavior.js';
diff --git a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts index 554c0a57..9c86b143 100644 --- a/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts +++ b/ui/webui/resources/cr_elements/cr_tabs/cr_tabs.ts
@@ -19,7 +19,7 @@ * - no horizontal scrolling, it is assumed that tabs always fit in the * available space */ -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../shared_vars_css.m.js'; import {DomRepeatEvent, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts b/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts index 1305a0bc..786650c 100644 --- a/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts +++ b/ui/webui/resources/cr_elements/cr_toast/cr_toast_manager.ts
@@ -6,7 +6,7 @@ import '../../js/cr.m.js'; import '../../js/event_tracker.m.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import './cr_toast.js'; import {PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.ts b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.ts index 90ea96a..d3123aa 100644 --- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.ts +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.ts
@@ -4,7 +4,7 @@ import '../cr_icon_button/cr_icon_button.js'; import '../cr_icons_css.m.js'; -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import '../icons.m.js'; import '../shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-media-query/iron-media-query.js';
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.ts b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.ts index 1d63347..fabdd31 100644 --- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.ts +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.ts
@@ -5,7 +5,7 @@ import '../cr_icon_button/cr_icon_button.js'; import '../cr_icons_css.m.js'; import '../icons.m.js'; -import '../shared_style_css.m.js'; +import '../cr_shared_style.css.js'; import '../shared_vars_css.m.js'; import '//resources/polymer/v3_0/paper-spinner/paper-spinner-lite.js';
diff --git a/ui/webui/resources/cr_elements/hidden_style_css.html b/ui/webui/resources/cr_elements/hidden_style_css.html deleted file mode 100644 index 33bb9159..0000000 --- a/ui/webui/resources/cr_elements/hidden_style_css.html +++ /dev/null
@@ -1,16 +0,0 @@ -<link rel="import" href="../html/polymer.html"> - -<!-- Common style for Material Design WebUI, such that the |hidden| attributes - works within Shadow DOM. --> -<dom-module id="cr-hidden-style"> - <template> - <style> - /* Included here so we don't have to include "iron-positioning" in every - * stylesheet. See crbug.com/498405. */ - [hidden], - :host([hidden]) { - display: none !important; - } - </style> - </template> -</dom-module>
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_indicator.js b/ui/webui/resources/cr_elements/policy/cr_policy_indicator.js index cb4a630..1ae632e 100644 --- a/ui/webui/resources/cr_elements/policy/cr_policy_indicator.js +++ b/ui/webui/resources/cr_elements/policy/cr_policy_indicator.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. /** @fileoverview Polymer element for indicating policies by type. */ -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import './cr_tooltip_icon.js'; import {html, mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js index 3d6b05da..8cc12118 100644 --- a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js +++ b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
@@ -6,7 +6,7 @@ * @fileoverview Polymer element for indicating policies that apply to an * element controlling a settings preference. */ -import '../hidden_style_css.m.js'; +import '../cr_hidden_style.css.js'; import './cr_tooltip_icon.js'; import {html, mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js';
diff --git a/ui/webui/resources/cr_elements/policy/cr_tooltip_icon.js b/ui/webui/resources/cr_elements/policy/cr_tooltip_icon.js index f4920747..c01887fde 100644 --- a/ui/webui/resources/cr_elements/policy/cr_tooltip_icon.js +++ b/ui/webui/resources/cr_elements/policy/cr_tooltip_icon.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import '../icons.m.js'; -import '../shared_style_css.m.js'; +import '../cr_shared_style.css.js'; import '../shared_vars_css.m.js'; import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import '//resources/polymer/v3_0/paper-tooltip/paper-tooltip.js';
diff --git a/ui/webui/resources/cr_elements/shared_style_css.html b/ui/webui/resources/cr_elements/shared_style_css.html deleted file mode 100644 index eda419e..0000000 --- a/ui/webui/resources/cr_elements/shared_style_css.html +++ /dev/null
@@ -1,189 +0,0 @@ -<link rel="import" href="../html/polymer.html"> - -<link rel="import" href="shared_vars_css.html"> -<link rel="import" href="hidden_style_css.html"> -<link rel="import" href="cr_icons_css.html"> - -<!-- Common styles for Material Design WebUI. Included directly in - settings_shared_css.html. --> -<dom-module id="cr-shared-style"> - <template> - <style include="cr-hidden-style cr-icons"> - html, - :host { - --scrollable-border-color: var(--google-grey-300); - } - - @media (prefers-color-scheme: dark) { - html, - :host { - --scrollable-border-color: var(--google-grey-700); - } - } - - [actionable] { - cursor: pointer; - } - - /* Horizontal rule line. */ - .hr { - border-top: var(--cr-separator-line); - } - - iron-list.cr-separators > *:not([first]) { - border-top: var(--cr-separator-line); - } - - [scrollable] { - border-color: transparent; - border-style: solid; - border-width: 1px 0; - overflow-y: auto; - } - [scrollable].is-scrolled { - border-top-color: var(--scrollable-border-color); - } - [scrollable].can-scroll:not(.scrolled-to-bottom) { - border-bottom-color: var(--scrollable-border-color); - } - [scrollable] iron-list > :not(.no-outline):focus, - [selectable]:focus, - [selectable] > :focus { - background-color: var(--cr-focused-item-color); - outline: none; - } - - .scroll-container { - display: flex; - flex-direction: column; - min-height: 1px; - } - - [selectable] > * { - cursor: pointer; - } - - .cr-centered-card-container { - box-sizing: border-box; - display: block; - height: inherit; - margin: 0 auto; - max-width: var(--cr-centered-card-max-width); - min-width: 550px; - position: relative; - width: calc(100% * var(--cr-centered-card-width-percentage)); - } - - .cr-container-shadow { - box-shadow: inset 0 5px 6px -3px rgba(0, 0, 0, .4); - height: var(--cr-container-shadow-height); - left: 0; - margin: 0 0 var(--cr-container-shadow-margin); - opacity: 0; - pointer-events: none; - position: relative; - right: 0; - top: 0; - transition: opacity 500ms; - z-index: 1; - } - - /** Styles for elements that implement the CrContainerShadowBehavior */ - #cr-container-shadow-bottom { - margin-bottom: 0; - margin-top: var(--cr-container-shadow-margin); - transform: scaleY(-1); - } - - #cr-container-shadow-top.has-shadow, - #cr-container-shadow-bottom.has-shadow { - opacity: var(--cr-container-shadow-max-opacity); - } - - .cr-row { - align-items: center; - border-top: var(--cr-separator-line); - display: flex; - min-height: var(--cr-section-min-height); - padding: 0 var(--cr-section-padding); - } - - .cr-row.first, - .cr-row.continuation { - border-top: none; - } - - .cr-row-gap { - padding-inline-start: 16px; - } - - .cr-button-gap { - margin-inline-start: 8px; - } - - paper-tooltip::part(tooltip) { - border-radius: var(--paper-tooltip-border-radius, 2px); - font-size: 92.31%; /* Effectively 12px if the host default is 13px. */ - font-weight: 500; - max-width: 330px; - min-width: var(--paper-tooltip-min-width, 200px); - padding: var(--paper-tooltip-padding, 10px 8px); - } - - /* Typography */ - - .cr-padded-text { - padding-block-end: var(--cr-section-vertical-padding); - padding-block-start: var(--cr-section-vertical-padding); - } - - .cr-title-text { - color: var(--cr-title-text-color); - font-size: 107.6923%; /* Go to 14px from 13px. */ - font-weight: 500; - } - - .cr-secondary-text { - color: var(--cr-secondary-text-color); - font-weight: 400; - } - - .cr-form-field-label { - color: var(--cr-form-field-label-color); - display: block; - font-size: var(--cr-form-field-label-font-size); - font-weight: 500; - letter-spacing: .4px; - line-height: var(--cr-form-field-label-line-height); - margin-bottom: 8px; - } - - .cr-vertical-tab { - align-items: center; - display: flex; - } - - .cr-vertical-tab::before { - border-radius: 0 3px 3px 0; - content: ''; - display: block; - flex-shrink: 0; - height: var(--cr-vertical-tab-height, 100%); - width: 4px; - } - - .cr-vertical-tab.selected::before { - background: var(--cr-vertical-tab-selected-color, var(--cr-checked-color)); - } - - :host-context([dir=rtl]) .cr-vertical-tab::before { - /* Border-radius based on block/inline is not yet supported. */ - transform: scaleX(-1); - } - - .iph-anchor-highlight { - background-color: var(--cr-iph-anchor-highlight-color); - } - </style> - </template> -</dom-module>