diff --git a/DEPS b/DEPS index 2aaf2fb..1f0d7e5 100644 --- a/DEPS +++ b/DEPS
@@ -253,11 +253,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': 'e253cc3e55d32419bdd7a1b8a79b790814b03d7d', + 'skia_revision': '8d29ce3305351446ca3840a5985e2a06eda3b766', # 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': 'bb89a37b7214956af8d91e7fb76264bf5ba587c0', + 'v8_revision': '967f520eb867f235a51cf0bcd3f1b4960a4dcb09', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. @@ -328,7 +328,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'c9d94630e3a2bda57ca590e97798718b3f5cb100', + 'devtools_frontend_revision': 'b0555f75a725956ee7ec4e3e11d69b416f4ea624', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -412,7 +412,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'libcxxabi_revision': 'a897d0f3f8e8c28ac2abf848f3b695b724409298', + 'libcxxabi_revision': '93b8dcd57bd8ebe201ec24f7257339988ed2ef7c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -527,7 +527,7 @@ 'packages': [ { 'package': 'infra/3pp/tools/httpd-php/${{platform}}', - 'version': 'version:2@httpd2.4.38.php7.3.31.chromium.1', + 'version': 'version:2@httpd2.4.38.php7.3.31.chromium.2', }, ], 'dep_type': 'cipd', @@ -816,7 +816,7 @@ 'packages': [ { 'package': 'chromium/rts/model/linux-amd64', - 'version': 'eEKxTcWI5TCbL_dNqak7VgCt705-dYKLw6O697CNiSoC', + 'version': 'RLW71Y2eRTjMSjaHAyDffpdD7OwJhJLbjOf0-BLLmwsC', }, ], 'dep_type': 'cipd', @@ -827,7 +827,7 @@ 'packages': [ { 'package': 'chromium/rts/model/mac-amd64', - 'version': 'nXXmYVXgcExxRTjx7e9SgpsJzxsTolp9ObHPfX1DKXIC', + 'version': 'kXqkgNAZI3mjN_7BL0owH1iDd9WbjGNLQQmF5UiaINMC', }, ], 'dep_type': 'cipd', @@ -1107,7 +1107,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '32317b1903affb8798ac58ecc15ab503d5bb6127', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '725b443750be9664a1c5a12ce19d5fc42dda4cd2', 'condition': 'checkout_chromeos', }, @@ -1510,7 +1510,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '86fc023993c5b9b98d2333c389af8c2a3026ffcc', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '02e3224f3e0a7f5f01c6daa4b8139a131be2e224', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1728,10 +1728,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'cf04aebdf9b53bb2853f22a81465688daf879ec6', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'd4c9a41a05a4e339d3e9bd660fe4f1c069473da5', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '7498fde17a5e5bef4d81ce0f57bceac75a3357cc', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '7ddc7d548cf7f1a39b7efabd3a06f8162305baee', + Var('webrtc_git') + '/src.git' + '@' + '6160ca53d113a4b6c6cb77f78a6d724344dfe8ef', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1801,7 +1801,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@608ae5bd0b8db56d78691d0ff9dabfc1692b4df8', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@d9c065cf3372611252ee2dd8657ab12dab0a5653', 'condition': 'checkout_src_internal', }, @@ -1831,7 +1831,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'pT8LaiqCoa5lm3HWqD8ZoHWiCo_hdvy_NhldI8QQjtwC', + 'version': 'u67vrrhNviCfWBV4S_3DgdPbceF4ciF4jNJUV3vlrskC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal',
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index d75fef0..99723fa 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -126,7 +126,6 @@ excluded_paths: Optional[Sequence[str]] = None -# Format: Sequence of BanRule: _BANNED_JAVA_IMPORTS : Sequence[BanRule] = ( BanRule( 'import java.net.URI;', @@ -175,7 +174,6 @@ ), ) -# Format: Sequence of BanRule: _BANNED_JAVA_FUNCTIONS : Sequence[BanRule] = ( BanRule( 'StrictMode.allowThreadDiskReads()', @@ -203,7 +201,6 @@ ), ) -# Format: Sequence of BanRule: _BANNED_OBJC_FUNCTIONS : Sequence[BanRule] = ( BanRule( 'addTrackingRect:', @@ -305,7 +302,6 @@ ), ) -# Format: Sequence of BanRule: _BANNED_IOS_OBJC_FUNCTIONS = ( BanRule( r'/\bTEST[(]', @@ -328,7 +324,6 @@ ), ) -# Format: Sequence of BanRule: _BANNED_IOS_EGTEST_FUNCTIONS : Sequence[BanRule] = ( BanRule( r'/\bEXPECT_OCMOCK_VERIFY\b', @@ -340,7 +335,6 @@ ), ) -# Format: Sequence of BanRule: _BANNED_CPP_FUNCTIONS : Sequence[BanRule] = ( BanRule( r'/\busing namespace ', @@ -1008,6 +1002,19 @@ ), ) +_BANNED_MOJOM_PATTERNS : Sequence[BanRule] = ( + BanRule( + 'handle<shared_buffer>', + ( + 'Please use one of the more specific shared memory types instead:', + ' mojo_base.mojom.ReadOnlySharedMemoryRegion', + ' mojo_base.mojom.WritableSharedMemoryRegion', + ' mojo_base.mojom.UnsafeSharedMemoryRegion', + ), + True, + ), +) + # Format: Sequence of tuples containing: # * String pattern or, if starting with a slash, a regular expression. # * Sequence of strings to show when the pattern matches. @@ -1683,6 +1690,13 @@ for ban_rule in _BANNED_CPP_FUNCTIONS: CheckForMatch(f, line_num, line, ban_rule) + file_filter = lambda f: f.LocalPath().endswith(('.mojom')) + for f in input_api.AffectedFiles(file_filter=file_filter): + for line_num, line in f.ChangedContents(): + for ban_rule in _BANNED_MOJOM_PATTERNS: + CheckForMatch(f, line_num, line, ban_rule) + + result = [] if (warnings): result.append(
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py index e5ca100..76d425a 100755 --- a/PRESUBMIT_test.py +++ b/PRESUBMIT_test.py
@@ -2591,6 +2591,28 @@ self.assertTrue('third_party/blink/ok/file3.cc' not in results[0].message) self.assertTrue('content/renderer/ok/file3.cc' not in results[0].message) + def testBannedMojomPatterns(self): + input_api = MockInputApi() + input_api.files = [ + MockFile('bad.mojom', + ['struct Bad {', + ' handle<shared_buffer> buffer;', + '};']), + MockFile('good.mojom', + ['struct Good {', + ' mojo_base.mojom.ReadOnlySharedMemoryRegion region1;', + ' mojo_base.mojom.WritableSharedMemoryRegion region2;', + ' mojo_base.mojom.UnsafeSharedMemoryRegion region3;', + '};']), + ] + + results = PRESUBMIT.CheckNoBannedFunctions(input_api, MockOutputApi()) + + # warnings are results[0], errors are results[1] + self.assertEqual(1, len(results)) + self.assertTrue('bad.mojom' in results[0].message) + self.assertTrue('good.mojom' not in results[0].message) + def testDeprecatedMojoTypes(self): ok_paths = ['components/arc'] warning_paths = ['some/cpp']
diff --git a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected b/android_webview/expectations/system_webview_bundle.AndroidManifest.expected index 818185f9..1e15014 100644 --- a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected +++ b/android_webview/expectations/system_webview_bundle.AndroidManifest.expected
@@ -10,6 +10,7 @@ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.INTERNET"/> + <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31"/> <application android:name="org.chromium.android_webview.nonembedded.WebViewApkApplication"
diff --git a/android_webview/expectations/trichrome_webview_bundle.AndroidManifest.expected b/android_webview/expectations/trichrome_webview_bundle.AndroidManifest.expected index a8dc50d4c..9b40ada9 100644 --- a/android_webview/expectations/trichrome_webview_bundle.AndroidManifest.expected +++ b/android_webview/expectations/trichrome_webview_bundle.AndroidManifest.expected
@@ -10,6 +10,7 @@ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.INTERNET"/> + <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-sdk android:minSdkVersion="29" android:targetSdkVersion="31"/> <application android:name="org.chromium.android_webview.nonembedded.WebViewApkApplication"
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java index 72fc4149..083e341 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -18,6 +18,7 @@ import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; +import android.webkit.WebChromeClient; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -34,7 +35,9 @@ import org.chromium.content_public.common.ContentUrlConstants; import java.security.Principal; +import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.regex.Pattern; /** @@ -298,6 +301,97 @@ private String mTitle; private String mDefaultFilename; private boolean mCapture; + private static final Map<String, String> sAcceptTypesMapping = new HashMap<String, + String>() { + { + put("application/*", "application/*"); + put("audio/*", "audio/*"); + put("font/*", "font/*"); + put("image/*", "image/*"); + put("text/*", "text/*"); + put("video/*", "video/*"); + put(".aac", "audio/aac"); + put(".abw", "application/x-abiword"); + put(".arc", "application/x-freearc"); + put(".avif", "image/avif"); + put(".avi", "video/x-msvideo"); + put(".azw", "application/vnd.amazon.ebook"); + put(".bin", "application/octet-stream"); + put(".bmp", "image/bmp"); + put(".bz", "application/x-bzip"); + put(".bz2", "application/x-bzip2"); + put(".cda", "application/x-cdf"); + put(".csh", "application/x-csh"); + put(".css", "text/css"); + put(".csv", "text/csv"); + put(".doc", "application/msword"); + put(".docx", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + put(".eot", "application/vnd.ms-fontobject"); + put(".epub", "application/epub+zip"); + put(".gz", "application/gzip"); + put(".gif", "image/gif"); + put(".htm", "text/html"); + put(".html", "text/html"); + put(".ico", "image/vnd.microsoft.icon"); + put(".ics", "text/calendar"); + put(".jar", "application/java-archive"); + put(".jpeg", "image/jpeg"); + put(".jpg", "image/jpeg"); + put(".js", "text/javascript"); + put(".json", "application/json"); + put(".jsonld", "application/ld+json"); + put(".mid", "audio/midi"); + put(".midi", "audio/midi"); + put(".mjs", "text/javascript"); + put(".mp3", "audio/mpeg"); + put(".mp4", "video/mp4"); + put(".mpeg", "video/mpeg"); + put(".mpkg", "application/vnd.apple.installer+xml"); + put(".odp", "application/vnd.oasis.opendocument.presentation"); + put(".ods", "application/vnd.oasis.opendocument.spreadsheet"); + put(".odt", "application/vnd.oasis.opendocument.text"); + put(".oga", "audio/ogg"); + put(".ogv", "video/ogg"); + put(".ogx", "application/ogg"); + put(".opus", "audio/opus"); + put(".otf", "font/otf"); + put(".png", "image/png"); + put(".pdf", "application/pdf"); + put(".php", "application/x-httpd-php"); + put(".ppt", "application/vnd.ms-powerpoint"); + put(".pptx", + "application/vnd.openxmlformats-officedocument" + + ".presentationml.presentation"); + put(".rar", "application/vnd.rar"); + put(".rtf", "application/rtf"); + put(".sh", "application/x-sh"); + put(".svg", "image/svg+xml"); + put(".swf", "application/x-shockwave-flash"); + put(".tar", "application/x-tar"); + put(".tif", "image/tiff"); + put(".tiff", "image/tiff"); + put(".ts", "video/mp2t"); + put(".ttf", "font/ttf"); + put(".txt", "text/plain"); + put(".vsd", "application/vnd.visio"); + put(".wav", "audio/wav"); + put(".weba", "audio/webm"); + put(".webm", "video/webm"); + put(".webp", "image/webp"); + put(".woff", "font/woff"); + put(".woff2", "font/woff2"); + put(".xhtml", "application/xhtml+xml"); + put(".xls", "application/vnd.ms-excel"); + put(".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + put(".xml", "application/xml"); + put(".xul", "application/vnd.mozilla.xul+xml"); + put(".zip", "application/zip"); + put(".3gp", "video/3gpp"); + put(".3g2", "video/3gpp2"); + put(".7z", "application/x-7z-compressed"); + } + }; public FileChooserParamsImpl(int mode, String acceptTypes, String title, String defaultFilename, boolean capture) { @@ -337,15 +431,46 @@ public Intent createIntent() { String mimeType = "*/*"; - if (mAcceptTypes != null && !mAcceptTypes.trim().isEmpty()) { - mimeType = mAcceptTypes.split(",")[0]; - } - Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.addCategory(Intent.CATEGORY_OPENABLE); + if (getMode() == WebChromeClient.FileChooserParams.MODE_OPEN_MULTIPLE) { + i.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); + } + if (mAcceptTypes != null && !mAcceptTypes.trim().isEmpty()) { + String[] acceptTypesArray = getAcceptTypes(); + if (acceptTypesArray.length > 0) { + String[] mimeTypesToAccept = getMimeTypesToAccept(getAcceptTypes()); + if (mimeTypesToAccept.length > 0) { + if (!mimeTypesToAccept[0].trim().isEmpty()) { + mimeType = mimeTypesToAccept[0]; + } + i.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypesToAccept); + } + } + } i.setType(mimeType); return i; } + + /** + * This method takes a list of types to accept, which could be file extensions, MIME types, + * or a sub-category of MIME types such as image/*, video/*, etc., and returns a list of + * MIME types. + * @param acceptTypesList + * @return An array of MIME types to accept in the file selector + */ + private String[] getMimeTypesToAccept(String[] acceptTypesList) { + ArrayList<String> acceptTypesArray = new ArrayList<String>(); + for (int i = 0; i < acceptTypesList.length; i++) { + if (sAcceptTypesMapping.containsKey(acceptTypesList[i])) { + acceptTypesArray.add(sAcceptTypesMapping.get(acceptTypesList[i])); + } else if (sAcceptTypesMapping.containsValue(acceptTypesList[i])) { + // can also directly use the MIME type in the accept HTML field + acceptTypesArray.add(acceptTypesList[i]); + } + } + return acceptTypesArray.toArray(new String[acceptTypesArray.size()]); + } } public abstract void showFileChooser(
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwFileChooserTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwFileChooserTest.java index 5d2be1f..10d0086 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwFileChooserTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwFileChooserTest.java
@@ -4,6 +4,7 @@ package org.chromium.android_webview.test; +import android.content.Intent; import android.net.Uri; import android.webkit.WebChromeClient; @@ -143,7 +144,9 @@ @Test @SmallTest public void testAcceptTypes() throws Throwable { - final String expectedAcceptTypesString = ".txt,.png,.pdf"; + final String[] expectedIntentExtraTypes = {"application/pdf", "text/plain", "image/png"}; + final String expectedIntentType = expectedIntentExtraTypes[0]; + final String expectedAcceptTypesString = ".pdf,.txt,.png"; final String singleFileUploadPageHtml = CommonResources.makeHtmlPageFrom( /*headers=*/"", /*body=*/"<input type='file' accept='" + expectedAcceptTypesString + "' id='" @@ -157,6 +160,13 @@ clickSelectFileButtonAndWaitForCallback("1"); final FileChooserParamsImpl params = mShowFileChooserHelper.getFileParams(); Assert.assertEquals(expectedAcceptTypesString, params.getAcceptTypesString()); + + // Testing FileChooserParamsImpl.createIntent API + // Verifies that the file choice type and the extra types are set properly + Intent i = params.createIntent(); + Assert.assertEquals( + i.getStringArrayExtra(Intent.EXTRA_MIME_TYPES), expectedIntentExtraTypes); + Assert.assertEquals(i.getType(), expectedIntentType); } @Test
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/devui/DeveloperUiTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/devui/DeveloperUiTest.java index 4a4ebf5..ae28995 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/devui/DeveloperUiTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/devui/DeveloperUiTest.java
@@ -4,6 +4,7 @@ package org.chromium.android_webview.test.devui; +import static androidx.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu; import static androidx.test.espresso.action.ViewActions.click; @@ -18,23 +19,33 @@ import static androidx.test.espresso.intent.matcher.UriMatchers.hasScheme; import static androidx.test.espresso.matcher.ViewMatchers.hasTextColor; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; +import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withText; import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.anything; import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import android.app.Activity; import android.app.Instrumentation.ActivityResult; +import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.Build; import android.provider.Settings; import android.support.test.InstrumentationRegistry; +import android.view.View; +import android.widget.ListView; +import androidx.test.espresso.DataInteraction; import androidx.test.espresso.intent.Intents; import androidx.test.espresso.intent.matcher.IntentMatchers; import androidx.test.filters.MediumTest; +import org.hamcrest.Matcher; import org.junit.After; import org.junit.Assume; import org.junit.Rule; @@ -45,7 +56,6 @@ import org.chromium.android_webview.devui.R; import org.chromium.android_webview.test.AwJUnit4ClassRunner; import org.chromium.base.test.BaseActivityTestRule; -import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.Feature; /** @@ -53,7 +63,6 @@ * have their own test class. */ @RunWith(AwJUnit4ClassRunner.class) -@Batch(Batch.PER_CLASS) public class DeveloperUiTest { // The package name of the test shell. This is acting both as the client app and the WebView // provider. @@ -61,7 +70,8 @@ public static final String TEST_WEBVIEW_APPLICATION_LABEL = "AwShellApplication"; @Rule - public BaseActivityTestRule mRule = new BaseActivityTestRule<MainActivity>(MainActivity.class); + public BaseActivityTestRule<MainActivity> mRule = + new BaseActivityTestRule<>(MainActivity.class); private void launchHomeFragment() { mRule.launchActivity(null); @@ -79,6 +89,9 @@ public void tearDown() throws Exception { // Activity is launched, i.e the test is not skipped. if (mRule.getActivity() != null) { + // Clear the stored preferences + mRule.getActivity().getPreferences(Context.MODE_PRIVATE).edit().clear().apply(); + // Tests are responsible for verifying every Intent they trigger. assertNoUnverifiedIntents(); Intents.release(); @@ -250,4 +263,98 @@ onView(withId(R.id.fragment_components_list)).check(matches(isDisplayed())); } + + private void switchToFlagsUi() { + onView(withId(R.id.navigation_flags_ui)).perform(click()); + } + + private void checkFlagSpinnersEnabledState(boolean shouldBeEnabled) { + // Check that all spinners are enabled + // Test assumes that the first element in the list is the text. + ListView flagsList = mRule.getActivity().findViewById(R.id.flags_list); + int flagCount = flagsList.getCount(); + DataInteraction flags = onData(anything()).inAdapterView(withId(R.id.flags_list)); + + Matcher<View> criteria = shouldBeEnabled ? isEnabled() : not(isEnabled()); + + for (int i = 1; i < flagCount; i++) { + flags.atPosition(i).onChildView(withId(R.id.flag_toggle)).check(matches(criteria)); + } + } + + @Test + @MediumTest + @Feature({"AndroidWebView"}) + public void testPostNotificationPermissions_preT() throws Throwable { + launchHomeFragment(); + MainActivity activity = mRule.getActivity(); + activity.setIsAtLeastTBuildForTesting(false); + + assertFalse(activity.needToRequestPostNotificationPermission()); + + switchToFlagsUi(); + + checkFlagSpinnersEnabledState(true); + } + + @Test + @MediumTest + @Feature({"AndroidWebView"}) + public void testPostNotificationPermissions_T_notYetRequested() throws Throwable { + launchHomeFragment(); + MainActivity activity = mRule.getActivity(); + activity.setIsAtLeastTBuildForTesting(true); + + assertTrue(activity.needToRequestPostNotificationPermission()); + + switchToFlagsUi(); + + // Check that the popup is visible, and then dismiss it + onView(withText(MainActivity.NOTIFICATION_PERMISSION_REQUEST_MESSAGE)) + .check(matches(isDisplayed())); + onView(withText("Cancel")).check(matches(isDisplayed())).perform(click()); + + checkFlagSpinnersEnabledState(false); + } + + @Test + @MediumTest + @Feature({"AndroidWebView"}) + public void testPostNotificationPermissions_T_alreadyRequested() throws Throwable { + launchHomeFragment(); + MainActivity activity = mRule.getActivity(); + + activity.setIsAtLeastTBuildForTesting(true); + SharedPreferences preferences = activity.getPreferences(Context.MODE_PRIVATE); + preferences.edit() + .putBoolean(MainActivity.POST_NOTIFICATIONS_PERMISSION_REQUESTED_KEY, true) + .apply(); + + assertFalse(activity.needToRequestPostNotificationPermission()); + + switchToFlagsUi(); + checkFlagSpinnersEnabledState(true); + } + + @Test + @MediumTest + @Feature({"AndroidWebView"}) + public void testPostNotificationPermissions_T_permissionGranted() throws Throwable { + launchHomeFragment(); + MainActivity activity = mRule.getActivity(); + + activity.setIsAtLeastTBuildForTesting(true); + activity.runOnUiThread(() -> { + // Need to run on the UI thread as it directly changes the view + activity.onRequestPermissionsResult( + 0, new String[] {"android.permission.POST_NOTIFICATIONS"}, new int[] {0}); + }); + + // Getting the permission result should have switched us to fragment_flags + onView(withId(R.id.fragment_flags)).check(matches(isDisplayed())); + checkFlagSpinnersEnabledState(true); + + assertFalse("We should no longer need to ask for permission", + activity.needToRequestPostNotificationPermission()); + } }
diff --git a/android_webview/nonembedded/java/AndroidManifest.xml b/android_webview/nonembedded/java/AndroidManifest.xml index ce91769d..6b1c677d 100644 --- a/android_webview/nonembedded/java/AndroidManifest.xml +++ b/android_webview/nonembedded/java/AndroidManifest.xml
@@ -23,6 +23,9 @@ <!-- Required by WebView Developer UI only --> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> + <!-- Required to run the foreground service--> + <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> + <application android:label="{{ application_label|default('Android System WebView') }}" android:icon="@{{manifest_package|default('com.android.webview')}}:drawable/icon_webview"
diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/FlagsFragment.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/FlagsFragment.java index c7db9a5..8b375cb 100644 --- a/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/FlagsFragment.java +++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/FlagsFragment.java
@@ -74,6 +74,8 @@ STATE_ENABLED, }; + private final boolean mEnabled; + private Map<String, Boolean> mOverriddenFlags = new HashMap<>(); private FlagsListAdapter mListAdapter; @@ -82,6 +84,10 @@ private static volatile @Nullable Runnable sFilterListener; + public FlagsFragment(boolean enabled) { + mEnabled = enabled; + } + @Override public void onAttach(Context context) { super.onAttach(context); @@ -374,6 +380,7 @@ TextView flagName = view.findViewById(R.id.flag_name); TextView flagDescription = view.findViewById(R.id.flag_description); Spinner flagToggle = view.findViewById(R.id.flag_toggle); + flagToggle.setEnabled(mEnabled); String label = flag.getName(); if (flag.getEnabledStateValue() != null) {
diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/MainActivity.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/MainActivity.java index 140c9904..93d8c60 100644 --- a/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/MainActivity.java +++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/devui/MainActivity.java
@@ -3,7 +3,11 @@ // found in the LICENSE file. package org.chromium.android_webview.devui; +import android.app.AlertDialog; +import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; @@ -18,12 +22,16 @@ import android.widget.TextView; import androidx.annotation.IntDef; +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; +import androidx.core.app.ActivityCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.BuildInfo; import org.chromium.base.IntentUtils; import org.chromium.base.metrics.RecordHistogram; @@ -41,6 +49,9 @@ private boolean mSwitchFragmentOnResume; final Map<Integer, Integer> mFragmentIdMap = new HashMap<>(); + // Store in a variable to allow for replacement during test + private boolean mIsAtLeastTBuild = BuildInfo.isAtLeastT(); + // Keep in sync with DeveloperUiService.java public static final String FRAGMENT_ID_INTENT_EXTRA = "fragment-id"; public static final int FRAGMENT_ID_HOME = 0; @@ -81,6 +92,17 @@ int COUNT = 4; } + // TODO: Replace with Manifest.permission.POST_NOTIFICATIONS once Android T is released + private static final String POST_NOTIFICATIONS = "android.permission.POST_NOTIFICATIONS"; + private static final int NOTIFICATION_PERMISSION_REQUEST_CODE = 0; + @VisibleForTesting + public static final String POST_NOTIFICATIONS_PERMISSION_REQUESTED_KEY = + "POST_NOTIFICATIONS_PERMISSION_REQUESTED"; + @VisibleForTesting + public static final String NOTIFICATION_PERMISSION_REQUEST_MESSAGE = + "WebView DevTools requires permission to show notifications " + + "in order to manage flags."; + /** * Logs a navigation to a fragment. Requires a suffix from histograms.xml ("AnyMethod", * "FromIntent", or "NavBar") to determine which histogram to log. @@ -174,7 +196,13 @@ fragment = new CrashesListFragment(); break; case FRAGMENT_ID_FLAGS: - fragment = new FlagsFragment(); + boolean needPermissionCheck = needToRequestPostNotificationPermission(); + if (needPermissionCheck) { + // Spawn the request permission check on top of the new fragment + requestPostNotificationPermission(); + } + // Enable the UI if we don't need a permission check + fragment = new FlagsFragment(!needPermissionCheck); break; case FRAGMENT_ID_COMPONENTS: fragment = new ComponentsListFragment(); @@ -312,4 +340,56 @@ } return super.onOptionsItemSelected(item); } + + @VisibleForTesting + public boolean needToRequestPostNotificationPermission() { + if (mIsAtLeastTBuild) { + // Check if we already requested the permission. If we did, we don't need to request + // it again, even if no permission was given. + SharedPreferences preferences = getPreferences(Context.MODE_PRIVATE); + boolean alreadyRequestedPermission = + preferences.getBoolean(POST_NOTIFICATIONS_PERMISSION_REQUESTED_KEY, false); + return !alreadyRequestedPermission; + } + return false; + } + + private void requestPostNotificationPermission() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage(NOTIFICATION_PERMISSION_REQUEST_MESSAGE); + builder.setPositiveButton("Ok", (dialogInterface, i) -> { + ActivityCompat.requestPermissions( + this, new String[] {POST_NOTIFICATIONS}, NOTIFICATION_PERMISSION_REQUEST_CODE); + }); + builder.setNegativeButton("Cancel", (dialogInterface, i) -> {}); + builder.create().show(); + } + + @Override + public void onRequestPermissionsResult( + int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if (requestCode == NOTIFICATION_PERMISSION_REQUEST_CODE && grantResults.length > 0) { + // We don't actually care about the result, just that we got a result. + // The service will still work. + // Save the fact that we have received the permission callback. + SharedPreferences preferences = getPreferences(Context.MODE_PRIVATE); + Editor editor = preferences.edit(); + editor.putBoolean(POST_NOTIFICATIONS_PERMISSION_REQUESTED_KEY, true); + editor.apply(); + // Reset the UI to enable input fields. + switchFragment(FRAGMENT_ID_FLAGS); + } + } + + /** + * Override whether or not the Activity is running on a T+ build of Android. + * + * This method has been introduced to avoid mocking out {@link BuildInfo#isAtLeastT()}. + * @param isAtLeastT Whether the running Android version is at least T. + */ + @VisibleForTesting + public void setIsAtLeastTBuildForTesting(boolean isAtLeastT) { + mIsAtLeastTBuild = isAtLeastT; + } }
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 0cbf25f4..04e5565 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -2630,6 +2630,7 @@ "system/palette/tools/create_note_unittest.cc", "system/palette/tools/metalayer_unittest.cc", "system/pcie_peripheral/pcie_peripheral_notification_controller_unittest.cc", + "system/phonehub/camera_roll_thumbnail_unittest.cc", "system/phonehub/camera_roll_view_unittest.cc", "system/phonehub/phone_hub_notification_controller_unittest.cc", "system/phonehub/phone_hub_recent_apps_view_unittest.cc",
diff --git a/ash/ambient/ambient_controller.cc b/ash/ambient/ambient_controller.cc index 3849970..ee96562 100644 --- a/ash/ambient/ambient_controller.cc +++ b/ash/ambient/ambient_controller.cc
@@ -17,9 +17,9 @@ #include "ash/ambient/ui/ambient_view_delegate.h" #include "ash/ambient/util/ambient_util.h" #include "ash/assistant/model/assistant_interaction_model.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/constants/ash_features.h" #include "ash/login/ui/lock_screen.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" #include "ash/public/cpp/ambient/ambient_backend_controller.h" #include "ash/public/cpp/ambient/ambient_client.h" #include "ash/public/cpp/ambient/ambient_metrics.h" @@ -756,13 +756,16 @@ base::FeatureList::GetStateIfOverridden( features::kAmbientModeAnimationFeature); if (animation_experiment_enabled.has_value()) { - // TODO(esum): Remove this block of code once the web ui that allows the - // user to select the desired theme is ready. It is currently controlled by - // an experiment flag since the feature is under active development. + // Allows developers to enable the animation without having to depend on + // personalization hub by overriding the dedicated animation experiment. current_theme = animation_experiment_enabled.value() - ? AmbientAnimationTheme::kFeelTheBreeze - : AmbientAnimationTheme::kSlideshow; - } else { + ? features::kAmbientModeAnimationThemeParam.Get() + : kDefaultAmbientAnimationTheme; + } else if (features::IsPersonalizationHubEnabled()) { + // UX testers/dogfooders only have to enable the personalization hub to get + // the animation. They do not turn on the dedicated animation experiment + // flag as that is only intended for developers who want to bypass the hub. + // If the hub is disabled, fallback to the default theme. DCHECK(GetPrimaryUserPrefService()); int current_theme_as_int = GetPrimaryUserPrefService()->GetInteger( ambient::prefs::kAmbientAnimationTheme);
diff --git a/ash/ambient/ambient_controller_unittest.cc b/ash/ambient/ambient_controller_unittest.cc index b1034c44..5da8b04 100644 --- a/ash/ambient/ambient_controller_unittest.cc +++ b/ash/ambient/ambient_controller_unittest.cc
@@ -13,7 +13,8 @@ #include "ash/ambient/ui/ambient_view_ids.h" #include "ash/assistant/assistant_interaction_controller_impl.h" #include "ash/assistant/model/assistant_interaction_model.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" +#include "ash/constants/ash_features.h" #include "ash/public/cpp/ambient/ambient_prefs.h" #include "ash/public/cpp/ambient/ambient_ui_model.h" #include "ash/public/cpp/assistant/controller/assistant_interaction_controller.h" @@ -22,6 +23,7 @@ #include "ash/system/power/power_status.h" #include "base/run_loop.h" #include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" #include "base/time/time.h" #include "build/buildflag.h" #include "chromeos/assistant/buildflags.h" @@ -1105,6 +1107,8 @@ #define MAYBE_RendersCorrectView DISABLED_RendersCorrectView #endif // BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) TEST_F(AmbientControllerTest, MAYBE_RendersCorrectView) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature(features::kPersonalizationHub); SetAmbientAnimationTheme(AmbientAnimationTheme::kSlideshow); LockScreen();
diff --git a/ash/ambient/resources/ambient_animation_static_resources.h b/ash/ambient/resources/ambient_animation_static_resources.h index 3532d383..ac813fec 100644 --- a/ash/ambient/resources/ambient_animation_static_resources.h +++ b/ash/ambient/resources/ambient_animation_static_resources.h
@@ -8,7 +8,7 @@ #include <memory> #include "ash/ash_export.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "base/containers/flat_map.h" #include "base/strings/string_piece.h"
diff --git a/ash/ambient/resources/ambient_animation_static_resources_impl_unittest.cc b/ash/ambient/resources/ambient_animation_static_resources_impl_unittest.cc index 2995b62..545ee31 100644 --- a/ash/ambient/resources/ambient_animation_static_resources_impl_unittest.cc +++ b/ash/ambient/resources/ambient_animation_static_resources_impl_unittest.cc
@@ -5,7 +5,7 @@ #include "ash/ambient/resources/ambient_animation_static_resources.h" #include "ash/ambient/resources/ambient_animation_resource_constants.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "base/json/json_reader.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ash/ambient/test/ambient_ash_test_base.h b/ash/ambient/test/ambient_ash_test_base.h index 3594a0a..9022a93 100644 --- a/ash/ambient/test/ambient_ash_test_base.h +++ b/ash/ambient/test/ambient_ash_test_base.h
@@ -13,7 +13,7 @@ #include "ash/ambient/ambient_controller.h" #include "ash/ambient/test/test_ambient_client.h" #include "ash/ambient/ui/ambient_background_image_view.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/public/cpp/ambient/proto/photo_cache_entry.pb.h" #include "ash/public/cpp/test/test_image_downloader.h" #include "ash/test/ash_test_base.h"
diff --git a/ash/components/phonehub/fake_camera_roll_manager.cc b/ash/components/phonehub/fake_camera_roll_manager.cc index e10972f..1e0aac47 100644 --- a/ash/components/phonehub/fake_camera_roll_manager.cc +++ b/ash/components/phonehub/fake_camera_roll_manager.cc
@@ -22,6 +22,7 @@ } else { PA_LOG(VERBOSE) << "Fake Camera Roll Download: Success"; } + download_request_count_++; } void FakeCameraRollManager::SetIsCameraRollAvailableToBeEnabled( @@ -49,6 +50,10 @@ simulated_error_type_ = error_type; } +int FakeCameraRollManager::GetDownloadRequestCount() { + return download_request_count_; +} + void FakeCameraRollManager::ComputeAndUpdateUiState() { if (!is_camera_roll_accessible_) { ui_state_ = CameraRollUiState::SHOULD_HIDE;
diff --git a/ash/components/phonehub/fake_camera_roll_manager.h b/ash/components/phonehub/fake_camera_roll_manager.h index 5d579198..98cd3209 100644 --- a/ash/components/phonehub/fake_camera_roll_manager.h +++ b/ash/components/phonehub/fake_camera_roll_manager.h
@@ -21,6 +21,7 @@ void SetIsAndroidStorageGranted(bool granted); void SetSimulatedDownloadError(bool has_error); void SetSimulatedErrorType(Observer::DownloadErrorType error_type); + int GetDownloadRequestCount(); bool is_camera_roll_enabled() const { return !is_avaiable_to_be_enabled_; } @@ -33,6 +34,7 @@ // CameraRollManager: void DownloadItem( const proto::CameraRollItemMetadata& item_metadata) override; + int download_request_count_ = 0; bool is_avaiable_to_be_enabled_ = true; bool is_camera_roll_accessible_ = true; bool is_android_storage_granted_ = true;
diff --git a/ash/constants/BUILD.gn b/ash/constants/BUILD.gn index fe024d1..b9d70e9 100644 --- a/ash/constants/BUILD.gn +++ b/ash/constants/BUILD.gn
@@ -10,6 +10,8 @@ output_name = "ash_constants" defines = [ "IS_ASH_CONSTANTS_IMPL" ] sources = [ + "ambient_animation_theme.cc", + "ambient_animation_theme.h", "app_types.h", "ash_constants.cc", "ash_constants.h",
diff --git a/ash/public/cpp/ambient/ambient_animation_theme.cc b/ash/constants/ambient_animation_theme.cc similarity index 89% rename from ash/public/cpp/ambient/ambient_animation_theme.cc rename to ash/constants/ambient_animation_theme.cc index f3d0d8e..3d82a8c 100644 --- a/ash/public/cpp/ambient/ambient_animation_theme.cc +++ b/ash/constants/ambient_animation_theme.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" namespace ash {
diff --git a/ash/public/cpp/ambient/ambient_animation_theme.h b/ash/constants/ambient_animation_theme.h similarity index 65% rename from ash/public/cpp/ambient/ambient_animation_theme.h rename to ash/constants/ambient_animation_theme.h index 5ac58a3a..08275b7 100644 --- a/ash/public/cpp/ambient/ambient_animation_theme.h +++ b/ash/constants/ambient_animation_theme.h
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_PUBLIC_CPP_AMBIENT_AMBIENT_ANIMATION_THEME_H_ -#define ASH_PUBLIC_CPP_AMBIENT_AMBIENT_ANIMATION_THEME_H_ +#ifndef ASH_CONSTANTS_AMBIENT_ANIMATION_THEME_H_ +#define ASH_CONSTANTS_AMBIENT_ANIMATION_THEME_H_ #include <ostream> -#include "ash/public/cpp/ash_public_export.h" +#include "base/component_export.h" namespace ash { @@ -16,7 +16,7 @@ // // These values are persisted in user pref storage, so they should never be // renumbered or reused. -enum class ASH_PUBLIC_EXPORT AmbientAnimationTheme { +enum class AmbientAnimationTheme { // This is the one exception in the list, and it describes the mode where // IMAX photos are displayed at full screen in a slideshow fashion. This is // not currently implemented as an "animation" and doesn't have a Lottie file. @@ -27,12 +27,12 @@ kMaxValue = kFloatOnBy, }; -static constexpr AmbientAnimationTheme kDefaultAmbientAnimationTheme = +inline constexpr AmbientAnimationTheme kDefaultAmbientAnimationTheme = AmbientAnimationTheme::kSlideshow; -ASH_PUBLIC_EXPORT std::ostream& operator<<(std::ostream& os, - AmbientAnimationTheme theme); +COMPONENT_EXPORT(ASH_CONSTANTS) +std::ostream& operator<<(std::ostream& os, AmbientAnimationTheme theme); } // namespace ash -#endif // ASH_PUBLIC_CPP_AMBIENT_AMBIENT_ANIMATION_THEME_H_ +#endif // ASH_CONSTANTS_AMBIENT_ANIMATION_THEME_H_
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index f2d2dbc..db79980e 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -83,11 +83,22 @@ constexpr base::FeatureParam<bool> kAmbientModeStreetArtAlbumEnabled{ &kAmbientModeFeature, "StreetArtAlbumEnabled", false}; +// The "slideshow" theme is intentionally omitted here. For that, the developer +// can just disable |kAmbientModeAnimationFeature| entirely. +const base::FeatureParam<AmbientAnimationTheme>::Option + kAmbientModeAnimationThemeOptions[] = { + {AmbientAnimationTheme::kFeelTheBreeze, "feel_the_breeze"}, + {AmbientAnimationTheme::kFloatOnBy, "float_on_by"}}; + +// When |kAmbientModeAnimationFeature| is enabled, specifies which animation +// theme to load. If |kAmbientModeAnimationFeature| is disabled, this is +// unused. +const base::FeatureParam<AmbientAnimationTheme> kAmbientModeAnimationThemeParam{ + &kAmbientModeAnimationFeature, "animation_theme", + AmbientAnimationTheme::kFeelTheBreeze, &kAmbientModeAnimationThemeOptions}; + // Controls whether to launch the animated screensaver (as opposed to the -// existing photo slideshow) when entering ambient mode. Currently, there is -// only one animation theme available ("feel the breeze"), but a FeatureParam -// will be introduced that allows the user to select a specific theme when more -// become available. +// existing photo slideshow) when entering ambient mode. const base::Feature kAmbientModeAnimationFeature{ "ChromeOSAmbientModeAnimation", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -493,7 +504,7 @@ // Enables displaying additional OpenVPN configuration values on the network // details page. const base::Feature kExtendedOpenVpnSettings{"ExtendedOpenVpnSettings", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Enables setting the device hostname. const base::Feature kEnableHostnameSetting{"EnableHostnameSetting", @@ -635,7 +646,7 @@ base::FEATURE_DISABLED_BY_DEFAULT}; // Enables the System Web App (SWA) version of file manager. -const base::Feature kFilesSWA{"FilesSWA", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kFilesSWA{"FilesSWA", base::FEATURE_ENABLED_BY_DEFAULT}; // Enables partitioning of removable disks in file manager. const base::Feature kFilesSinglePartitionFormat{
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 7f4680f7a..38185825 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -5,6 +5,7 @@ #ifndef ASH_CONSTANTS_ASH_FEATURES_H_ #define ASH_CONSTANTS_ASH_FEATURES_H_ +#include "ash/constants/ambient_animation_theme.h" #include "base/component_export.h" #include "base/feature_list.h" #include "base/metrics/field_trial_params.h" @@ -51,6 +52,9 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kAmbientModeAnimationFeature; COMPONENT_EXPORT(ASH_CONSTANTS) +extern const base::FeatureParam<AmbientAnimationTheme> + kAmbientModeAnimationThemeParam; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kAmbientModeDevUseProdFeature; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kAmbientModePhotoPreviewFeature;
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index 1f08ec60..e6123f22 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -23,8 +23,6 @@ "accessibility_focus_ring_controller.h", "accessibility_focus_ring_info.cc", "accessibility_focus_ring_info.h", - "ambient/ambient_animation_theme.cc", - "ambient/ambient_animation_theme.h", "ambient/ambient_backend_controller.cc", "ambient/ambient_backend_controller.h", "ambient/ambient_client.cc",
diff --git a/ash/quick_pair/repository/fast_pair_repository_impl.cc b/ash/quick_pair/repository/fast_pair_repository_impl.cc index 45d8ee1..7d5b1cd7 100644 --- a/ash/quick_pair/repository/fast_pair_repository_impl.cc +++ b/ash/quick_pair/repository/fast_pair_repository_impl.cc
@@ -163,6 +163,7 @@ const AccountKeyFilter& account_key_filter, CheckAccountKeysCallback callback, absl::optional<nearby::fastpair::UserReadDevicesResponse> user_devices) { + QP_LOG(INFO) << __func__; if (!user_devices) { std::move(callback).Run(absl::nullopt); return;
diff --git a/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner_impl.cc b/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner_impl.cc index 78b2b75..b33fc9a 100644 --- a/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner_impl.cc +++ b/ash/quick_pair/scanning/fast_pair/fast_pair_not_discoverable_scanner_impl.cc
@@ -123,7 +123,7 @@ void FastPairNotDiscoverableScannerImpl::OnDeviceFound( device::BluetoothDevice* device) { - QP_LOG(INFO) << __func__ << ": " << device->GetNameForDisplay(); + QP_LOG(VERBOSE) << __func__ << ": " << device->GetNameForDisplay(); const std::vector<uint8_t>* fast_pair_service_data = device->GetServiceDataForUUID(kFastPairBluetoothUuid);
diff --git a/ash/system/network/network_section_header_view.cc b/ash/system/network/network_section_header_view.cc index be92f0d..b5bd53eb 100644 --- a/ash/system/network/network_section_header_view.cc +++ b/ash/system/network/network_section_header_view.cc
@@ -32,6 +32,7 @@ using chromeos::network_config::mojom::DeviceStateProperties; using chromeos::network_config::mojom::DeviceStateType; using chromeos::network_config::mojom::FilterType; +using chromeos::network_config::mojom::GlobalPolicy; using chromeos::network_config::mojom::NetworkFilter; using chromeos::network_config::mojom::NetworkStateProperties; using chromeos::network_config::mojom::NetworkStatePropertiesPtr; @@ -351,11 +352,20 @@ // The button opens the eSIM setup flow, and should only be added if the // device is eSIM-capable. - if (IsESimSupported()) { - model()->cros_network_config()->GetGlobalPolicy( - base::BindOnce(&MobileSectionHeaderView::PerformAddExtraButtons, - base::Unretained(this), enabled)); + if (!IsESimSupported()) { + return; } + + can_add_esim_button_be_enabled_ = enabled; + const gfx::VectorIcon& icon = base::i18n::IsRTL() ? kAddCellularNetworkRtlIcon + : kAddCellularNetworkIcon; + add_esim_button_ = new IconButton( + base::BindRepeating(&MobileSectionHeaderView::AddCellularButtonPressed, + base::Unretained(this)), + IconButton::Type::kSmall, &icon, GetAddESimTooltipMessageId()); + add_esim_button_->SetEnabled(enabled && !IsCellularDeviceInhibited()); + container()->AddView(TriView::Container::END, add_esim_button_); + UpdateAddESimButtonVisibility(); } void MobileSectionHeaderView::DeviceStateListChanged() { @@ -367,30 +377,26 @@ l10n_util::GetStringUTF16(GetAddESimTooltipMessageId())); } -void MobileSectionHeaderView::PerformAddExtraButtons( - bool enabled, - chromeos::network_config::mojom::GlobalPolicyPtr global_policy) { +void MobileSectionHeaderView::GlobalPolicyChanged() { + UpdateAddESimButtonVisibility(); +} + +void MobileSectionHeaderView::UpdateAddESimButtonVisibility() { + if (!add_esim_button_) { + return; + } + + const GlobalPolicy* global_policy = model()->global_policy(); + // Adding new cellular networks is disallowed when only policy cellular // networks are allowed by admin. if (ash::features::IsESimPolicyEnabled() && - global_policy->allow_only_policy_cellular_networks) { + (!global_policy || global_policy->allow_only_policy_cellular_networks)) { + add_esim_button_->SetVisible(/*visible=*/false); return; } - can_add_esim_button_be_enabled_ = enabled; - const gfx::VectorIcon& icon = base::i18n::IsRTL() ? kAddCellularNetworkRtlIcon - : kAddCellularNetworkIcon; - add_esim_button_ = new IconButton( - base::BindRepeating(&MobileSectionHeaderView::AddCellularButtonPressed, - base::Unretained(this)), - IconButton::Type::kSmall, &icon, GetAddESimTooltipMessageId()); - add_esim_button_->SetEnabled(enabled && !IsCellularDeviceInhibited()); - - // Because the toggle is added conditionally and the check is asynchronous, we - // need override the view index here in order for correct ordering of the - // toggle and the add cellular button. - container()->AddViewAt(TriView::Container::END, add_esim_button_, - /*index=*/0); + add_esim_button_->SetVisible(/*visible=*/true); } void MobileSectionHeaderView::AddCellularButtonPressed() { @@ -429,6 +435,19 @@ bool enabled = model()->GetDeviceState(NetworkType::kWiFi) == DeviceStateType::kEnabled; NetworkSectionHeaderView::Init(enabled); + model()->AddObserver(this); +} + +WifiSectionHeaderView::~WifiSectionHeaderView() { + model()->RemoveObserver(this); +} + +void WifiSectionHeaderView::DeviceStateListChanged() { + UpdateJoinButtonVisibility(); +} + +void WifiSectionHeaderView::GlobalPolicyChanged() { + UpdateJoinButtonVisibility(); } void WifiSectionHeaderView::SetToggleState(bool toggle_enabled, bool is_on) { @@ -453,6 +472,35 @@ join_button->SetEnabled(enabled); container()->AddView(TriView::Container::END, join_button); join_button_ = join_button; + UpdateJoinButtonVisibility(); +} + +void WifiSectionHeaderView::UpdateJoinButtonVisibility() { + if (!join_button_) { + return; + } + + const DeviceStateProperties* wifi_device = + model()->GetDevice(chromeos::network_config::mojom::NetworkType::kWiFi); + if (!wifi_device) { + join_button_->SetVisible(/*visible=*/false); + return; + } + + const GlobalPolicy* global_policy = model()->global_policy(); + + // Adding new network config is disallowed when only policy wifi networks + // are allowed by admin or managed networks are available and corresponding + // settings is enabled. + if (!global_policy || + global_policy->allow_only_policy_wifi_networks_to_connect || + (global_policy->allow_only_policy_wifi_networks_to_connect_if_available && + wifi_device->managed_network_available)) { + join_button_->SetVisible(/*visible=*/false); + return; + } + + join_button_->SetVisible(/*visible=*/true); } void WifiSectionHeaderView::JoinButtonPressed() {
diff --git a/ash/system/network/network_section_header_view.h b/ash/system/network/network_section_header_view.h index 9f7a851..620fac1 100644 --- a/ash/system/network/network_section_header_view.h +++ b/ash/system/network/network_section_header_view.h
@@ -117,10 +117,9 @@ // TrayNetworkStateObserver: void DeviceStateListChanged() override; + void GlobalPolicyChanged() override; - void PerformAddExtraButtons( - bool enabled, - chromeos::network_config::mojom::GlobalPolicyPtr global_policy); + void UpdateAddESimButtonVisibility(); void AddCellularButtonPressed(); @@ -150,14 +149,15 @@ base::WeakPtrFactory<MobileSectionHeaderView> weak_ptr_factory_{this}; }; -class WifiSectionHeaderView : public NetworkSectionHeaderView { +class WifiSectionHeaderView : public NetworkSectionHeaderView, + public TrayNetworkStateObserver { public: WifiSectionHeaderView(); WifiSectionHeaderView(const WifiSectionHeaderView&) = delete; WifiSectionHeaderView& operator=(const WifiSectionHeaderView&) = delete; - ~WifiSectionHeaderView() override = default; + ~WifiSectionHeaderView() override; // NetworkSectionHeaderView: void SetToggleState(bool toggle_enabled, bool is_on) override; @@ -166,9 +166,14 @@ const char* GetClassName() const override; private: + // TrayNetworkStateObserver: + void DeviceStateListChanged() override; + void GlobalPolicyChanged() override; + // NetworkSectionHeaderView: void OnToggleToggled(bool is_on) override; void AddExtraButtons(bool enabled) override; + void UpdateJoinButtonVisibility(); void JoinButtonPressed();
diff --git a/ash/system/network/tray_network_state_model.cc b/ash/system/network/tray_network_state_model.cc index 0a1aabc..ea32636 100644 --- a/ash/system/network/tray_network_state_model.cc +++ b/ash/system/network/tray_network_state_model.cc
@@ -92,6 +92,12 @@ base::Unretained(model_))); } + void GetGlobalPolicy() { + DCHECK(remote_cros_network_config_); + remote_cros_network_config_->GetGlobalPolicy(base::BindOnce( + &TrayNetworkStateModel::OnGetGlobalPolicy, base::Unretained(model_))); + } + void SetNetworkTypeEnabledState(NetworkType type, bool enabled) { DCHECK(remote_cros_network_config_); remote_cros_network_config_->SetNetworkTypeEnabledState(type, enabled, @@ -125,7 +131,9 @@ void OnNetworkCertificatesChanged() override {} - void OnPoliciesApplied(const std::string& userhash) override {} + void OnPoliciesApplied(const std::string& userhash) override { + GetGlobalPolicy(); + } TrayNetworkStateModel* model_; mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> @@ -147,6 +155,7 @@ impl_->GetActiveNetworks(); impl_->GetVirtualNetworks(); impl_->GetDeviceStateList(); + impl_->GetGlobalPolicy(); } TrayNetworkStateModel::~TrayNetworkStateModel() { @@ -263,6 +272,12 @@ has_vpn_ = !networks.empty(); } +void TrayNetworkStateModel::OnGetGlobalPolicy( + chromeos::network_config::mojom::GlobalPolicyPtr global_policy) { + global_policy_ = std::move(global_policy); + NotifyGlobalPolicyChanged(); +} + void TrayNetworkStateModel::NotifyNetworkListChanged() { if (timer_.IsRunning()) return; @@ -271,6 +286,11 @@ base::Unretained(this))); } +void TrayNetworkStateModel::NotifyGlobalPolicyChanged() { + for (auto& observer : observer_list_) + observer.GlobalPolicyChanged(); +} + void TrayNetworkStateModel::NotifyVpnProvidersChanged() { for (auto& observer : observer_list_) observer.VpnProvidersChanged();
diff --git a/ash/system/network/tray_network_state_model.h b/ash/system/network/tray_network_state_model.h index 51cb0747..c8a5d4e 100644 --- a/ash/system/network/tray_network_state_model.h +++ b/ash/system/network/tray_network_state_model.h
@@ -74,6 +74,9 @@ } bool has_vpn() const { return has_vpn_; } VpnList* vpn_list() { return vpn_list_.get(); } + const chromeos::network_config::mojom::GlobalPolicy* global_policy() { + return global_policy_.get(); + } private: void OnGetDeviceStateList( @@ -88,7 +91,11 @@ std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr> networks); + void OnGetGlobalPolicy( + chromeos::network_config::mojom::GlobalPolicyPtr global_policy); + void NotifyNetworkListChanged(); + void NotifyGlobalPolicyChanged(); void NotifyVpnProvidersChanged(); void SendActiveNetworkStateChanged(); void SendNetworkListChanged(); @@ -115,6 +122,7 @@ active_non_cellular_; chromeos::network_config::mojom::NetworkStatePropertiesPtr active_cellular_; chromeos::network_config::mojom::NetworkStatePropertiesPtr active_vpn_; + chromeos::network_config::mojom::GlobalPolicyPtr global_policy_; bool has_vpn_ = false; std::unique_ptr<VpnList> vpn_list_; };
diff --git a/ash/system/network/tray_network_state_observer.h b/ash/system/network/tray_network_state_observer.h index 4227970..e41c9b64 100644 --- a/ash/system/network/tray_network_state_observer.h +++ b/ash/system/network/tray_network_state_observer.h
@@ -22,6 +22,9 @@ // The list of VPN providers changed. virtual void VpnProvidersChanged() {} + + // The global policy object has changed. + virtual void GlobalPolicyChanged() {} }; } // namespace ash
diff --git a/ash/system/phonehub/camera_roll_thumbnail.h b/ash/system/phonehub/camera_roll_thumbnail.h index c925b93..d96fe1cd 100644 --- a/ash/system/phonehub/camera_roll_thumbnail.h +++ b/ash/system/phonehub/camera_roll_thumbnail.h
@@ -38,6 +38,9 @@ private: FRIEND_TEST_ALL_PREFIXES(CameraRollViewTest, ImageThumbnail); FRIEND_TEST_ALL_PREFIXES(CameraRollViewTest, VideoThumbnail); + FRIEND_TEST_ALL_PREFIXES(CameraRollThumbnailTest, ImageThumbnail); + FRIEND_TEST_ALL_PREFIXES(CameraRollThumbnailTest, VideoThumbnail); + FRIEND_TEST_ALL_PREFIXES(CameraRollThumbnailTest, PressButtonAndMenuItem); void ButtonPressed(); ui::SimpleMenuModel* GetMenuModel();
diff --git a/ash/system/phonehub/camera_roll_thumbnail_unittest.cc b/ash/system/phonehub/camera_roll_thumbnail_unittest.cc new file mode 100644 index 0000000..66126a8 --- /dev/null +++ b/ash/system/phonehub/camera_roll_thumbnail_unittest.cc
@@ -0,0 +1,230 @@ +// 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 "ash/system/phonehub/camera_roll_thumbnail.h" + +#include "ash/components/phonehub/camera_roll_item.h" +#include "ash/components/phonehub/fake_camera_roll_manager.h" +#include "ash/components/phonehub/fake_user_action_recorder.h" +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/style/ash_color_provider.h" +#include "base/logging.h" +#include "camera_roll_thumbnail.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/compositor/property_change_reason.h" +#include "ui/events/test/event_generator.h" +#include "ui/gfx/image/image.h" +#include "ui/gfx/image/image_unittest_util.h" +#include "ui/gfx/paint_vector_icon.h" +#include "ui/views/controls/button/menu_button.h" +#include "ui/views/style/platform_style.h" +#include "ui/views/test/views_test_base.h" +#include "ui/views/view.h" +#include "ui/views/widget/widget_utils.h" + +namespace ash { +constexpr int kRectWidthInDip = 120; +constexpr int kRectHeightInDip = 70; +constexpr gfx::Size kExpectedCameraRollThumbnailBorderSize(74, 74); +constexpr gfx::Point kExpectedCameraRollThumbnailVideoCircleOrigin(37, 37); +constexpr int kExpectedCameraRollThumbnailVideoCircleRadius = 16; +constexpr gfx::Point kExpectedCameraRollThumbnailVideoIconOrigin(27, 27); +constexpr int kExpectedCameraRollThumbnailVideoIconSize = 20; + +class CameraRollThumbnailForTest : public CameraRollThumbnail { + public: + CameraRollThumbnailForTest(const phonehub::CameraRollItem& test_item, + phonehub::CameraRollManager* camera_roll_manager, + phonehub::UserActionRecorder* user_action_recorder) + : CameraRollThumbnail(1, + test_item, + camera_roll_manager, + user_action_recorder) {} + ~CameraRollThumbnailForTest() override = default; +}; + +class CameraRollThumbnailTest : public views::ViewsTestBase { + public: + CameraRollThumbnailTest() = default; + ~CameraRollThumbnailTest() override = default; + + // ViewTestBase: + void SetUp() override { + views::ViewsTestBase::SetUp(); + fake_camera_roll_manager_ = + std::make_unique<phonehub::FakeCameraRollManager>(); + fake_user_action_recorder_ = + std::make_unique<phonehub::FakeUserActionRecorder>(); + CreateWidget(); + generator_ = + std::make_unique<ui::test::EventGenerator>(GetRootWindow(widget_)); + } + + void TearDown() override { + camera_roll_thumbnail_.reset(); + fake_camera_roll_manager_.reset(); + fake_user_action_recorder_.reset(); + generator_.reset(); + views::ViewsTestBase::TearDown(); + } + + protected: + views::Widget* widget() { return widget_; } + ui::test::EventGenerator* generator() { return generator_.get(); } + + CameraRollThumbnail* camera_roll_thumbnail() const { + return camera_roll_thumbnail_.get(); + } + + phonehub::FakeCameraRollManager* fake_camera_roll_manager() { + return fake_camera_roll_manager_.get(); + } + + void CreateWidget() { + DCHECK(!widget_); + widget_ = new views::Widget; + views::Widget::InitParams params = + CreateParams(views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); + params.bounds = gfx::Rect(0, 0, 200, 200); + widget_->Init(std::move(params)); + } + + void SetUpCameraRollThumbnailForTest(bool is_video) { + auto thumbnail_button = std::make_unique<CameraRollThumbnailForTest>( + CreateCameraRollItemWithType(is_video), fake_camera_roll_manager_.get(), + fake_user_action_recorder_.get()); + camera_roll_thumbnail_ = std::unique_ptr<CameraRollThumbnailForTest>( + widget_->SetContentsView(std::move(thumbnail_button))); + camera_roll_thumbnail_->SetBoundsRect( + gfx::Rect(0, 0, kRectWidthInDip, kRectHeightInDip)); + widget_->Show(); + } + + SkBitmap CreateExpectedThumbnail(bool is_video) { + gfx::Canvas expected(gfx::Size(kRectWidthInDip, kRectHeightInDip), + /*image_scale=*/1.0f, /*is_opaque=*/true); + auto* provider = AshColorProvider::Get(); + expected.DrawColor(provider->GetControlsLayerColor( + AshColorProvider::ControlsLayerType::kControlBackgroundColorInactive)); + + gfx::ImageSkia test_image = CreateTestThumbnail().AsImageSkia(); + expected.DrawImageInt( + test_image, 0, 0, test_image.width(), test_image.height(), 0, 0, + kExpectedCameraRollThumbnailBorderSize.width(), + kExpectedCameraRollThumbnailBorderSize.height(), false); + + if (is_video) { + cc::PaintFlags flags; + flags.setAntiAlias(true); + flags.setColor(provider->GetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparent80)); + flags.setStyle(cc::PaintFlags::kFill_Style); + expected.DrawCircle(kExpectedCameraRollThumbnailVideoCircleOrigin, + kExpectedCameraRollThumbnailVideoCircleRadius, flags); + expected.DrawImageInt( + CreateVectorIcon( + kPhoneHubCameraRollItemVideoIcon, + kExpectedCameraRollThumbnailVideoIconSize, + provider->GetContentLayerColor( + AshColorProvider::ContentLayerType::kIconColorPrimary)), + kExpectedCameraRollThumbnailVideoIconOrigin.x(), + kExpectedCameraRollThumbnailVideoIconOrigin.y()); + } + + return expected.GetBitmap(); + } + + private: + const phonehub::CameraRollItem CreateCameraRollItemWithType(bool is_video) { + phonehub::proto::CameraRollItemMetadata metadata; + metadata.set_key("key"); + metadata.set_last_modified_millis(1577865600); + metadata.set_file_size_bytes(123456); + + if (is_video) { + metadata.set_mime_type("video/mp4"); + metadata.set_file_name("fake_video.mp4"); + } else { + metadata.set_mime_type("image/png"); + metadata.set_file_name("fake_image.png"); + } + + return phonehub::CameraRollItem(metadata, CreateTestThumbnail()); + } + + const gfx::Image CreateTestThumbnail() { + SkBitmap bitmap; + bitmap.allocN32Pixels(1, 1); + return gfx::Image::CreateFrom1xBitmap(bitmap); + } + + // This is required in order for the context to find color provider + AshColorProvider color_provider_; + raw_ptr<views::Widget> widget_ = nullptr; + std::unique_ptr<CameraRollThumbnail> camera_roll_thumbnail_; + std::unique_ptr<phonehub::FakeUserActionRecorder> fake_user_action_recorder_; + std::unique_ptr<phonehub::FakeCameraRollManager> fake_camera_roll_manager_; + std::unique_ptr<ui::test::EventGenerator> generator_; +}; + +TEST_F(CameraRollThumbnailTest, ViewLayout) { + SetUpCameraRollThumbnailForTest(/*is_video=*/false); + + EXPECT_EQ(camera_roll_thumbnail()->GetFocusBehavior(), + CameraRollThumbnail::FocusBehavior::ALWAYS); + EXPECT_EQ(camera_roll_thumbnail()->GetClassName(), "CameraRollThumbnail"); +} + +TEST_F(CameraRollThumbnailTest, ImageThumbnail) { + SetUpCameraRollThumbnailForTest(/*is_video=*/false); + EXPECT_EQ(camera_roll_thumbnail()->GetFocusBehavior(), + CameraRollThumbnail::FocusBehavior::ALWAYS); + + gfx::Canvas placeholder(gfx::Size(kRectWidthInDip, kRectHeightInDip), + /*image_scale=*/1.0f, /*is_opaque=*/true); + gfx::Canvas* ptr_placeholder; + ptr_placeholder = &placeholder; + camera_roll_thumbnail()->PaintButtonContents(ptr_placeholder); + + EXPECT_TRUE( + gfx::test::AreBitmapsEqual(CreateExpectedThumbnail(/*is_video=*/false), + ptr_placeholder->GetBitmap())); +} + +TEST_F(CameraRollThumbnailTest, VideoThumbnail) { + SetUpCameraRollThumbnailForTest(/*is_video=*/true); + EXPECT_EQ(camera_roll_thumbnail()->GetFocusBehavior(), + CameraRollThumbnail::FocusBehavior::ALWAYS); + + gfx::Canvas placeholder(gfx::Size(kRectWidthInDip, kRectHeightInDip), + /*image_scale=*/1.0f, /*is_opaque=*/true); + gfx::Canvas* ptr_placeholder; + ptr_placeholder = &placeholder; + camera_roll_thumbnail()->PaintButtonContents(ptr_placeholder); + + EXPECT_TRUE( + gfx::test::AreBitmapsEqual(CreateExpectedThumbnail(/*is_video=*/true), + ptr_placeholder->GetBitmap())); +} + +TEST_F(CameraRollThumbnailTest, PressButtonAndMenuItem) { + SetUpCameraRollThumbnailForTest(/*is_video=*/false); + EXPECT_TRUE(!camera_roll_thumbnail()->menu_model_); + + // Press button + generator()->MoveMouseTo( + camera_roll_thumbnail()->GetBoundsInScreen().CenterPoint()); + generator()->ClickLeftButton(); + + // Menu model of type CameraRollMenuModel is created + EXPECT_TRUE(dynamic_cast<CameraRollMenuModel*>( + camera_roll_thumbnail()->menu_model_.get()) != nullptr); + + // Triggering menu item callback + camera_roll_thumbnail()->menu_model_.get()->ExecuteCommand( + CameraRollMenuModel::CommandID::COMMAND_DOWNLOAD, 0); + + EXPECT_EQ(fake_camera_roll_manager()->GetDownloadRequestCount(), 1); +} +} // namespace ash
diff --git a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc index 3670f2d..6645b2ee3 100644 --- a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc +++ b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.cc
@@ -7,7 +7,7 @@ #include <string> #include <vector> -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/public/cpp/ambient/common/ambient_settings.h" #include "ash/public/cpp/default_user_image.h" #include "ash/public/cpp/personalization_app/user_display_info.h"
diff --git a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h index 5271369..ac3a669 100644 --- a/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h +++ b/ash/webui/personalization_app/mojom/personalization_app_mojom_traits.h
@@ -8,7 +8,7 @@ #include <string> #include <vector> -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/public/cpp/ambient/common/ambient_settings.h" #include "ash/public/cpp/default_user_image.h" #include "ash/public/cpp/personalization_app/user_display_info.h"
diff --git a/ash/webui/personalization_app/personalization_app_ui.cc b/ash/webui/personalization_app/personalization_app_ui.cc index 373654ad..f2370a2 100644 --- a/ash/webui/personalization_app/personalization_app_ui.cc +++ b/ash/webui/personalization_app/personalization_app_ui.cc
@@ -186,9 +186,6 @@ source->AddBoolean("isDarkLightModeEnabled", features::IsDarkLightModeEnabled()); - - source->AddBoolean("isAmbientModeAnimationEnabled", - features::IsAmbientModeAnimationEnabled()); } } // namespace
diff --git a/ash/webui/personalization_app/resources/common/base.css b/ash/webui/personalization_app/resources/common/base.css index e1083f5..a3abaa8 100644 --- a/ash/webui/personalization_app/resources/common/base.css +++ b/ash/webui/personalization_app/resources/common/base.css
@@ -10,7 +10,7 @@ } body { - background-color: var(--cros-bg-color-elevation-1); + background-color: var(--cros-bg-color); } body.fullscreen-preview {
diff --git a/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html b/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html index 4b4c5472..52c499a 100644 --- a/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html +++ b/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.html
@@ -67,11 +67,9 @@ <template is="dom-if" if="[[!loadingSettings_]]"> <ambient-preview></ambient-preview> - <template is="dom-if" if="[[isAmbientModeAnimationEnabled_()]]"> - <animation-theme-list selected-animation-theme="[[animationTheme_]]" - disabled$="[[disabled_]]"> - </animation-theme-list> - </template> + <animation-theme-list selected-animation-theme="[[animationTheme_]]" + disabled$="[[disabled_]]"> + </animation-theme-list> <topic-source-list selected-topic-source="[[topicSource_]]" has-google-photos-albums="[[hasGooglePhotosAlbums_(albums_)]]" disabled="[[disabled_]]">
diff --git a/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.ts b/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.ts index 5ba0dd5..25c640a5 100644 --- a/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.ts +++ b/ash/webui/personalization_app/resources/trusted/ambient/ambient_subpage_element.ts
@@ -15,7 +15,6 @@ import './toggle_row_element.js'; import './topic_source_list_element.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {AmbientModeAlbum, AnimationTheme, TemperatureUnit, TopicSource} from '../personalization_app.mojom-webui.js'; @@ -83,10 +82,6 @@ this.updateFromStore(); } - private isAmbientModeAnimationEnabled_(): boolean { - return loadTimeData.getBoolean('isAmbientModeAnimationEnabled'); - } - private onClickAmbientModeButton_(event: Event) { event.stopPropagation(); this.setAmbientModeEnabled_(!this.ambientModeEnabled_);
diff --git a/ash/webui/personalization_app/test/fake_personalization_app_ambient_provider.h b/ash/webui/personalization_app/test/fake_personalization_app_ambient_provider.h index b497211..2c1fa96e 100644 --- a/ash/webui/personalization_app/test/fake_personalization_app_ambient_provider.h +++ b/ash/webui/personalization_app/test/fake_personalization_app_ambient_provider.h
@@ -5,7 +5,7 @@ #ifndef ASH_WEBUI_PERSONALIZATION_APP_TEST_FAKE_PERSONALIZATION_APP_AMBIENT_PROVIDER_H_ #define ASH_WEBUI_PERSONALIZATION_APP_TEST_FAKE_PERSONALIZATION_APP_AMBIENT_PROVIDER_H_ -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/webui/personalization_app/personalization_app_ambient_provider.h" #include <stdint.h>
diff --git a/ash/webui/personalization_app/test/personalization_app_browsertest.js b/ash/webui/personalization_app/test/personalization_app_browsertest.js index caef8d9..27d3b272 100644 --- a/ash/webui/personalization_app/test/personalization_app_browsertest.js +++ b/ash/webui/personalization_app/test/personalization_app_browsertest.js
@@ -167,7 +167,9 @@ testDone(); }); -TEST_F('WallpaperSubpageBrowserTest', 'LoadsCollectionsGrid', () => { +// TODO(crbug.com/1306628): Disable this test while LayoutNGBlockInInline is +// off. This should be reenabled before the M101 branch point. +TEST_F('WallpaperSubpageBrowserTest', 'DISABLED_LoadsCollectionsGrid', () => { const router = document.querySelector('personalization-router'); assertTrue(!!router, 'personalization-router should be top level element');
diff --git a/ash/webui/projector_app/resources/app/index.html b/ash/webui/projector_app/resources/app/index.html index f6ecaca..bbc79489 100644 --- a/ash/webui/projector_app/resources/app/index.html +++ b/ash/webui/projector_app/resources/app/index.html
@@ -5,7 +5,7 @@ --> <!DOCTYPE html> -<html dir="$i18n{textdirection}" lang="$i18n{language}"> +<html dir="$i18n{textdirection}" lang="$i18n{appLocale}"> <head> <meta charset="utf-8"> <title>$i18n{appTitle}</title>
diff --git a/ash/webui/shimless_rma/BUILD.gn b/ash/webui/shimless_rma/BUILD.gn index 3afe21f3..00279b38 100644 --- a/ash/webui/shimless_rma/BUILD.gn +++ b/ash/webui/shimless_rma/BUILD.gn
@@ -23,6 +23,7 @@ "//chromeos/strings/", "//content/public/browser", "//dbus", + "//ui/chromeos:chromeos", "//ui/chromeos/strings:strings_provider", "//ui/resources", "//ui/web_dialogs",
diff --git a/ash/webui/shimless_rma/DEPS b/ash/webui/shimless_rma/DEPS index c72c12ae..91ed8d8c 100644 --- a/ash/webui/shimless_rma/DEPS +++ b/ash/webui/shimless_rma/DEPS
@@ -6,6 +6,7 @@ "+chromeos/dbus/util", "+ui/resources", "+ui/web_dialogs", + "+ui/chromeos", "+ui/chromeos/strings", "+components/onc/onc_constants.h", "+components/onc/onc_pref_names.h",
diff --git a/ash/webui/shimless_rma/shimless_rma.cc b/ash/webui/shimless_rma/shimless_rma.cc index a724b4c..141897f1 100644 --- a/ash/webui/shimless_rma/shimless_rma.cc +++ b/ash/webui/shimless_rma/shimless_rma.cc
@@ -22,6 +22,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "services/network/public/mojom/content_security_policy.mojom.h" +#include "ui/chromeos/devicetype_utils.h" #include "ui/chromeos/strings/network_element_localized_strings_provider.h" #include "ui/resources/grit/webui_generated_resources.h" #include "ui/resources/grit/webui_resources.h" @@ -70,7 +71,6 @@ {"componentKeyboard", IDS_SHIMLESS_RMA_COMPONENT_KEYBOARD}, {"componentPowerButton", IDS_SHIMLESS_RMA_COMPONENT_POWER_BUTTON}, // Splash screen - {"shimlessSplashTitle", IDS_SHIMLESS_RMA_SPLASH_TITLE}, {"shimlessSplashRemembering", IDS_SHIMLESS_RMA_SPLASH_REMEMBERING}, {"shimlessSplashLoading", IDS_SHIMLESS_RMA_SPLASH_LOADING}, // Common buttons @@ -81,7 +81,6 @@ {"okButtonLabel", IDS_SHIMLESS_RMA_OK_BUTTON}, {"retryButtonLabel", IDS_SHIMLESS_RMA_RETRY_BUTTON}, // Landing page - {"welcomeTitleText", IDS_SHIMLESS_RMA_LANDING_PAGE_TITLE}, {"beginRmaWarningText", IDS_SHIMLESS_RMA_AUTHORIZED_TECH_ONLY_WARNING}, {"validatingComponentsText", IDS_SHIMLESS_RMA_VALIDATING_COMPONENTS}, {"validatedComponentsSuccessText", @@ -136,8 +135,6 @@ IDS_SHIMLESS_RMA_CHOOSE_WP_DISABLE_METHOD_PAGE_TITLE}, {"manualWpDisableMethodOptionText", IDS_SHIMLESS_RMA_MANUAL_WP_DISABLE_METHOD_OPTION}, - {"manualWpDisableMethodDescriptionText", - IDS_SHIMLESS_RMA_MANUAL_WP_DISABLE_METHOD_DESCRIPTION}, {"rsuWpDisableMethodOptionText", IDS_SHIMLESS_RMA_RSU_WP_DISABLE_METHOD_OPTION}, {"rsuWpDisableMethodDescriptionText", @@ -298,7 +295,6 @@ {"onboardingUpdatePermission", IDS_SHIMLESS_RMA_ONBOARDING_UPDATE_PERMISSION}, // Critical error - {"criticalErrorTitleText", IDS_SHIMLESS_RMA_CRITICAL_ERROR_TITLE}, {"criticalErrorMessageText", IDS_SHIMLESS_RMA_CRITICAL_ERROR_MESSAGE}, {"criticalErrorExitText", IDS_SHIMLESS_RMA_CRITICAL_EXIT_BUTTON}, {"criticalErrorRebootText", IDS_SHIMLESS_RMA_CRITICAL_REBOOT_BUTTON}, @@ -318,6 +314,22 @@ html_source->UseStringsJs(); } +void AddDevicePlaceholderStrings(content::WebUIDataSource* html_source) { + html_source->AddString( + "shimlessSplashTitle", + ui::SubstituteChromeOSDeviceType(IDS_SHIMLESS_RMA_SPLASH_TITLE)); + html_source->AddString( + "welcomeTitleText", + ui::SubstituteChromeOSDeviceType(IDS_SHIMLESS_RMA_LANDING_PAGE_TITLE)); + html_source->AddString( + "manualWpDisableMethodDescriptionText", + ui::SubstituteChromeOSDeviceType( + IDS_SHIMLESS_RMA_MANUAL_WP_DISABLE_METHOD_DESCRIPTION)); + html_source->AddString( + "criticalErrorTitleText", + ui::SubstituteChromeOSDeviceType(IDS_SHIMLESS_RMA_CRITICAL_ERROR_TITLE)); +} + } // namespace namespace shimless_rma { @@ -370,6 +382,7 @@ SetUpWebUIDataSource(html_source, resources, IDR_ASH_SHIMLESS_RMA_INDEX_HTML); AddShimlessRmaStrings(html_source); + AddDevicePlaceholderStrings(html_source); ui::network_element::AddLocalizedStrings(html_source); ui::network_element::AddOncLocalizedStrings(html_source);
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py index 8bb1f5d..00d158e 100755 --- a/base/android/jni_generator/jni_generator.py +++ b/base/android/jni_generator/jni_generator.py
@@ -141,6 +141,7 @@ self.proxy_name = kwargs.get('proxy_name', self.name) self.hashed_proxy_name = kwargs.get('hashed_proxy_name', None) + self.switch_num = None if self.params: assert type(self.params) is list @@ -159,6 +160,8 @@ else: self.type = 'function' self.method_id_var_name = kwargs.get('method_id_var_name', None) + self.return_and_signature = (self.return_type, + tuple(p.datatype for p in self.params)) class CalledByNative(object):
diff --git a/base/android/jni_generator/jni_registration_generator.py b/base/android/jni_generator/jni_registration_generator.py index 158d2ad..cb69f9f 100755 --- a/base/android/jni_generator/jni_registration_generator.py +++ b/base/android/jni_generator/jni_registration_generator.py
@@ -10,6 +10,7 @@ to register all native methods that exist within an application.""" import argparse +import collections import functools import multiprocessing import os @@ -55,13 +56,23 @@ header_path: If specified, generates a header file in this location. namespace: If specified, sets the namespace for the generated header file. """ + # For JNI multiplexing, a 16-bit prefix is used to identify each individual + # java file path. This allows fewer multiplexed functions to resolve multiple + # different native functions with the same signature across the JNI boundary + # using switch statements. Should not exceed 65536 (2**16) number of paths. + assert len(java_file_paths) < 65536 + java_path_prefix_tuples = [(path, index) + for index, path in enumerate(java_file_paths)] # Without multiprocessing, script takes ~13 seconds for chrome_public_apk # on a z620. With multiprocessing, takes ~2 seconds. results = [] with multiprocessing.Pool() as pool: for d in pool.imap_unordered( - functools.partial(_DictForPath, use_proxy_hash=proxy_opts.use_hash), - java_file_paths): + functools.partial( + _DictForPathAndPrefix, + use_proxy_hash=proxy_opts.use_hash, + enable_jni_multiplexing=proxy_opts.enable_jni_multiplexing), + java_path_prefix_tuples): if d: results.append(d) @@ -71,6 +82,13 @@ combined_dict = {} for key in MERGEABLE_KEYS: combined_dict[key] = ''.join(d.get(key, '') for d in results) + # PROXY_NATIVE_SIGNATURES will have duplicates for JNI multiplexing since + # all native methods with similar signatures map to the same proxy. + if proxy_opts.enable_jni_multiplexing: + proxy_signatures_list = sorted( + set(combined_dict['PROXY_NATIVE_SIGNATURES'].split('\n'))) + combined_dict['PROXY_NATIVE_SIGNATURES'] = '\n'.join( + signature for signature in proxy_signatures_list) if header_path: combined_dict['HEADER_GUARD'] = \ @@ -102,7 +120,20 @@ data=CreateProxyJavaFromDict(combined_dict, proxy_opts)) -def _DictForPath(path, use_proxy_hash=False): +# A wrapper for imap_ordered to call with a tuple. +def _DictForPathAndPrefix(path_prefix_tuple, use_proxy_hash, + enable_jni_multiplexing): + path, switch_prefix = path_prefix_tuple + return _DictForPath(path, + use_proxy_hash=use_proxy_hash, + enable_jni_multiplexing=enable_jni_multiplexing, + switch_prefix=switch_prefix) + + +def _DictForPath(path, + use_proxy_hash=False, + enable_jni_multiplexing=False, + switch_prefix=None): with open(path) as f: contents = jni_generator.RemoveComments(f.read()) if '@JniIgnoreNatives' in contents: @@ -122,8 +153,15 @@ jni_params = jni_generator.JniParams(fully_qualified_class) jni_params.ExtractImportsAndInnerClasses(contents) is_main_dex = jni_generator.IsMainDexJavaClass(contents) - header_generator = HeaderGenerator(namespace, fully_qualified_class, natives, - jni_params, is_main_dex, use_proxy_hash) + header_generator = HeaderGenerator( + namespace, + fully_qualified_class, + natives, + jni_params, + is_main_dex, + use_proxy_hash, + enable_jni_multiplexing=enable_jni_multiplexing, + switch_prefix=switch_prefix) return header_generator.Generate() @@ -313,8 +351,15 @@ class HeaderGenerator(object): """Generates an inline header file for JNI registration.""" - def __init__(self, namespace, fully_qualified_class, natives, jni_params, - main_dex, use_proxy_hash): + def __init__(self, + namespace, + fully_qualified_class, + natives, + jni_params, + main_dex, + use_proxy_hash, + enable_jni_multiplexing=False, + switch_prefix=None): self.namespace = namespace self.natives = natives self.proxy_natives = [n for n in natives if n.is_proxy] @@ -326,6 +371,10 @@ self.helper = jni_generator.HeaderFileGeneratorHelper( self.class_name, fully_qualified_class, use_proxy_hash, None) self.use_proxy_hash = use_proxy_hash + self.enable_jni_multiplexing = enable_jni_multiplexing + # Each java file path is assigned a 16-bit integer as a prefix to the + # switch number to ensure uniqueness across all native methods. + self.switch_prefix = switch_prefix self.registration_dict = None def Generate(self): @@ -338,11 +387,19 @@ self._AddRegisterNativesFunctions() self.registration_dict['PROXY_NATIVE_SIGNATURES'] = (''.join( - _MakeProxySignature(n, self.use_proxy_hash) - for n in self.proxy_natives)) + _MakeProxySignature( + native, + self.use_proxy_hash, + enable_jni_multiplexing=self.enable_jni_multiplexing) + for native in self.proxy_natives)) + if self.enable_jni_multiplexing: + self._AssignSwitchNumberToNatives() + if self.use_proxy_hash: self.registration_dict['FORWARDING_PROXY_METHODS'] = ('\n'.join( - _MakeForwardingProxy(n) for n in self.proxy_natives)) + _MakeForwardingProxy( + native, enable_jni_multiplexing=self.enable_jni_multiplexing) + for native in self.proxy_natives)) return self.registration_dict @@ -536,11 +593,46 @@ return self._SubstituteNativeMethods(template) return '' + def _AssignSwitchNumberToNatives(self): + # The switch number for a native method is a 32-bit integer and indicates + # which native implementation the method should be dispatched to across + # the JNI multiplexing boundary. + signature_to_methods = collections.defaultdict(list) + for native in self.proxy_natives: + same_signature_methods = signature_to_methods[native.return_and_signature] + # Should not exceed 65536 (2**16) methods with same proxy signature. + assert len(same_signature_methods) < 65536 -def _MakeForwardingProxy(proxy_native): + native.switch_num = self.switch_prefix * (2**16) + len( + same_signature_methods) + same_signature_methods.append(native.proxy_name) + + +def _GetParamsListForMultiplex(params_list): + if not params_list: + return 'int switch_num' + + # Parameters are named after their type, with a unique number per parameter + # type to make sure the names are unique, even within the same types. + params_type_count = collections.defaultdict(int) + params_with_types = [] + for p in params_list: + params_type_count[p] += 1 + params_with_types.append( + '%s %s_param%d' % + (p, p.replace('[]', '_array').lower(), params_type_count[p])) + + return ', '.join(params_with_types) + ', int switch_num' + + +def _GetMultiplexProxyName(return_type): + return 'resolve_for_' + return_type.replace('[]', '_array').lower() + + +def _MakeForwardingProxy(proxy_native, enable_jni_multiplexing=False): template = string.Template(""" public static ${RETURN_TYPE} ${METHOD_NAME}(${PARAMS_WITH_TYPES}) { - ${MAYBE_RETURN}${PROXY_CLASS}.${HASHED_NAME}($PARAM_NAMES); + ${MAYBE_RETURN}${PROXY_CLASS}.${PROXY_METHOD_NAME}(${PARAM_NAMES}); }""") params_with_types = ', '.join( @@ -548,6 +640,15 @@ param_names = ', '.join(p.name for p in proxy_native.params) proxy_class = jni_generator.ProxyHelpers.GetQualifiedClass(True) + if enable_jni_multiplexing: + if not param_names: + param_names = proxy_native.switch_num + else: + param_names += ', %s' % proxy_native.switch_num + proxy_method_name = _GetMultiplexProxyName(proxy_native.return_type) + else: + proxy_method_name = proxy_native.hashed_proxy_name + return template.substitute({ 'RETURN_TYPE': proxy_native.return_type, @@ -559,42 +660,57 @@ '' if proxy_native.return_type == 'void' else 'return ', 'PROXY_CLASS': proxy_class.replace('/', '.'), - 'HASHED_NAME': - proxy_native.hashed_proxy_name, + 'PROXY_METHOD_NAME': + proxy_method_name, 'PARAM_NAMES': param_names, }) -def _MakeProxySignature(proxy_native, use_proxy_hash): - if use_proxy_hash: - signature_template = string.Template(""" - // Original name: ${ALT_NAME} - public static native ${RETURN_TYPE} ${NAME}(${PARAMS_WITH_TYPES});""") - else: - signature_template = string.Template(""" - // Hashed name: ${ALT_NAME} - public static native ${RETURN_TYPE} ${NAME}(${PARAMS_WITH_TYPES});""") +def _MakeProxySignature(proxy_native, + use_proxy_hash, + enable_jni_multiplexing=False): + params_with_types = ', '.join('%s %s' % (p.datatype, p.name) + for p in proxy_native.params) + native_method_line = """ + public static native ${RETURN} ${PROXY_NAME}(${PARAMS_WITH_TYPES});""" - params_with_types = ', '.join( - '%s %s' % (p.datatype, p.name) for p in proxy_native.params) - args = { - 'RETURN_TYPE': proxy_native.return_type, - 'PARAMS_WITH_TYPES': params_with_types, - } - if use_proxy_hash: - args['NAME'] = proxy_native.hashed_proxy_name - args['ALT_NAME'] = proxy_native.proxy_name + if enable_jni_multiplexing: + # This has to be only one line and without comments because all the proxy + # signatures will be joined, then split on new lines with duplicates removed + # since multiple |proxy_native|s map to the same multiplexed signature. + signature_template = string.Template(native_method_line) + + alt_name = None + return_type, params_list = proxy_native.return_and_signature + proxy_name = _GetMultiplexProxyName(return_type) + params_with_types = _GetParamsListForMultiplex(params_list) + elif use_proxy_hash: + signature_template = string.Template(""" + // Original name: ${ALT_NAME}""" + native_method_line) + + alt_name = proxy_native.proxy_name + proxy_name = proxy_native.hashed_proxy_name else: - args['NAME'] = proxy_native.proxy_name - args['ALT_NAME'] = proxy_native.hashed_proxy_name - return signature_template.substitute(args) + signature_template = string.Template(""" + // Hashed name: ${ALT_NAME}""" + native_method_line) + + alt_name = proxy_native.hashed_proxy_name + proxy_name = proxy_native.proxy_name + + return signature_template.substitute({ + 'ALT_NAME': alt_name, + 'RETURN': proxy_native.return_type, + 'PROXY_NAME': proxy_name, + 'PARAMS_WITH_TYPES': params_with_types, + }) class ProxyOptions: def __init__(self, **kwargs): self.use_hash = kwargs.get('use_hash', False) + self.enable_jni_multiplexing = kwargs.get('enable_jni_multiplexing', False) self.enable_mocks = kwargs.get('enable_mocks', False) self.require_mocks = kwargs.get('require_mocks', False) # Can never require and disable. @@ -646,6 +762,10 @@ action='store_true', help='Enables hashing of the native declaration for methods in ' 'an @JniNatives interface') + arg_parser.add_argument( + '--enable_jni_multiplexing', + action='store_true', + help='Enables JNI multiplexing for Java native methods') args = arg_parser.parse_args(build_utils.ExpandFileArgs(argv[1:])) if not args.enable_proxy_mocks and args.require_mocks: @@ -656,6 +776,7 @@ sources_files = sorted(set(build_utils.ParseGnList(args.sources_files))) proxy_opts = ProxyOptions( use_hash=args.use_proxy_hash, + enable_jni_multiplexing=args.enable_jni_multiplexing, require_mocks=args.require_mocks, enable_mocks=args.enable_proxy_mocks)
diff --git a/base/rs_glue/values_glue.h b/base/rs_glue/values_glue.h index 58d3cc4..73d8b529 100644 --- a/base/rs_glue/values_glue.h +++ b/base/rs_glue/values_glue.h
@@ -6,6 +6,8 @@ #define BASE_RS_GLUE_VALUES_GLUE_H_ #include <stddef.h> + +#include "base/base_export.h" #include "base/strings/string_piece_rust.h" #include "base/values.h" #include "third_party/rust/cxx/v1/crate/include/cxx.h" @@ -23,27 +25,29 @@ using ValueSlot = absl::optional<base::Value>; // Function purposes explained in mod.rs in the same directory. -void ValueSetNoneKey(base::Value& v, rust::Str key); -void ValueSetBoolKey(base::Value& v, rust::Str key, bool value); -void ValueSetIntegerKey(base::Value& v, rust::Str key, int value); -void ValueSetDoubleKey(base::Value& v, rust::Str key, double value); -void ValueSetStringKey(base::Value& v, rust::Str key, rust::Str value); -base::Value& ValueSetDictKey(base::Value& v, rust::Str key); -base::Value& ValueSetListKey(base::Value& v, rust::Str key); -void ValueAppendNone(base::Value& v); -void ValueAppendString(base::Value& v, rust::Str value); -base::Value& ValueAppendDict(base::Value& v); -base::Value& ValueAppendList(base::Value& v); -void ValueReserveSize(base::Value& v, size_t len); -std::unique_ptr<ValueSlot> NewValueSlotForTesting(); -rust::String DumpValueSlot(const ValueSlot& v); -void ConstructNoneValue(ValueSlot& v); -void ConstructBoolValue(ValueSlot& v, bool value); -void ConstructIntegerValue(ValueSlot& v, int value); -void ConstructDoubleValue(ValueSlot& v, double value); -void ConstructStringValue(ValueSlot& v, rust::Str value); -base::Value& ConstructDictValue(ValueSlot& v); -base::Value& ConstructListValue(ValueSlot& v); +BASE_EXPORT void ValueSetNoneKey(base::Value& v, rust::Str key); +BASE_EXPORT void ValueSetBoolKey(base::Value& v, rust::Str key, bool value); +BASE_EXPORT void ValueSetIntegerKey(base::Value& v, rust::Str key, int value); +BASE_EXPORT void ValueSetDoubleKey(base::Value& v, rust::Str key, double value); +BASE_EXPORT void ValueSetStringKey(base::Value& v, + rust::Str key, + rust::Str value); +BASE_EXPORT base::Value& ValueSetDictKey(base::Value& v, rust::Str key); +BASE_EXPORT base::Value& ValueSetListKey(base::Value& v, rust::Str key); +BASE_EXPORT void ValueAppendNone(base::Value& v); +BASE_EXPORT void ValueAppendString(base::Value& v, rust::Str value); +BASE_EXPORT base::Value& ValueAppendDict(base::Value& v); +BASE_EXPORT base::Value& ValueAppendList(base::Value& v); +BASE_EXPORT void ValueReserveSize(base::Value& v, size_t len); +BASE_EXPORT std::unique_ptr<ValueSlot> NewValueSlotForTesting(); +BASE_EXPORT rust::String DumpValueSlot(const ValueSlot& v); +BASE_EXPORT void ConstructNoneValue(ValueSlot& v); +BASE_EXPORT void ConstructBoolValue(ValueSlot& v, bool value); +BASE_EXPORT void ConstructIntegerValue(ValueSlot& v, int value); +BASE_EXPORT void ConstructDoubleValue(ValueSlot& v, double value); +BASE_EXPORT void ConstructStringValue(ValueSlot& v, rust::Str value); +BASE_EXPORT base::Value& ConstructDictValue(ValueSlot& v); +BASE_EXPORT base::Value& ConstructListValue(ValueSlot& v); } // namespace rs_glue } // namespace base
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index 22ebc02..1ec4e55 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh
@@ -199,7 +199,6 @@ patch perl pkg-config - python-setuptools rpm ruby subversion @@ -212,12 +211,6 @@ $chromeos_dev_list " -if package_exists python-is-python2; then - dev_list="${dev_list} python-is-python2 python2-dev" -else - dev_list="${dev_list} python python-dev" -fi - # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built # NaCl binaries. if file -L /sbin/init | grep -q 'ELF 64-bit'; then @@ -335,6 +328,8 @@ libgtk2.0-dev mesa-common-dev msttcorefonts + python-dev + python-setuptools ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic @@ -342,8 +337,31 @@ ttf-mscorefonts-installer xfonts-mathml " + if package_exists python-is-python2; then - backwards_compatible_list="${backwards_compatible_list} python-dev" + backwards_compatible_list="${backwards_compatible_list} python-is-python2 python2-dev" +else + backwards_compatible_list="${backwards_compatible_list} python" +fi + +if package_exists python-crypto; then + backwards_compatible_list="${backwards_compatible_list} python-crypto" +fi + +if package_exists python-numpy; then + backwards_compatible_list="${backwards_compatible_list} python-numpy" +fi + +if package_exists python-openssl; then + backwards_compatible_list="${backwards_compatible_list} python-openssl" +fi + +if package_exists python-psutil; then + backwards_compatible_list="${backwards_compatible_list} python-psutil" +fi + +if package_exists python-yaml; then + backwards_compatible_list="${backwards_compatible_list} python-yaml" fi case $distro_codename in @@ -498,24 +516,6 @@ dev_list="${dev_list} php5-cgi libapache2-mod-php5" fi -# Most python 2 packages are removed in Ubuntu 20.10, but the build doesn't seem -# to need them, so only install them if they're available. -if package_exists python-crypto; then - dev_list="${dev_list} python-crypto" -fi -if package_exists python-numpy; then - dev_list="${dev_list} python-numpy" -fi -if package_exists python-openssl; then - dev_list="${dev_list} python-openssl" -fi -if package_exists python-psutil; then - dev_list="${dev_list} python-psutil" -fi -if package_exists python-yaml; then - dev_list="${dev_list} python-yaml" -fi - # Some packages are only needed if the distribution actually supports # installing them. if package_exists appmenu-gtk; then
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 059e3e3..616c883 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -1036,6 +1036,7 @@ "//chrome/browser/tab_group:junit", "//chrome/browser/tabmodel:factory_java", "//chrome/browser/tabmodel:java", + "//chrome/browser/tabmodel:junit", "//chrome/browser/tabmodel/internal:java", "//chrome/browser/tabpersistence:junit", "//chrome/browser/thumbnail:java",
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 320da6ff..e8c7309 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -597,7 +597,6 @@ "javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreUnitTest.java", - "javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabbedModeTabPersistencePolicyTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TestTabModelDirectory.java", "javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java",
diff --git a/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected b/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected index 891fd08..59ce62e 100644 --- a/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected +++ b/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected
@@ -59,6 +59,8 @@ <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_CONNECT"/> <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/> <uses-permission-sdk-23 android:name="android.permission.READ_CONTACTS"/> + <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_IMAGE"/> + <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_VIDEO"/> <uses-permission-sdk-23 android:name="android.permission.REORDER_TASKS"/> <uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> <uses-permission-sdk-23 android:name="android.permission.USE_BIOMETRIC"/>
diff --git a/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected b/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected index 3cdf98d8..9cdd537 100644 --- a/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected +++ b/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected
@@ -59,6 +59,8 @@ <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_CONNECT"/> <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/> <uses-permission-sdk-23 android:name="android.permission.READ_CONTACTS"/> + <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_IMAGE"/> + <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_VIDEO"/> <uses-permission-sdk-23 android:name="android.permission.REORDER_TASKS"/> <uses-permission-sdk-23 android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> <uses-permission-sdk-23 android:name="android.permission.USE_BIOMETRIC"/>
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index 76ba8ce5..8ea11f1c 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -74,6 +74,8 @@ <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> + <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_IMAGE"/> + <uses-permission-sdk-23 android:name="android.permission.READ_MEDIA_VIDEO"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java index e6a2f71..a5cac07c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBackupAgentImpl.java
@@ -96,7 +96,6 @@ ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED, ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, ChromePreferenceKeys.FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE, - ChromePreferenceKeys.FIRST_RUN_FLOW_SIGNIN_SETUP, ChromePreferenceKeys.PRIVACY_METRICS_REPORTING, };
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillSaveCardPromptBase.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillSaveCardPromptBase.java index bf61341b..5e53218b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillSaveCardPromptBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillSaveCardPromptBase.java
@@ -146,7 +146,8 @@ if (mSpannableStringBuilder == null) { mSpannableStringBuilder = new SpannableStringBuilder(); } else { - mSpannableStringBuilder.append("\n"); + // If this isn't the first line, append a new line before the legal message. + mSpannableStringBuilder.append("\n\n"); } int offset = mSpannableStringBuilder.length(); mSpannableStringBuilder.append(line.text);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentIntegrationTest.java index 125ab78..6020e3a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentIntegrationTest.java
@@ -43,6 +43,7 @@ import org.chromium.base.IntentUtils; import org.chromium.base.test.util.Batch; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.ActivityTabProvider.ActivityTabTabObserver; @@ -260,6 +261,7 @@ @Feature({"ConversionMeasurement"}) @Features.EnableFeatures(ChromeFeatureList.APP_TO_WEB_ATTRIBUTION) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @DisabledTest(message = "Test is flaky. crbug.com/1306267") public void testConversionIntentEnabled_CCT_preload_differentUrl() { AttributionReporter.setInstanceForTesting(mAttributionReporter); CustomTabsConnection connection = CustomTabsTestUtils.setUpConnection();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java index f969dd2..9abd5fe 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java
@@ -502,7 +502,7 @@ tabId, isIncognito, (res) -> { callbackHelper.notifyCalled(res); }); }); callbackHelper.waitForCallback(chCount); - Assert.assertEquals(isNull, callbackHelper.getRes().isEmpty()); + Assert.assertEquals(isNull, callbackHelper.getRes() == null); } private static class CPTDCallbackHelper extends CallbackHelper {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java index b636594..c6356091 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ChromeBackupAgentTest.java
@@ -16,6 +16,7 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; +import static org.mockito.Mockito.reset; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -109,10 +110,20 @@ private final CoreAccountInfo mAccountInfo = CoreAccountInfo.createFromEmailAndGaiaId("user1", "gaia_id_user1"); + private static final String PREFERENCE_KEY_NOT_BACKED_UP = "not_backed_up"; + private void setUpTestPrefs(SharedPreferences prefs) { SharedPreferences.Editor editor = prefs.edit(); + // In production some of these prefs can't be present in SharedPreferences at the same time, + // but ChromeBackupAgentImpl is agnostic to that. The focus of these tests is making sure + // that all the allowlisted prefs are backed up, and none other. editor.putBoolean(ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, true); - editor.putBoolean(ChromePreferenceKeys.FIRST_RUN_FLOW_SIGNIN_SETUP, false); + editor.putBoolean(ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED, false); + editor.putBoolean(ChromePreferenceKeys.FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE, false); + editor.putBoolean(ChromePreferenceKeys.PRIVACY_METRICS_REPORTING, false); + + editor.putBoolean(PREFERENCE_KEY_NOT_BACKED_UP, false); + doReturn(mAccountInfo).when(mIdentityManagerMock).getPrimaryAccountInfo(anyInt()); editor.apply(); } @@ -182,28 +193,43 @@ verify(backupData, times(2)).writeEntityData(new byte[] {1}, 1); verify(backupData) .writeEntityHeader( - "AndroidDefault." + ChromePreferenceKeys.FIRST_RUN_FLOW_SIGNIN_SETUP, 1); - verify(backupData).writeEntityData(new byte[] {0}, 1); + "AndroidDefault." + ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED, 1); + verify(backupData) + .writeEntityHeader("AndroidDefault." + + ChromePreferenceKeys.FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE, + 1); + verify(backupData) + .writeEntityHeader( + "AndroidDefault." + ChromePreferenceKeys.PRIVACY_METRICS_REPORTING, 1); + verify(backupData, times(3)).writeEntityData(new byte[] {0}, 1); byte[] unameBytes = ApiCompatibilityUtils.getBytesUtf8(mAccountInfo.getEmail()); verify(backupData) .writeEntityHeader("AndroidDefault." + ChromeBackupAgentImpl.SIGNED_IN_ACCOUNT_KEY, unameBytes.length); verify(backupData).writeEntityData(unameBytes, unameBytes.length); + verify(backupData, times(0)) + .writeEntityHeader(eq("AndroidDefault." + PREFERENCE_KEY_NOT_BACKED_UP), anyInt()); + newState.close(); // Check that the state was saved correctly ObjectInputStream newStateStream = new ObjectInputStream(new FileInputStream(stateFile1)); ArrayList<String> names = (ArrayList<String>) newStateStream.readObject(); - assertThat(names.size(), equalTo(4)); + assertThat(names.size(), equalTo(6)); assertThat(names, hasItem("native.pref1")); assertThat( names, hasItem("AndroidDefault." + ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE)); assertThat(names, - hasItem("AndroidDefault." + ChromePreferenceKeys.FIRST_RUN_FLOW_SIGNIN_SETUP)); + hasItem("AndroidDefault." + ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED)); + assertThat(names, + hasItem("AndroidDefault." + + ChromePreferenceKeys.FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE)); + assertThat( + names, hasItem("AndroidDefault." + ChromePreferenceKeys.PRIVACY_METRICS_REPORTING)); assertThat(names, hasItem("AndroidDefault." + ChromeBackupAgentImpl.SIGNED_IN_ACCOUNT_KEY)); ArrayList<byte[]> values = (ArrayList<byte[]>) newStateStream.readObject(); - assertThat(values.size(), equalTo(4)); + assertThat(values.size(), equalTo(6)); assertThat(values, hasItem(unameBytes)); assertThat(values, hasItem(new byte[] {0})); assertThat(values, hasItem(new byte[] {1})); @@ -239,8 +265,8 @@ mAgent.onBackup(null, backupData, newState); // Minimal check on first backup, this isn't the test here. - verify(backupData, times(4)).writeEntityHeader(anyString(), anyInt()); - verify(backupData, times(4)).writeEntityData(any(byte[].class), anyInt()); + verify(backupData, times(6)).writeEntityHeader(anyString(), anyInt()); + verify(backupData, times(6)).writeEntityData(any(byte[].class), anyInt()); newState.close(); @@ -299,8 +325,8 @@ mAgent.onBackup(null, backupData, newState); // Minimal check on first backup, this isn't the test here. - verify(backupData, times(4)).writeEntityHeader(anyString(), anyInt()); - verify(backupData, times(4)).writeEntityData(any(byte[].class), anyInt()); + verify(backupData, times(6)).writeEntityHeader(anyString(), anyInt()); + verify(backupData, times(6)).writeEntityData(any(byte[].class), anyInt()); newState.close(); @@ -311,15 +337,16 @@ // Change some data. SharedPreferences.Editor editor = prefs.edit(); - editor.putBoolean(ChromePreferenceKeys.FIRST_RUN_FLOW_SIGNIN_SETUP, true); + editor.putBoolean(ChromePreferenceKeys.PRIVACY_METRICS_REPORTING, true); editor.apply(); // Do a second backup. + reset(backupData); mAgent.onBackup(oldState, backupData, newState); // Check that the second backup wrote something. - verify(backupData, times(8)).writeEntityHeader(anyString(), anyInt()); - verify(backupData, times(8)).writeEntityData(any(byte[].class), anyInt()); + verify(backupData, times(6)).writeEntityHeader(anyString(), anyInt()); + verify(backupData, times(6)).writeEntityData(any(byte[].class), anyInt()); oldState.close(); newState.close();
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 9cb312b..0473a68d 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd
@@ -1391,44 +1391,40 @@ </message> <!-- Privacy Sandbox Dialog strings --> - <!-- TODO(crbug.com/1286276) These strings are not final yet and therefore marked as translateable="false" --> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE" translateable="false" desc="Subtitle of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE" desc="A subtitle on the consent page. Consider this a tagline for the Privacy Sandbox project. * “exploring” conveys that this is a work in progress. * “new features” include settings that the user can turn on/off and also backend features that change the way Chromium works for everyone * “allow sites to deliver”: Privacy Sandbox is proposed by Google as a collaborative effort with the browser industry. We’re building and testing functionality that will live in the Chromium browser. In order to land the full promise of Privacy Sandbox, websites & advertisers need to adopt the new APIs / functionality that we’re developing. So “allow sites…” makes it clear to the user that we’re building something for the ecosystem. Typically a Google product builds something for the user, and that’s true in this case, but it’s bigger than that. * “same browsing experience using less of your info”: Another definition of the promise of Privacy Sandbox. Third-party cookies are going away. In this new world, the user will have essentially the same browsing experience but it’s more private because it doesn’t expose so much of the user’s info."> Chromium is exploring new features that allow sites to deliver the same browsing experience using less of your info </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2" translateable="false" desc="Description of the second section in the body of the Privacy Sandbox Dialog."> - During the experiment, Chromium will estimate topics you may be interested in, based on your recent browsing history. Then, without learning who you are, sites you visit may use this info to show you relevant ads. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2" desc="A paragraph beneath the “Try more transparent ads” subtitle. * “During the experiment”: The experiment happens in addition to today’s current system based on third-party cookies. In other words, even by accepting in this consent moment, the user’s core experience doesn’t change much. This is an experiment, and we need the user to understand as much. * “estimate topics”: Topics of interest include things like “Live comedy” and “Rock music”. Chromium estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”). * “recent browsing history”: Later in the UI, we define this as “a record of sites you’ve visited using Chromium on this device.” By “recent”, we mean the last 3 weeks (also defined later in the UI). * “Then”, is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understand this is essentially a two-step process. They browse, and Chromium might estimate their interests as they do so. At a later point when they continue to visit a site, that’s when the estimated interests might come into play. * “without learning who you are”: With third-party cookies, and the excessive sharing that happens in today’s world, it’s often possible for a site to be able to identify you — if not by name, then at least to realize you’re the same user who visited the site X number of days ago. With these trials, this becomes much much harder to do, and so we’re reassuring the user as to the privacy-preserving features of the experiment. (But again, we can’t overpromise, because 3rd-party cookies are still active and so the user’s privacy isn’t materially better upon clicking yes today. We’re promising a better future and need the user’s help to get there.) * “sites you visit may use this info to show you relevant ads”: 1) Chromium hs estimated your interests. 2) You visit a new site. 3) That site calls the “Topics API” which returns up to 3 topics, for example, “Pop music”, “Rock music” and “Defense industry”. The site can use those 3 topics of interests as signals to help them target ads to the user. I say “signals” because the site may also be using other means to target ads."> + During the experiment, Chromium will estimate topics you may be interested in. Then, without learning who you are, sites you visit may use this info to show you relevant ads. Interests are based on your recent browsing history and you can see and manage them. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER" translateable="false" desc="Header of the first section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER" desc="TOPICS API A sub title that describes the first of 2 ways a site can get info from Chromium in order to target ads to the user. Topics of interest include things like “Live comedy” and “Rock music”. Chromium estimates these interests based on the sites users visit. * “Your”: we need to convey a sense of ownership, even if the user didn’t explicitly choose the interests we’re talking about. Without the “your”, it could sound like Chromium is simply building a generic library of interests. * “estimated”: It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”). * “by Chromium”: This is new behavior for a browser (Chromium) to take an active role in processing user data for the purposes of showing ads. It’s important to convey “Chromium”, the actor in this case."> Your interests as estimated by Chromium </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1" translateable="false" desc="First bullet point of the first section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1" desc="TOPICS API Bullet 1 of 3 that appear beneath the “Your interests as estimated by Chromium” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chromium’s top level. The Topics API estimates topics of interest based on sites in the user’s browsing history that are participating in the trials."> <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph> Your browsing history, a record of sites you’ve visited using Chromium on this device. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2" translateable="false" desc="Second bullet point of the first section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2" desc="TOPICS API Bullet 2 of 3 that appear beneath the “Your interests as estimated by Chromium” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How we use this data:” is bold and serves as a label to help people skimming the page. * “estimate your interests”: Topics of interest include things like “Live comedy” and “Rock music”. Chromium estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”)."> <ph name="BEGIN_BOLD"><b></ph>How we use this data:<ph name="END_BOLD"></b></ph> Chromium can estimate your interests. Later, a site you visit can ask Chromium to see your interests in order to personalize the ads you see. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3" translateable="false" desc="Third bullet point of the first section in the collapsable section of the Privacy Sandbox Dialog."> - <ph name="BEGIN_BOLD"><b></ph>How you can manage your data:<ph name="END_BOLD"></b></ph> To protect your privacy, we auto-delete your interests that are older than 3 weeks. Interests can refresh. Or you can remove interests you don’t want Chromium to consider. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3" desc="TOPICS API Bullet 3 of 3 that appear beneath the “Your interests as estimated by Chromium” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How you can manage your data:” is bold and serves as a label to help people skimming the page. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “older than 3 weeks”: We’re trying to convey a rolling delete. Imagine a user opens a browser for the very first time. As the user browses, Chromium will estimate up to 5 topics of interest in the first week. In the second week, Chromium will estimate up to 5 additional topics of interest. The same for the third week, for a total of 15 potential interests. In week 4, Chromium will automatically delete the 5 interests from week 1 so that there aren’t ever more than 15 topics associated with a user at any given time. * “interests can refresh”: If a user loves horror films and reads about them for months on end, the interest “Horror movies” might get deleted and refreshed in the same week, so that “Horror movies” doesn’t ever disappear from the user’s list of interests. * “Or you can…”: A user might love horror movies but can’t stand the idea of seeing ads about horror movies (because even the visuals will ruin the surprise of opening night). In this case, the user can remove “Horror movies” from the list of interests Chromium will consider. This removal remains in place indefinitely. Note that the user might still see ads about Horror movies from different ad networks or by other means than Chromium’s “Browser-based ad personalization” setting."> + <ph name="BEGIN_BOLD"><b></ph>How you can manage your data:<ph name="END_BOLD"></b></ph> To protect your privacy, we auto-delete your interests that are older than 4 weeks. As you keep browsing, an interest might appear on the list again. Or you can remove interests you don’t want Chromium to consider. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1" translateable="false" desc="First bullet point of the second section in the collapsable section of the Privacy Sandbox Dialog."> - <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph>Your browsing history, a record of sites you’ve visited using Chromium on this device. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1" desc="FLEDGE APIBullet 1 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chromium’s top level. This content taken in isolation is somewhat misleading. With FLEDGE, a site can store information in Chromium about the user’s visit to their site. For example, the site might store “running_shoes_red_size_35” to indicate that the user showed interest in a particular shoe. We’re OK with the simplification in this bullet because 1) we explain it in the next bullet and 2) we want the user to understand that at the top level, both Topics & Fledge are based on the same thing and that is the user’s browsing history."> + <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph> Your browsing history, a record of sites you’ve visited using Chromium on this device. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2" translateable="false" desc="Second bullet point of the second section in the collapsable section of the Privacy Sandbox Dialog."> - <ph name="BEGIN_BOLD"><b></ph>How we use this data:<ph name="END_BOLD"></b></ph> Sites can store information with Chromium about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can see this interest and show you an ads for running shoes. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2" desc="FLEDGE API Bullet 2 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How we use this data:” is bold and serves as a label to help people skimming the page."> + <ph name="BEGIN_BOLD"><b></ph>How we use this data:<ph name="END_BOLD"></b></ph> Sites can store information with Chromium about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can show you an ad for running shoes based on your interests. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY" translateable="false" desc="Summary text in the bottom of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY" desc="A conclusion paragraph for the entire page. It sits beneath the “Try more transparent ads” subtitle but it’s no more associated with that topic than “Limit sharing between sites”. * “You can change your mind”: When writing a consent moment, we have a legal obligation to inform the user how they can “revoke their consent” or “opt out”. A friendlier way to say this is “change your mind”. * “in Chromium settings”: The URL is chrome://settings/privacySandbox. We don’t make it a live link because we need the users to stay in this moment until they make a choice. * “During the trials…”: The experiment happens in addition to today’s current system based on third-party cookies. In other words, even by accepting in this consent moment, the user’s core experience doesn’t change much. This is an experiment, and we need the user to understand as much."> You can change your mind at any time in Chromium settings. During trials, your interaction with sites may not be more private than it is without these new features. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1" translateable="false" desc="Description of the first section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1" desc="This string is a variant of “We’re exploring ways to restrict…” * “Chromium”: we need to establish the actor, and we haven’t yet in this notice version of the text. * “exploring” conveys that this is a work in progress. * “restrict” means to lessen. We don’t want to suggest that we’re “eliminating” cross-site tracking. * “cross-site tracking”: An example: a user visits site A and then site B. Based on how third-party cookies work today, when that user later visits site C, site C can be aware that the user visited sites A an B, and can even have some sense for what they did on those sites. * “stop ad spam and fraud”: This feature isn’t really related to restricting cross-site tracking but we combined these features in the same sentence / section for structural reasons."> Chromium is exploring ways to restrict cross-site tracking while enabling sites to stop ad spam and fraud. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_2" translateable="false" desc="Header of the second section in the body of the Privacy Sandbox Dialog."> - Try more transparent ads + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2" desc="This string is a variant of “During the experiment…” We drop “During the experiment…” because for this version of the text, we’re informing the user that we’ve turned experiments on. They’re still experiments, and the user can still leave them, but it’s the default behavior and so we don’t want to emphasize “during experiments” so much, because it’s more default for this user. A paragraph beneath the “Try more transparent ads” subtitle. * “estimate topics”: Topics of interest include things like “Live comedy” and “Rock music”. Chromium estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Instead of “estimate”, avoid words like “guess”, “establish”, “define”, etc. * “recent browsing history”: Later in the UI, we define this as “a record of sites you’ve visited using Chromium on this device.” By “recent”, we mean the last 3 weeks (also defined later in the UI). * “Then”, is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understand this is essentially a two-step process. They browse, and Chromium might estimate their interests as they do so. At a later point when they continue to visit a site, that’s when the estimated interests might come into play. * “without learning who you are”: With third-party cookies, and the excessive sharing that happens in today’s world, it’s often possible for a site to be able to identify you — if not by name, then at least to realize you’re the same user who visited the site X number of days ago. With these trials, this becomes much much harder to do, and so we’re reassuring the user as to the privacy-preserving features of the experiment. (But again, we can’t overpromise, because 3rd-party cookies are still active and so the user’s privacy isn’t materially better upon clicking yes today. We’re promising a better future and need the user’s help to get there.) * “sites you visit may use this info to show you relevant ads”: 1) Chromium hs estimated your interests. 2) You visit a new site. 3) That site calls the “Topics API” which returns up to 3 topics, for example, “Pop music”, “Rock music” and “Defense industry”. The site can use those 3 topics of interests as signals to help them target ads to the user. I say “signals” because the site may also be using other means to target ads."> + Chromium can estimate topics you may be interested in. Then, without learning who you are, sites you visit may use this info to show you relevant ads. Interests are based on your recent browsing history and you can see and manage them. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2" translateable="false" desc="Description of the second section in the body of the Privacy Sandbox Dialog."> - Chromium can estimate your topics of interest based on your recent browsing history. Then, without learning who you are, sites who are helping us test these features can use this info to show you relevant ads. - </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY" translateable="false" desc="Summary text in the bottom of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY" desc="This is a variant of “You can change your mind at…”. In this version that’s notice (not consent), we’re not asking the user to make a choice, and so we don’t remind the user they can “change their mind”. In this case, we’re informing the user of a change. They can get out of the change, by choosing the Settings button. * “in Chromium settings”: The URL is chrome://settings/privacySandbox. We don’t make it a live link because we need the users to stay in this moment until they make a choice. * “During the trials…”: The experiment happens in addition to today’s current system based on third-party cookies. In other words, even by accepting in this consent moment, the user’s core experience doesn’t change much. This is an experiment, and we need the user to understand as much."> You can learn more about these features in Chromium settings. During trials, your interaction with sites may not be more private than it is without these new features. </message> </messages>
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY.png.sha1 b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/chromium_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index f7e4235..704379ba 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -12604,44 +12604,46 @@ </if> <!-- Privacy Sandbox Dialog strings --> - <!-- TODO(crbug.com/1286276) These strings are not final yet and therefore marked as translateable="false" --> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_TITLE" translateable="false" desc="Title of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_TITLE" desc="CONTEXT: there are updates to the Chrome browser each month. Just after the user accepts the latest update, this message will appear. The user must make a choice, and this page can’t be dismissed until they do. The title of the page. * The title needs to be framed so that clicking the accept button makes sense * “Help us” is intended to convey a sense of collaboration. Privacy Sandbox is an ongoing multi-year effort. There are sites participating to help us and we also need users to agree to these trials so that we can measure the effectiveness of the features we're building. * “build” is intended to convey that this is a process. The user is agreeing to an effort rather than a stable set of features. Something like “make” doesn't have the same nuance. * “private web” is the promise of privacy sandbox."> Help us build a more private web </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_1" translateable="false" desc="Header of the first section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_1" desc="1 of 2 subtitles on the page. We want to write for users who skim the page. That means that the page title, the sub titles, and the button label all work well together as a mini story: 1) Help us build a more private web How? 2) Limit sharing between sites 3) Try more transparent ads 4) Yes, I’ll try it"> Limit sharing between sites </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_1" translateable="false" desc="Description of the first section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_1" desc="* “exploring” conveys that this is a work in progress. * “restrict” means to lessen. We don’t want to suggest that we’re “eliminating” cross-site tracking. * “cross-site tracking”: An example: a user visits site A and then site B. Based on how third-party cookies work today, when that user later visits site C, site C can be aware that the user visited sites A and B, and can even have some sense for what they did on those sites. * “stop ad spam and fraud”: This feature isn’t really related to restricting cross-site tracking but we combined these features in the same sentence / section for structural reasons."> We’re exploring ways to restrict cross-site tracking while enabling sites to stop ad spam and fraud. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_2" translateable="false" desc="Header of the second section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_2" desc="2 of 2 subtitles on the page. We want to write for users who skim the page. That means that the page title, the sub titles, and the button label all work well together as a mini story: 1) Help us build a more private web How? 2) Limit sharing between sites 3) Try more transparent ads 4) Yes, I’ll try it * “transparent ads”: We mean that with Privacy Sandbox, the user will be better able to understand why they’re seeing ads of a certain type. For example, if a user visits many sites about “cars”, Chrome might estimate that the user is interested in “cars”. Later, the user might visit a different site and see an ad about cars. With these new features, the user is able to see (and delete) specific interests, like “cars”, that Chrome has assigned them."> Try more transparent ads </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_LABEL" translateable="false" desc="Learn more label of the collapsable section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_LABEL" desc="* Learn more link ** Unfolds content within the page ** The text that appears describes 2 ways in which a site can target ads: the “Topics API” and the “FLEDGE API”. You can see what those are at www.privacysanbox.com or they’re described for the user’s benefit in other text. ** “Browser” is capitalized because “Browser-based ad personalization” is the name of our setting. “Ad personalization” would be an appropriate name as well, but we didn’t want the user to confuse this new setting with the Google Account level setting of that name (see https://adssettings.google.com/authenticated)."> Learn more about Browser-based ad personalization </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_HEADER" translateable="false" desc="Header of the second section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_HEADER" desc="FLEDGE API. A sub title that describes the second of 2 ways a site can get info from Chrome in order to target ads to the user."> Sites you visit that define your interests </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_3" translateable="false" desc="Third bullet point of the second section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_3" desc="FLEDGE API Bullet 3 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How you can manage your data:” is bold and serves as a label to help people skimming the page. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “older than 4 weeks”: We’re trying to convey a rolling delete. Imagine a user opens a browser for the very first time. As the user browses, sites can store info with Chrome for up to 4 weeks. So in week 1, the user visits site A. When week 5 starts, site A is removed from the list of sites. * “a site you visit…”: If a user visits site A every week for months on end, that site will remain on the user’s list of sites for months on end. * “Or you can…”: Say a user strongly dislikes www.siteB.com. But that user might visit siteB.com as part of their job, or just to see how bad it really is. The user can stop siteB from defining interests for them. This block lasts indefinitely."> <ph name="BEGIN_BOLD"><b></ph>How you can manage your data:<ph name="END_BOLD"></b></ph> To protect your privacy, we auto-delete sites from the list that are older than 4 weeks. A site you visit again might appear on the list again. Or you can remove a site If you don’t want that site to ever define interests for you. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_ACCEPT_BUTTON" translateable="false" desc="Label of the button that accepts the consent in the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_ACCEPT_BUTTON" desc="A button that allows the user to accept joining the Privacy Sandbox trials. If the user chooses “Yes, I’m in”: 1) this consent page disappears and the flow is complete 2) The Privacy Sandbox trials are turned on for this user. These features include everything described above. The page that hosts the settings will appear at chrome://settings/privacySandbox. Saying “Yes, I’m in” is like turning the toggle on. “No thanks” is like keeping the toggle off."> Yes, I’m in </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_DECLINE_BUTTON" translateable="false" desc="Label of the button that declines the consent in the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_DECLINE_BUTTON" desc="A button that allows the user to decline joining the Privacy Sandbox trials. If the user chooses “No thanks” this consent page disappears and the flow is complete."> No thanks </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_SUBTITLE" translateable="false" desc="Subtitle of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_SUBTITLE" desc="Context: regulations require that we get explicit consent from users in Europe. For the rest of the world, “notice” is sufficient, which means we’re informing the user of changes but that we don’t need their explicit permission (the change is that we’ve turned these trials on for them). That said, a user can still turn off the trials, which has the same effect as declining the consent moment. This string is a variant of “Chrome is exploring new features…” * “We’re”: “we” is intended to establish a sense of collaboration. Google needs users and sites to agree to the trials and help us test these new features. * “exploring” conveys that this is a work in progress. * “new features” include settings that the user can turn on/off and also backend features that change the way Chrome works for everyone * “allow sites to deliver”: Privacy Sandbox is proposed by Google as a collaborative effort with the browser industry. We’re building and testing functionality that will live in the Chrome browser. In order to land the full promise of Privacy Sandbox, websites & advertisers need to adopt the new APIs / functionality that we’re developing. So “allow sites…” makes it clear to the user that we’re building something for the ecosystem. Typically a Google product builds something for the user, and that’s true in this case, but it’s bigger than that. * “same browsing experience using less of your info”: Another definition of the promise of Privacy Sandbox. Third-party cookies are going away. In this new world, the user will have essentially the same browsing experience but it’s more private because it doesn’t expose so much of the user’s info."> We’re exploring new features that allow sites to deliver the same browsing experience using less of your info </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_1" translateable="false" desc="Header of the first section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_1" desc="1 of 2 subtitles on the page. We want to write for users who skim the page. That means that the page title, the sub titles, and the button label all work well together as a mini story: 1) Help us build a more private web How? 2) Limit sharing between sites 3) Try more transparent ads 4) Yes, I’ll try it"> Limit sharing between sites </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_ACKNOWLEDGE_BUTTON" translateable="false" desc="Label of the button that acknowledges the notice in the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_2" desc="2 of 2 subtitles on the page. We want to write for users who skim the page. That means that the page title, the sub titles, and the button label all work well together as a mini story: 1) Help us build a more private web How? 2) Limit sharing between sites 3) Try more transparent ads 4) Yes, I’ll try it * “transparent ads”: We mean that with Privacy Sandbox, the user will be better able to understand why they’re seeing ads of a certain type. For example, if a user visits many sites about “cars”, Chrome might estimate that the user is interested in “cars”. Later, the user might visit a different site and see an ad about cars. With these new features, the user is able to see (and delete) specific interests, like “cars”, that Chrome has assigned them."> + Try more transparent ads + </message> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_ACKNOWLEDGE_BUTTON" desc="The user can acknowledge the changes with “Got it”. This consent page disappears and the flow is complete."> Got it </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_OPEN_SETTINGS_BUTTON" translateable="false" desc="Label of the button that opens settings in the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_OPEN_SETTINGS_BUTTON" desc="The user can choose “Settings” to visit chrome://settings/privacySandbox. If they do, they’ll find the toggle on for Sandbox trials, which include everything they’ve read above. They can leave trials on or turn them off on this page. Choosing “Settings”, the user will navigate away from this page and won’t be able to return here."> Settings </message> </messages>
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_ACCEPT_BUTTON.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_ACCEPT_BUTTON.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_ACCEPT_BUTTON.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_1.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_1.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_1.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_1.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_1.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_1.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_2.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_2.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_HEADER_2.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_DECLINE_BUTTON.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_DECLINE_BUTTON.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_DECLINE_BUTTON.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_LABEL.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_LABEL.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_LABEL.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_3.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_3.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_3.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_HEADER.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_HEADER.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_HEADER.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_TITLE.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_TITLE.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_ACKNOWLEDGE_BUTTON.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_ACKNOWLEDGE_BUTTON.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_ACKNOWLEDGE_BUTTON.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_1.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_1.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_1.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_2.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_2.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_2.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_OPEN_SETTINGS_BUTTON.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_OPEN_SETTINGS_BUTTON.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_OPEN_SETTINGS_BUTTON.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_SUBTITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_SUBTITLE.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_SUBTITLE.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 0df4205..ca44b8f 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -1493,44 +1493,40 @@ </message> <!-- Privacy Sandbox Dialog strings --> - <!-- TODO(crbug.com/1286276) These strings are not final yet and therefore marked as translateable="false" --> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE" translateable="false" desc="Subtitle of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE" desc="A subtitle on the consent page. Consider this a tagline for the Privacy Sandbox project. * “exploring” conveys that this is a work in progress. * “new features” include settings that the user can turn on/off and also backend features that change the way Chrome works for everyone * “allow sites to deliver”: Privacy Sandbox is proposed by Google as a collaborative effort with the browser industry. We’re building and testing functionality that will live in the Chrome browser. In order to land the full promise of Privacy Sandbox, websites & advertisers need to adopt the new APIs / functionality that we’re developing. So “allow sites…” makes it clear to the user that we’re building something for the ecosystem. Typically a Google product builds something for the user, and that’s true in this case, but it’s bigger than that. * “same browsing experience using less of your info”: Another definition of the promise of Privacy Sandbox. Third-party cookies are going away. In this new world, the user will have essentially the same browsing experience but it’s more private because it doesn’t expose so much of the user’s info."> Chrome is exploring new features that allow sites to deliver the same browsing experience using less of your info </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2" translateable="false" desc="Description of the second section in the body of the Privacy Sandbox Dialog."> - During the experiment, Chrome will estimate topics you may be interested in, based on your recent browsing history. Then, without learning who you are, sites you visit may use this info to show you relevant ads. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2" desc="A paragraph beneath the “Try more transparent ads” subtitle. * “During the experiment”: The experiment happens in addition to today’s current system based on third-party cookies. In other words, even by accepting in this consent moment, the user’s core experience doesn’t change much. This is an experiment, and we need the user to understand as much. * “estimate topics”: Topics of interest include things like “Live comedy” and “Rock music”. Chrome estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”). * “recent browsing history”: Later in the UI, we define this as “a record of sites you’ve visited using Chrome on this device.” By “recent”, we mean the last 3 weeks (also defined later in the UI). * “Then”, is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understand this is essentially a two-step process. They browse, and Chrome might estimate their interests as they do so. At a later point when they continue to visit a site, that’s when the estimated interests might come into play. * “without learning who you are”: With third-party cookies, and the excessive sharing that happens in today’s world, it’s often possible for a site to be able to identify you — if not by name, then at least to realize you’re the same user who visited the site X number of days ago. With these trials, this becomes much much harder to do, and so we’re reassuring the user as to the privacy-preserving features of the experiment. (But again, we can’t overpromise, because 3rd-party cookies are still active and so the user’s privacy isn’t materially better upon clicking yes today. We’re promising a better future and need the user’s help to get there.) * “sites you visit may use this info to show you relevant ads”: 1) Chrome hs estimated your interests. 2) You visit a new site. 3) That site calls the “Topics API” which returns up to 3 topics, for example, “Pop music”, “Rock music” and “Defense industry”. The site can use those 3 topics of interests as signals to help them target ads to the user. I say “signals” because the site may also be using other means to target ads."> + During the experiment, Chrome will estimate topics you may be interested in. Then, without learning who you are, sites you visit may use this info to show you relevant ads. Interests are based on your recent browsing history and you can see and manage them. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER" translateable="false" desc="Header of the first section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER" desc="TOPICS API A sub title that describes the first of 2 ways a site can get info from Chrome in order to target ads to the user. Topics of interest include things like “Live comedy” and “Rock music”. Chrome estimates these interests based on the sites users visit. * “Your”: we need to convey a sense of ownership, even if the user didn’t explicitly choose the interests we’re talking about. Without the “your”, it could sound like Chrome is simply building a generic library of interests. * “estimated”: It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”). * “by Chrome”: This is new behavior for a browser (Chrome) to take an active role in processing user data for the purposes of showing ads. It’s important to convey “chrome”, the actor in this case."> Your interests as estimated by Chrome </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1" translateable="false" desc="First bullet point of the first section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1" desc="TOPICS API Bullet 1 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chrome’s top level. The Topics API estimates topics of interest based on sites in the user’s browsing history that are participating in the trials."> <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph> Your browsing history, a record of sites you’ve visited using Chrome on this device. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2" translateable="false" desc="Second bullet point of the first section in the collapsable section of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2" desc="TOPICS API Bullet 2 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How we use this data:” is bold and serves as a label to help people skimming the page. * “estimate your interests”: Topics of interest include things like “Live comedy” and “Rock music”. Chrome estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”)."> <ph name="BEGIN_BOLD"><b></ph>How we use this data:<ph name="END_BOLD"></b></ph> Chrome can estimate your interests. Later, a site you visit can ask Chrome to see your interests in order to personalize the ads you see. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3" translateable="false" desc="Third bullet point of the first section in the collapsable section of the Privacy Sandbox Dialog."> - <ph name="BEGIN_BOLD"><b></ph>How you can manage your data:<ph name="END_BOLD"></b></ph> To protect your privacy, we auto-delete your interests that are older than 3 weeks. Interests can refresh. Or you can remove interests you don’t want Chrome to consider. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3" desc="TOPICS API Bullet 3 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How you can manage your data:” is bold and serves as a label to help people skimming the page. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “older than 3 weeks”: We’re trying to convey a rolling delete. Imagine a user opens a browser for the very first time. As the user browses, Chrome will estimate up to 5 topics of interest in the first week. In the second week, Chrome will estimate up to 5 additional topics of interest. The same for the third week, for a total of 15 potential interests. In week 4, Chrome will automatically delete the 5 interests from week 1 so that there aren’t ever more than 15 topics associated with a user at any given time. * “interests can refresh”: If a user loves horror films and reads about them for months on end, the interest “Horror movies” might get deleted and refreshed in the same week, so that “Horror movies” doesn’t ever disappear from the user’s list of interests. * “Or you can…”: A user might love horror movies but can’t stand the idea of seeing ads about horror movies (because even the visuals will ruin the surprise of opening night). In this case, the user can remove “Horror movies” from the list of interests Chrome will consider. This removal remains in place indefinitely. Note that the user might still see ads about Horror movies from different ad networks or by other means than Chrome’s “Browser-based ad personalization” setting."> + <ph name="BEGIN_BOLD"><b></ph>How you can manage your data:<ph name="END_BOLD"></b></ph> To protect your privacy, we auto-delete your interests that are older than 4 weeks. As you keep browsing, an interest might appear on the list again. Or you can remove interests you don’t want Chrome to consider. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1" translateable="false" desc="First bullet point of the second section in the collapsable section of the Privacy Sandbox Dialog."> - <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph>Your browsing history, a record of sites you’ve visited using Chrome on this device. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1" desc="FLEDGE APIBullet 1 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chrome’s top level. This content taken in isolation is somewhat misleading. With FLEDGE, a site can store information in Chrome about the user’s visit to their site. For example, the site might store “running_shoes_red_size_35” to indicate that the user showed interest in a particular shoe. We’re OK with the simplification in this bullet because 1) we explain it in the next bullet and 2) we want the user to understand that at the top level, both Topics & Fledge are based on the same thing and that is the user’s browsing history."> + <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph> Your browsing history, a record of sites you’ve visited using Chrome on this device. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2" translateable="false" desc="Second bullet point of the second section in the collapsable section of the Privacy Sandbox Dialog."> - <ph name="BEGIN_BOLD"><b></ph>How we use this data:<ph name="END_BOLD"></b></ph> Sites can store information with Chrome about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can see this interest and show you an ads for running shoes. + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2" desc="FLEDGE API Bullet 2 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How we use this data:” is bold and serves as a label to help people skimming the page."> + <ph name="BEGIN_BOLD"><b></ph>How we use this data:<ph name="END_BOLD"></b></ph> Sites can store information with Chrome about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can show you an ad for running shoes based on your interests. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY" translateable="false" desc="Summary text in the bottom of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY" desc="A conclusion paragraph for the entire page. It sits beneath the “Try more transparent ads” subtitle but it’s no more associated with that topic than “Limit sharing between sites”. * “You can change your mind”: When writing a consent moment, we have a legal obligation to inform the user how they can “revoke their consent” or “opt out”. A friendlier way to say this is “change your mind”. * “in Chrome settings”: The URL is chrome://settings/privacySandbox. We don’t make it a live link because we need the users to stay in this moment until they make a choice. * “During the trials…”: The experiment happens in addition to today’s current system based on third-party cookies. In other words, even by accepting in this consent moment, the user’s core experience doesn’t change much. This is an experiment, and we need the user to understand as much."> You can change your mind at any time in Chrome settings. During trials, your interaction with sites may not be more private than it is without these new features. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1" translateable="false" desc="Description of the first section in the body of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1" desc="This string is a variant of “We’re exploring ways to restrict…” * “Chrome”: we need to establish the actor, and we haven’t yet in this notice version of the text. * “exploring” conveys that this is a work in progress. * “restrict” means to lessen. We don’t want to suggest that we’re “eliminating” cross-site tracking. * “cross-site tracking”: An example: a user visits site A and then site B. Based on how third-party cookies work today, when that user later visits site C, site C can be aware that the user visited sites A an B, and can even have some sense for what they did on those sites. * “stop ad spam and fraud”: This feature isn’t really related to restricting cross-site tracking but we combined these features in the same sentence / section for structural reasons."> Chrome is exploring ways to restrict cross-site tracking while enabling sites to stop ad spam and fraud. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_HEADER_2" translateable="false" desc="Header of the second section in the body of the Privacy Sandbox Dialog."> - Try more transparent ads + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2" desc="This string is a variant of “During the experiment…” We drop “During the experiment…” because for this version of the text, we’re informing the user that we’ve turned experiments on. They’re still experiments, and the user can still leave them, but it’s the default behavior and so we don’t want to emphasize “during experiments” so much, because it’s more default for this user. A paragraph beneath the “Try more transparent ads” subtitle. * “estimate topics”: Topics of interest include things like “Live comedy” and “Rock music”. Chrome estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Instead of “estimate”, avoid words like “guess”, “establish”, “define”, etc. * “recent browsing history”: Later in the UI, we define this as “a record of sites you’ve visited using Chrome on this device.” By “recent”, we mean the last 3 weeks (also defined later in the UI). * “Then”, is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understand this is essentially a two-step process. They browse, and Chrome might estimate their interests as they do so. At a later point when they continue to visit a site, that’s when the estimated interests might come into play. * “without learning who you are”: With third-party cookies, and the excessive sharing that happens in today’s world, it’s often possible for a site to be able to identify you — if not by name, then at least to realize you’re the same user who visited the site X number of days ago. With these trials, this becomes much much harder to do, and so we’re reassuring the user as to the privacy-preserving features of the experiment. (But again, we can’t overpromise, because 3rd-party cookies are still active and so the user’s privacy isn’t materially better upon clicking yes today. We’re promising a better future and need the user’s help to get there.) * “sites you visit may use this info to show you relevant ads”: 1) Chrome hs estimated your interests. 2) You visit a new site. 3) That site calls the “Topics API” which returns up to 3 topics, for example, “Pop music”, “Rock music” and “Defense industry”. The site can use those 3 topics of interests as signals to help them target ads to the user. I say “signals” because the site may also be using other means to target ads."> + Chrome can estimate topics you may be interested in. Then, without learning who you are, sites you visit may use this info to show you relevant ads. Interests are based on your recent browsing history and you can see and manage them. </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2" translateable="false" desc="Description of the second section in the body of the Privacy Sandbox Dialog."> - Chrome can estimate your topics of interest based on your recent browsing history. Then, without learning who you are, sites who are helping us test these features can use this info to show you relevant ads. - </message> - <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY" translateable="false" desc="Summary text in the bottom of the Privacy Sandbox Dialog."> + <message name="IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY" desc="This is a variant of “You can change your mind at…”. In this version that’s notice (not consent), we’re not asking the user to make a choice, and so we don’t remind the user they can “change their mind”. In this case, we’re informing the user of a change. They can get out of the change, by choosing the Settings button. * “in Chrome settings”: The URL is chrome://settings/privacySandbox. We don’t make it a live link because we need the users to stay in this moment until they make a choice. * “During the trials…”: The experiment happens in addition to today’s current system based on third-party cookies. In other words, even by accepting in this consent moment, the user’s core experience doesn’t change much. This is an experiment, and we need the user to understand as much."> You can learn more about these features in Chrome settings. During trials, your interaction with sites may not be more private than it is without these new features. </message> </messages>
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BODY_DESCRIPTION_2.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_BOTTOM_SUMMARY.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_1.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_2.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_BULLET_POINT_3.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_1_HEADER.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_1.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2.png.sha1 new file mode 100644 index 0000000..0a3d9ac --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_LEARN_MORE_SECTION_2_BULLET_POINT_2.png.sha1
@@ -0,0 +1 @@ +1ffcab13236568e1187cb514b8cb3755cf16bc4c \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE.png.sha1 new file mode 100644 index 0000000..28adee93 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_CONSENT_SUBTITLE.png.sha1
@@ -0,0 +1 @@ +d1862062fb7efbe7d9a2eaafb585ba0c5fbf3c42 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_1.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BODY_DESCRIPTION_2.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY.png.sha1 b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY.png.sha1 new file mode 100644 index 0000000..39673838 --- /dev/null +++ b/chrome/app/google_chrome_strings_grd/IDS_PRIVACY_SANDBOX_DIALOG_NOTICE_BOTTOM_SUMMARY.png.sha1
@@ -0,0 +1 @@ +ab18754f4a13ac43c2518e251d3c1ad7a80515f9 \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 9ed013d..427e7538 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2494,6 +2494,20 @@ std::size( kPasswordChangeVariationWithForcedDialogAfterEverySuccessfulSubmission), nullptr}}; + +// The variations of --touch-to-fill-password-submission. +const FeatureEntry::FeatureParam + kTouchToFillPasswordSubmissionWithConservativeHeuristics[] = { + {password_manager::features:: + kTouchToFillPasswordSubmissionWithConservativeHeuristics, + "true"}}; + +const FeatureEntry::FeatureVariation + kTouchToFillPasswordSubmissionVariations[] = { + {"Use conservative heuristics", + kTouchToFillPasswordSubmissionWithConservativeHeuristics, + std::size(kTouchToFillPasswordSubmissionWithConservativeHeuristics), + nullptr}}; #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_ANDROID) @@ -2616,9 +2630,6 @@ std::size(kPlatformProvidedTrustTokenIssuance), nullptr}}; #if BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) -constexpr char kAmbientModeAnimationInternalName[] = "ambient-mode-animation"; -#endif // BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) constexpr char kPersonalizationHubInternalName[] = "personalization-hub"; constexpr char kWallpaperFullScreenPreviewInternalName[] = "wallpaper-fullscreen-preview"; @@ -7656,9 +7667,10 @@ {"touch-to-fill-password-submission", flag_descriptions::kTouchToFillPasswordSubmissionName, flag_descriptions::kTouchToFillPasswordSubmissionDescription, kOsAndroid, - FEATURE_VALUE_TYPE( - password_manager::features::kTouchToFillPasswordSubmission)}, - + FEATURE_WITH_PARAMS_VALUE_TYPE( + password_manager::features::kTouchToFillPasswordSubmission, + kTouchToFillPasswordSubmissionVariations, + "TouchToFillPasswordSubmission")}, #endif #if BUILDFLAG(IS_CHROMEOS_ASH) @@ -8174,15 +8186,6 @@ FEATURE_VALUE_TYPE( autofill::features::kAutofillEnableUpdateVirtualCardEnrollment)}, -#if BUILDFLAG(IS_CHROMEOS_ASH) -#if BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) - {kAmbientModeAnimationInternalName, - flag_descriptions::kAmbientModeAnimationName, - flag_descriptions::kAmbientModeAnimationDescription, kOsCrOS, - FEATURE_VALUE_TYPE(ash::features::kAmbientModeAnimationFeature)}, -#endif // BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - #if BUILDFLAG(IS_CHROMEOS_LACROS) // TODO(b/180051795): Remove kOsLinux when lacros-chrome switches to // kOsCrOS. @@ -8500,13 +8503,7 @@ } // Features that are only available for Unknown/Canary/Dev channels. - bool is_ambient_mode_animation_feature = false; -#if BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) - is_ambient_mode_animation_feature = - !strcmp(kAmbientModeAnimationInternalName, entry.internal_name); -#endif // BUILDFLAG(HAS_ASH_AMBIENT_ANIMATION_RESOURCES) - if ((!strcmp(kPersonalizationHubInternalName, entry.internal_name) || - is_ambient_mode_animation_feature) && + if (!strcmp(kPersonalizationHubInternalName, entry.internal_name) && channel != version_info::Channel::DEV && channel != version_info::Channel::CANARY && channel != version_info::Channel::UNKNOWN) {
diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm index 88fdabb..d42a2dbf 100644 --- a/chrome/browser/app_controller_mac_browsertest.mm +++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -17,6 +17,7 @@ #include "base/command_line.h" #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" +#include "base/path_service.h" #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/strings/sys_string_conversions.h" @@ -56,6 +57,7 @@ #include "chrome/browser/ui/webui/welcome/helpers.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_features.h" +#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -69,11 +71,13 @@ #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" +#include "content/public/test/prerender_test_util.h" #include "content/public/test/test_navigation_observer.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/extension_dialog_auto_confirm.h" #include "extensions/common/extension.h" #include "extensions/test/extension_test_message_listener.h" +#include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "third_party/blink/public/common/features.h" #import "ui/events/test/cocoa_test_event_utils.h" @@ -1207,4 +1211,61 @@ EXPECT_EQ(g_handoff_url, test_url2); } +class AppControllerHandoffPrerenderBrowserTest + : public AppControllerHandoffBrowserTest { + public: + void SetUpOnMainThread() override { + prerender_helper_.SetUp(embedded_test_server()); + host_resolver()->AddRule("*", "127.0.0.1"); + embedded_test_server()->ServeFilesFromDirectory( + base::PathService::CheckedGet(chrome::DIR_TEST_DATA)); + ASSERT_TRUE(embedded_test_server()->Start()); + } + + content::WebContents* GetActiveWebContents() { + return browser()->tab_strip_model()->GetActiveWebContents(); + } + + content::test::PrerenderTestHelper& prerender_helper() { + return prerender_helper_; + } + + protected: + AppControllerHandoffPrerenderBrowserTest() + : prerender_helper_(base::BindRepeating( + &AppControllerHandoffPrerenderBrowserTest::GetActiveWebContents, + // Unretained is safe here, as this class owns PrerenderTestHelper + // object, which holds the callback being constructed here, so the + // callback will be destructed before this class. + base::Unretained(this))) {} + + private: + content::test::PrerenderTestHelper prerender_helper_; +}; + +// Tests that as a user switches from main page to prerendered page, the correct +// URL is being passed to the Handoff. +IN_PROC_BROWSER_TEST_F(AppControllerHandoffPrerenderBrowserTest, + TestHandoffURLs) { + // Navigate to an initial page. + GURL url = embedded_test_server()->GetURL("/empty.html"); + ASSERT_TRUE(content::NavigateToURL(GetActiveWebContents(), url)); + + // Start a prerender. + GURL prerender_url = embedded_test_server()->GetURL("/simple.html"); + prerender_helper().AddPrerender(prerender_url); + EXPECT_EQ(g_handoff_url, url); + + // Activate. + content::TestActivationManager navigation_manager(GetActiveWebContents(), + prerender_url); + ASSERT_TRUE( + content::ExecJs(GetActiveWebContents()->GetMainFrame(), + content::JsReplace("location = $1", prerender_url))); + navigation_manager.WaitForNavigationFinished(); + EXPECT_TRUE(navigation_manager.was_activated()); + EXPECT_TRUE(navigation_manager.was_successful()); + EXPECT_EQ(g_handoff_url, prerender_url); +} + } // namespace
diff --git a/chrome/browser/ash/crosapi/environment_provider.cc b/chrome/browser/ash/crosapi/environment_provider.cc index 6511d82..ae20f105 100644 --- a/chrome/browser/ash/crosapi/environment_provider.cc +++ b/chrome/browser/ash/crosapi/environment_provider.cc
@@ -125,6 +125,10 @@ default_paths->removable_media = chromeos::CrosDisksClient::GetRemovableDiskMountPoint(); + // Ash expects to find shared files in the share cache. + default_paths->share_cache = + file_manager::util::GetShareCacheFilePath(profile); + return default_paths; }
diff --git a/chrome/browser/ash/login/session/user_session_manager.cc b/chrome/browser/ash/login/session/user_session_manager.cc index 5fe2828..7dfc4f0 100644 --- a/chrome/browser/ash/login/session/user_session_manager.cc +++ b/chrome/browser/ash/login/session/user_session_manager.cc
@@ -806,8 +806,7 @@ chrome_client_secret_ = chrome_client_secret; } -void UserSessionManager::DoBrowserLaunch(Profile* profile, - LoginDisplayHost* login_host) { +void UserSessionManager::DoBrowserLaunch(Profile* profile) { auto* session_manager = session_manager::SessionManager::Get(); const auto current_session_state = session_manager->session_state(); // LOGGED_IN_NOT_ACTIVE should only be set from OOBE, LOGIN_PRIMARY, or @@ -820,7 +819,7 @@ } ui_shown_time_ = base::Time::Now(); - DoBrowserLaunchInternal(profile, login_host, false /* locale_pref_checked */); + DoBrowserLaunchInternal(profile, /*locale_pref_checked=*/false); } bool UserSessionManager::RespectLocalePreference( @@ -1823,7 +1822,7 @@ } } - DoBrowserLaunch(profile, LoginDisplayHost::default_host()); + DoBrowserLaunch(profile); return true; } @@ -2167,7 +2166,6 @@ } void UserSessionManager::DoBrowserLaunchInternal(Profile* profile, - LoginDisplayHost* login_host, bool locale_pref_checked) { if (browser_shutdown::IsTryingToQuit() || chrome::IsAttemptingShutdown()) return; @@ -2176,7 +2174,7 @@ RespectLocalePreferenceWrapper( profile, base::BindRepeating( &UserSessionManager::DoBrowserLaunchInternal, AsWeakPtr(), - profile, login_host, true /* locale_pref_checked */)); + profile, /*locale_pref_checked=*/true)); return; } @@ -2197,9 +2195,9 @@ return; } - if (login_host) { - login_host->SetStatusAreaVisible(true); - login_host->BeforeSessionStart(); + if (LoginDisplayHost::default_host()) { + LoginDisplayHost::default_host()->SetStatusAreaVisible(true); + LoginDisplayHost::default_host()->BeforeSessionStart(); } BootTimesRecorder::Get()->AddLoginTimeMarker("BrowserLaunched", false); @@ -2253,8 +2251,9 @@ // Mark login host for deletion after browser starts. This // guarantees that the message loop will be referenced by the // browser before it is dereferenced by the login host. - if (login_host) { - login_host->Finalize(std::move(login_host_finalized_callback)); + if (LoginDisplayHost::default_host()) { + LoginDisplayHost::default_host()->Finalize( + std::move(login_host_finalized_callback)); } else { std::move(login_host_finalized_callback).Run(); }
diff --git a/chrome/browser/ash/login/session/user_session_manager.h b/chrome/browser/ash/login/session/user_session_manager.h index f1023b1c..8e79bfe 100644 --- a/chrome/browser/ash/login/session/user_session_manager.h +++ b/chrome/browser/ash/login/session/user_session_manager.h
@@ -61,7 +61,6 @@ namespace ash { class AuthStatusConsumer; -class LoginDisplayHost; class OnboardingUserActivityCounter; class StubAuthenticatorBuilder; class TokenHandleFetcher; @@ -251,7 +250,7 @@ // Thin wrapper around StartupBrowserCreator::LaunchBrowser(). Meant to be // used in a Task posted to the UI thread. Once the browser is launched the // login host is deleted. - void DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host); + void DoBrowserLaunch(Profile* profile); // Changes browser locale (selects best suitable locale from different // user settings). Returns true if callback will be called. @@ -504,9 +503,7 @@ // `locale_pref_checked` set to false which will result in postponing browser // launch till user locale is applied if needed. After locale check has // completed this method is called with `locale_pref_checked` set to true. - void DoBrowserLaunchInternal(Profile* profile, - LoginDisplayHost* login_host, - bool locale_pref_checked); + void DoBrowserLaunchInternal(Profile* profile, bool locale_pref_checked); static void RunCallbackOnLocaleLoaded( base::OnceClosure callback,
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index 47eac05..a12340a4 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -1807,8 +1807,7 @@ content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&UserSessionManager::DoBrowserLaunch, UserSessionManager::GetInstance()->AsWeakPtr(), - ProfileManager::GetActiveUserProfile(), - GetLoginDisplayHost())); + ProfileManager::GetActiveUserProfile())); } void WizardController::OnDeviceDisabledChecked(bool device_disabled) {
diff --git a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc index 97d8566..e8b94179 100644 --- a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_browsertest.cc
@@ -222,6 +222,29 @@ run_loop.Run(); } + // Checks that there is an expected number of blocked/not blocked and + // warned/not warned data points. Number of not blocked and not warned data + // points is the difference between |total_count| and |blocked_count| and + // |warned_count| respectfully. + void VerifyHistogramCounts(int blocked_count, + int warned_count, + int total_count, + std::string blocked_suffix, + std::string warned_suffix) { + ASSERT_GE(total_count, warned_count + blocked_count); + ASSERT_GE(blocked_count, 0); + ASSERT_GE(warned_count, 0); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + blocked_suffix, true, blocked_count); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + blocked_suffix, false, + total_count - blocked_count); + histogram_tester_.ExpectBucketCount(GetDlpHistogramPrefix() + warned_suffix, + true, warned_count); + histogram_tester_.ExpectBucketCount(GetDlpHistogramPrefix() + warned_suffix, + false, total_count - warned_count); + } + protected: std::unique_ptr<DlpContentManagerTestHelper> helper_; base::HistogramTester histogram_tester_; @@ -838,7 +861,7 @@ } IN_PROC_BROWSER_TEST_F(DlpContentManagerAshBrowserTest, - ScreenShareDisabledNotification) { + ScreenShareDisabledOrWarned) { SetupReporting(); NotificationDisplayServiceTester display_service_tester(browser()->profile()); DlpContentManagerAsh* manager = @@ -855,8 +878,10 @@ base::DoNothing()); EXPECT_FALSE(display_service_tester.GetNotification( kScreenShareBlockedNotificationId)); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kScreenShareBlockedUMA, false, 1); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/0, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); helper_->ChangeConfidentiality(web_contents, kScreenShareRestricted); @@ -866,8 +891,24 @@ DlpRulesManager::Level::kBlock, 1u); EXPECT_TRUE(display_service_tester.GetNotification( kScreenShareBlockedNotificationId)); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kScreenShareBlockedUMA, true, 1); + VerifyHistogramCounts(/*blocked_count=*/1, /*warned_count=*/0, + /*total_count=*/2, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); + + helper_->ChangeConfidentiality(web_contents, kScreenShareWarned); + + manager->CheckScreenShareRestriction(media_id, u"example.com", + base::DoNothing()); + EXPECT_EQ(events_.size(), 2u); + EXPECT_THAT(events_[1], + IsDlpPolicyEvent(CreateDlpPolicyEvent( + kSrcPattern, DlpRulesManager::Restriction::kScreenShare, + DlpRulesManager::Level::kWarn))); + VerifyHistogramCounts(/*blocked_count=*/1, /*warned_count=*/1, + /*total_count=*/3, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); helper_->ChangeConfidentiality(web_contents, kEmptyRestrictionSet); } @@ -1034,11 +1075,18 @@ manager->OnScreenShareStarted(kLabel, {media_id}, kApplicationTitle, stop_cb.Get(), state_change_cb.Get(), /*source_callback=*/base::DoNothing()); + // Nothing is emitted yet since there's "no change" in the restrictions - + // normally there would be a metric logged in CheckScreenShareRestricted() + // that's not called in this test. helper_->ChangeConfidentiality(web_contents, kScreenShareWarned); EXPECT_EQ(helper_->ActiveWarningDialogsCount(), 1); CheckEvents(DlpRulesManager::Restriction::kScreenShare, DlpRulesManager::Level::kWarn, 1u); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/1, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); // Hit Enter to "Share anyway". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( @@ -1049,14 +1097,28 @@ EXPECT_THAT(events_[1], IsDlpPolicyEvent(CreateDlpPolicyWarningProceededEvent( kSrcPattern, DlpRulesManager::Restriction::kScreenShare))); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, false, 0); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, true, 1); EXPECT_TRUE(helper_->HasContentCachedForRestriction( web_contents, DlpRulesManager::Restriction::kScreenShare)); // The contents should already be cached as allowed by the user, so this - // should not trigger a new warning. + // should not trigger a new warning. We have to switch the level in order to + // trigger a proper check of restrictions, otherwise it would be skipped + // altogether. + helper_->ChangeConfidentiality(web_contents, kEmptyRestrictionSet); helper_->ChangeConfidentiality(web_contents, kScreenShareWarned); EXPECT_EQ(helper_->ActiveWarningDialogsCount(), 0); EXPECT_EQ(events_.size(), 2u); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/2, + /*total_count=*/3, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnSilentProceededUMA, true, + 1); } IN_PROC_BROWSER_TEST_F(DlpContentManagerAshBrowserTest, @@ -1091,11 +1153,18 @@ manager->OnScreenShareStarted(kLabel, {media_id}, kApplicationTitle, stop_cb.Get(), state_change_cb.Get(), /*source_callback=*/base::DoNothing()); + // Nothing is emitted yet since there's "no change" in the restrictions - + // normally there would be a metric logged in CheckScreenShareRestricted() + // that's not called in this test. helper_->ChangeConfidentiality(web_contents, kScreenShareWarned); EXPECT_EQ(helper_->ActiveWarningDialogsCount(), 1); CheckEvents(DlpRulesManager::Restriction::kScreenShare, DlpRulesManager::Level::kWarn, 1u); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/1, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); // Hit Esc to "Cancel". ASSERT_TRUE(ui_test_utils::SendKeyPressSync( @@ -1103,12 +1172,20 @@ /*shift=*/false, /*alt=*/false, /*command=*/false)); EXPECT_EQ(helper_->ActiveWarningDialogsCount(), 0); EXPECT_FALSE(helper_->HasAnyContentCached()); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, false, 1); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, true, 0); // The screen share should be stopped so would not be checked again, and this // should not trigger a new warning. helper_->ChangeConfidentiality(web_contents, kScreenShareWarned); EXPECT_EQ(helper_->ActiveWarningDialogsCount(), 0); CheckEvents(DlpRulesManager::Restriction::kScreenShare, DlpRulesManager::Level::kWarn, 1u); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/1, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); } IN_PROC_BROWSER_TEST_F(DlpContentManagerAshBrowserTest, @@ -1260,10 +1337,10 @@ DlpRulesManager::Level::kBlock, 1u); EXPECT_TRUE(display_service_tester.GetNotification( kScreenShareBlockedNotificationId)); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kScreenShareBlockedUMA, true, 1); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kScreenShareBlockedUMA, false, 0); + VerifyHistogramCounts(/*blocked_count=*/1, /*warned_count=*/0, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); } IN_PROC_BROWSER_TEST_F(DlpContentManagerAshScreenShareBrowserTest, @@ -1293,6 +1370,14 @@ kScreenShareBlockedNotificationId)); EXPECT_TRUE(helper_->HasContentCachedForRestriction( web_contents, DlpRulesManager::Restriction::kScreenShare)); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/2, + /*total_count=*/2, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, true, 1); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, false, 0); helper_->ResetWarnNotifierForTesting(); } @@ -1318,6 +1403,14 @@ EXPECT_FALSE(display_service_tester.GetNotification( kScreenShareBlockedNotificationId)); EXPECT_FALSE(helper_->HasAnyContentCached()); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/1, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, true, 0); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kScreenShareWarnProceededUMA, false, 1); helper_->ResetWarnNotifierForTesting(); } @@ -1339,10 +1432,10 @@ DlpRulesManager::Level::kReport, 1u); EXPECT_FALSE(display_service_tester.GetNotification( kScreenShareBlockedNotificationId)); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kScreenShareBlockedUMA, true, 0); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kScreenShareBlockedUMA, false, 1); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/0, + /*total_count=*/2, + /*blocked_suffix=*/dlp::kScreenShareBlockedUMA, + /*warned_suffix=*/dlp::kScreenShareWarnedUMA); // Open new tab and navigate to a url. // Then move back to the screen-shared tab.
diff --git a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_unittest.cc b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_unittest.cc index bf82b9d8..92a933f 100644 --- a/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_unittest.cc +++ b/chrome/browser/ash/policy/dlp/dlp_content_manager_ash_unittest.cc
@@ -494,6 +494,26 @@ EXPECT_EQ(is_action_allowed_.value(), expected); } + // Checks that there is an expected number of blocked/not blocked and + // warned/not warned data points. Number of not blocked and not warned data + // points is the difference between |total_count| and |blocked_count| and + // |warned_count| respectfully. + void VerifyHistogramCounts(int blocked_count, + int warned_count, + int total_count, + std::string blocked_suffix, + std::string warned_suffix) { + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + blocked_suffix, true, blocked_count); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + blocked_suffix, false, + total_count - blocked_count); + histogram_tester_.ExpectBucketCount(GetDlpHistogramPrefix() + warned_suffix, + true, warned_count); + histogram_tester_.ExpectBucketCount(GetDlpHistogramPrefix() + warned_suffix, + false, total_count - warned_count); + } + absl::optional<bool> is_action_allowed_; }; @@ -514,10 +534,10 @@ web_contents.get(), base::BindOnce(on_dlp_restriction_checked_callback, &is_action_allowed_)); VerifyAndResetActionAllowed(true /*expected*/); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kPrintingBlockedUMA, true, 0); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kPrintingBlockedUMA, false, 1); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/0, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); // Block restriction is enforced for web_contents: block. helper_.ChangeConfidentiality(web_contents.get(), kPrintingRestricted); @@ -527,10 +547,10 @@ web_contents.get(), base::BindOnce(on_dlp_restriction_checked_callback, &is_action_allowed_)); VerifyAndResetActionAllowed(false /*expected*/); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kPrintingBlockedUMA, true, 1); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kPrintingBlockedUMA, false, 1); + VerifyHistogramCounts(/*blocked_count=*/1, /*warned_count=*/0, + /*total_count=*/2, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); EXPECT_EQ(events_.size(), 1u); EXPECT_THAT(events_[0], @@ -546,13 +566,13 @@ web_contents.get(), base::BindOnce(on_dlp_restriction_checked_callback, &is_action_allowed_)); VerifyAndResetActionAllowed(true /*expected*/); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kPrintingBlockedUMA, true, 1); - histogram_tester_.ExpectBucketCount( - GetDlpHistogramPrefix() + dlp::kPrintingBlockedUMA, false, 2); + VerifyHistogramCounts(/*blocked_count=*/1, /*warned_count=*/0, + /*total_count=*/3, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); } -TEST_F(DlpContentManagerAshCheckRestrictionTest, PrintingWarnedContinued) { +TEST_F(DlpContentManagerAshCheckRestrictionTest, PrintingWarnedProceeded) { // Set the notifier to "Proceed" on the warning. MockDlpWarnNotifier* mock_dlp_warn_notifier = CreateAndSetDlpWarnNotifier(true /*should_proceed*/); @@ -576,6 +596,10 @@ VerifyAndResetActionAllowed(true /*expected*/); EXPECT_FALSE(helper_.HasAnyContentCached()); EXPECT_TRUE(events_.empty()); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/0, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); // Warn restriction is enforced: allow and remember that the user proceeded. helper_.ChangeConfidentiality(web_contents.get(), kPrintingWarned); @@ -595,6 +619,12 @@ EXPECT_THAT(events_[1], IsDlpPolicyEvent(CreateDlpPolicyWarningProceededEvent( kSrcPattern, DlpRulesManager::Restriction::kPrinting))); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/1, + /*total_count=*/2, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kPrintingWarnProceededUMA, true, 1); // Check again: allow based on cached user's response - no dialog is shown. GetManager()->CheckPrintingRestriction( @@ -607,6 +637,14 @@ EXPECT_THAT(events_[2], IsDlpPolicyEvent(CreateDlpPolicyWarningProceededEvent( kSrcPattern, DlpRulesManager::Restriction::kPrinting))); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/2, + /*total_count=*/3, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kPrintingWarnProceededUMA, true, 1); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kPrintingWarnSilentProceededUMA, true, 1); // Web contents are destroyed: allow, no dialog is shown. helper_.DestroyWebContents(web_contents.get()); @@ -617,6 +655,10 @@ base::BindOnce(on_dlp_restriction_checked_callback, &is_action_allowed_)); VerifyAndResetActionAllowed(true /*expected*/); EXPECT_EQ(events_.size(), 3u); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/2, + /*total_count=*/4, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); } TEST_F(DlpContentManagerAshCheckRestrictionTest, PrintingWarnedCancelled) { @@ -643,6 +685,10 @@ VerifyAndResetActionAllowed(true /*expected*/); EXPECT_FALSE(helper_.HasAnyContentCached()); EXPECT_TRUE(events_.empty()); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/0, + /*total_count=*/1, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); // Warn restriction is enforced: reject since the user canceled. helper_.ChangeConfidentiality(web_contents.get(), kPrintingWarned); @@ -658,6 +704,12 @@ IsDlpPolicyEvent(CreateDlpPolicyEvent( kSrcPattern, DlpRulesManager::Restriction::kPrinting, DlpRulesManager::Level::kWarn))); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/1, + /*total_count=*/2, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kPrintingWarnProceededUMA, false, 1); // Check again: since the user previously cancelled, dialog is shown again. GetManager()->CheckPrintingRestriction( @@ -670,6 +722,12 @@ IsDlpPolicyEvent(CreateDlpPolicyEvent( kSrcPattern, DlpRulesManager::Restriction::kPrinting, DlpRulesManager::Level::kWarn))); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/2, + /*total_count=*/3, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); + histogram_tester_.ExpectBucketCount( + GetDlpHistogramPrefix() + dlp::kPrintingWarnProceededUMA, false, 2); // Web contents are destroyed: allow, no dialog is shown. helper_.DestroyWebContents(web_contents.get()); @@ -680,6 +738,10 @@ base::BindOnce(on_dlp_restriction_checked_callback, &is_action_allowed_)); VerifyAndResetActionAllowed(true /*expected*/); EXPECT_EQ(events_.size(), 2u); + VerifyHistogramCounts(/*blocked_count=*/0, /*warned_count=*/2, + /*total_count=*/4, + /*blocked_suffix=*/dlp::kPrintingBlockedUMA, + /*warned_suffix=*/dlp::kPrintingWarnedUMA); } TEST_F(DlpContentManagerAshCheckRestrictionTest, CaptureModeInitRestricted) {
diff --git a/chrome/browser/ash/shimless_rma/chrome_shimless_rma_delegate.cc b/chrome/browser/ash/shimless_rma/chrome_shimless_rma_delegate.cc index 689b3341..41743d0 100644 --- a/chrome/browser/ash/shimless_rma/chrome_shimless_rma_delegate.cc +++ b/chrome/browser/ash/shimless_rma/chrome_shimless_rma_delegate.cc
@@ -7,6 +7,7 @@ #include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "chrome/browser/ash/login/chrome_restart_request.h" +#include "chrome/browser/ash/system/device_disabling_manager.h" #include "chrome/browser/ui/webui/chromeos/diagnostics_dialog.h" namespace ash { @@ -26,6 +27,11 @@ } void ChromeShimlessRmaDelegate::ShowDiagnosticsDialog() { + // Don't launch Diagnostics if device is disabled. + if (system::DeviceDisablingManager::IsDeviceDisabledDuringNormalOperation()) { + return; + } + chromeos::DiagnosticsDialog::ShowDialog(); }
diff --git a/chrome/browser/ash/wallpaper_handlers/wallpaper_handlers.cc b/chrome/browser/ash/wallpaper_handlers/wallpaper_handlers.cc index 0ffde54..a08e5c0 100644 --- a/chrome/browser/ash/wallpaper_handlers/wallpaper_handlers.cc +++ b/chrome/browser/ash/wallpaper_handlers/wallpaper_handlers.cc
@@ -665,20 +665,22 @@ if (resume_token && !resume_token->empty()) parsed_response->resume_token = *resume_token; - // The photos listed under "item" are the albums' cover photos. - const auto* response_photos = response->FindList("item"); - if (!response_photos) - return parsed_response; - - // Populate the ID -> URL mapping for the each album's cover photo. + // TODO(b/214577469): Remove code path to determine photo URL via item ID once + // API change hits prod. The photos listed under "item", if present, are the + // albums' cover photos. std::map<std::string, std::string> cover_photo_urls_by_id; - for (const auto& untyped_response_photo : *response_photos) { - DCHECK(untyped_response_photo.is_dict()); - const auto& response_photo = untyped_response_photo.GetDict(); - const auto* id = response_photo.FindStringByDottedPath("itemId.mediaKey"); - const auto* url = response_photo.FindStringByDottedPath("photo.servingUrl"); - if (id && url) - cover_photo_urls_by_id.emplace(*id, *url); + const auto* response_photos = response->FindList("item"); + if (response_photos) { + // Populate the ID -> URL mapping for the each album's cover photo. + for (const auto& untyped_response_photo : *response_photos) { + DCHECK(untyped_response_photo.is_dict()); + const auto& response_photo = untyped_response_photo.GetDict(); + const auto* id = response_photo.FindStringByDottedPath("itemId.mediaKey"); + const auto* url = + response_photo.FindStringByDottedPath("photo.servingUrl"); + if (id && url) + cover_photo_urls_by_id.emplace(*id, *url); + } } const auto* response_albums = response->FindList("collection"); @@ -695,25 +697,32 @@ const auto* title = response_album.FindString("name"); const auto* num_photos_string = response_album.FindString("numPhotos"); - // TODO(b/214577469): Get cover photo URL directly from `response_album`. + // TODO(b/214577469): Remove code path to determine photo URL via item ID + // once API change hits prod. const auto* cover_photo_id = response_album.FindStringByDottedPath("coverItemId.mediaKey"); auto cover_photo_url_iter = cover_photo_id ? cover_photo_urls_by_id.find(*cover_photo_id) : cover_photo_urls_by_id.end(); + const auto* cover_photo_url_ptr = + response_album.FindString("coverItemServingUrl"); int64_t num_photos; if (!album_id || !title || !num_photos_string || !base::StringToInt64(*num_photos_string, &num_photos) || num_photos < 1 || - cover_photo_url_iter == cover_photo_urls_by_id.end()) { + (cover_photo_url_iter == cover_photo_urls_by_id.end() && + !cover_photo_url_ptr)) { continue; } + auto cover_photo_url_string = cover_photo_url_ptr + ? *cover_photo_url_ptr + : cover_photo_url_iter->second; parsed_response->albums->push_back( ash::personalization_app::mojom::GooglePhotosAlbum::New( *album_id, *title, base::saturated_cast<int>(num_photos), - GURL(cover_photo_url_iter->second))); + GURL(cover_photo_url_string))); } return parsed_response; }
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.cc index 0990e07..ffe243d 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.cc +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.cc
@@ -9,8 +9,8 @@ #include <utility> #include <vector> +#include "ash/constants/ambient_animation_theme.h" #include "ash/constants/ash_features.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" #include "ash/public/cpp/ambient/ambient_client.h" #include "ash/public/cpp/ambient/ambient_metrics.h" #include "ash/public/cpp/ambient/ambient_prefs.h"
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.h b/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.h index 4020a5e6..e73b5a30 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.h +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_ASH_WEB_APPLICATIONS_PERSONALIZATION_APP_PERSONALIZATION_APP_AMBIENT_PROVIDER_IMPL_H_ #define CHROME_BROWSER_ASH_WEB_APPLICATIONS_PERSONALIZATION_APP_PERSONALIZATION_APP_AMBIENT_PROVIDER_IMPL_H_ -#include "ash/public/cpp/ambient/ambient_animation_theme.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/public/cpp/ambient/ambient_backend_controller.h" #include "ash/public/cpp/ambient/common/ambient_settings.h" #include "ash/webui/personalization_app/mojom/personalization_app.mojom.h"
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl_unittest.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl_unittest.cc index 5db29fb1..73f113d 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl_unittest.cc +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_ambient_provider_impl_unittest.cc
@@ -9,8 +9,8 @@ #include <vector> #include "ash/ambient/test/ambient_ash_test_helper.h" +#include "ash/constants/ambient_animation_theme.h" #include "ash/constants/ash_features.h" -#include "ash/public/cpp/ambient/ambient_animation_theme.h" #include "ash/public/cpp/ambient/ambient_prefs.h" #include "ash/public/cpp/ambient/common/ambient_settings.h" #include "ash/public/cpp/ambient/fake_ambient_backend_controller_impl.h"
diff --git a/chrome/browser/ash/web_applications/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc b/chrome/browser/ash/web_applications/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc index dd3ff05..d49b5ad 100644 --- a/chrome/browser/ash/web_applications/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc +++ b/chrome/browser/ash/web_applications/personalization_app/personalization_app_wallpaper_provider_impl_unittest.cc
@@ -56,6 +56,8 @@ constexpr char kFakeTestEmail[] = "fakeemail@personalization"; constexpr char kTestGaiaId[] = "1234567890"; +// TODO(b/214577469): Remove response fields used to determine photo URL via +// item ID once API change hits prod. constexpr char kGooglePhotosAlbumsFullResponse[] = "{" " \"collection\": [ {" @@ -651,6 +653,22 @@ mojo::Clone(valid_albums_vector), kResumeToken), google_photos_albums_fetcher->ParseResponse(&response)); + // Parse a response whose album cover photo URL can be determined directly or + // by looking up a cover photo item ID. + auto* album = GetAlbumFromGooglePhotosAlbumsResponse(&response); + album->Set("coverItemServingUrl", "https://www.google.com/"); + EXPECT_EQ(FetchGooglePhotosAlbumsResponse::New( + mojo::Clone(valid_albums_vector), kResumeToken), + google_photos_albums_fetcher->ParseResponse(&response)); + + // Parse a response whose album cover photo URL is directly specified but not + // determinable via a cover photo item ID. + album->Remove("coverItemId"); + response.Remove("item"); + EXPECT_EQ(FetchGooglePhotosAlbumsResponse::New( + mojo::Clone(valid_albums_vector), kResumeToken), + google_photos_albums_fetcher->ParseResponse(&response)); + // Parse a response with a valid album and no resume token. response.Remove("resumeToken"); EXPECT_EQ(FetchGooglePhotosAlbumsResponse::New(std::move(valid_albums_vector),
diff --git a/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc b/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc index b684c3ea..d2faa3b3 100644 --- a/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc +++ b/chrome/browser/ash/web_applications/projector_app/untrusted_projector_ui_config.cc
@@ -6,6 +6,7 @@ #include "ash/constants/ash_features.h" #include "ash/webui/projector_app/public/cpp/projector_app_constants.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/ash/projector/projector_utils.h" #include "chrome/common/channel_info.h" @@ -25,6 +26,7 @@ ash::features::IsProjectorExcludeTranscriptEnabled()); source->AddBoolean("isTutorialVideoViewEnabled", ash::features::IsProjectorTutorialVideoViewEnabled()); + source->AddString("appLocale", g_browser_process->GetApplicationLocale()); } UntrustedProjectorUIConfig::UntrustedProjectorUIConfig()
diff --git a/chrome/browser/capability_delegation_browsertest.cc b/chrome/browser/capability_delegation_browsertest.cc index 1be41b3e..892cbbf 100644 --- a/chrome/browser/capability_delegation_browsertest.cc +++ b/chrome/browser/capability_delegation_browsertest.cc
@@ -20,6 +20,7 @@ CapabilityDelegationBrowserTest() { feature_list_.InitWithFeatures( /*enabled_features=*/{features::kCapabilityDelegationPaymentRequest, + features::kPaymentRequestBasicCard, features::kPaymentRequestRequiresUserActivation}, /*disabled_features=*/{}); } @@ -44,7 +45,8 @@ base::test::ScopedFeatureList feature_list_; }; -IN_PROC_BROWSER_TEST_F(CapabilityDelegationBrowserTest, PaymentRequest) { +IN_PROC_BROWSER_TEST_F(CapabilityDelegationBrowserTest, + CrossOriginPaymentRequest) { // Navigate the top frame. GURL main_url( https_server()->GetURL("a.com", "/payment_request_delegation.html")); @@ -101,3 +103,47 @@ EXPECT_EQ("AbortError", content::EvalJs(active_web_contents, "sendRequestToSubframe(true)")); } + +IN_PROC_BROWSER_TEST_F(CapabilityDelegationBrowserTest, + SameOriginPaymentRequest) { + // Navigate the top frame. + GURL main_url( + https_server()->GetURL("a.com", "/payment_request_delegation.html")); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), main_url)); + + // Navigate the sub-frame cross-site. + content::WebContents* active_web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + GURL subframe_url( + https_server()->GetURL("a.com", "/payment_request_delegation_sub.html")); + EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "iframe", subframe_url)); + + // Confirm that the subframe is same-process. + content::RenderFrameHost* frame_host = + ChildFrameAt(active_web_contents->GetMainFrame(), 0); + ASSERT_TRUE(frame_host); + EXPECT_EQ(subframe_url, frame_host->GetLastCommittedURL()); + EXPECT_FALSE(frame_host->IsCrossProcessSubframe()); + + // Without either user activation or payment request token, PaymentRequest + // dialog is not allowed. + EXPECT_EQ("SecurityError", + content::EvalJs(active_web_contents, "sendRequestToSubframe(false)", + content::EXECUTE_SCRIPT_NO_USER_GESTURE)); + + // Without user activation but with the delegation option, PaymentRequest + // dialog is not allowed. + EXPECT_EQ("SecurityError", + content::EvalJs(active_web_contents, "sendRequestToSubframe(true)", + content::EXECUTE_SCRIPT_NO_USER_GESTURE)); + + // With user activation but without the delegation option, PaymentRequest + // dialog is shown and then successfully aborted by the script. + EXPECT_EQ("AbortError", content::EvalJs(active_web_contents, + "sendRequestToSubframe(false)")); + + // With both user activation and the delegation option, PaymentRequest dialog + // is shown and then successfully aborted by the script. + EXPECT_EQ("AbortError", content::EvalJs(active_web_contents, + "sendRequestToSubframe(true)")); +}
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc b/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc index de619560..073f068 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc +++ b/chrome/browser/chromeos/policy/dlp/dlp_content_manager.cc
@@ -15,6 +15,7 @@ #include "base/containers/contains.h" #include "base/containers/cxx20_erase.h" #include "base/memory/weak_ptr.h" +#include "base/notreached.h" #include "chrome/browser/chromeos/policy/dlp/dlp_confidential_contents.h" #include "chrome/browser/chromeos/policy/dlp/dlp_content_manager_observer.h" #include "chrome/browser/chromeos/policy/dlp/dlp_content_restriction_set.h" @@ -31,6 +32,7 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/views/widget/widget.h" #include "url/gurl.h" @@ -72,6 +74,27 @@ IsBlocked(restriction_info); } +// Maps restriction to the correct suffix used for logging WarnProceeded +// metrics. Returns the suffix for supported restrictions and null otherwise. +const absl::optional<std::string> RestrictionToWarnProceededUMASuffix( + DlpRulesManager::Restriction restriction) { + switch (restriction) { + case DlpRulesManager::Restriction::kScreenShare: + return absl::make_optional(dlp::kScreenShareWarnProceededUMA); + case DlpRulesManager::Restriction::kPrinting: + return absl::make_optional(dlp::kPrintingWarnProceededUMA); + case DlpRulesManager::Restriction::kScreenshot: + // TODO(crbug.com/1304750): Add UMA stats for warning for screenshots. + return absl::nullopt; + case DlpRulesManager::Restriction::kUnknownRestriction: + case DlpRulesManager::Restriction::kClipboard: + case DlpRulesManager::Restriction::kPrivacyScreen: + case DlpRulesManager::Restriction::kFiles: + NOTREACHED(); + return absl::nullopt; + } +} + } // namespace // static @@ -100,6 +123,7 @@ GetPrintingRestrictionInfo(web_contents); MaybeReportEvent(restriction_info, DlpRulesManager::Restriction::kPrinting); DlpBooleanHistogram(dlp::kPrintingBlockedUMA, IsBlocked(restriction_info)); + DlpBooleanHistogram(dlp::kPrintingWarnedUMA, IsWarn(restriction_info)); if (IsBlocked(restriction_info)) { ShowDlpPrintDisabledNotification(); std::move(callback).Run(false); @@ -113,6 +137,7 @@ ReportWarningProceededEvent(restriction_info.url, DlpRulesManager::Restriction::kPrinting, reporting_manager_); + DlpBooleanHistogram(dlp::kPrintingWarnSilentProceededUMA, true); std::move(callback).Run(true); return; } @@ -486,6 +511,8 @@ DlpRulesManager::Restriction::kScreenShare); DlpBooleanHistogram(dlp::kScreenShareBlockedUMA, IsBlocked(info.restriction_info)); + DlpBooleanHistogram(dlp::kScreenShareWarnedUMA, + IsWarn(info.restriction_info)); if (IsBlocked(info.restriction_info)) { ShowDlpScreenShareDisabledNotification(application_title); std::move(callback).Run(false); @@ -498,6 +525,7 @@ DlpRulesManager::Restriction::kScreenShare); if (info.confidential_contents.IsEmpty()) { // The user already allowed all the visible content. + DlpBooleanHistogram(dlp::kScreenShareWarnSilentProceededUMA, true); std::move(callback).Run(true); return; } @@ -570,6 +598,10 @@ } screen_share->SetConfidentialContentsInfo(info); + DlpBooleanHistogram(dlp::kScreenShareBlockedUMA, + IsBlocked(info.restriction_info)); + DlpBooleanHistogram(dlp::kScreenShareWarnedUMA, + IsWarn(info.restriction_info)); if (IsBlocked(info.restriction_info)) { if (screen_share->IsRunning()) { screen_share->Pause(); @@ -592,6 +624,7 @@ screen_share->Resume(); screen_share->MaybeUpdateNotifications(); } + DlpBooleanHistogram(dlp::kScreenShareWarnSilentProceededUMA, true); continue; } if (screen_share->IsRunning()) { @@ -633,6 +666,7 @@ // to do anything. return; + DlpBooleanHistogram(dlp::kScreenShareWarnProceededUMA, should_proceed); if (should_proceed) { ReportWarningProceededEvent(info.restriction_info.url, DlpRulesManager::Restriction::kScreenShare, @@ -657,6 +691,9 @@ DlpRulesManager::Restriction restriction, OnDlpRestrictionCheckedCallback callback, bool should_proceed) { + auto suffix = RestrictionToWarnProceededUMASuffix(restriction); + if (suffix.has_value()) + DlpBooleanHistogram(suffix.value(), should_proceed); if (should_proceed) { for (const auto& content : confidential_contents.GetContents()) { user_allowed_contents_cache_.Cache(content, restriction);
diff --git a/chrome/browser/chromeos/policy/dlp/dlp_histogram_helper.h b/chrome/browser/chromeos/policy/dlp/dlp_histogram_helper.h index 23b12ee9..a844ada 100644 --- a/chrome/browser/chromeos/policy/dlp/dlp_histogram_helper.h +++ b/chrome/browser/chromeos/policy/dlp/dlp_histogram_helper.h
@@ -24,8 +24,16 @@ constexpr char kDragDropBlockedUMA[] = "DragDropBlocked"; constexpr char kFilesDaemonStartedUMA[] = "FilesDaemonStarted"; constexpr char kPrintingBlockedUMA[] = "PrintingBlocked"; +constexpr char kPrintingWarnedUMA[] = "PrintingWarned"; +constexpr char kPrintingWarnProceededUMA[] = "PrintingWarnProceeded"; +constexpr char kPrintingWarnSilentProceededUMA[] = + "PrintingWarnSilentProceeded"; constexpr char kPrivacyScreenEnforcedUMA[] = "PrivacyScreenEnforced"; constexpr char kScreenShareBlockedUMA[] = "ScreenShareBlocked"; +constexpr char kScreenShareWarnedUMA[] = "ScreenShareWarned"; +constexpr char kScreenShareWarnProceededUMA[] = "ScreenShareWarnProceeded"; +constexpr char kScreenShareWarnSilentProceededUMA[] = + "ScreenShareWarnSilentProceeded"; constexpr char kScreenSharePausedOrResumedUMA[] = "ScreenSharePausedOrResumed"; constexpr char kScreenshotBlockedUMA[] = "ScreenshotBlocked"; constexpr char kVideoCaptureInterruptedUMA[] = "VideoCaptureInterrupted";
diff --git a/chrome/browser/content_creation/reactions/internal/android/java/res/layout/scene.xml b/chrome/browser/content_creation/reactions/internal/android/java/res/layout/scene.xml index 6afec94d..3285357fe 100644 --- a/chrome/browser/content_creation/reactions/internal/android/java/res/layout/scene.xml +++ b/chrome/browser/content_creation/reactions/internal/android/java/res/layout/scene.xml
@@ -10,7 +10,7 @@ android:layout_height="match_parent" android:orientation="vertical" android:background="@color/default_scrim_color" - android:importantForAccessibility="yes"> + android:importantForAccessibility="no"> <ImageView tools:ignore="ContentDescription" android:id="@+id/lightweight_reactions_background"
diff --git a/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/LightweightReactionsDialog.java b/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/LightweightReactionsDialog.java index 1d0017ed..bf6e91f 100644 --- a/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/LightweightReactionsDialog.java +++ b/chrome/browser/content_creation/reactions/internal/android/java/src/org/chromium/chrome/browser/content_creation/reactions/LightweightReactionsDialog.java
@@ -82,6 +82,5 @@ mContentView.findViewById(R.id.lightweight_reactions_background); Drawable background = new BitmapDrawable(getResources(), mScreenshot); sceneBackground.setImageDrawable(background); - sceneBackground.setFocusable(false); } } \ No newline at end of file
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc index fc1d593..a53f074 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -152,8 +152,7 @@ // platform_util::ShowItemInFolder / DownloadTargetDeterminer. // // How the platform path is determined is based on PlatformDownloadPathType. -base::FilePath GetPlatformDownloadPath(Profile* profile, - const DownloadItem* download, +base::FilePath GetPlatformDownloadPath(const DownloadItem* download, PlatformDownloadPathType path_type) { if (path_type == PLATFORM_TARGET_PATH) return download->GetTargetFilePath(); @@ -537,7 +536,7 @@ weak_ptr_factory_.GetWeakPtr(), download->GetId(), std::move(*callback)); base::FilePath download_path = - GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH); + GetPlatformDownloadPath(download, PLATFORM_TARGET_PATH); DownloadPathReservationTracker::FilenameConflictAction action = kDefaultPlatformConflictAction; #if BUILDFLAG(IS_ANDROID) @@ -817,7 +816,7 @@ void ChromeDownloadManagerDelegate::OpenDownloadUsingPlatformHandler( DownloadItem* download) { base::FilePath platform_path( - GetPlatformDownloadPath(profile_, download, PLATFORM_TARGET_PATH)); + GetPlatformDownloadPath(download, PLATFORM_TARGET_PATH)); DCHECK(!platform_path.empty()); platform_util::OpenItem(profile_, platform_path, platform_util::OPEN_FILE, platform_util::OpenOperationCallback()); @@ -918,7 +917,7 @@ } base::FilePath platform_path( - GetPlatformDownloadPath(profile_, download, PLATFORM_CURRENT_PATH)); + GetPlatformDownloadPath(download, PLATFORM_CURRENT_PATH)); DCHECK(!platform_path.empty()); platform_util::ShowItemInFolder(profile_, platform_path); }
diff --git a/chrome/browser/download/download_prefs_unittest.cc b/chrome/browser/download/download_prefs_unittest.cc index 12bc295..b58f44a 100644 --- a/chrome/browser/download/download_prefs_unittest.cc +++ b/chrome/browser/download/download_prefs_unittest.cc
@@ -452,9 +452,10 @@ "/media/fuse/drivefs-" + base::MD5String(drivefs_profile_salt + "-" + account_id.GetAccountIdKey())); const base::FilePath ash_resources_dir = base::FilePath("/opt/google/chrome"); - chrome::SetLacrosDefaultPaths(documents_path, default_dir, drivefs_dir, - removable_media_dir, android_files_dir, - linux_files_dir, ash_resources_dir); + base::FilePath share_cache_dir = profile.GetPath().AppendASCII("ShareCache"); + chrome::SetLacrosDefaultPaths( + documents_path, default_dir, drivefs_dir, removable_media_dir, + android_files_dir, linux_files_dir, ash_resources_dir, share_cache_dir); #endif // Test a valid subdirectory of downloads.
diff --git a/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc b/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc index b620328..7d155e1 100644 --- a/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc +++ b/chrome/browser/extensions/api/feedback_private/feedback_browsertest.cc
@@ -9,14 +9,12 @@ #include "chrome/browser/apps/platform_apps/app_browsertest_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/devtools/devtools_window_testing.h" -#include "chrome/browser/extensions/component_loader.h" -#include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/feedback/feedback_dialog_utils.h" #include "chrome/browser/feedback/feedback_uploader_chrome.h" #include "chrome/browser/feedback/feedback_uploader_factory_chrome.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/extensions/extension_constants.h" +#include "chrome/browser/ui/webui/feedback/feedback_dialog.h" #include "chrome/common/webui_url_constants.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" @@ -26,79 +24,67 @@ #include "content/public/test/test_utils.h" #include "extensions/browser/api/feedback_private/feedback_private_api.h" #include "extensions/browser/app_window/app_window.h" -#include "extensions/browser/app_window/app_window_registry.h" -#include "extensions/browser/event_router.h" -#include "extensions/browser/extension_system.h" #include "extensions/common/api/feedback_private.h" using extensions::api::feedback_private::FeedbackFlow; -namespace { - -void StopMessageLoopCallback() { - base::RunLoop::QuitCurrentWhenIdleDeprecated(); -} - -} // namespace - namespace extensions { -class FeedbackTest : public ExtensionBrowserTest { +class FeedbackTest : public InProcessBrowserTest { public: - void SetUp() override { - extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); - ExtensionBrowserTest::SetUp(); - } - void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitch(::switches::kEnableUserMediaScreenCapturing); } protected: - bool IsFeedbackAppAvailable() { - return extensions::EventRouter::Get(browser()->profile()) - ->ExtensionHasEventListener( - extension_misc::kFeedbackExtensionId, - extensions::api::feedback_private::OnFeedbackRequested::kEventName); - } - void StartFeedbackUI(FeedbackFlow flow, const std::string& extra_diagnostics, bool from_assistant = false, bool include_bluetooth_logs = false, bool show_questionnaire = false) { - base::OnceClosure callback = base::BindOnce(&StopMessageLoopCallback); - extensions::FeedbackPrivateGetStringsFunction::set_test_callback(&callback); - InvokeFeedbackUI(flow, extra_diagnostics, from_assistant, - include_bluetooth_logs, show_questionnaire); - content::RunMessageLoop(); - extensions::FeedbackPrivateGetStringsFunction::set_test_callback(nullptr); - } - - void VerifyFeedbackAppLaunch() { - AppWindow* window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - const Extension* feedback_app = window->GetExtension(); - ASSERT_TRUE(feedback_app); - EXPECT_EQ(feedback_app->id(), - std::string(extension_misc::kFeedbackExtensionId)); - } - - private: - void InvokeFeedbackUI(FeedbackFlow flow, - const std::string& extra_diagnostics, - bool from_assistant, - bool include_bluetooth_logs, - bool show_questionnaire) { extensions::FeedbackPrivateAPI* api = extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get( browser()->profile()); - api->RequestFeedbackForFlow( + auto info = api->CreateFeedbackInfo( "Test description", "Test placeholder", "Test tag", extra_diagnostics, GURL("http://www.test.com"), flow, from_assistant, - include_bluetooth_logs, show_questionnaire); + include_bluetooth_logs, show_questionnaire, + /*from_chrome_labs_or_kaleidoscope=*/false); + + FeedbackDialog::CreateOrShow(browser()->profile(), *info); } + + void VerifyFeedbackAppLaunch() { + feedback_dialog_ = FeedbackDialog::GetInstanceForTest(); + ASSERT_NE(nullptr, feedback_dialog_); + + base::RunLoop run_loop; + EnsureFeedbackAppUIShown(feedback_dialog_, run_loop.QuitClosure()); + run_loop.Run(); + + ASSERT_NE(nullptr, feedback_dialog_); + ASSERT_NE(nullptr, feedback_dialog_->GetWidget()); + EXPECT_TRUE(feedback_dialog_->GetWidget()->IsVisible()); + } + + private: + void EnsureFeedbackAppUIShown(FeedbackDialog* feedback_dialog, + base::OnceClosure callback) { + auto* widget = feedback_dialog->GetWidget(); + ASSERT_NE(nullptr, widget); + if (widget->IsActive()) { + std::move(callback).Run(); + } else { + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::BindOnce(&FeedbackTest::EnsureFeedbackAppUIShown, + base::Unretained(this), feedback_dialog, + std::move(callback)), + base::Seconds(1)); + } + } + + FeedbackDialog* feedback_dialog_; }; class TestFeedbackUploaderDelegate @@ -113,58 +99,50 @@ raw_ptr<base::RunLoop> quit_on_dispatch_; }; -// TODO(crbug.com/1241504): disable tests. -IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_ShowFeedback) { - WaitForExtensionViewsToLoad(); - - ASSERT_TRUE(IsFeedbackAppAvailable()); +IN_PROC_BROWSER_TEST_F(FeedbackTest, ShowFeedback) { StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_REGULAR, std::string()); VerifyFeedbackAppLaunch(); } -// TODO(crbug.com/1241504): disable tests. -IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_ShowLoginFeedback) { - WaitForExtensionViewsToLoad(); +IN_PROC_BROWSER_TEST_F(FeedbackTest, ShowLoginFeedback) { + content::WebContentsAddedObserver observer; - ASSERT_TRUE(IsFeedbackAppAvailable()); StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_LOGIN, std::string()); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); + ASSERT_EQ(u"Feedback", content->GetTitle()); + ASSERT_EQ("chrome://feedback/", content->GetURL().spec()); bool bool_result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( content, - "domAutomationController.send(" - "$('page-url').hidden && $('attach-file-container').hidden && " - "$('attach-file-note').hidden);", + "window.domAutomationController.send(" + "document.querySelector('#page-url').hidden && " + "document.querySelector('#attach-file-container').hidden && " + "document.querySelector('#attach-file-note').hidden);", &bool_result)); EXPECT_TRUE(bool_result); } // Tests that there's an option in the email drop down box with a value ''. -// TODO(crbug.com/1241504): disable tests. -IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_AnonymousUser) { - WaitForExtensionViewsToLoad(); +IN_PROC_BROWSER_TEST_F(FeedbackTest, AnonymousUser) { + content::WebContentsAddedObserver observer; - ASSERT_TRUE(IsFeedbackAppAvailable()); StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_REGULAR, std::string()); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); bool bool_result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( content, "domAutomationController.send(" " ((function() {" - " var options = $('user-email-drop-down').options;" + " var options = " + "document.querySelector('#user-email-drop-down').options;" " for (var option in options) {" " if (options[option].value == '')" " return true;" @@ -178,18 +156,14 @@ // Ensures that when extra diagnostics are provided with feedback, they are // injected properly in the system information. -// TODO(crbug.com/1241504): disable tests. -IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_ExtraDiagnostics) { - WaitForExtensionViewsToLoad(); +IN_PROC_BROWSER_TEST_F(FeedbackTest, ExtraDiagnostics) { + content::WebContentsAddedObserver observer; - ASSERT_TRUE(IsFeedbackAppAvailable()); StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_REGULAR, "Some diagnostics"); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); bool bool_result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( @@ -212,27 +186,25 @@ // Ensures that when triggered from Assistant with Google account, Assistant // checkbox are not hidden. -// Disabled due to flake: https://crbug.com/1240591 -IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_ShowFeedbackFromAssistant) { - WaitForExtensionViewsToLoad(); +IN_PROC_BROWSER_TEST_F(FeedbackTest, ShowFeedbackFromAssistant) { + content::WebContentsAddedObserver observer; - ASSERT_TRUE(IsFeedbackAppAvailable()); StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_GOOGLEINTERNAL, std::string(), /*from_assistant*/ true); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); bool bool_result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( content, "domAutomationController.send(" " ((function() {" - " if ($('assistant-checkbox-container') != null &&" - " $('assistant-checkbox-container').hidden == true) {" + " var elem = " + " document.getElementById('assistant-checkbox-container');" + " if (elem != null && elem.hidden == true) " + " {" " return false;" " }" " return true;" @@ -246,17 +218,14 @@ // string is entered into the description, that we provide the option for // uploading Bluetooth logs as well. IN_PROC_BROWSER_TEST_F(FeedbackTest, ProvideBluetoothLogs) { - WaitForExtensionViewsToLoad(); + content::WebContentsAddedObserver observer; - ASSERT_TRUE(IsFeedbackAppAvailable()); StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_GOOGLEINTERNAL, std::string(), /*from_assistant*/ false, /*include_bluetooth_logs*/ true); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); // It shouldn't be visible until we put the Bluetooth text into the // description. @@ -265,12 +234,14 @@ content, "domAutomationController.send(" " ((function() {" - " if ($('bluetooth-checkbox-container') != null &&" - " $('bluetooth-checkbox-container').hidden == true) {" - " return true;" - " }" - " return false;" - " })()));", + " var bluetooth = " + " document.getElementById('bluetooth-checkbox-container');" + " if (bluetooth != null && bluetooth.hidden == true) " + " { " + " return true; " + " } " + " return false; " + "})()));", &bool_result)); EXPECT_TRUE(bool_result); bool_result = false; @@ -281,12 +252,13 @@ " var elem = document.getElementById('description-text');" " elem.value = 'bluetooth';" " elem.dispatchEvent(new Event('input', {}));" - " if ($('bluetooth-checkbox-container') != null &&" - " $('bluetooth-checkbox-container').hidden == false) {" - " return true;" + " var bluetooth = " + " document.getElementById('bluetooth-checkbox-container');" + " if (bluetooth != null && bluetooth.hidden == false) {" + " return true; " " }" " return false;" - " })()));", + "})()));", &bool_result)); EXPECT_TRUE(bool_result); } @@ -295,27 +267,24 @@ // string is entered into the description, that we append Bluetooth-related // questions to the issue description. IN_PROC_BROWSER_TEST_F(FeedbackTest, AppendQuestionnaire) { - WaitForExtensionViewsToLoad(); - - ASSERT_TRUE(IsFeedbackAppAvailable()); + content::WebContentsAddedObserver observer; StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_GOOGLEINTERNAL, std::string(), /*from_assistant*/ false, /*include_bluetooth_logs*/ true, /*show_questionnaire*/ true); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); - // Questionnaire shouldn't be visible until we put the Bluetooth text into the - // description. + // Questionnaire shouldn't be visible until we put the Bluetooth text into + // the description. bool bool_result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( content, "domAutomationController.send(" " ((function() {" - " return !$('description-text').value.includes('please answer');" + " var elem = document.getElementById('description-text');" + " return !elem.value.includes('please answer');" " })()));", &bool_result)); EXPECT_TRUE(bool_result); @@ -353,18 +322,14 @@ // Questionnaires should not be displayed if it's not a Googler session. IN_PROC_BROWSER_TEST_F(FeedbackTest, AppendQuestionnaireNotGoogler) { - WaitForExtensionViewsToLoad(); - - ASSERT_TRUE(IsFeedbackAppAvailable()); + content::WebContentsAddedObserver observer; StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_REGULAR, std::string(), /*from_assistant*/ false, /*include_bluetooth_logs*/ false, /*show_questionnaire*/ false); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); // Questionnaire shouldn't be visible in the beginning. bool bool_result = false; @@ -372,7 +337,8 @@ content, "domAutomationController.send(" " ((function() {" - " return !$('description-text').value.includes('[Bluetooth]');" + " var elem = document.getElementById('description-text');" + " return !elem.value.includes('[Bluetooth]');" " })()));", &bool_result)); EXPECT_TRUE(bool_result); @@ -393,8 +359,7 @@ } #endif // BUILDFLAG(IS_CHROMEOS_ASH) -// Disabled due to flake: https://crbug.com/1069870 -IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_GetTargetTabUrl) { +IN_PROC_BROWSER_TEST_F(FeedbackTest, GetTargetTabUrl) { const std::pair<std::string, std::string> test_cases[] = { {"https://www.google.com/", "https://www.google.com/"}, {"chrome://version/", chrome::kChromeUIVersionURL}, @@ -435,16 +400,13 @@ // Disabled due to flake: https://crbug.com/1180373 IN_PROC_BROWSER_TEST_F(FeedbackTest, DISABLED_SubmissionTest) { - WaitForExtensionViewsToLoad(); + content::WebContentsAddedObserver observer; - ASSERT_TRUE(IsFeedbackAppAvailable()); StartFeedbackUI(FeedbackFlow::FEEDBACK_FLOW_GOOGLEINTERNAL, std::string()); VerifyFeedbackAppLaunch(); - AppWindow* const window = - PlatformAppBrowserTest::GetFirstAppWindowForBrowser(browser()); - ASSERT_TRUE(window); - content::WebContents* const content = window->web_contents(); + content::WebContents* content = observer.GetWebContents(); + ASSERT_TRUE(content::WaitForLoadStop(content)); // Set a delegate for the uploader which will be invoked when the report // normally would have been uploaded. We have it setup to then quit the @@ -461,8 +423,9 @@ content, "domAutomationController.send(" " ((function() {" - " if ($('send-report-button') != null) {" - " document.getElementById('send-report-button').click();" + " var button = document.getElementById('send-report-button');" + " if (button != null) {" + " button.click();" " return true;" " }" " return false;"
diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc index 67e8452..ef09c8e 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_apitest.cc
@@ -168,7 +168,13 @@ // Make sure tabCapture.capture only works if the tab has been granted // permission via an extension icon click or the extension is allowlisted. -IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, ActiveTabPermission) { +// TODO(crbug.com/1306351): Flaky on Mac and Win. +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +#define MAYBE_ActiveTabPermission DISABLED_ActiveTabPermission +#else +#define MAYBE_ActiveTabPermission ActiveTabPermission +#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) +IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, MAYBE_ActiveTabPermission) { ExtensionTestMessageListener before_open_tab("ready1", true); ExtensionTestMessageListener before_grant_permission("ready2", true); ExtensionTestMessageListener before_open_new_tab("ready3", true);
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java index 427e1625..b64ad92c 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStream.java
@@ -32,6 +32,8 @@ import org.chromium.base.supplier.Supplier; import org.chromium.base.task.PostTask; import org.chromium.chrome.browser.feed.v2.FeedUserActionType; +import org.chromium.chrome.browser.feed.webfeed.WebFeedBridge; +import org.chromium.chrome.browser.feed.webfeed.WebFeedSubscriptionRequestStatus; import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.profiles.Profile; @@ -62,6 +64,7 @@ import org.chromium.ui.mojom.WindowOpenDisposition; import org.chromium.url.GURL; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -207,6 +210,34 @@ mNativeFeedStream, mMakeGURL.apply(url), entityArray); } + @Override + public void updateWebFeedFollowState(WebFeedFollowUpdate update) { + byte[] webFeedId; + try { + webFeedId = update.webFeedName().getBytes("UTF8"); + } catch (UnsupportedEncodingException e) { + Log.i(TAG, "Invalid webFeedName", e); + return; + } + if (update.isFollow()) { + WebFeedBridge.followFromId(webFeedId, update.isDurable(), results -> { + WebFeedFollowUpdate.Callback callback = update.callback(); + if (callback != null) { + callback.requestComplete( + results.requestStatus == WebFeedSubscriptionRequestStatus.SUCCESS); + } + }); + } else { + WebFeedBridge.unfollow(webFeedId, update.isDurable(), results -> { + WebFeedFollowUpdate.Callback callback = update.callback(); + if (callback != null) { + callback.requestComplete( + results.requestStatus == WebFeedSubscriptionRequestStatus.SUCCESS); + } + }); + } + } + private void openSuggestionUrl(String url, int disposition) { boolean inNewTab = (disposition == WindowOpenDisposition.NEW_BACKGROUND_TAB || disposition == WindowOpenDisposition.OFF_THE_RECORD);
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStreamTest.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStreamTest.java index 9b92531..a10b1eca 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStreamTest.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedStreamTest.java
@@ -29,6 +29,7 @@ import android.util.TypedValue; import android.widget.FrameLayout; +import androidx.annotation.Nullable; import androidx.appcompat.widget.AppCompatTextView; import androidx.recyclerview.widget.RecyclerView; import androidx.test.filters.SmallTest; @@ -57,6 +58,11 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.JniMocker; import org.chromium.chrome.browser.feed.v2.FeedUserActionType; +import org.chromium.chrome.browser.feed.webfeed.WebFeedBridge; +import org.chromium.chrome.browser.feed.webfeed.WebFeedBridge.FollowResults; +import org.chromium.chrome.browser.feed.webfeed.WebFeedBridge.UnfollowResults; +import org.chromium.chrome.browser.feed.webfeed.WebFeedBridgeJni; +import org.chromium.chrome.browser.feed.webfeed.WebFeedSubscriptionRequestStatus; import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.profiles.Profile; @@ -66,6 +72,7 @@ import org.chromium.chrome.browser.xsurface.FeedLaunchReliabilityLogger; import org.chromium.chrome.browser.xsurface.HybridListRenderer; import org.chromium.chrome.browser.xsurface.SurfaceActionsHandler; +import org.chromium.chrome.browser.xsurface.SurfaceActionsHandler.WebFeedFollowUpdate; import org.chromium.chrome.browser.xsurface.SurfaceScope; import org.chromium.chrome.test.util.browser.Features; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; @@ -132,9 +139,17 @@ private FeedLaunchReliabilityLogger mLaunchReliabilityLogger; @Mock private FeedActionDelegate mActionDelegate; + @Mock + WebFeedBridge.Natives mWebFeedBridgeJni; @Captor private ArgumentCaptor<Map<String, String>> mMapCaptor; + @Captor + private ArgumentCaptor<Callback<FollowResults>> mFollowResultsCallbackCaptor; + @Captor + private ArgumentCaptor<Callback<UnfollowResults>> mUnfollowResultsCallbackCaptor; + @Mock + private WebFeedFollowUpdate.Callback mWebFeedFollowUpdateCallback; @Rule public JniMocker mocker = new JniMocker(); @@ -159,6 +174,7 @@ mocker.mock(FeedServiceBridge.getTestHooksForTesting(), mFeedServiceBridgeJniMock); mocker.mock(FeedReliabilityLoggingBridge.getTestHooksForTesting(), mFeedReliabilityLoggingBridgeJniMock); + mocker.mock(WebFeedBridgeJni.TEST_HOOKS, mWebFeedBridgeJni); Profile.setLastUsedProfileForTesting(mProfileMock); when(mFeedServiceBridgeJniMock.getLoadMoreTriggerLookahead()) @@ -545,6 +561,186 @@ @Test @SmallTest + public void testUpdateWebFeedFollowState_follow_success() throws Exception { + bindToView(); + FeedStream.FeedSurfaceActionsHandler handler = + (FeedStream.FeedSurfaceActionsHandler) mContentManager.getContextValues(0).get( + SurfaceActionsHandler.KEY); + + handler.updateWebFeedFollowState(new WebFeedFollowUpdate() { + @Override + public String webFeedName() { + return "webFeed1"; + } + @Override + @Nullable + public WebFeedFollowUpdate.Callback callback() { + return mWebFeedFollowUpdateCallback; + } + }); + + verify(mWebFeedBridgeJni) + .followWebFeedById(eq("webFeed1".getBytes("UTF8")), eq(false), + mFollowResultsCallbackCaptor.capture()); + mFollowResultsCallbackCaptor.getValue().onResult( + new FollowResults(WebFeedSubscriptionRequestStatus.SUCCESS, null)); + verify(mWebFeedFollowUpdateCallback).requestComplete(eq(true)); + } + + @Test + @SmallTest + public void testUpdateWebFeedFollowState_follow_null_callback() throws Exception { + bindToView(); + FeedStream.FeedSurfaceActionsHandler handler = + (FeedStream.FeedSurfaceActionsHandler) mContentManager.getContextValues(0).get( + SurfaceActionsHandler.KEY); + + handler.updateWebFeedFollowState(new WebFeedFollowUpdate() { + @Override + public String webFeedName() { + return "webFeed1"; + } + }); + + verify(mWebFeedBridgeJni) + .followWebFeedById(any(), eq(false), mFollowResultsCallbackCaptor.capture()); + // Just make sure no exception is thrown because there is no callback to call. + mFollowResultsCallbackCaptor.getValue().onResult( + new FollowResults(WebFeedSubscriptionRequestStatus.SUCCESS, null)); + } + + @Test + @SmallTest + public void testUpdateWebFeedFollowState_follow_durable_failure() throws Exception { + bindToView(); + FeedStream.FeedSurfaceActionsHandler handler = + (FeedStream.FeedSurfaceActionsHandler) mContentManager.getContextValues(0).get( + SurfaceActionsHandler.KEY); + + handler.updateWebFeedFollowState(new WebFeedFollowUpdate() { + @Override + public String webFeedName() { + return "webFeed1"; + } + @Override + public boolean isDurable() { + return true; + } + @Override + @Nullable + public WebFeedFollowUpdate.Callback callback() { + return mWebFeedFollowUpdateCallback; + } + }); + + verify(mWebFeedBridgeJni) + .followWebFeedById(eq("webFeed1".getBytes("UTF8")), eq(true), + mFollowResultsCallbackCaptor.capture()); + mFollowResultsCallbackCaptor.getValue().onResult( + new FollowResults(WebFeedSubscriptionRequestStatus.FAILED_OFFLINE, null)); + verify(mWebFeedFollowUpdateCallback).requestComplete(eq(false)); + } + + @Test + @SmallTest + public void testUpdateWebFeedFollowState_unfollow_durable_success() throws Exception { + bindToView(); + FeedStream.FeedSurfaceActionsHandler handler = + (FeedStream.FeedSurfaceActionsHandler) mContentManager.getContextValues(0).get( + SurfaceActionsHandler.KEY); + + handler.updateWebFeedFollowState(new WebFeedFollowUpdate() { + @Override + public String webFeedName() { + return "webFeed1"; + } + @Override + @Nullable + public WebFeedFollowUpdate.Callback callback() { + return mWebFeedFollowUpdateCallback; + } + @Override + public boolean isFollow() { + return false; + } + @Override + public boolean isDurable() { + return true; + } + }); + + verify(mWebFeedBridgeJni) + .unfollowWebFeed(eq("webFeed1".getBytes("UTF8")), eq(true), + mUnfollowResultsCallbackCaptor.capture()); + mUnfollowResultsCallbackCaptor.getValue().onResult( + new UnfollowResults(WebFeedSubscriptionRequestStatus.SUCCESS)); + // Just make sure no exception is thrown because there is no callback to call. + verify(mWebFeedFollowUpdateCallback).requestComplete(eq(true)); + } + + @Test + @SmallTest + public void testUpdateWebFeedFollowState_unfollow_null_callback() throws Exception { + bindToView(); + FeedStream.FeedSurfaceActionsHandler handler = + (FeedStream.FeedSurfaceActionsHandler) mContentManager.getContextValues(0).get( + SurfaceActionsHandler.KEY); + + handler.updateWebFeedFollowState(new WebFeedFollowUpdate() { + @Override + public String webFeedName() { + return "webFeed1"; + } + @Override + public boolean isFollow() { + return false; + } + }); + + verify(mWebFeedBridgeJni) + .unfollowWebFeed(any(), eq(false), mUnfollowResultsCallbackCaptor.capture()); + mUnfollowResultsCallbackCaptor.getValue().onResult( + new UnfollowResults(WebFeedSubscriptionRequestStatus.SUCCESS)); + } + + @Test + @SmallTest + public void testUpdateWebFeedFollowState_unfollow_durable_failure() throws Exception { + bindToView(); + FeedStream.FeedSurfaceActionsHandler handler = + (FeedStream.FeedSurfaceActionsHandler) mContentManager.getContextValues(0).get( + SurfaceActionsHandler.KEY); + + handler.updateWebFeedFollowState(new WebFeedFollowUpdate() { + @Override + public String webFeedName() { + return "webFeed1"; + } + @Override + @Nullable + public WebFeedFollowUpdate.Callback callback() { + return mWebFeedFollowUpdateCallback; + } + @Override + public boolean isFollow() { + return false; + } + @Override + public boolean isDurable() { + return true; + } + }); + + verify(mWebFeedBridgeJni) + .unfollowWebFeed(eq("webFeed1".getBytes("UTF8")), eq(true), + mUnfollowResultsCallbackCaptor.capture()); + mUnfollowResultsCallbackCaptor.getValue().onResult( + new UnfollowResults(WebFeedSubscriptionRequestStatus.FAILED_OFFLINE)); + verify(mWebFeedFollowUpdateCallback).requestComplete(eq(false)); + } + + @Test + @SmallTest public void testAddToReadingList() { bindToView(); FeedStream.FeedSurfaceActionsHandler handler =
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediator.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediator.java index 086e358..9e0e8e5 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediator.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediator.java
@@ -155,7 +155,7 @@ FeedServiceBridge.reportOtherUserAction( StreamKind.UNKNOWN, FeedUserActionType.TAPPED_FOLLOW_ON_MANAGEMENT_SURFACE); // The lambda will set the item as subscribed if the follow operation succeeds. - WebFeedBridge.followFromId(id, results -> { + WebFeedBridge.followFromId(id, /*isDurable=*/false, results -> { reportRequestStatus(results.requestStatus); itemModel.set(FollowManagementItemProperties.SUBSCRIBED_KEY, results.requestStatus == SUCCESS); @@ -165,7 +165,7 @@ FeedServiceBridge.reportOtherUserAction( StreamKind.UNKNOWN, FeedUserActionType.TAPPED_UNFOLLOW_ON_MANAGEMENT_SURFACE); // The lambda will set the item as unsubscribed if the unfollow operation succeeds. - WebFeedBridge.unfollow(id, results -> { + WebFeedBridge.unfollow(id, /*isDurable=*/false, results -> { reportRequestStatus(results.requestStatus); itemModel.set(FollowManagementItemProperties.SUBSCRIBED_KEY, results.requestStatus != SUCCESS);
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediatorTest.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediatorTest.java index af855ba..5173667 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediatorTest.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/followmanagement/FollowManagementMediatorTest.java
@@ -149,7 +149,9 @@ mFollowManagementMediator.clickHandler(mModelList.get(0).model); - verify(mWebFeedBridgeJni).unfollowWebFeed(eq(ID1), mUnfollowCallbackCaptor.capture()); + verify(mWebFeedBridgeJni) + .unfollowWebFeed( + eq(ID1), /*isDurable=*/eq(false), mUnfollowCallbackCaptor.capture()); mUnfollowCallbackCaptor.getValue().onResult( new WebFeedBridge.UnfollowResults(WebFeedSubscriptionRequestStatus.FAILED_OFFLINE)); @@ -165,7 +167,9 @@ mFollowManagementMediator.clickHandler(mModelList.get(0).model); - verify(mWebFeedBridgeJni).unfollowWebFeed(eq(ID1), mUnfollowCallbackCaptor.capture()); + verify(mWebFeedBridgeJni) + .unfollowWebFeed( + eq(ID1), /*isDurable=*/eq(false), mUnfollowCallbackCaptor.capture()); mUnfollowCallbackCaptor.getValue().onResult( new WebFeedBridge.UnfollowResults(WebFeedSubscriptionRequestStatus.SUCCESS)); @@ -193,7 +197,9 @@ mFollowManagementMediator.clickHandler(mModelList.get(0).model); - verify(mWebFeedBridgeJni).followWebFeedById(eq(ID1), mFollowCallbackCaptor.capture()); + verify(mWebFeedBridgeJni) + .followWebFeedById( + eq(ID1), /*isDurable=*/eq(false), mFollowCallbackCaptor.capture()); mFollowCallbackCaptor.getValue().onResult(new WebFeedBridge.FollowResults( WebFeedSubscriptionRequestStatus.FAILED_UNKNOWN_ERROR, null)); @@ -210,7 +216,9 @@ mFollowManagementMediator.clickHandler(mModelList.get(0).model); - verify(mWebFeedBridgeJni).followWebFeedById(eq(ID1), mFollowCallbackCaptor.capture()); + verify(mWebFeedBridgeJni) + .followWebFeedById( + eq(ID1), /*isDurable=*/eq(false), mFollowCallbackCaptor.capture()); mFollowCallbackCaptor.getValue().onResult( new WebFeedBridge.FollowResults(WebFeedSubscriptionRequestStatus.SUCCESS, null));
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedBridge.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedBridge.java index 177d6492..eba9847 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedBridge.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedBridge.java
@@ -181,8 +181,9 @@ * @param webFeedId The identifier of the Web Feed to be followed. * @param callback The callback to receive the follow results. */ - public static void followFromId(byte[] webFeedId, Callback<FollowResults> callback) { - WebFeedBridgeJni.get().followWebFeedById(webFeedId, callback); + public static void followFromId( + byte[] webFeedId, boolean isDurable, Callback<FollowResults> callback) { + WebFeedBridgeJni.get().followWebFeedById(webFeedId, isDurable, callback); } /** @@ -190,8 +191,9 @@ * @param webFeedId The Web Feed identifier. * @param callback The callback to receive the unfollow result. */ - public static void unfollow(byte[] webFeedId, Callback<UnfollowResults> callback) { - WebFeedBridgeJni.get().unfollowWebFeed(webFeedId, callback); + public static void unfollow( + byte[] webFeedId, boolean isDurable, Callback<UnfollowResults> callback) { + WebFeedBridgeJni.get().unfollowWebFeed(webFeedId, isDurable, callback); } /** This is deprecated, do not use. */ @@ -235,8 +237,10 @@ @NativeMethods public interface Natives { void followWebFeed(WebFeedPageInformation pageInfo, Callback<FollowResults> callback); - void followWebFeedById(byte[] webFeedId, Callback<FollowResults> callback); - void unfollowWebFeed(byte[] webFeedId, Callback<UnfollowResults> callback); + void followWebFeedById( + byte[] webFeedId, boolean isDurable, Callback<FollowResults> callback); + void unfollowWebFeed( + byte[] webFeedId, boolean isDurable, Callback<UnfollowResults> callback); void findWebFeedInfoForPage(WebFeedPageInformation pageInfo, @WebFeedPageInformationRequestReason int reason, Callback<WebFeedMetadata> callback);
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedMainMenuItem.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedMainMenuItem.java index 673caec..01645cf 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedMainMenuItem.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedMainMenuItem.java
@@ -160,7 +160,7 @@ mChipView = mFollowingChipView; showEnabledChipView(mFollowingChipView, mContext.getText(R.string.menu_following), R.drawable.ic_check_googblue_24dp, (view) -> { - WebFeedBridge.unfollow(webFeedId, + WebFeedBridge.unfollow(webFeedId, /*isDurable=*/false, (result) -> mWebFeedSnackbarController.showSnackbarForUnfollow( result.requestStatus, webFeedId, mUrl, mTitle));
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarController.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarController.java index 9ccf8dc..5700665 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarController.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarController.java
@@ -148,7 +148,7 @@ super.onAction(actionData); FeedServiceBridge.reportOtherUserAction(StreamKind.UNKNOWN, FeedUserActionType.TAPPED_UNFOLLOW_TRY_AGAIN_ON_SNACKBAR); - WebFeedBridge.unfollow(followId, result -> { + WebFeedBridge.unfollow(followId, /*isDurable=*/false, result -> { showSnackbarForUnfollow(result.requestStatus, followId, url, title); }); } @@ -271,7 +271,7 @@ showPostFollowHelp(mPinnedTab, result, mFollowId, mUrl, mTitle); }); } else { - WebFeedBridge.followFromId(mFollowId, + WebFeedBridge.followFromId(mFollowId, /*isDurable=*/false, result -> showPostFollowHelp(mPinnedTab, result, mFollowId, mUrl, mTitle)); } }
diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarControllerTest.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarControllerTest.java index a76fd50..42aea41 100644 --- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarControllerTest.java +++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/webfeed/WebFeedSnackbarControllerTest.java
@@ -365,7 +365,7 @@ verify(mWebFeedBridgeJniMock, description( "FollowFromId should be called on follow try again when ID is available.")) - .followWebFeedById(eq(sFollowId), any()); + .followWebFeedById(eq(sFollowId), /*isDurable=*/eq(false), any()); verify(mFeedServideBridgeJniMock) .reportOtherUserAction( StreamKind.UNKNOWN, FeedUserActionType.TAPPED_FOLLOW_TRY_AGAIN_ON_SNACKBAR); @@ -384,7 +384,7 @@ // Click refollow button. snackbar.getController().onAction(null); verify(mWebFeedBridgeJniMock, description("Follow should be called on refollow.")) - .followWebFeedById(eq(sFollowId), any()); + .followWebFeedById(eq(sFollowId), /*isDurable=*/eq(false), any()); verify(mFeedServideBridgeJniMock) .reportOtherUserAction(StreamKind.UNKNOWN, FeedUserActionType.TAPPED_REFOLLOW_AFTER_UNFOLLOW_ON_SNACKBAR); @@ -404,7 +404,7 @@ snackbar.getController().onAction(null); verify(mWebFeedBridgeJniMock, description("Unfollow should be called on unfollow try again.")) - .unfollowWebFeed(eq(sFollowId), any()); + .unfollowWebFeed(eq(sFollowId), /*isDurable=*/eq(false), any()); verify(mFeedServideBridgeJniMock) .reportOtherUserAction(StreamKind.UNKNOWN, FeedUserActionType.TAPPED_UNFOLLOW_TRY_AGAIN_ON_SNACKBAR);
diff --git a/chrome/browser/feed/android/web_feed_bridge.cc b/chrome/browser/feed/android/web_feed_bridge.cc index 06514b79..cface92 100644 --- a/chrome/browser/feed/android/web_feed_bridge.cc +++ b/chrome/browser/feed/android/web_feed_bridge.cc
@@ -199,6 +199,7 @@ static void JNI_WebFeedBridge_FollowWebFeedById( JNIEnv* env, const base::android::JavaParamRef<jbyteArray>& webFeedId, + jboolean is_durable, const base::android::JavaParamRef<jobject>& j_callback) { WebFeedSubscriptions* subscriptions = GetSubscriptions(); auto callback = @@ -209,13 +210,14 @@ return; } subscriptions->FollowWebFeed(ToNativeWebFeedId(env, webFeedId), - /*is_durable_request=*/false, + /*is_durable_request=*/is_durable, std::move(callback)); } static void JNI_WebFeedBridge_UnfollowWebFeed( JNIEnv* env, const base::android::JavaParamRef<jbyteArray>& webFeedId, + jboolean is_durable, const base::android::JavaParamRef<jobject>& j_callback) { WebFeedSubscriptions* subscriptions = GetSubscriptions(); auto callback = @@ -226,7 +228,7 @@ return; } subscriptions->UnfollowWebFeed(ToNativeWebFeedId(env, webFeedId), - /*is_durable_request=*/false, + /*is_durable_request=*/is_durable, std::move(callback)); }
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc index 2f07ff8..30dfc7e 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.cc
@@ -26,6 +26,16 @@ namespace media_router { namespace { + +// Connect timeout value when opening a Cast socket. +const int kConnectTimeoutInSeconds = 1; + +// Amount of idle time to wait before pinging the Cast device. +const int kPingIntervalInSeconds = 1; + +// Amount of idle time to wait before disconnecting. +const int kLivenessTimeoutInSeconds = 2; + using SinkSource = CastDeviceCountMetrics::SinkSource; using ChannelOpenedCallback = base::OnceCallback<void(bool)>; constexpr char kLoggerComponent[] = "AccessCodeCastSinkService"; @@ -71,11 +81,11 @@ 0.5, // 50% // Maximum delay (in ms) during exponential backoff. - 10 * 1000, // 10 seconds + 1 * 1000, // 1 second // Time to keep an entry from being discarded even when it has no - // significant state, -1 to never discard. (Not applicable.) - -1, + // significant state, -1 to never discard. + 1 * 1000, // 1 second, // False means that initial_delay_ms is the first delay once we start // exponential backoff, i.e., there is no delay after subsequent @@ -259,10 +269,21 @@ mojom::LogCategory::kDiscovery, kLoggerComponent, "Attempting to open a cast channel.", sink.id(), "", ""); cast_media_sink_service_impl_->task_runner()->PostTask( - FROM_HERE, base::BindOnce(&CastMediaSinkServiceImpl::OpenChannel, - base::Unretained(cast_media_sink_service_impl_), - sink, std::move(backoff_entry), - SinkSource::kAccessCode, std::move(callback))); + FROM_HERE, + base::BindOnce(&CastMediaSinkServiceImpl::OpenChannel, + base::Unretained(cast_media_sink_service_impl_), sink, + std::move(backoff_entry), SinkSource::kAccessCode, + std::move(callback), CreateCastSocketOpenParams(sink))); +} + +cast_channel::CastSocketOpenParams +AccessCodeCastSinkService::CreateCastSocketOpenParams( + const MediaSinkInternal& sink) { + return cast_channel::CastSocketOpenParams( + sink.cast_data().ip_endpoint, base::Seconds(kConnectTimeoutInSeconds), + base::Seconds(kLivenessTimeoutInSeconds), + base::Seconds(kPingIntervalInSeconds), + cast_channel::CastDeviceCapability::NONE); } void AccessCodeCastSinkService::Shutdown() {
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h index 87062aeda..65183480 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service.h
@@ -98,6 +98,9 @@ ChannelOpenedCallback callback, bool has_sink); + cast_channel::CastSocketOpenParams CreateCastSocketOpenParams( + const MediaSinkInternal& sink); + // KeyedService. void Shutdown() override;
diff --git a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_unittest.cc b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_unittest.cc index 2c40cf7..3e849ac 100644 --- a/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_unittest.cc +++ b/chrome/browser/media/router/discovery/access_code/access_code_cast_sink_service_unittest.cc
@@ -206,7 +206,7 @@ MediaSinkInternal cast_sink1 = CreateCastSink(1); EXPECT_CALL(*mock_cast_media_sink_service_impl(), - OpenChannel(cast_sink1, _, SinkSource::kAccessCode, _)) + OpenChannel(cast_sink1, _, SinkSource::kAccessCode, _, _)) .Times(0); EXPECT_CALL(mock_callback, Run(true)); access_code_cast_sink_service_->OpenChannelIfNecessary( @@ -230,7 +230,7 @@ .WillOnce(Return(std::vector<MediaRoute>{media_route_cast})); EXPECT_CALL(*router_, TerminateRoute(media_route_cast.media_route_id())); EXPECT_CALL(*mock_cast_media_sink_service_impl(), - OpenChannel(cast_sink1, _, SinkSource::kAccessCode, _)) + OpenChannel(cast_sink1, _, SinkSource::kAccessCode, _, _)) .Times(0); MockBoolCallback mock_callback; @@ -256,7 +256,7 @@ MediaSinkInternal cast_sink1 = CreateCastSink(1); EXPECT_CALL(*mock_cast_media_sink_service_impl(), - OpenChannel(cast_sink1, _, SinkSource::kAccessCode, _)); + OpenChannel(cast_sink1, _, SinkSource::kAccessCode, _, _)); EXPECT_CALL(mock_callback, Run(true)).Times(0); access_code_cast_sink_service_->OpenChannelIfNecessary( cast_sink1, mock_callback.Get(), false);
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc index 0a01bb7..4c62cb0 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
@@ -327,7 +327,8 @@ for (const auto& cast_sink : cast_sinks) { known_ip_endpoints_.insert(cast_sink.cast_data().ip_endpoint); - OpenChannel(cast_sink, nullptr, sink_source, base::DoNothing()); + OpenChannel(cast_sink, nullptr, sink_source, base::DoNothing(), + CreateCastSocketOpenParams(cast_sink)); } StartTimer(); @@ -379,7 +380,7 @@ FROM_HERE, base::BindOnce(&CastMediaSinkServiceImpl::OpenChannel, GetWeakPtr(), sink, nullptr, SinkSource::kConnectionRetryOnError, - base::DoNothing())); + base::DoNothing(), CreateCastSocketOpenParams(sink))); } } @@ -467,7 +468,8 @@ const MediaSinkInternal& cast_sink, std::unique_ptr<net::BackoffEntry> backoff_entry, SinkSource sink_source, - ChannelOpenedCallback callback) { + ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const net::IPEndPoint& ip_endpoint = cast_sink.cast_data().ip_endpoint; @@ -510,8 +512,6 @@ return; } - cast_channel::CastSocketOpenParams open_params = - CreateCastSocketOpenParams(cast_sink); cast_socket_service_->OpenSocket( base::BindRepeating([] { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -521,7 +521,8 @@ open_params, base::BindOnce(&CastMediaSinkServiceImpl::OnChannelOpened, GetWeakPtr(), cast_sink, std::move(backoff_entry), sink_source, - clock_->Now(), std::move(callback))); + clock_->Now(), std::move(callback), + std::move(open_params))); } void CastMediaSinkServiceImpl::OnChannelOpened( @@ -530,6 +531,7 @@ SinkSource sink_source, base::Time start_time, ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params, cast_channel::CastSocket* socket) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(socket); @@ -545,7 +547,7 @@ } else { OnChannelErrorMayRetry(cast_sink, std::move(backoff_entry), socket->error_state(), sink_source, - std::move(callback)); + std::move(callback), std::move(open_params)); } } @@ -554,7 +556,8 @@ std::unique_ptr<net::BackoffEntry> backoff_entry, cast_channel::ChannelError error_state, SinkSource sink_source, - ChannelOpenedCallback callback) { + ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); const MediaSink::Id& sink_id = cast_sink.sink().id(); @@ -580,7 +583,7 @@ FROM_HERE, base::BindOnce(&CastMediaSinkServiceImpl::OpenChannel, GetWeakPtr(), cast_sink, std::move(backoff_entry), sink_source, - std::move(callback)), + std::move(callback), std::move(open_params)), delay); } @@ -704,7 +707,8 @@ return; } - OpenChannel(sink, nullptr, SinkSource::kDial, base::DoNothing()); + OpenChannel(sink, nullptr, SinkSource::kDial, base::DoNothing(), + CreateCastSocketOpenParams(sink)); } bool CastMediaSinkServiceImpl::IsProbablyNonCastDevice(
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h index c5e9c67..2482089 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h
@@ -107,10 +107,13 @@ // |cast_sink|: Cast sink created from mDNS service description or DIAL sink. // |backoff_entry|: backoff entry passed to |OnChannelOpened| callback. // |callback|: Callback that keeps track of the channel opening status. + // |open_params|: Holds parameters necessary to open a Cast channel + // (CastSocket) to a Cast device. virtual void OpenChannel(const MediaSinkInternal& cast_sink, std::unique_ptr<net::BackoffEntry> backoff_entry, SinkSource sink_source, - ChannelOpenedCallback callback); + ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params); // Check to see if the given cast sink exists the sinks_. bool HasSink(const MediaSink::Id& sink_id); @@ -257,11 +260,14 @@ // ownership of |socket|. // |callback|: Callback passed from OpenChannel that keeps track of the // channel opening status. + // |open_params|: Holds parameters necessary to open a Cast channel + // (CastSocket) to a Cast device. void OnChannelOpened(const MediaSinkInternal& cast_sink, std::unique_ptr<net::BackoffEntry> backoff_entry, SinkSource sink_source, base::Time start_time, ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params, cast_channel::CastSocket* socket); // Invoked by |OnChannelOpened| if opening cast channel failed. It will retry @@ -275,11 +281,14 @@ // |error_state|: error encountered when opending cast channel. // |callback|: Callback passed from OpenChannel that keeps track of the // channel opening status. + // |open_params|: Holds parameters necessary to open a Cast channel + // (CastSocket) to a Cast device. void OnChannelErrorMayRetry(MediaSinkInternal cast_sink, std::unique_ptr<net::BackoffEntry> backoff_entry, cast_channel::ChannelError error_state, SinkSource sink_source, - ChannelOpenedCallback callback); + ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params); // Invoked when opening cast channel succeeds. // |cast_sink|: Cast sink created from mDNS service description, DIAL sink, or
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc index d822a75..38419c8 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc
@@ -297,13 +297,15 @@ EXPECT_CALL(*mock_cast_socket_service_, OpenSocket_(ip_endpoint, _)).Times(1); media_sink_service_impl_.OpenChannel( cast_sink, nullptr, CastMediaSinkServiceImpl::SinkSource::kMdns, - base::DoNothing()); + base::DoNothing(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink)); // One pending sink, the same as |cast_sink| EXPECT_CALL(*mock_cast_socket_service_, OpenSocket_(ip_endpoint, _)).Times(0); media_sink_service_impl_.OpenChannel( cast_sink, nullptr, CastMediaSinkServiceImpl::SinkSource::kMdns, - base::DoNothing()); + base::DoNothing(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink)); } TEST_P(CastMediaSinkServiceImplTest, TestOpenChannelRetryOnce) { @@ -325,7 +327,8 @@ media_sink_service_impl_.OpenChannel( cast_sink, std::move(backoff_entry), - CastMediaSinkServiceImpl::SinkSource::kMdns, mock_callback.Get()); + CastMediaSinkServiceImpl::SinkSource::kMdns, mock_callback.Get(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink)); socket.SetErrorState(cast_channel::ChannelError::NONE); ExpectOpenSocket(&socket); @@ -345,7 +348,8 @@ .WillRepeatedly(base::test::RunOnceCallback<1>(&socket)); media_sink_service_impl_.OpenChannel( cast_sink, nullptr, CastMediaSinkServiceImpl::SinkSource::kMdns, - base::DoNothing()); + base::DoNothing(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink)); mock_time_task_runner_->FastForwardUntilNoTasksRemain(); EXPECT_EQ(4, @@ -388,7 +392,9 @@ EXPECT_CALL(observer_, OnSinkAddedOrUpdated(cast_sink2)); media_sink_service_impl_.OnChannelOpened( cast_sink2, nullptr, CastMediaSinkServiceImpl::SinkSource::kMdns, - start_time, mock_callback.Get(), &socket2); + start_time, mock_callback.Get(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink2), + &socket2); tester.ExpectUniqueSample(CastAnalytics::kHistogramCastMdnsChannelOpenSuccess, delta.InMilliseconds(), 1); @@ -412,11 +418,15 @@ EXPECT_CALL(observer_, OnSinkAddedOrUpdated(cast_sink1)); media_sink_service_impl_.OnChannelOpened( cast_sink1, nullptr, CastMediaSinkServiceImpl::SinkSource::kMdns, - start_time, mock_callback.Get(), &socket1); + start_time, mock_callback.Get(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink1), + &socket1); EXPECT_CALL(observer_, OnSinkAddedOrUpdated(cast_sink3)); media_sink_service_impl_.OnChannelOpened( cast_sink3, nullptr, CastMediaSinkServiceImpl::SinkSource::kMdns, - start_time, mock_callback.Get(), &socket3); + start_time, mock_callback.Get(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink3), + &socket3); EXPECT_TRUE(mock_timer_->IsRunning()); EXPECT_CALL(mock_sink_discovered_cb_, @@ -1422,7 +1432,8 @@ ExpectOpenSocket(&socket); media_sink_service_impl_.OpenChannel( cast_sink, nullptr, CastMediaSinkServiceImpl::SinkSource::kAccessCode, - base::DoNothing()); + base::DoNothing(), + media_sink_service_impl_.CreateCastSocketOpenParams(cast_sink)); // Simulate channel is successfully opened. EXPECT_CALL(observer_, OnSinkAddedOrUpdated(cast_sink));
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h index 91739b4..48226fc 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_test_helpers.h
@@ -58,7 +58,8 @@ (const MediaSinkInternal& cast_sink, std::unique_ptr<net::BackoffEntry> backoff_entry, SinkSource sink_source, - base::OnceCallback<void(bool)> callback), + ChannelOpenedCallback callback, + cast_channel::CastSocketOpenParams open_params), (override)); OnSinksDiscoveredCallback sinks_discovered_cb() {
diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc index 61d0a92..dd7756e6 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc
@@ -147,7 +147,7 @@ std::move(storage_policy), /* quota_manager_proxy=*/nullptr, std::move(additional_providers), std::vector<storage::URLRequestAutoMountHandler>(), data_dir_.GetPath(), - storage::CreateAllowFileAccessOptions()); + data_dir_.GetPath(), storage::CreateAllowFileAccessOptions()); filesystem_ = isolated_context()->RegisterFileSystemForPath( storage::kFileSystemTypeLocalMedia, std::string(), root_path(),
diff --git a/chrome/browser/metrics/per_user_state_manager_chromeos.cc b/chrome/browser/metrics/per_user_state_manager_chromeos.cc index 91132f4..f596d8ea 100644 --- a/chrome/browser/metrics/per_user_state_manager_chromeos.cc +++ b/chrome/browser/metrics/per_user_state_manager_chromeos.cc
@@ -301,7 +301,11 @@ } void PerUserStateManagerChromeOS::ActiveUserChanged(user_manager::User* user) { - DCHECK_EQ(state_, State::CONSTRUCTED) << "User already detected."; + // Logged-in user is already detected. Do nothing since multi-user is + // deprecated and since the first user is the primary user. + if (state_ > State::CONSTRUCTED) { + return; + } state_ = State::USER_LOGIN;
diff --git a/chrome/browser/metrics/per_user_state_manager_chromeos_unittest.cc b/chrome/browser/metrics/per_user_state_manager_chromeos_unittest.cc index 92f1a18..1079381 100644 --- a/chrome/browser/metrics/per_user_state_manager_chromeos_unittest.cc +++ b/chrome/browser/metrics/per_user_state_manager_chromeos_unittest.cc
@@ -405,4 +405,78 @@ EXPECT_TRUE(GetPerUserStateManager()->is_log_store_set()); } +// Multi-user sessions are deprecated, but still need to be supported. This test +// ensures that the primary user (user originally used to login) is used and all +// other users are ignored. +TEST_F(PerUserStateManagerChromeOSTest, MultiUserUsesPrimaryUser) { + auto* test_user1 = + RegisterUser(AccountId::FromUserEmailGaiaId("test1@example.com", "1")); + InitializeProfileState(/*user_id=*/"", /*metrics_consent=*/false, + /*has_consented_to_metrics=*/true); + GetPerUserStateManager()->SetIsManaged(false); + GetPerUserStateManager()->SetDeviceMetricsConsent(true); + + // Simulate user login. + LoginRegularUser(test_user1); + + // User log store is created async. Ensure that the log store loading + // finishes. + RunUntilIdle(); + + GetPerUserStateManager()->SetCurrentUserMetricsConsent(true); + + // User consent should be set to true since pref is true and device metrics + // consent is also true. + EXPECT_TRUE( + *GetPerUserStateManager()->GetCurrentUserReportingConsentIfApplicable()); + + EXPECT_TRUE(GetPerUserStateManager()->is_log_store_set()); + + // Create secondary user. + TestingProfile::Builder profile_builder; + sync_preferences::PrefServiceMockFactory factory; + auto registry = base::MakeRefCounted<user_prefs::PrefRegistrySyncable>(); + RegisterUserProfilePrefs(registry.get()); + std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs( + factory.CreateSyncable(registry.get())); + profile_builder.SetPrefService(std::move(prefs)); + auto test_user2_profile = profile_builder.Build(); + AccountId test_user2_account_id = + AccountId::FromUserEmailGaiaId("test2@example.com", "2"); + + // Add user. + user_manager::User* test_user2 = + test_user_manager_->AddUserWithAffiliationAndTypeAndProfile( + test_user2_account_id, false, user_manager::USER_TYPE_REGULAR, + test_user2_profile.get()); + + // Explicitly set the user consent to false. + test_user2_profile->GetPrefs()->SetBoolean(prefs::kMetricsUserConsent, false); + + // Simulate user login. + LoginRegularUser(test_user2); + + // User log store is created async. Ensure that the log store loading + // finishes. + RunUntilIdle(); + + // User consent should still be true since that's the value of the primary + // user. + EXPECT_TRUE( + *GetPerUserStateManager()->GetCurrentUserReportingConsentIfApplicable()); + EXPECT_TRUE(GetPerUserStateManager()->is_log_store_set()); + + // Enable user2's metrics consent and disable it. + test_user2_profile->GetPrefs()->SetBoolean(prefs::kMetricsUserConsent, true); + test_user2_profile->GetPrefs()->SetBoolean(prefs::kMetricsUserConsent, false); + + // User consent should still be true since that's the value of the primary + // user. + EXPECT_TRUE( + *GetPerUserStateManager()->GetCurrentUserReportingConsentIfApplicable()); + + // Profiles must be destructed on the UI thread. + test_user2_profile.reset(); +} + } // namespace metrics
diff --git a/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc b/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc index 3563752..4bf2462 100644 --- a/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc +++ b/chrome/browser/optimization_guide/page_content_annotations_service_browsertest.cc
@@ -161,6 +161,120 @@ browser()->profile())); } +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +class PageContentAnnotationsServicePageTopicsBrowserTest + : public InProcessBrowserTest { + public: + PageContentAnnotationsServicePageTopicsBrowserTest() { + scoped_feature_list_.InitWithFeatures( + {features::kOptimizationHints, features::kPageContentAnnotations}, {}); + } + ~PageContentAnnotationsServicePageTopicsBrowserTest() override = default; + + void LoadModel() { + proto::Any any_metadata; + any_metadata.set_type_url( + "type.googleapis.com/com.foo.PageTopicsModelMetadata"); + proto::PageTopicsModelMetadata page_topics_model_metadata; + page_topics_model_metadata.set_version(123); + page_topics_model_metadata.add_supported_output( + proto::PAGE_TOPICS_SUPPORTED_OUTPUT_CATEGORIES); + auto* output_params = + page_topics_model_metadata.mutable_output_postprocessing_params(); + auto* category_params = output_params->mutable_category_params(); + category_params->set_max_categories(5); + category_params->set_min_none_weight(0.8); + category_params->set_min_category_weight(0.1); + category_params->set_min_normalized_weight_within_top_n(0.1); + page_topics_model_metadata.SerializeToString(any_metadata.mutable_value()); + base::FilePath source_root_dir; + base::PathService::Get(base::DIR_SOURCE_ROOT, &source_root_dir); + base::FilePath model_file_path = + source_root_dir.AppendASCII("components") + .AppendASCII("test") + .AppendASCII("data") + .AppendASCII("optimization_guide") + .AppendASCII("page_topics_128_model.tflite"); + + base::HistogramTester histogram_tester; + + OptimizationGuideKeyedServiceFactory::GetForProfile(browser()->profile()) + ->OverrideTargetModelForTesting( + proto::OPTIMIZATION_TARGET_PAGE_TOPICS_V2, + optimization_guide::TestModelInfoBuilder() + .SetModelFilePath(model_file_path) + .SetModelMetadata(any_metadata) + .Build()); + + RetryForHistogramUntilCountReached( + &histogram_tester, + "OptimizationGuide.ModelExecutor.ModelFileUpdated.PageTopicsV2", 1); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(PageContentAnnotationsServicePageTopicsBrowserTest, + E2EWithGoldenTestData) { + PageContentAnnotationsService* service = + PageContentAnnotationsServiceFactory::GetForProfile(browser()->profile()); + ASSERT_TRUE(service); + + service->RequestAndNotifyWhenModelAvailable(AnnotationType::kPageTopics, + base::DoNothing()); + + LoadModel(); + + std::vector<BatchAnnotationResult> results; + base::RunLoop run_loop; + service->BatchAnnotatePageTopics( + base::BindOnce( + [](base::RunLoop* run_loop, + std::vector<BatchAnnotationResult>* out_results, + const std::vector<BatchAnnotationResult>& results) { + *out_results = results; + run_loop->Quit(); + }, + &run_loop, &results), + std::vector<GURL>{ + GURL("https://www.youtube.com/"), + GURL("https://www.chrome.com/"), + GURL("https://music.youtube.com/"), + }); + run_loop.Run(); + + ASSERT_EQ(results.size(), 3U); + + EXPECT_EQ(results[0].input(), "youtube com"); + EXPECT_EQ(results[0].type(), AnnotationType::kPageTopics); + ASSERT_TRUE(results[0].topics()); + EXPECT_THAT(*results[0].topics(), testing::ElementsAreArray({ + WeightedIdentifier(250, 0.601997), + WeightedIdentifier(43, 0.915914), + })); + + EXPECT_EQ(results[1].input(), "chrome com"); + EXPECT_EQ(results[1].type(), AnnotationType::kPageTopics); + ASSERT_TRUE(results[1].topics()); + EXPECT_THAT(*results[1].topics(), testing::ElementsAreArray({ + WeightedIdentifier(223, 0.209933), + WeightedIdentifier(43, 0.474946), + WeightedIdentifier(148, 0.881723), + })); + + EXPECT_EQ(results[2].input(), "music youtube com"); + EXPECT_EQ(results[2].type(), AnnotationType::kPageTopics); + ASSERT_TRUE(results[2].topics()); + EXPECT_THAT(*results[2].topics(), testing::ElementsAreArray({ + WeightedIdentifier(250, 0.450154), + WeightedIdentifier(1, 0.518014), + WeightedIdentifier(43, 0.596481), + WeightedIdentifier(23, 0.827426), + })); +} +#endif + class PageContentAnnotationsServiceBrowserTest : public InProcessBrowserTest { public: PageContentAnnotationsServiceBrowserTest() {
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 40a0206a..626ceb68 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -423,15 +423,16 @@ #endif } -void ChromePasswordManagerClient::ShowTouchToFill(PasswordManagerDriver* driver, - bool trigger_submission) { +void ChromePasswordManagerClient::ShowTouchToFill( + PasswordManagerDriver* driver, + autofill::mojom::SubmissionReadinessState submission_readiness) { #if BUILDFLAG(IS_ANDROID) GetOrCreateTouchToFillController()->Show( credential_cache_ .GetCredentialStore(url::Origin::Create( driver->GetLastCommittedURL().DeprecatedGetOriginAsURL())) .GetCredentials(), - driver->AsWeakPtr(), trigger_submission); + driver->AsWeakPtr(), submission_readiness); #endif }
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h index 296cda6..68aa164 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.h +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -124,8 +124,9 @@ std::vector<std::unique_ptr<password_manager::PasswordForm>> local_forms, const url::Origin& origin, CredentialsCallback callback) override; - void ShowTouchToFill(password_manager::PasswordManagerDriver* driver, - bool trigger_submission) override; + void ShowTouchToFill( + password_manager::PasswordManagerDriver* driver, + autofill::mojom::SubmissionReadinessState submission_readiness) override; #if BUILDFLAG(IS_ANDROID) // Notifies `PasswordReuseDetectionManager` about passwords selected from
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc index 5ed9255..6f3c8a6 100644 --- a/chrome/browser/password_manager/password_manager_browsertest.cc +++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -4324,7 +4324,10 @@ int options, const gfx::RectF& bounds), (override)); - MOCK_METHOD(void, ShowTouchToFill, (bool), (override)); + MOCK_METHOD(void, + ShowTouchToFill, + (autofill::mojom::SubmissionReadinessState), + (override)); MOCK_METHOD(void, CheckSafeBrowsingReputation, (const GURL& form_action, const GURL& frame_url), @@ -4391,8 +4394,9 @@ options, bounds); }); ON_CALL(*this, ShowTouchToFill) - .WillByDefault([this](bool trigger_submission) { - impl_->ShowTouchToFill(trigger_submission); + .WillByDefault([this](autofill::mojom::SubmissionReadinessState + submission_readiness) { + impl_->ShowTouchToFill(submission_readiness); }); ON_CALL(*this, CheckSafeBrowsingReputation) .WillByDefault([this](const GURL& form_action, const GURL& frame_url) {
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java index 2df6be5..d8aec50 100644 --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
@@ -344,8 +344,8 @@ public static final String FIRST_RUN_FLOW_COMPLETE = "first_run_flow"; public static final String FIRST_RUN_FLOW_SIGNIN_ACCOUNT_NAME = "first_run_signin_account_name"; public static final String FIRST_RUN_FLOW_SIGNIN_COMPLETE = "first_run_signin_complete"; - // Needed by ChromeBackupAgent public static final String FIRST_RUN_FLOW_SIGNIN_SETUP = "first_run_signin_setup"; + // Needed by ChromeBackupAgent public static final String FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE = "lightweight_first_run_flow"; public static final String FIRST_RUN_SKIP_WELCOME_PAGE = "skip_welcome_page"; public static final String FIRST_RUN_SKIPPED_BY_POLICY = "Chrome.FirstRun.SkippedByPolicy";
diff --git a/chrome/browser/printing/print_browsertest.cc b/chrome/browser/printing/print_browsertest.cc index 5bb0969..22e1b1e 100644 --- a/chrome/browser/printing/print_browsertest.cc +++ b/chrome/browser/printing/print_browsertest.cc
@@ -49,6 +49,7 @@ #include "content/public/browser/global_routing_id.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" +#include "content/public/browser/web_contents_observer.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h" @@ -463,6 +464,34 @@ mojo::AssociatedReceiver<mojom::PrintRenderFrame> receiver_{this}; }; +// Wrapper around `SetPrintingEnabledInterceptor` that performs the interception +// for the first subframe created. +class SubframeSetPrintingEnabledInterceptor + : public content::WebContentsObserver { + public: + explicit SubframeSetPrintingEnabledInterceptor( + content::WebContents* web_contents) + : WebContentsObserver(web_contents) {} + ~SubframeSetPrintingEnabledInterceptor() override = default; + + // content::WebContentsObserver: + void RenderFrameCreated( + content::RenderFrameHost* render_frame_host) override { + if (intercepting_) + return; + + intercepting_ = true; + interceptor_.OverrideBinderForTesting(render_frame_host); + } + + bool intercepting() const { return intercepting_; } + SetPrintingEnabledInterceptor& interceptor() { return interceptor_; } + + private: + bool intercepting_ = false; + SetPrintingEnabledInterceptor interceptor_; +}; + } // namespace class TestPrintViewManager : public PrintViewManager { @@ -1748,6 +1777,39 @@ print_preview_observer.WaitUntilPreviewIsReady(); } +IN_PROC_BROWSER_TEST_F(PrintBrowserTest, NoExtraSetPrintingEnabledCalls) { + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + + SetPrintingEnabledInterceptor main_frame_interceptor; + main_frame_interceptor.OverrideBinderForTesting(web_contents->GetMainFrame()); + + // Clear `print_render_frames_` to use the overridden binder. + auto* print_view_manager = + TestPrintViewManager::FromWebContents(web_contents); + ASSERT_TRUE(print_view_manager); + print_view_manager->ClearPrintRenderFramesForTesting(); + + // SetPrintingEnabled() should be called only once per navigation. + EXPECT_CALL(main_frame_interceptor, SetPrintingEnabled(_)).Times(2); + + // Navigate to an initial page. + const GURL kDomainAUrl( + embedded_test_server()->GetURL("a.com", "/printing/test1.html")); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), kDomainAUrl)); + + // Navigate to a different site to a page with iframes. The subframe for the + // `kDomainAUrl` page should not ever get a SetPrintingEnabled() call. + SubframeSetPrintingEnabledInterceptor subframe_interceptor(web_contents); + EXPECT_CALL(subframe_interceptor.interceptor(), SetPrintingEnabled(_)) + .Times(0); + + const GURL kDomainBUrl(embedded_test_server()->GetURL( + "b.com", "/printing/content_with_same_site_iframe.html")); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), kDomainBUrl)); + EXPECT_TRUE(subframe_interceptor.intercepting()); +} + class PrintPrerenderBrowserTest : public PrintBrowserTest { public: PrintPrerenderBrowserTest() @@ -1858,8 +1920,9 @@ prerender_helper_.GetPrerenderedMainFrameHost(host_id); SetPrintingEnabledInterceptor prerendered_interceptor; prerendered_interceptor.OverrideBinderForTesting(prerender_rfh); - // SetPrintingEnabled() is only called once by activating the prerender. - EXPECT_CALL(prerendered_interceptor, SetPrintingEnabled(_)).Times(1); + // SetPrintingEnabled() is not called when prerendering HTML (non-PDF) + // content. + EXPECT_CALL(prerendered_interceptor, SetPrintingEnabled(_)).Times(0); // Trigger to call PrintViewManagerBase::UpdatePrintingEnabled() to check if // SetPrintingEnabled() is not called in prerendering.
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc index 3e71a3f6..1f37c11 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -716,8 +716,10 @@ content::RenderFrameHost* render_frame_host, content::RenderFrameHost::LifecycleState /*old_state*/, content::RenderFrameHost::LifecycleState new_state) { - if (new_state == content::RenderFrameHost::LifecycleState::kActive) + if (new_state == content::RenderFrameHost::LifecycleState::kActive && + render_frame_host->GetProcess()->IsPdf()) { SendPrintingEnabled(printing_enabled_.GetValue(), render_frame_host); + } } void PrintViewManagerBase::DidStartLoading() {
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/ad_personalization_preference.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/ad_personalization_preference.xml index a161fd0..a80db9c 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/xml/ad_personalization_preference.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/xml/ad_personalization_preference.xml
@@ -7,7 +7,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> <org.chromium.components.browser_ui.settings.LongSummaryTextMessagePreference - android:summary="@string/privacy_sandbox_ad_personalization_description" + android:key="ad_personalization_description" android:selectable="false" app:allowDividerBelow="false" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/spam_fraud_preference.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/spam_fraud_preference.xml index ace5ada..d93e04f 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/xml/spam_fraud_preference.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/xml/spam_fraud_preference.xml
@@ -7,7 +7,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> <org.chromium.components.browser_ui.settings.LongSummaryTextMessagePreference - android:summary="@string/privacy_sandbox_spam_fraud_description" + android:key="spam_fraud_description" app:allowDividerBelow="false"/> </PreferenceScreen>
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java index 9490e52b..423f54f 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java
@@ -18,7 +18,7 @@ * Settings fragment for privacy sandbox settings. */ public class AdMeasurementFragment extends PreferenceFragmentCompat { - public static final String AD_MEASUREMENT_DESCRIPTION = "ad_measurement_description"; + private static final String AD_MEASUREMENT_DESCRIPTION = "ad_measurement_description"; private Runnable mOpenHistoryRunnable; /** @@ -30,10 +30,13 @@ SettingsUtils.addPreferencesFromResource(this, R.xml.ad_measurement_preference); ChromeBasePreference descriptionPreference = findPreference(AD_MEASUREMENT_DESCRIPTION); - descriptionPreference.setSummary(SpanApplier.applySpans( - getResources().getString(R.string.privacy_sandbox_ad_measurement_description), - new SpanApplier.SpanInfo("<link>", "</link>", - new NoUnderlineClickableSpan(getContext(), this::showHistory)))); + int description = PrivacySandboxBridge.isPrivacySandboxEnabled() + ? R.string.privacy_sandbox_ad_measurement_description_trials_on + : R.string.privacy_sandbox_ad_measurement_description_trials_off; + descriptionPreference.setSummary( + SpanApplier.applySpans(getResources().getString(description), + new SpanApplier.SpanInfo("<link>", "</link>", + new NoUnderlineClickableSpan(getContext(), this::showHistory)))); } /**
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdPersonalizationFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdPersonalizationFragment.java index 10ed4cb4..d11057a 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdPersonalizationFragment.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdPersonalizationFragment.java
@@ -27,6 +27,7 @@ */ public class AdPersonalizationFragment extends PreferenceFragmentCompat implements Preference.OnPreferenceClickListener { + private static final String AD_PERSONALIZATION_DESCRIPTION = "ad_personalization_description"; private static final String TOPICS_CATEGORY_PREFERENCE = "topic_interests"; private static final String EMPTY_TOPICS_PREFERENCE = "empty_topics"; private static final String REMOVE_TOPICS_PREFERENCE = "removed_topics"; @@ -36,6 +37,7 @@ private PreferenceCategory mTopicsCategory; private Preference mEmptyTopicsPreference; private Preference mRemoveTopicsPreference; + private Preference mDescriptionPreference; public void setSnackbarManager(SnackbarManager snackbarManager) { mSnackbarManager = snackbarManager; @@ -47,8 +49,10 @@ @Override public void onCreatePreferences(Bundle bundle, String s) { getActivity().setTitle(R.string.privacy_sandbox_ad_personalization_title); - SettingsUtils.addPreferencesFromResource(this, R.xml.ad_personalization_preference); + + mDescriptionPreference = findPreference(AD_PERSONALIZATION_DESCRIPTION); + assert mDescriptionPreference != null; mTopicsCategory = findPreference(TOPICS_CATEGORY_PREFERENCE); assert mTopicsCategory != null; mEmptyTopicsPreference = findPreference(EMPTY_TOPICS_PREFERENCE); @@ -76,6 +80,13 @@ List<Topic> currentTopics = PrivacySandboxBridge.getCurrentTopTopics(); List<Topic> blockedTopics = PrivacySandboxBridge.getBlockedTopics(); + int description = PrivacySandboxBridge.isPrivacySandboxEnabled() + ? (!currentTopics.isEmpty() + ? R.string.privacy_sandbox_ad_personalization_description_trials_on + : R.string.privacy_sandbox_ad_personalization_description_no_items) + : R.string.privacy_sandbox_ad_personalization_description_trials_off; + mDescriptionPreference.setSummary(description); + mTopicsCategory.removeAll(); for (Topic topic : currentTopics) { TopicPreference preference = new TopicPreference(getContext(), topic);
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/SpamFraudFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/SpamFraudFragment.java index f91fb30..f53721e 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/SpamFraudFragment.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/SpamFraudFragment.java
@@ -14,6 +14,8 @@ * Settings fragment for privacy sandbox settings. */ public class SpamFraudFragment extends PreferenceFragmentCompat { + private static final String SPAM_FRAUD_DESCRIPTION = "spam_fraud_description"; + /** * Initializes all the objects related to the preferences page. */ @@ -21,5 +23,9 @@ public void onCreatePreferences(Bundle bundle, String s) { getActivity().setTitle(R.string.privacy_sandbox_spam_fraud_title); SettingsUtils.addPreferencesFromResource(this, R.xml.spam_fraud_preference); + int description = PrivacySandboxBridge.isPrivacySandboxEnabled() + ? R.string.privacy_sandbox_spam_fraud_description_trials_on + : R.string.privacy_sandbox_spam_fraud_description_trials_off; + findPreference(SPAM_FRAUD_DESCRIPTION).setSummary(description); } }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV3Test.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV3Test.java index 095880eb..ff50d18 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV3Test.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV3Test.java
@@ -21,6 +21,7 @@ import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -58,6 +59,7 @@ import org.chromium.content_public.browser.test.NativeLibraryTestUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.test.util.RenderTestRule; +import org.chromium.ui.test.util.ViewUtils; import java.io.IOException; @@ -116,6 +118,7 @@ fragmentArgs.putInt(PrivacySandboxSettingsFragment.PRIVACY_SANDBOX_REFERRER, PrivacySandboxReferrer.PRIVACY_SETTINGS); mSettingsActivityTestRule.startSettingsActivity(fragmentArgs); + ViewUtils.onViewWaiting(withText(R.string.privacy_sandbox_trials_title)); } private View getRootView(@StringRes int text) { @@ -190,7 +193,8 @@ public void testRenderSpamFraudView() throws IOException { openPrivacySandboxSettings(); onView(withText(R.string.privacy_sandbox_spam_fraud_title)).perform(click()); - mRenderTestRule.render(getRootView(R.string.privacy_sandbox_spam_fraud_description), + mRenderTestRule.render( + getRootView(R.string.privacy_sandbox_spam_fraud_description_trials_on), "privacy_sandbox_spam_fraud_view"); } @@ -198,12 +202,12 @@ @SmallTest public void testMainSettingsView() throws IOException { openPrivacySandboxSettings(); - assertTrue(PrivacySandboxBridge.isPrivacySandboxEnabled()); + assertTrue("Enabled initially", PrivacySandboxBridge.isPrivacySandboxEnabled()); // Toggle sandbox settings. onView(withText(R.string.privacy_sandbox_trials_title)).perform(click()); - assertFalse(PrivacySandboxBridge.isPrivacySandboxEnabled()); + assertFalse("Then disabled", PrivacySandboxBridge.isPrivacySandboxEnabled()); onView(withText(R.string.privacy_sandbox_trials_title)).perform(click()); - assertTrue(PrivacySandboxBridge.isPrivacySandboxEnabled()); + assertTrue("And enabled again", PrivacySandboxBridge.isPrivacySandboxEnabled()); } @Test @@ -214,6 +218,8 @@ onView(withText(R.string.privacy_sandbox_ad_personalization_title)).perform(click()); onView(withText(R.string.privacy_sandbox_remove_interest_title)) .check(matches(isDisplayed())); + onView(withText(R.string.privacy_sandbox_ad_personalization_description_trials_on)) + .check(matches(isDisplayed())); onView(withText(R.string.privacy_sandbox_topic_empty_state)).check(doesNotExist()); clickImageButtonNextToText("Foo"); @@ -238,12 +244,61 @@ mFakePrivacySandboxBridge.setBlockedTopics(); openPrivacySandboxSettings(); onView(withText(R.string.privacy_sandbox_ad_personalization_title)).perform(click()); + onView(withText(R.string.privacy_sandbox_ad_personalization_description_no_items)) + .check(matches(isDisplayed())); onView(withText(R.string.privacy_sandbox_remove_interest_title)).check(doesNotExist()); onView(withText(R.string.privacy_sandbox_topic_empty_state)).check(matches(isDisplayed())); } @Test @SmallTest + public void testAdPersonalizationEmptyViewTrialsOff() throws IOException { + PrivacySandboxBridge.setPrivacySandboxEnabled(false); + openPrivacySandboxSettings(); + onView(withText(R.string.privacy_sandbox_ad_personalization_title)).perform(click()); + onView(withText(R.string.privacy_sandbox_ad_personalization_description_trials_off)) + .check(matches(isDisplayed())); + } + + @Test + @SmallTest + public void testAdMeasurementView() { + openPrivacySandboxSettings(); + onView(withText(R.string.privacy_sandbox_ad_measurement_title)).perform(click()); + onView(withText(startsWith("Ad measurement allows sites"))).check(matches(isDisplayed())); + } + + @Test + @SmallTest + public void testAdMeasurementViewTrialsOff() { + PrivacySandboxBridge.setPrivacySandboxEnabled(false); + openPrivacySandboxSettings(); + onView(withText(R.string.privacy_sandbox_ad_measurement_title)).perform(click()); + onView(withText(startsWith("When trials are on, Ad measurement allows"))) + .check(matches(isDisplayed())); + } + + @Test + @SmallTest + public void testSpamFraudView() { + openPrivacySandboxSettings(); + onView(withText(R.string.privacy_sandbox_spam_fraud_title)).perform(click()); + onView(withText(R.string.privacy_sandbox_spam_fraud_description_trials_on)) + .check(matches(isDisplayed())); + } + + @Test + @SmallTest + public void testSpamFraudViewTrialsOff() { + PrivacySandboxBridge.setPrivacySandboxEnabled(false); + openPrivacySandboxSettings(); + onView(withText(R.string.privacy_sandbox_spam_fraud_title)).perform(click()); + onView(withText(R.string.privacy_sandbox_spam_fraud_description_trials_off)) + .check(matches(isDisplayed())); + } + + @Test + @SmallTest public void testRemovedInterestsView() throws IOException { mUserActionTester = new UserActionTester(); openPrivacySandboxSettings();
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/autoclick/autoclick_test.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/autoclick/autoclick_test.js index d41edb6..50bb42e 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/autoclick/autoclick_test.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/autoclick/autoclick_test.js
@@ -11,22 +11,30 @@ AutoclickE2ETest = class extends E2ETestBase { constructor() { super(); + this.navigateLacrosWithAutoComplete = true; + } + + async setUpDeferred() { this.mockAccessibilityPrivate = MockAccessibilityPrivate; chrome.accessibilityPrivate = this.mockAccessibilityPrivate; window.RoleType = chrome.automation.RoleType; + const module = + await import('/accessibility_common/accessibility_common_loader.js'); + // Re-initialize AccessibilityCommon with mock AccessibilityPrivate API. - const reinit = module => { - accessibilityCommon = new module.AccessibilityCommon(); + accessibilityCommon = new module.AccessibilityCommon(); + + await new Promise(r => { chrome.accessibilityFeatures.autoclick.get({}, () => { // Turn off focus ring blinking for test after autoclick is initialized. accessibilityCommon.getAutoclickForTest().setNoBlinkFocusRingsForTest(); + r(); }); - }; + }); -// TODO: Clang-format does this and below wrong. -import('/accessibility_common/accessibility_common_loader.js').then(reinit); + await super.setUpDeferred(); } /** @override */ @@ -62,26 +70,32 @@ } }; -TEST_F('AutoclickE2ETest', 'HighlightsRootWebAreaIfNotScrollable', function() { - this.runWithLoadedTree( - 'data:text/html;charset=utf-8,<p>Cats rock!</p>', async function(root) { - const node = root.find( - {role: RoleType.STATIC_TEXT, attributes: {name: 'Cats rock!'}}); - await new Promise(resolve => { - this.mockAccessibilityPrivate.callOnScrollableBoundsForPointRequested( - // Offset slightly into the node to ensure the hittest - // happens within the node. - node.location.left + 1, node.location.top + 1, resolve); - }); - const expected = node.root.location; - const focusRings = this.mockAccessibilityPrivate.getFocusRings(); - this.assertSameRect( - this.mockAccessibilityPrivate.getScrollableBounds(), expected); - this.assertSameRect(focusRings[0].rects[0], expected); - }); -}); +// Test is flaky: https://crbug.com/1306728 +TEST_F( + 'AutoclickE2ETest', 'DISABLED_HighlightsRootWebAreaIfNotScrollable', + function() { + this.runWithLoadedTree( + 'data:text/html;charset=utf-8,<p>Cats rock!</p>', + async function(root) { + const node = root.find( + {role: RoleType.STATIC_TEXT, attributes: {name: 'Cats rock!'}}); + await new Promise(resolve => { + this.mockAccessibilityPrivate + .callOnScrollableBoundsForPointRequested( + // Offset slightly into the node to ensure the hittest + // happens within the node. + node.location.left + 1, node.location.top + 1, resolve); + }); + const expected = node.root.location; + const focusRings = this.mockAccessibilityPrivate.getFocusRings(); + this.assertSameRect( + this.mockAccessibilityPrivate.getScrollableBounds(), expected); + this.assertSameRect(focusRings[0].rects[0], expected); + }); + }); -TEST_F('AutoclickE2ETest', 'HighlightsScrollableDiv', function() { +// Test is flaky: https://crbug.com/1306728 +TEST_F('AutoclickE2ETest', 'DISABLED_HighlightsScrollableDiv', function() { this.runWithLoadedTree( 'data:text/html;charset=utf-8,' + '<div style="width:100px;height:100px;overflow:scroll">' + @@ -109,7 +123,8 @@ }); }); -TEST_F('AutoclickE2ETest', 'RemovesAndAddsAutoclick', function() { +// Test is flaky: https://crbug.com/1306728 +TEST_F('AutoclickE2ETest', 'DISABLED_RemovesAndAddsAutoclick', function() { this.runWithLoadedTree( 'data:text/html;charset=utf-8,<p>Cats rock!</p>', async function(root) { // Turn on screen magnifier so that when we turn off autoclick, the
diff --git a/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js b/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js index ba82ab8..831af49 100644 --- a/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js +++ b/chrome/browser/resources/chromeos/accessibility/common/testing/e2e_test_base.js
@@ -220,11 +220,35 @@ // This populates the address bar as if we typed the url. focus.setValue(url); - const onValueChanged = e => { - focus.removeEventListener('valueChanged', onValueChanged); - EventGenerator.sendKeyPress(KeyCode.RETURN); - }; - focus.addEventListener('valueChanged', onValueChanged); + + // We have two choices to confirm navigation. + if (!this.navigateLacrosWithAutoComplete) { + // 1. (default), hit enter. + const onValueChanged = e => { + focus.removeEventListener( + 'valueChanged', onValueChanged); + EventGenerator.sendKeyPress(KeyCode.RETURN); + }; + focus.addEventListener('valueChanged', onValueChanged); + } else { + // 2. use the auto completion. + // Wait until the auto completion shows up. + const clickAutocomplete = () => { + focus.removeEventListener( + 'controlsChanged', clickAutocomplete); + + // The text field relates to the auto complete list box + // via controlledBy. The |controls| node structure here + // nests several levels until the listBoxOption we want. + const autoCompleteListBoxOption = + focus.controls[0].firstChild.firstChild; + assertEquals( + 'listBoxOption', autoCompleteListBoxOption.role); + autoCompleteListBoxOption.doDefault(); + }; + focus.addEventListener( + 'controlsChanged', clickAutocomplete); + } } }); return;
diff --git a/chrome/browser/resources/hangout_services/manifest.json b/chrome/browser/resources/hangout_services/manifest.json index 556c6046..53fb2b5 100644 --- a/chrome/browser/resources/hangout_services/manifest.json +++ b/chrome/browser/resources/hangout_services/manifest.json
@@ -5,7 +5,7 @@ "name": "Google Hangouts", // Note: Always update the version number when this file is updated. Chrome // triggers extension preferences update on the version increase. - "version": "1.3.16", + "version": "1.3.18", "manifest_version": 2, "externally_connectable": { "matches": [
diff --git a/chrome/browser/resources/history/history_clusters/cluster.html b/chrome/browser/resources/history/history_clusters/cluster.html index dba56ca4..e95da9d 100644 --- a/chrome/browser/resources/history/history_clusters/cluster.html +++ b/chrome/browser/resources/history/history_clusters/cluster.html
@@ -125,12 +125,12 @@ </url-visit> </template> </iron-collapse> - <div id="related-searches" hidden="[[!cluster.visit.relatedSearches.length]]"> + <div id="related-searches" hidden="[[!cluster.relatedSearches.length]]"> <div id="related-searches-label">$i18n{relatedSearchesHeader}</div> <div id="search-queries" role="list" aria-labelledby="related-searches-label" on-related-search-clicked="onRelatedSearchClicked_"> - <template is="dom-repeat" items="[[cluster.visit.relatedSearches]]"> + <template is="dom-repeat" items="[[cluster.relatedSearches]]"> <search-query search-query="[[item]]" index="[[index]]" role="listitem"> </search-query> </template>
diff --git a/chrome/browser/resources/pdf/manifest.json b/chrome/browser/resources/pdf/manifest.json index dbe8dd5..b1be621 100644 --- a/chrome/browser/resources/pdf/manifest.json +++ b/chrome/browser/resources/pdf/manifest.json
@@ -1,6 +1,6 @@ { // chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai - "manifest_version": 2, + "manifest_version": 3, "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDN6hM0rsDYGbzQPQfOygqlRtQgKUXMfnSjhIBL7LnReAVBEd7ZmKtyN2qmSasMl4HZpMhVe2rPWVVwBDl6iyNE/Kok6E6v6V3vCLGsOpQAuuNVye/3QxzIldzG/jQAdWZiyXReRVapOhZtLjGfywCvlWq7Sl/e3sbc0vWybSDI2QIDAQAB", "name": "<NAME>", "version": "1", @@ -18,6 +18,8 @@ "mime_types": [ "application/pdf" ], - "content_security_policy": "script-src 'self' 'wasm-eval' blob: filesystem: chrome://resources; object-src * blob: externalfile: file: filesystem: data:", - "mime_types_handler": "index.html" + "mime_types_handler": "index.html", + "content_security_policy": { + "extension_pages" : "script-src 'self' 'wasm-eval' blob: filesystem: chrome://resources; object-src * blob: externalfile: file: filesystem: data:" + } }
diff --git a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.html b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.html index 902fb2a..de15d5a 100644 --- a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.html +++ b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.html
@@ -50,15 +50,13 @@ <cr-dialog id="dialog" close-text="$i18n{close}"> <div slot="title">[[title_]]</div> <div slot="body"> - <div id="select-row" class="address-row" tabindex="0" - on-focus="onCountryRowFocus_" - on-pointerdown="onCountryRowPointerDown_"> + <div id="select-row" class="address-row"> <label id="select-label" class="cr-form-field-label"> $i18n{addressCountry} </label> <select class="md-select" aria-labelledby="select-label" value="[[countryCode_]]" on-change="onCountryChange_" - tabindex="-1" autofocus> + autofocus> <option value=""></option> <template is="dom-repeat" items="[[countries_]]"> <option value="[[getCode_(item)]]"
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 943966e2..a1d1a92e 100644 --- a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts +++ b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts
@@ -242,24 +242,6 @@ this.countryCode_ = countrySelect!.value; } - /** - * Propagates focus to the <select> when country row is focused - * (e.g. using tab navigation). - */ - private onCountryRowFocus_() { - this.shadowRoot!.querySelector('select')!.focus(); - } - - /** - * Prevents clicking random spaces within country row but outside of <select> - * from triggering focus. - */ - private onCountryRowPointerDown_(e: Event) { - if ((e.composedPath()[0] as HTMLElement).tagName !== 'SELECT') { - e.preventDefault(); - } - } - createHonorificAddressComponentUI( address: chrome.autofillPrivate.AddressEntry): AddressComponentUI { return new AddressComponentUI(address, {
diff --git a/chrome/browser/resources/settings/chromeos/BUILD.gn b/chrome/browser/resources/settings/chromeos/BUILD.gn index 9636d5a..4fa16c1 100644 --- a/chrome/browser/resources/settings/chromeos/BUILD.gn +++ b/chrome/browser/resources/settings/chromeos/BUILD.gn
@@ -260,7 +260,7 @@ "chromeos/deep_linking_behavior.js", "chromeos/metrics_recorder.m.js", "chromeos/os_settings_routes.m.js", - "chromeos/route_origin_behavior.m.js", + "chromeos/route_origin_behavior.js", "chromeos/search_handler.js", "chromeos/os_route.m.js", "chromeos/os_page_visibility.js", @@ -758,7 +758,6 @@ } js_library("route_origin_behavior") { - sources = [ "route_origin_behavior.m.js" ] deps = [ ":os_route", "//ui/webui/resources/js:cr.m",
diff --git a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_subpage.js b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_subpage.js index 70b42c2..c8f80dd 100644 --- a/chrome/browser/resources/settings/chromeos/crostini_page/crostini_subpage.js +++ b/chrome/browser/resources/settings/chromeos/crostini_page/crostini_subpage.js
@@ -32,7 +32,7 @@ import {routes} from '../os_route.m.js'; import {Router, Route} from '../../router.js'; import {RouteObserverBehavior} from '../route_observer_behavior.js'; -import {RouteOriginBehaviorImpl, RouteOriginBehavior} from '../route_origin_behavior.m.js'; +import {RouteOriginBehaviorImpl, RouteOriginBehavior} from '../route_origin_behavior.js'; import {WebUIListenerBehavior} from '//resources/js/web_ui_listener_behavior.m.js'; import '../../settings_shared_css.js'; import {recordSettingChange, recordSearch, setUserActionRecorderForTesting, recordPageFocus, recordPageBlur, recordClick, recordNavigation} from '../metrics_recorder.m.js';
diff --git a/chrome/browser/resources/settings/chromeos/device_page/storage.js b/chrome/browser/resources/settings/chromeos/device_page/storage.js index 3ad6594df..51a026c 100644 --- a/chrome/browser/resources/settings/chromeos/device_page/storage.js +++ b/chrome/browser/resources/settings/chromeos/device_page/storage.js
@@ -20,7 +20,7 @@ import {Route, Router} from '../../router.js'; import {routes} from '../os_route.m.js'; import {RouteObserverBehavior} from '../route_observer_behavior.js'; -import {RouteOriginBehavior, RouteOriginBehaviorImpl} from '../route_origin_behavior.m.js'; +import {RouteOriginBehavior, RouteOriginBehaviorImpl} from '../route_origin_behavior.js'; import {BatteryStatus, DevicePageBrowserProxy, DevicePageBrowserProxyImpl, ExternalStorage, getDisplayApi, IdleBehavior, LidClosedBehavior, NoteAppInfo, NoteAppLockScreenSupport, PowerManagementSettings, PowerSource, StorageSpaceState} from './device_page_browser_proxy.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 20d0856..6e21fdf0 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/internet_subpage.js +++ b/chrome/browser/resources/settings/chromeos/internet_page/internet_subpage.js
@@ -36,7 +36,7 @@ import {recordClick, recordNavigation, recordPageBlur, recordPageFocus, recordSearch, recordSettingChange, setUserActionRecorderForTesting} from '../metrics_recorder.m.js'; import {routes} from '../os_route.m.js'; import {RouteObserverBehavior} from '../route_observer_behavior.js'; -import {RouteOriginBehavior, RouteOriginBehaviorImpl} from '../route_origin_behavior.m.js'; +import {RouteOriginBehavior, RouteOriginBehaviorImpl} from '../route_origin_behavior.js'; import {InternetPageBrowserProxy, InternetPageBrowserProxyImpl} from './internet_page_browser_proxy.js';
diff --git a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_feature_item.js b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_feature_item.js index cf2e9faf..281fc5b 100644 --- a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_feature_item.js +++ b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_feature_item.js
@@ -14,7 +14,7 @@ import {Route, Router} from '../../router.js'; import {routes} from '../os_route.m.js'; -import {RouteOriginBehavior} from '../route_origin_behavior.m.js'; +import {RouteOriginBehavior} from '../route_origin_behavior.js'; import {MultiDeviceFeature} from './multidevice_constants.js'; import {MultiDeviceFeatureBehavior} from './multidevice_feature_behavior.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js index 923effa..c23e769d 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/manage_a11y_page.js
@@ -28,7 +28,7 @@ import {BatteryStatus, DevicePageBrowserProxy, DevicePageBrowserProxyImpl, ExternalStorage, IdleBehavior, LidClosedBehavior, NoteAppInfo, NoteAppLockScreenSupport, PowerManagementSettings, PowerSource, getDisplayApi, StorageSpaceState} from '../device_page/device_page_browser_proxy.js'; import '//resources/cr_components/localized_link/localized_link.js'; import {RouteObserverBehavior} from '../route_observer_behavior.js'; -import {RouteOriginBehaviorImpl, RouteOriginBehavior} from '../route_origin_behavior.m.js'; +import {RouteOriginBehaviorImpl, RouteOriginBehavior} from '../route_origin_behavior.js'; import {ManageA11yPageBrowserProxyImpl, ManageA11yPageBrowserProxy} from './manage_a11y_page_browser_proxy.js'; Polymer({
diff --git a/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_device_detail_subpage.js b/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_device_detail_subpage.js index 877d2fc3..04a2222 100644 --- a/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_device_detail_subpage.js +++ b/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_device_detail_subpage.js
@@ -27,7 +27,7 @@ import {Route, Router} from '../../router.js'; import {routes} from '../os_route.m.js'; import {RouteObserverBehavior, RouteObserverBehaviorInterface} from '../route_observer_behavior.js'; -import {RouteOriginBehavior, RouteOriginBehaviorInterface} from '../route_origin_behavior.m.js'; +import {RouteOriginBehavior, RouteOriginBehaviorInterface} from '../route_origin_behavior.js'; const mojom = chromeos.bluetoothConfig.mojom;
diff --git a/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js b/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js index 7e74ff4f..8c96cad 100644 --- a/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js +++ b/chrome/browser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_summary.js
@@ -22,7 +22,7 @@ import {Router} from '../../router.js'; import {routes} from '../os_route.m.js'; import {RouteObserverBehavior, RouteObserverBehaviorInterface} from '../route_observer_behavior.js'; -import {RouteOriginBehavior, RouteOriginBehaviorInterface} from '../route_origin_behavior.m.js'; +import {RouteOriginBehavior, RouteOriginBehaviorInterface} from '../route_origin_behavior.js'; const mojom = chromeos.bluetoothConfig.mojom;
diff --git a/chrome/browser/resources/settings/chromeos/route_origin_behavior.html b/chrome/browser/resources/settings/chromeos/route_origin_behavior.html deleted file mode 100644 index 0c665f4b..0000000 --- a/chrome/browser/resources/settings/chromeos/route_origin_behavior.html +++ /dev/null
@@ -1 +0,0 @@ -<!-- This file is used only for Polymer 3 autogeneration. -->
diff --git a/chrome/browser/resources/settings/chromeos/route_origin_behavior.m.js b/chrome/browser/resources/settings/chromeos/route_origin_behavior.js similarity index 100% rename from chrome/browser/resources/settings/chromeos/route_origin_behavior.m.js rename to chrome/browser/resources/settings/chromeos/route_origin_behavior.js
diff --git a/chrome/browser/resources/settings/privacy_sandbox/app.ts b/chrome/browser/resources/settings/privacy_sandbox/app.ts index 15c97bf..41dbc24 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/app.ts +++ b/chrome/browser/resources/settings/privacy_sandbox/app.ts
@@ -152,6 +152,15 @@ HatsBrowserProxyImpl.getInstance().trustSafetyInteractionOccurred( TrustSafetyInteraction.OPENED_PRIVACY_SANDBOX); + + const view = new URLSearchParams(window.location.search).get('view'); + if (Object.values(PrivacySandboxSettingsView) + .includes(view as PrivacySandboxSettingsView)) { + this.privacySandboxSettingsView_ = view as PrivacySandboxSettingsView; + } else { + // If no view has been specified, then navigate to main page. + this.privacySandboxSettingsView_ = PrivacySandboxSettingsView.MAIN; + } } private onFlocChanged_() {
diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc index c28157c..1b13534 100644 --- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc +++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
@@ -269,7 +269,7 @@ quota_manager_.get() ? quota_manager_->proxy() : nullptr, std::move(additional_backends), std::vector<storage::URLRequestAutoMountHandler>(), data_dir_.GetPath(), - options); + data_dir_.GetPath(), options); is_filesystem_set_up_ = true; }
diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/CriticalPersistedTabData.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/CriticalPersistedTabData.java index bc8ed589..92dbf5f 100644 --- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/CriticalPersistedTabData.java +++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/CriticalPersistedTabData.java
@@ -55,13 +55,29 @@ @Override public SerializedCriticalPersistedTabData map(ByteBuffer byteBuffer) { if (byteBuffer == null || byteBuffer.limit() == 0) { - return new SerializedCriticalPersistedTabData(null); + return null; } - CriticalPersistedTabDataFlatBuffer criticalPersistedTabDataFlatBuffer = null; + SerializedCriticalPersistedTabData res = null; try { - criticalPersistedTabDataFlatBuffer = + CriticalPersistedTabDataFlatBuffer flatBuffer = CriticalPersistedTabDataFlatBuffer .getRootAsCriticalPersistedTabDataFlatBuffer(byteBuffer); + ByteBuffer webContentsStateByteBuffer = + flatBuffer.webContentsStateBytesAsByteBuffer(); + WebContentsState webContentsState = + new WebContentsState(webContentsStateByteBuffer == null + ? ByteBuffer.allocateDirect(0) + : webContentsStateByteBuffer.slice()); + webContentsState.setVersion( + WebContentsState.CONTENTS_STATE_CURRENT_VERSION); + res = new SerializedCriticalPersistedTabData(flatBuffer.parentId(), + flatBuffer.rootId(), flatBuffer.timestampMillis(), webContentsState, + NULL_OPENER_APP_ID.equals(flatBuffer.openerAppId()) + ? null + : flatBuffer.openerAppId(), + flatBuffer.contentStateVersion(), flatBuffer.themeColor(), + getLaunchType(flatBuffer.launchTypeAtCreation()), + getTabUserAgentType(flatBuffer.userAgent())); } catch (Exception e) { // TODO(crbug.com/1294613) Add in some metrics recording how often this // happens. @@ -70,10 +86,8 @@ + "Details: " + e.getMessage()); } RecordHistogram.recordBooleanHistogram( - "Tabs.PersistedTabData.Critical.Map.Success", - criticalPersistedTabDataFlatBuffer != null); - return new SerializedCriticalPersistedTabData( - criticalPersistedTabDataFlatBuffer); + "Tabs.PersistedTabData.Critical.Map.Success", res != null); + return res; } }; public static final long INVALID_TIMESTAMP = -1; @@ -170,26 +184,11 @@ @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) public CriticalPersistedTabData(Tab tab, SerializedCriticalPersistedTabData serialized) { - this(tab); - mParentId = serialized.getFlatBuffer().parentId(); - mRootId = serialized.getFlatBuffer().rootId(); - mTimestampMillis = serialized.getFlatBuffer().timestampMillis(); - ByteBuffer webContentsState = - serialized.getFlatBuffer().webContentsStateBytesAsByteBuffer(); - mWebContentsState = new WebContentsState( - webContentsState == null ? ByteBuffer.allocateDirect(0) : webContentsState.slice()); - mWebContentsState.setVersion(WebContentsState.CONTENTS_STATE_CURRENT_VERSION); - mUrl = mWebContentsState.getVirtualUrlFromState() == null - ? GURL.emptyGURL() - : new GURL(mWebContentsState.getVirtualUrlFromState()); - mTitle = mWebContentsState.getDisplayTitleFromState(); - mContentStateVersion = serialized.getFlatBuffer().contentStateVersion(); - mOpenerAppId = NULL_OPENER_APP_ID.equals(serialized.getFlatBuffer().openerAppId()) - ? null - : serialized.getFlatBuffer().openerAppId(); - mThemeColor = serialized.getFlatBuffer().themeColor(); - mTabLaunchTypeAtCreation = getLaunchType(serialized.getFlatBuffer().launchTypeAtCreation()); - mUserAgent = getTabUserAgentType(serialized.getFlatBuffer().userAgent()); + this(tab, serialized.getUrl(), serialized.getTitle(), serialized.getParentId(), + serialized.getRootId(), serialized.getTimestampMillis(), + serialized.getWebContentsState(), serialized.getWebContentsStateVersion(), + serialized.getOpenerAppId(), serialized.getThemeColor(), serialized.getLaunchType(), + serialized.getUserAgent()); } /** @@ -778,8 +777,7 @@ */ public static boolean isEmptySerialization( SerializedCriticalPersistedTabData serializedCriticalPersistedTabData) { - return serializedCriticalPersistedTabData == null - || serializedCriticalPersistedTabData.isEmpty(); + return serializedCriticalPersistedTabData == null; } @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/SerializedCriticalPersistedTabData.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/SerializedCriticalPersistedTabData.java index e25b9df7..d51ac19 100644 --- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/SerializedCriticalPersistedTabData.java +++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/state/SerializedCriticalPersistedTabData.java
@@ -4,37 +4,96 @@ package org.chromium.chrome.browser.tab.state; -import androidx.annotation.VisibleForTesting; +import androidx.annotation.Nullable; -import org.chromium.chrome.browser.tab.flatbuffer.CriticalPersistedTabDataFlatBuffer; - -import java.nio.ByteBuffer; +import org.chromium.chrome.browser.tab.TabLaunchType; +import org.chromium.chrome.browser.tab.TabUserAgent; +import org.chromium.chrome.browser.tab.WebContentsState; /** * Contains serialized {@link CriticalPersistedTabData} * TODO(crbug.com/1294620) rename to CriticalPersistedTabDataResult */ public class SerializedCriticalPersistedTabData implements PersistedTabDataResult { - private final CriticalPersistedTabDataFlatBuffer mCriticalPersistedTabDataFlatBuffer; + private final int mParentId; + private final int mRootId; + private final long mTimestampMillis; + private final WebContentsState mWebContentsState; + private final String mOpenerAppId; + private final int mWebContentsStateVersion; + private final int mThemeColor; + private final @Nullable @TabLaunchType Integer mLaunchTypeAtCreation; + private final @TabUserAgent int mUserAgent; /** - * @param byteBuffer the {@link ByteBuffer} containing serialized {@link - * CriticalPersistedTabData} + * @param parentId parent identifier for a {@link Tab} + * @param rootId root identifier for a {@link Tab} + * @param timestampMillis time {@link Tab} was last accessed + * @param webContentsState {@link WebContentsState} for the {@link Tab} + * @param url url the {@link Tab} is currently visiting + * @param title title of the {@link Tab} + * @param openerAppId opener app id for the {@link Tab} + * @param webContentsStateVersion version of the {@link WebContentsState} + * @param themeColor theme color of the {@link Tab} + * @param launchTypeAtCreation the way the {@link Tab} was launched + * @param userAgent user agent for the {@link Tab} */ - protected SerializedCriticalPersistedTabData( - CriticalPersistedTabDataFlatBuffer criticalPersistedTabDataFlatBuffer) { - mCriticalPersistedTabDataFlatBuffer = criticalPersistedTabDataFlatBuffer; + protected SerializedCriticalPersistedTabData(int parentId, int rootId, long timestampMillis, + WebContentsState webContentsState, String openerAppId, int webContentsStateVersion, + int themeColor, @Nullable @TabLaunchType Integer launchTypeAtCreation, + @TabUserAgent int userAgent) { + mParentId = parentId; + mRootId = rootId; + mTimestampMillis = timestampMillis; + mWebContentsState = webContentsState; + mOpenerAppId = openerAppId; + mWebContentsStateVersion = webContentsStateVersion; + mThemeColor = themeColor; + mLaunchTypeAtCreation = launchTypeAtCreation; + mUserAgent = userAgent; } - /** - * @return true if the {@link SerializedCriticalPersistedTabData} is empty. - */ - public boolean isEmpty() { - return mCriticalPersistedTabDataFlatBuffer == null; + protected int getParentId() { + return mParentId; } - @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) - protected CriticalPersistedTabDataFlatBuffer getFlatBuffer() { - return mCriticalPersistedTabDataFlatBuffer; + protected int getRootId() { + return mRootId; + } + + protected long getTimestampMillis() { + return mTimestampMillis; + } + + protected WebContentsState getWebContentsState() { + return mWebContentsState; + } + + protected String getUrl() { + return mWebContentsState.getVirtualUrlFromState(); + } + + protected String getTitle() { + return mWebContentsState.getDisplayTitleFromState(); + } + + protected String getOpenerAppId() { + return mOpenerAppId; + } + + protected int getWebContentsStateVersion() { + return mWebContentsStateVersion; + } + + protected int getThemeColor() { + return mThemeColor; + } + + protected @Nullable @TabLaunchType Integer getLaunchType() { + return mLaunchTypeAtCreation; + } + + protected @TabUserAgent int getUserAgent() { + return mUserAgent; } }
diff --git a/chrome/browser/tabmodel/BUILD.gn b/chrome/browser/tabmodel/BUILD.gn index a956cf4..381d4f68 100644 --- a/chrome/browser/tabmodel/BUILD.gn +++ b/chrome/browser/tabmodel/BUILD.gn
@@ -82,3 +82,27 @@ "//third_party/mockito:mockito_java", ] } + +java_library("junit") { + # Skip platform checks since Robolectric depends on requires_android targets. + bypass_platform_checks = true + testonly = true + + sources = [ "android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java" ] + + deps = [ + ":factory_java", + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//base:base_junit_test_support", + "//chrome/browser/tab:java", + "//chrome/test/android:chrome_java_test_support", + "//third_party/android_deps:robolectric_all_java", + "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/hamcrest:hamcrest_core_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + ] +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java similarity index 65% rename from chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java rename to chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java index d95c52e0..e8365fe 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java +++ b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java
@@ -5,29 +5,27 @@ package org.chromium.chrome.browser.tabmodel; import android.app.Activity; +import android.os.Build; import android.util.Pair; import androidx.test.filters.SmallTest; -import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.robolectric.Robolectric; +import org.robolectric.android.controller.ActivityController; +import org.robolectric.annotation.Config; -import org.chromium.base.ActivityState; -import org.chromium.base.ApplicationStatus; import org.chromium.base.ThreadUtils; -import org.chromium.base.test.UiThreadTest; -import org.chromium.base.test.util.Batch; +import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Feature; -import org.chromium.chrome.browser.app.ChromeActivity; -import org.chromium.chrome.browser.customtabs.CustomTabActivity; -import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; import org.chromium.chrome.browser.tab.MockTab; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.NextTabPolicy.NextTabPolicySupplier; -import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.browser.tabmodel.MockTabModelSelector; import java.util.ArrayList; @@ -39,11 +37,13 @@ * Makes sure the class handles multiple {@link Activity}s requesting {@link TabModelSelector}s, * {@link Activity}s getting destroyed, etc. */ -@RunWith(ChromeJUnit4ClassRunner.class) -@Batch(Batch.UNIT_TESTS) +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) public class TabWindowManagerTest { private TabWindowManager mSubject; private AsyncTabParamsManager mAsyncTabParamsManager; + @Mock + private TabCreatorManager mTabCreatorManager; private NextTabPolicySupplier mNextTabPolicySupplier = () -> NextTabPolicy.HIERARCHICAL; private static final TabModelSelectorFactory sMockTabModelSelectorFactory = @@ -58,31 +58,25 @@ @Before public void setUp() { + MockitoAnnotations.initMocks(this); ThreadUtils.runOnUiThreadBlocking(() -> { mAsyncTabParamsManager = AsyncTabParamsManagerFactory.createAsyncTabParamsManager(); - int maxInstances = MultiWindowUtils.getMaxInstances(); + int maxInstances = + (Build.VERSION.SDK_INT >= 31 /*S*/ ? TabWindowManager.MAX_SELECTORS_S + : TabWindowManager.MAX_SELECTORS_LEGACY); mSubject = TabWindowManagerFactory.createInstance( sMockTabModelSelectorFactory, mAsyncTabParamsManager, maxInstances); }); } - @After - public void tearDown() { - ThreadUtils.runOnUiThreadBlocking( - () -> { ApplicationStatus.resetActivitiesForInstrumentationTests(); }); + private ActivityController<Activity> createActivity() { + ActivityController<Activity> controller = Robolectric.buildActivity(Activity.class); + controller.setup(); + return controller; } - private ChromeActivity buildActivity() { - ChromeActivity activity = new CustomTabActivity(); - ThreadUtils.runOnUiThreadBlocking(() -> { - ApplicationStatus.onStateChangeForTesting(activity, ActivityState.CREATED); - }); - return activity; - } - - private void destroyActivity(Activity a) { - ThreadUtils.runOnUiThreadBlocking( - () -> { ApplicationStatus.onStateChangeForTesting(a, ActivityState.DESTROYED); }); + private void destroyActivity(ActivityController<Activity> controller) { + controller.destroy(); } /** @@ -91,18 +85,18 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testSingleActivity() { - ChromeActivity activity0 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Assert.assertEquals(0, assignment0.first.intValue()); TabModelSelector selector0 = assignment0.second; Assert.assertNotNull("Was not able to build the TabModelSelector", selector0); Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); - destroyActivity(activity0); + destroyActivity(activityController0); } /** @@ -111,16 +105,17 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testMultipleActivities() { Assert.assertTrue("Not enough selectors", mSubject.getMaxSimultaneousSelectors() >= 2); - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 1); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 1); Assert.assertEquals(0, assignment0.first.intValue()); Assert.assertEquals(1, assignment1.first.intValue()); @@ -129,8 +124,8 @@ Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); Assert.assertEquals("Unexpected model index", 1, mSubject.getIndexForWindow(activity1)); - destroyActivity(activity0); - destroyActivity(activity1); + destroyActivity(activityController0); + destroyActivity(activityController1); } /** @@ -140,23 +135,24 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testTooManyActivities() { - List<ChromeActivity> activityList = new ArrayList<>(); + List<ActivityController<Activity>> activityControllerList = new ArrayList<>(); for (int i = 0; i < mSubject.getMaxSimultaneousSelectors(); i++) { - ChromeActivity a = buildActivity(); - activityList.add(a); + ActivityController<Activity> c = createActivity(); + activityControllerList.add(c); Assert.assertNotNull("Could not build selector", - mSubject.requestSelector(a, a, mNextTabPolicySupplier, 0)); + mSubject.requestSelector( + c.get(), mTabCreatorManager, mNextTabPolicySupplier, 0)); } - ChromeActivity activity = buildActivity(); - activityList.add(activity); + ActivityController<Activity> activityController = createActivity(); + activityControllerList.add(activityController); Assert.assertNull("Built selectors past the max number supported", - mSubject.requestSelector(activity, activity, mNextTabPolicySupplier, 0)); + mSubject.requestSelector( + activityController.get(), mTabCreatorManager, mNextTabPolicySupplier, 0)); - for (ChromeActivity a : activityList) { - destroyActivity(a); + for (ActivityController<Activity> c : activityControllerList) { + destroyActivity(c); } } @@ -167,17 +163,18 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testIndexFallback() { Assert.assertTrue("Not enough selectors", mSubject.getMaxSimultaneousSelectors() >= 2); - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); // Request 0 again, but should get 1 instead. Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 0); Assert.assertEquals(0, assignment0.first.intValue()); Assert.assertEquals(1, assignment1.first.intValue()); @@ -186,8 +183,8 @@ Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); Assert.assertEquals("Unexpected model index", 1, mSubject.getIndexForWindow(activity1)); - destroyActivity(activity0); - destroyActivity(activity1); + destroyActivity(activityController0); + destroyActivity(activityController1); } /** @@ -197,17 +194,18 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testIndexFallback2() { Assert.assertTrue("Not enough selectors", mSubject.getMaxSimultaneousSelectors() >= 3); - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 2); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 2); // Request 2 again, but should get 0 instead. Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 2); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 2); Assert.assertEquals(2, assignment0.first.intValue()); Assert.assertEquals(0, assignment1.first.intValue()); @@ -216,8 +214,8 @@ Assert.assertEquals("Unexpected model index", 2, mSubject.getIndexForWindow(activity0)); Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity1)); - destroyActivity(activity0); - destroyActivity(activity1); + destroyActivity(activityController0); + destroyActivity(activityController1); } /** @@ -227,17 +225,17 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testActivityDeathRemovesSingle() { - ChromeActivity activity0 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Assert.assertEquals(0, assignment0.first.intValue()); Assert.assertNotNull("Was not able to build the TabModelSelector", assignment0.second); Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); - destroyActivity(activity0); + destroyActivity(activityController0); Assert.assertEquals("Still found model", TabWindowManager.INVALID_WINDOW_INDEX, mSubject.getIndexForWindow(activity0)); @@ -250,30 +248,31 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testActivityDeathLetsModelReassign() { - ChromeActivity activity0 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Assert.assertEquals(0, assignment0.first.intValue()); Assert.assertNotNull("Was not able to build the TabModelSelector", assignment0.second); Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); - destroyActivity(activity0); + destroyActivity(activityController0); Assert.assertEquals("Still found model", TabWindowManager.INVALID_WINDOW_INDEX, mSubject.getIndexForWindow(activity0)); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 0); Assert.assertEquals(0, assignment1.first.intValue()); Assert.assertNotNull("Was not able to build the TabModelSelector", assignment1.second); Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity1)); - destroyActivity(activity1); + destroyActivity(activityController1); } /** @@ -284,16 +283,17 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testActivityDeathWithMultipleActivities() { Assert.assertTrue("Not enough selectors", mSubject.getMaxSimultaneousSelectors() >= 2); - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 1); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 1); Assert.assertEquals(0, assignment0.first.intValue()); Assert.assertEquals(1, assignment1.first.intValue()); @@ -302,22 +302,23 @@ Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); Assert.assertEquals("Unexpected model index", 1, mSubject.getIndexForWindow(activity1)); - destroyActivity(activity1); + destroyActivity(activityController1); Assert.assertEquals("Still found model", TabWindowManager.INVALID_WINDOW_INDEX, mSubject.getIndexForWindow(activity1)); - ChromeActivity activity2 = buildActivity(); + ActivityController<Activity> activityController2 = createActivity(); + Activity activity2 = activityController2.get(); Pair<Integer, TabModelSelector> assignment2 = - mSubject.requestSelector(activity2, activity2, mNextTabPolicySupplier, 1); + mSubject.requestSelector(activity2, mTabCreatorManager, mNextTabPolicySupplier, 1); Assert.assertEquals(1, assignment2.first.intValue()); Assert.assertNotNull("Was not able to build the TabModelSelector", assignment2.second); Assert.assertEquals("Unexpected model index", 0, mSubject.getIndexForWindow(activity0)); Assert.assertEquals("Unexpected model index", 1, mSubject.getIndexForWindow(activity2)); - destroyActivity(activity0); - destroyActivity(activity2); + destroyActivity(activityController0); + destroyActivity(activityController2); } /** @@ -326,14 +327,15 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testTabExistsInAnySelector() { - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 1); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 1); MockTabModelSelector selector0 = (MockTabModelSelector) assignment0.second; MockTabModelSelector selector1 = (MockTabModelSelector) assignment1.second; Tab tab1 = selector0.addMockTab(); @@ -356,8 +358,8 @@ mAsyncTabParamsManager.getAsyncTabParams().clear(); } - destroyActivity(activity0); - destroyActivity(activity1); + destroyActivity(activityController0); + destroyActivity(activityController1); } /** @@ -366,14 +368,15 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void testGetTabById() { - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 1); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 1); MockTabModelSelector selector0 = (MockTabModelSelector) assignment0.second; MockTabModelSelector selector1 = (MockTabModelSelector) assignment1.second; Tab tab1 = selector0.addMockTab(); @@ -396,8 +399,8 @@ mAsyncTabParamsManager.getAsyncTabParams().clear(); } - destroyActivity(activity0); - destroyActivity(activity1); + destroyActivity(activityController0); + destroyActivity(activityController1); } /** @@ -406,14 +409,15 @@ @Test @SmallTest @Feature({"Multiwindow"}) - @UiThreadTest public void getTabModelForTab() { - ChromeActivity activity0 = buildActivity(); - ChromeActivity activity1 = buildActivity(); + ActivityController<Activity> activityController0 = createActivity(); + Activity activity0 = activityController0.get(); + ActivityController<Activity> activityController1 = createActivity(); + Activity activity1 = activityController1.get(); Pair<Integer, TabModelSelector> assignment0 = - mSubject.requestSelector(activity0, activity0, mNextTabPolicySupplier, 0); + mSubject.requestSelector(activity0, mTabCreatorManager, mNextTabPolicySupplier, 0); Pair<Integer, TabModelSelector> assignment1 = - mSubject.requestSelector(activity1, activity1, mNextTabPolicySupplier, 1); + mSubject.requestSelector(activity1, mTabCreatorManager, mNextTabPolicySupplier, 1); MockTabModelSelector selector0 = (MockTabModelSelector) assignment0.second; MockTabModelSelector selector1 = (MockTabModelSelector) assignment1.second; Tab tab1 = selector0.addMockTab(); @@ -430,7 +434,7 @@ Assert.assertEquals( selector1.getModel(/* incognito= */ true), mSubject.getTabModelForTab(tab4)); - destroyActivity(activity0); - destroyActivity(activity1); + destroyActivity(activityController0); + destroyActivity(activityController1); } }
diff --git a/chrome/browser/touch_to_fill/touch_to_fill_controller.cc b/chrome/browser/touch_to_fill/touch_to_fill_controller.cc index 33a47cf..35bd3d3 100644 --- a/chrome/browser/touch_to_fill/touch_to_fill_controller.cc +++ b/chrome/browser/touch_to_fill/touch_to_fill_controller.cc
@@ -8,6 +8,7 @@ #include "base/callback_helpers.h" #include "base/check.h" +#include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_functions.h" #include "base/ranges/algorithm.h" #include "base/types/pass_key.h" @@ -33,6 +34,7 @@ using ShowVirtualKeyboard = password_manager::PasswordManagerDriver::ShowVirtualKeyboard; +using autofill::mojom::SubmissionReadinessState; using device_reauth::BiometricsAvailability; using password_manager::PasswordManagerDriver; using password_manager::UiCredential; @@ -52,6 +54,45 @@ return result; } +// Infers whether a form should be submitted based on the feature's state and +// the form's structure (submission_readiness). +bool ShouldTriggerSubmission(SubmissionReadinessState submission_readiness) { + if (!base::FeatureList::IsEnabled( + password_manager::features::kTouchToFillPasswordSubmission)) { + return false; + } + + bool use_conservative_heuristics = base::GetFieldTrialParamByFeatureAsBool( + password_manager::features::kTouchToFillPasswordSubmission, + password_manager::features:: + kTouchToFillPasswordSubmissionWithConservativeHeuristics, + false); + switch (submission_readiness) { + case SubmissionReadinessState::kNoInformation: + case SubmissionReadinessState::kError: + case SubmissionReadinessState::kNoUsernameField: + case SubmissionReadinessState::kFieldBetweenUsernameAndPassword: + case SubmissionReadinessState::kFieldAfterPasswordField: + return false; + + case SubmissionReadinessState::kEmptyFields: + case SubmissionReadinessState::kMoreThanTwoFields: + return !use_conservative_heuristics; + + case SubmissionReadinessState::kTwoFields: + return true; + } +} + +// Returns whether there is at least one credential with a non-empty username. +bool ContainsNonEmptyUsername( + const base::span<const UiCredential>& credentials) { + return std::any_of(credentials.begin(), credentials.end(), + [](const UiCredential& credential) { + return !credential.username().empty(); + }); +} + } // namespace TouchToFillController::TouchToFillController( @@ -74,19 +115,23 @@ } } -void TouchToFillController::Show(base::span<const UiCredential> credentials, - base::WeakPtr<PasswordManagerDriver> driver, - bool ready_for_submission) { +void TouchToFillController::Show( + base::span<const UiCredential> credentials, + base::WeakPtr<PasswordManagerDriver> driver, + SubmissionReadinessState submission_readiness) { DCHECK(!driver_ || driver_.get() == driver.get()); driver_ = std::move(driver); - trigger_submission_ = - ready_for_submission && - base::FeatureList::IsEnabled( - password_manager::features::kTouchToFillPasswordSubmission); + + trigger_submission_ = ShouldTriggerSubmission(submission_readiness) && + ContainsNonEmptyUsername(credentials); + base::UmaHistogramEnumeration( + "PasswordManager.TouchToFill.SubmissionReadiness", submission_readiness); + ukm::builders::TouchToFill_SubmissionReadiness(source_id_) + .SetSubmissionReadiness(static_cast<int64_t>(submission_readiness)) + .Record(ukm::UkmRecorder::Get()); base::UmaHistogramCounts100("PasswordManager.TouchToFill.NumCredentialsShown", credentials.size()); - if (credentials.empty()) { // Ideally this should never happen. However, in case we do end up invoking // Show() without credentials, we should not show Touch To Fill to the user @@ -190,7 +235,7 @@ driver_->FillSuggestion(credential.username(), credential.password()); - if (trigger_submission_) { + if (trigger_submission_ && !credential.username().empty()) { driver_->TriggerFormSubmission(); } driver_ = nullptr;
diff --git a/chrome/browser/touch_to_fill/touch_to_fill_controller.h b/chrome/browser/touch_to_fill/touch_to_fill_controller.h index da8a566f..2708814 100644 --- a/chrome/browser/touch_to_fill/touch_to_fill_controller.h +++ b/chrome/browser/touch_to_fill/touch_to_fill_controller.h
@@ -16,6 +16,7 @@ #include "base/types/pass_key.h" #include "chrome/browser/touch_to_fill/touch_to_fill_view.h" #include "chrome/browser/touch_to_fill/touch_to_fill_view_factory.h" +#include "components/autofill/core/common/mojom/autofill_types.mojom.h" #include "components/device_reauth/biometric_authenticator.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "ui/gfx/native_widget_types.h" @@ -70,7 +71,7 @@ // Instructs the controller to show the provided |credentials| to the user. void Show(base::span<const password_manager::UiCredential> credentials, base::WeakPtr<password_manager::PasswordManagerDriver> driver, - bool ready_for_submission); + autofill::mojom::SubmissionReadinessState submission_readiness); // Informs the controller that the user has made a selection. Invokes both // FillSuggestion() and TouchToFillDismissed() on |driver_|. No-op if invoked
diff --git a/chrome/browser/touch_to_fill/touch_to_fill_controller_unittest.cc b/chrome/browser/touch_to_fill/touch_to_fill_controller_unittest.cc index 8d388d1..ac2af5d 100644 --- a/chrome/browser/touch_to_fill/touch_to_fill_controller_unittest.cc +++ b/chrome/browser/touch_to_fill/touch_to_fill_controller_unittest.cc
@@ -15,6 +15,7 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/types/pass_key.h" +#include "components/autofill/core/common/mojom/autofill_types.mojom.h" #include "components/device_reauth/biometric_authenticator.h" #include "components/device_reauth/mock_biometric_authenticator.h" #include "components/password_manager/core/browser/origin_credential_store.h" @@ -32,6 +33,7 @@ using ShowVirtualKeyboard = password_manager::PasswordManagerDriver::ShowVirtualKeyboard; +using autofill::mojom::SubmissionReadinessState; using base::test::RunOnceCallback; using device_reauth::BiometricAuthRequester; using device_reauth::BiometricsAvailability; @@ -163,8 +165,9 @@ EXPECT_CALL(*weak_view, Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - controller_no_auth->Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + controller_no_auth->Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); // Test that we correctly log the absence of an Android credential. EXPECT_CALL(driver(), FillSuggestion(std::u16string(u"alice"), @@ -205,8 +208,9 @@ EXPECT_CALL(*weak_view, Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/true)); - controller_no_auth->Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/true); + controller_no_auth->Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kTwoFields); EXPECT_CALL(driver(), FillSuggestion(std::u16string(u"alice"), std::u16string(u"p4ssw0rd"))); @@ -234,8 +238,9 @@ EXPECT_CALL(*weak_view, Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - controller_no_auth->Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + controller_no_auth->Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); EXPECT_CALL(driver(), FillSuggestion(std::u16string(u"alice"), std::u16string(u"p4ssw0rd"))); @@ -246,6 +251,73 @@ controller_no_auth->OnCredentialSelected(credentials[0]); } +TEST_F(TouchToFillControllerTest, Dont_Submit_With_Empty_Username) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + password_manager::features::kTouchToFillPasswordSubmission); + + std::unique_ptr<TouchToFillController> controller_no_auth = + CreateNoAuthController(); + std::unique_ptr<MockTouchToFillView> mock_view = + std::make_unique<MockTouchToFillView>(); + MockTouchToFillView* weak_view = mock_view.get(); + controller_no_auth->set_view(std::move(mock_view)); + + UiCredential credentials[] = { + MakeUiCredential({.username = "", .password = "p4ssw0rd"}), + MakeUiCredential({.username = "username", .password = "p4ssw0rd"})}; + + // As we don't know which credential will be selected, don't disable + // submission for now. + EXPECT_CALL(*weak_view, Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), + ElementsAreArray(credentials), + /*trigger_submission=*/true)); + controller_no_auth->Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kTwoFields); + + // The user picks the credential with an empty username, submission should not + // be triggered. + EXPECT_CALL(driver(), TriggerFormSubmission()).Times(0); + EXPECT_CALL(driver(), + FillSuggestion(std::u16string(u""), std::u16string(u"p4ssw0rd"))); + EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(false))); + + controller_no_auth->OnCredentialSelected(credentials[0]); +} + +TEST_F(TouchToFillControllerTest, Single_Credential_With_Empty_Username) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + password_manager::features::kTouchToFillPasswordSubmission); + + std::unique_ptr<TouchToFillController> controller_no_auth = + CreateNoAuthController(); + std::unique_ptr<MockTouchToFillView> mock_view = + std::make_unique<MockTouchToFillView>(); + MockTouchToFillView* weak_view = mock_view.get(); + controller_no_auth->set_view(std::move(mock_view)); + + UiCredential credentials[] = { + MakeUiCredential({.username = "", .password = "p4ssw0rd"})}; + + // Only one credential with empty username - submission is impossible. + EXPECT_CALL(*weak_view, Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), + ElementsAreArray(credentials), + /*trigger_submission=*/false)); + controller_no_auth->Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kTwoFields); + + // Filling doesn't trigger submission. + EXPECT_CALL(driver(), TriggerFormSubmission()).Times(0); + EXPECT_CALL(driver(), + FillSuggestion(std::u16string(u""), std::u16string(u"p4ssw0rd"))); + EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(false))); + + controller_no_auth->OnCredentialSelected(credentials[0]); +} + TEST_F(TouchToFillControllerTest, Show_And_Fill_No_Auth_Available) { UiCredential credentials[] = { MakeUiCredential({.username = "alice", .password = "p4ssw0rd"})}; @@ -253,8 +325,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); // Test that we correctly log the absence of an Android credential. EXPECT_CALL(driver(), FillSuggestion(std::u16string(u"alice"), @@ -288,8 +361,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/true); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kTwoFields); EXPECT_CALL(driver(), FillSuggestion(std::u16string(u"alice"), std::u16string(u"p4ssw0rd"))); @@ -314,8 +388,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); EXPECT_CALL(driver(), FillSuggestion(_, _)).Times(0); EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(true))); @@ -335,8 +410,9 @@ TEST_F(TouchToFillControllerTest, Show_Empty) { EXPECT_CALL(view(), Show).Times(0); - touch_to_fill_controller().Show({}, driver().AsWeakPtr(), - /*trigger_submission=*/false); + touch_to_fill_controller().Show( + {}, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); histogram_tester().ExpectUniqueSample( "PasswordManager.TouchToFill.NumCredentialsShown", 0, 1); } @@ -351,8 +427,9 @@ EXPECT_CALL(view(), Show(Eq(GURL("http://example.com")), IsOriginSecure(false), ElementsAreArray(credentials), /*ready_for_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); } TEST_F(TouchToFillControllerTest, Show_And_Fill_Android_Credential) { @@ -375,8 +452,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); // Test that we correctly log the presence of an Android credential. EXPECT_CALL(driver(), FillSuggestion(std::u16string(u"bob"), @@ -429,8 +507,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), testing::ElementsAre(charlie, alice, bob, david), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); } TEST_F(TouchToFillControllerTest, Dismiss) { @@ -440,8 +519,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(true))); touch_to_fill_controller().OnDismiss(); @@ -463,8 +543,9 @@ EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), ElementsAreArray(credentials), /*trigger_submission=*/false)); - touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), - /*ready_for_submission=*/false); + touch_to_fill_controller().Show( + credentials, driver().AsWeakPtr(), + autofill::mojom::SubmissionReadinessState::kNoInformation); EXPECT_CALL(*authenticator(), CanAuthenticate(BiometricAuthRequester::kTouchToFill)) @@ -475,3 +556,100 @@ EXPECT_CALL(*authenticator(), Cancel(BiometricAuthRequester::kTouchToFill)); } + +class TouchToFillControllerTestWithSubmissionReadinessVariationTest + : public TouchToFillControllerTest, + public testing::WithParamInterface<SubmissionReadinessState> {}; + +TEST_P(TouchToFillControllerTestWithSubmissionReadinessVariationTest, + SubmissionReadiness) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + password_manager::features::kTouchToFillPasswordSubmission); + SubmissionReadinessState submission_readiness = GetParam(); + + UiCredential credentials[] = { + MakeUiCredential({.username = "alice", .password = "p4ssw0rd"})}; + + // If there is no field after the password, then submit the form. + bool submission_expected = + submission_readiness > SubmissionReadinessState::kFieldAfterPasswordField; + EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), + ElementsAreArray(credentials), + /*trigger_submission=*/submission_expected)); + touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), + submission_readiness); + + EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(true))); + touch_to_fill_controller().OnDismiss(); +} + +TEST_P(TouchToFillControllerTestWithSubmissionReadinessVariationTest, + SubmissionReadiness_ConservativeHeuristics) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeatureWithParameters( + password_manager::features::kTouchToFillPasswordSubmission, + {{password_manager::features:: + kTouchToFillPasswordSubmissionWithConservativeHeuristics, + "true"}}); + SubmissionReadinessState submission_readiness = GetParam(); + + UiCredential credentials[] = { + MakeUiCredential({.username = "alice", .password = "p4ssw0rd"})}; + + // Submit the form iff there is only two fields. + bool submission_expected = + submission_readiness == SubmissionReadinessState::kTwoFields; + + EXPECT_CALL(view(), Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), + ElementsAreArray(credentials), + /*trigger_submission=*/submission_expected)); + touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), + submission_readiness); + + EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(true))); + touch_to_fill_controller().OnDismiss(); +} + +TEST_P(TouchToFillControllerTestWithSubmissionReadinessVariationTest, + SubmissionReadinessMetrics) { + SubmissionReadinessState submission_readiness = GetParam(); + + base::HistogramTester uma_recorder; + + UiCredential credentials[] = { + MakeUiCredential({.username = "alice", .password = "p4ssw0rd"})}; + + EXPECT_CALL(view(), + Show(Eq(GURL(kExampleCom)), IsOriginSecure(true), + ElementsAreArray(credentials), /*trigger_submission=*/_)); + touch_to_fill_controller().Show(credentials, driver().AsWeakPtr(), + submission_readiness); + + EXPECT_CALL(driver(), TouchToFillClosed(ShowVirtualKeyboard(true))); + touch_to_fill_controller().OnDismiss(); + + uma_recorder.ExpectUniqueSample( + "PasswordManager.TouchToFill.SubmissionReadiness", submission_readiness, + 1); + + auto entries = test_recorder().GetEntriesByName( + ukm::builders::TouchToFill_SubmissionReadiness::kEntryName); + ASSERT_EQ(1u, entries.size()); + test_recorder().ExpectEntryMetric( + entries[0], + ukm::builders::TouchToFill_SubmissionReadiness::kSubmissionReadinessName, + static_cast<int64_t>(submission_readiness)); +} + +INSTANTIATE_TEST_SUITE_P( + SubmissionReadinessVariation, + TouchToFillControllerTestWithSubmissionReadinessVariationTest, + testing::Values(SubmissionReadinessState::kNoInformation, + SubmissionReadinessState::kError, + SubmissionReadinessState::kNoUsernameField, + SubmissionReadinessState::kFieldBetweenUsernameAndPassword, + SubmissionReadinessState::kFieldAfterPasswordField, + SubmissionReadinessState::kEmptyFields, + SubmissionReadinessState::kMoreThanTwoFields, + SubmissionReadinessState::kTwoFields));
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index d82bdf6..a2082fd 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -4432,7 +4432,6 @@ "views/overlay/back_to_tab_label_button.h", "views/overlay/close_image_button.cc", "views/overlay/close_image_button.h", - "views/overlay/constants.h", "views/overlay/document_overlay_window_views.cc", "views/overlay/document_overlay_window_views.h", "views/overlay/hang_up_button.cc",
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index e55e06a..2dabb25 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -901,16 +901,27 @@ <message name="IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_SUMMARY" desc="The description of card 1 of 3. * “browsing history”: we define this as “a record of sites you’ve visited using Chrome on this device.” By “recent”, we mean the last 3 weeks (also defined later in the UI). * “affects the ads you see”: We think we’re stating the obvious. The ads the user sees are affected by the things they do online, like browsing the web."> Your browsing history affects the ads you see </message> - <message name="IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE. * “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle)."> - Your browsing history affects the ads you see and the interests as estimated below. Chrome auto-deletes your interests every few weeks to protect your privacy. Interests refresh unless you remove them. + <message name="IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_TRIALS_ON" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE. * “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle)."> + Your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Chrome auto-deletes your interests on a rolling basis each month. Interests can refresh unless you remove them. + </message> + <message name="IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_NO_ITEMS" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE. * “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle)."> + If Chrome has randomly placed you in an active trial, your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Chrome deletes your interests on a rolling basis each month. Interests refresh unless you remove them. + </message> + <message name="IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_TRIALS_OFF" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE. * “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle)."> + When trials are on and if Chrome has randomly placed you in an active trial, your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Chrome deletes your interests on a rolling basis each month. </message> <message name="IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_TITLE" desc="The title of card 2 of 3. * The title of a Privacy Sandbox API used by advertisers to measure the effectiveness of ads."> Ad measurement </message> - <message name="IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION" desc="A description of the Ad measurement API. * “Ad measurement” is the name of an API in this context. We don’t use “API” with the user, but they need to know that there is something called “A measurement” and what it does. * “sites you visit”: call the API to get information. The actor is the site, not Chrome. * “restricts cross-site tracking”: Today, with 3rd-party cookies, ad measurement technologies can inadvertently (and intentionally) share considerable information from one site to another). This feature restricts that sharing in order to improve the user’s privacy. * “your browsing history”: points to chrome://history/ * “You can control…”: The user can “control” this data by clearing their browser data at chrome://history/"> + <message name="IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION_TRIALS_ON" desc="A description of the Ad measurement API. * “Ad measurement” is the name of an API in this context. We don’t use “API” with the user, but they need to know that there is something called “A measurement” and what it does. * “sites you visit”: call the API to get information. The actor is the site, not Chrome. * “restricts cross-site tracking”: Today, with 3rd-party cookies, ad measurement technologies can inadvertently (and intentionally) share considerable information from one site to another). This feature restricts that sharing in order to improve the user’s privacy. * “your browsing history”: points to chrome://history/ * “You can control…”: The user can “control” this data by clearing their browser data at chrome://history/"> Ad measurement allows sites you visit to request information from Chrome that helps the site measure the performance of their ads. Ad measurement restricts cross-site tracking by transferring as little information as possible between sites. -You can control measurement information associated with you by accessing <ph name="BEGIN_LINK"><link></ph>your browsing history<ph name="END_LINK"></link></ph>. +When you delete your browsing history — all or for a specific site — you also delete associated measurement info. See <ph name="BEGIN_LINK"><link></ph>your browsing history<ph name="END_LINK"></link></ph>. + </message> + <message name="IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION_TRIALS_OFF" desc="A description of the Ad measurement API. * “Ad measurement” is the name of an API in this context. We don’t use “API” with the user, but they need to know that there is something called “A measurement” and what it does. * “sites you visit”: call the API to get information. The actor is the site, not Chrome. * “restricts cross-site tracking”: Today, with 3rd-party cookies, ad measurement technologies can inadvertently (and intentionally) share considerable information from one site to another). This feature restricts that sharing in order to improve the user’s privacy. * “your browsing history”: points to chrome://history/ * “You can control…”: The user can “control” this data by clearing their browser data at chrome://history/"> + When trials are on, Ad measurement allows sites you visit to request information from Chrome that helps the site measure the performance of their ads. Ad measurement restricts cross-site tracking by transferring as little information as possible between sites. + +When you delete your browsing history — all or for a specific site — you also delete associated measurement info. See <ph name="BEGIN_LINK"><link></ph>your browsing history<ph name="END_LINK"></link></ph>. </message> <message name="IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_SUMMARY" desc="The description of card 2 of 3 * The description of a Privacy Sandbox API used by advertisers to measure the effectiveness of ads."> Advertisers can understand how ads perform @@ -921,13 +932,20 @@ <message name="IDS_PRIVACY_SANDBOX_SPAM_FRAUD_SUMMARY" desc="The description of card 3 of 3. * “help”: This API is one way that sites can fight fraud. Don’t suggest that sites must use this API to fight fraud. * “distinguish bots from people”: This touches on just one aspect of fraud but we hope it helps the user understand the purpose of this API, and that is to distinguish real users from malicious players." > Help sites fight fraud and distinguish bots from people </message> - <message name="IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION" desc="The first of 3 paragraphs on the spam & fraud card. This is a behind-the-scenes upgrade to Chrome. There aren’t any user controls or data to interact with, at least not yet. * “trust tokens”: explained in the next paragraph * “help”: This feature is one way that sites can fight fraud. Don’t suggest that sites must use this API to fight fraud. * “distinguish bots from people”: This touches on just one aspect of fraud but we hope it helps the user understand the purpose of this API, and that is to distinguish real users from malicious players. * “interaction”: is broad. It’s not just viewing a site but also how you interact with it, like by signing in * “Later”: is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understands this is essentially a two-step process. A trust token is issued. Sometime in the future, when hyou visit a different site, that trust token might get used. "> + <message name="IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION_TRIALS_ON" desc="The first of 3 paragraphs on the spam & fraud card. This is a behind-the-scenes upgrade to Chrome. There aren’t any user controls or data to interact with, at least not yet. * “trust tokens”: explained in the next paragraph * “help”: This feature is one way that sites can fight fraud. Don’t suggest that sites must use this API to fight fraud. * “distinguish bots from people”: This touches on just one aspect of fraud but we hope it helps the user understand the purpose of this API, and that is to distinguish real users from malicious players. * “interaction”: is broad. It’s not just viewing a site but also how you interact with it, like by signing in * “Later”: is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understands this is essentially a two-step process. A trust token is issued. Sometime in the future, when hyou visit a different site, that trust token might get used. "> Spam & fraud reduction relies on trust tokens to help sites fight fraud and distinguish bots from people. Based on your interaction with a site, like regularly signing in to an account, that site can issue a trust token to your browser. Later, if other sites you visit check for and find a valid trust token, they’re more likely to treat you like a person and not a bot. Trust tokens improve privacy on the web and can’t be used to find out who you are. </message> + <message name="IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION_TRIALS_OFF" desc="The first of 3 paragraphs on the spam & fraud card. This is a behind-the-scenes upgrade to Chrome. There aren’t any user controls or data to interact with, at least not yet. * “trust tokens”: explained in the next paragraph * “help”: This feature is one way that sites can fight fraud. Don’t suggest that sites must use this API to fight fraud. * “distinguish bots from people”: This touches on just one aspect of fraud but we hope it helps the user understand the purpose of this API, and that is to distinguish real users from malicious players. * “interaction”: is broad. It’s not just viewing a site but also how you interact with it, like by signing in * “Later”: is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understands this is essentially a two-step process. A trust token is issued. Sometime in the future, when hyou visit a different site, that trust token might get used. "> + When trials are on, Spam & fraud reduction relies on trust tokens to help sites fight fraud and distinguish bots from people. + +Based on your interaction with a site, like regularly signing in to an account, that site can issue a trust token to your browser. Later, if other sites you visit check for and find a valid trust token, they’re more likely to treat you like a person and not a bot. + +Trust tokens improve privacy on the web and can’t be used to find out who you are. + </message> <message name="IDS_PRIVACY_SANDBOX_LEARN_MORE_DESCRIPTION_1" desc="TOPICS API Bullet 1 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chrome’s top level. The Topics API estimates topics of interest based on sites in the user’s browsing history that are participating in the trials."> <ph name="BEGIN_BOLD"><b></ph>What data is used:<ph name="END_BOLD"></b></ph> Your browsing history, a record of sites you’ve visited using Chrome on this device. </message>
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION_TRIALS_OFF.png.sha1 similarity index 100% copy from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION.png.sha1 copy to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION_TRIALS_OFF.png.sha1
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION_TRIALS_ON.png.sha1 similarity index 100% rename from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION.png.sha1 rename to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_MEASUREMENT_DESCRIPTION_TRIALS_ON.png.sha1
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_NO_ITEMS.png.sha1 similarity index 100% copy from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION.png.sha1 copy to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_NO_ITEMS.png.sha1
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_TRIALS_OFF.png.sha1 similarity index 100% copy from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION.png.sha1 copy to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_TRIALS_OFF.png.sha1
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_TRIALS_ON.png.sha1 similarity index 100% rename from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION.png.sha1 rename to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DESCRIPTION_TRIALS_ON.png.sha1
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION_TRIALS_OFF.png.sha1 similarity index 100% copy from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION.png.sha1 copy to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION_TRIALS_OFF.png.sha1
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION_TRIALS_ON.png.sha1 similarity index 100% rename from chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION.png.sha1 rename to chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PRIVACY_SANDBOX_SPAM_FRAUD_DESCRIPTION_TRIALS_ON.png.sha1
diff --git a/chrome/browser/ui/ash/projector/projector_navigation_throttle_browsertest.cc b/chrome/browser/ui/ash/projector/projector_navigation_throttle_browsertest.cc index d74dd86..ea14a5d 100644 --- a/chrome/browser/ui/ash/projector/projector_navigation_throttle_browsertest.cc +++ b/chrome/browser/ui/ash/projector/projector_navigation_throttle_browsertest.cc
@@ -27,6 +27,7 @@ #include "content/public/browser/navigation_entry.h" #include "content/public/common/page_type.h" #include "content/public/test/browser_test.h" +#include "content/public/test/browser_test_utils.h" #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition.h" #include "url/gurl.h" @@ -226,6 +227,13 @@ // URL remains unchanged. EXPECT_EQ(tab->GetVisibleURL().spec(), url); + // Verify the document language. We must use the deprecated + // ExecuteScriptAndExtract*() instead of EvalJs() due to CSP. + std::string lang; + ASSERT_TRUE(content::ExecuteScriptAndExtractString( + tab, "domAutomationController.send(document.documentElement.lang)", + &lang)); + EXPECT_EQ(lang, "en-US"); } // Verifies that navigating to chrome://projector/app/ does not redirect.
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index e412b51b..d7a0fe7 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc
@@ -443,9 +443,9 @@ browser, extension_urls::GetWebstoreLaunchURL()); } -void ShowPrivacySandboxSettings(Browser* browser) { +void ShowPrivacySandboxAdPersonalization(Browser* browser) { base::RecordAction(UserMetricsAction("Options_ShowPrivacySandbox")); - ShowSettingsSubPage(browser, kPrivacySandboxSubPage); + ShowSettingsSubPage(browser, kPrivacySandboxAdPersonalizationSubPage); } #if BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/ui/chrome_pages.h b/chrome/browser/ui/chrome_pages.h index 171abb6c2..5064dfb 100644 --- a/chrome/browser/ui/chrome_pages.h +++ b/chrome/browser/ui/chrome_pages.h
@@ -163,7 +163,7 @@ void ShowAboutChrome(Browser* browser); void ShowSearchEngineSettings(Browser* browser); void ShowWebStore(Browser* browser); -void ShowPrivacySandboxSettings(Browser* browser); +void ShowPrivacySandboxAdPersonalization(Browser* browser); #if BUILDFLAG(IS_CHROMEOS_ASH) // Shows the enterprise management info page in a browser tab.
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer.cc b/chrome/browser/ui/cocoa/handoff_active_url_observer.cc index df4ebfe..ffb72e7 100644 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer.cc +++ b/chrome/browser/ui/cocoa/handoff_active_url_observer.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "content/public/browser/navigation_handle.h" +#include "content/public/browser/page.h" #include "content/public/browser/web_contents.h" HandoffActiveURLObserver::HandoffActiveURLObserver( @@ -52,15 +52,7 @@ delegate_->HandoffActiveURLChanged(selection.new_contents); } -void HandoffActiveURLObserver::DidFinishNavigation( - content::NavigationHandle* navigation_handle) { - // TODO(https://crbug.com/1218946): With MPArch there may be multiple main - // frames. This caller was converted automatically to the primary main frame - // to preserve its semantics. Follow up to confirm correctness. - if (!navigation_handle->IsInPrimaryMainFrame() || - !navigation_handle->HasCommitted()) - return; - +void HandoffActiveURLObserver::PrimaryPageChanged(content::Page& page) { delegate_->HandoffActiveURLChanged(web_contents()); }
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer.h b/chrome/browser/ui/cocoa/handoff_active_url_observer.h index 3247c17..af19043 100644 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer.h +++ b/chrome/browser/ui/cocoa/handoff_active_url_observer.h
@@ -10,6 +10,7 @@ #include "content/public/browser/web_contents_observer.h" namespace content { +class Page; class WebContents; } @@ -42,8 +43,7 @@ const TabStripSelectionChange& selection) override; // content::WebContentsObserver - void DidFinishNavigation( - content::NavigationHandle* navigation_handle) override; + void PrimaryPageChanged(content::Page& page) override; // Updates the active browser. void SetActiveBrowser(Browser* active_browser);
diff --git a/chrome/browser/ui/color/chrome_color_id.h b/chrome/browser/ui/color/chrome_color_id.h index dea02d4..a0b54cb 100644 --- a/chrome/browser/ui/color/chrome_color_id.h +++ b/chrome/browser/ui/color/chrome_color_id.h
@@ -164,10 +164,15 @@ ThemeProperties::COLOR_OMNIBOX_SECURITY_CHIP_SECURE) \ E(kColorOmniboxText, ThemeProperties::COLOR_OMNIBOX_TEXT) \ E(kColorOmniboxTextDimmed, ThemeProperties::COLOR_OMNIBOX_TEXT_DIMMED) \ - /* Overlay colors. */ \ - E_CPONLY(kColorOverlayWindowBackgroundColor) \ /* Payments colors. */ \ E_CPONLY(kColorPaymentRequestRowBackgroundHighlighted) \ + /* Picture-in-Picture window colors. */ \ + E_CPONLY(kColorPipWindowBackToTabButtonBackground) \ + E_CPONLY(kColorPipWindowBackground) \ + E_CPONLY(kColorPipWindowForeground) \ + E_CPONLY(kColorPipWindowHangUpButtonForeground) \ + E_CPONLY(kColorPipWindowSkipAdButtonBackground) \ + E_CPONLY(kColorPipWindowSkipAdButtonBorder) \ /* QR code colors. */ \ E_CPONLY(kColorQrCodeBackground) \ E_CPONLY(kColorQrCodeBorder) \
diff --git a/chrome/browser/ui/color/chrome_color_mixer.cc b/chrome/browser/ui/color/chrome_color_mixer.cc index 0417dea..35eb80a3 100644 --- a/chrome/browser/ui/color/chrome_color_mixer.cc +++ b/chrome/browser/ui/color/chrome_color_mixer.cc
@@ -295,9 +295,16 @@ ui::kColorButtonForeground}; mixer[kColorOmniboxText] = ui::GetColorWithMaxContrast(kColorOmniboxBackground); - mixer[kColorOverlayWindowBackgroundColor] = {SK_ColorBLACK}; mixer[kColorPaymentRequestRowBackgroundHighlighted] = { SkColorSetA(SK_ColorBLACK, 0x0D)}; + mixer[kColorPipWindowBackToTabButtonBackground] = { + SkColorSetA(SK_ColorBLACK, 0x60)}; + mixer[kColorPipWindowBackground] = {SK_ColorBLACK}; + mixer[kColorPipWindowForeground] = + ui::GetColorWithMaxContrast(kColorPipWindowBackground); + mixer[kColorPipWindowHangUpButtonForeground] = {gfx::kGoogleRed300}; + mixer[kColorPipWindowSkipAdButtonBackground] = {gfx::kGoogleGrey700}; + mixer[kColorPipWindowSkipAdButtonBorder] = {kColorPipWindowForeground}; mixer[kColorQrCodeBackground] = {SK_ColorWHITE}; mixer[kColorQrCodeBorder] = {ui::kColorMidground}; mixer[kColorReadLaterButtonHighlight] = {kColorAvatarButtonHighlightNormal};
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 3711e38..ba96345d 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
@@ -162,9 +162,9 @@ return count > 1; } -void ChromePageInfoUiDelegate::ShowPrivacySandboxSettings() { +void ChromePageInfoUiDelegate::ShowPrivacySandboxAdPersonalization() { Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); - chrome::ShowPrivacySandboxSettings(browser); + chrome::ShowPrivacySandboxAdPersonalization(browser); } std::u16string ChromePageInfoUiDelegate::GetPermissionDetail(
diff --git a/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h b/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h index 666f809..c714a3c 100644 --- a/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h +++ b/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h
@@ -54,8 +54,8 @@ // extra details to the user concerning the granted permission. std::u16string GetPermissionDetail(ContentSettingsType type); - // Opens "Privacy Sandbox" settings page. - void ShowPrivacySandboxSettings(); + // Opens Privacy Sandbox's "Ad Personalzation" settings page. + void ShowPrivacySandboxAdPersonalization(); // PageInfoUiDelegate implementation bool IsBlockAutoPlayEnabled() override;
diff --git a/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc b/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc index 29b5efc..e99fa4a 100644 --- a/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc +++ b/chrome/browser/ui/quick_answers/quick_answers_controller_impl.cc
@@ -55,16 +55,10 @@ return false; bool settings_enabled = QuickAnswersState::Get()->settings_enabled(); - // Respect the managed settings. - if (QuickAnswersState::Get()->IsSettingsEnforced()) - return settings_enabled; - - if (settings_enabled) - return true; bool should_show_consent = QuickAnswersState::Get()->consent_status() == quick_answers::prefs::ConsentStatus::kUnknown; - return should_show_consent; + return settings_enabled || should_show_consent; } } // namespace
diff --git a/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.cc b/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.cc index 4d53e17c..86f3264 100644 --- a/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.cc +++ b/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.cc
@@ -156,12 +156,19 @@ const VirtualCardEnrollmentFields virtual_card_enrollment_fields = controller_->GetVirtualCardEnrollmentFields(); CreditCard card = virtual_card_enrollment_fields.credit_card; - gfx::Image* card_image = virtual_card_enrollment_fields.card_art_image.get(); + gfx::Image* card_image = virtual_card_enrollment_fields.card_art_image; - auto* const card_network_icon = + card_network_icon_ = description_view->AddChildView(std::make_unique<views::ImageView>()); - card_network_icon->SetImage(card_image->AsImageSkia()); - card_network_icon->SetTooltipText(card.NetworkForDisplay()); + DCHECK(!card.network().empty()); + + // If the card art image is retrieved at this point, display that. Otherwise + // fallback to the network icon. + card_network_icon_->SetImage( + card_image ? card_image->AsImageSkia() + : *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( + CreditCard::IconResourceId(card.network()))); + card_network_icon_->SetTooltipText(card.NetworkForDisplay()); const std::u16string card_info = card.CardIdentifierStringForAutofillDisplay();
diff --git a/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.h b/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.h index f51f7f24..5654c19 100644 --- a/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.h +++ b/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views.h
@@ -12,6 +12,7 @@ #include "chrome/browser/ui/views/autofill/payments/payments_view_util.h" #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.h" #include "components/autofill/core/browser/ui/payments/payments_bubble_closed_reasons.h" +#include "ui/views/controls/image_view.h" namespace content { class WebContents; @@ -37,6 +38,10 @@ void Show(DisplayReason reason); + bool NetworkIconNotEmptyForTesting() { + return !card_network_icon_->GetImageModel().IsEmpty(); + } + // AutofillBubbleBase: void Hide() override; @@ -67,6 +72,8 @@ PaymentsBubbleClosedReason closed_reason_ = PaymentsBubbleClosedReason::kUnknown; + raw_ptr<views::ImageView> card_network_icon_ = nullptr; + base::WeakPtrFactory<VirtualCardEnrollBubbleViews> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views_interactive_uitest.cc b/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views_interactive_uitest.cc index 67b17c8..afcef475 100644 --- a/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views_interactive_uitest.cc +++ b/chrome/browser/ui/views/autofill/payments/virtual_card_enroll_bubble_views_interactive_uitest.cc
@@ -172,6 +172,18 @@ EXPECT_TRUE(GetBubbleViews()); EXPECT_TRUE(IsIconVisible()); + // Ensure there is a non-empty image set if no card art image is present. + VirtualCardEnrollmentFields + upstream_virtual_card_enrollment_fields_no_card_art_image = + upstream_virtual_card_enrollment_fields(); + upstream_virtual_card_enrollment_fields_no_card_art_image.card_art_image = + nullptr; + ShowBubbleAndWaitUntilShown( + upstream_virtual_card_enrollment_fields_no_card_art_image, + base::DoNothing(), base::DoNothing()); + EXPECT_TRUE(GetBubbleViews()->NetworkIconNotEmptyForTesting()); + EXPECT_TRUE(IsIconVisible()); + ShowBubbleAndWaitUntilShown(downstream_virtual_card_enrollment_fields(), base::DoNothing(), base::DoNothing()); EXPECT_TRUE(GetBubbleViews());
diff --git a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc index eac47f7..7309977 100644 --- a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc +++ b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc
@@ -523,6 +523,7 @@ installed_item->view_controller())); } +// TODO(crbug.com/1304959): Test is flaky. TEST_F(ExtensionsTabbedMenuViewUnitTest, InstalledTab_AddAndRemoveExtensionWhenMenuIsOpen) { constexpr char kExtensionA[] = "A Extension"; @@ -738,6 +739,7 @@ EXPECT_EQ(requests_access_items().size(), 0u); } +// TODO(crbug.com/1304951): Test is flaky. TEST_F( ExtensionsTabbedMenuViewUnitTest, SiteAccessTab_ExtensionInCorrectSiteAccessSectionAfterChangingSiteAccessUsingCombobox) { @@ -780,6 +782,7 @@ kOnClickComboboxIndex); } +// TODO(crbug.com/1304951): Test is flaky. TEST_F( ExtensionsTabbedMenuViewUnitTest, SiteAccessTab_ExtensionInCorrectSiteAccessSectionAfterChangingSiteAccessUsingContextMenu) { @@ -844,6 +847,7 @@ kOnClickComboboxIndex); } +// TODO(crbug.com/1304951): Test is flaky. TEST_F( ExtensionsTabbedMenuViewUnitTest, SiteAccessTab_ExtensionsInCorrectSiteAccessSectionAfterClickingOnAction) { @@ -884,6 +888,7 @@ kOnClickComboboxIndex); } +// TODO(crbug.com/1304959): Test is flaky. TEST_F(ExtensionsTabbedMenuViewUnitTest, SiteAccessTab_AddAndRemoveExtensionWhenMenuIsOpen) { constexpr char kExtensionA[] = "A Extension";
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc index 063cbf00..7bc8d11 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc +++ b/chrome/browser/ui/views/overlay/back_to_tab_image_button.cc
@@ -4,11 +4,11 @@ #include "chrome/browser/ui/views/overlay/back_to_tab_image_button.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/gfx/color_palette.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/vector_icons.h" @@ -20,9 +20,10 @@ BackToTabImageButton::BackToTabImageButton(PressedCallback callback) : OverlayWindowImageButton(std::move(callback)) { - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(views::kLaunchIcon, kBackToTabImageSize, - kPipWindowIconColor)); + SetImageModel( + views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + views::kLaunchIcon, kColorPipWindowForeground, kBackToTabImageSize)); // Accessibility. const std::u16string back_to_tab_button_label(l10n_util::GetStringUTF16(
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc b/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc index 648e199c..7d0e399 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc +++ b/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc
@@ -4,13 +4,12 @@ #include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/cursor/cursor.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/gfx/color_palette.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" #include "ui/views/border.h" @@ -30,8 +29,6 @@ constexpr int kBackToTabBorderRadius = (kBackToTabButtonSize + (2 * kBackToTabBorderThickness)) / 2; -constexpr SkColor kBackToTabBackgroundColor = SkColorSetA(SK_ColorBLACK, 0x60); - } // namespace BackToTabLabelButton::BackToTabLabelButton(PressedCallback callback) @@ -45,27 +42,20 @@ // Elide the origin at the front of the text. SetElideBehavior(gfx::ElideBehavior::ELIDE_HEAD); - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(views::kLaunchIcon, kBackToTabImageSize, - kPipWindowIconColor)); + SetImageModel( + views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + views::kLaunchIcon, kColorPipWindowForeground, kBackToTabImageSize)); // Prevent DCHECKing for our non-opaque background. SetTextSubpixelRenderingEnabled(false); - // Leave the border transparent since the background will color it. - SetBorder(views::CreateRoundedRectBorder( - kBackToTabBorderThickness, kBackToTabBorderRadius, SK_ColorTRANSPARENT)); - - SetBackground(views::CreateRoundedRectBackground(kBackToTabBackgroundColor, - kBackToTabBorderRadius)); + SetBorder(views::CreateEmptyBorder(gfx::Insets(kBackToTabBorderThickness))); const std::u16string back_to_tab_button_label(l10n_util::GetStringUTF16( IDS_PICTURE_IN_PICTURE_BACK_TO_TAB_CONTROL_TEXT)); SetText(back_to_tab_button_label); - SetEnabledTextColors(kPipWindowTextColor); - SetTextColor(views::Button::STATE_DISABLED, kPipWindowTextColor); - // Accessibility. SetAccessibleName(back_to_tab_button_label); SetInstallFocusRingOnFocus(true); @@ -77,6 +67,19 @@ return views::GetNativeHandCursor(); } +void BackToTabLabelButton::OnThemeChanged() { + views::LabelButton::OnThemeChanged(); + + const auto* const color_provider = GetColorProvider(); + SetBackground(views::CreateRoundedRectBackground( + color_provider->GetColor(kColorPipWindowBackToTabButtonBackground), + kBackToTabBorderRadius)); + const SkColor foreground_color = + color_provider->GetColor(kColorPipWindowForeground); + SetEnabledTextColors(foreground_color); + SetTextColor(views::Button::STATE_DISABLED, foreground_color); +} + void BackToTabLabelButton::SetWindowSize(const gfx::Size& window_size) { if (window_size_.has_value() && window_size_.value() == window_size) return;
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_label_button.h b/chrome/browser/ui/views/overlay/back_to_tab_label_button.h index c1d41e0..b802448c 100644 --- a/chrome/browser/ui/views/overlay/back_to_tab_label_button.h +++ b/chrome/browser/ui/views/overlay/back_to_tab_label_button.h
@@ -21,6 +21,7 @@ // views::View: gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; + void OnThemeChanged() override; // Updates the position of this button within the new bounds of the window. void SetWindowSize(const gfx::Size& window_size);
diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc index 0c1fa867..d3400d7 100644 --- a/chrome/browser/ui/views/overlay/close_image_button.cc +++ b/chrome/browser/ui/views/overlay/close_image_button.cc
@@ -5,11 +5,11 @@ #include "chrome/browser/ui/views/overlay/close_image_button.h" #include "build/chromeos_buildflags.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/gfx/color_palette.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/vector_icons.h" @@ -23,9 +23,10 @@ CloseImageButton::CloseImageButton(PressedCallback callback) : OverlayWindowImageButton(std::move(callback)) { SetSize(gfx::Size(kCloseButtonSize, kCloseButtonSize)); - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(views::kIcCloseIcon, kCloseButtonSize, - kPipWindowIconColor)); + SetImageModel( + views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + views::kIcCloseIcon, kColorPipWindowForeground, kCloseButtonSize)); // Accessibility. const std::u16string close_button_label(
diff --git a/chrome/browser/ui/views/overlay/constants.cc b/chrome/browser/ui/views/overlay/constants.cc deleted file mode 100644 index 583c50e..0000000 --- a/chrome/browser/ui/views/overlay/constants.cc +++ /dev/null
@@ -1,5 +0,0 @@ -// Copyright 2021 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/views/overlay/constants.h"
diff --git a/chrome/browser/ui/views/overlay/constants.h b/chrome/browser/ui/views/overlay/constants.h deleted file mode 100644 index 73bfa0c..0000000 --- a/chrome/browser/ui/views/overlay/constants.h +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2021 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_UI_VIEWS_OVERLAY_CONSTANTS_H_ -#define CHROME_BROWSER_UI_VIEWS_OVERLAY_CONSTANTS_H_ - -#include "third_party/skia/include/core/SkColor.h" - -constexpr SkColor kPipWindowIconColor = SK_ColorWHITE; - -constexpr SkColor kPipWindowTextColor = SK_ColorWHITE; - -#endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_CONSTANTS_H_
diff --git a/chrome/browser/ui/views/overlay/document_overlay_window_views.cc b/chrome/browser/ui/views/overlay/document_overlay_window_views.cc index 0202f96..3309906 100644 --- a/chrome/browser/ui/views/overlay/document_overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/document_overlay_window_views.cc
@@ -99,8 +99,7 @@ void OnThemeChanged() override { views::View::OnThemeChanged(); - layer()->SetColor( - GetColorProvider()->GetColor(kColorOverlayWindowBackgroundColor)); + layer()->SetColor(GetColorProvider()->GetColor(kColorPipWindowBackground)); } }; @@ -510,7 +509,7 @@ // | web view | // +-------------------------------------------+ if (controls_container_view_->GetIndexOf(close_controls_view_) != 0) { - resize_handle_view_->SetImageForQuadrant(quadrant); + resize_handle_view_->SetQuadrant(quadrant); controls_container_view_->ReorderChildView(close_controls_view_, 0); controls_container_view_->ReorderChildView(back_to_tab_image_button_, 1); controls_container_view_->ReorderChildView(resize_handle_view_, -1); @@ -526,7 +525,7 @@ // | web view | // +-------------------------------------------+ if (controls_container_view_->GetIndexOf(resize_handle_view_) != 0) { - resize_handle_view_->SetImageForQuadrant(quadrant); + resize_handle_view_->SetQuadrant(quadrant); controls_container_view_->ReorderChildView(back_to_tab_image_button_, -1); controls_container_view_->ReorderChildView(close_controls_view_, -1); controls_container_view_->ReorderChildView(resize_handle_view_, 0);
diff --git a/chrome/browser/ui/views/overlay/hang_up_button.cc b/chrome/browser/ui/views/overlay/hang_up_button.cc index 8e54570..26f8f5ff 100644 --- a/chrome/browser/ui/views/overlay/hang_up_button.cc +++ b/chrome/browser/ui/views/overlay/hang_up_button.cc
@@ -4,18 +4,14 @@ #include "chrome/browser/ui/views/overlay/hang_up_button.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" -namespace { - -constexpr SkColor kHangUpButtonColor = gfx::kGoogleRed300; - -} // namespace - HangUpButton::HangUpButton(PressedCallback callback) : OverlayWindowImageButton(std::move(callback)) { SetTooltipText( @@ -31,9 +27,10 @@ } void HangUpButton::UpdateImage() { - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(vector_icons::kCallEndIcon, width(), - kHangUpButtonColor)); + SetImageModel(views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon( + vector_icons::kCallEndIcon, + kColorPipWindowHangUpButtonForeground, width())); } BEGIN_METADATA(HangUpButton, OverlayWindowImageButton)
diff --git a/chrome/browser/ui/views/overlay/overlay_window_image_button.cc b/chrome/browser/ui/views/overlay/overlay_window_image_button.cc index 1a6ac3e..6c140ae 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_image_button.cc +++ b/chrome/browser/ui/views/overlay/overlay_window_image_button.cc
@@ -4,9 +4,10 @@ #include "chrome/browser/ui/views/overlay/overlay_window_image_button.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "ui/base/cursor/cursor.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/color/color_provider.h" #include "ui/views/animation/ink_drop.h" #include "ui/views/controls/button/image_button_factory.h" #include "ui/views/native_cursor.h" @@ -17,7 +18,6 @@ SetImageVerticalAlignment(views::ImageButton::ALIGN_MIDDLE); views::ConfigureVectorImageButton(this); - views::InkDrop::Get(this)->SetBaseColor(kPipWindowIconColor); SetInstallFocusRingOnFocus(true); } @@ -27,5 +27,12 @@ return views::GetNativeHandCursor(); } +void OverlayWindowImageButton::OnThemeChanged() { + views::ImageButton::OnThemeChanged(); + + views::InkDrop::Get(this)->SetBaseColor( + GetColorProvider()->GetColor(kColorPipWindowForeground)); +} + BEGIN_METADATA(OverlayWindowImageButton, views::ImageButton) END_METADATA
diff --git a/chrome/browser/ui/views/overlay/overlay_window_image_button.h b/chrome/browser/ui/views/overlay/overlay_window_image_button.h index 275b9cf..cbc723fe7 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_image_button.h +++ b/chrome/browser/ui/views/overlay/overlay_window_image_button.h
@@ -22,6 +22,7 @@ // views::View: gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; + void OnThemeChanged() override; }; #endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_OVERLAY_WINDOW_IMAGE_BUTTON_H_
diff --git a/chrome/browser/ui/views/overlay/playback_image_button.cc b/chrome/browser/ui/views/overlay/playback_image_button.cc index ad413df..bcd3b2e1 100644 --- a/chrome/browser/ui/views/overlay/playback_image_button.cc +++ b/chrome/browser/ui/views/overlay/playback_image_button.cc
@@ -5,11 +5,12 @@ #include "chrome/browser/ui/views/overlay/playback_image_button.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/vector_icons.h" @@ -23,12 +24,12 @@ } void PlaybackImageButton::OnBoundsChanged(const gfx::Rect& rect) { - play_image_ = gfx::CreateVectorIcon(vector_icons::kPlayArrowIcon, - size().width(), kPipWindowIconColor); - pause_image_ = gfx::CreateVectorIcon(vector_icons::kPauseIcon, size().width(), - kPipWindowIconColor); - replay_image_ = gfx::CreateVectorIcon(vector_icons::kReplayIcon, - size().width(), kPipWindowIconColor); + play_image_ = ui::ImageModel::FromVectorIcon( + vector_icons::kPlayArrowIcon, kColorPipWindowForeground, size().width()); + pause_image_ = ui::ImageModel::FromVectorIcon( + vector_icons::kPauseIcon, kColorPipWindowForeground, size().width()); + replay_image_ = ui::ImageModel::FromVectorIcon( + vector_icons::kReplayIcon, kColorPipWindowForeground, size().width()); UpdateImageAndTooltipText(); } @@ -45,17 +46,17 @@ void PlaybackImageButton::UpdateImageAndTooltipText() { switch (playback_state_) { case VideoOverlayWindowViews::kPlaying: - SetImage(views::Button::STATE_NORMAL, pause_image_); + SetImageModel(views::Button::STATE_NORMAL, pause_image_); SetTooltipText( l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_PAUSE_CONTROL_TEXT)); break; case VideoOverlayWindowViews::kPaused: - SetImage(views::Button::STATE_NORMAL, play_image_); + SetImageModel(views::Button::STATE_NORMAL, play_image_); SetTooltipText( l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_PLAY_CONTROL_TEXT)); break; case VideoOverlayWindowViews::kEndOfVideo: - SetImage(views::Button::STATE_NORMAL, replay_image_); + SetImageModel(views::Button::STATE_NORMAL, replay_image_); SetTooltipText(l10n_util::GetStringUTF16( IDS_PICTURE_IN_PICTURE_REPLAY_CONTROL_TEXT)); break;
diff --git a/chrome/browser/ui/views/overlay/playback_image_button.h b/chrome/browser/ui/views/overlay/playback_image_button.h index 7247a28f..14fdcf5 100644 --- a/chrome/browser/ui/views/overlay/playback_image_button.h +++ b/chrome/browser/ui/views/overlay/playback_image_button.h
@@ -8,6 +8,7 @@ #include "chrome/browser/ui/views/overlay/overlay_window_image_button.h" #include "chrome/browser/ui/views/overlay/video_overlay_window_views.h" #include "ui/base/metadata/metadata_header_macros.h" +#include "ui/base/models/image_model.h" // A resizable playback button with 3 states: play/pause/replay. class PlaybackImageButton : public OverlayWindowImageButton { @@ -33,9 +34,9 @@ VideoOverlayWindowViews::PlaybackState playback_state_ = VideoOverlayWindowViews::PlaybackState::kEndOfVideo; - gfx::ImageSkia play_image_; - gfx::ImageSkia pause_image_; - gfx::ImageSkia replay_image_; + ui::ImageModel play_image_; + ui::ImageModel pause_image_; + ui::ImageModel replay_image_; }; #endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_PLAYBACK_IMAGE_BUTTON_H_
diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.cc b/chrome/browser/ui/views/overlay/resize_handle_button.cc index 90c9dbbf..8bf217b 100644 --- a/chrome/browser/ui/views/overlay/resize_handle_button.cc +++ b/chrome/browser/ui/views/overlay/resize_handle_button.cc
@@ -5,12 +5,12 @@ #include "chrome/browser/ui/views/overlay/resize_handle_button.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/gfx/color_palette.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/skbitmap_operations.h" @@ -26,7 +26,6 @@ ResizeHandleButton::ResizeHandleButton(PressedCallback callback) : views::ImageButton(std::move(callback)) { SetSize(gfx::Size(kResizeHandleButtonSize, kResizeHandleButtonSize)); - SetImageForQuadrant(OverlayWindowViews::WindowQuadrant::kBottomRight); // Accessibility. const std::u16string resize_button_label( @@ -38,11 +37,13 @@ ResizeHandleButton::~ResizeHandleButton() = default; -int ResizeHandleButton::GetHTComponent() const { - if (!current_quadrant_) - return HTNOWHERE; +void ResizeHandleButton::OnThemeChanged() { + views::ImageButton::OnThemeChanged(); + UpdateImageForQuadrant(); +} - switch (current_quadrant_.value()) { +int ResizeHandleButton::GetHTComponent() const { + switch (current_quadrant_) { case OverlayWindowViews::WindowQuadrant::kBottomLeft: return HTTOPRIGHT; case OverlayWindowViews::WindowQuadrant::kBottomRight: @@ -82,18 +83,23 @@ } // Also rotate the icon to match the new corner. - SetImageForQuadrant(quadrant); + SetQuadrant(quadrant); } -void ResizeHandleButton::SetImageForQuadrant( +void ResizeHandleButton::SetQuadrant( OverlayWindowViews::WindowQuadrant quadrant) { if (current_quadrant_ == quadrant) return; current_quadrant_ = quadrant; + if (GetWidget()) + UpdateImageForQuadrant(); +} - gfx::ImageSkia icon = gfx::CreateVectorIcon( - kResizeHandleIcon, kResizeHandleButtonSize, kPipWindowIconColor); - switch (quadrant) { +void ResizeHandleButton::UpdateImageForQuadrant() { + const SkColor color = GetColorProvider()->GetColor(kColorPipWindowForeground); + gfx::ImageSkia icon = + gfx::CreateVectorIcon(kResizeHandleIcon, kResizeHandleButtonSize, color); + switch (current_quadrant_) { case OverlayWindowViews::WindowQuadrant::kBottomLeft: SetImageHorizontalAlignment(views::ImageButton::ALIGN_RIGHT); SetImageVerticalAlignment(views::ImageButton::ALIGN_TOP);
diff --git a/chrome/browser/ui/views/overlay/resize_handle_button.h b/chrome/browser/ui/views/overlay/resize_handle_button.h index edd0ab4..1ab84f35 100644 --- a/chrome/browser/ui/views/overlay/resize_handle_button.h +++ b/chrome/browser/ui/views/overlay/resize_handle_button.h
@@ -19,13 +19,18 @@ ResizeHandleButton& operator=(const ResizeHandleButton&) = delete; ~ResizeHandleButton() override; + void OnThemeChanged() override; + void SetPosition(const gfx::Size& size, OverlayWindowViews::WindowQuadrant quadrant); int GetHTComponent() const; - void SetImageForQuadrant(OverlayWindowViews::WindowQuadrant quadrant); + void SetQuadrant(OverlayWindowViews::WindowQuadrant quadrant); private: - absl::optional<OverlayWindowViews::WindowQuadrant> current_quadrant_; + void UpdateImageForQuadrant(); + + OverlayWindowViews::WindowQuadrant current_quadrant_ = + OverlayWindowViews::WindowQuadrant::kBottomRight; }; #endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_RESIZE_HANDLE_BUTTON_H_
diff --git a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc index ae3b37b..51c7db1b 100644 --- a/chrome/browser/ui/views/overlay/skip_ad_label_button.cc +++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/ui/views/overlay/skip_ad_label_button.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -18,22 +18,13 @@ const int kSkipAdButtonHeight = 24; const int kSkipAdButtonMarginBottom = 48; -constexpr SkColor kSkipAdButtonTextColor = kPipWindowIconColor; -constexpr SkColor kSkipAdButtonBorderColor = kPipWindowIconColor; -constexpr SkColor kSkipAdButtonBackgroundColor = gfx::kGoogleGrey700; - } // namespace SkipAdLabelButton::SkipAdLabelButton(PressedCallback callback) : views::LabelButton(std::move(callback), l10n_util::GetStringUTF16( IDS_PICTURE_IN_PICTURE_SKIP_AD_CONTROL_TEXT)) { - SetBackground(CreateBackgroundFromPainter( - views::Painter::CreateRoundRectWith1PxBorderPainter( - kSkipAdButtonBackgroundColor, kSkipAdButtonBorderColor, 1.f))); SetHorizontalAlignment(gfx::ALIGN_CENTER); - SetEnabledTextColors(kSkipAdButtonTextColor); - SetTextColor(views::Button::STATE_DISABLED, kSkipAdButtonTextColor); SetSize(gfx::Size(kSkipAdButtonWidth, kSkipAdButtonHeight)); // Accessibility. @@ -56,5 +47,19 @@ : gfx::Size()); } +void SkipAdLabelButton::OnThemeChanged() { + views::LabelButton::OnThemeChanged(); + + const auto* const color_provider = GetColorProvider(); + SetBackground(CreateBackgroundFromPainter( + views::Painter::CreateRoundRectWith1PxBorderPainter( + color_provider->GetColor(kColorPipWindowSkipAdButtonBackground), + color_provider->GetColor(kColorPipWindowSkipAdButtonBorder), 1.f))); + const SkColor foreground_color = + color_provider->GetColor(kColorPipWindowForeground); + SetEnabledTextColors(foreground_color); + SetTextColor(views::Button::STATE_DISABLED, foreground_color); +} + BEGIN_METADATA(SkipAdLabelButton, views::LabelButton) END_METADATA
diff --git a/chrome/browser/ui/views/overlay/skip_ad_label_button.h b/chrome/browser/ui/views/overlay/skip_ad_label_button.h index a6314bf..554dd307 100644 --- a/chrome/browser/ui/views/overlay/skip_ad_label_button.h +++ b/chrome/browser/ui/views/overlay/skip_ad_label_button.h
@@ -24,6 +24,7 @@ // Overridden from views::View. void SetVisible(bool is_visible) override; + void OnThemeChanged() override; }; #endif // CHROME_BROWSER_UI_VIEWS_OVERLAY_SKIP_AD_LABEL_BUTTON_H_
diff --git a/chrome/browser/ui/views/overlay/toggle_camera_button.cc b/chrome/browser/ui/views/overlay/toggle_camera_button.cc index c525450..46ec4441 100644 --- a/chrome/browser/ui/views/overlay/toggle_camera_button.cc +++ b/chrome/browser/ui/views/overlay/toggle_camera_button.cc
@@ -4,11 +4,12 @@ #include "chrome/browser/ui/views/overlay/toggle_camera_button.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" ToggleCameraButton::ToggleCameraButton(PressedCallback callback) @@ -37,8 +38,9 @@ auto text = is_turned_on_ ? IDS_PICTURE_IN_PICTURE_TURN_OFF_CAMERA_TEXT : IDS_PICTURE_IN_PICTURE_TURN_ON_CAMERA_TEXT; - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(icon, width(), kPipWindowIconColor)); + SetImageModel( + views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon(icon, kColorPipWindowForeground, width())); SetTooltipText(l10n_util::GetStringUTF16(text)); }
diff --git a/chrome/browser/ui/views/overlay/toggle_microphone_button.cc b/chrome/browser/ui/views/overlay/toggle_microphone_button.cc index 98d6534..59b9a544 100644 --- a/chrome/browser/ui/views/overlay/toggle_microphone_button.cc +++ b/chrome/browser/ui/views/overlay/toggle_microphone_button.cc
@@ -4,11 +4,12 @@ #include "chrome/browser/ui/views/overlay/toggle_microphone_button.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" ToggleMicrophoneButton::ToggleMicrophoneButton(PressedCallback callback) @@ -37,8 +38,9 @@ auto text = is_muted_ ? IDS_PICTURE_IN_PICTURE_UNMUTE_MICROPHONE_TEXT : IDS_PICTURE_IN_PICTURE_MUTE_MICROPHONE_TEXT; - SetImage(views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(icon, width(), kPipWindowIconColor)); + SetImageModel( + views::Button::STATE_NORMAL, + ui::ImageModel::FromVectorIcon(icon, kColorPipWindowForeground, width())); SetTooltipText(l10n_util::GetStringUTF16(text)); }
diff --git a/chrome/browser/ui/views/overlay/track_image_button.cc b/chrome/browser/ui/views/overlay/track_image_button.cc index d569023..5e13648 100644 --- a/chrome/browser/ui/views/overlay/track_image_button.cc +++ b/chrome/browser/ui/views/overlay/track_image_button.cc
@@ -5,11 +5,12 @@ #include "chrome/browser/ui/views/overlay/track_image_button.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/ui/views/overlay/constants.h" +#include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/grit/generated_resources.h" #include "components/vector_icons/vector_icons.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/vector_icons.h" @@ -23,9 +24,10 @@ const gfx::VectorIcon& icon, std::u16string label) : OverlayWindowImageButton(std::move(callback)), - image_( - gfx::CreateVectorIcon(icon, kTrackImageSize, kPipWindowIconColor)) { - SetImage(views::Button::STATE_NORMAL, image_); + image_(ui::ImageModel::FromVectorIcon(icon, + kColorPipWindowForeground, + kTrackImageSize)) { + SetImageModel(views::Button::STATE_NORMAL, image_); // Accessibility. SetAccessibleName(label);
diff --git a/chrome/browser/ui/views/overlay/track_image_button.h b/chrome/browser/ui/views/overlay/track_image_button.h index 9aab4b64..3dae36eb 100644 --- a/chrome/browser/ui/views/overlay/track_image_button.h +++ b/chrome/browser/ui/views/overlay/track_image_button.h
@@ -13,6 +13,10 @@ struct VectorIcon; } +namespace ui { +class ImageModel; +} + // A resizable previous/next track image button. class TrackImageButton : public OverlayWindowImageButton { public: @@ -33,7 +37,7 @@ void OnBoundsChanged(const gfx::Rect& previous_bounds) override; private: - const gfx::ImageSkia image_; + const ui::ImageModel image_; // Last visible size of the image button. gfx::Size last_visible_size_;
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc index be0115c..b2e2818 100644 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -112,8 +112,7 @@ void OnThemeChanged() override { views::View::OnThemeChanged(); - layer()->SetColor( - GetColorProvider()->GetColor(kColorOverlayWindowBackgroundColor)); + layer()->SetColor(GetColorProvider()->GetColor(kColorPipWindowBackground)); } };
diff --git a/chrome/browser/ui/views/page_info/page_info_ad_personalization_content_view.cc b/chrome/browser/ui/views/page_info/page_info_ad_personalization_content_view.cc index a689f65..5fed986 100644 --- a/chrome/browser/ui/views/page_info/page_info_ad_personalization_content_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_ad_personalization_content_view.cc
@@ -39,7 +39,7 @@ view->presenter_->RecordPageInfoAction( PageInfo::PageInfoAction:: PAGE_INFO_AD_PERSONALIZATION_SETTINGS_OPENED); - view->ui_delegate_->ShowPrivacySandboxSettings(); + view->ui_delegate_->ShowPrivacySandboxAdPersonalization(); }, this), PageInfoViewFactory::GetSiteSettingsIcon(),
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc index 96f1add4..434e62d9 100644 --- a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.cc
@@ -110,8 +110,9 @@ base::BindOnce(&PrivacySandboxDialogView::Close, base::Unretained(this)), base::BindOnce(&PrivacySandboxDialogView::ResizeNativeView, base::Unretained(this)), - base::BindOnce(&PrivacySandboxDialogView::OpenPrivacySandboxSettings, - base::Unretained(this)), + base::BindOnce( + &PrivacySandboxDialogView::OpenPrivacySandboxAdPersonalization, + base::Unretained(this)), dialog_type); SetUseDefaultFillLayout(true); @@ -136,9 +137,9 @@ base::TimeTicks::Now() - dialog_created_time_); } -void PrivacySandboxDialogView::OpenPrivacySandboxSettings() { +void PrivacySandboxDialogView::OpenPrivacySandboxAdPersonalization() { DCHECK(browser_); - chrome::ShowPrivacySandboxSettings(browser_); + chrome::ShowPrivacySandboxAdPersonalization(browser_); } BEGIN_METADATA(PrivacySandboxDialogView, views::View)
diff --git a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.h b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.h index ad747b6..98f0eef 100644 --- a/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.h +++ b/chrome/browser/ui/views/privacy_sandbox/privacy_sandbox_dialog_view.h
@@ -27,7 +27,7 @@ private: void ResizeNativeView(int height); - void OpenPrivacySandboxSettings(); + void OpenPrivacySandboxAdPersonalization(); raw_ptr<views::WebView> web_view_; raw_ptr<Browser> browser_;
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc index c6ab826..5a95732 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc +++ b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc
@@ -1540,13 +1540,19 @@ after_state_change_action_state_.get(), profile(), site_mode); ASSERT_TRUE(app_state); EXPECT_EQ(app_state->run_on_os_login_mode, apps::RunOnOsLoginMode::kWindowed); -#if BUILDFLAG(IS_LINUX) base::ScopedAllowBlockingForTesting allow_blocking; +#if BUILDFLAG(IS_LINUX) std::string shortcut_filename = "chrome-" + app_state->id + "-" + profile()->GetBaseName().value() + ".desktop"; ASSERT_TRUE(base::PathExists( shortcut_override_->startup.GetPath().Append(shortcut_filename))); +#elif BUILDFLAG(IS_WIN) + DCHECK(base::Contains(g_app_name_icon_color, app_state->name)); + SkColor color = g_app_name_icon_color.find(app_state->name)->second; + ASSERT_TRUE(IsShortcutAndIconFoundForProfile( + profile(), app_state->name, shortcut_override_->startup.GetPath(), + color)); #endif AfterStateCheckAction(); } @@ -1558,13 +1564,19 @@ after_state_change_action_state_.get(), profile(), site_mode); ASSERT_TRUE(app_state); EXPECT_EQ(app_state->run_on_os_login_mode, apps::RunOnOsLoginMode::kNotRun); -#if BUILDFLAG(IS_LINUX) base::ScopedAllowBlockingForTesting allow_blocking; +#if BUILDFLAG(IS_LINUX) std::string shortcut_filename = "chrome-" + app_state->id + "-" + profile()->GetBaseName().value() + ".desktop"; ASSERT_FALSE(base::PathExists( shortcut_override_->startup.GetPath().Append(shortcut_filename))); +#elif BUILDFLAG(IS_WIN) + DCHECK(base::Contains(g_app_name_icon_color, app_state->name)); + SkColor color = g_app_name_icon_color.find(app_state->name)->second; + ASSERT_FALSE(IsShortcutAndIconFoundForProfile( + profile(), app_state->name, shortcut_override_->startup.GetPath(), + color)); #endif AfterStateCheckAction(); }
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters.mojom b/chrome/browser/ui/webui/history_clusters/history_clusters.mojom index 41b1644..1e93841 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters.mojom +++ b/chrome/browser/ui/webui/history_clusters/history_clusters.mojom
@@ -60,10 +60,6 @@ // Annotations for this visit. array<Annotation> annotations; - // Search queries related to this visit or one of its related visits, if - // applicable; typically the highest scoring one. - array<SearchQuery> related_searches; - // Related visits to this visit; starting with the highest scoring one, if // applicable. Only prominently featured visits have related visits. array<URLVisit> related_visits; @@ -90,6 +86,9 @@ // An optional label for the whole cluster. If this is not defined or empty, // `visit` should be displayed prominently instead. string? label; + + // Search queries related to this cluster's visits. + array<SearchQuery> related_searches; }; // Represents a set of Clusters returned by the browser in response to a request
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc index 1232a4c4..7d3f0959 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc
@@ -165,16 +165,15 @@ top_visit_mojom->related_visits.push_back(std::move(visit_mojom)); } - // Coalesce the unique related searches of this visit into the top visit + // Coalesce the unique related searches of this visit into the cluster // until the cap is reached. - const auto& top_visit_mojom = cluster_mojom->visit; for (const auto& search_query : visit.annotated_visit.content_annotations.related_searches) { - if (top_visit_mojom->related_searches.size() >= kMaxRelatedSearches) { + if (cluster_mojom->related_searches.size() >= kMaxRelatedSearches) { break; } - if (base::Contains(top_visit_mojom->related_searches, search_query, + if (base::Contains(cluster_mojom->related_searches, search_query, [](const mojom::SearchQueryPtr& search_query_mojom) { return search_query_mojom->query; })) { @@ -183,7 +182,7 @@ auto search_query_mojom = SearchQueryToMojom(profile, search_query); if (search_query_mojom) { - top_visit_mojom->related_searches.emplace_back( + cluster_mojom->related_searches.emplace_back( std::move(*search_query_mojom)); } } @@ -296,6 +295,14 @@ return; } + // Hard cap the number of opened visits in a tab group to 32. It's a + // relatively high cap chosen fairly arbitrarily, because the user took an + // affirmative action to open this many tabs. And hidden visits aren't opened. + constexpr size_t kMaxVisitsToOpenInTabGroup = 32; + if (visits.size() > kMaxVisitsToOpenInTabGroup) { + visits.resize(kMaxVisitsToOpenInTabGroup); + } + auto* model = browser->tab_strip_model(); std::vector<int> tab_indices; tab_indices.reserve(visits.size());
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler_browsertest.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler_browsertest.cc index fa3fd23..42a22153 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler_browsertest.cc +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler_browsertest.cc
@@ -74,4 +74,21 @@ tab_strip_model->GetWebContentsAt(2)->GetVisibleURL()); } +IN_PROC_BROWSER_TEST_F(HistoryClustersHandlerBrowserTest, + OpenVisitUrlsInTabGroupHardCap) { + auto* tab_strip_model = browser()->tab_strip_model(); + ASSERT_EQ(1, tab_strip_model->GetTabCount()); + + std::vector<mojom::URLVisitPtr> visits; + for (size_t i = 0; i < 50; ++i) { + auto visit = mojom::URLVisit::New(); + visit->normalized_url = GURL("https://foo"); + visits.push_back(std::move(visit)); + } + + // Verify that we open 32 at maximum. Including the NTP, that's 33 total. + handler_->OpenVisitUrlsInTabGroup(std::move(visits)); + ASSERT_EQ(33, tab_strip_model->GetTabCount()); +} + } // namespace history_clusters
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc index 282c857..71ea9ca 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc
@@ -154,13 +154,13 @@ ASSERT_EQ(mojom_result->clusters.size(), 1u); EXPECT_EQ(mojom_result->clusters[0]->id, 4); - const auto& top_visit = mojom_result->clusters[0]->visit; - ASSERT_EQ(top_visit->related_searches.size(), 5u); - EXPECT_EQ(top_visit->related_searches[0]->query, "one"); - EXPECT_EQ(top_visit->related_searches[1]->query, "two"); - EXPECT_EQ(top_visit->related_searches[2]->query, "three"); - EXPECT_EQ(top_visit->related_searches[3]->query, "four"); - EXPECT_EQ(top_visit->related_searches[4]->query, "five"); + const auto& cluster_mojom = mojom_result->clusters[0]; + ASSERT_EQ(cluster_mojom->related_searches.size(), 5u); + EXPECT_EQ(cluster_mojom->related_searches[0]->query, "one"); + EXPECT_EQ(cluster_mojom->related_searches[1]->query, "two"); + EXPECT_EQ(cluster_mojom->related_searches[2]->query, "three"); + EXPECT_EQ(cluster_mojom->related_searches[3]->query, "four"); + EXPECT_EQ(cluster_mojom->related_searches[4]->query, "five"); } // TODO(manukh) Add a test case for `VisitToMojom`.
diff --git a/chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_dialog_handler_unittest.cc b/chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_dialog_handler_unittest.cc index f9d6292..0c743226 100644 --- a/chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_dialog_handler_unittest.cc +++ b/chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_dialog_handler_unittest.cc
@@ -22,7 +22,7 @@ public: MOCK_METHOD(void, Close, ()); MOCK_METHOD(void, ResizeNativeView, (int)); - MOCK_METHOD(void, OpenPrivacySandboxSettings, ()); + MOCK_METHOD(void, OpenPrivacySandboxAdPersonalization, ()); }; class MockPrivacySandboxService : public PrivacySandboxService { @@ -107,7 +107,7 @@ base::BindOnce(&MockPrivacySandboxDialogView::ResizeNativeView, dialog_mock()), base::BindOnce( - &MockPrivacySandboxDialogView::OpenPrivacySandboxSettings, + &MockPrivacySandboxDialogView::OpenPrivacySandboxAdPersonalization, dialog_mock()), PrivacySandboxService::DialogType::kConsent); } @@ -217,7 +217,7 @@ base::BindOnce(&MockPrivacySandboxDialogView::ResizeNativeView, dialog_mock()), base::BindOnce( - &MockPrivacySandboxDialogView::OpenPrivacySandboxSettings, + &MockPrivacySandboxDialogView::OpenPrivacySandboxAdPersonalization, dialog_mock()), PrivacySandboxService::DialogType::kNotice); } @@ -242,7 +242,7 @@ } TEST_F(PrivacySandboxNoticeDialogHandlerTest, HandleOpenSettings) { - EXPECT_CALL(*dialog_mock(), OpenPrivacySandboxSettings()); + EXPECT_CALL(*dialog_mock(), OpenPrivacySandboxAdPersonalization()); EXPECT_CALL(*dialog_mock(), Close()); EXPECT_CALL(*mock_privacy_sandbox_service(), DialogActionOccurred(
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager.cc b/chrome/browser/web_applications/preinstalled_web_app_manager.cc index 0bbc1f5..c42d88d 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_manager.cc
@@ -88,6 +88,29 @@ const std::vector<base::Value>* g_configs_for_testing = nullptr; FileUtilsWrapper* g_file_utils_for_testing = nullptr; +const char kHistogramMigrationDisabledReason[] = + "WebApp.Preinstalled.DisabledReason"; + +// These values are reported to UMA, do not modify them. +enum class DisabledReason { + kNotDisabled = 0, + kPreinstalledAppsNotEnabled = 1, + kUserTypeNotAllowed = 2, + kGatedFeatureNotEnabled = 3, + kGatedFeatureNotEnabledAndAppNotInstalled = 4, + kArcAvailable = 5, + kTabletFormFactor = 6, + kNotNewUserAndNotPreviouslyInstalled = 7, + kNotPreviouslyPreinstalled = 8, + kReplacingAppBlockedByPolicy = 9, + kReplacingAppForceInstalled = 10, + kReplacingAppStillInstalled = 11, + kDefaultAppAndAppsToReplaceUninstalled = 12, + kReplacingAppUninstalledByUser = 13, + kStylusRequired = 14, + kMaxValue = kStylusRequired +}; + struct LoadedConfig { base::Value contents; base::FilePath file; @@ -172,6 +195,8 @@ DCHECK(registrar); if (!preinstalled_apps_enabled_in_prefs) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kPreinstalledAppsNotEnabled); return options.install_url.spec() + " disabled by preinstalled_apps pref setting."; } @@ -179,12 +204,16 @@ // Remove if not applicable to current user type. DCHECK_GT(options.user_type_allowlist.size(), 0u); if (!base::Contains(options.user_type_allowlist, user_type)) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kUserTypeNotAllowed); return options.install_url.spec() + " disabled for user type: " + user_type; } // Remove if gated on a disabled feature. if (options.gate_on_feature && !IsPreinstalledAppInstallFeatureEnabled( *options.gate_on_feature, *profile)) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kGatedFeatureNotEnabled); return options.install_url.spec() + " disabled because feature is disabled: " + *options.gate_on_feature; } @@ -198,6 +227,9 @@ ExternallyInstalledWebAppPrefs(profile->GetPrefs()) .LookupAppId(options.install_url); if (!app_id.has_value()) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kGatedFeatureNotEnabledAndAppNotInstalled); return options.install_url.spec() + " disabled because the feature " + *options.gate_on_feature_or_installed + " is disabled and the app is not already installed"; @@ -207,12 +239,16 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) // Remove if ARC is supported and app should be disabled. if (options.disable_if_arc_supported && arc::IsArcAvailable()) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kArcAvailable); return options.install_url.spec() + " disabled because ARC is available."; } // Remove if device is tablet and app should be disabled. if (options.disable_if_tablet_form_factor && ash::switches::IsTabletFormFactor()) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kTabletFormFactor); return options.install_url.spec() + " disabled because device is tablet."; } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -225,6 +261,9 @@ .LookupAppId(options.install_url) .has_value(); if (!was_previously_installed) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kNotNewUserAndNotPreviouslyInstalled); return options.install_url.spec() + " disabled because user was not new when config was added."; } @@ -244,6 +283,8 @@ } if (!was_previously_preinstalled) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kNotPreviouslyPreinstalled); return options.install_url.spec() + " disabled because was not previously preinstalled."; } @@ -253,12 +294,18 @@ // policy. for (const AppId& app_id : options.uninstall_and_replace) { if (extensions::IsExtensionBlockedByPolicy(profile, app_id)) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kReplacingAppBlockedByPolicy); return options.install_url.spec() + " disabled due to admin policy blocking replacement " "Extension."; } std::u16string reason; if (extensions::IsExtensionForceInstalled(profile, app_id, &reason)) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kReplacingAppForceInstalled); return options.install_url.spec() + " disabled due to admin policy force installing replacement " "Extension: " + @@ -269,6 +316,9 @@ // Keep if any apps to replace are installed. for (const AppId& app_id : options.uninstall_and_replace) { if (extensions::IsExtensionInstalled(profile, app_id)) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kReplacingAppStillInstalled); return absl::nullopt; } } @@ -285,6 +335,9 @@ if (!WasMigrationRun(profile, *options.gate_on_feature)) { if (extensions::IsPreinstalledAppId(app_id)) { MarkPreinstalledAppAsUninstalled(profile, app_id); + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kDefaultAppAndAppsToReplaceUninstalled); return options.install_url.spec() + "disabled because it's default app and apps to replace were " "uninstalled."; @@ -294,6 +347,9 @@ // uninstalled by user as the migration is already run, use the pref // saved in first migration. if (WasPreinstalledAppUninstalled(profile, app_id)) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kDefaultAppAndAppsToReplaceUninstalled); return options.install_url.spec() + "disabled because it's default app and apps to replace were " "uninstalled."; @@ -306,6 +362,9 @@ // Remove if any apps to replace were previously uninstalled. for (const AppId& app_id : options.uninstall_and_replace) { if (extensions::IsExternalExtensionUninstalled(profile, app_id)) { + base::UmaHistogramEnumeration( + kHistogramMigrationDisabledReason, + DisabledReason::kReplacingAppUninstalledByUser); return options.install_url.spec() + " disabled because apps to replace were uninstalled."; } @@ -324,11 +383,15 @@ } } if (!have_touchscreen_with_stylus) { + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kStylusRequired); return options.install_url.spec() + " disabled because the device does not have a built-in " "touchscreen with stylus support."; } } + base::UmaHistogramEnumeration(kHistogramMigrationDisabledReason, + DisabledReason::kNotDisabled); return absl::nullopt; }
diff --git a/chrome/browser/webshare/BUILD.gn b/chrome/browser/webshare/BUILD.gn index a92b67e..d82c94e 100644 --- a/chrome/browser/webshare/BUILD.gn +++ b/chrome/browser/webshare/BUILD.gn
@@ -30,11 +30,7 @@ source_set("unit_tests") { testonly = true - # TODO(crbug.com/1225825): Support file sharing from Lacros. - sources = [] - if (!is_chromeos_lacros) { - sources += [ "share_service_unittest.cc" ] - } + sources = [ "share_service_unittest.cc" ] if (is_chromeos || is_mac) { sources += [ "prepare_directory_task_unittest.cc" ]
diff --git a/chrome/browser/webshare/chromeos/sharesheet_client.cc b/chrome/browser/webshare/chromeos/sharesheet_client.cc index b6806838..2b29b24 100644 --- a/chrome/browser/webshare/chromeos/sharesheet_client.cc +++ b/chrome/browser/webshare/chromeos/sharesheet_client.cc
@@ -18,7 +18,6 @@ #include "base/time/time.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/apps/app_service/intent_util.h" -#include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sharesheet/sharesheet_metrics.h" #include "chrome/browser/visibility_timer_tab_helper.h" @@ -36,11 +35,13 @@ #if BUILDFLAG(IS_CHROMEOS_LACROS) #include "chrome/browser/ui/lacros/window_utility.h" +#include "chrome/common/chrome_paths_lacros.h" #include "chromeos/crosapi/mojom/app_service_types.mojom.h" #include "chromeos/crosapi/mojom/sharesheet.mojom.h" #include "chromeos/crosapi/mojom/sharesheet_mojom_traits.h" #include "chromeos/lacros/lacros_service.h" #else +#include "chrome/browser/ash/file_manager/path_util.h" #include "chrome/browser/sharesheet/sharesheet_service.h" #include "chrome/browser/sharesheet/sharesheet_service_factory.h" #endif // BUILDFLAG(IS_CHROMEOS_LACROS) @@ -50,10 +51,12 @@ namespace { -#if BUILDFLAG(IS_CHROMEOS_ASH) constexpr base::FilePath::CharType kWebShareDirname[] = +#if BUILDFLAG(IS_CHROMEOS_LACROS) + FILE_PATH_LITERAL(".web_share"); +#else FILE_PATH_LITERAL(".WebShare"); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif constexpr char kDefaultShareName[] = "share"; @@ -104,6 +107,32 @@ std::move(file_paths), delay); } +#if BUILDFLAG(IS_CHROMEOS_LACROS) +crosapi::mojom::IntentPtr CreateCrosapiShareIntentFromFiles( + const std::vector<base::FilePath>& file_paths, + const std::vector<std::string>& mime_types, + const std::string& share_text, + const std::string& share_title) { + DCHECK_EQ(file_paths.size(), mime_types.size()); + + std::vector<crosapi::mojom::IntentFilePtr> files; + files.reserve(file_paths.size()); + for (size_t index = 0; index < file_paths.size(); ++index) { + files.push_back( + crosapi::mojom::IntentFile::New(file_paths[index], mime_types[index])); + } + + const char* action = file_paths.size() <= 1 + ? apps_util::kIntentActionSend + : apps_util::kIntentActionSendMultiple; + std::string mime_type = file_paths.empty() + ? "text/plain" + : apps_util::CalculateCommonMimeType(mime_types); + return crosapi::mojom::Intent::New(action, + /*url=*/absl::nullopt, mime_type, + share_text, share_title, std::move(files)); +} +#endif // BUILDFLAG(IS_CHROMEOS_LACROS) } // namespace namespace webshare { @@ -157,13 +186,20 @@ } current_share_ = CurrentShare(); -#if BUILDFLAG(IS_CHROMEOS_ASH) current_share_->files = std::move(files); +#if BUILDFLAG(IS_CHROMEOS_ASH) current_share_->directory = file_manager::util::GetShareCacheFilePath(profile).Append( kWebShareDirname); #else - // TODO(crbug.com/1225825): Support file sharing from Lacros. + base::FilePath share_cache_dir; + if (chrome::GetShareCachePath(&share_cache_dir)) { + current_share_->directory = share_cache_dir.Append(kWebShareDirname); + } else { + LOG(ERROR) << "Share cache path not set"; // DO NOT LAND + VLOG(1) << "Share cache path not set"; + current_share_->files.clear(); + } #endif // BUILDFLAG(IS_CHROMEOS_ASH) if (share_url.is_valid()) { if (text.empty()) @@ -305,20 +341,17 @@ DCHECK(profile); #if BUILDFLAG(IS_CHROMEOS_LACROS) - // TODO(crbug.com/1225825): Support file sharing from Lacros. - apps::mojom::IntentPtr intent = - apps_util::CreateShareIntentFromText(text, title); - auto* const service = chromeos::LacrosService::Get(); if (!service || !service->IsAvailable<crosapi::mojom::Sharesheet>()) { std::move(delivered_callback).Run(sharesheet::SharesheetResult::kCancel); return; } + crosapi::mojom::IntentPtr intent = + CreateCrosapiShareIntentFromFiles(file_paths, content_types, text, title); service->GetRemote<crosapi::mojom::Sharesheet>()->ShowBubble( lacros_window_utility::GetRootWindowUniqueId( web_contents->GetTopLevelNativeWindow()), - sharesheet::LaunchSource::kWebShare, - apps_util::ConvertAppServiceToCrosapiIntent(intent, profile), + sharesheet::LaunchSource::kWebShare, std::move(intent), std::move(delivered_callback)); #else apps::mojom::IntentPtr intent =
diff --git a/chrome/browser/webshare/chromeos/sharesheet_client_unittest.cc b/chrome/browser/webshare/chromeos/sharesheet_client_unittest.cc index 7f250779..6bc9d3da 100644 --- a/chrome/browser/webshare/chromeos/sharesheet_client_unittest.cc +++ b/chrome/browser/webshare/chromeos/sharesheet_client_unittest.cc
@@ -30,6 +30,10 @@ #include "chrome/browser/ash/file_manager/path_util.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS_LACROS) +#include "chrome/common/chrome_paths_lacros.h" +#endif // BUILDFLAG(IS_CHROMEOS_LACROS) + namespace webshare { class SharesheetClientUnitTest : public ChromeRenderViewHostTestHarness { @@ -129,17 +133,24 @@ EXPECT_EQ(error, blink::mojom::ShareError::OK); } -#if BUILDFLAG(IS_CHROMEOS_ASH) TEST_F(SharesheetClientUnitTest, DeleteAfterShare) { SetGuest(); SharesheetClient sharesheet_client(web_contents()); +#if BUILDFLAG(IS_CHROMEOS_LACROS) + base::FilePath share_cache_dir; + ASSERT_TRUE(chrome::GetShareCachePath(&share_cache_dir)); + const base::FilePath first_file = + share_cache_dir.AppendASCII(".web_share/share1/first.txt"); + const base::FilePath second_file = + share_cache_dir.AppendASCII(".web_share/share2/second.txt"); +#else const base::FilePath share_cache_dir = file_manager::util::GetShareCacheFilePath(profile()); const base::FilePath first_file = share_cache_dir.AppendASCII(".WebShare/share1/first.txt"); const base::FilePath second_file = share_cache_dir.AppendASCII(".WebShare/share2/second.txt"); - +#endif const std::string title = "Subject"; const std::string text = "Message"; const GURL share_url("https://example.com/"); @@ -174,8 +185,5 @@ EXPECT_FALSE(base::PathExists(first_file)); EXPECT_FALSE(base::PathExists(second_file)); } -#else -// TODO(crbug.com/1225825): Support file sharing from Lacros. -#endif // BUILDFLAG(IS_CHROMEOS_ASH) } // namespace webshare
diff --git a/chrome/browser/webshare/share_service_browsertest.cc b/chrome/browser/webshare/share_service_browsertest.cc index 4386571..4e18f25 100644 --- a/chrome/browser/webshare/share_service_browsertest.cc +++ b/chrome/browser/webshare/share_service_browsertest.cc
@@ -113,9 +113,6 @@ WebShareMethod::kShare, kRepeats); } -// TODO(crbug.com/1225825): Support file sharing from Lacros. -#if !BUILDFLAG(IS_CHROMEOS_LACROS) - class SafeBrowsingShareServiceBrowserTest : public ShareServiceBrowserTest { public: SafeBrowsingShareServiceBrowserTest() @@ -168,5 +165,3 @@ EXPECT_EQ("share failed: NotAllowedError: Permission denied", content::EvalJs(contents, "share_pdf_file()")); } - -#endif // !BUILDFLAG(IS_CHROMEOS_LACROS)
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index d8bddd5..f2e1c25ae 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1647410341-8ed37bd17ab87d8af1822a0d40ab01e44cb548d8.profdata +chrome-linux-main-1647453506-34a0252761fcde704d0ce6d61651e1fb4e9c4a53.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 069ae88..2bde2a64 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1647431991-4f403b69bd2eabe50f03c6a288ecbe8e04b20b48.profdata +chrome-win64-main-1647442689-51aff1c7b5ab34b042338997d1084f1fbf126c92.profdata
diff --git a/chrome/common/chrome_paths_lacros.cc b/chrome/common/chrome_paths_lacros.cc index 4480c71c..f7e5a929 100644 --- a/chrome/common/chrome_paths_lacros.cc +++ b/chrome/common/chrome_paths_lacros.cc
@@ -25,6 +25,7 @@ base::FilePath android_files_dir; base::FilePath linux_files_dir; base::FilePath ash_resources_dir; + base::FilePath share_cache_dir; }; DefaultPaths& GetDefaultPaths() { @@ -40,7 +41,8 @@ const base::FilePath& removable_media_dir, const base::FilePath& android_files_dir, const base::FilePath& linux_files_dir, - const base::FilePath& ash_resources_dir) { + const base::FilePath& ash_resources_dir, + const base::FilePath& share_cache_dir) { DCHECK(!documents_dir.empty()); DCHECK(documents_dir.IsAbsolute()); GetDefaultPaths().documents_dir = documents_dir; @@ -54,6 +56,7 @@ GetDefaultPaths().android_files_dir = android_files_dir; GetDefaultPaths().linux_files_dir = linux_files_dir; GetDefaultPaths().ash_resources_dir = ash_resources_dir; + GetDefaultPaths().share_cache_dir = share_cache_dir; } void SetLacrosDefaultPathsFromInitParams( @@ -77,10 +80,14 @@ base::FilePath ash_resources_dir; if (init_params->default_paths->ash_resources.has_value()) ash_resources_dir = init_params->default_paths->ash_resources.value(); + base::FilePath share_cache_dir; + if (init_params->default_paths->share_cache.has_value()) + share_cache_dir = init_params->default_paths->share_cache.value(); + chrome::SetLacrosDefaultPaths( init_params->default_paths->documents, init_params->default_paths->downloads, drivefs_dir, removable_media_dir, - android_files_dir, linux_files_dir, ash_resources_dir); + android_files_dir, linux_files_dir, ash_resources_dir, share_cache_dir); } } @@ -183,4 +190,11 @@ return true; } +bool GetShareCachePath(base::FilePath* result) { + if (GetDefaultPaths().share_cache_dir.empty()) + return false; + *result = GetDefaultPaths().share_cache_dir; + return true; +} + } // namespace chrome
diff --git a/chrome/common/chrome_paths_lacros.h b/chrome/common/chrome_paths_lacros.h index 581ec73b..b31b75f 100644 --- a/chrome/common/chrome_paths_lacros.h +++ b/chrome/common/chrome_paths_lacros.h
@@ -23,7 +23,8 @@ const base::FilePath& removable_media_dir, const base::FilePath& android_files_dir, const base::FilePath& linux_files_dir, - const base::FilePath& ash_resources_dir); + const base::FilePath& ash_resources_dir, + const base::FilePath& share_cache_dir); // Sets the default paths from BrowserInitParams received from ash on startup. void SetLacrosDefaultPathsFromInitParams( @@ -42,6 +43,7 @@ bool GetAndroidFilesPath(base::FilePath* result); bool GetLinuxFilesPath(base::FilePath* result); bool GetAshResourcesPath(base::FilePath* result); +bool GetShareCachePath(base::FilePath* result); } // namespace chrome #endif // CHROME_COMMON_CHROME_PATHS_LACROS_H_
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index 3a05bccf..05478c5 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc
@@ -553,7 +553,8 @@ const char kCreateProfileSubPage[] = "createProfile"; const char kManageProfileSubPage[] = "manageProfile"; const char kPeopleSubPage[] = "people"; -const char kPrivacySandboxSubPage[] = "privacySandbox"; +const char kPrivacySandboxAdPersonalizationSubPage[] = + "privacySandbox?view=adPersonalizationDialog"; #if !BUILDFLAG(IS_ANDROID) const char kPrivacySandboxSubPagePath[] = "/privacySandbox";
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h index ca027cb..624910eb 100644 --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h
@@ -491,7 +491,7 @@ extern const char kSignOutSubPage[]; extern const char kSyncSetupSubPage[]; extern const char kTriggeredResetProfileSettingsSubPage[]; -extern const char kPrivacySandboxSubPage[]; +extern const char kPrivacySandboxAdPersonalizationSubPage[]; #if !BUILDFLAG(IS_ANDROID) extern const char kPrivacySandboxSubPagePath[];
diff --git a/chrome/installer/mac/signing/commands.py b/chrome/installer/mac/signing/commands.py index 846ac27..5ca81fd6 100644 --- a/chrome/installer/mac/signing/commands.py +++ b/chrome/installer/mac/signing/commands.py
@@ -11,7 +11,6 @@ import shutil import stat import subprocess -import sys import tempfile from . import logger @@ -128,18 +127,8 @@ def read_plist(path): """Loads Plist at |path| and returns it as a dictionary.""" - if sys.version_info.major == 2: - fd, name = tempfile.mkstemp() - try: - subprocess.check_call( - ['plutil', '-convert', 'xml1', '-o', name, path]) - with os.fdopen(fd, 'rb') as f: - return plistlib.readPlist(f) - finally: - os.unlink(name) - else: - with open(path, 'rb') as f: - return plistlib.load(f) + with open(path, 'rb') as f: + return plistlib.load(f) def write_plist(data, path, format): @@ -150,22 +139,12 @@ # it does exist. if os.path.exists(path): os.unlink(path) - if sys.version_info.major == 2: - fd, name = tempfile.mkstemp() - try: - with os.fdopen(fd, 'wb') as f: - plistlib.writePlist(data, f) - subprocess.check_call( - ['plutil', '-convert', format, '-o', path, name]) - finally: - os.unlink(name) - else: - with open(path, 'wb') as f: - plist_format = { - 'binary1': plistlib.FMT_BINARY, - 'xml1': plistlib.FMT_XML - } - plistlib.dump(data, f, fmt=plist_format[format]) + with open(path, 'wb') as f: + plist_format = { + 'binary1': plistlib.FMT_BINARY, + 'xml1': plistlib.FMT_XML + } + plistlib.dump(data, f, fmt=plist_format[format]) class PlistContext(object):
diff --git a/chrome/renderer/autofill/fake_mojo_password_manager_driver.h b/chrome/renderer/autofill/fake_mojo_password_manager_driver.h index b485caf..3a29cce 100644 --- a/chrome/renderer/autofill/fake_mojo_password_manager_driver.h +++ b/chrome/renderer/autofill/fake_mojo_password_manager_driver.h
@@ -36,7 +36,10 @@ (const autofill::FormData&), (override)); - MOCK_METHOD(void, ShowTouchToFill, (bool), (override)); + MOCK_METHOD(void, + ShowTouchToFill, + (autofill::mojom::SubmissionReadinessState), + (override)); MOCK_METHOD(void, ShowPasswordSuggestions,
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 7e3ed13..afd3c9a 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -1776,7 +1776,9 @@ // TODO(crbug.com/1299430): Consider to disable |ShowTouchToFill| on Desktop. #if BUILDFLAG(IS_ANDROID) - EXPECT_CALL(fake_driver_, ShowTouchToFill(true)); + EXPECT_CALL( + fake_driver_, + ShowTouchToFill(autofill::mojom::SubmissionReadinessState::kEmptyFields)); #else EXPECT_CALL(fake_driver_, ShowTouchToFill); #endif @@ -1793,13 +1795,16 @@ // TODO(crbug.com/1299430): Consider to disable |ShowTouchToFill| on Desktop. #if BUILDFLAG(IS_ANDROID) - EXPECT_CALL(fake_driver_, ShowTouchToFill(true)); + EXPECT_CALL( + fake_driver_, + ShowTouchToFill(autofill::mojom::SubmissionReadinessState::kEmptyFields)); #else EXPECT_CALL(fake_driver_, ShowTouchToFill); #endif base::RunLoop().RunUntilIdle(); } +#if BUILDFLAG(IS_ANDROID) TEST_F(PasswordAutofillAgentTest, TryToShowTouchToFillButDontEnableSubmission) { LoadHTML(kPasswordChangeFormHTML); UpdateUrlForHTML(kPasswordChangeFormHTML); @@ -1813,11 +1818,13 @@ EXPECT_EQ(WebAutofillState::kPreviewed, password_element_.GetAutofillState()); // As there are other input fields, don't enable automatic submission. - EXPECT_CALL(fake_driver_, ShowTouchToFill(/*trigger_submission=*/false)); + EXPECT_CALL( + fake_driver_, + ShowTouchToFill( + autofill::mojom::SubmissionReadinessState::kFieldAfterPasswordField)); base::RunLoop().RunUntilIdle(); } -#if BUILDFLAG(IS_ANDROID) TEST_F(PasswordAutofillAgentTest, TouchToFillSuppressesPopups) { SimulateOnFillPasswordForm(fill_data_); SimulateSuggestionChoice(username_element_); @@ -1862,6 +1869,102 @@ EXPECT_CALL(fake_driver_, ShowTouchToFill); base::RunLoop().RunUntilIdle(); } + +TEST_F(PasswordAutofillAgentTest, SubmissionReadiness_NoUsernameField) { + LoadHTML(kVisibleFormWithNoUsernameHTML); + UpdateUrlForHTML(kVisibleFormWithNoUsernameHTML); + UpdateOnlyPasswordElement(); + SimulateOnFillPasswordForm(fill_data_); + + EXPECT_TRUE( + password_autofill_agent_->TryToShowTouchToFill(password_element_)); + + EXPECT_CALL(fake_driver_, + ShowTouchToFill( + autofill::mojom::SubmissionReadinessState::kNoUsernameField)); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(PasswordAutofillAgentTest, SubmissionReadiness_FieldsInBetween) { + // Parse the "random_field" as username. Then, the "username" field should + // block a submission. + WebDocument document = GetMainFrame()->GetDocument(); + WebElement element = + document.GetElementById(WebString::FromUTF16(u"random_field")); + ASSERT_FALSE(element.IsNull()); + username_element_ = element.To<WebInputElement>(); + UpdateRendererIDs(); + + SimulateOnFillPasswordForm(fill_data_); + + EXPECT_TRUE( + password_autofill_agent_->TryToShowTouchToFill(password_element_)); + + EXPECT_CALL(fake_driver_, + ShowTouchToFill(autofill::mojom::SubmissionReadinessState:: + kFieldBetweenUsernameAndPassword)); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(PasswordAutofillAgentTest, SubmissionReadiness_FieldAfterPassword) { + LoadHTML(kPasswordChangeFormHTML); + UpdateUrlForHTML(kPasswordChangeFormHTML); + UpdateUsernameAndPasswordElements(); + SimulateOnFillPasswordForm(fill_data_); + + EXPECT_TRUE( + password_autofill_agent_->TryToShowTouchToFill(password_element_)); + + EXPECT_CALL( + fake_driver_, + ShowTouchToFill( + autofill::mojom::SubmissionReadinessState::kFieldAfterPasswordField)); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(PasswordAutofillAgentTest, SubmissionReadiness_EmptyFields) { + SimulateOnFillPasswordForm(fill_data_); + + EXPECT_TRUE( + password_autofill_agent_->TryToShowTouchToFill(password_element_)); + + EXPECT_CALL( + fake_driver_, + ShowTouchToFill(autofill::mojom::SubmissionReadinessState::kEmptyFields)); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(PasswordAutofillAgentTest, SubmissionReadiness_MoreThanTwoFields) { + SimulateOnFillPasswordForm(fill_data_); + WebInputElement surname_element = GetInputElementByID("random_field"); + ASSERT_FALSE(surname_element.IsNull()); + SimulateUserInputChangeForElement(&surname_element, "Smith"); + + EXPECT_TRUE( + password_autofill_agent_->TryToShowTouchToFill(password_element_)); + + EXPECT_CALL( + fake_driver_, + ShowTouchToFill( + autofill::mojom::SubmissionReadinessState::kMoreThanTwoFields)); + base::RunLoop().RunUntilIdle(); +} + +TEST_F(PasswordAutofillAgentTest, SubmissionReadiness_TwoFields) { + LoadHTML(kSimpleWebpage); + UpdateUrlForHTML(kSimpleWebpage); + UpdateUsernameAndPasswordElements(); + + SimulateOnFillPasswordForm(fill_data_); + + EXPECT_TRUE( + password_autofill_agent_->TryToShowTouchToFill(password_element_)); + + EXPECT_CALL( + fake_driver_, + ShowTouchToFill(autofill::mojom::SubmissionReadinessState::kTwoFields)); + base::RunLoop().RunUntilIdle(); +} #endif TEST_F(PasswordAutofillAgentTest, DontTryToShowTouchToFillReadonlyPassword) {
diff --git a/chrome/test/base/chrome_test_suite.cc b/chrome/test/base/chrome_test_suite.cc index df00b1c..b4e8b5e 100644 --- a/chrome/test/base/chrome_test_suite.cc +++ b/chrome/test/base/chrome_test_suite.cc
@@ -120,10 +120,11 @@ chrome::SetLacrosDefaultPaths(/*documents_dir=*/temp_path, /*downloads_dir=*/temp_path, /*drivefs=*/base::FilePath(), - /*removable_media_dir*/ base::FilePath(), - /*android_files_dir*/ base::FilePath(), - /*linux_files_dir*/ base::FilePath(), - /*ash_resources_dir*/ base::FilePath()); + /*removable_media_dir=*/base::FilePath(), + /*android_files_dir=*/base::FilePath(), + /*linux_files_dir=*/base::FilePath(), + /*ash_resources_dir=*/base::FilePath(), + /*share_cache_dir=*/temp_path); #endif // BUILDFLAG(IS_CHROMEOS_LACROS) }
diff --git a/chrome/test/data/capability_delegation/payment_request_delegation.html b/chrome/test/data/capability_delegation/payment_request_delegation.html index ad1701b..1a327fe 100644 --- a/chrome/test/data/capability_delegation/payment_request_delegation.html +++ b/chrome/test/data/capability_delegation/payment_request_delegation.html
@@ -26,5 +26,5 @@ return promise; } </script> -<iframe src="about:blank" id="iframe" allowpaymentrequest></iframe> +<iframe src="about:blank" id="iframe" allow="payment"></iframe> </html>
diff --git a/chrome/test/data/capability_delegation/payment_request_delegation_sub.html b/chrome/test/data/capability_delegation/payment_request_delegation_sub.html index c48ecb5..b562df63 100644 --- a/chrome/test/data/capability_delegation/payment_request_delegation_sub.html +++ b/chrome/test/data/capability_delegation/payment_request_delegation_sub.html
@@ -29,7 +29,7 @@ // When show() is not allowed, the Promise above throws a "NotAllowedError" // right away. Otherwise, the visible dialog is aborted after a short delay // below, which causes the Promise above to throw an "AbortError". - window.setTimeout(() => request.abort().catch(()=>{}), 0); + window.setTimeout(() => request.abort().catch(()=>{}), 50); } window.addEventListener("message", tryPaymentRequestAndReport);
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index 0e296f5c..b4e276b 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -142,7 +142,7 @@ deps += [ ":modulize" ] } - if (is_chromeos_ash || is_win) { + if (is_chromeos_ash || is_win || is_mac) { sources += [ "inline_login/inline_login_browsertest.js" ] deps += [ "//build:chromeos_buildflags" ] }
diff --git a/chrome/test/data/webui/chromeos/personalization_app/ambient_subpage_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/ambient_subpage_element_test.ts index fa335cd..5f20b3d 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/ambient_subpage_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/ambient_subpage_element_test.ts
@@ -13,7 +13,6 @@ import {emptyState} from 'chrome://personalization/trusted/personalization_state.js'; import {WallpaperGridItem} from 'chrome://personalization/trusted/wallpaper/wallpaper_grid_item_element.js'; import {CrRadioButtonElement} from 'chrome://resources/cr_elements/cr_radio_button/cr_radio_button.m.js'; -import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {assertDeepEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js'; import {waitAfterNextRender} from 'chrome://webui-test/test_util.js'; @@ -220,7 +219,6 @@ test( 'sets animation theme when animation theme item is clicked', async () => { - loadTimeData.overrideValues({isAmbientModeAnimationEnabled: true}); ambientSubpageElement = await displayMainSettings( TopicSource.kArtGallery, TemperatureUnit.kFahrenheit, /*ambientModeEnabled=*/ true);
diff --git a/chrome/updater/win/installer/installer.cc b/chrome/updater/win/installer/installer.cc index 0247c7e..2a04ecd 100644 --- a/chrome/updater/win/installer/installer.cc +++ b/chrome/updater/win/installer/installer.cc
@@ -282,6 +282,11 @@ } } + // If there is nothing but the executable (and quotes), return an error. + if (cmd_line.length() <= setup_exe.length() + 2) { + return ProcessExitResult(INVALID_OPTION); + } + // Append logging-related arguments for debugging purposes, at least for // now. if (!cmd_line.append(
diff --git a/chrome/updater/win/installer/installer_main.cc b/chrome/updater/win/installer/installer_main.cc index 8c181caa..745edfd 100644 --- a/chrome/updater/win/installer/installer_main.cc +++ b/chrome/updater/win/installer/installer_main.cc
@@ -4,6 +4,8 @@ #include <windows.h> +#include <string> + #include "chrome/updater/win/installer/installer.h" // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx @@ -16,5 +18,11 @@ updater::ProcessExitResult result = updater::WMain(reinterpret_cast<HMODULE>(&__ImageBase)); + if (result.exit_code != updater::SUCCESS_EXIT_CODE) { + std::wstring error = L"Updater error "; + error.append(std::to_wstring(result.exit_code)); + ::MessageBoxEx(nullptr, error.c_str(), nullptr, 0, 0); + } + return result.exit_code; }
diff --git a/chromeos/chromeos_strings.grd b/chromeos/chromeos_strings.grd index 36457b9f..7e5634d 100644 --- a/chromeos/chromeos_strings.grd +++ b/chromeos/chromeos_strings.grd
@@ -2453,7 +2453,7 @@ </message> <!-- Splash screen --> <message name="IDS_SHIMLESS_RMA_SPLASH_TITLE" translateable="false" desc="Message to display while waiting for RMA to initialize at boot."> - Chromebook repair + <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> repair </message> <message name="IDS_SHIMLESS_RMA_SPLASH_REMEMBERING" translateable="false" desc="Message that lets the user know that we are resuming repair."> Remembering where you left off... @@ -2482,7 +2482,7 @@ </message> <!-- Landing page --> <message name="IDS_SHIMLESS_RMA_LANDING_PAGE_TITLE" translateable="false" desc="Title for the landing page at the start of RMA."> - Chromebook repair + <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> repair </message> <message name="IDS_SHIMLESS_RMA_AUTHORIZED_TECH_ONLY_WARNING" translateable="false" desc="Warning that RMA is only for qualified technicians."> This repair process is intended for a trained repair technicians. Start only after replacing the malfunctioning components. @@ -2552,7 +2552,7 @@ Manually disable write-protect </message> <message name="IDS_SHIMLESS_RMA_MANUAL_WP_DISABLE_METHOD_DESCRIPTION" translateable="false" desc="Title for the page offering the options for disabling write protect on this device. Disabling write protection allows the new components to be calibrated and the system to be updated with information about them."> - Once you disable write-protect, you can immediately enable it again. You will see instructions for disabling write-protect on this Chromebook on the next screen. + Once you disable write-protect, you can immediately enable it again. You will see instructions for disabling write-protect on this <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> on the next screen. </message> <message name="IDS_SHIMLESS_RMA_RSU_WP_DISABLE_METHOD_OPTION" translateable="false" desc="Title for the page offering the options for disabling write protect on this device. Disabling write protection allows the new components to be calibrated and the system to be updated with information about them."> Perform RMA Server Unlock (RSU) @@ -2874,7 +2874,7 @@ </message> <!-- Critical error page --> <message name="IDS_SHIMLESS_RMA_CRITICAL_ERROR_TITLE" translateable="false" desc="The title for the critical error page. Critical errors cause the RMA process to attempt to exit to login or reboot the device at users discretion. It will try to cancel RMA, but if that fails the next boot may also trigger an RMA critical error."> - Error + <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> repair error </message> <message name="IDS_SHIMLESS_RMA_CRITICAL_ERROR_MESSAGE" translateable="false" desc="The message for the critical error when Shimless RMA app is launched when not in RMA. This should never happen."> We're running into errors. Try rebooting or return to the login screen.
diff --git a/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc b/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc index 5b152af8b..fc3f5ee 100644 --- a/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc +++ b/chromeos/components/quick_answers/public/cpp/quick_answers_state.cc
@@ -197,11 +197,6 @@ use_text_annotator_for_testing_; } -bool QuickAnswersState::IsSettingsEnforced() { - return pref_change_registrar_->prefs()->IsManagedPreference( - quick_answers::prefs::kQuickAnswersEnabled); -} - void QuickAnswersState::InitializeObserver( QuickAnswersStateObserver* observer) { if (prefs_initialized_) @@ -209,8 +204,9 @@ } void QuickAnswersState::UpdateSettingsEnabled() { - auto settings_enabled = - pref_change_registrar_->prefs()->GetBoolean(kQuickAnswersEnabled); + auto* prefs = pref_change_registrar_->prefs(); + + auto settings_enabled = prefs->GetBoolean(kQuickAnswersEnabled); if (settings_enabled_ == settings_enabled) { return; } @@ -219,8 +215,14 @@ // If the user turn on the Quick Answers in settings, set the consented status // to true. if (settings_enabled_) { - pref_change_registrar_->prefs()->SetInteger(kQuickAnswersConsentStatus, - ConsentStatus::kAccepted); + prefs->SetInteger(kQuickAnswersConsentStatus, ConsentStatus::kAccepted); + } + + // If the feature is enforced off by the administrator policy, set the + // consented status to rejected. + if (!settings_enabled_ && + prefs->IsManagedPreference(quick_answers::prefs::kQuickAnswersEnabled)) { + prefs->SetInteger(kQuickAnswersConsentStatus, ConsentStatus::kRejected); } for (auto& observer : observers_)
diff --git a/chromeos/components/quick_answers/public/cpp/quick_answers_state.h b/chromeos/components/quick_answers/public/cpp/quick_answers_state.h index c3929ec..5700e1e4 100644 --- a/chromeos/components/quick_answers/public/cpp/quick_answers_state.h +++ b/chromeos/components/quick_answers/public/cpp/quick_answers_state.h
@@ -59,8 +59,6 @@ bool ShouldUseQuickAnswersTextAnnotator(); - bool IsSettingsEnforced(); - bool settings_enabled() const { return settings_enabled_; } quick_answers::prefs::ConsentStatus consent_status() const { return consent_status_;
diff --git a/chromeos/crosapi/mojom/crosapi.mojom b/chromeos/crosapi/mojom/crosapi.mojom index 272df054..c85c10f 100644 --- a/chromeos/crosapi/mojom/crosapi.mojom +++ b/chromeos/crosapi/mojom/crosapi.mojom
@@ -529,8 +529,8 @@ // future compatibility, to avoid assumptions about where on disk the directory // is located. // -// Next version: 33 -// Next id: 8 +// Next version: 34 +// Next id: 9 [Stable] struct DefaultPaths { // The default (non-configurable) directory for documents. For example, @@ -564,6 +564,10 @@ // The (non-coniggurable) directory for ash resources. For example, // /opt/google/chrome. [MinVersion=32] mojo_base.mojom.FilePath? ash_resources@7; + + // The default (non-configurable) directory for shared files. For example, + // /home/chronos/u-<hash>/ShareCache. + [MinVersion=33] mojo_base.mojom.FilePath? share_cache@8; }; // The device specific data needed in Lacros.
diff --git a/chromeos/dbus/hermes/hermes_manager_client.cc b/chromeos/dbus/hermes/hermes_manager_client.cc index 2c06f71..28803413 100644 --- a/chromeos/dbus/hermes/hermes_manager_client.cc +++ b/chromeos/dbus/hermes/hermes_manager_client.cc
@@ -4,6 +4,8 @@ #include "chromeos/dbus/hermes/hermes_manager_client.h" +#include <memory> + #include "base/bind.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" @@ -31,7 +33,7 @@ dbus::ObjectPath hermes_manager_path(hermes::kHermesManagerPath); object_proxy_ = bus->GetObjectProxy(hermes::kHermesServiceName, hermes_manager_path); - properties_ = new Properties( + properties_ = std::make_unique<Properties>( object_proxy_, base::BindRepeating(&HermesManagerClientImpl::OnPropertyChanged, weak_ptr_factory_.GetWeakPtr(), @@ -81,7 +83,7 @@ } dbus::ObjectProxy* object_proxy_; - Properties* properties_; + std::unique_ptr<Properties> properties_; base::WeakPtrFactory<HermesManagerClientImpl> weak_ptr_factory_{this}; };
diff --git a/chromeos/network/cellular_policy_handler.cc b/chromeos/network/cellular_policy_handler.cc index 9ef1815..043bdc0 100644 --- a/chromeos/network/cellular_policy_handler.cc +++ b/chromeos/network/cellular_policy_handler.cc
@@ -14,6 +14,7 @@ #include "chromeos/network/managed_network_configuration_handler.h" #include "chromeos/network/network_event_log.h" #include "chromeos/network/network_profile_handler.h" +#include "chromeos/network/network_state_handler.h" #include "chromeos/network/policy_util.h" namespace chromeos { @@ -34,6 +35,8 @@ // Timeout waiting for EUICC to become available in Hermes. constexpr base::TimeDelta kEuiccWaitTime = base::Minutes(3); +// Timeout waiting for cellular device to become available. +constexpr base::TimeDelta kCellularDeviceWaitTime = base::Seconds(30); } // namespace @@ -49,22 +52,27 @@ CellularPolicyHandler::CellularPolicyHandler() = default; -CellularPolicyHandler::~CellularPolicyHandler() = default; +CellularPolicyHandler::~CellularPolicyHandler() { + OnShuttingDown(); +} void CellularPolicyHandler::Init( CellularESimProfileHandler* cellular_esim_profile_handler, CellularESimInstaller* cellular_esim_installer, NetworkProfileHandler* network_profile_handler, + NetworkStateHandler* network_state_handler, ManagedNetworkConfigurationHandler* managed_network_configuration_handler) { cellular_esim_profile_handler_ = cellular_esim_profile_handler; cellular_esim_installer_ = cellular_esim_installer; network_profile_handler_ = network_profile_handler; + network_state_handler_ = network_state_handler; managed_network_configuration_handler_ = managed_network_configuration_handler; hermes_observation_.Observe(HermesManagerClient::Get()); cellular_esim_profile_handler_observation_.Observe( cellular_esim_profile_handler); + network_state_handler_->AddObserver(this, FROM_HERE); } void CellularPolicyHandler::InstallESim(const std::string& smdp_address, @@ -81,6 +89,20 @@ ResumeInstallIfNeeded(); } +void CellularPolicyHandler::DeviceListChanged() { + ResumeInstallIfNeeded(); +} + +void CellularPolicyHandler::OnShuttingDown() { + if (!network_state_handler_) { + return; + } + if (network_state_handler_->HasObserver(this)) { + network_state_handler_->RemoveObserver(this, FROM_HERE); + } + network_state_handler_ = nullptr; +} + void CellularPolicyHandler::ResumeInstallIfNeeded() { if (!is_installing_ || !wait_timer_.IsRunning()) { return; @@ -110,13 +132,29 @@ void CellularPolicyHandler::AttemptInstallESim() { DCHECK(is_installing_); + const DeviceState* cellular_device = + network_state_handler_->GetDeviceStateByType( + NetworkTypePattern::Cellular()); + if (!cellular_device) { + // Cellular device may not be ready. Wait for DeviceListChanged notification + // before continuing with installation. + NET_LOG(EVENT) << "Cellular device is not available when attempting to " + << "install eSIM profile for SMDP address: " + << GetCurrentSmdpAddress() + << ". Waiting for device list change."; + wait_timer_.Start(FROM_HERE, kCellularDeviceWaitTime, + base::BindOnce(&CellularPolicyHandler::OnWaitTimeout, + weak_ptr_factory_.GetWeakPtr())); + return; + } + absl::optional<dbus::ObjectPath> euicc_path = GetCurrentEuiccPath(); if (!euicc_path) { // Hermes may not be ready and available euicc list is empty. Wait for // AvailableEuiccListChanged notification to continue with installation. NET_LOG(EVENT) << "No EUICC found when attempting to install eSIM profile " - "for SMDP address: " - << GetCurrentSmdpAddress() << ". Waiting for EUICC."; + << "for SMDP address: " << GetCurrentSmdpAddress() + << ". Waiting for EUICC."; wait_timer_.Start(FROM_HERE, kEuiccWaitTime, base::BindOnce(&CellularPolicyHandler::OnWaitTimeout, weak_ptr_factory_.GetWeakPtr()));
diff --git a/chromeos/network/cellular_policy_handler.h b/chromeos/network/cellular_policy_handler.h index cea318b3..6131057f 100644 --- a/chromeos/network/cellular_policy_handler.h +++ b/chromeos/network/cellular_policy_handler.h
@@ -13,6 +13,7 @@ #include "base/timer/timer.h" #include "base/values.h" #include "chromeos/network/cellular_esim_profile_handler.h" +#include "chromeos/network/network_state_handler_observer.h" #include "net/base/backoff_entry.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -24,6 +25,7 @@ class CellularESimInstaller; class NetworkProfileHandler; +class NetworkStateHandler; class ManagedNetworkConfigurationHandler; enum class HermesResponseStatus; @@ -36,7 +38,8 @@ // requests that are waiting for retry attempt. class COMPONENT_EXPORT(CHROMEOS_NETWORK) CellularPolicyHandler : public HermesManagerClient::Observer, - public CellularESimProfileHandler::Observer { + public CellularESimProfileHandler::Observer, + public NetworkStateHandlerObserver { public: CellularPolicyHandler(); CellularPolicyHandler(const CellularPolicyHandler&) = delete; @@ -46,6 +49,7 @@ void Init(CellularESimProfileHandler* cellular_esim_profile_handler, CellularESimInstaller* cellular_esim_installer, NetworkProfileHandler* network_profile_handler, + NetworkStateHandler* network_state_handler, ManagedNetworkConfigurationHandler* managed_network_configuration_handler); @@ -84,6 +88,10 @@ // CellularESimProfileHandler::Observer: void OnESimProfileListUpdated() override; + // NetworkStateHandlerObserver: + void DeviceListChanged() override; + void OnShuttingDown() override; + void ResumeInstallIfNeeded(); void ProcessRequests(); void AttemptInstallESim(); @@ -108,6 +116,7 @@ CellularESimProfileHandler* cellular_esim_profile_handler_ = nullptr; CellularESimInstaller* cellular_esim_installer_ = nullptr; NetworkProfileHandler* network_profile_handler_ = nullptr; + NetworkStateHandler* network_state_handler_ = nullptr; ManagedNetworkConfigurationHandler* managed_network_configuration_handler_ = nullptr;
diff --git a/chromeos/network/cellular_policy_handler_unittest.cc b/chromeos/network/cellular_policy_handler_unittest.cc index dea5a0fe..3bf1b4a 100644 --- a/chromeos/network/cellular_policy_handler_unittest.cc +++ b/chromeos/network/cellular_policy_handler_unittest.cc
@@ -15,6 +15,8 @@ #include "chromeos/components/onc/onc_utils.h" #include "chromeos/dbus/hermes/hermes_clients.h" #include "chromeos/dbus/shill/shill_clients.h" +#include "chromeos/dbus/shill/shill_device_client.h" +#include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/network/cellular_connection_handler.h" #include "chromeos/network/cellular_esim_installer.h" #include "chromeos/network/cellular_inhibitor.h" @@ -137,7 +139,7 @@ cellular_policy_handler_ = std::make_unique<CellularPolicyHandler>(); cellular_policy_handler_->Init( cellular_esim_profile_handler_.get(), cellular_esim_installer_.get(), - network_profile_handler_.get(), + network_profile_handler_.get(), network_state_handler_.get(), managed_network_configuration_handler_.get()); } @@ -270,6 +272,31 @@ /*expected_count=*/0); } +TEST_F(CellularPolicyHandlerTest, InstallWaitForDeviceState) { + SetupEuicc(); + ShillManagerClient::Get()->GetTestInterface()->ClearDevices(); + base::RunLoop().RunUntilIdle(); + + const std::string policy = + GenerateCellularPolicy(HermesEuiccClient::Get() + ->GetTestInterface() + ->GenerateFakeActivationCode()); + // Verify the configuration is created automatically after device state + // becomes available. + InstallESimPolicy(policy, + HermesEuiccClient::Get() + ->GetTestInterface() + ->GenerateFakeActivationCode(), + /*expect_install_success=*/false); + CheckShillConfiguration(/*is_installed=*/false); + + ShillDeviceClient::Get()->GetTestInterface()->AddDevice( + "/device/cellular1", shill::kTypeCellular, "TestCellular"); + FastForwardProfileRefreshDelay(); + base::RunLoop().RunUntilIdle(); + CheckShillConfiguration(/*is_installed=*/true); +} + TEST_F(CellularPolicyHandlerTest, InstallWaitForEuicc) { HermesManagerClient::Get()->GetTestInterface()->ClearEuiccs(); const std::string policy =
diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc index ffa7023..4ed5f35 100644 --- a/chromeos/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/network/managed_network_configuration_handler_unittest.cc
@@ -201,7 +201,7 @@ managed_network_configuration_handler_->AddObserver(&policy_observer_); cellular_policy_handler_->Init( cellular_esim_profile_handler_.get(), cellular_esim_installer_.get(), - network_profile_handler_.get(), + network_profile_handler_.get(), network_state_handler_.get(), managed_network_configuration_handler_.get()); base::RunLoop().RunUntilIdle();
diff --git a/chromeos/network/network_handler.cc b/chromeos/network/network_handler.cc index 9cec38e..6ce8399 100644 --- a/chromeos/network/network_handler.cc +++ b/chromeos/network/network_handler.cc
@@ -113,7 +113,7 @@ if (features::IsESimPolicyEnabled()) { cellular_policy_handler_->Init( cellular_esim_profile_handler_.get(), cellular_esim_installer_.get(), - network_profile_handler_.get(), + network_profile_handler_.get(), network_state_handler_.get(), managed_network_configuration_handler_.get()); esim_policy_login_metrics_logger_->Init( network_state_handler_.get(),
diff --git a/chromeos/services/network_config/cros_network_config.cc b/chromeos/services/network_config/cros_network_config.cc index 5dd347f4..46f11e8 100644 --- a/chromeos/services/network_config/cros_network_config.cc +++ b/chromeos/services/network_config/cros_network_config.cc
@@ -2918,29 +2918,39 @@ void CrosNetworkConfig::GetGlobalPolicy(GetGlobalPolicyCallback callback) { auto result = mojom::GlobalPolicy::New(); + + // Network configuration handler can be nullptr in tests. + if (!network_configuration_handler_) { + std::move(callback).Run(std::move(result)); + return; + } + // Global network configuration policy values come from the device policy. const base::Value* global_policy_dict = network_configuration_handler_->GetGlobalConfigFromPolicy( /*userhash=*/std::string()); - if (global_policy_dict) { - result->allow_only_policy_cellular_networks = GetBoolean( - global_policy_dict, - ::onc::global_network_config::kAllowOnlyPolicyCellularNetworks); - result->allow_only_policy_networks_to_autoconnect = GetBoolean( - global_policy_dict, - ::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect); - result->allow_only_policy_wifi_networks_to_connect = - GetBoolean(global_policy_dict, - ::onc::global_network_config::kAllowOnlyPolicyWiFiToConnect); - result - ->allow_only_policy_wifi_networks_to_connect_if_available = GetBoolean( - global_policy_dict, - ::onc::global_network_config::kAllowOnlyPolicyWiFiToConnectIfAvailable); - absl::optional<std::vector<std::string>> blocked_hex_ssids = GetStringList( - global_policy_dict, ::onc::global_network_config::kBlockedHexSSIDs); - if (blocked_hex_ssids) - result->blocked_hex_ssids = std::move(*blocked_hex_ssids); + if (!global_policy_dict) { + std::move(callback).Run(std::move(result)); + return; } + + result->allow_only_policy_cellular_networks = GetBoolean( + global_policy_dict, + ::onc::global_network_config::kAllowOnlyPolicyCellularNetworks); + result->allow_only_policy_networks_to_autoconnect = GetBoolean( + global_policy_dict, + ::onc::global_network_config::kAllowOnlyPolicyNetworksToAutoconnect); + result->allow_only_policy_wifi_networks_to_connect = + GetBoolean(global_policy_dict, + ::onc::global_network_config::kAllowOnlyPolicyWiFiToConnect); + result->allow_only_policy_wifi_networks_to_connect_if_available = GetBoolean( + global_policy_dict, + ::onc::global_network_config::kAllowOnlyPolicyWiFiToConnectIfAvailable); + absl::optional<std::vector<std::string>> blocked_hex_ssids = GetStringList( + global_policy_dict, ::onc::global_network_config::kBlockedHexSSIDs); + if (blocked_hex_ssids) + result->blocked_hex_ssids = std::move(*blocked_hex_ssids); + std::move(callback).Run(std::move(result)); }
diff --git a/chromeos/tast_control.gni b/chromeos/tast_control.gni index 8bcc1f16..44c2cbd 100644 --- a/chromeos/tast_control.gni +++ b/chromeos/tast_control.gni
@@ -150,6 +150,9 @@ "policy.URLCheck.whitelist", # nocheck "policy.URLCheck.blacklist", # nocheck "policy.UserNativePrintersAllowed", # nocheck + + # https://crbug.com/1306441 + "policy.UserAvatarImage", ] # To disable a specific test in lacros_all_tast_tests, add it the following
diff --git a/components/autofill/content/common/mojom/autofill_driver.mojom b/components/autofill/content/common/mojom/autofill_driver.mojom index f93652b..05db5f9 100644 --- a/components/autofill/content/common/mojom/autofill_driver.mojom +++ b/components/autofill/content/common/mojom/autofill_driver.mojom
@@ -137,9 +137,9 @@ mojo_base.mojom.String16 typed_username, int32 options, gfx.mojom.RectF bounds); - // Instructs the browser to show the Touch To Fill UI and whether form - // submission should be triggered after filling. - ShowTouchToFill(bool trigger_submission); + // Instructs the browser to show the Touch To Fill UI and whether the form is + // ready for submission after filling. + ShowTouchToFill(SubmissionReadinessState submission_readiness); // Checks the safe browsing reputation of the website where the focused // username/password field is on.
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 4d53e1ed..7369209 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -446,16 +446,61 @@ } #if BUILDFLAG(IS_ANDROID) +size_t GetIndexOfElement(const FormData& form_data, + const WebInputElement& element) { + for (size_t i = 0; i < form_data.fields.size(); ++i) { + if (form_data.fields[i].unique_renderer_id.value() == + element.UniqueRendererFormControlId()) + return i; + } + return form_data.fields.size(); +} + // Returns a prediction whether the form that contains |username_element| and -// password_element will be ready for submission after filling these two +// |password_element| will be ready for submission after filling these two // elements. -bool IsReadyForSubmissionAfterCredentialFilling( +mojom::SubmissionReadinessState CalculateSubmissionReadiness( + const FormData& form_data, WebInputElement& username_element, WebInputElement& password_element) { - if (password_element.IsNull() || !password_element.IsLastInputElementInForm()) - return false; - // TODO(crbug.com/1299394): Add additional checks and metrics for them. - return true; + DCHECK(!password_element.IsNull()); + + if (username_element.IsNull()) + return mojom::SubmissionReadinessState::kNoUsernameField; + + size_t username_index = GetIndexOfElement(form_data, username_element); + size_t password_index = GetIndexOfElement(form_data, password_element); + size_t number_of_elements = form_data.fields.size(); + if (username_index == number_of_elements || + password_index == number_of_elements) { + // This is unexpected. |form_data| is supposed to contain username and + // password elements. + return mojom::SubmissionReadinessState::kError; + } + + for (size_t i = username_index + 1; i < password_index; ++i) { + if (form_data.fields[i].IsVisible()) + return mojom::SubmissionReadinessState::kFieldBetweenUsernameAndPassword; + } + + if (!password_element.IsLastInputElementInForm()) + return mojom::SubmissionReadinessState::kFieldAfterPasswordField; + + size_t number_of_visible_elements = 0; + for (size_t i = 0; i < number_of_elements; ++i) { + if (form_data.fields[i].IsVisible()) { + if (username_index != i && password_index != i && + form_data.fields[i].value.empty()) { + return mojom::SubmissionReadinessState::kEmptyFields; + } + number_of_visible_elements++; + } + } + + if (number_of_visible_elements > 2) + return mojom::SubmissionReadinessState::kMoreThanTwoFields; + + return mojom::SubmissionReadinessState::kTwoFields; } #endif // BUILDFLAG(IS_ANDROID) @@ -534,9 +579,10 @@ DeferMsg(&mojom::PasswordManagerDriver::ShowPasswordSuggestions, text_direction, typed_username, options, bounds); } - void ShowTouchToFill(bool ready_for_submission) override { + void ShowTouchToFill( + autofill::mojom::SubmissionReadinessState submission_readiness) override { DeferMsg(&mojom::PasswordManagerDriver::ShowTouchToFill, - ready_for_submission); + submission_readiness); } void CheckSafeBrowsingReputation(const GURL& form_action, const GURL& frame_url) override { @@ -1002,11 +1048,15 @@ // TODO(crbug.com/1299430): Consider to disable |TryToShowTouchToFill| and // |ShowTouchToFill| on Desktop. #if BUILDFLAG(IS_ANDROID) - GetPasswordManagerDriver().ShowTouchToFill( - IsReadyForSubmissionAfterCredentialFilling(username_element, - password_element)); + WebFormElement form = password_element.Form(); + std::unique_ptr<FormData> form_data = + form.IsNull() ? GetFormDataFromUnownedInputElements() + : GetFormDataFromWebForm(form); + GetPasswordManagerDriver().ShowTouchToFill(CalculateSubmissionReadiness( + *form_data, username_element, password_element)); #else - GetPasswordManagerDriver().ShowTouchToFill(/*ready_for_submission*/ false); + GetPasswordManagerDriver().ShowTouchToFill( + mojom::SubmissionReadinessState::kNoInformation); #endif touch_to_fill_state_ = TouchToFillState::kIsShowing; @@ -1507,10 +1557,9 @@ DCHECK(input.IsPasswordFieldForAutofill()) << "Form submission attempt for a non-password element"; - // TODO(crbug.com/1283004): Ideally, - // |IsReadyForSubmissionAfterCredentialFilling| should be called to check - // all criteria. Use the DCHECK just for a sanity check now and remove it - // later. + // TODO(crbug.com/1283004): Ideally, |CalculateSubmissionReadiness| should be + // called to check all criteria. Use the DCHECK just for a sanity check now + // and remove it later. DCHECK(input.IsLastInputElementInForm()) << "Form is not ready for submission"; input.DispatchSimulatedEnter();
diff --git a/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc b/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc index 815d4e1..f679571 100644 --- a/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc +++ b/components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc
@@ -62,7 +62,9 @@ int options, const gfx::RectF& bounds) override {} - void ShowTouchToFill(bool trigger_submission) override {} + void ShowTouchToFill( + autofill::mojom::SubmissionReadinessState submission_readiness) override { + } void RecordSavePasswordProgress(const std::string& log) override { called_record_save_ = true;
diff --git a/components/autofill/core/browser/autofill_address_policy_handler.cc b/components/autofill/core/browser/autofill_address_policy_handler.cc index f5d857c..3072e4c 100644 --- a/components/autofill/core/browser/autofill_address_policy_handler.cc +++ b/components/autofill/core/browser/autofill_address_policy_handler.cc
@@ -21,8 +21,9 @@ void AutofillAddressPolicyHandler::ApplyPolicySettings( const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* value = policies.GetValue(policy_name()); - if (value && value->is_bool() && !value->GetBool()) + const base::Value* value = + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); + if (value && !value->GetBool()) prefs->SetBoolean(autofill::prefs::kAutofillProfileEnabled, false); }
diff --git a/components/autofill/core/browser/autofill_credit_card_policy_handler.cc b/components/autofill/core/browser/autofill_credit_card_policy_handler.cc index 012e8a1a..14610c62 100644 --- a/components/autofill/core/browser/autofill_credit_card_policy_handler.cc +++ b/components/autofill/core/browser/autofill_credit_card_policy_handler.cc
@@ -21,8 +21,9 @@ void AutofillCreditCardPolicyHandler::ApplyPolicySettings( const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* value = policies.GetValue(policy_name()); - if (value && value->is_bool() && !value->GetBool()) + const base::Value* value = + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); + if (value && !value->GetBool()) prefs->SetBoolean(autofill::prefs::kAutofillCreditCardEnabled, false); }
diff --git a/components/autofill/core/browser/autofill_policy_handler.cc b/components/autofill/core/browser/autofill_policy_handler.cc index 6f1c71d4..dd14b74 100644 --- a/components/autofill/core/browser/autofill_policy_handler.cc +++ b/components/autofill/core/browser/autofill_policy_handler.cc
@@ -21,20 +21,18 @@ void AutofillPolicyHandler::ApplyPolicySettings( const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* autofill_credit_card_policy_value = - policies.GetValue(policy::key::kAutofillCreditCardEnabled); - const base::Value* autofill_address_policy_value = - policies.GetValue(policy::key::kAutofillAddressEnabled); + const base::Value* autofill_credit_card_policy_value = policies.GetValue( + policy::key::kAutofillCreditCardEnabled, base::Value::Type::BOOLEAN); + const base::Value* autofill_address_policy_value = policies.GetValue( + policy::key::kAutofillAddressEnabled, base::Value::Type::BOOLEAN); // Ignore the old policy if either of the new fine-grained policies are set. - if ((autofill_credit_card_policy_value && - autofill_credit_card_policy_value->is_bool()) || - (autofill_address_policy_value && - autofill_address_policy_value->is_bool())) { + if (autofill_credit_card_policy_value || autofill_address_policy_value) { return; } - const base::Value* value = policies.GetValue(policy_name()); - if (value && value->is_bool() && !value->GetBool()) { + const base::Value* value = + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); + if (value && !value->GetBool()) { prefs->SetBoolean(autofill::prefs::kAutofillEnabledDeprecated, false); // Disable the fine-grained prefs if the main pref is disabled by policy. prefs->SetBoolean(autofill::prefs::kAutofillCreditCardEnabled, false);
diff --git a/components/autofill/core/common/mojom/autofill_types.mojom b/components/autofill/core/common/mojom/autofill_types.mojom index 4760c77e..d135727 100644 --- a/components/autofill/core/common/mojom/autofill_types.mojom +++ b/components/autofill/core/common/mojom/autofill_types.mojom
@@ -67,6 +67,43 @@ SPAN = 7 // e.g. <span name='btn'> }; +// Describes various criteria (e.g. there are empty fields in the form) that +// affect whether a form is ready for submission. Don't change IDs as they are +// used for metrics. +// TODO(crbug.com/1299394): Which criteria will be used for the actual launch +// is a subject to change. For now, we collect metrics to test two versions: +// - |kFieldAfterPasswordField| is the criterion to enable submission in the +// regular launch. +// - |kTwoFields| is the criterion to enable submission in the conservative +// launch. +// After the launch, passing the state to the browser will be useless. +// Therefore, the enum will be removed. +enum SubmissionReadinessState { + // No information received. Supposed to be unused on Android. + kNoInformation = 0, + // Error occurred while assessing submission readiness. Ideally, Chrome + // should not report such votes. Otherwise, |CalculateSubmissionReadiness| + // should be corrected. + kError = 1, + + // Various blockers of forms submission. + // The username field is not found. + kNoUsernameField = 2, + // There are fields between username and password fields. + kFieldBetweenUsernameAndPassword = 3, + // There is a field right after the password field by focus traversal. + kFieldAfterPasswordField = 4, + // There are other empty fields. If the |kFieldBetweenUsernameAndPassword| or + // |kFieldAfterPasswordField| criteria are matched, they should be reported, + // not this one. + kEmptyFields = 5, + // No empty fields and there are more than two visible fields. + kMoreThanTwoFields = 6, + + // The most conservative criterion for submission. + // There are only two visible fields: username and password. + kTwoFields = 7, +}; // autofill::FrameToken struct FrameToken {
diff --git a/components/autofill_assistant/browser/js_flow_executor_impl.cc b/components/autofill_assistant/browser/js_flow_executor_impl.cc index 532b73ba..5e9ac05f 100644 --- a/components/autofill_assistant/browser/js_flow_executor_impl.cc +++ b/components/autofill_assistant/browser/js_flow_executor_impl.cc
@@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/strings/strcat.h" #include "components/autofill_assistant/browser/features.h" +#include "components/autofill_assistant/browser/js_flow_util.h" #include "components/autofill_assistant/browser/parse_jspb.h" #include "components/autofill_assistant/browser/web/web_controller_util.h" @@ -333,11 +334,14 @@ void JsFlowExecutorImpl::OnFlowFinished( const DevtoolsClient::ReplyStatus& reply_status, std::unique_ptr<runtime::EvaluateResult> result) { - // Note that the result is always serialized if available, not just if the - // flow was successful. In particular, this serializes exceptions. - RunCallback( - CheckJavaScriptResult(reply_status, result.get(), __FILE__, __LINE__), - (result != nullptr ? result->Serialize() : nullptr)); + // Check and extract the return value. In case of exceptions, the sanitized + // stack trace will be part of the returned ClientStatus. Only primitive + // values are allowed (see js_flow_util::ExtractFlowReturnValue for details). + std::unique_ptr<base::Value> out_result_value; + ClientStatus status = js_flow_util::ExtractFlowReturnValue( + reply_status, result.get(), out_result_value); + + RunCallback(status, std::move(out_result_value)); } void JsFlowExecutorImpl::RunCallback(
diff --git a/components/autofill_assistant/browser/js_flow_executor_impl_browsertest.cc b/components/autofill_assistant/browser/js_flow_executor_impl_browsertest.cc index f04aa99..3780aeda 100644 --- a/components/autofill_assistant/browser/js_flow_executor_impl_browsertest.cc +++ b/components/autofill_assistant/browser/js_flow_executor_impl_browsertest.cc
@@ -127,7 +127,8 @@ "keyF": true, "keyG": 123.45, "keyH": null - } + }, + "keyI": [1,2,3,4] } )"))); @@ -146,29 +147,29 @@ if (status != 2) { // ACTION_APPLIED return status; } + + // Remove non-allowed types from return value. + delete value.keyB; + delete value.keyC; + delete value.keyD.keyE; + + // Make some changes just to check that this propagates. value.keyA += 3; - value.keyB += '!'; value.keyD.keyF = false; + value.keyI.push(5); return value; )", js_return_value), Property(&ClientStatus::proto_status, ACTION_APPLIED)); EXPECT_EQ(*js_return_value, *base::JSONReader::Read(R"( { - "result": { - "type": "object", - "value": { - "keyA": 12348, - "keyB": "Hello world!", - "keyC": [ "array", "of", "strings" ], - "keyD": { - "keyE": "nested", - "keyF": false, - "keyG": 123.45, - "keyH": null - } - } - } + "keyA": 12348, + "keyD": { + "keyF": false, + "keyG": 123.45, + "keyH": null + }, + "keyI": [1,2,3,4,5] } )")); } @@ -188,15 +189,8 @@ )", result), Property(&ClientStatus::proto_status, ACTION_APPLIED)); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "description": "2", - "type": "number", - "value": 2 - } - } - )")); + // ACTION_APPLIED == 2. + EXPECT_EQ(*result, base::Value(2)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, @@ -218,15 +212,7 @@ )", result), Property(&ClientStatus::proto_status, ACTION_APPLIED)); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "description": "2", - "type": "number", - "value": 2 - } - } - )")); + EXPECT_EQ(*result, base::Value(2)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, RunMultipleNativeActions) { @@ -257,44 +243,25 @@ )", result), Property(&ClientStatus::proto_status, ACTION_APPLIED)); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "description": "3", - "type": "number", - "value": 3 - } - } - )")); + // OTHER_ACTION_STATUS == 3 + EXPECT_EQ(*result, base::Value(3)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ReturnInteger) { std::unique_ptr<base::Value> result; ClientStatus status = RunTest("return 12345;", result); EXPECT_EQ(status.proto_status(), ACTION_APPLIED); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "description": "12345", - "type": "number", - "value": 12345 - } - } - )")); + EXPECT_EQ(*result, base::Value(12345)); } -IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ReturnString) { +IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ReturningStringFails) { + // Return value checking is more comprehensively tested in + // js_flow_util::ContainsOnlyAllowedValues. This test is just to ensure that + // that util is actually used for JS flow return values. std::unique_ptr<base::Value> result; - ClientStatus status = RunTest("return 'Hello world!';", result); - EXPECT_EQ(status.proto_status(), ACTION_APPLIED); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "type": "string", - "value": "Hello world!" - } - } - )")); + ClientStatus status = RunTest("return 'Strings are not allowed!';", result); + EXPECT_EQ(status.proto_status(), INVALID_ACTION); + EXPECT_THAT(result, Eq(nullptr)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ReturnDictionary) { @@ -303,34 +270,25 @@ R"( return { "keyA":12345, - "keyB":"Hello world!", - "keyC": ["array", "of", "strings"], - "keyD": { - "keyE": "nested", - "keyF": true, - "keyG": 123.45, - "keyH": null - } + "keyB": { + "keyC": true, + "keyD": 123.45, + "keyE": null + }, + "keyF": [false, false, true] }; )", result); EXPECT_EQ(status.proto_status(), ACTION_APPLIED); EXPECT_EQ(*result, *base::JSONReader::Read(R"( { - "result": { - "type": "object", - "value": { - "keyA": 12345, - "keyB": "Hello world!", - "keyC": ["array", "of", "strings"], - "keyD": { - "keyE": "nested", - "keyF": true, - "keyG": 123.45, - "keyH": null - } - } - } + "keyA":12345, + "keyB": { + "keyC": true, + "keyD": 123.45, + "keyE": null + }, + "keyF": [false, false, true] } )")); } @@ -339,62 +297,43 @@ std::unique_ptr<base::Value> result; ClientStatus status = RunTest("", result); EXPECT_EQ(status.proto_status(), ACTION_APPLIED); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "type": "undefined" - } - } - )")); + EXPECT_THAT(result, Eq(nullptr)); +} + +IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ReturnNonJsonObjectFails) { + std::unique_ptr<base::Value> result; + ClientStatus status = RunTest(R"( + function test() { + console.log('something'); + } + return test; + )", + result); + EXPECT_EQ(status.proto_status(), INVALID_ACTION); + EXPECT_THAT(result, Eq(nullptr)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ReturnNull) { std::unique_ptr<base::Value> result; ClientStatus status = RunTest("return null;", result); EXPECT_EQ(status.proto_status(), ACTION_APPLIED); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "subtype": "null", - "type": "object", - "value": null - } - } - )")); + EXPECT_EQ(*result, *base::JSONReader::Read("null")); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, ExceptionReporting) { + // Note: the flow wrapper is responsible for the second exception stack frame + // as well as the line offset. In practice, the bottom-most stack frame can + // and/or should be mostly ignored when analyzing stack traces. std::unique_ptr<base::Value> result; ClientStatus status = RunTest("throw new Error('Hello world!');", result); EXPECT_EQ(status.proto_status(), UNEXPECTED_JS_ERROR); - ASSERT_NE(result, nullptr); - - absl::optional<base::Value> exceptionDetails = - result->ExtractKey("exceptionDetails"); - ASSERT_NE(exceptionDetails, absl::nullopt); - - EXPECT_THAT(exceptionDetails->ExtractKey("text")->GetIfString(), - Pointee(Eq("Uncaught (in promise) Error: Hello world!"))); - - // We can't currently check the contents of the reported stack frames since - // they depend on the internal wrapper. For now, we simply test that this is - // not empty. For reference, at the time of writing, this was the full output: - // "exceptionDetails": { - // "columnNumber": 0, - // "exception": { - // "className": "Error", - // "description": "Error: Hello world! - // at <anonymous>:13:11 - // at <anonymous>:13:41", - // "objectId": "1450023673453216843.4.1", - // "subtype": "error", - // "type": "object" - // }, - // "exceptionId": 2, - // "lineNumber": 0, - // "text": "Uncaught (in promise) Error: Hello world!" - // } - EXPECT_THAT(exceptionDetails->ExtractKey("exception"), Ne(absl::nullopt)); + ASSERT_THAT(result, Eq(nullptr)); + EXPECT_THAT( + status.details().unexpected_error_info().js_exception_line_numbers(), + ElementsAre(9, 9)); + EXPECT_THAT( + status.details().unexpected_error_info().js_exception_column_numbers(), + ElementsAre(10, 41)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, RunMultipleConsecutiveFlows) { @@ -403,7 +342,7 @@ ClientStatus status = RunTest(base::StrCat({"return ", base::NumberToString(i)}), result); EXPECT_EQ(status.proto_status(), ACTION_APPLIED); - EXPECT_EQ(result->ExtractKey("result")->ExtractKey("value")->GetIfInt(), i); + EXPECT_EQ(*result, base::Value(i)); } } @@ -455,15 +394,7 @@ )", result); EXPECT_EQ(status.proto_status(), ACTION_APPLIED); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "description": "2", - "type": "number", - "value": 2 - } - } - )")); + EXPECT_EQ(*result, base::Value(2)); } IN_PROC_BROWSER_TEST_F(JsFlowExecutorImplTest, @@ -473,15 +404,7 @@ std::unique_ptr<base::Value> result; EXPECT_EQ(RunTest("return globalFlowState.i;", result).proto_status(), ACTION_APPLIED); - EXPECT_EQ(*result, *base::JSONReader::Read(R"( - { - "result": { - "description": "5", - "type": "number", - "value": 5 - } - } - )")); + EXPECT_EQ(*result, base::Value(5)); } } // namespace
diff --git a/components/autofill_assistant/browser/js_flow_util.cc b/components/autofill_assistant/browser/js_flow_util.cc index d799c9a4..a1ff04e 100644 --- a/components/autofill_assistant/browser/js_flow_util.cc +++ b/components/autofill_assistant/browser/js_flow_util.cc
@@ -3,12 +3,33 @@ // found in the LICENSE file. #include "components/autofill_assistant/browser/js_flow_util.h" +#include "base/strings/strcat.h" +#include "components/autofill_assistant/browser/web/web_controller_util.h" namespace autofill_assistant { -namespace js_flow { -bool ContainsOnlyPrimitveValues(const base::Value& value, - std::string& out_error_message) { +namespace { + +// Returns true for remote object types that flows are allowed to return. This +// is mostly used to filter types like FUNCTION which would otherwise slip +// through. +bool IsAllowedRemoteType(runtime::RemoteObjectType type) { + switch (type) { + case runtime::RemoteObjectType::OBJECT: + case runtime::RemoteObjectType::NUMBER: + case runtime::RemoteObjectType::BOOLEAN: + return true; + default: + return false; + } +} + +} // namespace + +namespace js_flow_util { + +bool ContainsOnlyAllowedValues(const base::Value& value, + std::string& out_error_message) { switch (value.type()) { case base::Value::Type::NONE: case base::Value::Type::BOOLEAN: @@ -23,7 +44,7 @@ return false; case base::Value::Type::DICT: { for (const auto [key, nested_value] : *value.GetIfDict()) { - if (!ContainsOnlyPrimitveValues(nested_value, out_error_message)) { + if (!ContainsOnlyAllowedValues(nested_value, out_error_message)) { return false; } } @@ -31,7 +52,7 @@ } case base::Value::Type::LIST: { for (const auto& entry : *value.GetIfList()) { - if (!ContainsOnlyPrimitveValues(entry, out_error_message)) { + if (!ContainsOnlyAllowedValues(entry, out_error_message)) { return false; } } @@ -40,5 +61,49 @@ } } -} // namespace js_flow +ClientStatus ExtractFlowReturnValue( + const DevtoolsClient::ReplyStatus& devtools_reply_status, + runtime::EvaluateResult* devtools_result, + std::unique_ptr<base::Value>& out_flow_result) { + ClientStatus status = CheckJavaScriptResult( + devtools_reply_status, devtools_result, __FILE__, __LINE__); + if (!status.ok()) { + return status; + } + + const runtime::RemoteObject* remote_object = devtools_result->GetResult(); + if (!remote_object->HasValue() && + remote_object->GetType() == runtime::RemoteObjectType::UNDEFINED) { + // Special case: flows are allowed to return nothing. + return status; + } + + if (!remote_object->HasValue() || + !IsAllowedRemoteType(remote_object->GetType())) { + status.set_proto_status(INVALID_ACTION); + status.mutable_details() + ->mutable_unexpected_error_info() + ->set_devtools_error_message( + base::StrCat({"Invalid return value: only primitive non-string " + "values are allowed, but got RemoteObject of type ", + base::NumberToString( + static_cast<int>(remote_object->GetType()))})); + return status; + } + + std::string error_message; + if (!ContainsOnlyAllowedValues(*remote_object->GetValue(), error_message)) { + status.set_proto_status(INVALID_ACTION); + status.mutable_details() + ->mutable_unexpected_error_info() + ->set_devtools_error_message(error_message); + return status; + } + + out_flow_result = + base::Value::ToUniquePtrValue(remote_object->GetValue()->Clone()); + return OkClientStatus(); +} + +} // namespace js_flow_util } // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/js_flow_util.h b/components/autofill_assistant/browser/js_flow_util.h index 717de48..2db68004 100644 --- a/components/autofill_assistant/browser/js_flow_util.h +++ b/components/autofill_assistant/browser/js_flow_util.h
@@ -5,18 +5,41 @@ #ifndef COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_JS_FLOW_UTIL_H_ #define COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_JS_FLOW_UTIL_H_ +#include <memory> +#include <string> + #include "base/values.h" +#include "components/autofill_assistant/browser/client_status.h" +#include "components/autofill_assistant/browser/devtools/devtools_client.h" namespace autofill_assistant { -namespace js_flow { +namespace js_flow_util { -// Returns true if |value| contains only primitive values. Dictionaries and -// lists are allowed, so long as they only contain primitive values too. -// |out_error_message| will contain details if this returns false. -bool ContainsOnlyPrimitveValues(const base::Value& value, - std::string& out_error_message); +// Returns true if |value| contains only allowed value types, which are INT, +// BOOL, DOUBLE, and NONE. Dictionaries and lists are allowed, so long as they +// only contain allowed value types too. |out_error_message| will contain +// details if this returns false. +bool ContainsOnlyAllowedValues(const base::Value& value, + std::string& out_error_message); -} // namespace js_flow +// Converts an incoming |devtools_result| into a value that is allowed to leave +// the JS sandbox as a flow return value, see |ContainsOnlyAllowedValues|. +// - If |devtools_reply_status| is not ok, this will return OTHER_ACTION_STATUS, +// indicating that this is most likely a client bug. +// - If |devtools_result| does not contain a result, this will return an OK +// client status. +// - If an exception was thrown, this will return UNEXPECTED_JS_ERROR +// containing a sanitized stack trace (i.e., line and column numbers only, no +// error messages). +// - If |devtools_result| contains an unsupported value (e.g., a string, or an +// unserializable value such as a function), this will return INVALID_ACTION. +// Additional information may be available in the status details. +ClientStatus ExtractFlowReturnValue( + const DevtoolsClient::ReplyStatus& devtools_reply_status, + runtime::EvaluateResult* devtools_result, + std::unique_ptr<base::Value>& out_flow_result); + +} // namespace js_flow_util } // namespace autofill_assistant #endif // COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_JS_FLOW_UTIL_H_
diff --git a/components/autofill_assistant/browser/js_flow_util_unittest.cc b/components/autofill_assistant/browser/js_flow_util_unittest.cc index 8cbb02a..9437f8f 100644 --- a/components/autofill_assistant/browser/js_flow_util_unittest.cc +++ b/components/autofill_assistant/browser/js_flow_util_unittest.cc
@@ -10,24 +10,22 @@ #include "testing/gmock/include/gmock/gmock.h" namespace autofill_assistant { -namespace js_flow { +namespace js_flow_util { namespace { TEST(JsFlowUtilTest, SimpleValues) { std::string ignored_error_message; - EXPECT_TRUE(js_flow::ContainsOnlyPrimitveValues(base::Value(), - ignored_error_message)); - EXPECT_TRUE(js_flow::ContainsOnlyPrimitveValues(base::Value(3), - ignored_error_message)); - EXPECT_TRUE(js_flow::ContainsOnlyPrimitveValues(base::Value(2.0), - ignored_error_message)); - EXPECT_TRUE(js_flow::ContainsOnlyPrimitveValues(base::Value(true), - ignored_error_message)); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(base::Value(std::string()), - ignored_error_message)); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues( - base::Value(std::string("test")), ignored_error_message)); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues( + EXPECT_TRUE(ContainsOnlyAllowedValues(base::Value(), ignored_error_message)); + EXPECT_TRUE(ContainsOnlyAllowedValues(base::Value(3), ignored_error_message)); + EXPECT_TRUE( + ContainsOnlyAllowedValues(base::Value(2.0), ignored_error_message)); + EXPECT_TRUE( + ContainsOnlyAllowedValues(base::Value(true), ignored_error_message)); + EXPECT_FALSE(ContainsOnlyAllowedValues(base::Value(std::string()), + ignored_error_message)); + EXPECT_FALSE( + ContainsOnlyAllowedValues(base::Value("test"), ignored_error_message)); + EXPECT_FALSE(ContainsOnlyAllowedValues( base::Value(std::vector<uint8_t>{'b', 'i', 'n', 'a', 'r', 'y'}), ignored_error_message)); } @@ -56,16 +54,16 @@ TEST(JsFlowUtilTest, ComplexAllowedValue) { std::string ignored_error_message; - EXPECT_TRUE(js_flow::ContainsOnlyPrimitveValues(CreateTestValue(), - ignored_error_message)); + EXPECT_TRUE( + ContainsOnlyAllowedValues(CreateTestValue(), ignored_error_message)); } TEST(JsFlowUtilTest, DictContainingStringNotAllowed) { std::string ignored_error_message; base::Value key_a_is_string = CreateTestValue(); key_a_is_string.GetIfDict()->Set("keyA", "not allowed"); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(key_a_is_string, - ignored_error_message)); + EXPECT_FALSE( + ContainsOnlyAllowedValues(key_a_is_string, ignored_error_message)); } TEST(JsFlowUtilTest, DictContainingBinaryNotAllowed) { @@ -73,8 +71,8 @@ base::Value key_a_is_binary = CreateTestValue(); key_a_is_binary.GetIfDict()->Set("keyA", std::vector<uint8_t>{'t', 'e', 's', 't'}); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(key_a_is_binary, - ignored_error_message)); + EXPECT_FALSE( + ContainsOnlyAllowedValues(key_a_is_binary, ignored_error_message)); } TEST(JsFlowUtilTest, NestedDictContainingStringNotAllowed) { @@ -82,8 +80,8 @@ base::Value nested_key_is_string = CreateTestValue(); nested_key_is_string.GetIfDict()->SetByDottedPath("keyE.nestedA", "not allowed"); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(nested_key_is_string, - ignored_error_message)); + EXPECT_FALSE( + ContainsOnlyAllowedValues(nested_key_is_string, ignored_error_message)); } TEST(JsFlowUtilTest, NestedDictContainingBinaryNotAllowed) { @@ -91,8 +89,8 @@ base::Value nested_key_is_binary = CreateTestValue(); nested_key_is_binary.GetIfDict()->SetByDottedPath( "keyE.nestedA", std::vector<uint8_t>{'t', 'e', 's', 't'}); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(nested_key_is_binary, - ignored_error_message)); + EXPECT_FALSE( + ContainsOnlyAllowedValues(nested_key_is_binary, ignored_error_message)); } TEST(JsFlowUtilTest, NestedListContainingStringsNotAllowed) { @@ -102,8 +100,8 @@ list_containing_strings.Append("not allowed"); nested_list_contains_strings.GetIfDict()->SetByDottedPath( "keyE.nestedE", std::move(list_containing_strings)); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(nested_list_contains_strings, - ignored_error_message)); + EXPECT_FALSE(ContainsOnlyAllowedValues(nested_list_contains_strings, + ignored_error_message)); } TEST(JsFlowUtilTest, NestedListContainingBinaryNotAllowed) { @@ -113,8 +111,8 @@ list_containing_binary.Append(std::vector<uint8_t>{'t', 'e', 's', 't'}); nested_list_contains_binary.GetIfDict()->SetByDottedPath( "keyE.nestedE", std::move(list_containing_binary)); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues(nested_list_contains_binary, - ignored_error_message)); + EXPECT_FALSE(ContainsOnlyAllowedValues(nested_list_contains_binary, + ignored_error_message)); } TEST(JsFlowUtilTest, NestedListContainingDictWithStringsNotAllowed) { @@ -124,10 +122,28 @@ list_contains_dict_with_strings.GetIfDict()->FindList("keyG"); ASSERT_TRUE(key_g_list != nullptr); key_g_list->front().GetIfDict()->Set("key", "not allowed"); - EXPECT_FALSE(js_flow::ContainsOnlyPrimitveValues( - list_contains_dict_with_strings, ignored_error_message)); + EXPECT_FALSE(ContainsOnlyAllowedValues(list_contains_dict_with_strings, + ignored_error_message)); +} + +TEST(JsFlowUtilTest, ExtractFlowReturnValue) { + // Note: this is tested much more extensively in the JsFlowExecutorImpl. + DevtoolsClient::ReplyStatus devtools_status; + std::unique_ptr<runtime::EvaluateResult> devtools_result = + runtime::EvaluateResult::Builder() + .SetResult(runtime::RemoteObject::Builder() + .SetType(runtime::RemoteObjectType::NUMBER) + .SetValue(std::make_unique<base::Value>(12345)) + .Build()) + .Build(); + + std::unique_ptr<base::Value> out_flow_value; + ClientStatus status = ExtractFlowReturnValue( + devtools_status, devtools_result.get(), out_flow_value); + EXPECT_TRUE(status.ok()); + EXPECT_EQ(*out_flow_value, base::Value(12345)); } } // namespace -} // namespace js_flow +} // namespace js_flow_util } // namespace autofill_assistant
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java index bac7af1..d8f42f1 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTask.java
@@ -121,7 +121,8 @@ String whereClause = directoryColumnName + " LIKE ? OR " + directoryColumnName + " LIKE ? OR " + directoryColumnName + " LIKE ? OR " + directoryColumnName - + " LIKE ? OR " + directoryColumnName + " LIKE ?"; + + " LIKE ? OR " + directoryColumnName + " LIKE ? OR " + directoryColumnName + + " LIKE ?"; String additionalClause = ""; if (mIncludeImages) { additionalClause = MediaStore.Files.FileColumns.MEDIA_TYPE + "=" @@ -136,6 +137,7 @@ String cameraDir = getCameraDirectory(); String picturesDir = Environment.DIRECTORY_PICTURES; + String moviesDir = Environment.DIRECTORY_MOVIES; String downloadsDir = Environment.DIRECTORY_DOWNLOADS; // Files downloaded from the user's Google Photos library go to a Restored folder. String restoredDir = Environment.DIRECTORY_DCIM + "/Restored"; @@ -145,6 +147,7 @@ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { cameraDir = Environment.getExternalStoragePublicDirectory(cameraDir).toString(); picturesDir = Environment.getExternalStoragePublicDirectory(picturesDir).toString(); + moviesDir = Environment.getExternalStoragePublicDirectory(moviesDir).toString(); downloadsDir = Environment.getExternalStoragePublicDirectory(downloadsDir).toString(); restoredDir = Environment.getExternalStoragePublicDirectory(restoredDir).toString(); screenshotsDir = @@ -155,6 +158,7 @@ // Include: cameraDir + "%", picturesDir + "%", + moviesDir + "%", downloadsDir + "%", restoredDir + "%", screenshotsDir + "%",
diff --git a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTaskTest.java b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTaskTest.java index d3219305..68fcee6 100644 --- a/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTaskTest.java +++ b/components/browser_ui/photo_picker/android/java/src/org/chromium/components/browser_ui/photo_picker/FileEnumWorkerTaskTest.java
@@ -206,8 +206,8 @@ String[] selectColumns = {MediaStore.Files.FileColumns._ID, MediaStore.Files.FileColumns.DATE_ADDED, MediaStore.Files.FileColumns.MEDIA_TYPE, MediaStore.Files.FileColumns.MIME_TYPE, MediaStore.Files.FileColumns.DATA}; - String whereClause = - "_data LIKE ? OR _data LIKE ? OR _data LIKE ? OR _data LIKE ? OR _data LIKE ?"; + String whereClause = "_data LIKE ? OR _data LIKE ? OR _data LIKE ? OR _data LIKE ? OR " + + "_data LIKE ? OR _data LIKE ?"; String orderBy = MediaStore.MediaColumns.DATE_ADDED + " DESC"; ArgumentCaptor<String[]> argument = ArgumentCaptor.forClass(String[].class); @@ -215,17 +215,19 @@ .query(eq(contentUri), eq(selectColumns), eq(whereClause), argument.capture(), eq(orderBy)); String[] actualWhereArgs = argument.getValue(); - Assert.assertEquals(5, actualWhereArgs.length); + Assert.assertEquals(6, actualWhereArgs.length); Assert.assertTrue(actualWhereArgs[0], actualWhereArgs[0].contains(Environment.DIRECTORY_DCIM + "/Camera")); Assert.assertTrue( actualWhereArgs[1], actualWhereArgs[1].contains(Environment.DIRECTORY_PICTURES)); Assert.assertTrue( - actualWhereArgs[2], actualWhereArgs[2].contains(Environment.DIRECTORY_DOWNLOADS)); - Assert.assertTrue(actualWhereArgs[3], - actualWhereArgs[3].contains(Environment.DIRECTORY_DCIM + "/Restored")); + actualWhereArgs[2], actualWhereArgs[2].contains(Environment.DIRECTORY_MOVIES)); + Assert.assertTrue( + actualWhereArgs[3], actualWhereArgs[3].contains(Environment.DIRECTORY_DOWNLOADS)); Assert.assertTrue(actualWhereArgs[4], - actualWhereArgs[4].contains(Environment.DIRECTORY_DCIM + "/Screenshots")); + actualWhereArgs[4].contains(Environment.DIRECTORY_DCIM + "/Restored")); + Assert.assertTrue(actualWhereArgs[5], + actualWhereArgs[5].contains(Environment.DIRECTORY_DCIM + "/Screenshots")); } @Test
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index 01d75e5..6b2a1d9 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "7.1", - "log_list_timestamp": "2022-03-15T01:34:41Z", + "version": "7.2", + "log_list_timestamp": "2022-03-16T01:33:58Z", "operators": [ { "name": "Google",
diff --git a/components/chromeos_camera/BUILD.gn b/components/chromeos_camera/BUILD.gn index c407a8e..9039bbc 100644 --- a/components/chromeos_camera/BUILD.gn +++ b/components/chromeos_camera/BUILD.gn
@@ -58,7 +58,10 @@ "//ui/gfx/geometry", ] - deps = [ "//mojo/public/cpp/system" ] + deps = [ + "//media/gpu", + "//mojo/public/cpp/system", + ] } # TODO(crbug.com/960243): Don't compile these codes for build without vaapi/v4l2
diff --git a/components/chromeos_camera/dmabuf_utils.cc b/components/chromeos_camera/dmabuf_utils.cc index 0fa4d72..fdffee4 100644 --- a/components/chromeos_camera/dmabuf_utils.cc +++ b/components/chromeos_camera/dmabuf_utils.cc
@@ -4,6 +4,8 @@ #include "components/chromeos_camera/dmabuf_utils.h" +#include <unistd.h> + #include <utility> #include "base/files/scoped_file.h" @@ -13,11 +15,44 @@ #include "media/base/color_plane_layout.h" #include "media/base/video_frame.h" #include "media/base/video_frame_layout.h" +#include "media/gpu/buffer_validation.h" #include "mojo/public/cpp/system/platform_handle.h" #include "ui/gfx/geometry/rect.h" namespace chromeos_camera { +bool VerifyMjpegBufferHandle(const gfx::GpuMemoryBufferHandle& gmb_handle) { + if (gmb_handle.native_pixmap_handle.planes[0].offset != 0u) { + DLOG(ERROR) << "Invalid DMA buf plane offset"; + return false; + } + // For MJPEG, we expect the byte size to be at least as large as the stride + // (see b/142105578). + if (base::strict_cast<uint64_t>( + gmb_handle.native_pixmap_handle.planes[0].stride) > + gmb_handle.native_pixmap_handle.planes[0].size) { + DLOG(ERROR) << "Invalid DMA buf plane stride or size"; + return false; + } + const auto dma_buf_fd = gmb_handle.native_pixmap_handle.planes[0].fd.get(); + const off_t data_size = lseek(dma_buf_fd, /*offset=*/0, SEEK_END); + if (data_size == static_cast<off_t>(-1)) { + PLOG(ERROR) << "Failed to get the size of the dma-buf"; + return false; + } + if (lseek(dma_buf_fd, /*offset=*/0, SEEK_SET) == static_cast<off_t>(-1)) { + PLOG(ERROR) << "Failed to reset the file offset of the dma-buf"; + return false; + } + if (!base::IsValueInRangeForNumericType<uint64_t>(data_size) || + base::checked_cast<uint64_t>(data_size) < + gmb_handle.native_pixmap_handle.planes[0].size) { + DLOG(ERROR) << "Invalid DMA buf plane size"; + return false; + } + return true; +} + scoped_refptr<media::VideoFrame> ConstructVideoFrame( std::vector<mojom::DmaBufPlanePtr> dma_buf_planes, media::VideoPixelFormat pixel_format, @@ -34,8 +69,9 @@ } const gfx::Rect visible_rect(coded_size); - std::vector<base::ScopedFD> dma_buf_fds(num_planes); - std::vector<media::ColorPlaneLayout> planes(num_planes); + gfx::GpuMemoryBufferHandle gmb_handle; + gmb_handle.type = gfx::GpuMemoryBufferType::NATIVE_PIXMAP; + gmb_handle.native_pixmap_handle.planes.resize(num_planes); for (size_t i = 0; i < num_planes; ++i) { mojo::PlatformHandle handle = mojo::UnwrapPlatformHandle(std::move(dma_buf_planes[i]->fd_handle)); @@ -43,7 +79,33 @@ DLOG(ERROR) << "Invalid DMA buf file descriptor"; return nullptr; } - dma_buf_fds[i] = handle.TakeFD(); + if (dma_buf_planes[i]->stride <= 0) { + DLOG(ERROR) << "Invalid DMA buf stride"; + return nullptr; + } + gmb_handle.native_pixmap_handle.planes[i].stride = + base::checked_cast<uint32_t>(dma_buf_planes[i]->stride); + gmb_handle.native_pixmap_handle.planes[i].offset = + base::strict_cast<uint64_t>(dma_buf_planes[i]->offset); + gmb_handle.native_pixmap_handle.planes[i].size = + base::strict_cast<uint64_t>(dma_buf_planes[i]->size); + gmb_handle.native_pixmap_handle.planes[i].fd = handle.TakeFD(); + } + if (pixel_format == media::PIXEL_FORMAT_MJPEG) { + if (!VerifyMjpegBufferHandle(gmb_handle)) { + return nullptr; + } + } else { + if (!media::VerifyGpuMemoryBufferHandle(pixel_format, coded_size, + gmb_handle)) { + return nullptr; + } + } + + std::vector<base::ScopedFD> dma_buf_fds(num_planes); + std::vector<media::ColorPlaneLayout> planes(num_planes); + for (size_t i = 0; i < num_planes; ++i) { + dma_buf_fds[i] = std::move(gmb_handle.native_pixmap_handle.planes[i].fd); planes[i] = media::ColorPlaneLayout( dma_buf_planes[i]->stride, base::strict_cast<size_t>(dma_buf_planes[i]->offset),
diff --git a/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc b/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc index e5522782..4869248 100644 --- a/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc +++ b/components/chromeos_camera/jpeg_encode_accelerator_unittest.cc
@@ -5,6 +5,7 @@ #include <stdint.h> #include <string.h> +#include <sys/mman.h> #include <memory> #include "base/at_exit.h" @@ -427,7 +428,7 @@ // |hw_out_frame_| should only be mapped once. auto mapper = media::GenericDmaBufVideoFrameMapper::Create(hw_out_frame_->format()); - hw_out_frame_ = mapper->Map(hw_out_frame_); + hw_out_frame_ = mapper->Map(hw_out_frame_, PROT_READ | PROT_WRITE); } size_t sw_encoded_size = 0;
diff --git a/components/content_settings/core/browser/cookie_settings_policy_handler.cc b/components/content_settings/core/browser/cookie_settings_policy_handler.cc index 419891b..5188308 100644 --- a/components/content_settings/core/browser/cookie_settings_policy_handler.cc +++ b/components/content_settings/core/browser/cookie_settings_policy_handler.cc
@@ -24,7 +24,7 @@ const policy::PolicyMap& policies, PrefValueMap* prefs) { const base::Value* third_party_cookie_blocking = - policies.GetValue(policy_name()); + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); if (third_party_cookie_blocking) { prefs->SetInteger( prefs::kCookieControlsMode, @@ -43,9 +43,9 @@ // If there is a Cookie BLOCK default content setting, then Privacy Sandbox // APIs should be disabled, regardless of whether they were enabled along // with third party cookies. - const base::Value* default_cookie_setting = - policies.GetValue(policy::key::kDefaultCookiesSetting); - if (default_cookie_setting && default_cookie_setting->is_int() && + const base::Value* default_cookie_setting = policies.GetValue( + policy::key::kDefaultCookiesSetting, base::Value::Type::INTEGER); + if (default_cookie_setting && static_cast<ContentSetting>(default_cookie_setting->GetInt()) == CONTENT_SETTING_BLOCK) { prefs->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
diff --git a/components/content_settings/core/browser/insecure_private_network_policy_handler.cc b/components/content_settings/core/browser/insecure_private_network_policy_handler.cc index f86d8ec..2a37fdb5 100644 --- a/components/content_settings/core/browser/insecure_private_network_policy_handler.cc +++ b/components/content_settings/core/browser/insecure_private_network_policy_handler.cc
@@ -31,8 +31,9 @@ void InsecurePrivateNetworkPolicyHandler::ApplyPolicySettings( const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* value = policies.GetValue(policy_name()); - if (value && value->is_bool()) { + const base::Value* value = + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); + if (value) { prefs->SetValue( prefs::kManagedDefaultInsecurePrivateNetworkSetting, base::Value(ConvertBooleanToContentSetting(value->GetBool())));
diff --git a/components/enterprise/browser/reporting/cloud_profile_reporting_policy_handler.cc b/components/enterprise/browser/reporting/cloud_profile_reporting_policy_handler.cc index 82b5213c..ca8148d 100644 --- a/components/enterprise/browser/reporting/cloud_profile_reporting_policy_handler.cc +++ b/components/enterprise/browser/reporting/cloud_profile_reporting_policy_handler.cc
@@ -46,7 +46,7 @@ const policy::PolicyMap& policies, PrefValueMap* prefs) { const base::Value* cloud_profile_reporting_policy_value = - policies.GetValue(policy_name()); + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); if (cloud_profile_reporting_policy_value) { prefs->SetBoolean(kCloudProfileReportingEnabled,
diff --git a/components/enterprise/browser/reporting/cloud_reporting_frequency_policy_handler.cc b/components/enterprise/browser/reporting/cloud_reporting_frequency_policy_handler.cc index d52c426..2a35812 100644 --- a/components/enterprise/browser/reporting/cloud_reporting_frequency_policy_handler.cc +++ b/components/enterprise/browser/reporting/cloud_reporting_frequency_policy_handler.cc
@@ -50,7 +50,9 @@ void CloudReportingFrequencyPolicyHandler::ApplyPolicySettings( const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* value = policies.GetValue(policy_name()); + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. + const base::Value* value = policies.GetValueUnsafe(policy_name()); int value_in_range; if (value && EnsureInRange(value, &value_in_range, nullptr)) prefs->SetValue(kCloudReportingUploadFrequency,
diff --git a/components/enterprise/browser/reporting/cloud_reporting_policy_handler.cc b/components/enterprise/browser/reporting/cloud_reporting_policy_handler.cc index 7f12b5b..1f891eb 100644 --- a/components/enterprise/browser/reporting/cloud_reporting_policy_handler.cc +++ b/components/enterprise/browser/reporting/cloud_reporting_policy_handler.cc
@@ -29,7 +29,9 @@ bool CloudReportingPolicyHandler::CheckPolicySettings( const policy::PolicyMap& policies, policy::PolicyErrorMap* errors) { - if (!policies.GetValue(policy_name())) + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. + if (!policies.GetValueUnsafe(policy_name())) return true; if (!TypeCheckingPolicyHandler::CheckPolicySettings(policies, errors)) return false; @@ -47,7 +49,7 @@ const policy::PolicyMap& policies, PrefValueMap* prefs) { const base::Value* cloud_reporting_policy_value = - policies.GetValue(policy_name()); + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); if (cloud_reporting_policy_value) { prefs->SetBoolean(kCloudReportingEnabled,
diff --git a/components/enterprise/content/copy_prevention_settings_policy_handler.cc b/components/enterprise/content/copy_prevention_settings_policy_handler.cc index f9776ac..45d62766 100644 --- a/components/enterprise/content/copy_prevention_settings_policy_handler.cc +++ b/components/enterprise/content/copy_prevention_settings_policy_handler.cc
@@ -31,7 +31,9 @@ bool CopyPreventionSettingsPolicyHandler::CheckPolicySettings( const policy::PolicyMap& policies, policy::PolicyErrorMap* errors) { - const base::Value* value = policies.GetValue(policy_name()); + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. + const base::Value* value = policies.GetValueUnsafe(policy_name()); if (!value) return true; @@ -70,7 +72,8 @@ void CopyPreventionSettingsPolicyHandler::ApplyPolicySettings( const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* value = policies.GetValue(policy_name()); + const base::Value* value = + policies.GetValue(policy_name(), base::Value::Type::DICT); if (!value) return; @@ -87,4 +90,4 @@ } prefs->SetValue(pref_path_, std::move(processed_value)); -} \ No newline at end of file +}
diff --git a/components/enterprise/content/copy_prevention_settings_policy_handler_unittests.cc b/components/enterprise/content/copy_prevention_settings_policy_handler_unittests.cc index db005f51..0370e734 100644 --- a/components/enterprise/content/copy_prevention_settings_policy_handler_unittests.cc +++ b/components/enterprise/content/copy_prevention_settings_policy_handler_unittests.cc
@@ -130,7 +130,8 @@ ASSERT_TRUE(prefs.GetValue(enterprise::content::kCopyPreventionSettings, &value_in_pref)); - const base::Value* value_in_map = policy_map.GetValue(kPolicyName); + const base::Value* value_in_map = + policy_map.GetValue(kPolicyName, base::Value::Type::DICT); ASSERT_TRUE(value_in_pref->Equals(value_in_map)); } @@ -250,4 +251,4 @@ policy::PolicyErrorMap errors; ASSERT_FALSE(handler->CheckPolicySettings(policy_map, &errors)); ASSERT_FALSE(errors.empty()); -} \ No newline at end of file +}
diff --git a/components/feed/core/v2/api_test/feed_api_subscriptions_unittest.cc b/components/feed/core/v2/api_test/feed_api_subscriptions_unittest.cc index d91ec6f..a29156a 100644 --- a/components/feed/core/v2/api_test/feed_api_subscriptions_unittest.cc +++ b/components/feed/core/v2/api_test/feed_api_subscriptions_unittest.cc
@@ -1209,14 +1209,14 @@ EXPECT_FALSE(callback.RunAndGetResult().success); } -TEST_F(FeedApiSubscriptionsTest, FetchSubscribedWebFeedsAbortOnClearAll) { - // Test task ordering: ClearAllTask, FetchSubscribedWebFeedsTask. +TEST_F(FeedApiSubscriptionsTest, FetchSubscribedWebFeedsRetryOnClearAll) { + // Test task ordering: ClearAllTask, FetchSubscribedWebFeedsTask, then retry. stream_->OnCacheDataCleared(); CallbackReceiver<WebFeedSubscriptions::RefreshResult> callback; network_.InjectListWebFeedsResponse({MakeWireWebFeed("cats")}); subscriptions().RefreshSubscriptions(callback.Bind()); - EXPECT_FALSE(callback.RunAndGetResult().success); + EXPECT_TRUE(callback.RunAndGetResult().success); } TEST_F(FeedApiSubscriptionsTest, FieldTrialRegistered_OneFollow) {
diff --git a/components/feed/core/v2/web_feed_subscription_coordinator.cc b/components/feed/core/v2/web_feed_subscription_coordinator.cc index 88aca7d..9bf4825a 100644 --- a/components/feed/core/v2/web_feed_subscription_coordinator.cc +++ b/components/feed/core/v2/web_feed_subscription_coordinator.cc
@@ -771,18 +771,25 @@ void WebFeedSubscriptionCoordinator::FetchSubscribedWebFeedsComplete( FetchSubscribedWebFeedsTask::Result result) { + if (result.status == + WebFeedRefreshStatus::kAbortFetchWebFeedPendingClearAll) { + // Retry the task if it was cancelled by a ClearAll, and don't call the + // callbacks. + fetching_subscribed_web_feeds_ = false; + FetchSubscribedWebFeedsStart(); + return; + } + feed_stream_->GetMetricsReporter().RefreshSubscribedWebFeedsAttempted( fetching_subscribed_web_feeds_because_stale_, result.status, result.subscribed_web_feeds.size()); - if (result.status != - WebFeedRefreshStatus::kAbortFetchWebFeedPendingClearAll) { - DCHECK(model_); - fetching_subscribed_web_feeds_because_stale_ = false; - fetching_subscribed_web_feeds_ = false; - if (result.status == WebFeedRefreshStatus::kSuccess) - model_->UpdateSubscribedFeeds(std::move(result.subscribed_web_feeds)); - } + DCHECK(model_); + fetching_subscribed_web_feeds_because_stale_ = false; + fetching_subscribed_web_feeds_ = false; + + if (result.status == WebFeedRefreshStatus::kSuccess) + model_->UpdateSubscribedFeeds(std::move(result.subscribed_web_feeds)); SubscriptionsChanged();
diff --git a/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc index 367073e9..f761e58 100644 --- a/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc +++ b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc
@@ -223,6 +223,7 @@ WebFeature::kWebCodecsVideoFrameFromBuffer, WebFeature::kOpenWebDatabaseInsecureContext, WebFeature::kPrivateNetworkAccessIgnoredPreflightError, + WebFeature::kWebBluetoothGetAvailability, })); return *opt_in_features; }
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc index 0bc21a2..1614dec 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.cc +++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -395,11 +395,12 @@ TransformToRootCoordinates(render_frame_host_, bounds)); } -void ContentPasswordManagerDriver::ShowTouchToFill(bool trigger_submission) { +void ContentPasswordManagerDriver::ShowTouchToFill( + autofill::mojom::SubmissionReadinessState submission_readiness) { if (!password_manager::bad_message::CheckFrameNotPrerendering( render_frame_host_)) return; - client_->ShowTouchToFill(this, trigger_submission); + client_->ShowTouchToFill(this, submission_readiness); } void ContentPasswordManagerDriver::CheckSafeBrowsingReputation(
diff --git a/components/password_manager/content/browser/content_password_manager_driver.h b/components/password_manager/content/browser/content_password_manager_driver.h index d2cbd95..3e2f081b 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.h +++ b/components/password_manager/content/browser/content_password_manager_driver.h
@@ -139,7 +139,8 @@ const std::u16string& typed_username, int options, const gfx::RectF& bounds) override; - void ShowTouchToFill(bool trigger_submission) override; + void ShowTouchToFill( + autofill::mojom::SubmissionReadinessState submission_readiness) override; void CheckSafeBrowsingReputation(const GURL& form_action, const GURL& frame_url) override; void FocusedInputChanged(
diff --git a/components/password_manager/core/browser/password_manager_client.cc b/components/password_manager/core/browser/password_manager_client.cc index 3cb85a2..6fc1788 100644 --- a/components/password_manager/core/browser/password_manager_client.cc +++ b/components/password_manager/core/browser/password_manager_client.cc
@@ -27,8 +27,9 @@ return true; } -void PasswordManagerClient::ShowTouchToFill(PasswordManagerDriver* driver, - bool trigger_submission) {} +void PasswordManagerClient::ShowTouchToFill( + PasswordManagerDriver* driver, + autofill::mojom::SubmissionReadinessState submission_readiness) {} void PasswordManagerClient::OnPasswordSelected(const std::u16string& text) {}
diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h index 3d158a2..291ad17c 100644 --- a/components/password_manager/core/browser/password_manager_client.h +++ b/components/password_manager/core/browser/password_manager_client.h
@@ -184,8 +184,9 @@ CredentialsCallback callback) = 0; // Instructs the client to show the Touch To Fill UI. - virtual void ShowTouchToFill(PasswordManagerDriver* driver, - bool trigger_submission); + virtual void ShowTouchToFill( + PasswordManagerDriver* driver, + autofill::mojom::SubmissionReadinessState submission_readiness); // Informs `PasswordReuseDetectionManager` about reused passwords selected // from the AllPasswordsBottomSheet.
diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc index c8f166a..e493272 100644 --- a/components/password_manager/core/common/password_manager_features.cc +++ b/components/password_manager/core/common/password_manager_features.cc
@@ -281,6 +281,12 @@ const char kPasswordChangeInSettingsWithForcedWarningForEverySite[] = "should_force_warning_for_every_site_in_settings"; +#if BUILDFLAG(IS_ANDROID) +// Enables using conservative heuristics to calculate submission readiness. +const char kTouchToFillPasswordSubmissionWithConservativeHeuristics[] = + "should_use_conservative_heuristics"; +#endif // IS_ANDROID + bool IsPasswordScriptsFetchingEnabled() { return base::FeatureList::IsEnabled(kPasswordScriptsFetching) || base::FeatureList::IsEnabled(kPasswordDomainCapabilitiesFetching);
diff --git a/components/password_manager/core/common/password_manager_features.h b/components/password_manager/core/common/password_manager_features.h index b01d577..3d997607 100644 --- a/components/password_manager/core/common/password_manager_features.h +++ b/components/password_manager/core/common/password_manager_features.h
@@ -107,6 +107,11 @@ kPasswordChangeWithForcedDialogAfterEverySuccessfulSubmission[]; extern const char kPasswordChangeInSettingsWithForcedWarningForEverySite[]; +#if BUILDFLAG(IS_ANDROID) +// Touch To Fill submission feature's variations. +extern const char kTouchToFillPasswordSubmissionWithConservativeHeuristics[]; +#endif // IS_ANDROID + // Returns true if any of the password script fetching related flags are // enabled. bool IsPasswordScriptsFetchingEnabled();
diff --git a/components/reporting/util/test_support_callbacks.cc b/components/reporting/util/test_support_callbacks.cc index 332dfad3..2d51479d 100644 --- a/components/reporting/util/test_support_callbacks.cc +++ b/components/reporting/util/test_support_callbacks.cc
@@ -4,13 +4,10 @@ #include "components/reporting/util/test_support_callbacks.h" -#include "base/run_loop.h" - namespace reporting { namespace test { -TestCallbackWaiter::TestCallbackWaiter() - : run_loop_(base::RunLoop::Type::kNestableTasksAllowed) {} +TestCallbackWaiter::TestCallbackWaiter() = default; TestCallbackWaiter::~TestCallbackWaiter() = default; TestCallbackAutoWaiter::TestCallbackAutoWaiter() {
diff --git a/components/reporting/util/test_support_callbacks.h b/components/reporting/util/test_support_callbacks.h index 4422e67..74872e5 100644 --- a/components/reporting/util/test_support_callbacks.h +++ b/components/reporting/util/test_support_callbacks.h
@@ -7,10 +7,18 @@ #include <atomic> #include <tuple> +#include <utility> +#include "base/bind.h" #include "base/callback.h" +#include "base/callback_helpers.h" #include "base/logging.h" +#include "base/memory/scoped_refptr.h" #include "base/run_loop.h" +#include "base/sequence_checker.h" +#include "base/task/bind_post_task.h" +#include "base/task/sequenced_task_runner.h" +#include "base/threading/sequenced_task_runner_handle.h" namespace reporting { namespace test { @@ -27,11 +35,12 @@ template <typename ResType> class TestEvent { public: - TestEvent() : run_loop_(base::RunLoop::Type::kNestableTasksAllowed) {} - ~TestEvent() = default; + TestEvent() = default; + ~TestEvent() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } TestEvent(const TestEvent& other) = delete; TestEvent& operator=(const TestEvent& other) = delete; ResType result() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); run_loop_.Run(); return std::forward<ResType>(result_); } @@ -42,17 +51,26 @@ // when the caller requires it. // If the caller expects OnceCallback, result will be converted automatically. base::RepeatingCallback<void(ResType res)> cb() { - return base::BindRepeating( - [](base::RunLoop* run_loop, ResType* result, ResType res) { - *result = std::forward<ResType>(res); - run_loop->Quit(); - }, - base::Unretained(&run_loop_), base::Unretained(&result_)); + return base::BindPostTask( + task_runner_.get(), + base::BindRepeating( + [](base::WeakPtr<TestEvent<ResType>> self, ResType res) { + CHECK(self); + self->result_ = std::forward<ResType>(res); + self->run_loop_.Quit(); + }, + weak_ptr_factory_.GetWeakPtr())); } private: - base::RunLoop run_loop_; + scoped_refptr<base::SequencedTaskRunner> task_runner_{ + base::SequencedTaskRunnerHandle::Get()}; + SEQUENCE_CHECKER(sequence_checker_); + + base::RunLoop run_loop_{base::RunLoop::Type::kNestableTasksAllowed}; ResType result_; + + base::WeakPtrFactory<TestEvent<ResType>> weak_ptr_factory_{this}; }; // Usage (in tests only): @@ -67,8 +85,8 @@ template <typename... ResType> class TestMultiEvent { public: - TestMultiEvent() : run_loop_(base::RunLoop::Type::kNestableTasksAllowed) {} - ~TestMultiEvent() = default; + TestMultiEvent() = default; + ~TestMultiEvent() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } TestMultiEvent(const TestMultiEvent& other) = delete; TestMultiEvent& operator=(const TestMultiEvent& other) = delete; std::tuple<ResType...> result() { @@ -78,18 +96,26 @@ // Completion callback to hand over to the processing method. base::RepeatingCallback<void(ResType... res)> cb() { - return base::BindRepeating( - [](base::RunLoop* run_loop, std::tuple<ResType...>* result, - ResType... res) { - *result = std::forward_as_tuple(res...); - run_loop->Quit(); - }, - base::Unretained(&run_loop_), base::Unretained(&result_)); + return base::BindPostTask( + task_runner_.get(), + base::BindRepeating( + [](base::WeakPtr<TestMultiEvent<ResType...>> self, ResType... res) { + CHECK(self); + self->result_ = std::forward_as_tuple(res...); + self->run_loop_.Quit(); + }, + weak_ptr_factory_.GetWeakPtr())); } private: - base::RunLoop run_loop_; + scoped_refptr<base::SequencedTaskRunner> task_runner_{ + base::SequencedTaskRunnerHandle::Get()}; + SEQUENCE_CHECKER(sequence_checker_); + + base::RunLoop run_loop_{base::RunLoop::Type::kNestableTasksAllowed}; std::tuple<ResType...> result_; + + base::WeakPtrFactory<TestMultiEvent<ResType...>> weak_ptr_factory_{this}; }; // Usage (in tests only): @@ -137,7 +163,7 @@ private: std::atomic<size_t> counter_{1}; // Owned by constructor. - base::RunLoop run_loop_; + base::RunLoop run_loop_{base::RunLoop::Type::kNestableTasksAllowed}; }; // RAAI wrapper for TestCallbackWaiter.
diff --git a/components/safe_browsing/core/common/safe_browsing_policy_handler.cc b/components/safe_browsing/core/common/safe_browsing_policy_handler.cc index 567b40f..e001724 100644 --- a/components/safe_browsing/core/common/safe_browsing_policy_handler.cc +++ b/components/safe_browsing/core/common/safe_browsing_policy_handler.cc
@@ -55,8 +55,10 @@ // does not have a valid value, returns |nullopt|. absl::optional<ProtectionLevel> GetValueFromSafeBrowsingEnabledPolicy( const policy::PolicyMap& policies) { + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. const base::Value* safe_browsing_enabled = - policies.GetValue(policy::key::kSafeBrowsingEnabled); + policies.GetValueUnsafe(policy::key::kSafeBrowsingEnabled); if (CheckSafeBrowsingEnabled(safe_browsing_enabled, nullptr /*error*/) != PolicyCheckResult::kValid) { @@ -107,8 +109,10 @@ // does not have a valid value, returns |nullopt|. absl::optional<ProtectionLevel> GetValueFromSafeBrowsingProtectionLevelPolicy( const policy::PolicyMap& policies) { + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. const base::Value* safe_browsing_protection_level = - policies.GetValue(policy::key::kSafeBrowsingProtectionLevel); + policies.GetValueUnsafe(policy::key::kSafeBrowsingProtectionLevel); if (CheckSafeBrowsingProtectionLevel(safe_browsing_protection_level, nullptr /*error*/) != @@ -142,14 +146,18 @@ const policy::PolicyMap& policies, policy::PolicyErrorMap* errors) { // Deprecated boolean policy SafeBrowsingEnabled. + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. const base::Value* safe_browsing_enabled = - policies.GetValue(policy::key::kSafeBrowsingEnabled); + policies.GetValueUnsafe(policy::key::kSafeBrowsingEnabled); PolicyCheckResult safe_browsing_enabled_result = CheckSafeBrowsingEnabled(safe_browsing_enabled, errors); - // Enumerated policy SafeBrowsingProtectionLevel + // Enumerated policy SafeBrowsingProtectionLevel. + // |GetValueUnsafe(...)| is used in order to differentiate between the policy + // value being unset vs being set with an incorrect type. const base::Value* safe_browsing_protection_level = - policies.GetValue(policy::key::kSafeBrowsingProtectionLevel); + policies.GetValueUnsafe(policy::key::kSafeBrowsingProtectionLevel); PolicyCheckResult safe_browsing_protection_level_result = CheckSafeBrowsingProtectionLevel(safe_browsing_protection_level, errors);
diff --git a/components/search_engines/default_search_policy_handler.cc b/components/search_engines/default_search_policy_handler.cc index bcb6d75..adbe3d2 100644 --- a/components/search_engines/default_search_policy_handler.cc +++ b/components/search_engines/default_search_policy_handler.cc
@@ -28,14 +28,9 @@ const char* key, base::DictionaryValue* dict) { DCHECK(dict); - const base::Value* policy_value = policies.GetValue(policy_name); - bool is_list = false; - if (policy_value) { - is_list = policy_value->is_list(); - DCHECK(is_list); - } - - dict->Set(key, is_list + const base::Value* policy_value = + policies.GetValue(policy_name, base::Value::Type::LIST); + dict->Set(key, policy_value ? std::make_unique<base::Value>(policy_value->Clone()) : std::make_unique<base::Value>(base::Value::Type::LIST)); } @@ -46,12 +41,10 @@ const char* key, base::DictionaryValue* dict) { DCHECK(dict); - std::string str; - if (const base::Value* policy_value = policies.GetValue(policy_name)) { - DCHECK(policy_value->is_string()); - str = policy_value->GetString(); - } - dict->SetStringKey(key, str); + const base::Value* policy_value = + policies.GetValue(policy_name, base::Value::Type::STRING); + dict->SetStringKey(key, + policy_value ? policy_value->GetString() : std::string()); } void SetBooleanInPref(const PolicyMap& policies, @@ -59,12 +52,9 @@ const char* key, base::DictionaryValue* dict) { DCHECK(dict); - bool bool_value = false; - if (const base::Value* policy_value = policies.GetValue(policy_name)) { - DCHECK(policy_value->is_bool()); - bool_value = policy_value->GetBool(); - } - dict->SetBoolPath(key, bool_value); + const base::Value* policy_value = + policies.GetValue(policy_name, base::Value::Type::BOOLEAN); + dict->SetBoolPath(key, policy_value && policy_value->GetBool()); } } // namespace @@ -243,7 +233,9 @@ for (const auto& policy_map_entry : kDefaultSearchPolicyDataMap) { // It's important to check policy type for all policies and not just exit on // the first error, so we report all policy errors. - const base::Value* value = policies.GetValue(policy_map_entry.policy_name); + // |GetValueUnsafe(...)| is used due to multiple policy types being handled. + const base::Value* value = + policies.GetValueUnsafe(policy_map_entry.policy_name); if (value && value->type() != policy_map_entry.value_type) { errors->AddError(policy_map_entry.policy_name, IDS_POLICY_TYPE_ERROR, base::Value::GetTypeName(policy_map_entry.value_type)); @@ -270,10 +262,9 @@ bool DefaultSearchPolicyHandler::DefaultSearchProviderIsDisabled( const PolicyMap& policies) { - const base::Value* provider_enabled = - policies.GetValue(key::kDefaultSearchProviderEnabled); - return provider_enabled && provider_enabled->is_bool() && - !provider_enabled->GetBool(); + const base::Value* provider_enabled = policies.GetValue( + key::kDefaultSearchProviderEnabled, base::Value::Type::BOOLEAN); + return provider_enabled && !provider_enabled->GetBool(); } bool DefaultSearchPolicyHandler::DefaultSearchProviderPolicyIsSet( @@ -285,8 +276,9 @@ const PolicyMap& policies, const base::Value** url_value, std::string* url_string) { - *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL); - if (!*url_value || !(*url_value)->is_string()) + *url_value = policies.GetValue(key::kDefaultSearchProviderSearchURL, + base::Value::Type::STRING); + if (!*url_value) return false; *url_string = (*url_value)->GetString();
diff --git a/components/search_engines/default_search_policy_handler_unittest.cc b/components/search_engines/default_search_policy_handler_unittest.cc index a091591..d051a95 100644 --- a/components/search_engines/default_search_policy_handler_unittest.cc +++ b/components/search_engines/default_search_policy_handler_unittest.cc
@@ -167,7 +167,8 @@ EXPECT_TRUE(store_->GetValue( DefaultSearchManager::kDefaultSearchProviderDataPrefName, &temp)); - auto old_value = policy.GetValue(policy_name)->Clone(); + // |GetValueUnsafe(...)| is used due to multiple policy types being handled. + auto old_value = policy.GetValueUnsafe(policy_name)->Clone(); // BinaryValue is not supported in any current default search policy params. // Try changing policy param to BinaryValue and check that policy becomes // invalid.
diff --git a/components/sync/driver/glue/sync_engine_backend.cc b/components/sync/driver/glue/sync_engine_backend.cc index f5605e0..4dd4c14 100644 --- a/components/sync/driver/glue/sync_engine_backend.cc +++ b/components/sync/driver/glue/sync_engine_backend.cc
@@ -471,17 +471,21 @@ sync_manager_->UpdateInvalidationClientId(client_id); } -void SyncEngineBackend::DoOnInvalidationReceived(const std::string& payload) { +void SyncEngineBackend::DoOnStandaloneInvalidationReceived( + const std::string& payload, + const ModelTypeSet& interested_data_types) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(base::FeatureList::IsEnabled(kSyncSendInterestedDataTypes) && base::FeatureList::IsEnabled(kUseSyncInvalidations)); const IncomingInvalidationStatus status = - DoOnInvalidationReceivedImpl(payload); + DoOnStandaloneInvalidationReceivedImpl(payload, interested_data_types); RecordIncomingInvalidationStatus(status); } SyncEngineBackend::IncomingInvalidationStatus -SyncEngineBackend::DoOnInvalidationReceivedImpl(const std::string& payload) { +SyncEngineBackend::DoOnStandaloneInvalidationReceivedImpl( + const std::string& payload, + const ModelTypeSet& interested_data_types) { sync_pb::SyncInvalidationsPayload payload_message; if (!payload_message.ParseFromString(payload)) { return IncomingInvalidationStatus::kPayloadParseFailed; @@ -497,8 +501,12 @@ continue; } + if (!interested_data_types.Has(model_type)) { + // Filter out invalidations for unsubscribed data types. + continue; + } + contains_valid_model_type = true; - // TODO(crbug.com/1119798): Use only enabled data types. RecordInvalidationPerModelType(model_type); std::unique_ptr<SyncInvalidation> inv_adapter = std::make_unique<SyncInvalidationAdapter>(payload_message.hint());
diff --git a/components/sync/driver/glue/sync_engine_backend.h b/components/sync/driver/glue/sync_engine_backend.h index 31dd257..44965cd 100644 --- a/components/sync/driver/glue/sync_engine_backend.h +++ b/components/sync/driver/glue/sync_engine_backend.h
@@ -176,7 +176,9 @@ // Forwards an invalidation to the sync manager for all data types extracted // from the |payload|. This method is called for sync standalone // invalidations. - void DoOnInvalidationReceived(const std::string& payload); + void DoOnStandaloneInvalidationReceived( + const std::string& payload, + const ModelTypeSet& interested_data_types); // Returns a ListValue representing Nigori node. void GetNigoriNodeForDebugging(AllNodesCallback callback); @@ -201,8 +203,9 @@ void LoadAndConnectNigoriController(); - IncomingInvalidationStatus DoOnInvalidationReceivedImpl( - const std::string& payload); + IncomingInvalidationStatus DoOnStandaloneInvalidationReceivedImpl( + const std::string& payload, + const ModelTypeSet& interested_data_types); // Name used for debugging. const std::string name_;
diff --git a/components/sync/driver/glue/sync_engine_impl.cc b/components/sync/driver/glue/sync_engine_impl.cc index 6b2e86e..461a9de 100644 --- a/components/sync/driver/glue/sync_engine_impl.cc +++ b/components/sync/driver/glue/sync_engine_impl.cc
@@ -579,10 +579,15 @@ void SyncEngineImpl::OnInvalidationReceived(const std::string& payload) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // TODO(crbug.com/1082122): check that sync engine is fully initialized. + // TODO(crbug.com/1082122): check that sync engine is fully initialized and + // store incoming invalidations until then. sync_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&SyncEngineBackend::DoOnInvalidationReceived, - backend_, payload)); + FROM_HERE, + base::BindOnce( + &SyncEngineBackend::DoOnStandaloneInvalidationReceived, backend_, + payload, + sync_invalidations_service_->GetInterestedDataTypes().value_or( + ModelTypeSet()))); } // static
diff --git a/components/sync/driver/glue/sync_engine_impl_unittest.cc b/components/sync/driver/glue/sync_engine_impl_unittest.cc index 8ee150e9..4b7ed845 100644 --- a/components/sync/driver/glue/sync_engine_impl_unittest.cc +++ b/components/sync/driver/glue/sync_engine_impl_unittest.cc
@@ -329,11 +329,11 @@ protected: SyncInvalidationsService* GetSyncInvalidationsService() override { - return &mock_instance_id_driver_; + return &mock_sync_invalidations_service_; } base::test::ScopedFeatureList override_features_; - NiceMock<MockSyncInvalidationsService> mock_instance_id_driver_; + NiceMock<MockSyncInvalidationsService> mock_sync_invalidations_service_; }; class SyncEngineImplWithSyncInvalidationsForWalletAndOfferTest @@ -673,7 +673,9 @@ TEST_F(SyncEngineImplWithSyncInvalidationsTest, ShouldInvalidateDataTypesOnIncomingInvalidation) { - EXPECT_CALL(mock_instance_id_driver_, AddListener(backend_.get())); + enabled_types_.PutAll({syncer::BOOKMARKS, syncer::PREFERENCES}); + + EXPECT_CALL(mock_sync_invalidations_service_, AddListener(backend_.get())); InitializeBackend(/*expect_success=*/true); sync_pb::SyncInvalidationsPayload payload; @@ -686,6 +688,8 @@ preferences_invalidation->set_data_type_id( GetSpecificsFieldNumberFromModelType(ModelType::PREFERENCES)); + EXPECT_CALL(mock_sync_invalidations_service_, GetInterestedDataTypes()) + .WillOnce(Return(enabled_types_)); backend_->OnInvalidationReceived(payload.SerializeAsString()); fake_manager_->WaitForSyncThread(); @@ -694,6 +698,34 @@ } TEST_F(SyncEngineImplWithSyncInvalidationsTest, + ShouldInvalidateOnlyEnabledDataTypes) { + enabled_types_.Remove(syncer::BOOKMARKS); + enabled_types_.Put(syncer::PREFERENCES); + + EXPECT_CALL(mock_sync_invalidations_service_, AddListener(backend_.get())); + InitializeBackend(/*expect_success=*/true); + ConfigureDataTypes(); + + sync_pb::SyncInvalidationsPayload payload; + sync_pb::SyncInvalidationsPayload::DataTypeInvalidation* + bookmarks_invalidation = payload.add_data_type_invalidations(); + bookmarks_invalidation->set_data_type_id( + GetSpecificsFieldNumberFromModelType(ModelType::BOOKMARKS)); + sync_pb::SyncInvalidationsPayload::DataTypeInvalidation* + preferences_invalidation = payload.add_data_type_invalidations(); + preferences_invalidation->set_data_type_id( + GetSpecificsFieldNumberFromModelType(ModelType::PREFERENCES)); + + EXPECT_CALL(mock_sync_invalidations_service_, GetInterestedDataTypes()) + .WillOnce(Return(enabled_types_)); + backend_->OnInvalidationReceived(payload.SerializeAsString()); + + fake_manager_->WaitForSyncThread(); + EXPECT_EQ(0, fake_manager_->GetInvalidationCount(ModelType::BOOKMARKS)); + EXPECT_EQ(1, fake_manager_->GetInvalidationCount(ModelType::PREFERENCES)); +} + +TEST_F(SyncEngineImplWithSyncInvalidationsTest, UseOldInvalidationsOnlyForWalletAndOffer) { enabled_types_.PutAll({AUTOFILL_WALLET_DATA, AUTOFILL_WALLET_OFFER});
diff --git a/components/sync/driver/sync_policy_handler.cc b/components/sync/driver/sync_policy_handler.cc index 367563b..96d5679 100644 --- a/components/sync/driver/sync_policy_handler.cc +++ b/components/sync/driver/sync_policy_handler.cc
@@ -57,16 +57,15 @@ void SyncPolicyHandler::ApplyPolicySettings(const policy::PolicyMap& policies, PrefValueMap* prefs) { - const base::Value* disable_sync_value = policies.GetValue(policy_name()); - if (disable_sync_value && disable_sync_value->is_bool() && - disable_sync_value->GetBool()) { + const base::Value* disable_sync_value = + policies.GetValue(policy_name(), base::Value::Type::BOOLEAN); + if (disable_sync_value && disable_sync_value->GetBool()) { prefs->SetValue(prefs::kSyncManaged, disable_sync_value->Clone()); } - const base::Value* disabled_sync_types_value = - policies.GetValue(policy::key::kSyncTypesListDisabled); - - if (disabled_sync_types_value && disabled_sync_types_value->is_list()) { + const base::Value* disabled_sync_types_value = policies.GetValue( + policy::key::kSyncTypesListDisabled, base::Value::Type::LIST); + if (disabled_sync_types_value) { base::Value::ConstListView list = disabled_sync_types_value->GetListDeprecated(); for (const base::Value& type_name : list) {
diff --git a/components/test/data/optimization_guide/page_topics_128_model.tflite b/components/test/data/optimization_guide/page_topics_128_model.tflite new file mode 100644 index 0000000..7d8376d --- /dev/null +++ b/components/test/data/optimization_guide/page_topics_128_model.tflite Binary files differ
diff --git a/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc b/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc index a5ba1246..19f9d0c 100644 --- a/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc +++ b/components/webapps/browser/android/add_to_homescreen_data_fetcher.cc
@@ -13,6 +13,7 @@ #include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" +#include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "base/task/sequenced_task_runner.h" @@ -159,9 +160,11 @@ } // Set the user-editable title to be the page's title. - shortcut_info_.user_title = web_page_metadata->application_name.empty() - ? web_contents_->GetTitle() - : web_page_metadata->application_name; + std::u16string app_name; + base::TrimWhitespace(web_page_metadata->application_name, + base::TrimPositions::TRIM_ALL, &app_name); + shortcut_info_.user_title = + app_name.empty() ? web_contents_->GetTitle() : app_name; shortcut_info_.short_name = shortcut_info_.user_title; shortcut_info_.name = shortcut_info_.user_title;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index aab0998..bfaeccc 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -2465,10 +2465,6 @@ deps += [ "//content/browser/devtools:devtools_resources_extern" ] } - if (enable_basic_printing) { - deps += [ "//printing" ] - } - if (is_mac) { frameworks += [ "AppKit.framework" ] sources += [ @@ -2682,6 +2678,9 @@ "//ppapi/shared_impl", ] + assert(enable_basic_printing) + deps += [ "//printing" ] + if (is_chromeos_ash) { sources += [ "renderer_host/pepper/pepper_vpn_provider_message_filter_chromeos.cc",
diff --git a/content/browser/file_system/browser_file_system_helper.cc b/content/browser/file_system/browser_file_system_helper.cc index 527db29..4fd7e56f 100644 --- a/content/browser/file_system/browser_file_system_helper.cc +++ b/content/browser/file_system/browser_file_system_helper.cc
@@ -113,6 +113,7 @@ scoped_refptr<storage::FileSystemContext> CreateFileSystemContext( BrowserContext* browser_context, const base::FilePath& profile_path, + const base::FilePath& bucket_base_path, bool is_incognito, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy) { // Setting up additional filesystem backends. @@ -136,7 +137,7 @@ browser_context->GetMountPoints(), browser_context->GetSpecialStoragePolicy(), std::move(quota_manager_proxy), std::move(additional_backends), - url_request_auto_mount_handlers, profile_path, options); + url_request_auto_mount_handlers, profile_path, bucket_base_path, options); for (const storage::FileSystemType& type : file_system_context->GetFileSystemTypes()) {
diff --git a/content/browser/file_system/browser_file_system_helper.h b/content/browser/file_system/browser_file_system_helper.h index 2a66c35..ebc9d4a1a 100644 --- a/content/browser/file_system/browser_file_system_helper.h +++ b/content/browser/file_system/browser_file_system_helper.h
@@ -38,6 +38,7 @@ CreateFileSystemContext( BrowserContext* browser_context, const base::FilePath& profile_path, + const base::FilePath& bucket_base_path, bool is_incognito, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy);
diff --git a/content/browser/file_system/browser_file_system_helper_unittest.cc b/content/browser/file_system/browser_file_system_helper_unittest.cc index c9b32095..bdf2874 100644 --- a/content/browser/file_system/browser_file_system_helper_unittest.cc +++ b/content/browser/file_system/browser_file_system_helper_unittest.cc
@@ -75,7 +75,8 @@ /*quota_manager_proxy=*/nullptr, std::vector<std::unique_ptr<storage::FileSystemBackend>>(), std::vector<storage::URLRequestAutoMountHandler>(), - /*partition_path=*/base::FilePath(), file_system_options); + /*partition_path=*/base::FilePath(), + /*bucket_base_path=*/base::FilePath(), file_system_options); // Prepare content::DropData containing |file_system_url|. DropData::FileSystemFileInfo filesystem_file_info;
diff --git a/content/browser/file_system/file_system_operation_runner_unittest.cc b/content/browser/file_system/file_system_operation_runner_unittest.cc index 19220d49..ff6fe632 100644 --- a/content/browser/file_system/file_system_operation_runner_unittest.cc +++ b/content/browser/file_system/file_system_operation_runner_unittest.cc
@@ -209,7 +209,7 @@ base::MakeRefCounted<storage::MockSpecialStoragePolicy>(), /*quota_manager_proxy=*/nullptr, std::vector<std::unique_ptr<storage::FileSystemBackend>>(), - std::vector<storage::URLRequestAutoMountHandler>(), base_dir, + std::vector<storage::URLRequestAutoMountHandler>(), base_dir, base_dir, storage::CreateAllowFileAccessOptions()); // Disallow IO on the main loop.
diff --git a/content/browser/renderer_host/render_widget_helper.cc b/content/browser/renderer_host/render_widget_helper.cc index 146591a..90347035 100644 --- a/content/browser/renderer_host/render_widget_helper.cc +++ b/content/browser/renderer_host/render_widget_helper.cc
@@ -7,11 +7,8 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/lazy_instance.h" -#include "base/posix/eintr_wrapper.h" -#include "base/threading/thread.h" -#include "base/threading/thread_restrictions.h" -#include "content/browser/renderer_host/render_view_host_impl.h" #include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" namespace content { namespace {
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index b78be9fb..acdb415 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -1193,7 +1193,8 @@ // Each consumer is responsible for registering its QuotaClient during // its construction. filesystem_context_ = CreateFileSystemContext( - browser_context_, partition_path_, is_in_memory(), quota_manager_proxy); + browser_context_, partition_path_, GetBucketBasePath(), is_in_memory(), + quota_manager_proxy); database_tracker_ = storage::DatabaseTracker::Create( partition_path_, is_in_memory(),
diff --git a/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-auralinux.txt b/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-auralinux.txt index 552c40d1f2..0a6872f 100644 --- a/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-auralinux.txt +++ b/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-auralinux.txt
@@ -1,22 +1,21 @@ [document web] +++[separator] name='Control: elements that are not in tree' horizontal ++[section] -++++[separator] name='Control: elements that are not in tree' horizontal ++++[section] ++++++[section] -++++++++[section] -++++++++++[entry] selectable-text -++++[separator] name='An aria-owned element is always in tree' horizontal -++++[panel] -++++++[push button] name='button-in-owned-tree' -++++[separator] name='Element with aria-owns is always in tree' horizontal +++++++++[entry] selectable-text +++[separator] name='An aria-owned element is always in tree' horizontal +++[panel] +++++[push button] name='button-in-owned-tree' +++[separator] name='Element with aria-owns is always in tree' horizontal +++[section] +++++[entry] selectable-text +++[separator] name='Owning an element with unincluded ancestors serializes cleanly' horizontal +++[panel] +++++[check box] checkable:true +++[separator] name='All the above in one' horizontal +++[section] ++++[section] -++++++[entry] selectable-text -++++[separator] name='Owning an element with unincluded ancestors serializes cleanly' horizontal -++++[panel] -++++++[check box] checkable:true -++++[separator] name='All the above in one' horizontal +++++++[static] name='xyz' ++++[section] -++++++[section] -++++++++[static] name='xyz' -++++++[section] -++++++++[slider] horizontal current=50.000000 minimum=0.000000 maximum=100.000000 +++++++[slider] horizontal current=50.000000 minimum=0.000000 maximum=100.000000
diff --git a/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-blink.txt b/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-blink.txt index a768635..86297cd 100644 --- a/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-blink.txt +++ b/content/test/data/accessibility/aria/aria-owns-included-in-tree-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea ++genericContainer ignored -++++genericContainer +++++genericContainer ignored ++++++genericContainer ignored ++++++++splitter horizontal name='Control: elements that are not in tree' ++++++++genericContainer ignored
diff --git a/content/test/data/accessibility/aria/label-with-selected-option-expected-blink.txt b/content/test/data/accessibility/aria/label-with-selected-option-expected-blink.txt index 170e69f..f24d099 100644 --- a/content/test/data/accessibility/aria/label-with-selected-option-expected-blink.txt +++ b/content/test/data/accessibility/aria/label-with-selected-option-expected-blink.txt
@@ -1,7 +1,7 @@ rootWebArea ++genericContainer ignored ++++genericContainer ignored -++++++genericContainer +++++++genericContainer ignored ++++++++checkBox name='Test 1: Flash the screen 2 times.' checkedState=false ++++++++labelText ++++++++++staticText name='Test 1: Flash the screen' @@ -18,7 +18,7 @@ ++++++++++++++++inlineTextBox name='3' ++++++++++staticText name='times.' ++++++++++++inlineTextBox name='times.' -++++++genericContainer +++++++genericContainer ignored ++++++++checkBox name='Test 2: Flash the screen 2 times.' checkedState=false ++++++++labelText ++++++++++staticText name='Test 2: Flash the screen' @@ -37,7 +37,7 @@ ++++++++++++++++++inlineTextBox name='3' ++++++++++staticText name='times.' ++++++++++++inlineTextBox name='times.' -++++++genericContainer +++++++genericContainer ignored ++++++++checkBox name='Test 3: Flash the screen two times.' checkedState=false ++++++++labelText ++++++++++staticText name='Test 3: Flash the screen' @@ -54,7 +54,7 @@ ++++++++++++++++inlineTextBox name='3' ++++++++++staticText name='times.' ++++++++++++inlineTextBox name='times.' -++++++genericContainer +++++++genericContainer ignored ++++++++checkBox name='Test 4: Flash the screen two times.' checkedState=false ++++++++labelText ++++++++++staticText name='Test 4: Flash the screen' @@ -73,7 +73,7 @@ ++++++++++++++++++inlineTextBox name='3' ++++++++++staticText name='times.' ++++++++++++inlineTextBox name='times.' -++++++genericContainer +++++++genericContainer ignored ++++++++checkBox name='Test 5: Flash the screen two times.' checkedState=false ++++++++labelText ++++++++++staticText name='Test 5: Flash the screen'
diff --git a/content/test/data/accessibility/css/before-after-block-expected-blink.txt b/content/test/data/accessibility/css/before-after-block-expected-blink.txt index 8cb1b0a2..344d34c 100644 --- a/content/test/data/accessibility/css/before-after-block-expected-blink.txt +++ b/content/test/data/accessibility/css/before-after-block-expected-blink.txt
@@ -1,7 +1,7 @@ rootWebArea htmlTag='#document' ++genericContainer ignored htmlTag='html' ++++genericContainer ignored htmlTag='body' -++++++genericContainer htmlTag='div' +++++++genericContainer ignored htmlTag='div' ++++++++staticText name='A' ++++++++++inlineTextBox name='A' ++++++++genericContainer ignored htmlTag='b'
diff --git a/content/test/data/accessibility/css/before-after-code-expected-android-external.txt b/content/test/data/accessibility/css/before-after-code-expected-android-external.txt index f1ca5d2f..0906446 100644 --- a/content/test/data/accessibility/css/before-after-code-expected-android-external.txt +++ b/content/test/data/accessibility/css/before-after-code-expected-android-external.txt
@@ -1,4 +1,24 @@ WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] ++TextView text:"start" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] -++TextView text:"text with [:before] and [:after] content, then abold element with a [block] before content then a italicelement with a [block] after content" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"text with " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"[" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:":before" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"]" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" and " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"[" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:":after" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"]" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" content, then a" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"bold" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" element with a " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"[" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"block" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"]" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" before content then a " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"italic" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"element with a " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"[" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"block" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"]" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" after content" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] ++TextView text:"end" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/a-nested-structure-expected-android-external.txt b/content/test/data/accessibility/html/a-nested-structure-expected-android-external.txt index 6d58949..b7d1548 100644 --- a/content/test/data/accessibility/html/a-nested-structure-expected-android-external.txt +++ b/content/test/data/accessibility/html/a-nested-structure-expected-android-external.txt
@@ -1,14 +1,13 @@ WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] -++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] -++++View text:"null" contentDescription:"Header 1 List element 1 List element 2 List element 3" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="http://www.foobar.com/"] -++++++TextView text:"Header 1" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", clickableScore="100", roleDescription="heading 1"] -++++++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list", clickableScore="100"] -++++++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] -++++++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] -++++++++++TextView text:"List element 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] -++++++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] -++++++++++TextView text:"List element 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] -++++++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] -++++++++++TextView text:"List element 3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file +++View text:"null" contentDescription:"Header 1 List element 1 List element 2 List element 3" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="http://www.foobar.com/"] +++++TextView text:"Header 1" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", clickableScore="100", roleDescription="heading 1"] +++++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list", clickableScore="100"] +++++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] +++++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] +++++++++TextView text:"List element 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] +++++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] +++++++++TextView text:"List element 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] +++++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] +++++++++TextView text:"List element 3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/a-nested-structure-expected-android.txt b/content/test/data/accessibility/html/a-nested-structure-expected-android.txt index 1d08501..fac36600 100644 --- a/content/test/data/accessibility/html/a-nested-structure-expected-android.txt +++ b/content/test/data/accessibility/html/a-nested-structure-expected-android.txt
@@ -1,14 +1,13 @@ android.webkit.WebView focusable focused scrollable -++android.view.View -++++android.view.View role_description='link' clickable focusable link name='Header 1 List element 1 List element 2 List element 3' -++++++android.widget.TextView role_description='heading 1' heading name='Header 1' -++++++android.widget.ListView collection item_count=3 row_count=3 -++++++++android.view.View collection_item -++++++++++android.view.View name='%E2%80%A2 ' -++++++++++android.widget.TextView name='List element 1' -++++++++android.view.View collection_item item_index=1 row_index=1 -++++++++++android.view.View name='%E2%80%A2 ' -++++++++++android.widget.TextView name='List element 2' -++++++++android.view.View collection_item item_index=2 row_index=2 -++++++++++android.view.View name='%E2%80%A2 ' -++++++++++android.widget.TextView name='List element 3' \ No newline at end of file +++android.view.View role_description='link' clickable focusable link name='Header 1 List element 1 List element 2 List element 3' +++++android.widget.TextView role_description='heading 1' heading name='Header 1' +++++android.widget.ListView collection item_count=3 row_count=3 +++++++android.view.View collection_item +++++++++android.view.View name='%E2%80%A2 ' +++++++++android.widget.TextView name='List element 1' +++++++android.view.View collection_item item_index=1 row_index=1 +++++++++android.view.View name='%E2%80%A2 ' +++++++++android.widget.TextView name='List element 2' +++++++android.view.View collection_item item_index=2 row_index=2 +++++++++android.view.View name='%E2%80%A2 ' +++++++++android.widget.TextView name='List element 3' \ No newline at end of file
diff --git a/content/test/data/accessibility/html/a-nested-structure-expected-auralinux.txt b/content/test/data/accessibility/html/a-nested-structure-expected-auralinux.txt index 2bb42c14..b34baeb3 100644 --- a/content/test/data/accessibility/html/a-nested-structure-expected-auralinux.txt +++ b/content/test/data/accessibility/html/a-nested-structure-expected-auralinux.txt
@@ -1,15 +1,14 @@ [document web] -++[section] -++++[link] name='Header 1 List element 1 List element 2 List element 3' -++++++[heading] name='Header 1' -++++++++[static] name='Header 1' -++++++[list] -++++++++[list item] -++++++++++[static] name='%E2%80%A2 ' -++++++++++[static] name='List element 1' -++++++++[list item] -++++++++++[static] name='%E2%80%A2 ' -++++++++++[static] name='List element 2' -++++++++[list item] -++++++++++[static] name='%E2%80%A2 ' -++++++++++[static] name='List element 3' \ No newline at end of file +++[link] name='Header 1 List element 1 List element 2 List element 3' +++++[heading] name='Header 1' +++++++[static] name='Header 1' +++++[list] +++++++[list item] +++++++++[static] name='%E2%80%A2 ' +++++++++[static] name='List element 1' +++++++[list item] +++++++++[static] name='%E2%80%A2 ' +++++++++[static] name='List element 2' +++++++[list item] +++++++++[static] name='%E2%80%A2 ' +++++++++[static] name='List element 3' \ No newline at end of file
diff --git a/content/test/data/accessibility/html/a-nested-structure-expected-blink.txt b/content/test/data/accessibility/html/a-nested-structure-expected-blink.txt index 579028a..163ea5e 100644 --- a/content/test/data/accessibility/html/a-nested-structure-expected-blink.txt +++ b/content/test/data/accessibility/html/a-nested-structure-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea ++genericContainer ignored -++++genericContainer +++++genericContainer ignored ++++++link name='Header 1 List element 1 List element 2 List element 3' ++++++++heading name='Header 1' hierarchicalLevel=1 ++++++++++staticText name='Header 1'
diff --git a/content/test/data/accessibility/html/continuations-expected-android-external.txt b/content/test/data/accessibility/html/continuations-expected-android-external.txt index 433091c..90be0588 100644 --- a/content/test/data/accessibility/html/continuations-expected-android-external.txt +++ b/content/test/data/accessibility/html/continuations-expected-android-external.txt
@@ -15,8 +15,7 @@ ++++++++TextView text:"After" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] ++View text:"Group 4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] ++++TextView text:"Before" viewIdResName:"before" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] -++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] -++++++TextView text:"After" viewIdResName:"after" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++TextView text:"After" viewIdResName:"after" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] ++View text:"Group 5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] ++++TextView text:"Italic only " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] ++++TextView text:"italic and bold" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"]
diff --git a/content/test/data/accessibility/html/continuations-expected-auralinux.txt b/content/test/data/accessibility/html/continuations-expected-auralinux.txt index 0e4e2cf3..23dcfc44 100644 --- a/content/test/data/accessibility/html/continuations-expected-auralinux.txt +++ b/content/test/data/accessibility/html/continuations-expected-auralinux.txt
@@ -21,9 +21,8 @@ ++[panel] name='Group 4' ++++[section] ++++++[static] name='Before' -++++[section] -++++++[paragraph] -++++++++[static] name='After' +++++[paragraph] +++++++[static] name='After' ++[panel] name='Group 5' ++++[static] name='Italic only ' ++++[static] name='italic and bold'
diff --git a/content/test/data/accessibility/html/continuations-expected-blink.txt b/content/test/data/accessibility/html/continuations-expected-blink.txt index af1441e..96dcbe8 100644 --- a/content/test/data/accessibility/html/continuations-expected-blink.txt +++ b/content/test/data/accessibility/html/continuations-expected-blink.txt
@@ -32,7 +32,7 @@ ++++++++genericContainer display='block' isLineBreakingObject=true ++++++++++staticText display='block' name='Before' ++++++++++++inlineTextBox display='block' name='Before' -++++++++genericContainer display='block' isLineBreakingObject=true +++++++++genericContainer ignored isLineBreakingObject=true ++++++++++paragraph display='block' isLineBreakingObject=true ++++++++++++staticText display='block' name='After' ++++++++++++++inlineTextBox display='block' name='After'
diff --git a/content/test/data/accessibility/html/continuations-parser-splits-markup-expected-blink.txt b/content/test/data/accessibility/html/continuations-parser-splits-markup-expected-blink.txt index 5f023da..6829cda 100644 --- a/content/test/data/accessibility/html/continuations-parser-splits-markup-expected-blink.txt +++ b/content/test/data/accessibility/html/continuations-parser-splits-markup-expected-blink.txt
@@ -1,7 +1,7 @@ rootWebArea isLineBreakingObject=true ++genericContainer ignored isLineBreakingObject=true ++++genericContainer ignored isLineBreakingObject=true -++++++genericContainer display='block' isLineBreakingObject=true +++++++genericContainer ignored isLineBreakingObject=true ++++++++genericContainer className='copied-element' display='inline' ++++++++++genericContainer className='before' display='block' isLineBreakingObject=true ++++++++++++staticText display='block' name='Before'
diff --git a/content/test/data/accessibility/html/custom-element-nested-slots-expected-auralinux.txt b/content/test/data/accessibility/html/custom-element-nested-slots-expected-auralinux.txt index 855e286f..f5af5c2 100644 --- a/content/test/data/accessibility/html/custom-element-nested-slots-expected-auralinux.txt +++ b/content/test/data/accessibility/html/custom-element-nested-slots-expected-auralinux.txt
@@ -1,4 +1,3 @@ [document web] tag:#document -++[section] tag:body -++++[paragraph] tag:p -++++++[static] name='Slot contents' \ No newline at end of file +++[paragraph] tag:p +++++[static] name='Slot contents'
diff --git a/content/test/data/accessibility/html/custom-element-nested-slots-expected-blink.txt b/content/test/data/accessibility/html/custom-element-nested-slots-expected-blink.txt index f094fb6..654c3422f 100644 --- a/content/test/data/accessibility/html/custom-element-nested-slots-expected-blink.txt +++ b/content/test/data/accessibility/html/custom-element-nested-slots-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea htmlTag='#document' ++genericContainer ignored htmlTag='html' -++++genericContainer htmlTag='body' +++++genericContainer ignored htmlTag='body' ++++++genericContainer ignored htmlTag='my-element' ++++++++genericContainer ignored className='div-inside-template' htmlTag='div' ++++++++++genericContainer ignored className='outer' htmlTag='slot'
diff --git a/content/test/data/accessibility/html/custom-element-remove-nodes-expected-blink.txt b/content/test/data/accessibility/html/custom-element-remove-nodes-expected-blink.txt index 4312912..80e69ed 100644 --- a/content/test/data/accessibility/html/custom-element-remove-nodes-expected-blink.txt +++ b/content/test/data/accessibility/html/custom-element-remove-nodes-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea htmlTag='#document' name='done' ++genericContainer ignored htmlTag='html' -++++genericContainer htmlTag='body' +++++genericContainer ignored htmlTag='body' ++++++genericContainer className='dt1' htmlTag='x-details' ++++++++genericContainer ignored htmlTag='slot' ++++++++++genericContainer description='Details' htmlTag='summary' descriptionFrom=summary
diff --git a/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-expected-blink.txt b/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-expected-blink.txt index 2251051..d22c1bf3 100644 --- a/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-expected-blink.txt +++ b/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea ++genericContainer ignored -++++genericContainer +++++genericContainer ignored ++++++group ++++++++docEndnotes ++++++++++docEndnote
diff --git a/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-slot-expected-blink.txt b/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-slot-expected-blink.txt index 9a776199..0e70391a 100644 --- a/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-slot-expected-blink.txt +++ b/content/test/data/accessibility/html/custom-element-with-aria-owns-inside-slot-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea ++genericContainer ignored -++++genericContainer +++++genericContainer ignored ++++++group ++++++++docEndnotes ++++++++++docEndnote
diff --git a/content/test/data/accessibility/html/figcaption-expected-android-external.txt b/content/test/data/accessibility/html/figcaption-expected-android-external.txt index d7fda8e..f5f1a87 100644 --- a/content/test/data/accessibility/html/figcaption-expected-android-external.txt +++ b/content/test/data/accessibility/html/figcaption-expected-android-external.txt
@@ -1,4 +1,4 @@ WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] -++View text:"Fig.1 - A green Box" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="figure", hasImage="true", roleDescription="graphic"] +++View actions:[AX_FOCUS] bundle:[chromeRole="figure", hasImage="true", roleDescription="graphic"] ++++Image text:"This is a green box." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/greenbox.png"] ++++View text:"Fig.1 - A green Box" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="figcaption"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/figcaption-expected-android.txt b/content/test/data/accessibility/html/figcaption-expected-android.txt index aa1bf45..d0bd255f 100644 --- a/content/test/data/accessibility/html/figcaption-expected-android.txt +++ b/content/test/data/accessibility/html/figcaption-expected-android.txt
@@ -1,4 +1,4 @@ android.webkit.WebView focusable focused scrollable -++android.view.View role_description='graphic' name='Fig.1 - A green Box' +++android.view.View role_description='graphic' ++++android.widget.Image role_description='graphic' name='This is a green box.' ++++android.view.View name='Fig.1 - A green Box' \ No newline at end of file
diff --git a/content/test/data/accessibility/html/figcaption-expected-auralinux.txt b/content/test/data/accessibility/html/figcaption-expected-auralinux.txt index baf4146c..04268c5c 100644 --- a/content/test/data/accessibility/html/figcaption-expected-auralinux.txt +++ b/content/test/data/accessibility/html/figcaption-expected-auralinux.txt
@@ -1,5 +1,5 @@ [document web] -++[panel] name='Fig.1 - A green Box' labelled-by +++[panel] details ++++[image] name='This is a green box.' -++++[caption] label-for +++++[caption] details-for ++++++[static] name='Fig.1 - A green Box'
diff --git a/content/test/data/accessibility/html/figcaption-expected-blink.txt b/content/test/data/accessibility/html/figcaption-expected-blink.txt index 5b0fc94..0b0efd7 100644 --- a/content/test/data/accessibility/html/figcaption-expected-blink.txt +++ b/content/test/data/accessibility/html/figcaption-expected-blink.txt
@@ -1,7 +1,7 @@ rootWebArea ++genericContainer ignored ++++genericContainer ignored -++++++figure name='Fig.1 - A green Box' +++++++figure detailsIds=figcaption ++++++++image name='This is a green box.' ++++++++figcaption ++++++++++staticText name='Fig.1 - A green Box'
diff --git a/content/test/data/accessibility/html/figcaption-expected-mac.txt b/content/test/data/accessibility/html/figcaption-expected-mac.txt index b9dbd24..cd791c8e 100644 --- a/content/test/data/accessibility/html/figcaption-expected-mac.txt +++ b/content/test/data/accessibility/html/figcaption-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea -++AXGroup AXTitle='Fig.1 - A green Box' +++AXGroup ++++AXImage AXDescription='This is a green box.' ++++AXGroup ++++++AXStaticText AXValue='Fig.1 - A green Box'
diff --git a/content/test/data/accessibility/html/figcaption-expected-uia-win.txt b/content/test/data/accessibility/html/figcaption-expected-uia-win.txt index b404448..4db01e2 100644 --- a/content/test/data/accessibility/html/figcaption-expected-uia-win.txt +++ b/content/test/data/accessibility/html/figcaption-expected-uia-win.txt
@@ -1,5 +1,5 @@ Document -++Group Name='Fig.1 - A green Box' +++Group ++++Image Name='This is a green box.' ++++Text IsControlElement=false ++++++Text Name='Fig.1 - A green Box'
diff --git a/content/test/data/accessibility/html/figcaption-expected-win.txt b/content/test/data/accessibility/html/figcaption-expected-win.txt index c88e99e43..d1c4dbfe 100644 --- a/content/test/data/accessibility/html/figcaption-expected-win.txt +++ b/content/test/data/accessibility/html/figcaption-expected-win.txt
@@ -1,5 +1,5 @@ ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE -++ROLE_SYSTEM_GROUPING name='Fig.1 - A green Box' +++ROLE_SYSTEM_GROUPING ++++ROLE_SYSTEM_GRAPHIC name='This is a green box.' READONLY ++++IA2_ROLE_CAPTION ++++++ROLE_SYSTEM_STATICTEXT name='Fig.1 - A green Box'
diff --git a/content/test/data/accessibility/html/figcaption-nested-expected-blink.txt b/content/test/data/accessibility/html/figcaption-nested-expected-blink.txt index 6f3be82..e9f1a61e 100644 --- a/content/test/data/accessibility/html/figcaption-nested-expected-blink.txt +++ b/content/test/data/accessibility/html/figcaption-nested-expected-blink.txt
@@ -1,17 +1,17 @@ rootWebArea ++genericContainer ignored ++++genericContainer ignored -++++++figure name='External Caption' +++++++figure detailsIds=figcaption ++++++++figcaption ++++++++++staticText name='External Caption' ++++++++++++inlineTextBox name='External Caption' -++++++++figure name='Internal caption' +++++++++figure detailsIds=figcaption ++++++++++image name='This is a green box.' ++++++++++figcaption ++++++++++++staticText name='Internal caption' ++++++++++++++inlineTextBox name='Internal caption' -++++++figure name='External Caption' -++++++++figure name='Internal caption' +++++++figure detailsIds=figcaption +++++++++figure detailsIds=figcaption ++++++++++image name='This is a green box.' ++++++++++figcaption ++++++++++++staticText name='Internal caption'
diff --git a/content/test/data/accessibility/html/figcaption.html b/content/test/data/accessibility/html/figcaption.html index 32d3e19..5de4ed8 100644 --- a/content/test/data/accessibility/html/figcaption.html +++ b/content/test/data/accessibility/html/figcaption.html
@@ -9,4 +9,4 @@ <figcaption>Fig.1 - A green Box</figcaption> </figure> </body> -</html> \ No newline at end of file +</html>
diff --git a/content/test/data/accessibility/html/figure-expected-auralinux.txt b/content/test/data/accessibility/html/figure-expected-auralinux.txt index 0e68e22..000c4f3 100644 --- a/content/test/data/accessibility/html/figure-expected-auralinux.txt +++ b/content/test/data/accessibility/html/figure-expected-auralinux.txt
@@ -1,3 +1,3 @@ [document web] ++[panel] -++++[image] name='Sunspots' \ No newline at end of file +++++[image] name='Sunspots'
diff --git a/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt b/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt index 8e046a3..5a3cb51 100644 --- a/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt +++ b/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt
@@ -1,11 +1,10 @@ WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] -++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] -++++Image text:"pipe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] -++++++TextView text:"Headings are allowed in a map" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] -++++++View text:"null" contentDescription:"pipe1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/fake.htm"] -++++++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] -++++++++TextView text:"So are " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++++++View text:"other elements" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="mark", roleDescription="highlight"] -++++++++TextView text:"!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++++TextView text:"pipe2" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText", clickableScore="200"] -++++++Button text:"Even a button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file +++Image text:"pipe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] +++++TextView text:"Headings are allowed in a map" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++++View text:"null" contentDescription:"pipe1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/fake.htm"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++++TextView text:"So are " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View text:"other elements" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="mark", roleDescription="highlight"] +++++++TextView text:"!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"pipe2" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText", clickableScore="200"] +++++Button text:"Even a button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/map-any-contents-expected-auralinux.txt b/content/test/data/accessibility/html/map-any-contents-expected-auralinux.txt index 59d1f39d..a5de671 100644 --- a/content/test/data/accessibility/html/map-any-contents-expected-auralinux.txt +++ b/content/test/data/accessibility/html/map-any-contents-expected-auralinux.txt
@@ -1,13 +1,12 @@ [document web] -++[section] -++++[image map] name='pipe' -++++++[heading] name='Headings are allowed in a map' -++++++++[static] name='Headings are allowed in a map' -++++++[link] name='pipe1' -++++++[paragraph] -++++++++[static] name='So are ' -++++++++[static] -++++++++++[static] name='other elements' -++++++++[static] name='!' -++++++[static] name='pipe2' -++++++[push button] name='Even a button' \ No newline at end of file +++[image map] name='pipe' +++++[heading] name='Headings are allowed in a map' +++++++[static] name='Headings are allowed in a map' +++++[link] name='pipe1' +++++[paragraph] +++++++[static] name='So are ' +++++++[static] +++++++++[static] name='other elements' +++++++[static] name='!' +++++[static] name='pipe2' +++++[push button] name='Even a button' \ No newline at end of file
diff --git a/content/test/data/accessibility/html/map-any-contents-expected-blink.txt b/content/test/data/accessibility/html/map-any-contents-expected-blink.txt index f88a81d..b4d6e31 100644 --- a/content/test/data/accessibility/html/map-any-contents-expected-blink.txt +++ b/content/test/data/accessibility/html/map-any-contents-expected-blink.txt
@@ -1,6 +1,6 @@ rootWebArea ++genericContainer ignored -++++genericContainer +++++genericContainer ignored ++++++image name='pipe' ++++++++heading name='Headings are allowed in a map' ++++++++++staticText name='Headings are allowed in a map'
diff --git a/docs/updater/design_doc.md b/docs/updater/design_doc.md new file mode 100644 index 0000000..93b4e40f --- /dev/null +++ b/docs/updater/design_doc.md
@@ -0,0 +1,10 @@ +# Chromium Updater Design Document + +This is the design document for [Chromium Updater](https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/). + +[TOC] + +## Objective +The objective is to create an updater for desktop client software using Chromium +code and tools. +
diff --git a/docs/updater/functional_spec.md b/docs/updater/functional_spec.md new file mode 100644 index 0000000..0e75a3a --- /dev/null +++ b/docs/updater/functional_spec.md
@@ -0,0 +1,8 @@ +# Chromium Updater Functional Specification + +This is the functional specification for [Chromium Updater](https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/). + + +[TOC] + +##
diff --git a/docs/updater/user_manual.md b/docs/updater/user_manual.md new file mode 100644 index 0000000..5f06126 --- /dev/null +++ b/docs/updater/user_manual.md
@@ -0,0 +1,7 @@ +# Chromium Updater User Manual + +This is the user manual for [Chromium Updater](https://source.chromium.org/chromium/chromium/src/+/main:chrome/updater/). + +[TOC] + +##
diff --git a/fuchsia/engine/BUILD.gn b/fuchsia/engine/BUILD.gn index 91b853c..18fd3b0 100644 --- a/fuchsia/engine/BUILD.gn +++ b/fuchsia/engine/BUILD.gn
@@ -176,6 +176,14 @@ "//ppapi/proxy/*", "//ppapi/shared_impl/*", "//ppapi/thunk/*", + + # Although `enable_printing` is true for Fuchsia, no code should be linked. + # "//printing:metafile" is used by //third_party/blink/renderer/core and + # uses "//printing/common/*". + # "//printing/mojom/*" is allowed because Blink public APIs use its types. + "//printing:printing", + "//printing:printing_base", + "//printing/backend/*", ] # Technically the PAK files are only data dependencies, but specifying them
diff --git a/headless/test/headless_web_contents_browsertest.cc b/headless/test/headless_web_contents_browsertest.cc index e5f1663..aadcfe87 100644 --- a/headless/test/headless_web_contents_browsertest.cc +++ b/headless/test/headless_web_contents_browsertest.cc
@@ -575,7 +575,6 @@ "lang": "en", "type": "Document", "~children": [ { - "alt": "Figure 1: The caption", "type": "Figure", "~children": [ { "alt": "Sample SVG image",
diff --git "a/infra/config/generated/builders/ci/Android WebView P FYI \050rel\051/properties.json" "b/infra/config/generated/builders/ci/Android WebView P FYI \050rel\051/properties.json" deleted file mode 100644 index b6e2921..0000000 --- "a/infra/config/generated/builders/ci/Android WebView P FYI \050rel\051/properties.json" +++ /dev/null
@@ -1,16 +0,0 @@ -{ - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "jobs": 250, - "metrics_project": "chromium-reclient-metrics" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.android.fyi", - "recipe": "chromium" -} \ No newline at end of file
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index 4583d9c..6767066 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -1782,85 +1782,6 @@ } } builders { - name: "Android WebView P FYI (rel)" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.ci" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/ci/Android WebView P FYI (rel)/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.android.fyi",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium"' - '}' - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://[^/]*blink_web_tests/.+" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "Android arm Builder (dbg)" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1"
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index ac8918a..2538cbfb 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -3674,11 +3674,6 @@ refs: "regexp:refs/heads/main" manifest_name: "REVISION" builders { - name: "buildbucket/luci.chromium.ci/Android WebView P FYI (rel)" - category: "webview" - short_name: "p-rel" - } - builders { name: "buildbucket/luci.chromium.ci/Android ASAN (dbg) (reclient)" category: "builder|arm" short_name: "san"
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index 9b0cf6007..b4b3caf 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -296,16 +296,6 @@ } } job { - id: "Android WebView P FYI (rel)" - realm: "ci" - acl_sets: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "Android WebView P FYI (rel)" - } -} -job { id: "Android arm Builder (dbg)" realm: "ci" acl_sets: "ci" @@ -7176,7 +7166,6 @@ triggers: "Android ASAN (dbg)" triggers: "Android ASAN (dbg) (reclient)" triggers: "Android Release (Nexus 5X)" - triggers: "Android WebView P FYI (rel)" triggers: "Android arm Builder (dbg)" triggers: "Android arm64 Builder (dbg)" triggers: "Android x64 Builder (dbg)"
diff --git a/infra/config/subprojects/chromium/ci/chromium.android.fyi.star b/infra/config/subprojects/chromium/ci/chromium.android.fyi.star index 6862ff9..891eb52 100644 --- a/infra/config/subprojects/chromium/ci/chromium.android.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.android.fyi.star
@@ -117,17 +117,6 @@ ) ci.builder( - name = "Android WebView P FYI (rel)", - console_view_entry = consoles.console_view_entry( - category = "webview", - short_name = "p-rel", - ), - goma_backend = None, - reclient_jobs = rbe_jobs.DEFAULT, - reclient_instance = rbe_instance.DEFAULT, -) - -ci.builder( name = "android-nougat-x86-rel", builder_spec = builder_config.builder_spec( gclient_config = builder_config.gclient_config(
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm index 32686876..4d0bb1c 100644 --- a/ios/chrome/browser/passwords/password_controller_unittest.mm +++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -42,7 +42,7 @@ #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h" #include "ios/chrome/browser/web/chrome_web_client.h" -#import "ios/chrome/browser/web/chrome_web_test.h" +#include "ios/web/public/deprecated/url_verification_constants.h" #include "ios/web/public/js_messaging/web_frame.h" #include "ios/web/public/js_messaging/web_frame_util.h" #import "ios/web/public/js_messaging/web_frames_manager.h" @@ -50,6 +50,10 @@ #import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/scoped_testing_web_client.h" +#import "ios/web/public/test/task_observer_util.h" +#import "ios/web/public/test/web_state_test_util.h" +#import "ios/web/public/test/web_task_environment.h" #include "services/network/test/test_network_context.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -233,15 +237,19 @@ @end -class PasswordControllerTest : public ChromeWebTest { +class PasswordControllerTest : public PlatformTest { public: - PasswordControllerTest() - : ChromeWebTest(std::make_unique<ChromeWebClient>()) {} + PasswordControllerTest() : web_client_(std::make_unique<ChromeWebClient>()) { + browser_state_ = TestChromeBrowserState::Builder().Build(); + + web::WebState::CreateParams params(browser_state_.get()); + web_state_ = web::WebState::Create(params); + } ~PasswordControllerTest() override { store_->ShutdownOnUIThread(); } void SetUp() override { - ChromeWebTest::SetUp(); + PlatformTest::SetUp(); store_ = new testing::NiceMock<password_manager::MockPasswordStoreInterface>(); @@ -300,8 +308,9 @@ // Wait for |SetUpForUniqueIDsWithInitialState| to complete. return WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^bool { - return [ExecuteJavaScript(@"document[__gCrWeb.fill.ID_SYMBOL]") - intValue] == int{next_available_id}; + return [web::test::ExecuteJavaScript(@"document[__gCrWeb.fill.ID_SYMBOL]", + web_state()) intValue] == + int{next_available_id}; }); } @@ -361,8 +370,9 @@ NSString* kFormNamingScript = @"__gCrWeb.form.getFormIdentifier(" " document.querySelectorAll('form')[%d]);"; - return base::SysNSStringToUTF8(ExecuteJavaScript( - [NSString stringWithFormat:kFormNamingScript, form_number])); + return base::SysNSStringToUTF8(web::test::ExecuteJavaScript( + [NSString stringWithFormat:kFormNamingScript, form_number], + web_state())); } void SimulateUserTyping(const std::string& form_name, @@ -433,23 +443,32 @@ } void LoadHtml(NSString* html) { - ChromeWebTest::LoadHtml(html); + web::test::LoadHtml(html, web_state()); ASSERT_TRUE(SetUpUniqueIDs()); } void LoadHtml(NSString* html, const GURL& url) { - ChromeWebTest::LoadHtml(html, url); + web::test::LoadHtml(html, url, web_state()); ASSERT_TRUE(SetUpUniqueIDs()); } [[nodiscard]] bool LoadHtml(const std::string& html) { - bool result = ChromeWebTest::LoadHtml(html); - if (result) { - result = SetUpUniqueIDs(); - } - return result; + web::test::LoadHtml(base::SysUTF8ToNSString(html), web_state()); + return SetUpUniqueIDs(); } + std::string BaseUrl() const { + web::URLVerificationTrustLevel unused_level; + return web_state()->GetCurrentURL(&unused_level).spec(); + } + + web::WebState* web_state() const { return web_state_.get(); } + + web::ScopedTestingWebClient web_client_; + web::WebTaskEnvironment task_environment_; + std::unique_ptr<TestChromeBrowserState> browser_state_; + std::unique_ptr<web::WebState> web_state_; + // SuggestionController for testing. PasswordsTestSuggestionController* suggestionController_; @@ -833,7 +852,7 @@ // clang-format on for (const FillPasswordFormTestData& data : test_data) { - ExecuteJavaScript(kClearInputFieldsScript); + web::test::ExecuteJavaScript(kClearInputFieldsScript, web_state()); PasswordFormFillData form_data; SetPasswordFormFillData(data.origin, data.name, data.form_unique_ID, @@ -854,7 +873,8 @@ return block_was_called; })); - id result = ExecuteJavaScript(kInputFieldValueVerificationScript); + id result = web::test::ExecuteJavaScript(kInputFieldValueVerificationScript, + web_state()); EXPECT_NSEQ(data.expected_result, result); } } @@ -1006,9 +1026,10 @@ WaitForFormManagersCreation(); const std::string base_url = BaseUrl(); - ExecuteJavaScript( + web::test::ExecuteJavaScript( [NSString stringWithFormat:kUsernameAndPasswordTestPreparationScript, - @"un", @"pw"]); + @"un", @"pw"], + web_state()); // Initialize |form_data| with test data and an indicator that autofill // should not be performed while the user is entering the username so that @@ -1032,7 +1053,8 @@ // Verify that the form has not been autofilled. EXPECT_NSEQ(@"[]=, onkeyup=false, onchange=false", - ExecuteJavaScript(kUsernamePasswordVerificationScript)); + web::test::ExecuteJavaScript(kUsernamePasswordVerificationScript, + web_state())); // clang-format off SuggestionTestData test_data[] = { @@ -1091,16 +1113,17 @@ << "for description=" << data.description << " and eval_scripts=" << data.eval_scripts); // Prepare the test. - ExecuteJavaScript( + web::test::ExecuteJavaScript( [NSString stringWithFormat:kUsernameAndPasswordTestPreparationScript, - @"un", @"pw"]); + @"un", @"pw"], + web_state()); for (NSString* script in data.eval_scripts) { // Trigger events. - ExecuteJavaScript(script); + web::test::ExecuteJavaScript(script, web_state()); // Pump the run loop so that the host can respond. - WaitForBackgroundTasks(); + web::test::WaitForBackgroundTasks(); } // Wait until suggestions are received. EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^{ @@ -1109,7 +1132,8 @@ EXPECT_NSEQ(data.expected_suggestions, GetSuggestionValues()); EXPECT_NSEQ(data.expected_result, - ExecuteJavaScript(kUsernamePasswordVerificationScript)); + web::test::ExecuteJavaScript( + kUsernamePasswordVerificationScript, web_state())); // Clear all suggestions. [suggestionController_ setSuggestions:nil]; } @@ -1172,13 +1196,15 @@ NSString* password_element = SysUTF8ToNSString(test_data.password_element); // Prepare username and passwords for checking. - ExecuteJavaScript( + web::test::ExecuteJavaScript( [NSString stringWithFormat:kUsernameAndPasswordTestPreparationScript, - username_element, password_element]); + username_element, password_element], + web_state()); // Verify that the form has not been autofilled. EXPECT_NSEQ(@"[]=, onkeyup=false, onchange=false", - ExecuteJavaScript(kUsernamePasswordVerificationScript)); + web::test::ExecuteJavaScript( + kUsernamePasswordVerificationScript, web_state())); std::string mainFrameID = web::GetMainWebFrameId(web_state()); // Emulate that the user clicks on the username field in the first form. @@ -1224,7 +1250,8 @@ SuggestionHandledCompletion completion = ^{ block_was_called = YES; EXPECT_NSEQ(@"abc[]=def, onkeyup=true, onchange=true", - ExecuteJavaScript(kUsernamePasswordVerificationScript)); + web::test::ExecuteJavaScript( + kUsernamePasswordVerificationScript, web_state())); }; [passwordController_.sharedPasswordController didSelectSuggestion:suggestion @@ -1335,7 +1362,7 @@ // not sent to the store then the request the the store is sent. TEST_F(PasswordControllerTest, SendingToStoreDynamicallyAddedFormsOnFocus) { LoadHtml(kHtmlWithoutPasswordForm); - ExecuteJavaScript(kAddFormDynamicallyScript); + web::test::ExecuteJavaScript(kAddFormDynamicallyScript, web_state()); // The standard pattern is to use a __block variable WaitUntilCondition but // __block variable can't be captured in C++ lambda, so as workaround it's @@ -1360,7 +1387,7 @@ // Sets a focus on a username field. NSString* kSetUsernameInFocusScript = @"document.getElementById('username').focus();"; - ExecuteJavaScript(kSetUsernameInFocusScript); + web::test::ExecuteJavaScript(kSetUsernameInFocusScript, web_state()); // Wait until GetLogins is called. EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool() { @@ -1398,11 +1425,12 @@ EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr) .WillOnce(WithArg<0>(SaveToScopedPtr(&form_manager_to_save))); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementsByName('username')[0].value = 'user1';" "document.getElementsByName('password')[0].value = 'password1';" "var e = new UIEvent('touchend');" - "document.getElementById('submit_button').dispatchEvent(e);"); + "document.getElementById('submit_button').dispatchEvent(e);", + web_state()); LoadHtmlWithRendererInitiatedNavigation( SysUTF8ToNSString("<html><body>Success</body></html>")); @@ -1436,16 +1464,18 @@ .WillOnce(WithArg<0>(SaveToScopedPtr(&form_manager_to_save))); LoadHtml(@"<iframe id='frame1' name='frame1'></iframe>"); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementById('frame1').contentDocument.body.innerHTML = " "'<form id=\"form1\">" "<input type=\"text\" name=\"text\" value=\"user1\" id=\"id2\">" "<input type=\"password\" name=\"password\" value=\"pw1\" id=\"id2\">" "<input type=\"submit\" id=\"submit_input\"/>" - "</form>'"); - ExecuteJavaScript( + "</form>'", + web_state()); + web::test::ExecuteJavaScript( @"document.getElementById('frame1').contentDocument.getElementById('" - @"submit_input').click();"); + @"submit_input').click();", + web_state()); LoadHtmlWithRendererInitiatedNavigation( SysUTF8ToNSString("<html><body>Success</body></html>")); @@ -1480,8 +1510,8 @@ WithArg<1>(InvokeEmptyConsumerWithForms(store_.get()))); } // Do not call |LoadHtml| which will prematurely configure form ids. - ChromeWebTest::LoadHtml(kHtmlWithoutPasswordForm); - ExecuteJavaScript(kAddFormDynamicallyScript); + web::test::LoadHtml(kHtmlWithoutPasswordForm, web_state()); + web::test::ExecuteJavaScript(kAddFormDynamicallyScript, web_state()); SimulateFormActivityObserverSignal("form_changed", FormRendererId(), FieldRendererId(), std::string()); @@ -1534,7 +1564,7 @@ .WillOnce(WithArg<1>(InvokeConsumer(store_.get(), form))); LoadHtml(kHtmlWithoutPasswordForm); - ExecuteJavaScript(kAddFormDynamicallyScript); + web::test::ExecuteJavaScript(kAddFormDynamicallyScript, web_state()); SimulateFormActivityObserverSignal("form_changed", FormRendererId(), FieldRendererId(), std::string()); @@ -1617,9 +1647,10 @@ WaitForFormManagersCreation(); const std::string base_url = BaseUrl(); - ExecuteJavaScript( + web::test::ExecuteJavaScript( [NSString stringWithFormat:kUsernameAndPasswordTestPreparationScript, - @"un", @"pw"]); + @"un", @"pw"], + web_state()); // Initialize |form_data| with test data and an indicator that autofill // should not be performed while the user is entering the username so that @@ -1643,7 +1674,8 @@ // Verify that the form has not been autofilled. EXPECT_NSEQ(@"[]=, onkeyup=false, onchange=false", - ExecuteJavaScript(kUsernamePasswordVerificationScript)); + web::test::ExecuteJavaScript(kUsernamePasswordVerificationScript, + web_state())); // clang-format off SuggestionTestData test_data[] = { @@ -1671,16 +1703,17 @@ << "for description=" << data.description << " and eval_scripts=" << data.eval_scripts); // Prepare the test. - ExecuteJavaScript( + web::test::ExecuteJavaScript( [NSString stringWithFormat:kUsernameAndPasswordTestPreparationScript, - @"un", @"pw"]); + @"un", @"pw"], + web_state()); for (NSString* script in data.eval_scripts) { // Trigger events. - ExecuteJavaScript(script); + web::test::ExecuteJavaScript(script, web_state()); // Pump the run loop so that the host can respond. - WaitForBackgroundTasks(); + web::test::WaitForBackgroundTasks(); } // Wait until suggestions are received. EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^{ @@ -1689,7 +1722,8 @@ EXPECT_NSEQ(data.expected_suggestions, GetSuggestionValues()); EXPECT_NSEQ(data.expected_result, - ExecuteJavaScript(kUsernamePasswordVerificationScript)); + web::test::ExecuteJavaScript( + kUsernamePasswordVerificationScript, web_state())); // Clear all suggestions. [suggestionController_ setSuggestions:nil]; } @@ -1716,10 +1750,11 @@ std::unique_ptr<PasswordFormManagerForUI> form_manager_to_save; EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr) .WillOnce(WithArg<0>(SaveToScopedPtr(&form_manager_to_save))); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementsByName('username')[0].value = 'user1';" "document.getElementsByName('password')[0].value = 'password1';" - "document.getElementById('submit_button').click();"); + "document.getElementById('submit_button').click();", + web_state()); LoadHtmlWithRendererInitiatedNavigation( SysUTF8ToNSString("<html><body>Success</body></html>")); auto& form_manager_check = form_manager_to_save; @@ -1756,9 +1791,10 @@ WaitForFormManagersCreation(); EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr).Times(0); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementsByName('username')[0].value = 'user1';" - "document.getElementsByName('password')[0].value = 'password1';"); + "document.getElementsByName('password')[0].value = 'password1';", + web_state()); LoadHtmlWithRendererInitiatedNavigation( SysUTF8ToNSString("<html><body>New page</body></html>")); } @@ -1782,10 +1818,11 @@ WaitForFormManagersCreation(); EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr).Times(0); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementsByName('username')[0].value = 'user1';" "document.getElementsByName('password')[0].value = 'password1';" - "document.getElementById('submit_button').click();"); + "document.getElementById('submit_button').click();", + web_state()); LoadHtmlWithRendererInitiatedNavigation( SysUTF8ToNSString("<html><body>Success</body></html>")); } @@ -1811,10 +1848,11 @@ std::unique_ptr<PasswordFormManagerForUI> form_manager_to_save; EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr) .WillOnce(WithArg<0>(SaveToScopedPtr(&form_manager_to_save))); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementsByName('Username')[0].value = 'googleuser';" "document.getElementsByName('Passwd')[0].value = 'new_password';" - "document.getElementById('submit_button').click();"); + "document.getElementById('submit_button').click();", + web_state()); LoadHtmlWithRendererInitiatedNavigation( SysUTF8ToNSString("<html><body>Success</body></html>"), GURL("http://www.google.com/a/Login")); @@ -1946,7 +1984,7 @@ // that a form manager is created for it. TEST_F(PasswordControllerTest, FindDynamicallyAddedForm2) { LoadHtml(kHtmlWithoutPasswordForm); - ExecuteJavaScript(kAddFormDynamicallyScript); + web::test::ExecuteJavaScript(kAddFormDynamicallyScript, web_state()); SimulateFormActivityObserverSignal("form_changed", FormRendererId(), FieldRendererId(), std::string()); @@ -2098,8 +2136,10 @@ EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr) .WillOnce(WithArg<0>(SaveToScopedPtr(&form_manager_to_save))); - ExecuteJavaScript(@"var frame1 = document.getElementById('frame1');" - "frame1.parentNode.removeChild(frame1);"); + web::test::ExecuteJavaScript( + @"var frame1 = document.getElementById('frame1');" + "frame1.parentNode.removeChild(frame1);", + web_state()); auto& form_manager_check = form_manager_to_save; ASSERT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool() { return form_manager_check != nullptr; @@ -2151,8 +2191,10 @@ EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr).Times(0); - ExecuteJavaScript(@"var frame1 = document.getElementById('frame1');" - "frame1.parentNode.removeChild(frame1);"); + web::test::ExecuteJavaScript( + @"var frame1 = document.getElementById('frame1');" + "frame1.parentNode.removeChild(frame1);", + web_state()); ASSERT_TRUE(WaitUntilConditionOrTimeout(kWaitForJSCompletionTimeout, ^bool() { auto frames = web_state()->GetWebFramesManager()->GetAllWebFrames(); return frames.size() == 1; @@ -2178,10 +2220,11 @@ .WillOnce(WithArg<0>(SaveToScopedPtr(&form_manager_to_save))); std::string main_frame_id = web::GetMainWebFrameId(web_state()); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"document.getElementsByName('username')[0].value = 'user';" "document.getElementsByName('password')[0].value = 'pw';" - "document.getElementById('submit_button').click();"); + "document.getElementById('submit_button').click();", + web_state()); LoadHtmlWithRendererInitiatedNavigation( @"<html><body>Success</body></html>"); @@ -2226,9 +2269,10 @@ return block_was_called; })); - ExecuteJavaScript( + web::test::ExecuteJavaScript( @"var e = new UIEvent('touchend');" - "document.getElementById('submit_button').dispatchEvent(e);"); + "document.getElementById('submit_button').dispatchEvent(e);", + web_state()); LoadHtmlWithRendererInitiatedNavigation(@"<html><body>Success</body></html>"); password_manager::PasswordManagerJavaScriptFeature* password_feature =
diff --git a/ios/chrome/browser/ui/badges/BUILD.gn b/ios/chrome/browser/ui/badges/BUILD.gn index 44fbc679..d84e8a60 100644 --- a/ios/chrome/browser/ui/badges/BUILD.gn +++ b/ios/chrome/browser/ui/badges/BUILD.gn
@@ -18,13 +18,19 @@ source_set("util") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ + "badge_overflow_menu_util.h", + "badge_overflow_menu_util.mm", "badge_type_util.h", "badge_type_util.mm", ] deps = [ ":public", "//base", + "//components/password_manager/core/common", + "//components/strings", + "//ios/chrome/app/strings", "//ios/chrome/browser/infobars:public", + "//ui/base", ] }
diff --git a/ios/chrome/browser/ui/badges/badge_button.mm b/ios/chrome/browser/ui/badges/badge_button.mm index 260d86f8..b93f34d 100644 --- a/ios/chrome/browser/ui/badges/badge_button.mm +++ b/ios/chrome/browser/ui/badges/badge_button.mm
@@ -84,38 +84,38 @@ - (NSString*)accessibilityIdentifierForAcceptedState:(BOOL)accepted { switch (self.badgeType) { - case BadgeType::kBadgeTypeNone: + case kBadgeTypeNone: NOTREACHED() << "A badge should not have kBadgeTypeNone"; return nil; - case BadgeType::kBadgeTypePasswordSave: + case kBadgeTypePasswordSave: return accepted ? kBadgeButtonSavePasswordAcceptedAccessibilityIdentifier : kBadgeButtonSavePasswordAccessibilityIdentifier; - case BadgeType::kBadgeTypePasswordUpdate: + case kBadgeTypePasswordUpdate: return accepted ? kBadgeButtonUpdatePasswordAccpetedAccessibilityIdentifier : kBadgeButtonUpdatePasswordAccessibilityIdentifier; - case BadgeType::kBadgeTypeIncognito: + case kBadgeTypeIncognito: return kBadgeButtonIncognitoAccessibilityIdentifier; - case BadgeType::kBadgeTypeOverflow: + case kBadgeTypeOverflow: return kBadgeButtonOverflowAccessibilityIdentifier; - case BadgeType::kBadgeTypeSaveCard: + case kBadgeTypeSaveCard: return accepted ? kBadgeButtonSaveCardAcceptedAccessibilityIdentifier : kBadgeButtonSaveCardAccessibilityIdentifier; - case BadgeType::kBadgeTypeSaveAddressProfile: + case kBadgeTypeSaveAddressProfile: return accepted ? kBadgeButtonSaveAddressProfileAcceptedAccessibilityIdentifier : kBadgeButtonSaveAddressProfileAccessibilityIdentifier; - case BadgeType::kBadgeTypeTranslate: + case kBadgeTypeTranslate: return accepted ? kBadgeButtonTranslateAcceptedAccessibilityIdentifier : kBadgeButtonTranslateAccessibilityIdentifier; - case BadgeType::kBadgeTypeAddToReadingList: + case kBadgeTypeAddToReadingList: return accepted ? kBadgeButtonReadingListAcceptedAccessibilityIdentifier : kBadgeButtonReadingListAccessibilityIdentifier; - case BadgeType::kBadgeTypePermissionsCamera: + case kBadgeTypePermissionsCamera: return accepted ? kBadgeButtonPermissionsCameraAccessibilityIdentifier : kBadgeButtonPermissionsCameraAcceptedAccessibilityIdentifier; - case BadgeType::kBadgeTypePermissionsMicrophone: + case kBadgeTypePermissionsMicrophone: return accepted ? kBadgeButtonPermissionsMicrophoneAccessibilityIdentifier : kBadgeButtonPermissionsMicrophoneAcceptedAccessibilityIdentifier;
diff --git a/ios/chrome/browser/ui/badges/badge_button_factory.mm b/ios/chrome/browser/ui/badges/badge_button_factory.mm index b80492f..2152156c 100644 --- a/ios/chrome/browser/ui/badges/badge_button_factory.mm +++ b/ios/chrome/browser/ui/badges/badge_button_factory.mm
@@ -11,6 +11,8 @@ #import "ios/chrome/browser/ui/badges/badge_button.h" #import "ios/chrome/browser/ui/badges/badge_constants.h" #import "ios/chrome/browser/ui/badges/badge_delegate.h" +#import "ios/chrome/browser/ui/badges/badge_overflow_menu_util.h" +#import "ios/chrome/browser/ui/ui_feature_flags.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" #include "ios/chrome/grit/ios_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -20,6 +22,10 @@ #endif namespace { +// The identifier for the new popup menu action trigger. +NSString* const kOverflowPopupMenuActionIdentifier = + @"kOverflowPopupMenuActionIdentifier"; +// The size of the symbol image in the badge button. const CGFloat kSymbolImagePointSize = 18; } // namespace @@ -67,7 +73,7 @@ - (BadgeButton*)passwordsSaveBadgeButton { BadgeButton* button = [self - createButtonForType:BadgeType::kBadgeTypePasswordSave + createButtonForType:kBadgeTypePasswordSave image:[[UIImage imageNamed:[self passwordKeyAssetName]] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -83,7 +89,7 @@ - (BadgeButton*)passwordsUpdateBadgeButton { BadgeButton* button = [self - createButtonForType:BadgeType::kBadgeTypePasswordUpdate + createButtonForType:kBadgeTypePasswordUpdate image:[[UIImage imageNamed:[self passwordKeyAssetName]] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -99,7 +105,7 @@ - (BadgeButton*)saveCardBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypeSaveCard + [self createButtonForType:kBadgeTypeSaveCard image:[[UIImage imageNamed:@"infobar_save_card_icon"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -114,7 +120,7 @@ - (BadgeButton*)translateBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypeTranslate + [self createButtonForType:kBadgeTypeTranslate image:[[UIImage imageNamed:@"infobar_translate_icon"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -129,7 +135,7 @@ - (BadgeButton*)incognitoBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypeIncognito + [self createButtonForType:kBadgeTypeIncognito image:[[UIImage imageNamed:@"incognito_badge"] imageWithRenderingMode: UIImageRenderingModeAlwaysOriginal]]; @@ -146,7 +152,7 @@ - (BadgeButton*)overflowBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypeOverflow + [self createButtonForType:kBadgeTypeOverflow image:[[UIImage imageNamed:@"wrench_badge"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -156,12 +162,43 @@ button.accessibilityIdentifier = kBadgeButtonOverflowAccessibilityIdentifier; button.accessibilityLabel = l10n_util::GetNSString(IDS_IOS_OVERFLOW_BADGE_HINT); + + // Configure new overflow popup menu if enabled. + if (ShouldUseUIKitPopupMenu()) { + button.showsMenuAsPrimaryAction = YES; + + // Adds an empty menu so the event triggers the first time. + button.menu = [UIMenu menuWithChildren:@[]]; + [button removeActionForIdentifier:kOverflowPopupMenuActionIdentifier + forControlEvents:UIControlEventMenuActionTriggered]; + + // Configure actions that should be executed on each tap of the overflow + // badge button to make sure the right overflow menu items are showing up. + __weak UIButton* weakButton = button; + __weak BadgeButtonFactory* weakSelf = self; + void (^showModalFunction)(BadgeType) = ^(BadgeType badgeType) { + [weakSelf.delegate showModalForBadgeType:badgeType]; + }; + void (^buttonTapHandler)(UIAction*) = ^(UIAction* action) { + weakButton.menu = GetOverflowMenuFromBadgeTypes( + weakSelf.delegate.badgeTypesForOverflowMenu, showModalFunction); + }; + UIAction* action = + [UIAction actionWithTitle:@"" + image:nil + identifier:kOverflowPopupMenuActionIdentifier + handler:buttonTapHandler]; + + // Attach the action to the button. + [button addAction:action + forControlEvents:UIControlEventMenuActionTriggered]; + } return button; } - (BadgeButton*)saveAddressProfileBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypeSaveAddressProfile + [self createButtonForType:kBadgeTypeSaveAddressProfile image:[[UIImage imageNamed:@"ic_place"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -176,7 +213,7 @@ - (BadgeButton*)readingListBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypeAddToReadingList + [self createButtonForType:kBadgeTypeAddToReadingList image:[[UIImage imageNamed:@"infobar_reading_list"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -191,7 +228,7 @@ - (BadgeButton*)permissionsCameraBadgeButton { BadgeButton* button = [self - createButtonForType:BadgeType::kBadgeTypePermissionsCamera + createButtonForType:kBadgeTypePermissionsCamera image:[[UIImage imageNamed:@"infobar_permissions_camera"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]]; @@ -207,7 +244,7 @@ - (BadgeButton*)permissionsMicrophoneBadgeButton { BadgeButton* button = - [self createButtonForType:BadgeType::kBadgeTypePermissionsMicrophone + [self createButtonForType:kBadgeTypePermissionsMicrophone image:[[UIImage systemImageNamed:@"mic.fill"] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate]];
diff --git a/ios/chrome/browser/ui/badges/badge_constants.h b/ios/chrome/browser/ui/badges/badge_constants.h index a2a9d5926..e7b53a2 100644 --- a/ios/chrome/browser/ui/badges/badge_constants.h +++ b/ios/chrome/browser/ui/badges/badge_constants.h
@@ -7,7 +7,7 @@ #import <Foundation/Foundation.h> -// A11y identifiers so that automation can tap on BadgeButtons +// A11y identifiers so that automation can tap on BadgeButtons. extern NSString* const kBadgeButtonSavePasswordAccessibilityIdentifier; extern NSString* const kBadgeButtonSavePasswordAcceptedAccessibilityIdentifier; extern NSString* const kBadgeButtonUpdatePasswordAccessibilityIdentifier; @@ -37,4 +37,13 @@ // A11y identifier for the unread indicator above the displayed badge. extern NSString* const kBadgeUnreadIndicatorAccessibilityIdentifier; +// Action identifiers for the new overflow menu. +extern NSString* const kBadgeButtonSavePasswordActionIdentifier; +extern NSString* const kBadgeButtonUpdatePasswordActionIdentifier; +extern NSString* const kBadgeButtonReadingListActionIdentifier; +extern NSString* const kBadgeButtonSaveAddressProfileActionIdentifier; +extern NSString* const kBadgeButtonSaveCardActionIdentifier; +extern NSString* const kBadgeButtonTranslateActionIdentifier; +extern NSString* const kBadgeButtonPermissionsActionIdentifier; + #endif // IOS_CHROME_BROWSER_UI_BADGES_BADGE_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/badges/badge_constants.mm b/ios/chrome/browser/ui/badges/badge_constants.mm index 0920892..50108ff3 100644 --- a/ios/chrome/browser/ui/badges/badge_constants.mm +++ b/ios/chrome/browser/ui/badges/badge_constants.mm
@@ -68,3 +68,24 @@ NSString* const kBadgeUnreadIndicatorAccessibilityIdentifier = @"badgeUnreadIndicatorAXID"; + +NSString* const kBadgeButtonSavePasswordActionIdentifier = + @"badgeButtonSavePasswordActionIdentifier"; + +NSString* const kBadgeButtonUpdatePasswordActionIdentifier = + @"badgeButtonUpdatePasswordActionIdentifier"; + +NSString* const kBadgeButtonReadingListActionIdentifier = + @"badgeButtonReadingListActionIdentifier"; + +NSString* const kBadgeButtonSaveAddressProfileActionIdentifier = + @"badgeButtonSaveAddressProfileActionIdentifier"; + +NSString* const kBadgeButtonSaveCardActionIdentifier = + @"badgeButtonSaveCardActionIdentifier"; + +NSString* const kBadgeButtonTranslateActionIdentifier = + @"badgeButtonTranslateActionIdentifier"; + +NSString* const kBadgeButtonPermissionsActionIdentifier = + @"badgeButtonPermissionsActionIdentifier";
diff --git a/ios/chrome/browser/ui/badges/badge_delegate.h b/ios/chrome/browser/ui/badges/badge_delegate.h index b979dc27..cfe7d1f6 100644 --- a/ios/chrome/browser/ui/badges/badge_delegate.h +++ b/ios/chrome/browser/ui/badges/badge_delegate.h
@@ -5,8 +5,15 @@ #ifndef IOS_CHROME_BROWSER_UI_BADGES_BADGE_DELEGATE_H_ #define IOS_CHROME_BROWSER_UI_BADGES_BADGE_DELEGATE_H_ +#include "ios/chrome/browser/ui/badges/badge_type.h" + // Protocol to communicate Badge actions to the mediator. @protocol BadgeDelegate + +// Badge types for menu items that should be displayed in the overflow menu. +@property(nonatomic, strong, readonly) + NSArray<NSNumber*>* badgeTypesForOverflowMenu; + // Action when a Reading List badge is tapped. - (void)addToReadingListBadgeButtonTapped:(id)sender; @@ -27,6 +34,11 @@ // Action when the overflow badge is tapped. - (void)overflowBadgeButtonTapped:(id)sender; + +// Show the infobar modal for the respective |badgeType| when the new overflow +// menu is tapped. +- (void)showModalForBadgeType:(BadgeType)badgeType; + @end #endif // IOS_CHROME_BROWSER_UI_BADGES_BADGE_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/badges/badge_mediator.mm b/ios/chrome/browser/ui/badges/badge_mediator.mm index db7b257..a039a757 100644 --- a/ios/chrome/browser/ui/badges/badge_mediator.mm +++ b/ios/chrome/browser/ui/badges/badge_mediator.mm
@@ -31,6 +31,7 @@ #import "ios/chrome/browser/ui/commands/browser_coordinator_commands.h" #import "ios/chrome/browser/ui/commands/infobar_commands.h" #import "ios/chrome/browser/ui/list_model/list_model.h" +#import "ios/chrome/browser/ui/ui_feature_flags.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h" #import "ios/web/public/permissions/permissions.h" @@ -92,8 +93,8 @@ DCHECK(browser); // Create the incognito badge if |browser| is off-the-record. if (browser->GetBrowserState()->IsOffTheRecord()) { - _offTheRecordBadge = [[BadgeStaticItem alloc] - initWithBadgeType:BadgeType::kBadgeTypeIncognito]; + _offTheRecordBadge = + [[BadgeStaticItem alloc] initWithBadgeType:kBadgeTypeIncognito]; } // Set up the OverlayPresenterObserver for the infobar banner presentation. _overlayPresenterObserver = @@ -214,8 +215,8 @@ self.webState->GetStatesForAllPermissions(); return permissionStates[@(web::PermissionMicrophone)].unsignedIntValue > permissionStates[@(web::PermissionCamera)].unsignedIntValue - ? BadgeType::kBadgeTypePermissionsMicrophone - : BadgeType::kBadgeTypePermissionsCamera; + ? kBadgeTypePermissionsMicrophone + : kBadgeTypePermissionsCamera; } #pragma mark - Accessor helpers @@ -229,8 +230,8 @@ BOOL shouldDisplayOverflowBadge = badges.count > 1; id<BadgeItem> displayedBadge = nil; if (shouldDisplayOverflowBadge) { - displayedBadge = [[BadgeTappableItem alloc] - initWithBadgeType:BadgeType::kBadgeTypeOverflow]; + displayedBadge = + [[BadgeTappableItem alloc] initWithBadgeType:kBadgeTypeOverflow]; } else { displayedBadge = [badges firstObject]; } @@ -241,38 +242,46 @@ #pragma mark - BadgeDelegate +- (NSArray<NSNumber*>*)badgeTypesForOverflowMenu { + NSMutableArray<NSNumber*>* badgeTypes = [NSMutableArray array]; + for (id<BadgeItem> badgeItem in self.badges) { + [badgeTypes addObject:@(badgeItem.badgeType)]; + } + return badgeTypes; +} + - (void)addToReadingListBadgeButtonTapped:(id)sender { BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender); - DCHECK_EQ(badgeButton.badgeType, BadgeType::kBadgeTypeAddToReadingList); + DCHECK_EQ(badgeButton.badgeType, kBadgeTypeAddToReadingList); [self handleTappedBadgeButton:badgeButton]; } - (void)passwordsBadgeButtonTapped:(id)sender { BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender); - DCHECK(badgeButton.badgeType == BadgeType::kBadgeTypePasswordSave || - badgeButton.badgeType == BadgeType::kBadgeTypePasswordUpdate); + DCHECK(badgeButton.badgeType == kBadgeTypePasswordSave || + badgeButton.badgeType == kBadgeTypePasswordUpdate); [self handleTappedBadgeButton:badgeButton]; } - (void)saveAddressProfileBadgeButtonTapped:(id)sender { BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender); - DCHECK_EQ(badgeButton.badgeType, BadgeType::kBadgeTypeSaveAddressProfile); + DCHECK_EQ(badgeButton.badgeType, kBadgeTypeSaveAddressProfile); [self handleTappedBadgeButton:badgeButton]; } - (void)saveCardBadgeButtonTapped:(id)sender { BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender); - DCHECK_EQ(badgeButton.badgeType, BadgeType::kBadgeTypeSaveCard); + DCHECK_EQ(badgeButton.badgeType, kBadgeTypeSaveCard); [self handleTappedBadgeButton:badgeButton]; } - (void)translateBadgeButtonTapped:(id)sender { BadgeButton* badgeButton = base::mac::ObjCCastStrict<BadgeButton>(sender); - DCHECK_EQ(badgeButton.badgeType, BadgeType::kBadgeTypeTranslate); + DCHECK_EQ(badgeButton.badgeType, kBadgeTypeTranslate); [self handleTappedBadgeButton:badgeButton]; } @@ -286,29 +295,34 @@ } - (void)overflowBadgeButtonTapped:(id)sender { - NSMutableArray<id<BadgeItem>>* popupMenuBadges = - [[NSMutableArray alloc] init]; - // Get all non-fullscreen badges. - for (id<BadgeItem> item in self.badges) { - if (!item.fullScreen) { - // Mark each badge as read since the overflow menu is about to be - // displayed. - [self onBadgeItemRead:item]; - [popupMenuBadges addObject:item]; - } - } // Log overflow badge tap. base::RecordAction( base::UserMetricsAction(kInfobarOverflowBadgeTappedUserAction)); - [self.dispatcher displayPopupMenuWithBadgeItems:popupMenuBadges]; + if (!ShouldUseUIKitPopupMenu()) { + NSMutableArray<id<BadgeItem>>* popupMenuBadges = + [[NSMutableArray alloc] init]; + // Get all non-fullscreen badges. + for (id<BadgeItem> item in self.badges) { + if (!item.fullScreen) { + // Mark each badge as read since the overflow menu is about to be + // displayed. + [self onBadgeItemRead:item]; + [popupMenuBadges addObject:item]; + } + } + [self.dispatcher displayPopupMenuWithBadgeItems:popupMenuBadges]; + } [self updateConsumerReadStatus]; - // TODO(crbug.com/976901): Add metric for this action. +} + +- (void)showModalForBadgeType:(BadgeType)badgeType { + [self addModalRequestForInfobarType:InfobarTypeForBadgeType(badgeType)]; } #pragma mark - InfobarBadgeTabHelperDelegate - (BOOL)badgeSupportedForInfobarType:(InfobarType)infobarType { - return BadgeTypeForInfobarType(infobarType) != BadgeType::kBadgeTypeNone; + return BadgeTypeForInfobarType(infobarType) != kBadgeTypeNone; } - (void)updateBadgesShownForWebState:(web::WebState*)webState { @@ -342,10 +356,10 @@ if (count > 1) { // If a badge's banner is being presented, then show that badge as the // displayed badge. Otherwise, show the overflow badge. - displayedBadge = presentingBadge - ? presentingBadge - : [[BadgeTappableItem alloc] - initWithBadgeType:BadgeType::kBadgeTypeOverflow]; + displayedBadge = + presentingBadge + ? presentingBadge + : [[BadgeTappableItem alloc] initWithBadgeType:kBadgeTypeOverflow]; } else if (count == 1) { // Since there is only one non-fullscreen badge, it will be fixed as the // displayed badge, so mark it as read. @@ -353,7 +367,7 @@ [self.dispatcher dismissBadgePopupMenu]; } - if (displayedBadge.badgeType == BadgeType::kBadgeTypeOverflow) { + if (displayedBadge.badgeType == kBadgeTypeOverflow) { // Log that the overflow badge is being shown. base::RecordAction( base::UserMetricsAction(kInfobarOverflowBadgeShownUserAction)); @@ -450,23 +464,28 @@ // Shows the modal UI when |button| is tapped. - (void)handleTappedBadgeButton:(BadgeButton*)button { InfobarType infobarType = InfobarTypeForBadgeType(button.badgeType); - DCHECK(self.webState); - InfoBarIOS* infobar = [self infobarWithType:infobarType]; - if (infobar) { - InfobarOverlayRequestInserter::CreateForWebState(self.webState); - InsertParams params(infobar); - params.overlay_type = InfobarOverlayType::kModal; - params.insertion_index = - OverlayRequestQueue::FromWebState(self.webState, - OverlayModality::kInfobarModal) - ->size(); - params.source = InfobarOverlayInsertionSource::kBadge; - InfobarOverlayRequestInserter::FromWebState(self.webState) - ->InsertOverlayRequest(params); - } + [self addModalRequestForInfobarType:infobarType]; [self recordMetricsForBadgeButton:button infobarType:infobarType]; } +// Adds a modal request for the Infobar of |infobarType|. +- (void)addModalRequestForInfobarType:(InfobarType)infobarType { + DCHECK(self.webState); + InfoBarIOS* infobar = [self infobarWithType:infobarType]; + DCHECK(infobar); + if (infobar) { + InfobarOverlayRequestInserter::CreateForWebState(self.webState); + InsertParams params(infobar); + params.overlay_type = InfobarOverlayType::kModal; + params.insertion_index = OverlayRequestQueue::FromWebState( + self.webState, OverlayModality::kInfobarModal) + ->size(); + params.source = InfobarOverlayInsertionSource::kBadge; + InfobarOverlayRequestInserter::FromWebState(self.webState) + ->InsertOverlayRequest(params); + } +} + // Returns the infobar in the active WebState's InfoBarManager with |type|. - (InfoBarIOS*)infobarWithType:(InfobarType)type { InfoBarManagerImpl* manager = InfoBarManagerImpl::FromWebState(self.webState);
diff --git a/ios/chrome/browser/ui/badges/badge_overflow_menu_util.h b/ios/chrome/browser/ui/badges/badge_overflow_menu_util.h new file mode 100644 index 0000000..7d1a35e --- /dev/null +++ b/ios/chrome/browser/ui/badges/badge_overflow_menu_util.h
@@ -0,0 +1,18 @@ +// 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 IOS_CHROME_BROWSER_UI_BADGES_BADGE_OVERFLOW_MENU_UTIL_H_ +#define IOS_CHROME_BROWSER_UI_BADGES_BADGE_OVERFLOW_MENU_UTIL_H_ + +#import "ios/chrome/browser/ui/badges/badge_type.h" + +typedef void (^ShowModalFunction)(BadgeType); +@class UIMenu; + +// Returns new popup menu that will be displayed when users tap the overflow +// badge button. +UIMenu* GetOverflowMenuFromBadgeTypes(NSArray<NSNumber*>* badge_types, + ShowModalFunction show_modal_function); + +#endif // IOS_CHROME_BROWSER_UI_BADGES_BADGE_OVERFLOW_MENU_UTIL_H_
diff --git a/ios/chrome/browser/ui/badges/badge_overflow_menu_util.mm b/ios/chrome/browser/ui/badges/badge_overflow_menu_util.mm new file mode 100644 index 0000000..33d7c63d --- /dev/null +++ b/ios/chrome/browser/ui/badges/badge_overflow_menu_util.mm
@@ -0,0 +1,132 @@ +// 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 "ios/chrome/browser/ui/badges/badge_overflow_menu_util.h" + +#include "base/metrics/histogram_functions.h" +#import "base/notreached.h" +#include "components/password_manager/core/common/password_manager_features.h" +#include "components/strings/grit/components_strings.h" +#import "ios/chrome/browser/ui/badges/badge_constants.h" +#import "ios/chrome/browser/ui/badges/badges_histograms.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ui/base/l10n/l10n_util.h" + +#import <UIKit/UIKit.h> + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +// The menu element for |badgeType| shown in the overflow menu when the overflow +// badge is tapped. +UIAction* GetOverflowMenuElementForBadgeType( + BadgeType badge_type, + ShowModalFunction show_modal_function) { + NSString* title; + UIActionIdentifier action_identifier; + UIImage* image; + MobileMessagesInfobarType histogram_type = MobileMessagesInfobarType::Confirm; + + NSString* passwordImageName = + base::FeatureList::IsEnabled( + password_manager::features::kIOSEnablePasswordManagerBrandingUpdate) + ? @"password_key" + : @"legacy_password_key"; + switch (badge_type) { + case kBadgeTypePasswordSave: + action_identifier = kBadgeButtonSavePasswordActionIdentifier; + title = + l10n_util::GetNSString(IDS_IOS_PASSWORD_MANAGER_SAVE_PASSWORD_TITLE); + image = [[UIImage imageNamed:passwordImageName] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::SavePassword; + break; + case kBadgeTypePasswordUpdate: + action_identifier = kBadgeButtonUpdatePasswordActionIdentifier; + title = l10n_util::GetNSString( + IDS_IOS_PASSWORD_MANAGER_UPDATE_PASSWORD_TITLE); + image = [[UIImage imageNamed:passwordImageName] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::UpdatePassword; + break; + case kBadgeTypeSaveAddressProfile: + action_identifier = kBadgeButtonSaveAddressProfileActionIdentifier; + title = + l10n_util::GetNSString(IDS_IOS_AUTOFILL_SAVE_ADDRESS_PROMPT_TITLE); + image = [[UIImage imageNamed:@"ic_place"] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::AutofillSaveAddressProfile; + break; + case kBadgeTypeSaveCard: + action_identifier = kBadgeButtonSaveCardActionIdentifier; + title = l10n_util::GetNSString(IDS_IOS_AUTOFILL_SAVE_CARD); + image = [[UIImage imageNamed:@"infobar_save_card_icon"] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::SaveCard; + break; + case kBadgeTypeTranslate: + action_identifier = kBadgeButtonTranslateActionIdentifier; + title = l10n_util::GetNSString(IDS_IOS_TRANSLATE_INFOBAR_MODAL_TITLE); + image = [[UIImage imageNamed:@"infobar_translate_icon"] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + break; + case kBadgeTypeAddToReadingList: + action_identifier = kBadgeButtonReadingListActionIdentifier; + title = l10n_util::GetNSString(IDS_IOS_READING_LIST_MESSAGES_MODAL_TITLE); + image = [[UIImage imageNamed:@"infobar_reading_list"] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::Translate; + break; + case kBadgeTypePermissionsCamera: + action_identifier = kBadgeButtonPermissionsActionIdentifier; + title = l10n_util::GetNSString( + IDS_IOS_PERMISSIONS_INFOBAR_OVERFLOW_POPUP_TITLE); + image = [[UIImage imageNamed:@"infobar_permissions_camera"] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::Permissions; + break; + case kBadgeTypePermissionsMicrophone: + action_identifier = kBadgeButtonPermissionsActionIdentifier; + title = l10n_util::GetNSString( + IDS_IOS_PERMISSIONS_INFOBAR_OVERFLOW_POPUP_TITLE); + image = [[UIImage systemImageNamed:@"mic.fill"] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + histogram_type = MobileMessagesInfobarType::Permissions; + break; + case kBadgeTypeIncognito: + NOTREACHED() << "An overflow menu badge should not be an Incognito badge"; + break; + case kBadgeTypeOverflow: + NOTREACHED() << "A overflow menu badge should not be an overflow badge"; + break; + case kBadgeTypeNone: + NOTREACHED() << "A badge should not have kBadgeTypeNone"; + break; + } + + UIActionHandler handler = ^(UIAction* action) { + base::UmaHistogramEnumeration(kInfobarOverflowMenuTappedHistogram, + histogram_type); + show_modal_function(badge_type); + }; + + return [UIAction actionWithTitle:title + image:image + identifier:action_identifier + handler:handler]; +} +} // namespace + +UIMenu* GetOverflowMenuFromBadgeTypes(NSArray<NSNumber*>* badge_types, + ShowModalFunction show_modal_function) { + NSMutableArray<UIMenuElement*>* menu_elements = [NSMutableArray array]; + for (NSNumber* badge_type_wrapped in badge_types) { + BadgeType badgeType = BadgeType(badge_type_wrapped.unsignedIntegerValue); + [menu_elements addObject:GetOverflowMenuElementForBadgeType( + badgeType, show_modal_function)]; + } + return [UIMenu menuWithTitle:@"" children:menu_elements]; +}
diff --git a/ios/chrome/browser/ui/badges/badge_popup_menu_coordinator.mm b/ios/chrome/browser/ui/badges/badge_popup_menu_coordinator.mm index 7c89e3c..d327f2c 100644 --- a/ios/chrome/browser/ui/badges/badge_popup_menu_coordinator.mm +++ b/ios/chrome/browser/ui/badges/badge_popup_menu_coordinator.mm
@@ -4,7 +4,7 @@ #import "ios/chrome/browser/ui/badges/badge_popup_menu_coordinator.h" -#include "base/metrics/histogram_macros.h" +#include "base/metrics/histogram_functions.h" #include "base/notreached.h" #include "ios/chrome/browser/infobars/infobar_ios.h" #include "ios/chrome/browser/infobars/infobar_manager_impl.h" @@ -101,21 +101,21 @@ [self dismissPopupMenu]; switch (item.actionIdentifier) { case PopupMenuActionShowSavePasswordOptions: { - UMA_HISTOGRAM_ENUMERATION(kInfobarOverflowMenuTappedHistogram, - MobileMessagesInfobarType::SavePassword); + base::UmaHistogramEnumeration(kInfobarOverflowMenuTappedHistogram, + MobileMessagesInfobarType::SavePassword); [self addModalRequestForInfobarType:InfobarType::kInfobarTypePasswordSave]; break; } case PopupMenuActionShowUpdatePasswordOptions: { - UMA_HISTOGRAM_ENUMERATION(kInfobarOverflowMenuTappedHistogram, - MobileMessagesInfobarType::UpdatePassword); + base::UmaHistogramEnumeration(kInfobarOverflowMenuTappedHistogram, + MobileMessagesInfobarType::UpdatePassword); [self addModalRequestForInfobarType:InfobarType:: kInfobarTypePasswordUpdate]; break; } case PopupMenuActionShowSaveAddressProfileOptions: { - UMA_HISTOGRAM_ENUMERATION( + base::UmaHistogramEnumeration( kInfobarOverflowMenuTappedHistogram, MobileMessagesInfobarType::AutofillSaveAddressProfile); [self addModalRequestForInfobarType: @@ -123,20 +123,20 @@ break; } case PopupMenuActionShowSaveCardOptions: { - UMA_HISTOGRAM_ENUMERATION(kInfobarOverflowMenuTappedHistogram, - MobileMessagesInfobarType::SaveCard); + base::UmaHistogramEnumeration(kInfobarOverflowMenuTappedHistogram, + MobileMessagesInfobarType::SaveCard); [self addModalRequestForInfobarType:InfobarType::kInfobarTypeSaveCard]; break; } case PopupMenuActionShowTranslateOptions: { - UMA_HISTOGRAM_ENUMERATION(kInfobarOverflowMenuTappedHistogram, - MobileMessagesInfobarType::Translate); + base::UmaHistogramEnumeration(kInfobarOverflowMenuTappedHistogram, + MobileMessagesInfobarType::Translate); [self addModalRequestForInfobarType:InfobarType::kInfobarTypeTranslate]; break; } case PopupMenuActionShowPermissionsOptions: { - UMA_HISTOGRAM_ENUMERATION(kInfobarOverflowMenuTappedHistogram, - MobileMessagesInfobarType::Permissions); + base::UmaHistogramEnumeration(kInfobarOverflowMenuTappedHistogram, + MobileMessagesInfobarType::Permissions); [self addModalRequestForInfobarType:InfobarType::kInfobarTypePermissions]; break; }
diff --git a/ios/chrome/browser/ui/badges/badge_popup_menu_item.mm b/ios/chrome/browser/ui/badges/badge_popup_menu_item.mm index 12ee552..2e2b41f 100644 --- a/ios/chrome/browser/ui/badges/badge_popup_menu_item.mm +++ b/ios/chrome/browser/ui/badges/badge_popup_menu_item.mm
@@ -114,44 +114,44 @@ ? @"password_key" : @"legacy_password_key"; switch (self.badgeType) { - case BadgeType::kBadgeTypePasswordSave: - case BadgeType::kBadgeTypePasswordUpdate: + case kBadgeTypePasswordSave: + case kBadgeTypePasswordUpdate: badgeImage = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypeSaveAddressProfile: + case kBadgeTypeSaveAddressProfile: badgeImage = [[UIImage imageNamed:@"ic_place"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypeSaveCard: + case kBadgeTypeSaveCard: badgeImage = [[UIImage imageNamed:@"infobar_save_card_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypeTranslate: + case kBadgeTypeTranslate: badgeImage = [[UIImage imageNamed:@"infobar_translate_icon"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypeAddToReadingList: + case kBadgeTypeAddToReadingList: badgeImage = [[UIImage imageNamed:@"infobar_reading_list"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypePermissionsCamera: + case kBadgeTypePermissionsCamera: badgeImage = [[UIImage imageNamed:@"infobar_permissions_camera"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypePermissionsMicrophone: + case kBadgeTypePermissionsMicrophone: badgeImage = [[UIImage systemImageNamed:@"mic.fill"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; break; - case BadgeType::kBadgeTypeIncognito: + case kBadgeTypeIncognito: NOTREACHED() << "A popup menu item should not be of type kBadgeTypeIncognito"; break; - case BadgeType::kBadgeTypeOverflow: + case kBadgeTypeOverflow: NOTREACHED() << "A popup menu item should not be of type kBadgeTypeOverflow"; break; - case BadgeType::kBadgeTypeNone: + case kBadgeTypeNone: NOTREACHED() << "A badge should not have kBadgeTypeNone"; } [cell setBadgeImage:badgeImage];
diff --git a/ios/chrome/browser/ui/follow/follow_block_types.h b/ios/chrome/browser/ui/follow/follow_block_types.h index 691a536..9af43c0 100644 --- a/ios/chrome/browser/ui/follow/follow_block_types.h +++ b/ios/chrome/browser/ui/follow/follow_block_types.h
@@ -11,8 +11,8 @@ // |success| is YES if the operation was successful. typedef void (^RequestCompletionBlock)(BOOL success); -// Block to call for unfollowing a web channel. +// Block to call for unfollowing or refollowing a web channel. // |completion| is called at completion of the request. -typedef void (^UnfollowRequestBlock)(RequestCompletionBlock completion); +typedef void (^FollowRequestBlock)(RequestCompletionBlock completion); #endif // IOS_CHROME_BROWSER_UI_FOLLOW_FOLLOW_BLOCK_TYPES_H_
diff --git a/ios/chrome/browser/ui/follow/followed_web_channel.h b/ios/chrome/browser/ui/follow/followed_web_channel.h index 5ed96b2..2d248d7 100644 --- a/ios/chrome/browser/ui/follow/followed_web_channel.h +++ b/ios/chrome/browser/ui/follow/followed_web_channel.h
@@ -24,7 +24,10 @@ @property(nonatomic, assign) BOOL unavailable; // Used to request to unfollow this web channel. -@property(nonatomic, copy) UnfollowRequestBlock unfollowRequestBlock; +@property(nonatomic, copy) FollowRequestBlock unfollowRequestBlock; + +// Used to request to refollow this web channel, if it has been unfollowed. +@property(nonatomic, copy) FollowRequestBlock refollowRequestBlock; @end
diff --git a/ios/chrome/browser/ui/infobars/test_infobar_badge_tab_helper_delegate.mm b/ios/chrome/browser/ui/infobars/test_infobar_badge_tab_helper_delegate.mm index d83e644..010423fc 100644 --- a/ios/chrome/browser/ui/infobars/test_infobar_badge_tab_helper_delegate.mm +++ b/ios/chrome/browser/ui/infobars/test_infobar_badge_tab_helper_delegate.mm
@@ -40,8 +40,8 @@ std::map<InfobarType, BadgeState> badgeStatesForInfobarType = self.badgeTabHelper->GetInfobarBadgeStates(); for (auto& infobarTypeBadgeStatePair : badgeStatesForInfobarType) { - BadgeTappableItem* item = [[BadgeTappableItem alloc] - initWithBadgeType:BadgeType::kBadgeTypePasswordSave]; + BadgeTappableItem* item = + [[BadgeTappableItem alloc] initWithBadgeType:kBadgeTypePasswordSave]; item.badgeState = infobarTypeBadgeStatePair.second; _badgeItems[infobarTypeBadgeStatePair.first] = item; }
diff --git a/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm b/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm index c2a6128..8b8811f 100644 --- a/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm +++ b/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm
@@ -34,6 +34,17 @@ } // namespace +@interface FollowManagementViewController () + +// Saved placement of the item that was last attempted to unfollow. +@property(nonatomic, strong) NSIndexPath* indexPathOfLastUnfollowAttempt; + +// Saved item that was attempted to unfollow. +@property(nonatomic, strong) + FollowedWebChannelItem* lastUnfollowedWebChannelItem; + +@end + @implementation FollowManagementViewController - (void)viewDidLoad { @@ -124,21 +135,44 @@ } - (void)requestUnfollowWebChannelAtIndexPath:(NSIndexPath*)indexPath { - FollowedWebChannelItem* item = + // TODO(crbug.com/1296745): Start favicon spinner. + + self.indexPathOfLastUnfollowAttempt = indexPath; + + FollowedWebChannelItem* followedWebChannelItem = base::mac::ObjCCastStrict<FollowedWebChannelItem>( [self.tableViewModel itemAtIndexPath:indexPath]); - // TODO(crbug.com/1296745): Start spinner. - __weak FollowManagementViewController* weakSelf = self; - item.followedWebChannel.unfollowRequestBlock(^(BOOL success) { + followedWebChannelItem.followedWebChannel.unfollowRequestBlock( + ^(BOOL success) { + // TODO(crbug.com/1296745): Stop favicon spinner. + if (success) { + // TODO(crbug.com/1296745): Show success snackbar + // with undo button. + weakSelf.lastUnfollowedWebChannelItem = followedWebChannelItem; + [weakSelf deleteItemAtIndexPath:indexPath]; + } else { + // TODO(crbug.com/1296745): Show failure snackbar + // with try again button. + } + }); +} + +- (void)retryUnfollow { + [self + requestUnfollowWebChannelAtIndexPath:self.indexPathOfLastUnfollowAttempt]; +} + +- (void)undoUnfollow { + // TODO(crbug.com/1296745): Start spinner over UNDO text in snackbar. + FollowedWebChannelItem* unfollowedItem = self.lastUnfollowedWebChannelItem; + unfollowedItem.followedWebChannel.refollowRequestBlock(^(BOOL success) { + // TODO(crbug.com/1296745): Stop spinner over UNDO text in snackbar. if (success) { - // TODO(crbug.com/1296745): Show success snackbar - // with undo button. - [weakSelf deleteItemAtIndexPath:indexPath]; + // TODO(crbug.com/1296745): Re-insert row. } else { - // TODO(crbug.com/1296745): Show failure snackbar - // with try again button. Stop spinner. + // TODO(crbug.com/1296745): Show undo failure snackbar. } }); }
diff --git a/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.h b/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.h index 87b7f92..6e90152 100644 --- a/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.h +++ b/ios/chrome/browser/ui/ntp/feed_management/followed_web_channel_item.h
@@ -13,7 +13,7 @@ @interface FollowedWebChannelItem : TableViewURLItem // Web channel associated with this table view item. -@property(nonatomic, strong) FollowedWebChannel* followedWebChannel; +@property(nonatomic, weak) FollowedWebChannel* followedWebChannel; @end @@ -21,7 +21,7 @@ @interface FollowedWebChannelCell : TableViewURLCell // Web channel associated with this cell. -@property(nonatomic, strong) FollowedWebChannel* followedWebChannel; +@property(nonatomic, weak) FollowedWebChannel* followedWebChannel; @end
diff --git a/ios/chrome/browser/ui/ntp/feed_metrics_recorder.h b/ios/chrome/browser/ui/ntp/feed_metrics_recorder.h index 158830a..5945bd6 100644 --- a/ios/chrome/browser/ui/ntp/feed_metrics_recorder.h +++ b/ios/chrome/browser/ui/ntp/feed_metrics_recorder.h
@@ -40,6 +40,10 @@ // header menu. - (void)recordHeaderMenuLearnMoreTapped; +// Record metrics for when the user selects the 'Manage' item in the feed header +// menu. +- (void)recordHeaderMenuManageTapped; + // Record metrics for when the user selects the 'Manage Activity' item in the // feed header menu. - (void)recordHeaderMenuManageActivityTapped;
diff --git a/ios/chrome/browser/ui/ntp/feed_metrics_recorder.mm b/ios/chrome/browser/ui/ntp/feed_metrics_recorder.mm index dba0945..96f20e3 100644 --- a/ios/chrome/browser/ui/ntp/feed_metrics_recorder.mm +++ b/ios/chrome/browser/ui/ntp/feed_metrics_recorder.mm
@@ -106,6 +106,8 @@ "ContentSuggestions.Feed.CardAction.TapPreview"; // User action names for feed header menu. +const char kDiscoverFeedUserActionManageTapped[] = + "ContentSuggestions.Feed.HeaderAction.Manage"; const char kDiscoverFeedUserActionManageActivityTapped[] = "ContentSuggestions.Feed.HeaderAction.ManageActivity"; const char kDiscoverFeedUserActionManageInterestsTapped[] = @@ -240,6 +242,13 @@ base::UserMetricsAction(kDiscoverFeedUserActionLearnMoreTapped)); } +- (void)recordHeaderMenuManageTapped { + [self + recordDiscoverFeedUserActionHistogram:FeedUserActionType::kTappedManage]; + base::RecordAction( + base::UserMetricsAction(kDiscoverFeedUserActionManageTapped)); +} + - (void)recordHeaderMenuManageActivityTapped { [self recordDiscoverFeedUserActionHistogram:FeedUserActionType:: kTappedManageActivity];
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm index 481b411..2bbad46 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_coordinator.mm
@@ -1096,6 +1096,7 @@ } - (void)handleFeedManageTapped { + [self.feedMetricsRecorder recordHeaderMenuManageTapped]; [self.feedManagementCoordinator stop]; self.feedManagementCoordinator = nil;
diff --git a/ios/chrome/browser/ui/omnibox/popup/BUILD.gn b/ios/chrome/browser/ui/omnibox/popup/BUILD.gn index 54d1607..82a5a40 100644 --- a/ios/chrome/browser/ui/omnibox/popup/BUILD.gn +++ b/ios/chrome/browser/ui/omnibox/popup/BUILD.gn
@@ -10,6 +10,7 @@ "omnibox_popup_view_provider.swift", "shared/fake_omnibox_icon.swift", "shared/omnibox_pedal.swift", + "shared/popup_empty_space_view.swift", "shared/popup_image.swift", "shared/popup_match.swift", "shared/popup_match_image_view.swift", @@ -19,6 +20,7 @@ "shared/popup_model.swift", "shared/popup_view.swift", "shared/pressed_preference_key_button_style.swift", + "shared/self_sizing_list.swift", ] deps = [ @@ -37,6 +39,8 @@ source_set("popup") { sources = [ + "omnibox_popup_container_view.h", + "omnibox_popup_container_view.mm", "omnibox_popup_coordinator.h", "omnibox_popup_coordinator.mm", "omnibox_popup_mediator.h",
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.h b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.h new file mode 100644 index 0000000..7f7a85a5 --- /dev/null +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.h
@@ -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. + +#ifndef IOS_CHROME_BROWSER_UI_OMNIBOX_POPUP_OMNIBOX_POPUP_CONTAINER_VIEW_H_ +#define IOS_CHROME_BROWSER_UI_OMNIBOX_POPUP_OMNIBOX_POPUP_CONTAINER_VIEW_H_ + +#include <UIKit/UIKit.h> + +// Container view for the popup view hierarchy. It overrides hit-testing so we +// can dismiss hits on the PopupEmptySpaceView. +@interface OmniboxPopupContainerView : UIView +@end + +#endif // IOS_CHROME_BROWSER_UI_OMNIBOX_POPUP_OMNIBOX_POPUP_CONTAINER_VIEW_H_
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.mm new file mode 100644 index 0000000..4f69143 --- /dev/null +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.mm
@@ -0,0 +1,27 @@ +// 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 "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.h" + +#import "ios/chrome/browser/ui/omnibox/popup/popup_swift.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation OmniboxPopupContainerView + +// Ignore user interaction with itself or PopupEmptySpaceView. +- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent*)event { + UIView* hitResult = [super hitTest:point withEvent:event]; + + if (hitResult == self) + return NULL; + if ([hitResult isKindOfClass:[PopupEmptySpaceView class]]) + return NULL; + + return hitResult; +} + +@end
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm index aa7b54d..20a33dc 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm
@@ -27,6 +27,7 @@ #include "ios/chrome/browser/ui/util/ui_util.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #include "services/network/public/cpp/shared_url_loader_factory.h" +#include "ui/base/device_form_factor.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -88,9 +89,12 @@ self.model = [[PopupModel alloc] initWithMatches:@[] headers:@[] delegate:self.mediator]; + BOOL popupShouldSelfSize = + (ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET); self.mediator.model = self.model; - self.popupViewController = - [OmniboxPopupViewProvider makeViewControllerWithModel:self.model]; + self.popupViewController = [OmniboxPopupViewProvider + makeViewControllerWithModel:self.model + popupShouldSelfSize:popupShouldSelfSize]; [self.browser->GetCommandDispatcher() startDispatchingToTarget:self.model forProtocol:@protocol(OmniboxSuggestionCommands)];
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.mm index cef4ea6e..7dbc176e 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.mm +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.mm
@@ -5,8 +5,10 @@ #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_presenter.h" #import "ios/chrome/browser/ui/omnibox/popup/content_providing.h" +#import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_container_view.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_configuration.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" +#include "ios/chrome/browser/ui/ui_feature_flags.h" #import "ios/chrome/browser/ui/util/named_guide.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" @@ -52,7 +54,7 @@ ToolbarConfiguration* configuration = [[ToolbarConfiguration alloc] initWithStyle:incognito ? INCOGNITO : NORMAL]; - UIView* containerView = [[UIView alloc] init]; + UIView* containerView = [[OmniboxPopupContainerView alloc] init]; [containerView addSubview:viewController.view]; _popupContainerView = containerView; @@ -65,7 +67,10 @@ _popupContainerView.overrideUserInterfaceStyle = userInterfaceStyle; viewController.overrideUserInterfaceStyle = userInterfaceStyle; - _popupContainerView.backgroundColor = [configuration backgroundColor]; + if (!base::FeatureList::IsEnabled(kIOSOmniboxUpdatedPopupUI)) { + _popupContainerView.backgroundColor = [configuration backgroundColor]; + } + _popupContainerView.translatesAutoresizingMaskIntoConstraints = NO; viewController.view.translatesAutoresizingMaskIntoConstraints = NO; AddSameConstraints(viewController.view, _popupContainerView); @@ -99,7 +104,8 @@ if (!popupHasContent && popupIsOnscreen) { // If intrinsic size is 0 and popup is onscreen, we want to remove the // popup view. - if (ui::GetDeviceFormFactor() != ui::DEVICE_FORM_FACTOR_TABLET) { + if (ui::GetDeviceFormFactor() != ui::DEVICE_FORM_FACTOR_TABLET || + base::FeatureList::IsEnabled(kIOSOmniboxUpdatedPopupUI)) { self.bottomConstraint.active = NO; self.bottomSeparator.hidden = YES; } @@ -121,7 +127,8 @@ [self initialLayout]; - if (ui::GetDeviceFormFactor() != ui::DEVICE_FORM_FACTOR_TABLET) { + if (ui::GetDeviceFormFactor() != ui::DEVICE_FORM_FACTOR_TABLET || + base::FeatureList::IsEnabled(kIOSOmniboxUpdatedPopupUI)) { self.bottomConstraint.active = YES; self.bottomSeparator.hidden = NO; }
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_provider.swift b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_provider.swift index 76c95e5d..48049a5 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_provider.swift +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_provider.swift
@@ -5,18 +5,31 @@ import SwiftUI import UIKit -// A provider to provide the SwiftUI PopupView to Objective-C. This is -// necessary because Objective-C can't see SwiftUI types. +/// A provider to provide the SwiftUI PopupView to Objective-C. This is +/// necessary because Objective-C can't see SwiftUI types. +/// +/// - Parameters: +/// - model: The popup model to be used by the popup view. +/// - popupShouldSelfSize: Whether the popup should resize itself to fit its content. +/// - Returns: The hosting controller which embeds the popup view. @objcMembers public class OmniboxPopupViewProvider: NSObject { - public static func makeViewController(withModel model: PopupModel) -> UIViewController - & ContentProviding + public static func makeViewController(withModel model: PopupModel, popupShouldSelfSize: Bool) + -> UIViewController & ContentProviding { - return OmniboxPopupHostingController(rootView: PopupView(model: model)) + return OmniboxPopupHostingController( + rootView: PopupView( + model: model, shouldSelfSize: popupShouldSelfSize, + appearanceContainerType: OmniboxPopupHostingController.self)) } } class OmniboxPopupHostingController: UIHostingController<PopupView>, ContentProviding { + override func viewDidLoad() { + view.backgroundColor = .clear + view.isOpaque = false + } + var hasContent: Bool { - return !rootView.model.sections.isEmpty + return rootView.model.sections.map(\.matches.count).reduce(0, +) > 0 } }
diff --git a/ios/chrome/browser/ui/omnibox/popup/shared/popup_empty_space_view.swift b/ios/chrome/browser/ui/omnibox/popup/shared/popup_empty_space_view.swift new file mode 100644 index 0000000..b5b38a2 --- /dev/null +++ b/ios/chrome/browser/ui/omnibox/popup/shared/popup_empty_space_view.swift
@@ -0,0 +1,16 @@ +// 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 SwiftUI + +/// An empty UIKit view wrapped in a SwiftUI view, +/// to identity the empty space below the omnibox popup during hit testing. +final class PopupEmptySpaceView: UIView, UIViewRepresentable { + func makeUIView(context: Context) -> PopupEmptySpaceView { + PopupEmptySpaceView() + } + + func updateUIView(_ uiView: PopupEmptySpaceView, context: Context) { + } +}
diff --git a/ios/chrome/browser/ui/omnibox/popup/shared/popup_view.swift b/ios/chrome/browser/ui/omnibox/popup/shared/popup_view.swift index e3db8d06..14e8b18 100644 --- a/ios/chrome/browser/ui/omnibox/popup/shared/popup_view.swift +++ b/ios/chrome/browser/ui/omnibox/popup/shared/popup_view.swift
@@ -7,60 +7,92 @@ struct PopupView: View { enum Dimensions { static let matchListRowInsets = EdgeInsets(.zero) + static let selfSizingListBottomMargin: CGFloat = 40 } @ObservedObject var model: PopupModel - var body: some View { - VStack { - List { - ForEach(Array(zip(model.sections.indices, model.sections)), id: \.0) { - sectionIndex, section in + private let shouldSelfSize: Bool + private let appearanceContainerType: UIAppearanceContainer.Type? - let sectionContents = - ForEach(Array(zip(section.matches.indices, section.matches)), id: \.0) { - matchIndex, match in - PopupMatchRowView( - match: match, - isHighlighted: IndexPath(row: matchIndex, section: sectionIndex) - == self.model.highlightedMatchIndexPath, + init( + model: PopupModel, shouldSelfSize: Bool = false, + appearanceContainerType: UIAppearanceContainer.Type? = nil + ) { + self.model = model + self.shouldSelfSize = shouldSelfSize + self.appearanceContainerType = appearanceContainerType + } - selectionHandler: { - model.delegate?.autocompleteResultConsumer( - model, didSelectRow: UInt(matchIndex), inSection: UInt(sectionIndex)) - }, - trailingButtonHandler: { - model.delegate?.autocompleteResultConsumer( - model, didTapTrailingButtonForRow: UInt(matchIndex), - inSection: UInt(sectionIndex)) - } + var content: some View { + ForEach(Array(zip(model.sections.indices, model.sections)), id: \.0) { + sectionIndex, section in - ) - .deleteDisabled(!match.supportsDeletion) - .listRowInsets(Dimensions.matchListRowInsets) - } - .onDelete { indexSet in - for matchIndex in indexSet { - model.delegate?.autocompleteResultConsumer( - model, didSelectRowForDeletion: UInt(matchIndex), inSection: UInt(sectionIndex)) - } - } + let sectionContents = + ForEach(Array(zip(section.matches.indices, section.matches)), id: \.0) { + matchIndex, match in + PopupMatchRowView( + match: match, + isHighlighted: IndexPath(row: matchIndex, section: sectionIndex) + == self.model.highlightedMatchIndexPath, - // Split the suggestions into sections, but only add a header text if the header isn't empty - if !section.header.isEmpty { - Section(header: Text(section.header)) { - sectionContents + selectionHandler: { + model.delegate?.autocompleteResultConsumer( + model, didSelectRow: UInt(matchIndex), inSection: UInt(sectionIndex)) + }, + trailingButtonHandler: { + model.delegate?.autocompleteResultConsumer( + model, didTapTrailingButtonForRow: UInt(matchIndex), + inSection: UInt(sectionIndex)) } - } else { - Section { - sectionContents - } + ) + .deleteDisabled(!match.supportsDeletion) + .listRowInsets(Dimensions.matchListRowInsets) + } + .onDelete { indexSet in + for matchIndex in indexSet { + model.delegate?.autocompleteResultConsumer( + model, didSelectRowForDeletion: UInt(matchIndex), inSection: UInt(sectionIndex)) } + } + // Split the suggestions into sections, but only add a header text if the header isn't empty + if !section.header.isEmpty { + Section(header: Text(section.header)) { + sectionContents + } + } else { + Section { + sectionContents } } } } + var body: some View { + if shouldSelfSize { + SelfSizingList(bottomMargin: Dimensions.selfSizingListBottomMargin) { + content + } emptySpace: { + PopupEmptySpaceView() + } + .onAppear(perform: onAppear) + } else { + List { + content + } + .onAppear(perform: onAppear) + } + } + + func onAppear() { + if let appearanceContainerType = self.appearanceContainerType { + let listAppearance = UITableView.appearance(whenContainedInInstancesOf: [ + appearanceContainerType + ]) + + listAppearance.bounces = false + } + } } struct PopupView_Previews: PreviewProvider {
diff --git a/ios/chrome/browser/ui/omnibox/popup/shared/self_sizing_list.swift b/ios/chrome/browser/ui/omnibox/popup/shared/self_sizing_list.swift new file mode 100644 index 0000000..8b01425 --- /dev/null +++ b/ios/chrome/browser/ui/omnibox/popup/shared/self_sizing_list.swift
@@ -0,0 +1,68 @@ +// 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 SwiftUI + +/// A preference key which is meant to compute the greatest `maxY` value of multiple elements. +struct MaxYPreferenceKey: PreferenceKey { + static var defaultValue: CGFloat? = nil + static func reduce(value: inout CGFloat?, nextValue: () -> CGFloat?) { + if let nextValue = nextValue() { + if let currentValue = value { + value = max(currentValue, nextValue) + } else { + value = nextValue + } + } + } +} + +/// View which acts like a `List` but which also clips whatever empty space +/// is available below the actual content to replace it with an arbitrary view. +struct SelfSizingList<Content: View, EmptySpace: View>: View { + let bottomMargin: CGFloat + var content: () -> Content + var emptySpace: () -> EmptySpace + + init( + bottomMargin: CGFloat = 0, + @ViewBuilder content: @escaping () -> Content, + @ViewBuilder emptySpace: @escaping () -> EmptySpace + ) { + self.bottomMargin = bottomMargin + self.content = content + self.emptySpace = emptySpace + } + + @State private var contentHeightEstimate: CGFloat? = nil + + var body: some View { + GeometryReader { geometry in + let availableHeight = geometry.size.height + + VStack(spacing: 0) { + VStack(spacing: 0) { + List { + content() + .anchorPreference(key: MaxYPreferenceKey.self, value: .bounds) { geometry[$0].maxY } + } + .onPreferenceChange(MaxYPreferenceKey.self) { newMaxY in + let newContentHeightEstimate = newMaxY.map { + min($0 + bottomMargin, geometry.size.height) + } + if self.contentHeightEstimate != newContentHeightEstimate { + self.contentHeightEstimate = newContentHeightEstimate + } + } + .frame(height: availableHeight, alignment: .top) + } + .frame(height: self.contentHeightEstimate, alignment: .top) + .clipped() + + // Empty space view to identify and explicitly ignore during hit testing. + emptySpace() + } + } + } +}
diff --git a/ios/chrome/browser/ui/omnibox/popup/swiftui_previews/omnibox_popup.xcodeproj/project.pbxproj b/ios/chrome/browser/ui/omnibox/popup/swiftui_previews/omnibox_popup.xcodeproj/project.pbxproj index 2c828cdd..af18c69 100644 --- a/ios/chrome/browser/ui/omnibox/popup/swiftui_previews/omnibox_popup.xcodeproj/project.pbxproj +++ b/ios/chrome/browser/ui/omnibox/popup/swiftui_previews/omnibox_popup.xcodeproj/project.pbxproj
@@ -16,7 +16,9 @@ 59C4A9C227BFF04F0080C045 /* popup_match.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59C4A9BD27BFF04F0080C045 /* popup_match.swift */; }; 59C4A9C327BFF04F0080C045 /* popup_model.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59C4A9BE27BFF04F0080C045 /* popup_model.swift */; }; 8701451C27D24A8800C2D66F /* pressed_preference_key_button_style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8701451B27D24A8800C2D66F /* pressed_preference_key_button_style.swift */; }; + 8749952427E22B8B005EF2ED /* self_sizing_list.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8749952327E22B8B005EF2ED /* self_sizing_list.swift */; }; 876011EB27D287A6004EB60B /* popup_match_trailing_button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876011EA27D287A6004EB60B /* popup_match_trailing_button.swift */; }; + 8781A7EC27DFF6950054D0B9 /* popup_empty_space_view.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8781A7EB27DFF6950054D0B9 /* popup_empty_space_view.swift */; }; 879F655B27CD142E005B650F /* ios_chrome_common_ui_colors_swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 879F655A27CD142E005B650F /* ios_chrome_common_ui_colors_swift.h */; settings = {ATTRIBUTES = (Public, ); }; }; 879F655E27CD142E005B650F /* ios_chrome_common_ui_colors_swift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 879F655827CD142E005B650F /* ios_chrome_common_ui_colors_swift.framework */; }; 879F655F27CD142E005B650F /* ios_chrome_common_ui_colors_swift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 879F655827CD142E005B650F /* ios_chrome_common_ui_colors_swift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -96,8 +98,10 @@ 59C4A9BD27BFF04F0080C045 /* popup_match.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = popup_match.swift; path = ../../shared/popup_match.swift; sourceTree = "<group>"; }; 59C4A9BE27BFF04F0080C045 /* popup_model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = popup_model.swift; path = ../../shared/popup_model.swift; sourceTree = "<group>"; }; 8701451B27D24A8800C2D66F /* pressed_preference_key_button_style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = pressed_preference_key_button_style.swift; path = ../../shared/pressed_preference_key_button_style.swift; sourceTree = "<group>"; }; - 876011EA27D287A6004EB60B /* popup_match_trailing_button.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = popup_match_trailing_button.swift; path = ../../shared/popup_match_trailing_button.swift; sourceTree = "<group>"; }; + 8749952327E22B8B005EF2ED /* self_sizing_list.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = self_sizing_list.swift; path = ../../shared/self_sizing_list.swift; sourceTree = "<group>"; }; 876011E927D26E28004EB60B /* omnibox_suggestion_commands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = omnibox_suggestion_commands.h; path = ../../../../commands/omnibox_suggestion_commands.h; sourceTree = "<group>"; }; + 876011EA27D287A6004EB60B /* popup_match_trailing_button.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = popup_match_trailing_button.swift; path = ../../shared/popup_match_trailing_button.swift; sourceTree = "<group>"; }; + 8781A7EB27DFF6950054D0B9 /* popup_empty_space_view.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = popup_empty_space_view.swift; path = ../../shared/popup_empty_space_view.swift; sourceTree = "<group>"; }; 879F655827CD142E005B650F /* ios_chrome_common_ui_colors_swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ios_chrome_common_ui_colors_swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 879F655A27CD142E005B650F /* ios_chrome_common_ui_colors_swift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ios_chrome_common_ui_colors_swift.h; sourceTree = "<group>"; }; 879F656627CD14E5005B650F /* Color+Chrome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Color+Chrome.swift"; path = "../../../../../../common/ui/colors/Color+Chrome.swift"; sourceTree = "<group>"; }; @@ -165,6 +169,7 @@ 593C4C1227C5638000FBE617 /* omnibox_icon.h */, 93BCA07027D2D4C300CE8602 /* fake_omnibox_icon.swift */, 59C4A9BA27BFF04F0080C045 /* omnibox_pedal.swift */, + 8781A7EB27DFF6950054D0B9 /* popup_empty_space_view.swift */, 9329C14427D2662F0032C244 /* popup_image.swift */, 9329C3D427D2BE500032C244 /* popup_match_image_view.swift */, 59C4A9BB27BFF04F0080C045 /* popup_match_row_view.swift */, @@ -174,6 +179,7 @@ 59C4A9BE27BFF04F0080C045 /* popup_model.swift */, 59C4A9BC27BFF04F0080C045 /* popup_view.swift */, 8701451B27D24A8800C2D66F /* pressed_preference_key_button_style.swift */, + 8749952327E22B8B005EF2ED /* self_sizing_list.swift */, 879F659A27CD299E005B650F /* README.md */, ); name = shared; @@ -425,12 +431,14 @@ buildActionMask = 2147483647; files = ( 876011EB27D287A6004EB60B /* popup_match_trailing_button.swift in Sources */, + 8749952427E22B8B005EF2ED /* self_sizing_list.swift in Sources */, 593C4C1327C5639000FBE617 /* autocomplete_result_consumer.h in Sources */, 593C4C1427C5639000FBE617 /* autocomplete_suggestion.h in Sources */, 593C4C1527C5639000FBE617 /* omnibox_icon.h in Sources */, 93B3BBBA27B1C3900034ADF1 /* view_controller.swift in Sources */, 93BCA07127D2D4C300CE8602 /* fake_omnibox_icon.swift in Sources */, 59C4A9C227BFF04F0080C045 /* popup_match.swift in Sources */, + 8781A7EC27DFF6950054D0B9 /* popup_empty_space_view.swift in Sources */, 9329C16027D26FE30032C244 /* crurl.swift in Sources */, 59C4A9C127BFF04F0080C045 /* popup_view.swift in Sources */, 93B3BBC827B1C8460034ADF1 /* popup_coordinator.swift in Sources */,
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm index 1e1bb9bc..4e08f4c5 100644 --- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm +++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm
@@ -20,7 +20,6 @@ #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" #import "ios/chrome/browser/ui/ui_feature_flags.h" -#include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/util/animation_util.h" #import "ios/chrome/browser/ui/util/force_touch_long_press_gesture_recognizer.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" @@ -455,8 +454,7 @@ weakButton.menu = [weakSelf.menuProvider menuForButtonOfType:buttonType]; }]; - [weakButton addAction:action - forControlEvents:UIControlEventMenuActionTriggered]; + [button addAction:action forControlEvents:UIControlEventMenuActionTriggered]; } @end
diff --git a/ios/showcase/badges/sc_badge_coordinator.mm b/ios/showcase/badges/sc_badge_coordinator.mm index ffd7a22f..e89581b6 100644 --- a/ios/showcase/badges/sc_badge_coordinator.mm +++ b/ios/showcase/badges/sc_badge_coordinator.mm
@@ -122,6 +122,10 @@ @implementation SCBadgeCoordinator @synthesize baseViewController = _baseViewController; +- (NSArray<NSNumber*>*)badgeTypesForOverflowMenu { + return @[ @(kBadgeTypePasswordSave) ]; +} + - (void)start { self.containerViewController = [[BadgeContainerViewController alloc] init]; BadgeButtonFactory* buttonFactory = [[BadgeButtonFactory alloc] init]; @@ -165,4 +169,7 @@ [self.consumer markDisplayedBadgeAsRead:YES]; } +- (void)showModalForBadgeType:(BadgeType)badgeType { +} + @end
diff --git a/ios/web/BUILD.gn b/ios/web/BUILD.gn index 3b279608..017abc1 100644 --- a/ios/web/BUILD.gn +++ b/ios/web/BUILD.gn
@@ -679,6 +679,7 @@ sources = [ "navigation/resources/error_page_injected.html", "navigation/resources/error_page_loaded.html", + "navigation/resources/error_page_reloaded.html", "navigation/resources/restore_session.html", ] outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
diff --git a/ios/web/navigation/crw_wk_navigation_handler.mm b/ios/web/navigation/crw_wk_navigation_handler.mm index e1b4520..ec82ae85 100644 --- a/ios/web/navigation/crw_wk_navigation_handler.mm +++ b/ios/web/navigation/crw_wk_navigation_handler.mm
@@ -1767,27 +1767,43 @@ if (itemURL != failingURL) item->SetVirtualURL(failingURL); - // Saves original context before, as the original context can be deleted - // before the callback is called. - __block std::unique_ptr<web::NavigationContextImpl> originalContext = - [self.navigationStates removeNavigation:navigation]; web::GetWebClient()->PrepareErrorPage( self.webStateImpl, failingURL, contextError, navigationContext->IsPost(), self.webStateImpl->GetBrowserState()->IsOffTheRecord(), SSLInfo, navigationContext->GetNavigationId(), base::BindOnce(^(NSString* errorHTML) { - if (errorHTML) { + if (@available(iOS 15, *)) { + NSBundle* bundleForHTMLFile = [NSBundle bundleForClass:CRWWKNavigationHandler.class]; + NSString* path = [bundleForHTMLFile pathForResource:@"error_page_reloaded" + ofType:@"html"]; + // Script which reloads the error page if the error page is being + // served from the browser cache. + NSString* reloadPageHTMLTemplate = + [NSString stringWithContentsOfFile:path + encoding:NSUTF8StringEncoding + error:nil]; + NSURLRequest* URL = [NSURLRequest requestWithURL:[NSURL URLWithString:failingURLString]]; - if (@available(iOS 15, *)) { - WKNavigation* errorNavigation = + WKNavigation* errorNavigation = nil; + + if (errorHTML) { + NSString* injectedHTML = + [errorHTML stringByAppendingString:reloadPageHTMLTemplate]; + errorNavigation = [webView loadSimulatedRequest:URL + responseHTMLString:injectedHTML]; + } else { + errorNavigation = [webView loadSimulatedRequest:URL - responseHTMLString:errorHTML]; - originalContext->SetLoadingErrorPage(true); - [self.navigationStates setContext:std::move(originalContext) - forNavigation:errorNavigation]; + responseHTMLString:reloadPageHTMLTemplate]; } + + std::unique_ptr<web::NavigationContextImpl> originalContext = + [self.navigationStates removeNavigation:navigation]; + originalContext->SetLoadingErrorPage(true); + [self.navigationStates setContext:std::move(originalContext) + forNavigation:errorNavigation]; } })); } else {
diff --git a/ios/web/navigation/resources/error_page_reloaded.html b/ios/web/navigation/resources/error_page_reloaded.html new file mode 100644 index 0000000..72809647 --- /dev/null +++ b/ios/web/navigation/resources/error_page_reloaded.html
@@ -0,0 +1,8 @@ +<script type="text/javascript"> +// When back/forward/refresh this error page, reload the page if being served from browser cache. +window.addEventListener('pageshow', (event) => { + if (event.persisted) { + window.location.reload(); + } +}); +</script>
diff --git a/media/gpu/buffer_validation.cc b/media/gpu/buffer_validation.cc index f36a8a1..25a0f42 100644 --- a/media/gpu/buffer_validation.cc +++ b/media/gpu/buffer_validation.cc
@@ -66,6 +66,11 @@ << coded_size.ToString(); return false; } + if (pixel_format != PIXEL_FORMAT_I420 && pixel_format != PIXEL_FORMAT_NV12 && + pixel_format != PIXEL_FORMAT_P016LE) { + VLOGF(1) << "Unsupported: " << pixel_format; + return false; + } #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format); if (num_planes != gmb_handle.native_pixmap_handle.planes.size() ||
diff --git a/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.cc b/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.cc index b39ef648..0993f92 100644 --- a/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.cc +++ b/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.cc
@@ -18,9 +18,9 @@ namespace { -uint8_t* Mmap(const size_t length, const int fd) { - void* addr = - mmap(nullptr, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0u); +uint8_t* Mmap(const size_t length, const int fd, int permissions) { + void* addr = mmap(nullptr, length, permissions, MAP_SHARED, fd, 0u); + if (addr == MAP_FAILED) { VLOGF(1) << "Failed to mmap."; return nullptr; @@ -104,7 +104,8 @@ : VideoFrameMapper(format) {} scoped_refptr<VideoFrame> GenericDmaBufVideoFrameMapper::Map( - scoped_refptr<const VideoFrame> video_frame) const { + scoped_refptr<const VideoFrame> video_frame, + int permissions) const { if (!video_frame) { LOG(ERROR) << "Video frame is nullptr"; return nullptr; @@ -155,7 +156,7 @@ return nullptr; } - uint8_t* mapped_addr = Mmap(mapped_size, dmabuf_fds[i].get()); + uint8_t* mapped_addr = Mmap(mapped_size, dmabuf_fds[i].get(), permissions); chunks.emplace_back(mapped_addr, mapped_size); for (size_t j = i; j < next_buf; ++j) plane_addrs[j] = mapped_addr + planes[j].offset;
diff --git a/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.h b/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.h index ed25232..0ab5b4b 100644 --- a/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.h +++ b/media/gpu/chromeos/generic_dmabuf_video_frame_mapper.h
@@ -23,8 +23,8 @@ ~GenericDmaBufVideoFrameMapper() override = default; // VideoFrameMapper implementation. - scoped_refptr<VideoFrame> Map( - scoped_refptr<const VideoFrame> video_frame) const override; + scoped_refptr<VideoFrame> Map(scoped_refptr<const VideoFrame> video_frame, + int permissions) const override; private: explicit GenericDmaBufVideoFrameMapper(VideoPixelFormat format);
diff --git a/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.cc b/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.cc index 0954dd8f..fb0cb05 100644 --- a/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.cc +++ b/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.cc
@@ -4,6 +4,8 @@ #include "media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.h" +#include <sys/mman.h> + #include "base/bind.h" #include "base/memory/ptr_util.h" #include "media/gpu/macros.h" @@ -21,12 +23,18 @@ : VideoFrameMapper(format) {} scoped_refptr<VideoFrame> GpuMemoryBufferVideoFrameMapper::Map( - scoped_refptr<const VideoFrame> video_frame) const { + scoped_refptr<const VideoFrame> video_frame, + int permissions) const { if (!video_frame) { LOG(ERROR) << "Video frame is nullptr"; return nullptr; } + if (!(permissions & PROT_READ && permissions & PROT_WRITE)) { + LOG(ERROR) << "GPU Memory Buffer must be mapped read/write."; + return nullptr; + } + if (video_frame->storage_type() != VideoFrame::StorageType::STORAGE_GPU_MEMORY_BUFFER) { VLOGF(1) << "VideoFrame's storage type is not GPU_MEMORY_BUFFER: "
diff --git a/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.h b/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.h index 82239f5f2..4b66244 100644 --- a/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.h +++ b/media/gpu/chromeos/gpu_memory_buffer_video_frame_mapper.h
@@ -26,8 +26,8 @@ ~GpuMemoryBufferVideoFrameMapper() override = default; // VideoFrameMapper implementation. - scoped_refptr<VideoFrame> Map( - scoped_refptr<const VideoFrame> video_frame) const override; + scoped_refptr<VideoFrame> Map(scoped_refptr<const VideoFrame> video_frame, + int permissions) const override; private: explicit GpuMemoryBufferVideoFrameMapper(VideoPixelFormat format);
diff --git a/media/gpu/chromeos/libyuv_image_processor_backend.cc b/media/gpu/chromeos/libyuv_image_processor_backend.cc index 2e6173c..6245a80 100644 --- a/media/gpu/chromeos/libyuv_image_processor_backend.cc +++ b/media/gpu/chromeos/libyuv_image_processor_backend.cc
@@ -4,6 +4,8 @@ #include "media/gpu/chromeos/libyuv_image_processor_backend.h" +#include <sys/mman.h> + #include "base/containers/contains.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" @@ -327,7 +329,11 @@ if (input_frame->storage_type() == VideoFrame::STORAGE_DMABUFS || input_frame->storage_type() == VideoFrame::STORAGE_GPU_MEMORY_BUFFER) { DCHECK_NE(input_frame_mapper_.get(), nullptr); - input_frame = input_frame_mapper_->Map(std::move(input_frame)); + int mapping_permissions = PROT_READ; + if (input_frame->storage_type() != VideoFrame::STORAGE_DMABUFS) + mapping_permissions |= PROT_WRITE; + input_frame = + input_frame_mapper_->Map(std::move(input_frame), mapping_permissions); if (!input_frame) { VLOGF(1) << "Failed to map input VideoFrame"; error_cb_.Run(); @@ -341,7 +347,8 @@ if (output_frame->storage_type() == VideoFrame::STORAGE_DMABUFS || output_frame->storage_type() == VideoFrame::STORAGE_GPU_MEMORY_BUFFER) { DCHECK_NE(output_frame_mapper_.get(), nullptr); - mapped_frame = output_frame_mapper_->Map(output_frame); + mapped_frame = + output_frame_mapper_->Map(output_frame, PROT_READ | PROT_WRITE); if (!mapped_frame) { VLOGF(1) << "Failed to map output VideoFrame"; error_cb_.Run();
diff --git a/media/gpu/chromeos/platform_video_frame_utils.cc b/media/gpu/chromeos/platform_video_frame_utils.cc index ccddf60e..428c869 100644 --- a/media/gpu/chromeos/platform_video_frame_utils.cc +++ b/media/gpu/chromeos/platform_video_frame_utils.cc
@@ -12,6 +12,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/containers/fixed_flat_set.h" +#include "base/dcheck_is_on.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/scoped_file.h" @@ -342,11 +343,17 @@ NOTREACHED() << "Unsupported storage type: " << video_frame->storage_type(); } - if (!handle.is_null() && handle.type == gfx::NATIVE_PIXMAP && - !VerifyGpuMemoryBufferHandle(video_frame->format(), - video_frame->coded_size(), handle)) { - VLOGF(1) << "Created GpuMemoryBufferHandle is invalid"; - } + CHECK_EQ(handle.type, gfx::NATIVE_PIXMAP); + if (video_frame->format() == PIXEL_FORMAT_MJPEG) + return handle; +#if DCHECK_IS_ON() + const bool is_handle_valid = + !handle.is_null() && + VerifyGpuMemoryBufferHandle(video_frame->format(), + video_frame->coded_size(), handle); + DLOG_IF(WARNING, !is_handle_valid) + << __func__ << "(): Created GpuMemoryBufferHandle is invalid"; +#endif // DCHECK_IS_ON() return handle; }
diff --git a/media/gpu/test/video_frame_file_writer.cc b/media/gpu/test/video_frame_file_writer.cc index 31f4031..76cdcb0 100644 --- a/media/gpu/test/video_frame_file_writer.cc +++ b/media/gpu/test/video_frame_file_writer.cc
@@ -4,6 +4,7 @@ #include "media/gpu/test/video_frame_file_writer.h" +#include <sys/mman.h> #include <utility> #include <vector> @@ -207,7 +208,8 @@ #if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) if (video_frame->storage_type() == VideoFrame::STORAGE_DMABUFS) { CHECK(video_frame_mapper_); - mapped_frame = video_frame_mapper_->Map(std::move(video_frame)); + mapped_frame = video_frame_mapper_->Map(std::move(video_frame), + PROT_READ | PROT_WRITE); } #endif // BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) @@ -250,7 +252,8 @@ #if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) if (video_frame->storage_type() == VideoFrame::STORAGE_DMABUFS) { CHECK(video_frame_mapper_); - mapped_frame = video_frame_mapper_->Map(std::move(video_frame)); + mapped_frame = video_frame_mapper_->Map(std::move(video_frame), + PROT_READ | PROT_WRITE); } #endif if (!mapped_frame) {
diff --git a/media/gpu/test/video_frame_helpers.cc b/media/gpu/test/video_frame_helpers.cc index 34acdd8..ead9b0a 100644 --- a/media/gpu/test/video_frame_helpers.cc +++ b/media/gpu/test/video_frame_helpers.cc
@@ -4,6 +4,7 @@ #include "media/gpu/test/video_frame_helpers.h" +#include <sys/mman.h> #include <utility> #include <vector> @@ -216,7 +217,8 @@ auto video_frame_mapper = VideoFrameMapperFactory::CreateMapper( dst_frame->format(), VideoFrame::STORAGE_DMABUFS, true); ASSERT_TRUE_OR_RETURN(video_frame_mapper, false); - dst_frame = video_frame_mapper->Map(std::move(dst_frame)); + dst_frame = + video_frame_mapper->Map(std::move(dst_frame), PROT_READ | PROT_WRITE); if (!dst_frame) { LOG(ERROR) << "Failed to map DMABuf video frame."; return false;
diff --git a/media/gpu/test/video_frame_validator.cc b/media/gpu/test/video_frame_validator.cc index 8a295449..7616702 100644 --- a/media/gpu/test/video_frame_validator.cc +++ b/media/gpu/test/video_frame_validator.cc
@@ -4,6 +4,8 @@ #include "media/gpu/test/video_frame_validator.h" +#include <sys/mman.h> + #include "base/bind.h" #include "base/cpu.h" #include "base/files/file.h" @@ -167,7 +169,7 @@ ASSERT_TRUE(video_frame_mapper_) << "Failed to create VideoFrameMapper"; } - frame = video_frame_mapper_->Map(std::move(frame)); + frame = video_frame_mapper_->Map(std::move(frame), PROT_READ | PROT_WRITE); if (!frame) { LOG(ERROR) << "Failed to map video frame"; return;
diff --git a/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc b/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc index 7f9fe1b8..1fe2660 100644 --- a/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_mjpeg_decode_accelerator.cc
@@ -885,7 +885,8 @@ VLOGF(1) << "Failed to create video frame mapper"; return false; } - dst_frame = frame_mapper->Map(std::move(dst_frame)); + dst_frame = frame_mapper->Map(std::move(dst_frame), PROT_READ | PROT_WRITE); + if (!dst_frame) { VLOGF(1) << "Failed to map DMA-buf video frame"; return false;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc index 74668b6..e8a143d 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc
@@ -152,11 +152,6 @@ // This control was landed in v5.17 and is pretty much a marker that the // driver supports the stable API. DCHECK(device_->IsCtrlExposed(V4L2_CID_STATELESS_VP9_FRAME)); - - // TODO(mcasas): Not all drivers support this, e.g. RK3399 does but MTK8195 - // doesn't. Remove this DCHECK() when the not-supporting platforms are - // brought up. - DCHECK(supports_compressed_header_); } V4L2VideoDecoderDelegateVP9::~V4L2VideoDecoderDelegateVP9() = default;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h index 7f4a208..6895b10 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h
@@ -34,7 +34,9 @@ bool OutputPicture(scoped_refptr<VP9Picture> pic) override; bool GetFrameContext(scoped_refptr<VP9Picture> pic, Vp9FrameContext* frame_ctx) override; - bool NeedsCompressedHeaderParsed() const override { return true; } + bool NeedsCompressedHeaderParsed() const override { + return supports_compressed_header_; + } bool SupportsContextProbabilityReadback() const override { return false; } private:
diff --git a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc index 0fbdbdc..c838ec3 100644 --- a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc +++ b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.cc
@@ -4,6 +4,8 @@ #include "media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.h" +#include <sys/mman.h> + #include "base/bind.h" #include "base/callback_helpers.h" #include "base/memory/ptr_util.h" @@ -171,13 +173,19 @@ VaapiDmaBufVideoFrameMapper::~VaapiDmaBufVideoFrameMapper() {} scoped_refptr<VideoFrame> VaapiDmaBufVideoFrameMapper::Map( - scoped_refptr<const VideoFrame> video_frame) const { + scoped_refptr<const VideoFrame> video_frame, + int permissions) const { DCHECK(vaapi_wrapper_); if (!video_frame) { LOG(ERROR) << "Video frame is nullptr"; return nullptr; } + if (!(permissions & PROT_READ && permissions & PROT_WRITE)) { + LOG(ERROR) << "VAAPI DMA Buffer must be mapped read/write."; + return nullptr; + } + if (!video_frame->HasDmaBufs()) return nullptr;
diff --git a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.h b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.h index e22e7b9..4d31db2 100644 --- a/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.h +++ b/media/gpu/vaapi/vaapi_dmabuf_video_frame_mapper.h
@@ -29,8 +29,8 @@ ~VaapiDmaBufVideoFrameMapper() override; // VideoFrameMapper override. - scoped_refptr<VideoFrame> Map( - scoped_refptr<const VideoFrame> video_frame) const override; + scoped_refptr<VideoFrame> Map(scoped_refptr<const VideoFrame> video_frame, + int permissions) const override; private: explicit VaapiDmaBufVideoFrameMapper(VideoPixelFormat format);
diff --git a/media/gpu/video_frame_mapper.h b/media/gpu/video_frame_mapper.h index e0eb0dad..cc8f956 100644 --- a/media/gpu/video_frame_mapper.h +++ b/media/gpu/video_frame_mapper.h
@@ -23,9 +23,12 @@ virtual ~VideoFrameMapper() = default; // Maps data referred by |video_frame| and creates a VideoFrame whose dtor - // unmap the mapped memory. + // unmap the mapped memory. The |permissions| parameter is a bitwise OR of the + // permissions the mapping needs if it uses mmap. Valid flags for this + // parameter are combinations of |PROT_READ| and |PROT_WRITE|. virtual scoped_refptr<VideoFrame> Map( - scoped_refptr<const VideoFrame> video_frame) const = 0; + scoped_refptr<const VideoFrame> video_frame, + int permissions) const = 0; // Returns the allowed pixel format of video frames on Map(). VideoPixelFormat pixel_format() const { return format_; }
diff --git a/services/network/OWNERS b/services/network/OWNERS index 62d6e9f..a72074c 100644 --- a/services/network/OWNERS +++ b/services/network/OWNERS
@@ -11,7 +11,6 @@ reillyg@chromium.org rmcelrath@chromium.org toyoshim@chromium.org -tsepez@chromium.org yhirano@chromium.org # Files and features related to component:Internals>Sandbox>SiteIsolation:
diff --git a/sql/database.cc b/sql/database.cc index 779bd60..cdd2d53 100644 --- a/sql/database.cc +++ b/sql/database.cc
@@ -26,6 +26,7 @@ #include "base/notreached.h" #include "base/numerics/safe_conversions.h" #include "base/ranges/algorithm.h" +#include "base/sequence_checker.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" @@ -276,35 +277,46 @@ DCHECK(!options_.mmap_alt_status_discouraged || options_.enable_views_discouraged) << "mmap_alt_status requires views"; + + // It's valid to construct a database on a sequence and then pass it to a + // different sequence before usage. + DETACH_FROM_SEQUENCE(sequence_checker_); } Database::~Database() { Close(); } +// static void Database::DisableMmapByDefault() { enable_mmap_by_default_ = false; } bool Database::Open(const base::FilePath& path) { - DCHECK(!path.empty()); - std::string path_string = AsUTF8ForSQL(path); + TRACE_EVENT1("sql", "Database::Open", "path", path_string); + + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(!path.empty()); DCHECK_NE(path_string, kSqliteOpenInMemoryPath) << "Path conflicts with SQLite magic identifier"; - TRACE_EVENT1("sql", "Database::Open", "path", path_string); return OpenInternal(path_string, OpenMode::kRetryOnPoision); } bool Database::OpenInMemory() { TRACE_EVENT0("sql", "Database::OpenInMemory"); + + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + in_memory_ = true; return OpenInternal(kSqliteOpenInMemoryPath, OpenMode::kInMemory); } bool Database::OpenTemporary(base::PassKey<Recovery>) { TRACE_EVENT0("sql", "Database::OpenTemporary"); + + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return OpenInternal(std::string(), OpenMode::kTemporary); } @@ -381,6 +393,7 @@ void Database::Preload() { TRACE_EVENT0("sql", "Database::Preload"); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!db_) { DCHECK(poisoned_) << "Cannot preload null db"; return; @@ -1311,6 +1324,7 @@ bool Database::ExecuteWithTimeout(const char* sql, base::TimeDelta timeout) { TRACE_EVENT0("sql", "Database::ExecuteWithTimeout"); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!db_) { DCHECK(poisoned_) << "Illegal use of Database without a db"; return false; @@ -1618,6 +1632,7 @@ bool Database::OpenInternal(const std::string& db_file_path, Database::OpenMode mode) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); TRACE_EVENT1("sql", "Database::OpenInternal", "path", db_file_path); DCHECK(mode != OpenMode::kTemporary || db_file_path.empty()) @@ -1912,20 +1927,35 @@ DCHECK_NE(statement != nullptr, sql_statement != nullptr) << __func__ << " should either get a Statement or a raw SQL string"; - bool is_expected_error = IsExpectedSqliteError(sqlite_error_code); - if (!is_expected_error) { - // Log unexpected errors. - if (statement) - sql_statement = statement->GetSQLStatement(); - DCHECK(sql_statement); + // Log errors for developers. + // + // This block is wrapped around a DCHECK_IS_ON() check so we don't waste CPU + // cycles computing the strings that make up the log message in production. +#if DCHECK_IS_ON() + if (statement) + sql_statement = statement->GetSQLStatement(); + DCHECK(sql_statement); - std::string id = histogram_tag_; - if (id.empty()) - id = DbPath().BaseName().AsUTF8Unsafe(); - LOG(ERROR) << id << " SQLite error: code " << sqlite_error_code << " errno " - << GetLastErrno() << ": " << GetErrorMessage() - << " sql: " << sql_statement; - } + std::string database_id = histogram_tag_; + if (database_id.empty()) + database_id = DbPath().BaseName().AsUTF8Unsafe(); + + // This logging block cannot be a DCHECK, because valid usage of sql::Database + // can still encounter SQLite errors in production. For example, valid SQL + // statements can fail when a database is corrupted. + // + // This logging block should not use LOG(ERROR) because many features built on + // top of sql::Database can recover from most errors. + DVLOG(1) << "SQLite error! This may indicate a programming error!\n" + << "Database: " << database_id + << " sqlite_error_code: " << sqlite_error_code + << " errno: " << GetLastErrno() + << "\nSQLite error description: " << GetErrorMessage() + << "\nSQL statement: " << sql_statement; +#endif // DCHECK_IS_ON() + + // Inform the error expecter that we've encountered the error. + std::ignore = IsExpectedSqliteError(sqlite_error_code); if (!error_callback_.is_null()) { // Create an additional reference to the state in `error_callback_`, so the @@ -1936,10 +1966,6 @@ error_callback_copy.Run(sqlite_error_code, statement); return; } - - // The default handling is to assert on debug and to ignore on release. - if (!is_expected_error) - DLOG(DCHECK) << GetErrorMessage(); } std::string Database::GetDiagnosticInfo(int sqlite_error_code, @@ -1983,6 +2009,7 @@ } bool Database::FullIntegrityCheck(std::vector<std::string>* messages) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); messages->clear(); // The PRAGMA below has the side effect of setting SQLITE_RecoveryMode, which @@ -2068,6 +2095,7 @@ } bool Database::CheckpointDatabase() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); absl::optional<base::ScopedBlockingCall> scoped_blocking_call; InitScopedBlockingCall(FROM_HERE, &scoped_blocking_call);
diff --git a/sql/database.h b/sql/database.h index 9872af0..369652b 100644 --- a/sql/database.h +++ b/sql/database.h
@@ -187,8 +187,8 @@ // Handle to an open SQLite database. // -// Instances of this class are thread-unsafe and DCHECK that they are accessed -// on the same sequence. +// Instances of this class are not thread-safe. After construction, a Database +// instance should only be accessed from one sequence. // // When a Database instance goes out of scope, any uncommitted transactions are // rolled back. @@ -856,6 +856,9 @@ // This method must only be called while the database is successfully opened. sqlite3_file* GetSqliteVfsFile(); + // Will eventually be checked on all methods. See https://crbug.com/1306694 + SEQUENCE_CHECKER(sequence_checker_); + // The actual sqlite database. Will be null before Init has been called or if // Init resulted in an error. sqlite3* db_ = nullptr;
diff --git a/storage/browser/blob/blob_registry_impl_unittest.cc b/storage/browser/blob/blob_registry_impl_unittest.cc index 90a5b6b..040049b9 100644 --- a/storage/browser/blob/blob_registry_impl_unittest.cc +++ b/storage/browser/blob/blob_registry_impl_unittest.cc
@@ -82,6 +82,7 @@ /*quota_manager_proxy=*/nullptr, std::vector<std::unique_ptr<FileSystemBackend>>(), std::vector<URLRequestAutoMountHandler>(), data_dir_.GetPath(), + data_dir_.GetPath(), FileSystemOptions(FileSystemOptions::PROFILE_MODE_INCOGNITO, /*force_in_memory=*/false, std::vector<std::string>()));
diff --git a/storage/browser/file_system/file_system_context.cc b/storage/browser/file_system/file_system_context.cc index 808295d..50017856 100644 --- a/storage/browser/file_system/file_system_context.cc +++ b/storage/browser/file_system/file_system_context.cc
@@ -154,6 +154,7 @@ std::vector<std::unique_ptr<FileSystemBackend>> additional_backends, const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, const base::FilePath& partition_path, + const base::FilePath& bucket_base_path, const FileSystemOptions& options) { bool force_override_incognito = base::FeatureList::IsEnabled( features::kIncognitoFileSystemContextForTesting); @@ -168,8 +169,8 @@ std::move(io_task_runner), std::move(file_task_runner), std::move(external_mount_points), std::move(special_storage_policy), std::move(quota_manager_proxy), std::move(additional_backends), - auto_mount_handlers, partition_path, maybe_overridden_options, - base::PassKey<FileSystemContext>()); + auto_mount_handlers, partition_path, bucket_base_path, + maybe_overridden_options, base::PassKey<FileSystemContext>()); context->Initialize(); return context; } @@ -183,6 +184,7 @@ std::vector<std::unique_ptr<FileSystemBackend>> additional_backends, const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, const base::FilePath& partition_path, + const base::FilePath& bucket_base_path, const FileSystemOptions& options, base::PassKey<FileSystemContext>) : base::RefCountedDeleteOnSequence<FileSystemContext>(io_task_runner), @@ -200,6 +202,7 @@ quota_manager_proxy_.get(), default_file_task_runner_.get(), partition_path, + bucket_base_path, special_storage_policy, options, env_override_.get())), @@ -208,6 +211,7 @@ plugin_private_backend_(std::make_unique<PluginPrivateFileSystemBackend>( default_file_task_runner_, partition_path, + bucket_base_path, std::move(special_storage_policy), options, env_override_.get())), @@ -215,6 +219,7 @@ auto_mount_handlers_(auto_mount_handlers), external_mount_points_(std::move(external_mount_points)), partition_path_(partition_path), + bucket_base_path_(bucket_base_path), is_incognito_(options.is_incognito()), operation_runner_(std::make_unique<FileSystemOperationRunner>( base::PassKey<FileSystemContext>(),
diff --git a/storage/browser/file_system/file_system_context.h b/storage/browser/file_system/file_system_context.h index 15b2f72..212086b 100644 --- a/storage/browser/file_system/file_system_context.h +++ b/storage/browser/file_system/file_system_context.h
@@ -135,6 +135,7 @@ std::vector<std::unique_ptr<FileSystemBackend>> additional_backends, const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, const base::FilePath& partition_path, + const base::FilePath& bucket_base_path, const FileSystemOptions& options); // Exposed for base::MakeRefCounted(). Instances should be obtained from the @@ -148,6 +149,7 @@ std::vector<std::unique_ptr<FileSystemBackend>> additional_backends, const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, const base::FilePath& partition_path, + const base::FilePath& bucket_base_path, const FileSystemOptions& options, base::PassKey<FileSystemContext>); @@ -305,6 +307,8 @@ const base::FilePath& partition_path() const { return partition_path_; } + const base::FilePath& bucket_base_path() const { return bucket_base_path_; } + // Same as `CrackFileSystemURL`, but cracks FileSystemURL created from `url` // and `storage_key`. FileSystemURL CrackURL(const GURL& url, @@ -470,6 +474,10 @@ // The base path of the storage partition for this context. const base::FilePath partition_path_; + // The base path of the file directory where StorageBucket data is stored for + // this context. + const base::FilePath bucket_base_path_; + const bool is_incognito_; const std::unique_ptr<FileSystemOperationRunner> operation_runner_;
diff --git a/storage/browser/file_system/file_system_context_unittest.cc b/storage/browser/file_system/file_system_context_unittest.cc index 93bdccd5d..8ada21d 100644 --- a/storage/browser/file_system/file_system_context_unittest.cc +++ b/storage/browser/file_system/file_system_context_unittest.cc
@@ -67,7 +67,7 @@ storage_policy_, mock_quota_manager_->proxy(), std::vector<std::unique_ptr<FileSystemBackend>>(), std::vector<URLRequestAutoMountHandler>(), data_dir_.GetPath(), - CreateAllowFileAccessOptions()); + data_dir_.GetPath(), CreateAllowFileAccessOptions()); } // Verifies a *valid* filesystem url has expected values.
diff --git a/storage/browser/file_system/obfuscated_file_util.cc b/storage/browser/file_system/obfuscated_file_util.cc index a3840c4b..97d3154 100644 --- a/storage/browser/file_system/obfuscated_file_util.cc +++ b/storage/browser/file_system/obfuscated_file_util.cc
@@ -272,6 +272,7 @@ ObfuscatedFileUtil::ObfuscatedFileUtil( scoped_refptr<SpecialStoragePolicy> special_storage_policy, const base::FilePath& file_system_directory, + const base::FilePath& bucket_base_path, leveldb::Env* env_override, GetTypeStringForURLCallback get_type_string_for_url, const std::set<std::string>& known_type_strings, @@ -279,6 +280,7 @@ bool is_incognito) : special_storage_policy_(std::move(special_storage_policy)), file_system_directory_(file_system_directory), + bucket_base_path_(bucket_base_path), env_override_(env_override), is_incognito_(is_incognito), db_flush_delay_seconds_(10 * 60), // 10 mins.
diff --git a/storage/browser/file_system/obfuscated_file_util.h b/storage/browser/file_system/obfuscated_file_util.h index 69b70676..c44189f 100644 --- a/storage/browser/file_system/obfuscated_file_util.h +++ b/storage/browser/file_system/obfuscated_file_util.h
@@ -111,6 +111,7 @@ // deleted when one StorageKey/type pair is deleted. ObfuscatedFileUtil(scoped_refptr<SpecialStoragePolicy> special_storage_policy, const base::FilePath& file_system_directory, + const base::FilePath& bucket_base_path, leveldb::Env* env_override, GetTypeStringForURLCallback get_type_string_for_url, const std::set<std::string>& known_type_strings, @@ -236,6 +237,7 @@ static std::unique_ptr<ObfuscatedFileUtil> CreateForTesting( scoped_refptr<SpecialStoragePolicy> special_storage_policy, const base::FilePath& file_system_directory, + const base::FilePath& bucket_base_path, leveldb::Env* env_override, bool is_incognito); @@ -331,6 +333,7 @@ std::unique_ptr<SandboxOriginDatabaseInterface> origin_database_; scoped_refptr<SpecialStoragePolicy> special_storage_policy_; base::FilePath file_system_directory_; + base::FilePath bucket_base_path_; raw_ptr<leveldb::Env> env_override_; bool is_incognito_;
diff --git a/storage/browser/file_system/obfuscated_file_util_unittest.cc b/storage/browser/file_system/obfuscated_file_util_unittest.cc index bf18d902..49f700b 100644 --- a/storage/browser/file_system/obfuscated_file_util_unittest.cc +++ b/storage/browser/file_system/obfuscated_file_util_unittest.cc
@@ -267,7 +267,7 @@ std::unique_ptr<ObfuscatedFileUtil> CreateObfuscatedFileUtil( scoped_refptr<SpecialStoragePolicy> storage_policy) { return ObfuscatedFileUtil::CreateForTesting( - std::move(storage_policy), data_dir_path(), + std::move(storage_policy), data_dir_path(), data_dir_path(), is_incognito() ? incognito_leveldb_environment_.get() : nullptr, is_incognito()); }
diff --git a/storage/browser/file_system/plugin_private_file_system_backend.cc b/storage/browser/file_system/plugin_private_file_system_backend.cc index c3f943b..8e50c87 100644 --- a/storage/browser/file_system/plugin_private_file_system_backend.cc +++ b/storage/browser/file_system/plugin_private_file_system_backend.cc
@@ -102,6 +102,7 @@ PluginPrivateFileSystemBackend::PluginPrivateFileSystemBackend( scoped_refptr<base::SequencedTaskRunner> file_task_runner, const base::FilePath& profile_path, + const base::FilePath& bucket_base_path, scoped_refptr<SpecialStoragePolicy> special_storage_policy, const FileSystemOptions& file_system_options, leveldb::Env* env_override) @@ -112,7 +113,8 @@ plugin_map_(new FileSystemIDToPluginMap(file_task_runner_)) { file_util_ = std::make_unique<AsyncFileUtilAdapter>( std::make_unique<ObfuscatedFileUtil>( - std::move(special_storage_policy), base_path_, env_override, + std::move(special_storage_policy), base_path_, bucket_base_path, + env_override, base::BindRepeating(&FileSystemIDToPluginMap::GetPluginIDForURL, base::Owned(plugin_map_.get())), std::set<std::string>(), nullptr,
diff --git a/storage/browser/file_system/plugin_private_file_system_backend.h b/storage/browser/file_system/plugin_private_file_system_backend.h index 5b36b882..d1422e6 100644 --- a/storage/browser/file_system/plugin_private_file_system_backend.h +++ b/storage/browser/file_system/plugin_private_file_system_backend.h
@@ -57,6 +57,7 @@ PluginPrivateFileSystemBackend( scoped_refptr<base::SequencedTaskRunner> file_task_runner, const base::FilePath& profile_path, + const base::FilePath& bucket_base_path, scoped_refptr<SpecialStoragePolicy> special_storage_policy, const FileSystemOptions& file_system_options, leveldb::Env* env_override);
diff --git a/storage/browser/file_system/quota/quota_backend_impl_unittest.cc b/storage/browser/file_system/quota/quota_backend_impl_unittest.cc index f03a7b5b..083688ee 100644 --- a/storage/browser/file_system/quota/quota_backend_impl_unittest.cc +++ b/storage/browser/file_system/quota/quota_backend_impl_unittest.cc
@@ -114,7 +114,7 @@ in_memory_env_ = leveldb_chrome::NewMemEnv("quota"); file_util_ = ObfuscatedFileUtil::CreateForTesting( /*special_storage_policy=*/nullptr, data_dir_.GetPath(), - in_memory_env_.get(), is_incognito()); + data_dir_.GetPath(), in_memory_env_.get(), is_incognito()); backend_ = std::make_unique<QuotaBackendImpl>( file_task_runner(), file_util_.get(), &file_system_usage_cache_, quota_manager_proxy_.get());
diff --git a/storage/browser/file_system/sandbox_file_system_backend_delegate.cc b/storage/browser/file_system/sandbox_file_system_backend_delegate.cc index f409b58..c78d058 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_delegate.cc +++ b/storage/browser/file_system/sandbox_file_system_backend_delegate.cc
@@ -182,6 +182,7 @@ scoped_refptr<QuotaManagerProxy> quota_manager_proxy, scoped_refptr<base::SequencedTaskRunner> file_task_runner, const base::FilePath& profile_path, + const base::FilePath& bucket_base_path, scoped_refptr<SpecialStoragePolicy> special_storage_policy, const FileSystemOptions& file_system_options, leveldb::Env* env_override) @@ -191,6 +192,7 @@ std::make_unique<ObfuscatedFileUtil>( special_storage_policy, profile_path.Append(kFileSystemDirectory), + bucket_base_path, env_override, base::BindRepeating(&GetTypeStringForURL), GetKnownTypeStrings(), @@ -675,11 +677,13 @@ std::unique_ptr<ObfuscatedFileUtil> ObfuscatedFileUtil::CreateForTesting( scoped_refptr<SpecialStoragePolicy> special_storage_policy, const base::FilePath& file_system_directory, + const base::FilePath& bucket_base_path, leveldb::Env* env_override, bool is_incognito) { return std::make_unique<ObfuscatedFileUtil>( - std::move(special_storage_policy), file_system_directory, env_override, - base::BindRepeating(&GetTypeStringForURL), GetKnownTypeStrings(), + std::move(special_storage_policy), file_system_directory, + bucket_base_path, env_override, base::BindRepeating(&GetTypeStringForURL), + GetKnownTypeStrings(), /*sandbox_delegate=*/nullptr, is_incognito); }
diff --git a/storage/browser/file_system/sandbox_file_system_backend_delegate.h b/storage/browser/file_system/sandbox_file_system_backend_delegate.h index 7abbc1a..d60e67e 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_delegate.h +++ b/storage/browser/file_system/sandbox_file_system_backend_delegate.h
@@ -99,6 +99,7 @@ scoped_refptr<QuotaManagerProxy> quota_manager_proxy, scoped_refptr<base::SequencedTaskRunner> file_task_runner, const base::FilePath& profile_path, + const base::FilePath& bucket_base_path, scoped_refptr<SpecialStoragePolicy> special_storage_policy, const FileSystemOptions& file_system_options, leveldb::Env* env_override);
diff --git a/storage/browser/file_system/sandbox_file_system_backend_delegate_unittest.cc b/storage/browser/file_system/sandbox_file_system_backend_delegate_unittest.cc index c6fb104..0f6a8f00 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_delegate_unittest.cc +++ b/storage/browser/file_system/sandbox_file_system_backend_delegate_unittest.cc
@@ -40,8 +40,9 @@ nullptr, base::ThreadTaskRunnerHandle::Get()); delegate_ = std::make_unique<SandboxFileSystemBackendDelegate>( quota_manager_proxy_.get(), base::ThreadTaskRunnerHandle::Get().get(), - data_dir_.GetPath(), /*special_storage_policy=*/nullptr, - CreateAllowFileAccessOptions(), /*env_override=*/nullptr); + data_dir_.GetPath(), data_dir_.GetPath(), + /*special_storage_policy=*/nullptr, CreateAllowFileAccessOptions(), + /*env_override=*/nullptr); } bool IsAccessValid(const FileSystemURL& url) const {
diff --git a/storage/browser/file_system/sandbox_file_system_backend_unittest.cc b/storage/browser/file_system/sandbox_file_system_backend_unittest.cc index 9bd79e4f..e1f98e46 100644 --- a/storage/browser/file_system/sandbox_file_system_backend_unittest.cc +++ b/storage/browser/file_system/sandbox_file_system_backend_unittest.cc
@@ -92,7 +92,7 @@ incognito_env_override_ = leveldb_chrome::NewMemEnv("FileSystem"); delegate_ = std::make_unique<SandboxFileSystemBackendDelegate>( /*quota_manager_proxy=*/nullptr, base::ThreadTaskRunnerHandle::Get(), - data_dir_.GetPath(), + data_dir_.GetPath(), data_dir_.GetPath(), /*special_storage_policy=*/nullptr, options, options.is_in_memory() ? incognito_env_override_.get() : nullptr); }
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc index bf8827b5..e54e9f8e 100644 --- a/storage/browser/quota/quota_database.cc +++ b/storage/browser/quota/quota_database.cc
@@ -801,6 +801,10 @@ db_ = std::make_unique<sql::Database>(sql::DatabaseOptions{ .exclusive_locking = true, + // The quota database is a critical storage component. If it's corrupted, + // all client-side storage APIs fail, because they don't know where their + // data is stored. + .flush_to_media = true, .page_size = 4096, .cache_size = 500, });
diff --git a/storage/browser/test/test_file_system_context.cc b/storage/browser/test/test_file_system_context.cc index b336ceb..74736dd1 100644 --- a/storage/browser/test/test_file_system_context.cc +++ b/storage/browser/test/test_file_system_context.cc
@@ -44,7 +44,7 @@ ExternalMountPoints::CreateRefCounted(), base::MakeRefCounted<MockSpecialStoragePolicy>(), std::move(quota_manager_proxy), std::move(additional_providers), - std::vector<URLRequestAutoMountHandler>(), base_path, + std::vector<URLRequestAutoMountHandler>(), base_path, base_path, CreateAllowFileAccessOptions()); } @@ -61,7 +61,7 @@ ExternalMountPoints::CreateRefCounted(), base::MakeRefCounted<MockSpecialStoragePolicy>(), std::move(quota_manager_proxy), std::move(additional_providers), - auto_mounters, base_path, CreateAllowFileAccessOptions()); + auto_mounters, base_path, base_path, CreateAllowFileAccessOptions()); } scoped_refptr<FileSystemContext> CreateIncognitoFileSystemContextForTesting( @@ -90,7 +90,7 @@ ExternalMountPoints::CreateRefCounted(), base::MakeRefCounted<MockSpecialStoragePolicy>(), std::move(quota_manager_proxy), std::move(additional_providers), - std::vector<URLRequestAutoMountHandler>(), base_path, + std::vector<URLRequestAutoMountHandler>(), base_path, base_path, CreateIncognitoFileSystemOptions()); }
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 42c8bf2d..613b3a0 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -6,64 +6,6 @@ "all" ] }, - "Android WebView P FYI (rel)": { - "gtest_tests": [ - { - "args": [ - "--gs-results-bucket=chromium-result-details", - "--recover-devices", - "--annotation", - "DisabledTest,FlakyTest" - ], - "merge": { - "args": [ - "--bucket", - "chromium-result-details", - "--test-name", - "webview_instrumentation_test_apk" - ], - "script": "//build/android/pylib/results/presentation/test_results_presentation.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "cipd_packages": [ - { - "cipd_package": "infra/tools/luci/logdog/butler/${platform}", - "location": "bin", - "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" - } - ], - "dimension_sets": [ - { - "device_os": "PQ3A.190801.002", - "device_os_flavor": "google", - "device_os_type": "userdebug", - "device_type": "walleye", - "os": "Android" - } - ], - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 12 - }, - "test": "webview_instrumentation_test_apk", - "test_id_prefix": "ninja://android_webview/test:webview_instrumentation_test_apk/" - } - ] - }, "android-10-x86-fyi-rel-tests": { "gtest_tests": [ { @@ -7477,9 +7419,6 @@ ], "junit_tests": [ { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "android_webview_junit_tests", "resultdb": { @@ -7491,9 +7430,6 @@ "test_id_prefix": "ninja://android_webview/test:android_webview_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "base_junit_tests", "resultdb": { @@ -7505,9 +7441,6 @@ "test_id_prefix": "ninja://base:base_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "chrome_java_test_pagecontroller_junit_tests", "resultdb": { @@ -7519,9 +7452,6 @@ "test_id_prefix": "ninja://chrome/test/android:chrome_java_test_pagecontroller_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "chrome_junit_tests", "resultdb": { @@ -7533,9 +7463,6 @@ "test_id_prefix": "ninja://chrome/android:chrome_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "components_junit_tests", "resultdb": { @@ -7547,9 +7474,6 @@ "test_id_prefix": "ninja://components:components_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "content_junit_tests", "resultdb": { @@ -7561,9 +7485,6 @@ "test_id_prefix": "ninja://content/public/android:content_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "device_junit_tests", "resultdb": { @@ -7575,9 +7496,6 @@ "test_id_prefix": "ninja://device:device_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "incremental_javac_junit_tests", "resultdb": { @@ -7589,9 +7507,6 @@ "test_id_prefix": "ninja://build/android/test:incremental_javac_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "junit_unit_tests", "resultdb": { @@ -7603,9 +7518,6 @@ "test_id_prefix": "ninja://testing/android/junit:junit_unit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "keyboard_accessory_junit_tests", "resultdb": { @@ -7617,9 +7529,6 @@ "test_id_prefix": "ninja://chrome/android/features/keyboard_accessory:keyboard_accessory_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "media_base_junit_tests", "resultdb": { @@ -7631,9 +7540,6 @@ "test_id_prefix": "ninja://media/base/android:media_base_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "module_installer_junit_tests", "resultdb": { @@ -7645,9 +7551,6 @@ "test_id_prefix": "ninja://components/module_installer/android:module_installer_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "net_junit_tests", "resultdb": { @@ -7659,9 +7562,6 @@ "test_id_prefix": "ninja://net/android:net_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "paint_preview_junit_tests", "resultdb": { @@ -7673,9 +7573,6 @@ "test_id_prefix": "ninja://components/paint_preview/player/android:paint_preview_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "password_check_junit_tests", "resultdb": { @@ -7687,9 +7584,6 @@ "test_id_prefix": "ninja://chrome/browser/password_check/android:password_check_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "password_manager_junit_tests", "resultdb": { @@ -7701,9 +7595,6 @@ "test_id_prefix": "ninja://chrome/browser/password_manager/android:password_manager_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "services_junit_tests", "resultdb": { @@ -7715,9 +7606,6 @@ "test_id_prefix": "ninja://services:services_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "touch_to_fill_junit_tests", "resultdb": { @@ -7729,9 +7617,6 @@ "test_id_prefix": "ninja://chrome/browser/touch_to_fill/android:touch_to_fill_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "ui_junit_tests", "resultdb": { @@ -7743,9 +7628,6 @@ "test_id_prefix": "ninja://ui/android:ui_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "webapk_client_junit_tests", "resultdb": { @@ -7757,9 +7639,6 @@ "test_id_prefix": "ninja://chrome/android/webapk/libs/client:webapk_client_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "webapk_shell_apk_h2o_junit_tests", "resultdb": { @@ -7771,9 +7650,6 @@ "test_id_prefix": "ninja://chrome/android/webapk/shell_apk:webapk_shell_apk_h2o_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "isolate_profile_data": true, "name": "webapk_shell_apk_junit_tests", "resultdb": { @@ -7785,9 +7661,6 @@ "test_id_prefix": "ninja://chrome/android/webapk/shell_apk:webapk_shell_apk_junit_tests/" }, { - "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android25.textpb" - ], "experiment_percentage": 100, "isolate_profile_data": true, "name": "weblayer_junit_tests",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 9ff8668..5c90a77 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5801,7 +5801,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -5809,14 +5809,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "dimension_sets": [ @@ -5943,7 +5943,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -5951,14 +5951,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "dimension_sets": [
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 1460351..4a0b311 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -85096,7 +85096,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -85104,14 +85104,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -85213,7 +85213,7 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "isolate_profile_data": true, @@ -85221,14 +85221,14 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -86595,21 +86595,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "dimension_sets": [ @@ -86737,21 +86737,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "dimension_sets": [ @@ -88292,21 +88292,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "dimension_sets": [ @@ -88434,21 +88434,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "dimension_sets": [ @@ -89185,21 +89185,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" @@ -89281,21 +89281,21 @@ }, { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome", "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4946.0", + "name": "lacros_chrome_browsertests_run_in_series_Lacros version skew testing ash 101.0.4948.0", "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v101.0.4946.0", - "revision": "version:101.0.4946.0" + "location": "lacros_version_skew_tests_v101.0.4948.0", + "revision": "version:101.0.4948.0" } ], "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com"
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 8f8a639..300c276 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -3629,13 +3629,6 @@ 'android-marshmallow-arm64-rel', ], 'modifications': { - # chromium.android.fyi - 'Android WebView P FYI (rel)': { - 'args': [ - '--annotation', - 'DisabledTest,FlakyTest' # Monitor status of disabled tests. - ], - }, 'Oreo Phone Tester': { # TODO(crbug.com/997362): Enable this once it's passing. # TODO(https://crbug.com/884413): Re-enable this once the tests are
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 75d85827..a72f71a 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -113,7 +113,7 @@ 'resultdb': { 'enable': True, 'result_format': 'single' - } + }, }, }, @@ -995,29 +995,120 @@ }, 'chromium_junit_tests': { - 'android_webview_junit_tests': {}, - 'base_junit_tests': {}, - 'chrome_java_test_pagecontroller_junit_tests': {}, - 'chrome_junit_tests': {}, - 'components_junit_tests': {}, - 'content_junit_tests': {}, - 'device_junit_tests': {}, - 'incremental_javac_junit_tests':{}, - 'junit_unit_tests': {}, - 'keyboard_accessory_junit_tests': {}, - 'media_base_junit_tests': {}, - 'module_installer_junit_tests': {}, - 'net_junit_tests': {}, - 'paint_preview_junit_tests': {}, - 'password_check_junit_tests': {}, - 'password_manager_junit_tests': {}, - 'services_junit_tests': {}, - 'touch_to_fill_junit_tests': {}, - 'ui_junit_tests': {}, - 'webapk_client_junit_tests': {}, - 'webapk_shell_apk_h2o_junit_tests': {}, - 'webapk_shell_apk_junit_tests': {}, + 'android_webview_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'base_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'chrome_java_test_pagecontroller_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'chrome_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'components_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'content_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'device_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'incremental_javac_junit_tests':{ + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'junit_unit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'keyboard_accessory_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'media_base_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'module_installer_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'net_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'paint_preview_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'password_check_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'password_manager_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'services_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'touch_to_fill_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'ui_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'webapk_client_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'webapk_shell_apk_h2o_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, + 'webapk_shell_apk_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], + }, 'weblayer_junit_tests': { + 'remove_mixins': [ + 'nougat-x86-emulator', + ], # Experimental until we're sure these are stable. 'experiment_percentage': 100 },
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 4d6789c..ff0caed 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -28,16 +28,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4946.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v101.0.4948.0/test_ash_chrome', '--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter', ], - 'identifier': 'Lacros version skew testing ash 101.0.4946.0', + 'identifier': 'Lacros version skew testing ash 101.0.4948.0', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v101.0.4946.0', - 'revision': 'version:101.0.4946.0', + 'location': 'lacros_version_skew_tests_v101.0.4948.0', + 'revision': 'version:101.0.4948.0', }, ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index fdd43e5..d3087f3 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1088,18 +1088,6 @@ 'all', ], }, - 'Android WebView P FYI (rel)': { - 'mixins': [ - 'has_native_resultdb_integration', - 'pie_fleet', - 'walleye', - ], - 'test_suites': { - 'gtest_tests': 'webview_bot_instrumentation_test_apk_gtest', - }, - 'use_swarming': True, - 'os_type': 'android', - }, 'android-10-x86-fyi-rel-tests': { 'mixins': [ 'has_native_resultdb_integration',
diff --git a/testing/scripts/run_finch_smoke_tests_android.py b/testing/scripts/run_finch_smoke_tests_android.py index 53255691..1e66be74 100755 --- a/testing/scripts/run_finch_smoke_tests_android.py +++ b/testing/scripts/run_finch_smoke_tests_android.py
@@ -181,7 +181,6 @@ rest_args.extend(['run', self.wpt_product_name(), '--tests=' + wpt_common.TESTS_ROOT_DIR, - '--test-type=' + 'testharness', '--device-serial', self._device.serial, '--webdriver-binary', @@ -423,6 +422,12 @@ def wpt_product_name(cls): return ANDROID_WEBVIEW + @property + def tests(self): + return super(WebViewFinchTestCase, self).tests + [ + 'svg/pservers/reftests/radialgradient-basic-002.svg', + ] + @classmethod def finch_seed_download_args(cls): return [
diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium index 9ce75eaf..c51245c7 100644 --- a/third_party/abseil-cpp/README.chromium +++ b/third_party/abseil-cpp/README.chromium
@@ -4,7 +4,7 @@ License: Apache 2.0 License File: LICENSE Version: 0 -Revision: c5a424a2a21005660b182516eb7a079cd8021699 +Revision: 231c393a170ce3c6d83e8456bc87fe917c333ecf Security Critical: yes Description:
diff --git a/third_party/abseil-cpp/absl/base/config.h b/third_party/abseil-cpp/absl/base/config.h index cd7781c..8c100d8 100644 --- a/third_party/abseil-cpp/absl/base/config.h +++ b/third_party/abseil-cpp/absl/base/config.h
@@ -425,7 +425,7 @@ #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM #error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ - defined(_AIX) || defined(__ros__) || defined(__OpenBSD__) || \ + defined(_AIX) || defined(__ros__) || defined(__OpenBSD__) || \ defined(__NetBSD__) #define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 #endif
diff --git a/third_party/abseil-cpp/absl/base/internal/cycleclock.cc b/third_party/abseil-cpp/absl/base/internal/cycleclock.cc index 0e65005..f6e64242 100644 --- a/third_party/abseil-cpp/absl/base/internal/cycleclock.cc +++ b/third_party/abseil-cpp/absl/base/internal/cycleclock.cc
@@ -25,6 +25,7 @@ #include <atomic> #include <chrono> // NOLINT(build/c++11) +#include "absl/base/attributes.h" #include "absl/base/internal/unscaledcycleclock.h" namespace absl { @@ -33,44 +34,18 @@ #if ABSL_USE_UNSCALED_CYCLECLOCK -namespace { +constexpr int32_t CycleClock::kShift; +constexpr double CycleClock::kFrequencyScale; -#ifdef NDEBUG -#ifdef ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY -// Not debug mode and the UnscaledCycleClock frequency is the CPU -// frequency. Scale the CycleClock to prevent overflow if someone -// tries to represent the time as cycles since the Unix epoch. -static constexpr int32_t kShift = 1; -#else -// Not debug mode and the UnscaledCycleClock isn't operating at the -// raw CPU frequency. There is no need to do any scaling, so don't -// needlessly sacrifice precision. -static constexpr int32_t kShift = 0; -#endif -#else -// In debug mode use a different shift to discourage depending on a -// particular shift value. -static constexpr int32_t kShift = 2; -#endif +ABSL_CONST_INIT std::atomic<CycleClockSourceFunc> + CycleClock::cycle_clock_source_{nullptr}; -static constexpr double kFrequencyScale = 1.0 / (1 << kShift); -static std::atomic<CycleClockSourceFunc> cycle_clock_source; - -CycleClockSourceFunc LoadCycleClockSource() { - // Optimize for the common case (no callback) by first doing a relaxed load; - // this is significantly faster on non-x86 platforms. - if (cycle_clock_source.load(std::memory_order_relaxed) == nullptr) { - return nullptr; - } - // This corresponds to the store(std::memory_order_release) in - // CycleClockSource::Register, and makes sure that any updates made prior to - // registering the callback are visible to this thread before the callback is - // invoked. - return cycle_clock_source.load(std::memory_order_acquire); +void CycleClockSource::Register(CycleClockSourceFunc source) { + // Corresponds to the load(std::memory_order_acquire) in LoadCycleClockSource. + CycleClock::cycle_clock_source_.store(source, std::memory_order_release); } -} // namespace - +#ifdef _WIN32 int64_t CycleClock::Now() { auto fn = LoadCycleClockSource(); if (fn == nullptr) { @@ -78,15 +53,7 @@ } return fn() >> kShift; } - -double CycleClock::Frequency() { - return kFrequencyScale * base_internal::UnscaledCycleClock::Frequency(); -} - -void CycleClockSource::Register(CycleClockSourceFunc source) { - // Corresponds to the load(std::memory_order_acquire) in LoadCycleClockSource. - cycle_clock_source.store(source, std::memory_order_release); -} +#endif #else
diff --git a/third_party/abseil-cpp/absl/base/internal/cycleclock.h b/third_party/abseil-cpp/absl/base/internal/cycleclock.h index a18b5844..9704e38 100644 --- a/third_party/abseil-cpp/absl/base/internal/cycleclock.h +++ b/third_party/abseil-cpp/absl/base/internal/cycleclock.h
@@ -42,14 +42,19 @@ #ifndef ABSL_BASE_INTERNAL_CYCLECLOCK_H_ #define ABSL_BASE_INTERNAL_CYCLECLOCK_H_ +#include <atomic> #include <cstdint> +#include "absl/base/attributes.h" #include "absl/base/config.h" +#include "absl/base/internal/unscaledcycleclock.h" namespace absl { ABSL_NAMESPACE_BEGIN namespace base_internal { +using CycleClockSourceFunc = int64_t (*)(); + // ----------------------------------------------------------------------------- // CycleClock // ----------------------------------------------------------------------------- @@ -68,12 +73,37 @@ static double Frequency(); private: +#if ABSL_USE_UNSCALED_CYCLECLOCK + static CycleClockSourceFunc LoadCycleClockSource(); + +#ifdef NDEBUG +#ifdef ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY + // Not debug mode and the UnscaledCycleClock frequency is the CPU + // frequency. Scale the CycleClock to prevent overflow if someone + // tries to represent the time as cycles since the Unix epoch. + static constexpr int32_t kShift = 1; +#else + // Not debug mode and the UnscaledCycleClock isn't operating at the + // raw CPU frequency. There is no need to do any scaling, so don't + // needlessly sacrifice precision. + static constexpr int32_t kShift = 0; +#endif +#else // NDEBUG + // In debug mode use a different shift to discourage depending on a + // particular shift value. + static constexpr int32_t kShift = 2; +#endif // NDEBUG + + static constexpr double kFrequencyScale = 1.0 / (1 << kShift); + ABSL_CONST_INIT static std::atomic<CycleClockSourceFunc> cycle_clock_source_; +#endif // ABSL_USE_UNSCALED_CYCLECLOC + CycleClock() = delete; // no instances CycleClock(const CycleClock&) = delete; CycleClock& operator=(const CycleClock&) = delete; -}; -using CycleClockSourceFunc = int64_t (*)(); + friend class CycleClockSource; +}; class CycleClockSource { private: @@ -87,6 +117,41 @@ static void Register(CycleClockSourceFunc source); }; +#if ABSL_USE_UNSCALED_CYCLECLOCK + +inline CycleClockSourceFunc CycleClock::LoadCycleClockSource() { +#if !defined(__x86_64__) + // Optimize for the common case (no callback) by first doing a relaxed load; + // this is significantly faster on non-x86 platforms. + if (cycle_clock_source_.load(std::memory_order_relaxed) == nullptr) { + return nullptr; + } +#endif // !defined(__x86_64__) + + // This corresponds to the store(std::memory_order_release) in + // CycleClockSource::Register, and makes sure that any updates made prior to + // registering the callback are visible to this thread before the callback + // is invoked. + return cycle_clock_source_.load(std::memory_order_acquire); +} + +// Accessing globals in inlined code in Window DLLs is problematic. +#ifndef _WIN32 +inline int64_t CycleClock::Now() { + auto fn = LoadCycleClockSource(); + if (fn == nullptr) { + return base_internal::UnscaledCycleClock::Now() >> kShift; + } + return fn() >> kShift; +} +#endif + +inline double CycleClock::Frequency() { + return kFrequencyScale * base_internal::UnscaledCycleClock::Frequency(); +} + +#endif // ABSL_USE_UNSCALED_CYCLECLOCK + } // namespace base_internal ABSL_NAMESPACE_END } // namespace absl
diff --git a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc index 4d352bd1..7b79d19 100644 --- a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +++ b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
@@ -49,12 +49,6 @@ #elif defined(__x86_64__) -int64_t UnscaledCycleClock::Now() { - uint64_t low, high; - __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); - return (high << 32) | low; -} - double UnscaledCycleClock::Frequency() { return base_internal::NominalCPUFrequency(); }
diff --git a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h index 681ff8f..07f867a6 100644 --- a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +++ b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
@@ -115,6 +115,16 @@ friend class base_internal::UnscaledCycleClockWrapperForInitializeFrequency; }; +#if defined(__x86_64__) + +inline int64_t UnscaledCycleClock::Now() { + uint64_t low, high; + __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); + return (high << 32) | low; +} + +#endif + } // namespace base_internal ABSL_NAMESPACE_END } // namespace absl
diff --git a/third_party/abseil-cpp/absl/base/optimization.h b/third_party/abseil-cpp/absl/base/optimization.h index 6fe03c435..db5cc09 100644 --- a/third_party/abseil-cpp/absl/base/optimization.h +++ b/third_party/abseil-cpp/absl/base/optimization.h
@@ -181,32 +181,21 @@ #define ABSL_PREDICT_TRUE(x) (x) #endif -// Platform and compilation mode dependent implementation of ABSL_ASSUME. -#if !defined(NDEBUG) -#define ABSL_INTERNAL_ASSUME(cond) assert(cond) -#elif ABSL_HAVE_BUILTIN(__builtin_assume) -#define ABSL_INTERNAL_ASSUME(cond) __builtin_assume(cond) -#elif defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable) -#define ABSL_INTERNAL_ASSUME(cond) \ - do { \ - if (!(cond)) __builtin_unreachable(); \ - } while (0) -#elif defined(_MSC_VER) -#define ABSL_INTERNAL_ASSUME(cond) __assume(cond) -#else -#define ABSL_INTERNAL_ASSUME(cond) \ - do { \ - static_cast<void>(false && (cond)); \ - } while (0) -#endif - // ABSL_ASSUME(cond) +// // Informs the compiler that a condition is always true and that it can assume -// it to be true for optimization purposes. The call has undefined behavior if -// the condition is false. +// it to be true for optimization purposes. +// +// WARNING: If the condition is false, the program can produce undefined and +// potentially dangerous behavior. +// // In !NDEBUG mode, the condition is checked with an assert(). +// // NOTE: The expression must not have side effects, as it may only be evaluated -// in some compilation modes and not others. +// in some compilation modes and not others. Some compilers may issue a warning +// if the compiler cannot prove the expression has no side effects. For example, +// the expression should not use a function call since the compiler cannot prove +// that a function call does not have side effects. // // Example: // @@ -216,7 +205,23 @@ // // assumption specified above. // int y = x / 16; // -#define ABSL_ASSUME(cond) ABSL_INTERNAL_ASSUME(cond) +#if !defined(NDEBUG) +#define ABSL_ASSUME(cond) assert(cond) +#elif ABSL_HAVE_BUILTIN(__builtin_assume) +#define ABSL_ASSUME(cond) __builtin_assume(cond) +#elif defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable) +#define ABSL_ASSUME(cond) \ + do { \ + if (!(cond)) __builtin_unreachable(); \ + } while (0) +#elif defined(_MSC_VER) +#define ABSL_ASSUME(cond) __assume(cond) +#else +#define ABSL_ASSUME(cond) \ + do { \ + static_cast<void>(false && (cond)); \ + } while (0) +#endif // ABSL_INTERNAL_UNIQUE_SMALL_NAME(cond) // This macro forces small unique name on a static file level symbols like
diff --git a/third_party/abseil-cpp/absl/container/flat_hash_map.h b/third_party/abseil-cpp/absl/container/flat_hash_map.h index 83c7102..13779ed 100644 --- a/third_party/abseil-cpp/absl/container/flat_hash_map.h +++ b/third_party/abseil-cpp/absl/container/flat_hash_map.h
@@ -76,6 +76,10 @@ // absl/hash/hash.h for information on extending Abseil hashing to user-defined // types. // +// Using `absl::flat_hash_map` at interface boundries in dynamically loaded +// libraries (e.g. .dll, .so) is unsupported due to way `absl::Hash` values may +// be randomized across dynamically loaded libraries. +// // NOTE: A `flat_hash_map` stores its value types directly inside its // implementation array to avoid memory indirection. Because a `flat_hash_map` // is designed to move data when rehashed, map values will not retain pointer
diff --git a/third_party/abseil-cpp/absl/container/flat_hash_set.h b/third_party/abseil-cpp/absl/container/flat_hash_set.h index 0fb2ae6f..304c2ab 100644 --- a/third_party/abseil-cpp/absl/container/flat_hash_set.h +++ b/third_party/abseil-cpp/absl/container/flat_hash_set.h
@@ -72,6 +72,10 @@ // absl/hash/hash.h for information on extending Abseil hashing to user-defined // types. // +// Using `absl::flat_hash_set` at interface boundries in dynamically loaded +// libraries (e.g. .dll, .so) is unsupported due to way `absl::Hash` values may +// be randomized across dynamically loaded libraries. +// // NOTE: A `flat_hash_set` stores its keys directly inside its implementation // array to avoid memory indirection. Because a `flat_hash_set` is designed to // move data when rehashed, set keys will not retain pointer stability. If you
diff --git a/third_party/abseil-cpp/absl/container/node_hash_map.h b/third_party/abseil-cpp/absl/container/node_hash_map.h index ca1ed40..f2175d16 100644 --- a/third_party/abseil-cpp/absl/container/node_hash_map.h +++ b/third_party/abseil-cpp/absl/container/node_hash_map.h
@@ -78,6 +78,10 @@ // absl/hash/hash.h for information on extending Abseil hashing to user-defined // types. // +// Using `absl::node_hash_map` at interface boundries in dynamically loaded +// libraries (e.g. .dll, .so) is unsupported due to way `absl::Hash` values may +// be randomized across dynamically loaded libraries. +// // Example: // // // Create a node hash map of three strings (that map to strings)
diff --git a/third_party/abseil-cpp/absl/container/node_hash_set.h b/third_party/abseil-cpp/absl/container/node_hash_set.h index 9421e11..a9ff7e1 100644 --- a/third_party/abseil-cpp/absl/container/node_hash_set.h +++ b/third_party/abseil-cpp/absl/container/node_hash_set.h
@@ -74,6 +74,10 @@ // absl/hash/hash.h for information on extending Abseil hashing to user-defined // types. // +// Using `absl::node_hash_set` at interface boundries in dynamically loaded +// libraries (e.g. .dll, .so) is unsupported due to way `absl::Hash` values may +// be randomized across dynamically loaded libraries. +// // Example: // // // Create a node hash set of three strings
diff --git a/third_party/abseil-cpp/absl/hash/hash.h b/third_party/abseil-cpp/absl/hash/hash.h index f31fde4..74e2d7c 100644 --- a/third_party/abseil-cpp/absl/hash/hash.h +++ b/third_party/abseil-cpp/absl/hash/hash.h
@@ -40,6 +40,11 @@ // each process. E.g., `absl::Hash<int>{}(9)` in one process and // `absl::Hash<int>{}(9)` in another process are likely to differ. // +// `absl::Hash` may also produce different values from different dynamically +// loaded libraries. For this reason, `absl::Hash` values must never cross +// boundries in dynamically loaded libraries (including when used in types like +// hash containers.) +// // `absl::Hash` is intended to strongly mix input bits with a target of passing // an [Avalanche Test](https://en.wikipedia.org/wiki/Avalanche_effect). //
diff --git a/third_party/abseil-cpp/absl/random/internal/generate_real.h b/third_party/abseil-cpp/absl/random/internal/generate_real.h index d5fbb44c..b569450c 100644 --- a/third_party/abseil-cpp/absl/random/internal/generate_real.h +++ b/third_party/abseil-cpp/absl/random/internal/generate_real.h
@@ -50,10 +50,10 @@ // inputs, otherwise it never returns 0. // // When a value in U(0,1) is required, use: -// Uniform64ToReal<double, PositiveValueT, true>; +// GenerateRealFromBits<double, PositiveValueT, true>; // // When a value in U(-1,1) is required, use: -// Uniform64ToReal<double, SignedValueT, false>; +// GenerateRealFromBits<double, SignedValueT, false>; // // This generates more distinct values than the mathematical equivalent // `U(0, 1) * 2.0 - 1.0`.
diff --git a/third_party/abseil-cpp/absl/random/uniform_real_distribution.h b/third_party/abseil-cpp/absl/random/uniform_real_distribution.h index 5ba17b2..1968334 100644 --- a/third_party/abseil-cpp/absl/random/uniform_real_distribution.h +++ b/third_party/abseil-cpp/absl/random/uniform_real_distribution.h
@@ -73,12 +73,12 @@ : lo_(lo), hi_(hi), range_(hi - lo) { // [rand.dist.uni.real] preconditions 2 & 3 assert(lo <= hi); + // NOTE: For integral types, we can promote the range to an unsigned type, // which gives full width of the range. However for real (fp) types, this // is not possible, so value generation cannot use the full range of the // real type. assert(range_ <= (std::numeric_limits<result_type>::max)()); - assert(std::isfinite(range_)); } result_type a() const { return lo_; }
diff --git a/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc b/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc index 035bd284..07f199d 100644 --- a/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc +++ b/third_party/abseil-cpp/absl/random/uniform_real_distribution_test.cc
@@ -78,62 +78,74 @@ GTEST_SKIP() << "Skipping the test because we detected x87 floating-point semantics"; #endif + using DistributionType = absl::uniform_real_distribution<TypeParam>; + using real_type = TypeParam; + using param_type = typename DistributionType::param_type; - using param_type = - typename absl::uniform_real_distribution<TypeParam>::param_type; + constexpr const real_type kMax = std::numeric_limits<real_type>::max(); + constexpr const real_type kMin = std::numeric_limits<real_type>::min(); + constexpr const real_type kEpsilon = + std::numeric_limits<real_type>::epsilon(); + constexpr const real_type kLowest = + std::numeric_limits<real_type>::lowest(); // -max - constexpr const TypeParam a{1152921504606846976}; + const real_type kDenormMax = std::nextafter(kMin, real_type{0}); + const real_type kOneMinusE = + std::nextafter(real_type{1}, real_type{0}); // 1 - epsilon + + constexpr const real_type kTwo60{1152921504606846976}; // 2^60 constexpr int kCount = 1000; absl::InsecureBitGen gen; for (const auto& param : { param_type(), - param_type(TypeParam(2.0), TypeParam(2.0)), // Same - param_type(TypeParam(-0.1), TypeParam(0.1)), - param_type(TypeParam(0.05), TypeParam(0.12)), - param_type(TypeParam(-0.05), TypeParam(0.13)), - param_type(TypeParam(-0.05), TypeParam(-0.02)), + param_type(real_type{0}, real_type{1}), + param_type(real_type(-0.1), real_type(0.1)), + param_type(real_type(0.05), real_type(0.12)), + param_type(real_type(-0.05), real_type(0.13)), + param_type(real_type(-0.05), real_type(-0.02)), + // range = 0 + param_type(real_type(2.0), real_type(2.0)), // Same // double range = 0 // 2^60 , 2^60 + 2^6 - param_type(a, TypeParam(1152921504606847040)), + param_type(kTwo60, real_type(1152921504606847040)), // 2^60 , 2^60 + 2^7 - param_type(a, TypeParam(1152921504606847104)), + param_type(kTwo60, real_type(1152921504606847104)), // double range = 2^8 // 2^60 , 2^60 + 2^8 - param_type(a, TypeParam(1152921504606847232)), + param_type(kTwo60, real_type(1152921504606847232)), // float range = 0 // 2^60 , 2^60 + 2^36 - param_type(a, TypeParam(1152921573326323712)), + param_type(kTwo60, real_type(1152921573326323712)), // 2^60 , 2^60 + 2^37 - param_type(a, TypeParam(1152921642045800448)), + param_type(kTwo60, real_type(1152921642045800448)), // float range = 2^38 // 2^60 , 2^60 + 2^38 - param_type(a, TypeParam(1152921779484753920)), + param_type(kTwo60, real_type(1152921779484753920)), // Limits - param_type(0, std::numeric_limits<TypeParam>::max()), - param_type(std::numeric_limits<TypeParam>::lowest(), 0), - param_type(0, std::numeric_limits<TypeParam>::epsilon()), - param_type(-std::numeric_limits<TypeParam>::epsilon(), - std::numeric_limits<TypeParam>::epsilon()), - param_type(std::numeric_limits<TypeParam>::epsilon(), - 2 * std::numeric_limits<TypeParam>::epsilon()), + param_type(0, kMax), + param_type(kLowest, 0), + param_type(0, kMin), + param_type(0, kEpsilon), + param_type(-kEpsilon, kEpsilon), + param_type(0, kOneMinusE), + param_type(0, kDenormMax), }) { // Validate parameters. const auto a = param.a(); const auto b = param.b(); - absl::uniform_real_distribution<TypeParam> before(a, b); + DistributionType before(a, b); EXPECT_EQ(before.a(), param.a()); EXPECT_EQ(before.b(), param.b()); { - absl::uniform_real_distribution<TypeParam> via_param(param); + DistributionType via_param(param); EXPECT_EQ(via_param, before); } std::stringstream ss; ss << before; - absl::uniform_real_distribution<TypeParam> after(TypeParam(1.0), - TypeParam(3.1)); + DistributionType after(real_type(1.0), real_type(3.1)); EXPECT_NE(before.a(), after.a()); EXPECT_NE(before.b(), after.b()); @@ -168,7 +180,7 @@ } } - if (!std::is_same<TypeParam, long double>::value) { + if (!std::is_same<real_type, long double>::value) { // static_cast<double>(long double) can overflow. std::string msg = absl::StrCat("Range: ", static_cast<double>(sample_min), ", ", static_cast<double>(sample_max)); @@ -182,33 +194,52 @@ #pragma warning(disable:4756) // Constant arithmetic overflow. #endif TYPED_TEST(UniformRealDistributionTest, ViolatesPreconditionsDeathTest) { + using DistributionType = absl::uniform_real_distribution<TypeParam>; + using real_type = TypeParam; + #if GTEST_HAS_DEATH_TEST // Hi < Lo - EXPECT_DEBUG_DEATH( - { absl::uniform_real_distribution<TypeParam> dist(10.0, 1.0); }, ""); + EXPECT_DEBUG_DEATH({ DistributionType dist(10.0, 1.0); }, ""); // Hi - Lo > numeric_limits<>::max() EXPECT_DEBUG_DEATH( { - absl::uniform_real_distribution<TypeParam> dist( - std::numeric_limits<TypeParam>::lowest(), - std::numeric_limits<TypeParam>::max()); + DistributionType dist(std::numeric_limits<real_type>::lowest(), + std::numeric_limits<real_type>::max()); }, ""); + + // kEpsilon guarantees that max + kEpsilon = inf. + const auto kEpsilon = std::nexttoward( + (std::numeric_limits<real_type>::max() - + std::nexttoward(std::numeric_limits<real_type>::max(), 0.0)) / + 2, + std::numeric_limits<real_type>::max()); + EXPECT_DEBUG_DEATH( + { + DistributionType dist(-kEpsilon, std::numeric_limits<real_type>::max()); + }, + ""); + EXPECT_DEBUG_DEATH( + { + DistributionType dist(std::numeric_limits<real_type>::lowest(), + kEpsilon); + }, + ""); + #endif // GTEST_HAS_DEATH_TEST #if defined(NDEBUG) // opt-mode, for invalid parameters, will generate a garbage value, // but should not enter an infinite loop. absl::InsecureBitGen gen; { - absl::uniform_real_distribution<TypeParam> dist(10.0, 1.0); + DistributionType dist(10.0, 1.0); auto x = dist(gen); EXPECT_FALSE(std::isnan(x)) << x; } { - absl::uniform_real_distribution<TypeParam> dist( - std::numeric_limits<TypeParam>::lowest(), - std::numeric_limits<TypeParam>::max()); + DistributionType dist(std::numeric_limits<real_type>::lowest(), + std::numeric_limits<real_type>::max()); auto x = dist(gen); // Infinite result. EXPECT_FALSE(std::isfinite(x)) << x; @@ -220,6 +251,8 @@ #endif TYPED_TEST(UniformRealDistributionTest, TestMoments) { + using DistributionType = absl::uniform_real_distribution<TypeParam>; + constexpr int kSize = 1000000; std::vector<double> values(kSize); @@ -228,7 +261,7 @@ // implementation. absl::random_internal::pcg64_2018_engine rng{0x2B7E151628AED2A6}; - absl::uniform_real_distribution<TypeParam> dist; + DistributionType dist; for (int i = 0; i < kSize; i++) { values[i] = dist(rng); } @@ -242,9 +275,10 @@ } TYPED_TEST(UniformRealDistributionTest, ChiSquaredTest50) { + using DistributionType = absl::uniform_real_distribution<TypeParam>; + using param_type = typename DistributionType::param_type; + using absl::random_internal::kChiSquared; - using param_type = - typename absl::uniform_real_distribution<TypeParam>::param_type; constexpr size_t kTrials = 100000; constexpr int kBuckets = 50; @@ -269,7 +303,7 @@ const double factor = kBuckets / (max_val - min_val); std::vector<int32_t> counts(kBuckets, 0); - absl::uniform_real_distribution<TypeParam> dist(param); + DistributionType dist(param); for (size_t i = 0; i < kTrials; i++) { auto x = dist(rng); auto bucket = static_cast<size_t>((x - min_val) * factor); @@ -297,8 +331,11 @@ } TYPED_TEST(UniformRealDistributionTest, StabilityTest) { + using DistributionType = absl::uniform_real_distribution<TypeParam>; + using real_type = TypeParam; + // absl::uniform_real_distribution stability relies only on - // random_internal::RandU64ToDouble and random_internal::RandU64ToFloat. + // random_internal::GenerateRealFromBits. absl::random_internal::sequence_urbg urbg( {0x0003eb76f6f7f755ull, 0xFFCEA50FDB2F953Bull, 0xC332DDEFBE6C5AA5ull, 0x6558218568AB9702ull, 0x2AEF7DAD5B6E2F84ull, 0x1521B62829076170ull, @@ -307,9 +344,9 @@ std::vector<int> output(12); - absl::uniform_real_distribution<TypeParam> dist; + DistributionType dist; std::generate(std::begin(output), std::end(output), [&] { - return static_cast<int>(TypeParam(1000000) * dist(urbg)); + return static_cast<int>(real_type(1000000) * dist(urbg)); }); EXPECT_THAT(
diff --git a/third_party/abseil-cpp/absl/status/status.h b/third_party/abseil-cpp/absl/status/status.h index 2d003ce..193db8d8 100644 --- a/third_party/abseil-cpp/absl/status/status.h +++ b/third_party/abseil-cpp/absl/status/status.h
@@ -613,10 +613,6 @@ const status_internal::Payloads* GetPayloads() const; status_internal::Payloads* GetPayloads(); - // Takes ownership of payload. - static uintptr_t NewRep( - absl::StatusCode code, absl::string_view msg, - std::unique_ptr<status_internal::Payloads> payload); static bool EqualsSlow(const absl::Status& a, const absl::Status& b); // MSVC 14.0 limitation requires the const.
diff --git a/third_party/abseil-cpp/absl/strings/cord.h b/third_party/abseil-cpp/absl/strings/cord.h index 081b631..5ad4ea0 100644 --- a/third_party/abseil-cpp/absl/strings/cord.h +++ b/third_party/abseil-cpp/absl/strings/cord.h
@@ -768,6 +768,7 @@ // Returns nullptr if holding bytes absl::cord_internal::CordRep* tree() const; absl::cord_internal::CordRep* as_tree() const; + const char* as_chars() const; // Returns non-null iff was holding a pointer absl::cord_internal::CordRep* clear(); // Converts to pointer if necessary. @@ -1094,6 +1095,11 @@ return is_tree() ? nullptr : data_.as_chars(); } +inline const char* Cord::InlineRep::as_chars() const { + assert(!data_.is_tree()); + return data_.as_chars(); +} + inline absl::cord_internal::CordRep* Cord::InlineRep::as_tree() const { assert(data_.is_tree()); return data_.as_tree();
diff --git a/third_party/abseil-cpp/symbols_arm64_dbg.def b/third_party/abseil-cpp/symbols_arm64_dbg.def index a145be6..4ddee91 100644 --- a/third_party/abseil-cpp/symbols_arm64_dbg.def +++ b/third_party/abseil-cpp/symbols_arm64_dbg.def
@@ -1749,7 +1749,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPEAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVDuration@1@AEBV?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@chrono@__1@std@@@Z ?FromChrono@absl@@YA?AVTime@1@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z @@ -1965,6 +1964,7 @@ ?Load@TimeZoneIf@cctz@time_internal@absl@@SA?AV?$unique_ptr@VTimeZoneIf@cctz@time_internal@absl@@U?$default_delete@VTimeZoneIf@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@67@@Z ?Load@TimeZoneInfo@cctz@time_internal@absl@@AEAA_NPEAVZoneInfoSource@234@@Z ?Load@TimeZoneInfo@cctz@time_internal@absl@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z + ?LoadCycleClockSource@CycleClock@base_internal@absl@@CAP6A_JXZXZ ?LoadTimeZone@Impl@time_zone@cctz@time_internal@absl@@SA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEAV2345@@Z ?LocalTime@TimeZoneInfo@cctz@time_internal@absl@@AEBA?AUabsolute_lookup@time_zone@234@_JAEBUTransition@234@@Z ?LocalTime@TimeZoneInfo@cctz@time_internal@absl@@AEBA?AUabsolute_lookup@time_zone@234@_JAEBUTransitionType@234@@Z @@ -2821,6 +2821,7 @@ ?count@FILERawSink@str_format_internal@absl@@QEBA_KXZ ?crc@CordRep@cord_internal@absl@@QEAAPEAUCordRepCrc@23@XZ ?crc@CordRep@cord_internal@absl@@QEBAPEBUCordRepCrc@23@XZ + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?data@?$InlinedVector@H$0CP@V?$allocator@H@__1@std@@@absl@@QEAAPEAHXZ ?data@?$InlinedVector@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QEAAPEAPEAUCordRep@cord_internal@2@XZ ?data@?$InlinedVector@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QEAAPEAPEAUCordRep@cord_internal@2@XZ
diff --git a/third_party/abseil-cpp/symbols_arm64_rel.def b/third_party/abseil-cpp/symbols_arm64_rel.def index 615eba71..04fd94a 100644 --- a/third_party/abseil-cpp/symbols_arm64_rel.def +++ b/third_party/abseil-cpp/symbols_arm64_rel.def
@@ -449,7 +449,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPEAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVTime@1@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z ?FromTM@absl@@YA?AVTime@1@AEBUtm@@VTimeZone@1@@Z @@ -865,6 +864,7 @@ ?code@Status@absl@@QEBA?AW4StatusCode@2@XZ ?cord_btree_exhaustive_validation@cord_internal@absl@@3U?$atomic@_N@__1@std@@A ?cord_ring_buffer_enabled@cord_internal@absl@@3U?$atomic@_N@__1@std@@A + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?day_difference@impl@detail@cctz@time_internal@absl@@YA_J_JCC0CC@Z ?description@time_zone@cctz@time_internal@absl@@QEBA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@XZ ?destroy@?$allocator@UPayload@status_internal@absl@@@__1@std@@QEAAXPEAUPayload@status_internal@absl@@@Z
diff --git a/third_party/abseil-cpp/symbols_x64_dbg.def b/third_party/abseil-cpp/symbols_x64_dbg.def index 6b7ce76..143d703 100644 --- a/third_party/abseil-cpp/symbols_x64_dbg.def +++ b/third_party/abseil-cpp/symbols_x64_dbg.def
@@ -1752,7 +1752,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPEAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVDuration@1@AEBV?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@chrono@__1@std@@@Z ?FromChrono@absl@@YA?AVTime@1@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z @@ -1966,6 +1965,7 @@ ?Load@TimeZoneIf@cctz@time_internal@absl@@SA?AV?$unique_ptr@VTimeZoneIf@cctz@time_internal@absl@@U?$default_delete@VTimeZoneIf@cctz@time_internal@absl@@@__1@std@@@__1@std@@AEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@67@@Z ?Load@TimeZoneInfo@cctz@time_internal@absl@@AEAA_NPEAVZoneInfoSource@234@@Z ?Load@TimeZoneInfo@cctz@time_internal@absl@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z + ?LoadCycleClockSource@CycleClock@base_internal@absl@@CAP6A_JXZXZ ?LoadTimeZone@Impl@time_zone@cctz@time_internal@absl@@SA_NAEBV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PEAV2345@@Z ?LocalTime@TimeZoneInfo@cctz@time_internal@absl@@AEBA?AUabsolute_lookup@time_zone@234@_JAEBUTransition@234@@Z ?LocalTime@TimeZoneInfo@cctz@time_internal@absl@@AEBA?AUabsolute_lookup@time_zone@234@_JAEBUTransitionType@234@@Z @@ -2820,6 +2820,7 @@ ?count@FILERawSink@str_format_internal@absl@@QEBA_KXZ ?crc@CordRep@cord_internal@absl@@QEAAPEAUCordRepCrc@23@XZ ?crc@CordRep@cord_internal@absl@@QEBAPEBUCordRepCrc@23@XZ + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?data@?$InlinedVector@H$0CP@V?$allocator@H@__1@std@@@absl@@QEAAPEAHXZ ?data@?$InlinedVector@PEAUCordRep@cord_internal@absl@@$01V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QEAAPEAPEAUCordRep@cord_internal@2@XZ ?data@?$InlinedVector@PEAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PEAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QEAAPEAPEAUCordRep@cord_internal@2@XZ
diff --git a/third_party/abseil-cpp/symbols_x64_rel.def b/third_party/abseil-cpp/symbols_x64_rel.def index 9f36d1a..cf4155bf 100644 --- a/third_party/abseil-cpp/symbols_x64_rel.def +++ b/third_party/abseil-cpp/symbols_x64_rel.def
@@ -449,7 +449,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPEAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVTime@1@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z ?FromTM@absl@@YA?AVTime@1@AEBUtm@@VTimeZone@1@@Z @@ -600,7 +599,6 @@ ?NotFoundError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?Notify@Notification@absl@@QEAAXXZ ?Now@CycleClock@base_internal@absl@@SA_JXZ - ?Now@UnscaledCycleClock@base_internal@absl@@CA_JXZ ?Now@absl@@YA?AVTime@1@XZ ?NumCPUs@base_internal@absl@@YAHXZ ?OutOfRangeError@absl@@YA?AVStatus@1@Vstring_view@1@@Z @@ -865,6 +863,7 @@ ?code@Status@absl@@QEBA?AW4StatusCode@2@XZ ?cord_btree_exhaustive_validation@cord_internal@absl@@3U?$atomic@_N@__1@std@@A ?cord_ring_buffer_enabled@cord_internal@absl@@3U?$atomic@_N@__1@std@@A + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?day_difference@impl@detail@cctz@time_internal@absl@@YA_J_JCC0CC@Z ?description@time_zone@cctz@time_internal@absl@@QEBA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@XZ ?destroy@?$allocator@UPayload@status_internal@absl@@@__1@std@@QEAAXPEAUPayload@status_internal@absl@@@Z
diff --git a/third_party/abseil-cpp/symbols_x64_rel_asan.def b/third_party/abseil-cpp/symbols_x64_rel_asan.def index 6284693..8e99dda 100644 --- a/third_party/abseil-cpp/symbols_x64_rel_asan.def +++ b/third_party/abseil-cpp/symbols_x64_rel_asan.def
@@ -453,7 +453,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPEAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVTime@1@AEBV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z ?FromTM@absl@@YA?AVTime@1@AEBUtm@@VTimeZone@1@@Z @@ -604,7 +603,6 @@ ?NotFoundError@absl@@YA?AVStatus@1@Vstring_view@1@@Z ?Notify@Notification@absl@@QEAAXXZ ?Now@CycleClock@base_internal@absl@@SA_JXZ - ?Now@UnscaledCycleClock@base_internal@absl@@CA_JXZ ?Now@absl@@YA?AVTime@1@XZ ?NumCPUs@base_internal@absl@@YAHXZ ?OutOfRangeError@absl@@YA?AVStatus@1@Vstring_view@1@@Z @@ -901,6 +899,7 @@ ?code@Status@absl@@QEBA?AW4StatusCode@2@XZ ?cord_btree_exhaustive_validation@cord_internal@absl@@3U?$atomic@_N@__1@std@@A ?cord_ring_buffer_enabled@cord_internal@absl@@3U?$atomic@_N@__1@std@@A + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?day_difference@impl@detail@cctz@time_internal@absl@@YA_J_JCC0CC@Z ?description@time_zone@cctz@time_internal@absl@@QEBA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@XZ ?destroy@?$allocator@UPayload@status_internal@absl@@@__1@std@@QEAAXPEAUPayload@status_internal@absl@@@Z
diff --git a/third_party/abseil-cpp/symbols_x86_dbg.def b/third_party/abseil-cpp/symbols_x86_dbg.def index 03dde24..1e080e5 100644 --- a/third_party/abseil-cpp/symbols_x86_dbg.def +++ b/third_party/abseil-cpp/symbols_x86_dbg.def
@@ -1747,7 +1747,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVDuration@1@ABV?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@chrono@__1@std@@@Z ?FromChrono@absl@@YA?AVTime@1@ABV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z @@ -1961,6 +1960,7 @@ ?Load@TimeZoneIf@cctz@time_internal@absl@@SA?AV?$unique_ptr@VTimeZoneIf@cctz@time_internal@absl@@U?$default_delete@VTimeZoneIf@cctz@time_internal@absl@@@__1@std@@@__1@std@@ABV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@67@@Z ?Load@TimeZoneInfo@cctz@time_internal@absl@@AAE_NPAVZoneInfoSource@234@@Z ?Load@TimeZoneInfo@cctz@time_internal@absl@@QAE_NABV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@@Z + ?LoadCycleClockSource@CycleClock@base_internal@absl@@CAP6A_JXZXZ ?LoadTimeZone@Impl@time_zone@cctz@time_internal@absl@@SA_NABV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@PAV2345@@Z ?LocalTime@TimeZoneInfo@cctz@time_internal@absl@@ABE?AUabsolute_lookup@time_zone@234@_JABUTransition@234@@Z ?LocalTime@TimeZoneInfo@cctz@time_internal@absl@@ABE?AUabsolute_lookup@time_zone@234@_JABUTransitionType@234@@Z @@ -2815,6 +2815,7 @@ ?count@FILERawSink@str_format_internal@absl@@QBEIXZ ?crc@CordRep@cord_internal@absl@@QAEPAUCordRepCrc@23@XZ ?crc@CordRep@cord_internal@absl@@QBEPBUCordRepCrc@23@XZ + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?data@?$InlinedVector@H$0CP@V?$allocator@H@__1@std@@@absl@@QAEPAHXZ ?data@?$InlinedVector@PAUCordRep@cord_internal@absl@@$01V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QAEPAPAUCordRep@cord_internal@2@XZ ?data@?$InlinedVector@PAUCordRep@cord_internal@absl@@$0CP@V?$allocator@PAUCordRep@cord_internal@absl@@@__1@std@@@absl@@QAEPAPAUCordRep@cord_internal@2@XZ
diff --git a/third_party/abseil-cpp/symbols_x86_rel.def b/third_party/abseil-cpp/symbols_x86_rel.def index 2c8dac2..04efb8a 100644 --- a/third_party/abseil-cpp/symbols_x86_rel.def +++ b/third_party/abseil-cpp/symbols_x86_rel.def
@@ -445,7 +445,6 @@ ?FormatTime@absl@@YA?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@Vstring_view@1@VTime@1@VTimeZone@1@@Z ?FormatUntyped@str_format_internal@absl@@YA_NVFormatRawSinkImpl@12@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z ?FprintF@str_format_internal@absl@@YAHPAU_iobuf@@VUntypedFormatSpecImpl@12@V?$Span@$$CBVFormatArgImpl@str_format_internal@absl@@@2@@Z - ?Frequency@CycleClock@base_internal@absl@@SANXZ ?Frequency@UnscaledCycleClock@base_internal@absl@@CANXZ ?FromChrono@absl@@YA?AVTime@1@ABV?$time_point@Vsystem_clock@chrono@__1@std@@V?$duration@_JV?$ratio@$00$0PECEA@@__1@std@@@234@@chrono@__1@std@@@Z ?FromTM@absl@@YA?AVTime@1@ABUtm@@VTimeZone@1@@Z @@ -861,6 +860,7 @@ ?code@Status@absl@@QBE?AW4StatusCode@2@XZ ?cord_btree_exhaustive_validation@cord_internal@absl@@3U?$atomic@_N@__1@std@@A ?cord_ring_buffer_enabled@cord_internal@absl@@3U?$atomic@_N@__1@std@@A + ?cycle_clock_source_@CycleClock@base_internal@absl@@0U?$atomic@P6A_JXZ@__1@std@@A ?day_difference@impl@detail@cctz@time_internal@absl@@YA_J_JCC0CC@Z ?description@time_zone@cctz@time_internal@absl@@QBE?AV?$basic_string@DU?$char_traits@D@__1@std@@V?$allocator@D@23@@__1@std@@XZ ?destroy@?$allocator@UPayload@status_internal@absl@@@__1@std@@QAEXPAUPayload@status_internal@absl@@@Z
diff --git a/third_party/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy b/third_party/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy index b22e8db0..8f0d92b 100644 --- a/third_party/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy +++ b/third_party/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy
@@ -614,13 +614,6 @@ sb.append(' # https://crbug.com/989505\n') sb.append(' jar_excluded_patterns = ["META-INF/proguard/*"]\n') break - case 'androidx_annotation_annotation_experimental': - sb.append('''\ - | # https://crbug.com/1213876 - | deps = - | [ "//third_party/android_deps:org_jetbrains_kotlin_kotlin_stdlib_java" ] - |'''.stripMargin()) - break case 'androidx_core_core': sb.with { append('\n')
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index e8c1c486..1cee901 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -146,10 +146,6 @@ const base::Feature kPath2DPaintCache{"Path2DPaintCache", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enable by default. This feature is for a kill switch. -const base::Feature kLayoutNGBlockInInline{"LayoutNGBlockInInline", - base::FEATURE_ENABLED_BY_DEFAULT}; - const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index 16aa2edf..5dd9fd0 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -50,7 +50,6 @@ BLINK_COMMON_EXPORT extern const base::Feature kDeferredFontShaping; BLINK_COMMON_EXPORT extern const base::Feature kEditingNG; BLINK_COMMON_EXPORT extern const base::Feature kLayoutNG; -BLINK_COMMON_EXPORT extern const base::Feature kLayoutNGBlockInInline; BLINK_COMMON_EXPORT extern const base::Feature kMixedContentAutoupgrade; BLINK_COMMON_EXPORT extern const base::Feature kNavigationPredictor; BLINK_COMMON_EXPORT extern const base::Feature kAnchorElementInteraction;
diff --git a/third_party/blink/public/mojom/direct_sockets/OWNERS b/third_party/blink/public/mojom/direct_sockets/OWNERS index af9a801..6d4613bf 100644 --- a/third_party/blink/public/mojom/direct_sockets/OWNERS +++ b/third_party/blink/public/mojom/direct_sockets/OWNERS
@@ -1,6 +1,7 @@ ericwilligers@chromium.org glenrob@chromium.org mgiuca@chromium.org +greengrape@google.com # Changes to Mojo interfaces require a security review to avoid # introducing new sandbox escapes.
diff --git a/third_party/blink/public/mojom/reporting/reporting.mojom b/third_party/blink/public/mojom/reporting/reporting.mojom index 063f8be7..0cc129dc 100644 --- a/third_party/blink/public/mojom/reporting/reporting.mojom +++ b/third_party/blink/public/mojom/reporting/reporting.mojom
@@ -20,7 +20,7 @@ // Attempts to queue a Deprecation report using the Reporting API. // - // (See //third_party/blink/renderer/core/frame/deprecation_report_body.h.) + // (See //third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h.) QueueDeprecationReport(url.mojom.Url url, string id, mojo_base.mojom.Time? anticipatedRemoval,
diff --git a/third_party/blink/renderer/bindings/core/v8/custom/v8_html_plugin_element_custom.cc b/third_party/blink/renderer/bindings/core/v8/custom/v8_html_plugin_element_custom.cc index 0b98df6..004130f 100644 --- a/third_party/blink/renderer/bindings/core/v8/custom/v8_html_plugin_element_custom.cc +++ b/third_party/blink/renderer/bindings/core/v8/custom/v8_html_plugin_element_custom.cc
@@ -35,7 +35,7 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_html_embed_element.h" #include "third_party/blink/renderer/bindings/core/v8/v8_html_object_element.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/html_embed_element.h" #include "third_party/blink/renderer/core/html/html_object_element.h" #include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
diff --git a/third_party/blink/renderer/bindings/core/v8/custom/v8_window_custom.cc b/third_party/blink/renderer/bindings/core/v8/custom/v8_window_custom.cc index 59635b4e..230101a 100644 --- a/third_party/blink/renderer/bindings/core/v8/custom/v8_window_custom.cc +++ b/third_party/blink/renderer/bindings/core/v8/custom/v8_window_custom.cc
@@ -38,7 +38,6 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_html_collection.h" #include "third_party/blink/renderer/bindings/core/v8/v8_node.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_owner.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/bindings/core/v8/use_counter_callback.cc b/third_party/blink/renderer/bindings/core/v8/use_counter_callback.cc index 94946748..878ba4e 100644 --- a/third_party/blink/renderer/bindings/core/v8/use_counter_callback.cc +++ b/third_party/blink/renderer/bindings/core/v8/use_counter_callback.cc
@@ -7,7 +7,7 @@ #include "third_party/blink/public/common/scheme_registry.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
diff --git a/third_party/blink/renderer/bindings/generated_in_core.gni b/third_party/blink/renderer/bindings/generated_in_core.gni index 3aaaf13..857cf93 100644 --- a/third_party/blink/renderer/bindings/generated_in_core.gni +++ b/third_party/blink/renderer/bindings/generated_in_core.gni
@@ -87,24 +87,24 @@ "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_animation_event_init.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_animation_playback_event_init.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_animation_playback_event_init.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_current_change_event_init.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_current_change_event_init.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event_init.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event_init.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigation_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigation_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_reload_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_reload_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_result.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_result.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_transition.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_transition.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_transition_while_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_transition_while_options.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_update_current_options.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_update_current_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigate_event_init.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigate_event_init.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_current_entry_change_event_init.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_current_entry_change_event_init.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_navigate_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_navigate_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_reload_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_reload_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_result.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_result.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_transition_while_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_transition_while_options.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_transition.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_transition.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_update_current_entry_options.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_update_current_entry_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_assigned_nodes_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_assigned_nodes_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_base_keyframe.cc", @@ -539,20 +539,6 @@ "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_animation_playback_event.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_animation_timeline.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_animation_timeline.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_current_change_event.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_current_change_event.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_destination.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_destination.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_entry.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_entry.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_focus_reset.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_focus_reset.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigation_type.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_app_history_navigation_type.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_attr.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_attr.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_attribution_reporting.cc", @@ -1061,6 +1047,20 @@ "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_mutation_record.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_named_node_map.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_named_node_map.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigate_event.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigate_event.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_current_entry_change_event.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_current_entry_change_event.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_destination.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_destination.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_focus_reset.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_focus_reset.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_history_entry.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_history_entry.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_navigation_type.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation_navigation_type.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigation.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigator.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigator.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_navigator_ua_data.cc",
diff --git a/third_party/blink/renderer/bindings/idl_in_core.gni b/third_party/blink/renderer/bindings/idl_in_core.gni index 49f69daa..ffaab205 100644 --- a/third_party/blink/renderer/bindings/idl_in_core.gni +++ b/third_party/blink/renderer/bindings/idl_in_core.gni
@@ -30,21 +30,6 @@ "//third_party/blink/renderer/core/aom/accessible_node.idl", "//third_party/blink/renderer/core/aom/accessible_node_list.idl", "//third_party/blink/renderer/core/aom/computed_accessible_node.idl", - "//third_party/blink/renderer/core/app_history/app_history.idl", - "//third_party/blink/renderer/core/app_history/app_history_destination.idl", - "//third_party/blink/renderer/core/app_history/app_history_entry.idl", - "//third_party/blink/renderer/core/app_history/app_history_current_change_event.idl", - "//third_party/blink/renderer/core/app_history/app_history_current_change_event_init.idl", - "//third_party/blink/renderer/core/app_history/app_history_navigate_event.idl", - "//third_party/blink/renderer/core/app_history/app_history_navigate_event_init.idl", - "//third_party/blink/renderer/core/app_history/app_history_navigate_options.idl", - "//third_party/blink/renderer/core/app_history/app_history_navigation_options.idl", - "//third_party/blink/renderer/core/app_history/app_history_reload_options.idl", - "//third_party/blink/renderer/core/app_history/app_history_result.idl", - "//third_party/blink/renderer/core/app_history/app_history_transition.idl", - "//third_party/blink/renderer/core/app_history/app_history_transition_while_options.idl", - "//third_party/blink/renderer/core/app_history/app_history_update_current_options.idl", - "//third_party/blink/renderer/core/app_history/window_app_history.idl", "//third_party/blink/renderer/core/clipboard/data_transfer.idl", "//third_party/blink/renderer/core/clipboard/data_transfer_item.idl", "//third_party/blink/renderer/core/clipboard/data_transfer_item_list.idl", @@ -281,7 +266,7 @@ "//third_party/blink/renderer/core/frame/bar_prop.idl", "//third_party/blink/renderer/core/frame/coop_access_violation_report_body.idl", "//third_party/blink/renderer/core/frame/csp/csp_violation_report_body.idl", - "//third_party/blink/renderer/core/frame/deprecation_report_body.idl", + "//third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.idl", "//third_party/blink/renderer/core/frame/directive.idl", "//third_party/blink/renderer/core/frame/document_policy_violation_report_body.idl", "//third_party/blink/renderer/core/frame/external.idl", @@ -511,6 +496,21 @@ "//third_party/blink/renderer/core/mojo/test/mojo_interface_interceptor.idl", "//third_party/blink/renderer/core/mojo/test/mojo_interface_request_event.idl", "//third_party/blink/renderer/core/mojo/test/mojo_interface_request_event_init.idl", + "//third_party/blink/renderer/core/navigation_api/navigate_event_init.idl", + "//third_party/blink/renderer/core/navigation_api/navigate_event.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event_init.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_destination.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_navigate_options.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_options.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_reload_options.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_result.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_transition_while_options.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_transition.idl", + "//third_party/blink/renderer/core/navigation_api/navigation_update_current_entry_options.idl", + "//third_party/blink/renderer/core/navigation_api/navigation.idl", + "//third_party/blink/renderer/core/navigation_api/window_navigation.idl", "//third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.idl", "//third_party/blink/renderer/core/page/color_page_popup_controller.idl", "//third_party/blink/renderer/core/page/page_popup_controller.idl",
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py index e1f0dc5..3effefd 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py
@@ -1373,8 +1373,9 @@ _1 = name node = TextNode(_format(pattern, _1=_1)) node.accumulate( - CodeGenAccumulator.require_include_headers( - ["third_party/blink/renderer/core/frame/deprecation.h"])) + CodeGenAccumulator.require_include_headers([ + "third_party/blink/renderer/core/frame/deprecation/deprecation.h" + ])) return node
diff --git a/third_party/blink/renderer/build/scripts/make_event_factory.py b/third_party/blink/renderer/build/scripts/make_event_factory.py index a7ceb451..02d41f1 100755 --- a/third_party/blink/renderer/build/scripts/make_event_factory.py +++ b/third_party/blink/renderer/build/scripts/make_event_factory.py
@@ -118,7 +118,7 @@ def _headers_header_includes(self, entries): includes = { 'third_party/blink/renderer/core/execution_context/execution_context.h', - 'third_party/blink/renderer/core/frame/deprecation.h', + 'third_party/blink/renderer/core/frame/deprecation/deprecation.h', 'third_party/blink/renderer/platform/instrumentation/use_counter.h', 'third_party/blink/renderer/platform/runtime_enabled_features.h', }
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn index 9c54b5bd..01736c7 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn
@@ -18,7 +18,6 @@ import("//third_party/blink/renderer/core/animation/build.gni") import("//third_party/blink/renderer/core/animation_frame/build.gni") import("//third_party/blink/renderer/core/aom/build.gni") -import("//third_party/blink/renderer/core/app_history/build.gni") import("//third_party/blink/renderer/core/clipboard/build.gni") import("//third_party/blink/renderer/core/content_capture/build.gni") import("//third_party/blink/renderer/core/context_features/build.gni") @@ -48,6 +47,7 @@ import("//third_party/blink/renderer/core/messaging/build.gni") import("//third_party/blink/renderer/core/mobile_metrics/build.gni") import("//third_party/blink/renderer/core/mojo/build.gni") +import("//third_party/blink/renderer/core/navigation_api/build.gni") import("//third_party/blink/renderer/core/offscreencanvas/build.gni") import("//third_party/blink/renderer/core/origin_trials/build.gni") import("//third_party/blink/renderer/core/page/build.gni") @@ -202,7 +202,6 @@ sources += rebase_path(blink_core_sources_animation_frame, "", "animation_frame") sources += rebase_path(blink_core_sources_aom, "", "aom") - sources += rebase_path(blink_core_sources_app_history, "", "app_history") sources += rebase_path(blink_core_sources_clipboard, "", "clipboard") sources += rebase_path(blink_core_sources_content_capture, "", "content_capture") @@ -245,6 +244,8 @@ rebase_path(blink_core_sources_mobile_metrics, "", "mobile_metrics") sources += rebase_path(blink_core_sources_mojo, "", "mojo") sources += + rebase_path(blink_core_sources_navigation_api, "", "navigation_api") + sources += rebase_path(blink_core_sources_offscreencanvas, "", "offscreencanvas") sources += rebase_path(blink_core_sources_origin_trials, "", "origin_trials") sources += rebase_path(blink_core_sources_page, "", "page") @@ -489,8 +490,6 @@ generate_event_interfaces("core_event_interfaces") { sources = [ - "app_history/app_history_current_change_event.idl", - "app_history/app_history_navigate_event.idl", "css/font_face_set_load_event.idl", "css/media_query_list_event.idl", "dom/events/custom_event.idl", @@ -531,6 +530,8 @@ "html/forms/submit_event.idl", "html/track/track_event.idl", "mojo/test/mojo_interface_request_event.idl", + "navigation_api/navigate_event.idl", + "navigation_api/navigation_current_entry_change_event.idl", ] output_file = "core/event_interface_names.json5" @@ -1214,7 +1215,6 @@ testonly = true sources = [ "accessibility/ax_context_test.cc", - "app_history/app_history_test.cc", "clipboard/clipboard_utilities_test.cc", "content_capture/content_capture_test.cc", "css/css_revert_layer_value_test.cc", @@ -1292,7 +1292,7 @@ "frame/csp/csp_source_test.cc", "frame/csp/source_list_directive_test.cc", "frame/csp/trusted_types_directive_test.cc", - "frame/deprecation_report_body_test.cc", + "frame/deprecation/deprecation_report_body_test.cc", "frame/document_loading_rendering_test.cc", "frame/document_policy_violation_report_body_test.cc", "frame/dom_timer_test.cc", @@ -1385,6 +1385,7 @@ "messaging/blink_transferable_message_mojom_traits_test.cc", "messaging/message_port_descriptor_mojom_traits_test.cc", "mobile_metrics/mobile_friendliness_checker_test.cc", + "navigation_api/navigation_api_test.cc", "origin_trials/origin_trial_context_test.cc", "page/autoscroll_controller_test.cc", "page/chrome_client_impl_test.cc",
diff --git a/third_party/blink/renderer/core/animation/animation_input_helpers.cc b/third_party/blink/renderer/core/animation/animation_input_helpers.cc index 75bba302..fc15e48 100644 --- a/third_party/blink/renderer/core/animation/animation_input_helpers.cc +++ b/third_party/blink/renderer/core/animation/animation_input_helpers.cc
@@ -10,7 +10,6 @@ #include "third_party/blink/renderer/core/css/parser/css_variable_parser.h" #include "third_party/blink/renderer/core/css/resolver/css_to_style_map.h" #include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/svg/animation/svg_smil_element.h" #include "third_party/blink/renderer/core/svg/svg_element.h" #include "third_party/blink/renderer/core/svg_names.h"
diff --git a/third_party/blink/renderer/core/app_history/app_history.idl b/third_party/blink/renderer/core/app_history/app_history.idl deleted file mode 100644 index 7e73dbe6..0000000 --- a/third_party/blink/renderer/core/app_history/app_history.idl +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright 2021 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. - -// https://github.com/WICG/app-history/ -[ - Exposed=Window, - RuntimeEnabled=AppHistory -] interface AppHistory : EventTarget { - readonly attribute AppHistoryEntry? currentEntry; - sequence<AppHistoryEntry> entries(); - [RaisesException, MeasureAs=AppHistory] void updateCurrentEntry(AppHistoryUpdateCurrentOptions options); - readonly attribute AppHistoryTransition? transition; - - readonly attribute boolean canGoBack; - readonly attribute boolean canGoForward; - - [CallWith=ScriptState, MeasureAs=AppHistory] AppHistoryResult navigate(USVString url, optional AppHistoryNavigateOptions options = {}); - [CallWith=ScriptState, MeasureAs=AppHistory] AppHistoryResult reload(optional AppHistoryReloadOptions options = {}); - - [CallWith=ScriptState, MeasureAs=AppHistory] AppHistoryResult traverseTo(DOMString key, optional AppHistoryNavigationOptions options = {}); - [CallWith=ScriptState, MeasureAs=AppHistory] AppHistoryResult back(optional AppHistoryNavigationOptions options = {}); - [CallWith=ScriptState, MeasureAs=AppHistory] AppHistoryResult forward(optional AppHistoryNavigationOptions options = {}); - - attribute EventHandler onnavigate; - attribute EventHandler onnavigatesuccess; - attribute EventHandler onnavigateerror; - attribute EventHandler oncurrententrychange; -};
diff --git a/third_party/blink/renderer/core/app_history/app_history_current_change_event.cc b/third_party/blink/renderer/core/app_history/app_history_current_change_event.cc deleted file mode 100644 index 7708ed1f..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_current_change_event.cc +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2021 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 "third_party/blink/renderer/core/app_history/app_history_current_change_event.h" - -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_current_change_event_init.h" -#include "third_party/blink/renderer/core/app_history/app_history_entry.h" -#include "third_party/blink/renderer/core/event_interface_names.h" - -namespace blink { - -AppHistoryCurrentChangeEvent::AppHistoryCurrentChangeEvent( - const AtomicString& type, - AppHistoryCurrentChangeEventInit* init) - : Event(type, init), from_(init->from()) { - if (init->navigationType()) - navigation_type_ = *init->navigationType(); -} - -const AtomicString& AppHistoryCurrentChangeEvent::InterfaceName() const { - return event_interface_names::kAppHistoryCurrentChangeEvent; -} - -void AppHistoryCurrentChangeEvent::Trace(Visitor* visitor) const { - Event::Trace(visitor); - visitor->Trace(from_); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/app_history/app_history_current_change_event.h b/third_party/blink/renderer/core/app_history/app_history_current_change_event.h deleted file mode 100644 index 18644fe..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_current_change_event.h +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_CURRENT_CHANGE_EVENT_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_CURRENT_CHANGE_EVENT_H_ - -#include "third_party/blink/renderer/core/dom/events/event.h" -#include "third_party/blink/renderer/platform/heap/member.h" -#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" - -namespace blink { -class AppHistoryCurrentChangeEventInit; -class AppHistoryEntry; - -class AppHistoryCurrentChangeEvent final : public Event { - DEFINE_WRAPPERTYPEINFO(); - - public: - static AppHistoryCurrentChangeEvent* Create( - const AtomicString& type, - AppHistoryCurrentChangeEventInit* init) { - return MakeGarbageCollected<AppHistoryCurrentChangeEvent>(type, init); - } - - AppHistoryCurrentChangeEvent(const AtomicString& type, - AppHistoryCurrentChangeEventInit* init); - - String navigationType() { return navigation_type_; } - AppHistoryEntry* from() { return from_; } - - const AtomicString& InterfaceName() const final; - void Trace(Visitor* visitor) const final; - - private: - String navigation_type_; - Member<AppHistoryEntry> from_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_CURRENT_CHANGE_EVENT_H_
diff --git a/third_party/blink/renderer/core/app_history/app_history_current_change_event.idl b/third_party/blink/renderer/core/app_history/app_history_current_change_event.idl deleted file mode 100644 index 6f75e67..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_current_change_event.idl +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright 2021 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. - -// https://github.com/WICG/app-history/ -[ - Exposed=Window, - RuntimeEnabled=AppHistory -] interface AppHistoryCurrentChangeEvent : Event { - constructor(DOMString type, AppHistoryCurrentChangeEventInit eventInit); - readonly attribute AppHistoryNavigationType? navigationType; - readonly attribute AppHistoryEntry from; -};
diff --git a/third_party/blink/renderer/core/app_history/app_history_current_change_event_init.idl b/third_party/blink/renderer/core/app_history/app_history_current_change_event_init.idl deleted file mode 100644 index eb3fa51..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_current_change_event_init.idl +++ /dev/null
@@ -1,9 +0,0 @@ -// Copyright 2021 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. - -// https://github.com/WICG/app-history/ -dictionary AppHistoryCurrentChangeEventInit : EventInit { - AppHistoryNavigationType? navigationType = null; - required AppHistoryEntry from; -};
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_event.idl b/third_party/blink/renderer/core/app_history/app_history_navigate_event.idl deleted file mode 100644 index 8787f0f..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_event.idl +++ /dev/null
@@ -1,22 +0,0 @@ -// Copyright 2021 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. - -// https://github.com/WICG/app-history/ -[ - Exposed=Window, - RuntimeEnabled=AppHistory -] interface AppHistoryNavigateEvent : Event { - [CallWith=ExecutionContext] constructor(DOMString type, AppHistoryNavigateEventInit eventInit); - - readonly attribute AppHistoryNavigationType navigationType; - readonly attribute AppHistoryDestination destination; - readonly attribute boolean canTransition; - readonly attribute boolean userInitiated; - readonly attribute boolean hashChange; - readonly attribute AbortSignal signal; - readonly attribute FormData? formData; - readonly attribute any info; - - [CallWith=ScriptState, RaisesException] void transitionWhile(Promise<void> newNavigationAction, optional AppHistoryTransitionWhileOptions options = {}); -};
diff --git a/third_party/blink/renderer/core/app_history/app_history_result.idl b/third_party/blink/renderer/core/app_history/app_history_result.idl deleted file mode 100644 index c218e5957..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_result.idl +++ /dev/null
@@ -1,9 +0,0 @@ -// Copyright 2021 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. - -// https://github.com/WICG/app-history/ -dictionary AppHistoryResult { - Promise<AppHistoryEntry> committed; - Promise<AppHistoryEntry> finished; -};
diff --git a/third_party/blink/renderer/core/app_history/app_history_transition.idl b/third_party/blink/renderer/core/app_history/app_history_transition.idl deleted file mode 100644 index e1aac5b..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_transition.idl +++ /dev/null
@@ -1,9 +0,0 @@ -[Exposed=Window, - RuntimeEnabled=AppHistory] -interface AppHistoryTransition { - readonly attribute AppHistoryNavigationType navigationType; - readonly attribute AppHistoryEntry from; - [CallWith=ScriptState] readonly attribute Promise<void> finished; - - // AppHistoryResult rollback(optional AppHistoryNavigationOptions options = {}); -};
diff --git a/third_party/blink/renderer/core/app_history/app_history_transition_while_options.idl b/third_party/blink/renderer/core/app_history/app_history_transition_while_options.idl deleted file mode 100644 index da5600b1..0000000 --- a/third_party/blink/renderer/core/app_history/app_history_transition_while_options.idl +++ /dev/null
@@ -1,8 +0,0 @@ -dictionary AppHistoryTransitionWhileOptions { - AppHistoryFocusReset focusReset; -}; - -enum AppHistoryFocusReset { - "after-transition", - "manual" -};
diff --git a/third_party/blink/renderer/core/app_history/build.gni b/third_party/blink/renderer/core/app_history/build.gni deleted file mode 100644 index 918b64c..0000000 --- a/third_party/blink/renderer/core/app_history/build.gni +++ /dev/null
@@ -1,19 +0,0 @@ -# Copyright 2021 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. - -blink_core_sources_app_history = [ - "app_history.cc", - "app_history.h", - "app_history_api_navigation.cc", - "app_history_api_navigation.h", - "app_history_current_change_event.cc", - "app_history_current_change_event.h", - "app_history_destination.h", - "app_history_entry.cc", - "app_history_entry.h", - "app_history_navigate_event.cc", - "app_history_navigate_event.h", - "app_history_transition.cc", - "app_history_transition.h", -]
diff --git a/third_party/blink/renderer/core/app_history/window_app_history.idl b/third_party/blink/renderer/core/app_history/window_app_history.idl deleted file mode 100644 index 7a580c9a..0000000 --- a/third_party/blink/renderer/core/app_history/window_app_history.idl +++ /dev/null
@@ -1,10 +0,0 @@ -// Copyright 2021 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. - -// https://github.com/WICG/app-history/ -[ - ImplementedAs=AppHistory -] partial interface Window { - [RuntimeEnabled=AppHistory, Replaceable] readonly attribute AppHistory navigation; -};
diff --git a/third_party/blink/renderer/core/css/css.dict b/third_party/blink/renderer/core/css/css.dict index f957f19..ee9304a 100644 --- a/third_party/blink/renderer/core/css/css.dict +++ b/third_party/blink/renderer/core/css/css.dict
@@ -190,6 +190,7 @@ "activecaption" "appworkspace" "background" +"buttonborder" "buttonface" "buttonhighlight" "buttonshadow"
diff --git a/third_party/blink/renderer/core/css/css_style_sheet.cc b/third_party/blink/renderer/core/css/css_style_sheet.cc index 5b87a0d..7c28a38 100644 --- a/third_party/blink/renderer/core/css/css_style_sheet.cc +++ b/third_party/blink/renderer/core/css/css_style_sheet.cc
@@ -37,7 +37,6 @@ #include "third_party/blink/renderer/core/css/style_sheet_contents.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/node.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/html_link_element.h" #include "third_party/blink/renderer/core/html/html_style_element.h"
diff --git a/third_party/blink/renderer/core/css/css_value_keywords.json5 b/third_party/blink/renderer/core/css/css_value_keywords.json5 index 14ac860c..a24d5ce 100644 --- a/third_party/blink/renderer/core/css/css_value_keywords.json5 +++ b/third_party/blink/renderer/core/css/css_value_keywords.json5
@@ -195,6 +195,7 @@ "activetext", "appworkspace", "background", + "buttonborder", "buttonface", "buttonhighlight", "buttonshadow",
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_context.cc b/third_party/blink/renderer/core/css/parser/css_parser_context.cc index 16de152..7f1d934e 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_context.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_context.cc
@@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/css/style_sheet_contents.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/html/html_document.h"
diff --git a/third_party/blink/renderer/core/css/parser/css_selector_parser.cc b/third_party/blink/renderer/core/css/parser/css_selector_parser.cc index f1c3eb4..b37c2d73 100644 --- a/third_party/blink/renderer/core/css/parser/css_selector_parser.cc +++ b/third_party/blink/renderer/core/css/parser/css_selector_parser.cc
@@ -14,7 +14,7 @@ #include "third_party/blink/renderer/core/css/parser/css_parser_token_stream.h" #include "third_party/blink/renderer/core/css/style_sheet_contents.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
diff --git a/third_party/blink/renderer/core/css/resolver/css_to_style_map.cc b/third_party/blink/renderer/core/css/resolver/css_to_style_map.cc index 42965afc..c30485b9 100644 --- a/third_party/blink/renderer/core/css/resolver/css_to_style_map.cc +++ b/third_party/blink/renderer/core/css/resolver/css_to_style_map.cc
@@ -41,7 +41,6 @@ #include "third_party/blink/renderer/core/css/resolver/style_builder_converter.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver_state.h" #include "third_party/blink/renderer/core/css_value_keywords.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/style/border_image_length_box.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/style/fill_layer.h"
diff --git a/third_party/blink/renderer/core/css/resolver/font_style_resolver.h b/third_party/blink/renderer/core/css/resolver/font_style_resolver.h index 7cc6d35..56d505c 100644 --- a/third_party/blink/renderer/core/css/resolver/font_style_resolver.h +++ b/third_party/blink/renderer/core/css/resolver/font_style_resolver.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_FONT_STYLE_RESOLVER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_FONT_STYLE_RESOLVER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_primitive_value_mappings.h" #include "third_party/blink/renderer/core/css/css_property_value_set.h" #include "third_party/blink/renderer/core/css/css_value_id_mappings.h"
diff --git a/third_party/blink/renderer/core/css/resolver/match_result.h b/third_party/blink/renderer/core/css/resolver/match_result.h index d7ef225..8b18f58 100644 --- a/third_party/blink/renderer/core/css/resolver/match_result.h +++ b/third_party/blink/renderer/core/css/resolver/match_result.h
@@ -25,6 +25,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_MATCH_RESULT_H_ #include "base/memory/scoped_refptr.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/cascade_layer_map.h" #include "third_party/blink/renderer/core/css/resolver/cascade_expansion.h" #include "third_party/blink/renderer/core/css/resolver/cascade_filter.h"
diff --git a/third_party/blink/renderer/core/css/resolver/matched_properties_cache.h b/third_party/blink/renderer/core/css/resolver/matched_properties_cache.h index f0100af..e4098dd 100644 --- a/third_party/blink/renderer/core/css/resolver/matched_properties_cache.h +++ b/third_party/blink/renderer/core/css/resolver/matched_properties_cache.h
@@ -24,6 +24,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_MATCHED_PROPERTIES_CACHE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_MATCHED_PROPERTIES_CACHE_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_property_value_set.h" #include "third_party/blink/renderer/core/css/resolver/match_result.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
diff --git a/third_party/blink/renderer/core/css/resolver/media_query_result.h b/third_party/blink/renderer/core/css/resolver/media_query_result.h index 6793e401..489cfe7 100644 --- a/third_party/blink/renderer/core/css/resolver/media_query_result.h +++ b/third_party/blink/renderer/core/css/resolver/media_query_result.h
@@ -24,6 +24,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_MEDIA_QUERY_RESULT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_MEDIA_QUERY_RESULT_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/media_query_exp.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h b/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h index 142a119..2e1bd2e 100644 --- a/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h +++ b/third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h
@@ -29,6 +29,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_SCOPED_STYLE_RESOLVER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_SCOPED_STYLE_RESOLVER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/active_style_sheets.h" #include "third_party/blink/renderer/core/css/element_rule_collector.h" #include "third_party/blink/renderer/core/css/rule_set.h"
diff --git a/third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h b/third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h index 4168829..3da2b98 100644 --- a/third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h +++ b/third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_SELECTOR_FILTER_PARENT_SCOPE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_SELECTOR_FILTER_PARENT_SCOPE_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver.h" #include "third_party/blink/renderer/core/css/selector_filter.h" #include "third_party/blink/renderer/core/dom/document.h"
diff --git a/third_party/blink/renderer/core/css/resolver/style_cascade.h b/third_party/blink/renderer/core/css/resolver/style_cascade.h index 18cd4df5..7520dbb 100644 --- a/third_party/blink/renderer/core/css/resolver/style_cascade.h +++ b/third_party/blink/renderer/core/css/resolver/style_cascade.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_STYLE_CASCADE_H_ #include "third_party/blink/renderer/core/animation/interpolation.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_property_name.h" #include "third_party/blink/renderer/core/css/css_property_value.h" #include "third_party/blink/renderer/core/css/parser/css_parser_token.h"
diff --git a/third_party/blink/renderer/core/css/selector_checker.h b/third_party/blink/renderer/core/css/selector_checker.h index 2c2398a..9f2a4ed 100644 --- a/third_party/blink/renderer/core/css/selector_checker.h +++ b/third_party/blink/renderer/core/css/selector_checker.h
@@ -31,6 +31,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_SELECTOR_CHECKER_H_ #include "base/dcheck_is_on.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_selector.h" #include "third_party/blink/renderer/core/css/style_request.h" #include "third_party/blink/renderer/core/dom/element.h"
diff --git a/third_party/blink/renderer/core/css/selector_filter.h b/third_party/blink/renderer/core/css/selector_filter.h index 61f2004f..6ce9f6d 100644 --- a/third_party/blink/renderer/core/css/selector_filter.h +++ b/third_party/blink/renderer/core/css/selector_filter.h
@@ -33,6 +33,7 @@ #include <memory> +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/platform/wtf/bloom_filter.h" #include "third_party/blink/renderer/platform/wtf/vector.h"
diff --git a/third_party/blink/renderer/core/css/selector_query.h b/third_party/blink/renderer/core/css/selector_query.h index 46f3265b..1b51aea9b 100644 --- a/third_party/blink/renderer/core/css/selector_query.h +++ b/third_party/blink/renderer/core/css/selector_query.h
@@ -29,6 +29,7 @@ #include <memory> +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_selector_list.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h"
diff --git a/third_party/blink/renderer/core/css/style_color.cc b/third_party/blink/renderer/core/css/style_color.cc index f270d8e6..9a82104 100644 --- a/third_party/blink/renderer/core/css/style_color.cc +++ b/third_party/blink/renderer/core/css/style_color.cc
@@ -73,13 +73,14 @@ bool StyleColor::IsSystemColor(CSSValueID id) { switch (id) { - // ButtonBorder, SelectedItem, SelectedItemText, Mark, MarkText not + // SelectedItem, SelectedItemText, Mark, MarkText not // understood yet. case CSSValueID::kCanvas: case CSSValueID::kCanvastext: case CSSValueID::kLinktext: case CSSValueID::kVisitedtext: case CSSValueID::kActivetext: + case CSSValueID::kButtonborder: case CSSValueID::kButtonface: case CSSValueID::kButtontext: case CSSValueID::kField:
diff --git a/third_party/blink/renderer/core/css/style_element.h b/third_party/blink/renderer/core/css/style_element.h index 4ffa573..2333d3b8 100644 --- a/third_party/blink/renderer/core/css/style_element.h +++ b/third_party/blink/renderer/core/css/style_element.h
@@ -21,6 +21,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_ELEMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_ELEMENT_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_style_sheet.h" #include "third_party/blink/renderer/core/css/pending_sheet_type.h" #include "third_party/blink/renderer/platform/wtf/text/text_position.h"
diff --git a/third_party/blink/renderer/core/css/style_invalidation_root.h b/third_party/blink/renderer/core/css/style_invalidation_root.h index 8d63665..ac83ec4 100644 --- a/third_party/blink/renderer/core/css/style_invalidation_root.h +++ b/third_party/blink/renderer/core/css/style_invalidation_root.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_INVALIDATION_ROOT_H_ #include "base/dcheck_is_on.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/style_traversal_root.h" namespace blink {
diff --git a/third_party/blink/renderer/core/css/style_recalc_root.h b/third_party/blink/renderer/core/css/style_recalc_root.h index c6755c4..4c0226b4 100644 --- a/third_party/blink/renderer/core/css/style_recalc_root.h +++ b/third_party/blink/renderer/core/css/style_recalc_root.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RECALC_ROOT_H_ #include "base/dcheck_is_on.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/style_traversal_root.h" namespace blink {
diff --git a/third_party/blink/renderer/core/css/style_rule_counter_style.h b/third_party/blink/renderer/core/css/style_rule_counter_style.h index e8b70c1..b4ad894 100644 --- a/third_party/blink/renderer/core/css/style_rule_counter_style.h +++ b/third_party/blink/renderer/core/css/style_rule_counter_style.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_COUNTER_STYLE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_COUNTER_STYLE_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/parser/at_rule_descriptors.h" #include "third_party/blink/renderer/core/css/style_rule.h"
diff --git a/third_party/blink/renderer/core/css/style_rule_font_palette_values.h b/third_party/blink/renderer/core/css/style_rule_font_palette_values.h index 2303347..1137d01 100644 --- a/third_party/blink/renderer/core/css/style_rule_font_palette_values.h +++ b/third_party/blink/renderer/core/css/style_rule_font_palette_values.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_FONT_PALETTE_VALUES_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_RULE_FONT_PALETTE_VALUES_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/parser/at_rule_descriptors.h" #include "third_party/blink/renderer/core/css/style_rule.h"
diff --git a/third_party/blink/renderer/core/css/style_sheet_list.h b/third_party/blink/renderer/core/css/style_sheet_list.h index ea515e7..2bbe0ee 100644 --- a/third_party/blink/renderer/core/css/style_sheet_list.h +++ b/third_party/blink/renderer/core/css/style_sheet_list.h
@@ -21,6 +21,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_SHEET_LIST_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_STYLE_SHEET_LIST_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_style_sheet.h" #include "third_party/blink/renderer/core/dom/tree_scope.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
diff --git a/third_party/blink/renderer/core/display_lock/OWNERS b/third_party/blink/renderer/core/display_lock/OWNERS index 9ec5de0..8cd5aaba 100644 --- a/third_party/blink/renderer/core/display_lock/OWNERS +++ b/third_party/blink/renderer/core/display_lock/OWNERS
@@ -1,2 +1,3 @@ chrishtr@chromium.org +jarhar@chromium.org vmpstr@chromium.org
diff --git a/third_party/blink/renderer/core/dom/comment.h b/third_party/blink/renderer/core/dom/comment.h index 152bb11..92cfc0e 100644 --- a/third_party/blink/renderer/core/dom/comment.h +++ b/third_party/blink/renderer/core/dom/comment.h
@@ -23,6 +23,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_COMMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_COMMENT_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/character_data.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h b/third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h index 959c9f1f..0980b60 100644 --- a/third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h +++ b/third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_ADD_EVENT_LISTENER_OPTIONS_RESOLVED_H_ #include "third_party/blink/renderer/bindings/core/v8/v8_add_event_listener_options.h" +#include "third_party/blink/renderer/core/core_export.h" namespace blink {
diff --git a/third_party/blink/renderer/core/dom/events/event.cc b/third_party/blink/renderer/core/dom/events/event.cc index d623aa0..b09ab62 100644 --- a/third_party/blink/renderer/core/dom/events/event.cc +++ b/third_party/blink/renderer/core/dom/events/event.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/renderer/core/events/mouse_event.h" #include "third_party/blink/renderer/core/events/pointer_event.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/svg/svg_element.h"
diff --git a/third_party/blink/renderer/core/dom/events/event_dispatcher.cc b/third_party/blink/renderer/core/dom/events/event_dispatcher.cc index dc270dc..9d57501 100644 --- a/third_party/blink/renderer/core/dom/events/event_dispatcher.cc +++ b/third_party/blink/renderer/core/dom/events/event_dispatcher.cc
@@ -45,7 +45,6 @@ #include "third_party/blink/renderer/core/events/simulated_event_util.h" #include "third_party/blink/renderer/core/events/text_event.h" #include "third_party/blink/renderer/core/frame/ad_tracker.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h"
diff --git a/third_party/blink/renderer/core/dom/events/event_queue.h b/third_party/blink/renderer/core/dom/events/event_queue.h index 99cdcb1..12f7fe8e 100644 --- a/third_party/blink/renderer/core/dom/events/event_queue.h +++ b/third_party/blink/renderer/core/dom/events/event_queue.h
@@ -29,6 +29,7 @@ #include "base/location.h" #include "third_party/blink/public/platform/task_type.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" #include "third_party/blink/renderer/platform/wtf/linked_hash_set.h"
diff --git a/third_party/blink/renderer/core/dom/events/event_target_impl.h b/third_party/blink/renderer/core/dom/events/event_target_impl.h index 99842712..a4ca826 100644 --- a/third_party/blink/renderer/core/dom/events/event_target_impl.h +++ b/third_party/blink/renderer/core/dom/events/event_target_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_EVENT_TARGET_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_EVENT_TARGET_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/events/event_target.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
diff --git a/third_party/blink/renderer/core/dom/events/native_event_listener.h b/third_party/blink/renderer/core/dom/events/native_event_listener.h index 31ae554d..688f135 100644 --- a/third_party/blink/renderer/core/dom/events/native_event_listener.h +++ b/third_party/blink/renderer/core/dom/events/native_event_listener.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_NATIVE_EVENT_LISTENER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_NATIVE_EVENT_LISTENER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/events/event_listener.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/dom/first_letter_pseudo_element.h b/third_party/blink/renderer/core/dom/first_letter_pseudo_element.h index 55a2842..7a5cfe1 100644 --- a/third_party/blink/renderer/core/dom/first_letter_pseudo_element.h +++ b/third_party/blink/renderer/core/dom/first_letter_pseudo_element.h
@@ -25,6 +25,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_FIRST_LETTER_PSEUDO_ELEMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_FIRST_LETTER_PSEUDO_ELEMENT_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/dom/processing_instruction.h b/third_party/blink/renderer/core/dom/processing_instruction.h index dbb8922..0ba5603 100644 --- a/third_party/blink/renderer/core/dom/processing_instruction.h +++ b/third_party/blink/renderer/core/dom/processing_instruction.h
@@ -22,6 +22,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_PROCESSING_INSTRUCTION_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_PROCESSING_INSTRUCTION_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/character_data.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_client.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h b/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h index 1d38f2f..94d9c2e 100644 --- a/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h +++ b/third_party/blink/renderer/core/dom/scripted_idle_task_controller.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_SCRIPTED_IDLE_TASK_CONTROLLER_H_ #include "third_party/blink/renderer/bindings/core/v8/v8_idle_request_callback.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/idle_deadline.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_state_observer.h" #include "third_party/blink/renderer/core/probe/async_task_context.h"
diff --git a/third_party/blink/renderer/core/dom/tree_scope_adopter.h b/third_party/blink/renderer/core/dom/tree_scope_adopter.h index da85497..219b81da 100644 --- a/third_party/blink/renderer/core/dom/tree_scope_adopter.h +++ b/third_party/blink/renderer/core/dom/tree_scope_adopter.h
@@ -28,6 +28,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_TREE_SCOPE_ADOPTER_H_ #include "base/dcheck_is_on.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/node.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/apply_block_element_command.h b/third_party/blink/renderer/core/editing/commands/apply_block_element_command.h index b3e833c1..9f0d97ffd 100644 --- a/third_party/blink/renderer/core/editing/commands/apply_block_element_command.h +++ b/third_party/blink/renderer/core/editing/commands/apply_block_element_command.h
@@ -31,6 +31,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_APPLY_BLOCK_ELEMENT_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_APPLY_BLOCK_ELEMENT_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/qualified_name.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h"
diff --git a/third_party/blink/renderer/core/editing/commands/apply_style_command.h b/third_party/blink/renderer/core/editing/commands/apply_style_command.h index 7b4506a3..f5dba8b 100644 --- a/third_party/blink/renderer/core/editing/commands/apply_style_command.h +++ b/third_party/blink/renderer/core/editing/commands/apply_style_command.h
@@ -27,6 +27,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_APPLY_STYLE_COMMAND_H_ #include "mojo/public/mojom/base/text_direction.mojom-blink-forward.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h" #include "third_party/blink/renderer/core/html/html_element.h"
diff --git a/third_party/blink/renderer/core/editing/commands/delete_selection_command.h b/third_party/blink/renderer/core/editing/commands/delete_selection_command.h index 7e8cc39..b9565e0 100644 --- a/third_party/blink/renderer/core/editing/commands/delete_selection_command.h +++ b/third_party/blink/renderer/core/editing/commands/delete_selection_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_DELETE_SELECTION_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_DELETE_SELECTION_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h" #include "third_party/blink/renderer/core/editing/commands/delete_selection_options.h" #include "third_party/blink/renderer/core/editing/visible_selection.h"
diff --git a/third_party/blink/renderer/core/editing/commands/format_block_command.h b/third_party/blink/renderer/core/editing/commands/format_block_command.h index 14ab626..726a96c 100644 --- a/third_party/blink/renderer/core/editing/commands/format_block_command.h +++ b/third_party/blink/renderer/core/editing/commands/format_block_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_FORMAT_BLOCK_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_FORMAT_BLOCK_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/qualified_name.h" #include "third_party/blink/renderer/core/editing/commands/apply_block_element_command.h" #include "third_party/blink/renderer/core/editing/forward.h"
diff --git a/third_party/blink/renderer/core/editing/commands/indent_outdent_command.h b/third_party/blink/renderer/core/editing/commands/indent_outdent_command.h index c9d10d6..1c794df 100644 --- a/third_party/blink/renderer/core/editing/commands/indent_outdent_command.h +++ b/third_party/blink/renderer/core/editing/commands/indent_outdent_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INDENT_OUTDENT_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INDENT_OUTDENT_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/apply_block_element_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/insert_incremental_text_command.h b/third_party/blink/renderer/core/editing/commands/insert_incremental_text_command.h index 324767a..18d8a36 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_incremental_text_command.h +++ b/third_party/blink/renderer/core/editing/commands/insert_incremental_text_command.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_INCREMENTAL_TEXT_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_INCREMENTAL_TEXT_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/insert_text_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/insert_list_command.h b/third_party/blink/renderer/core/editing/commands/insert_list_command.h index a56f84f8..a0f37f42 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_list_command.h +++ b/third_party/blink/renderer/core/editing/commands/insert_list_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_LIST_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_LIST_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.h b/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.h index 996c0643..b94ad0c 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.h +++ b/third_party/blink/renderer/core/editing/commands/insert_paragraph_separator_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_PARAGRAPH_SEPARATOR_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_PARAGRAPH_SEPARATOR_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/insert_text_command.h b/third_party/blink/renderer/core/editing/commands/insert_text_command.h index 8c3e29f..cb76217 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_text_command.h +++ b/third_party/blink/renderer/core/editing/commands/insert_text_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_TEXT_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_INSERT_TEXT_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/set_character_data_command.h b/third_party/blink/renderer/core/editing/commands/set_character_data_command.h index c8ac0b90..f0c6ef6 100644 --- a/third_party/blink/renderer/core/editing/commands/set_character_data_command.h +++ b/third_party/blink/renderer/core/editing/commands/set_character_data_command.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_SET_CHARACTER_DATA_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_SET_CHARACTER_DATA_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/edit_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/split_text_node_command.h b/third_party/blink/renderer/core/editing/commands/split_text_node_command.h index 145d280..6a562d5e 100644 --- a/third_party/blink/renderer/core/editing/commands/split_text_node_command.h +++ b/third_party/blink/renderer/core/editing/commands/split_text_node_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_SPLIT_TEXT_NODE_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_SPLIT_TEXT_NODE_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/edit_command.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/commands/typing_command.h b/third_party/blink/renderer/core/editing/commands/typing_command.h index a34cc90..47d536e 100644 --- a/third_party/blink/renderer/core/editing/commands/typing_command.h +++ b/third_party/blink/renderer/core/editing/commands/typing_command.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_TYPING_COMMAND_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_COMMANDS_TYPING_COMMAND_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/commands/composite_edit_command.h" #include "third_party/blink/renderer/core/editing/text_granularity.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/dom_selection.cc b/third_party/blink/renderer/core/editing/dom_selection.cc index b6df523..fbf907c 100644 --- a/third_party/blink/renderer/core/editing/dom_selection.cc +++ b/third_party/blink/renderer/core/editing/dom_selection.cc
@@ -42,7 +42,7 @@ #include "third_party/blink/renderer/core/editing/selection_template.h" #include "third_party/blink/renderer/core/editing/set_selection_options.h" #include "third_party/blink/renderer/core/editing/visible_selection.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/inspector/console_message.h"
diff --git a/third_party/blink/renderer/core/editing/dom_selection.h b/third_party/blink/renderer/core/editing/dom_selection.h index 903e1b3d..f005190 100644 --- a/third_party/blink/renderer/core/editing/dom_selection.h +++ b/third_party/blink/renderer/core/editing/dom_selection.h
@@ -30,6 +30,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_DOM_SELECTION_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_DOM_SELECTION_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/forward.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h"
diff --git a/third_party/blink/renderer/core/editing/ephemeral_range.h b/third_party/blink/renderer/core/editing/ephemeral_range.h index ab7ea7d81..1a9f66c 100644 --- a/third_party/blink/renderer/core/editing/ephemeral_range.h +++ b/third_party/blink/renderer/core/editing/ephemeral_range.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_EPHEMERAL_RANGE_H_ #include "base/dcheck_is_on.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/position.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/finder/find_buffer.h b/third_party/blink/renderer/core/editing/finder/find_buffer.h index 2f24ddba..bd33adc 100644 --- a/third_party/blink/renderer/core/editing/finder/find_buffer.h +++ b/third_party/blink/renderer/core/editing/finder/find_buffer.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_FINDER_FIND_BUFFER_H_ #include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/display_lock/display_lock_context.h" #include "third_party/blink/renderer/core/editing/finder/find_options.h" #include "third_party/blink/renderer/core/editing/iterators/text_searcher_icu.h"
diff --git a/third_party/blink/renderer/core/editing/ime/cached_text_input_info.h b/third_party/blink/renderer/core/editing/ime/cached_text_input_info.h index 593e432..830b709 100644 --- a/third_party/blink/renderer/core/editing/ime/cached_text_input_info.h +++ b/third_party/blink/renderer/core/editing/ime/cached_text_input_info.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_IME_CACHED_TEXT_INPUT_INFO_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_IME_CACHED_TEXT_INPUT_INFO_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/iterators/text_iterator_behavior.h" #include "third_party/blink/renderer/core/editing/plain_text_range.h" #include "third_party/blink/renderer/core/editing/position.h"
diff --git a/third_party/blink/renderer/core/editing/iterators/backwards_character_iterator.h b/third_party/blink/renderer/core/editing/iterators/backwards_character_iterator.h index b1e106b6..f493483 100644 --- a/third_party/blink/renderer/core/editing/iterators/backwards_character_iterator.h +++ b/third_party/blink/renderer/core/editing/iterators/backwards_character_iterator.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_ITERATORS_BACKWARDS_CHARACTER_ITERATOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_ITERATORS_BACKWARDS_CHARACTER_ITERATOR_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/forward.h" #include "third_party/blink/renderer/core/editing/iterators/simplified_backwards_text_iterator.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h"
diff --git a/third_party/blink/renderer/core/editing/iterators/fully_clipped_state_stack.h b/third_party/blink/renderer/core/editing/iterators/fully_clipped_state_stack.h index 3f60c01..477738f 100644 --- a/third_party/blink/renderer/core/editing/iterators/fully_clipped_state_stack.h +++ b/third_party/blink/renderer/core/editing/iterators/fully_clipped_state_stack.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_ITERATORS_FULLY_CLIPPED_STATE_STACK_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_ITERATORS_FULLY_CLIPPED_STATE_STACK_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/editing_strategy.h" #include "third_party/blink/renderer/core/editing/iterators/bit_stack.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/editing/iterators/simplified_backwards_text_iterator.h b/third_party/blink/renderer/core/editing/iterators/simplified_backwards_text_iterator.h index 3b5a1b4..beb135cb 100644 --- a/third_party/blink/renderer/core/editing/iterators/simplified_backwards_text_iterator.h +++ b/third_party/blink/renderer/core/editing/iterators/simplified_backwards_text_iterator.h
@@ -26,6 +26,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_ITERATORS_SIMPLIFIED_BACKWARDS_TEXT_ITERATOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_ITERATORS_SIMPLIFIED_BACKWARDS_TEXT_ITERATOR_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/forward.h" #include "third_party/blink/renderer/core/editing/iterators/fully_clipped_state_stack.h" #include "third_party/blink/renderer/core/editing/iterators/text_iterator_behavior.h"
diff --git a/third_party/blink/renderer/core/editing/markers/active_suggestion_marker.h b/third_party/blink/renderer/core/editing/markers/active_suggestion_marker.h index 06c63806..b4fb519 100644 --- a/third_party/blink/renderer/core/editing/markers/active_suggestion_marker.h +++ b/third_party/blink/renderer/core/editing/markers/active_suggestion_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_ACTIVE_SUGGESTION_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_ACTIVE_SUGGESTION_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/styleable_marker.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/markers/active_suggestion_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/active_suggestion_marker_list_impl.h index 1a14047..2feea63 100644 --- a/third_party/blink/renderer/core/editing/markers/active_suggestion_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/active_suggestion_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_ACTIVE_SUGGESTION_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_ACTIVE_SUGGESTION_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
diff --git a/third_party/blink/renderer/core/editing/markers/composition_marker.h b/third_party/blink/renderer/core/editing/markers/composition_marker.h index de40c9a..8e7c287f 100644 --- a/third_party/blink/renderer/core/editing/markers/composition_marker.h +++ b/third_party/blink/renderer/core/editing/markers/composition_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_COMPOSITION_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_COMPOSITION_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/styleable_marker.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/markers/composition_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/composition_marker_list_impl.h index 4ca766f8..a97529e 100644 --- a/third_party/blink/renderer/core/editing/markers/composition_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/composition_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_COMPOSITION_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_COMPOSITION_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
diff --git a/third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h b/third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h index 7f3a1e03d..6770f746 100644 --- a/third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h +++ b/third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_CUSTOM_HIGHLIGHT_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_CUSTOM_HIGHLIGHT_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/custom_highlight_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/custom_highlight_marker_list_impl.h index 1ff5e72..70386c4b 100644 --- a/third_party/blink/renderer/core/editing/markers/custom_highlight_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/custom_highlight_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_CUSTOM_HIGHLIGHT_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_CUSTOM_HIGHLIGHT_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker_list_impl.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/grammar_marker.h b/third_party/blink/renderer/core/editing/markers/grammar_marker.h index 77d4e13..c930bfd 100644 --- a/third_party/blink/renderer/core/editing/markers/grammar_marker.h +++ b/third_party/blink/renderer/core/editing/markers/grammar_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_GRAMMAR_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_GRAMMAR_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/spell_check_marker.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/markers/grammar_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/grammar_marker_list_impl.h index 82714ba2..fff4ca1 100644 --- a/third_party/blink/renderer/core/editing/markers/grammar_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/grammar_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_GRAMMAR_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_GRAMMAR_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/spell_check_marker_list_impl.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker.h b/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker.h index 1c390356..1b4054d 100644 --- a/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker.h +++ b/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_HIGHLIGHT_PSEUDO_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_HIGHLIGHT_PSEUDO_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker_list_impl.h index 4d17ec05..788945e8 100644 --- a/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_HIGHLIGHT_PSEUDO_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_HIGHLIGHT_PSEUDO_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/sorted_document_marker_list_editor.h b/third_party/blink/renderer/core/editing/markers/sorted_document_marker_list_editor.h index d354a84..49004ad 100644 --- a/third_party/blink/renderer/core/editing/markers/sorted_document_marker_list_editor.h +++ b/third_party/blink/renderer/core/editing/markers/sorted_document_marker_list_editor.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SORTED_DOCUMENT_MARKER_LIST_EDITOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SORTED_DOCUMENT_MARKER_LIST_EDITOR_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
diff --git a/third_party/blink/renderer/core/editing/markers/spell_check_marker.h b/third_party/blink/renderer/core/editing/markers/spell_check_marker.h index 7aff420..fa8640da 100644 --- a/third_party/blink/renderer/core/editing/markers/spell_check_marker.h +++ b/third_party/blink/renderer/core/editing/markers/spell_check_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELL_CHECK_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELL_CHECK_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/spell_check_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/spell_check_marker_list_impl.h index a753484..bd1ee18b 100644 --- a/third_party/blink/renderer/core/editing/markers/spell_check_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/spell_check_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELL_CHECK_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELL_CHECK_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/spelling_marker.h b/third_party/blink/renderer/core/editing/markers/spelling_marker.h index e59f09d..fb3d3c2 100644 --- a/third_party/blink/renderer/core/editing/markers/spelling_marker.h +++ b/third_party/blink/renderer/core/editing/markers/spelling_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELLING_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELLING_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/spell_check_marker.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/markers/spelling_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/spelling_marker_list_impl.h index 4a5ffda..fa2b297 100644 --- a/third_party/blink/renderer/core/editing/markers/spelling_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/spelling_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELLING_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SPELLING_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/spell_check_marker_list_impl.h" namespace blink {
diff --git a/third_party/blink/renderer/core/editing/markers/styleable_marker.h b/third_party/blink/renderer/core/editing/markers/styleable_marker.h index d860da2..9215544c 100644 --- a/third_party/blink/renderer/core/editing/markers/styleable_marker.h +++ b/third_party/blink/renderer/core/editing/markers/styleable_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_STYLEABLE_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_STYLEABLE_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker.h" #include "third_party/blink/renderer/platform/graphics/color.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/suggestion_marker.h b/third_party/blink/renderer/core/editing/markers/suggestion_marker.h index cfbde3410..561f8da 100644 --- a/third_party/blink/renderer/core/editing/markers/suggestion_marker.h +++ b/third_party/blink/renderer/core/editing/markers/suggestion_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SUGGESTION_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SUGGESTION_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/styleable_marker.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/suggestion_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/suggestion_marker_list_impl.h index 5b5289e..4804c8f 100644 --- a/third_party/blink/renderer/core/editing/markers/suggestion_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/suggestion_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SUGGESTION_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_SUGGESTION_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/core/editing/markers/suggestion_marker.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
diff --git a/third_party/blink/renderer/core/editing/markers/text_fragment_marker.h b/third_party/blink/renderer/core/editing/markers/text_fragment_marker.h index 932797cc..eca2004f 100644 --- a/third_party/blink/renderer/core/editing/markers/text_fragment_marker.h +++ b/third_party/blink/renderer/core/editing/markers/text_fragment_marker.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_FRAGMENT_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_FRAGMENT_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/text_fragment_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/text_fragment_marker_list_impl.h index 1ea87d7a..bf8ff12 100644 --- a/third_party/blink/renderer/core/editing/markers/text_fragment_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/text_fragment_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_FRAGMENT_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_FRAGMENT_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/highlight_pseudo_marker_list_impl.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/text_match_marker.h b/third_party/blink/renderer/core/editing/markers/text_match_marker.h index 62ed7ad..2b33759 100644 --- a/third_party/blink/renderer/core/editing/markers/text_match_marker.h +++ b/third_party/blink/renderer/core/editing/markers/text_match_marker.h
@@ -27,6 +27,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_MATCH_MARKER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_MATCH_MARKER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker.h" #include "third_party/blink/renderer/core/layout/geometry/physical_rect.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/text_match_marker_list_impl.h b/third_party/blink/renderer/core/editing/markers/text_match_marker_list_impl.h index 6bf93ce..8bffec5 100644 --- a/third_party/blink/renderer/core/editing/markers/text_match_marker_list_impl.h +++ b/third_party/blink/renderer/core/editing/markers/text_match_marker_list_impl.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_MATCH_MARKER_LIST_IMPL_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_TEXT_MATCH_MARKER_LIST_IMPL_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/editing/markers/unsorted_document_marker_list_editor.h b/third_party/blink/renderer/core/editing/markers/unsorted_document_marker_list_editor.h index 7b1a504..9d2e6f05 100644 --- a/third_party/blink/renderer/core/editing/markers/unsorted_document_marker_list_editor.h +++ b/third_party/blink/renderer/core/editing/markers/unsorted_document_marker_list_editor.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_UNSORTED_DOCUMENT_MARKER_LIST_EDITOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_MARKERS_UNSORTED_DOCUMENT_MARKER_LIST_EDITOR_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_list.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
diff --git a/third_party/blink/renderer/core/editing/range_in_flat_tree.h b/third_party/blink/renderer/core/editing/range_in_flat_tree.h index 9bfad97d..6f686f9 100644 --- a/third_party/blink/renderer/core/editing/range_in_flat_tree.h +++ b/third_party/blink/renderer/core/editing/range_in_flat_tree.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_RANGE_IN_FLAT_TREE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_RANGE_IN_FLAT_TREE_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/ephemeral_range.h" #include "third_party/blink/renderer/core/editing/relocatable_position.h"
diff --git a/third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.h b/third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.h index b3966cd1..d35247d 100644 --- a/third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.h +++ b/third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SPELLCHECK_IDLE_SPELL_CHECK_CONTROLLER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SPELLCHECK_IDLE_SPELL_CHECK_CONTROLLER_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/scripted_idle_task_controller.h" #include "third_party/blink/renderer/core/editing/forward.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
diff --git a/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.h b/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.h index 17ae045f..5ce7e8e 100644 --- a/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.h +++ b/third_party/blink/renderer/core/editing/spellcheck/spell_check_requester.h
@@ -27,6 +27,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SPELLCHECK_SPELL_CHECK_REQUESTER_H_ #include "base/memory/scoped_refptr.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/range.h" #include "third_party/blink/renderer/core/editing/forward.h"
diff --git a/third_party/blink/renderer/core/events/event_target_names.json5 b/third_party/blink/renderer/core/events/event_target_names.json5 index 90e7e05..d6ee493 100644 --- a/third_party/blink/renderer/core/events/event_target_names.json5 +++ b/third_party/blink/renderer/core/events/event_target_names.json5
@@ -10,14 +10,14 @@ data: [ "AccessibleNode", "Animation", - "AppHistory", - "AppHistoryEntry", "Clipboard", "EditContext", "FontFaceSet", "MediaQueryList", "BroadcastChannel", "MessagePort", + "Navigation", + "NavigationHistoryEntry", "Node", "EventTargetImpl", "AbortSignal",
diff --git a/third_party/blink/renderer/core/events/pointer_event.h b/third_party/blink/renderer/core/events/pointer_event.h index 035f223..3a9d1fe 100644 --- a/third_party/blink/renderer/core/events/pointer_event.h +++ b/third_party/blink/renderer/core/events/pointer_event.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EVENTS_POINTER_EVENT_H_ #include "third_party/blink/public/common/input/pointer_id.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/events/mouse_event.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/events/pointer_event_util.h b/third_party/blink/renderer/core/events/pointer_event_util.h index 53707c4..8f6f122c 100644 --- a/third_party/blink/renderer/core/events/pointer_event_util.h +++ b/third_party/blink/renderer/core/events/pointer_event_util.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_EVENTS_POINTER_EVENT_UTIL_H_ #include "third_party/blink/renderer/bindings/core/v8/v8_pointer_event_init.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/wtf/math_extras.h" namespace blink {
diff --git a/third_party/blink/renderer/core/events/pop_state_event.h b/third_party/blink/renderer/core/events/pop_state_event.h index 26a547187..0cd8f979 100644 --- a/third_party/blink/renderer/core/events/pop_state_event.h +++ b/third_party/blink/renderer/core/events/pop_state_event.h
@@ -29,6 +29,7 @@ #include "third_party/blink/renderer/bindings/core/v8/v8_pop_state_event_init.h" #include "third_party/blink/renderer/bindings/core/v8/world_safe_v8_reference.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h"
diff --git a/third_party/blink/renderer/core/execution_context/navigator_base.h b/third_party/blink/renderer/core/execution_context/navigator_base.h index 724d3ff7..81802a2 100644 --- a/third_party/blink/renderer/core/execution_context/navigator_base.h +++ b/third_party/blink/renderer/core/execution_context/navigator_base.h
@@ -20,6 +20,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EXECUTION_CONTEXT_NAVIGATOR_BASE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_EXECUTION_CONTEXT_NAVIGATOR_BASE_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/core/frame/navigator_concurrent_hardware.h" #include "third_party/blink/renderer/core/frame/navigator_device_memory.h"
diff --git a/third_party/blink/renderer/core/execution_context/security_context_init.h b/third_party/blink/renderer/core/execution_context/security_context_init.h index f1e09348..b1e0b58 100644 --- a/third_party/blink/renderer/core/execution_context/security_context_init.h +++ b/third_party/blink/renderer/core/execution_context/security_context_init.h
@@ -10,6 +10,7 @@ #include "third_party/blink/public/common/permissions_policy/document_policy.h" #include "third_party/blink/public/common/permissions_policy/permissions_policy.h" #include "third_party/blink/public/web/web_origin_policy.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/permissions_policy/policy_helper.h"
diff --git a/third_party/blink/renderer/core/fetch/fetch_request_data.h b/third_party/blink/renderer/core/fetch/fetch_request_data.h index 1205d3e..95ddf06 100644 --- a/third_party/blink/renderer/core/fetch/fetch_request_data.h +++ b/third_party/blink/renderer/core/fetch/fetch_request_data.h
@@ -15,6 +15,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h" #include "third_party/blink/public/platform/web_url_request.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/fetch/body_stream_buffer.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_load_priority.h"
diff --git a/third_party/blink/renderer/core/fragment_directive/selector_fragment_anchor.h b/third_party/blink/renderer/core/fragment_directive/selector_fragment_anchor.h index 0d0be32..2701993 100644 --- a/third_party/blink/renderer/core/fragment_directive/selector_fragment_anchor.h +++ b/third_party/blink/renderer/core/fragment_directive/selector_fragment_anchor.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAGMENT_DIRECTIVE_SELECTOR_FRAGMENT_ANCHOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_FRAGMENT_DIRECTIVE_SELECTOR_FRAGMENT_ANCHOR_H_ +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/page/scrolling/fragment_anchor.h" #include "third_party/blink/renderer/core/scroll/scroll_types.h"
diff --git a/third_party/blink/renderer/core/fragment_directive/text_fragment_handler.h b/third_party/blink/renderer/core/fragment_directive/text_fragment_handler.h index 6b7c14d18..2410ad3 100644 --- a/third_party/blink/renderer/core/fragment_directive/text_fragment_handler.h +++ b/third_party/blink/renderer/core/fragment_directive/text_fragment_handler.h
@@ -7,6 +7,7 @@ #include "components/shared_highlighting/core/common/shared_highlighting_metrics.h" #include "third_party/blink/public/mojom/link_to_text/link_to_text.mojom-blink.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/fragment_directive/text_fragment_selector_generator.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h"
diff --git a/third_party/blink/renderer/core/fragment_directive/text_fragment_selector_generator.h b/third_party/blink/renderer/core/fragment_directive/text_fragment_selector_generator.h index 867915e..4cf3ded 100644 --- a/third_party/blink/renderer/core/fragment_directive/text_fragment_selector_generator.h +++ b/third_party/blink/renderer/core/fragment_directive/text_fragment_selector_generator.h
@@ -7,6 +7,7 @@ #include "components/shared_highlighting/core/common/shared_highlighting_metrics.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/editing/forward.h" #include "third_party/blink/renderer/core/fragment_directive/same_block_word_iterator.h" #include "third_party/blink/renderer/core/fragment_directive/text_fragment_finder.h"
diff --git a/third_party/blink/renderer/core/frame/build.gni b/third_party/blink/renderer/core/frame/build.gni index 608a66b10..e94c900 100644 --- a/third_party/blink/renderer/core/frame/build.gni +++ b/third_party/blink/renderer/core/frame/build.gni
@@ -42,10 +42,10 @@ "dactyloscoper.h", "frame_content_as_text.h", "frame_content_as_text.cc", - "deprecation.cc", - "deprecation.h", - "deprecation_report_body.cc", - "deprecation_report_body.h", + "deprecation/deprecation.cc", + "deprecation/deprecation.h", + "deprecation/deprecation_report_body.cc", + "deprecation/deprecation_report_body.h", "device_single_window_event_controller.cc", "device_single_window_event_controller.h", "directive.cc",
diff --git a/third_party/blink/renderer/core/frame/coop_access_violation_report_body.h b/third_party/blink/renderer/core/frame/coop_access_violation_report_body.h index 2e83b7d8..dd06b869 100644 --- a/third_party/blink/renderer/core/frame/coop_access_violation_report_body.h +++ b/third_party/blink/renderer/core/frame/coop_access_violation_report_body.h
@@ -8,6 +8,7 @@ #include "services/network/public/mojom/cross_origin_opener_policy.mojom-blink-forward.h" #include "third_party/blink/renderer/bindings/core/v8/source_location.h" #include "third_party/blink/renderer/bindings/core/v8/v8_object_builder.h" +#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/frame/location_report_body.h" namespace blink {
diff --git a/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc b/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc index 50753e7..a989dea 100644 --- a/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc +++ b/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
@@ -18,7 +18,7 @@ #include "third_party/blink/renderer/core/frame/csp/content_security_policy_violation_type.h" #include "third_party/blink/renderer/core/frame/csp/source_list_directive.h" #include "third_party/blink/renderer/core/frame/csp/trusted_types_directive.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/html/html_script_element.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/loader/mixed_content_checker.h"
diff --git a/third_party/blink/renderer/core/frame/deprecation/OWNERS b/third_party/blink/renderer/core/frame/deprecation/OWNERS new file mode 100644 index 0000000..fc74c01 --- /dev/null +++ b/third_party/blink/renderer/core/frame/deprecation/OWNERS
@@ -0,0 +1 @@ +arichiv@chromium.org
diff --git a/third_party/blink/renderer/core/frame/deprecation.cc b/third_party/blink/renderer/core/frame/deprecation/deprecation.cc similarity index 99% rename from third_party/blink/renderer/core/frame/deprecation.cc rename to third_party/blink/renderer/core/frame/deprecation/deprecation.cc index 614d479..0f77675 100644 --- a/third_party/blink/renderer/core/frame/deprecation.cc +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "base/time/time.h" #include "build/build_config.h" @@ -10,7 +10,7 @@ #include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation_report_body.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/report.h" #include "third_party/blink/renderer/core/frame/reporting_context.h"
diff --git a/third_party/blink/renderer/core/frame/deprecation.h b/third_party/blink/renderer/core/frame/deprecation/deprecation.h similarity index 88% rename from third_party/blink/renderer/core/frame/deprecation.h rename to third_party/blink/renderer/core/frame/deprecation/deprecation.h index 57e432e..ca619ac 100644 --- a/third_party/blink/renderer/core/frame/deprecation.h +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_DEPRECATION_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_DEPRECATION_H_ #include <bitset> @@ -59,4 +59,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_DEPRECATION_H_
diff --git a/third_party/blink/renderer/core/frame/deprecation_report_body.cc b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.cc similarity index 95% rename from third_party/blink/renderer/core/frame/deprecation_report_body.cc rename to third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.cc index 5a82623..4b2a9eb 100644 --- a/third_party/blink/renderer/core/frame/deprecation_report_body.cc +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/frame/deprecation_report_body.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h" #include "third_party/blink/renderer/platform/bindings/to_v8.h" #include "third_party/blink/renderer/platform/text/date_components.h"
diff --git a/third_party/blink/renderer/core/frame/deprecation_report_body.h b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h similarity index 83% rename from third_party/blink/renderer/core/frame/deprecation_report_body.h rename to third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h index a4ba3e7..2848d6c4 100644 --- a/third_party/blink/renderer/core/frame/deprecation_report_body.h +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_REPORT_BODY_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_REPORT_BODY_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_DEPRECATION_REPORT_BODY_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_DEPRECATION_REPORT_BODY_H_ #include "base/time/time.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -39,4 +39,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_REPORT_BODY_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_DEPRECATION_DEPRECATION_REPORT_BODY_H_
diff --git a/third_party/blink/renderer/core/frame/deprecation_report_body.idl b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.idl similarity index 100% rename from third_party/blink/renderer/core/frame/deprecation_report_body.idl rename to third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.idl
diff --git a/third_party/blink/renderer/core/frame/deprecation_report_body_test.cc b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body_test.cc similarity index 95% rename from third_party/blink/renderer/core/frame/deprecation_report_body_test.cc rename to third_party/blink/renderer/core/frame/deprecation/deprecation_report_body_test.cc index 9e4b720..8c504d61 100644 --- a/third_party/blink/renderer/core/frame/deprecation_report_body_test.cc +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation_report_body_test.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/frame/deprecation_report_body.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
diff --git a/third_party/blink/renderer/core/frame/frame.h b/third_party/blink/renderer/core/frame/frame.h index 373f4ff8..d3f7fca2 100644 --- a/third_party/blink/renderer/core/frame/frame.h +++ b/third_party/blink/renderer/core/frame/frame.h
@@ -508,6 +508,13 @@ // The user activation state of the current frame. See |UserActivationState| // for details on how this state is maintained. + // + // TODO(https://crbug.com/1087963): Ideally this should be a state of + // |LocalDOMWindow| because user activation state never outlives JS Window + // object. See related discussion on browser-side states in + // https://crbug.com/905448. However, a legacy code relying on the user + // activation state of a |RemoteFrame| prevents us from moving this state to + // |LocalDOMWindow|. UserActivationState user_activation_state_; // The sticky user activation state of the current frame before eTLD+1
diff --git a/third_party/blink/renderer/core/frame/history.cc b/third_party/blink/renderer/core/frame/history.cc index c531169..313ec0dd 100644 --- a/third_party/blink/renderer/core/frame/history.cc +++ b/third_party/blink/renderer/core/frame/history.cc
@@ -26,7 +26,6 @@ #include "third_party/blink/renderer/core/frame/history.h" #include "third_party/blink/public/mojom/web_feature/web_feature.mojom-shared.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/history_util.h" @@ -36,6 +35,7 @@ #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/loader/history_item.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h" @@ -313,11 +313,11 @@ return; } - if (auto* app_history = AppHistory::navigation(*DomWindow())) { - if (app_history->DispatchNavigateEvent( + if (auto* navigation_api = NavigationApi::navigation(*DomWindow())) { + if (navigation_api->DispatchNavigateEvent( full_url, nullptr, NavigateEventType::kHistoryApi, type, UserNavigationInvolvement::kNone, data.get(), - nullptr) != AppHistory::DispatchResult::kContinue) { + nullptr) != NavigationApi::DispatchResult::kContinue) { return; } }
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index b38b09c2..c374f3f 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -1164,6 +1164,13 @@ UMA_HISTOGRAM_ENUMERATION("BackForwardCache.SameSite.ActionAfterPagehide2", ActionAfterPagehide::kReceivedPostMessage); } + + if (RuntimeEnabledFeatures::CapabilityDelegationPaymentRequestEnabled(this) && + event->delegatePaymentRequest()) { + UseCounter::Count(this, WebFeature::kCapabilityDelegationOfPaymentRequest); + payment_request_token_.Activate(); + } + DispatchEvent(*event); } @@ -2239,6 +2246,14 @@ } } +bool LocalDOMWindow::IsPaymentRequestTokenActive() const { + return payment_request_token_.IsActive(); +} + +bool LocalDOMWindow::ConsumePaymentRequestToken() { + return payment_request_token_.ConsumeIfActive(); +} + void LocalDOMWindow::SetIsInBackForwardCache(bool is_in_back_forward_cache) { ExecutionContext::SetIsInBackForwardCache(is_in_back_forward_cache); if (!is_in_back_forward_cache) {
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.h b/third_party/blink/renderer/core/frame/local_dom_window.h index bd98941..bc986fd0 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.h +++ b/third_party/blink/renderer/core/frame/local_dom_window.h
@@ -31,6 +31,7 @@ #include "services/metrics/public/cpp/ukm_recorder.h" #include "services/metrics/public/cpp/ukm_source_id.h" +#include "third_party/blink/public/common/frame/payment_request_token.h" #include "third_party/blink/public/common/metrics/post_message_counter.h" #include "third_party/blink/public/common/tokens/tokens.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" @@ -452,6 +453,12 @@ void DidReceiveUserActivation(); + // Returns the state of the |PaymentRequestToken| in this document. + bool IsPaymentRequestTokenActive() const; + + // Consumes the |PaymentRequestToken| if it was active in this document . + bool ConsumePaymentRequestToken(); + // Called when a network request buffered an additional `num_bytes` while this // frame is in back-forward cache. void DidBufferLoadWhileInBackForwardCache(size_t num_bytes); @@ -531,6 +538,10 @@ HeapHashSet<WeakMember<EventListenerObserver>> event_listener_observers_; HeapHashSet<WeakMember<UserActivationObserver>> user_activation_observers_; + // Tracker for delegated PaymentRequest. This is related to + // |Frame::user_activation_state_|. + PaymentRequestToken payment_request_token_; + // https://dom.spec.whatwg.org/#window-current-event // We represent the "undefined" value as nullptr. Member<Event> current_event_;
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc index 708fe1d..48fb425 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -775,14 +775,6 @@ return transient_allow_fullscreen_.IsActive(); } -bool LocalFrame::IsPaymentRequestTokenActive() const { - return payment_request_token_.IsActive(); -} - -bool LocalFrame::ConsumePaymentRequestToken() { - return payment_request_token_.ConsumeIfActive(); -} - void LocalFrame::Reload(WebFrameLoadType load_type) { DCHECK(IsReloadLoadType(load_type)); if (!loader_.GetDocumentLoader()->GetHistoryItem()) @@ -3019,6 +3011,10 @@ ports = MessagePort::EntanglePorts(*GetDocument()->GetExecutionContext(), std::move(message.ports)); } + + // The |message.user_activation| only conveys the sender |Frame|'s user + // activation state to receiver JS. This is never used for activating the + // receiver (or any other) |Frame|. UserActivation* user_activation = nullptr; if (message.user_activation) { user_activation = MakeGarbageCollected<UserActivation>( @@ -3026,15 +3022,6 @@ message.user_activation->was_active); } - if (GetDocument() && - RuntimeEnabledFeatures::CapabilityDelegationPaymentRequestEnabled( - GetDocument()->GetExecutionContext()) && - message.delegate_payment_request) { - UseCounter::Count(GetDocument(), - WebFeature::kCapabilityDelegationOfPaymentRequest); - payment_request_token_.Activate(); - } - message_event->initMessageEvent( "message", false, false, std::move(message.message), source_origin, "" /*lastEventId*/, window, ports, user_activation,
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h index 2c3c57320..5bc6c6c 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -40,7 +40,6 @@ #include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h" #include "services/network/public/mojom/fetch_api.mojom-blink-forward.h" #include "third_party/blink/public/common/frame/frame_ad_evidence.h" -#include "third_party/blink/public/common/frame/payment_request_token.h" #include "third_party/blink/public/common/frame/transient_allow_fullscreen.h" #include "third_party/blink/public/mojom/blob/blob_url_store.mojom-blink-forward.h" #include "third_party/blink/public/mojom/devtools/devtools_agent.mojom-blink-forward.h" @@ -680,12 +679,6 @@ transient_allow_fullscreen_.Activate(); } - // Returns the state of the |PaymentRequestToken| in the current |Frame|. - bool IsPaymentRequestTokenActive() const; - - // Consumes the |PaymentRequestToken| of the current |Frame| if it was active. - bool ConsumePaymentRequestToken(); - LocalFrameToken GetLocalFrameToken() const; TextFragmentHandler* GetTextFragmentHandler() const { @@ -936,8 +929,6 @@ // Manages a transient affordance for this frame to enter fullscreen. TransientAllowFullscreen transient_allow_fullscreen_; - PaymentRequestToken payment_request_token_; - #if !BUILDFLAG(IS_ANDROID) bool is_window_controls_overlay_visible_ = false; gfx::Rect window_controls_overlay_rect_;
diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc index 08322ad..4e46ee8 100644 --- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc +++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
@@ -23,7 +23,6 @@ #include "third_party/blink/public/web/web_local_frame_client.h" #include "third_party/blink/public/web/web_plugin.h" #include "third_party/blink/renderer/bindings/core/v8/script_controller.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" #include "third_party/blink/renderer/core/dom/element_traversal.h" #include "third_party/blink/renderer/core/dom/ignore_opens_during_unload_count_incrementer.h" #include "third_party/blink/renderer/core/editing/editing_utilities.h" @@ -55,6 +54,7 @@ #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" #include "third_party/blink/renderer/core/loader/mixed_content_checker.h" #include "third_party/blink/renderer/core/messaging/message_port.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/focus_controller.h" #include "third_party/blink/renderer/core/page/page.h" @@ -1151,8 +1151,9 @@ void LocalFrameMojoHandler::SetAppHistoryEntriesForRestore( mojom::blink::AppHistoryEntryArraysPtr entry_arrays) { - if (AppHistory* app_history = AppHistory::navigation(*frame_->DomWindow())) - app_history->SetEntriesForRestore(entry_arrays); + if (NavigationApi* navigation_api = + NavigationApi::navigation(*frame_->DomWindow())) + navigation_api->SetEntriesForRestore(entry_arrays); } void LocalFrameMojoHandler::AnimateDoubleTapZoom(const gfx::Point& point,
diff --git a/third_party/blink/renderer/core/frame/reporting_context.cc b/third_party/blink/renderer/core/frame/reporting_context.cc index 8c21cc8..31932fcd 100644 --- a/third_party/blink/renderer/core/frame/reporting_context.cc +++ b/third_party/blink/renderer/core/frame/reporting_context.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/csp/csp_violation_report_body.h" -#include "third_party/blink/renderer/core/frame/deprecation_report_body.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h" #include "third_party/blink/renderer/core/frame/document_policy_violation_report_body.h" #include "third_party/blink/renderer/core/frame/intervention_report_body.h" #include "third_party/blink/renderer/core/frame/permissions_policy_violation_report_body.h"
diff --git a/third_party/blink/renderer/core/frame/reporting_context_test.cc b/third_party/blink/renderer/core/frame/reporting_context_test.cc index 0e045f63..a356df6ab 100644 --- a/third_party/blink/renderer/core/frame/reporting_context_test.cc +++ b/third_party/blink/renderer/core/frame/reporting_context_test.cc
@@ -6,7 +6,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/common/browser_interface_broker_proxy.h" -#include "third_party/blink/renderer/core/frame/deprecation_report_body.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation_report_body.h" #include "third_party/blink/renderer/core/frame/document_policy_violation_report_body.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/core/frame/use_counter_impl.cc b/third_party/blink/renderer/core/frame/use_counter_impl.cc index 415cd1b..12056c6a 100644 --- a/third_party/blink/renderer/core/frame/use_counter_impl.cc +++ b/third_party/blink/renderer/core/frame/use_counter_impl.cc
@@ -35,7 +35,6 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/frame.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/core/frame/use_counter_impl_test.cc b/third_party/blink/renderer/core/frame/use_counter_impl_test.cc index 3237836..37e5e82 100644 --- a/third_party/blink/renderer/core/frame/use_counter_impl_test.cc +++ b/third_party/blink/renderer/core/frame/use_counter_impl_test.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/css/properties/css_property.h" #include "third_party/blink/renderer/core/dom/shadow_root.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/html_html_element.h"
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc index 7bf877e6..8df8261 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -179,7 +179,7 @@ #include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h" #include "third_party/blink/renderer/core/exported/web_view_impl.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/find_in_page.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/intervention.h"
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index 56a6b6b..aba8a0c 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -54,7 +54,6 @@ #include "third_party/blink/renderer/core/events/keyboard_event.h" #include "third_party/blink/renderer/core/events/mouse_event.h" #include "third_party/blink/renderer/core/fileapi/file_list.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/html/forms/color_chooser.h"
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc index 99d9887..5829dd2 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.cc +++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
@@ -36,7 +36,7 @@ #include "third_party/blink/renderer/core/events/keyboard_event.h" #include "third_party/blink/renderer/core/events/mouse_event.h" #include "third_party/blink/renderer/core/frame/ad_tracker.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
diff --git a/third_party/blink/renderer/core/html/html_element.cc b/third_party/blink/renderer/core/html/html_element.cc index 040d0f6..800eddc 100644 --- a/third_party/blink/renderer/core/html/html_element.cc +++ b/third_party/blink/renderer/core/html/html_element.cc
@@ -56,7 +56,6 @@ #include "third_party/blink/renderer/core/editing/spellcheck/spell_checker.h" #include "third_party/blink/renderer/core/events/keyboard_event.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h"
diff --git a/third_party/blink/renderer/core/html/html_html_element.cc b/third_party/blink/renderer/core/html/html_html_element.cc index abe6de78..cb96703bd 100644 --- a/third_party/blink/renderer/core/html/html_html_element.cc +++ b/third_party/blink/renderer/core/html/html_html_element.cc
@@ -29,7 +29,6 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/document_parser.h" #include "third_party/blink/renderer/core/dom/node_computed_style.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/html_body_element.h"
diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_party/blink/renderer/core/html/html_image_element.cc index da2496b..b713811 100644 --- a/third_party/blink/renderer/core/html/html_image_element.cc +++ b/third_party/blink/renderer/core/html/html_image_element.cc
@@ -37,7 +37,7 @@ #include "third_party/blink/renderer/core/dom/node_traversal.h" #include "third_party/blink/renderer/core/dom/shadow_root.h" #include "third_party/blink/renderer/core/frame/attribution_src_loader.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h" #include "third_party/blink/renderer/core/html/cross_origin_attribute.h"
diff --git a/third_party/blink/renderer/core/html/html_link_element.cc b/third_party/blink/renderer/core/html/html_link_element.cc index 35cd4d6..cb25608a 100644 --- a/third_party/blink/renderer/core/html/html_link_element.cc +++ b/third_party/blink/renderer/core/html/html_link_element.cc
@@ -34,7 +34,6 @@ #include "third_party/blink/renderer/core/dom/attribute.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/events/event.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
diff --git a/third_party/blink/renderer/core/html/parser/html_resource_preloader.cc b/third_party/blink/renderer/core/html/parser/html_resource_preloader.cc index 0074626..dce50278 100644 --- a/third_party/blink/renderer/core/html/parser/html_resource_preloader.cc +++ b/third_party/blink/renderer/core/html/parser/html_resource_preloader.cc
@@ -33,7 +33,6 @@ #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/web_prescient_networking.h" #include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" #include "third_party/blink/renderer/core/loader/document_loader.h"
diff --git a/third_party/blink/renderer/core/html/resources/forced_colors.css b/third_party/blink/renderer/core/html/resources/forced_colors.css index 1cff481..d2125baf 100644 --- a/third_party/blink/renderer/core/html/resources/forced_colors.css +++ b/third_party/blink/renderer/core/html/resources/forced_colors.css
@@ -116,7 +116,7 @@ input[type="file"]::-webkit-file-upload-button { background-color: ButtonFace; -internal-forced-background-color: ButtonFace; - -internal-forced-border-color: ButtonText; + -internal-forced-border-color: ButtonBorder; -internal-forced-color: ButtonText; }
diff --git a/third_party/blink/renderer/core/html/resources/html.css b/third_party/blink/renderer/core/html/resources/html.css index 4a0ed73..9f62d3a 100644 --- a/third_party/blink/renderer/core/html/resources/html.css +++ b/third_party/blink/renderer/core/html/resources/html.css
@@ -661,7 +661,7 @@ text-align: center; cursor: default; padding: 1px 6px; - border: 2px outset -internal-light-dark(#767676, #858585); + border: 2px outset ButtonBorder; box-sizing: border-box; background-color: -internal-light-dark(#efefef, #3B3B3B); color: -internal-light-dark(black, white); @@ -800,7 +800,7 @@ width: 50px; height: 27px; /* Same as native_theme_base. */ - border: 1px solid -internal-light-dark(#767676, #858585); + border: 1px solid ButtonBorder; padding: 1px 2px; cursor: default; box-sizing: border-box;
diff --git a/third_party/blink/renderer/core/input/event_handler.cc b/third_party/blink/renderer/core/input/event_handler.cc index 85929bce..f6b2dd5 100644 --- a/third_party/blink/renderer/core/input/event_handler.cc +++ b/third_party/blink/renderer/core/input/event_handler.cc
@@ -59,7 +59,7 @@ #include "third_party/blink/renderer/core/events/pointer_event_factory.h" #include "third_party/blink/renderer/core/events/text_event.h" #include "third_party/blink/renderer/core/events/touch_event.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/event_handler_registry.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
diff --git a/third_party/blink/renderer/core/input/touch_event_manager.cc b/third_party/blink/renderer/core/input/touch_event_manager.cc index 899340d..856961e3 100644 --- a/third_party/blink/renderer/core/input/touch_event_manager.cc +++ b/third_party/blink/renderer/core/input/touch_event_manager.cc
@@ -11,7 +11,6 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/flat_tree_traversal.h" #include "third_party/blink/renderer/core/events/touch_event.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/event_handler_registry.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/core/inspector/main_thread_debugger.cc b/third_party/blink/renderer/core/inspector/main_thread_debugger.cc index 629608b..cb82318 100644 --- a/third_party/blink/renderer/core/inspector/main_thread_debugger.cc +++ b/third_party/blink/renderer/core/inspector/main_thread_debugger.cc
@@ -46,7 +46,7 @@ #include "third_party/blink/renderer/core/dom/static_node_list.h" #include "third_party/blink/renderer/core/events/error_event.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/core/layout/grid_track_sizing_algorithm.cc b/third_party/blink/renderer/core/layout/grid_track_sizing_algorithm.cc index 14a7475..0c7b8a3 100644 --- a/third_party/blink/renderer/core/layout/grid_track_sizing_algorithm.cc +++ b/third_party/blink/renderer/core/layout/grid_track_sizing_algorithm.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/core/layout/grid_track_sizing_algorithm.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/layout/grid.h" #include "third_party/blink/renderer/core/layout/grid_layout_utils.h" #include "third_party/blink/renderer/core/layout/layout_grid.h"
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index a8bc656..7e4f3253 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -613,6 +613,9 @@ : 0xFFFFFFFF; case CSSValueID::kBackground: return 0xFF6363CE; + case CSSValueID::kButtonborder: + return color_scheme == mojom::blink::ColorScheme::kDark ? 0xFF6B6B6B + : 0xFF767676; case CSSValueID::kButtonface: return color_scheme == mojom::blink::ColorScheme::kDark ? 0xFF444444 : 0xFFDDDDDD; @@ -714,6 +717,7 @@ case CSSValueID::kButtonface: theme_color = blink::WebThemeEngine::SystemThemeColor::kButtonFace; break; + case CSSValueID::kButtonborder: case CSSValueID::kButtontext: theme_color = blink::WebThemeEngine::SystemThemeColor::kButtonText; break;
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc index 03fb590f..9da1cbf 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -225,6 +225,7 @@ const NGLineLayoutOpportunity& opportunity, NGLineInfo* line_info, NGLogicalLineItems* line_box, + NGLineBreaker* line_breaker, LayoutUnit* ruby_block_start_adjust) { // Needs MutableResults to move ShapeResult out of the NGLineInfo. NGInlineItemResults* line_items = line_info->MutableResults(); @@ -336,14 +337,11 @@ has_out_of_flow_positioned_items = true; } else if (item.Type() == NGInlineItem::kFloating) { if (item_result.positioned_float) { - if (item_result.positioned_float->layout_result) { + if (!item_result.positioned_float->need_break_before) { + DCHECK(item_result.positioned_float->layout_result); line_box->AddChild(item_result.positioned_float->layout_result, item_result.positioned_float->bfc_offset, item.BidiLevel()); - } else { - // If we didn't produce a result, it means that we decided to push the - // float to the next fragmentainer. - DCHECK(ConstraintSpace().HasBlockFragmentation()); } } else { line_box->AddChild(item.GetLayoutObject(), item.BidiLevel()); @@ -446,7 +444,7 @@ if (has_floating_items) { DCHECK(!line_info->IsBlockInInline()); PlaceFloatingObjects(*line_info, line_box_metrics, opportunity, - *ruby_block_start_adjust, line_box); + *ruby_block_start_adjust, line_box, line_breaker); } // Apply any relative positioned offsets to *items* which have relative @@ -774,7 +772,8 @@ const FontHeight& line_box_metrics, const NGLineLayoutOpportunity& opportunity, LayoutUnit ruby_block_start_adjust, - NGLogicalLineItems* line_box) { + NGLogicalLineItems* line_box, + NGLineBreaker* line_breaker) { DCHECK(line_info.IsEmptyLine() || !line_box_metrics.IsEmpty()) << "Non-empty lines must have a valid set of linebox metrics."; @@ -810,14 +809,14 @@ NGBlockNode float_node(To<LayoutBox>(child.unpositioned_float.Get())); auto* break_before = NGBlockBreakToken::CreateBreakBefore( float_node, /* is_forced_break */ false); - context_->PropagateBreakToken(break_before); + line_breaker->PropagateBreakToken(break_before); continue; } else { // If the float broke inside, we need to propagate the break token to // the block container, so that we'll resume in the next fragmentainer. if (const NGBreakToken* token = positioned_float.layout_result->PhysicalFragment().BreakToken()) - context_->PropagateBreakToken(To<NGBlockBreakToken>(token)); + line_breaker->PropagateBreakToken(To<NGBlockBreakToken>(token)); child.layout_result = std::move(positioned_float.layout_result); child.bfc_offset = positioned_float.bfc_offset; child.unpositioned_float = nullptr; @@ -1275,7 +1274,7 @@ PrepareBoxStates(line_info, break_token); LayoutUnit ruby_block_start_adjust; - CreateLine(line_opportunity, &line_info, line_box, + CreateLine(line_opportunity, &line_info, line_box, &line_breaker, &ruby_block_start_adjust); is_line_created = true; @@ -1427,7 +1426,6 @@ auto* break_before = NGBlockBreakToken::CreateBreakBefore( float_node, /* is_forced_break */ false); context_->PropagateBreakToken(break_before); - positioned_float.layout_result = nullptr; } else if (const NGBreakToken* token = positioned_float.layout_result->PhysicalFragment() .BreakToken()) {
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h index 29b0c0b..5975fdf 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.h
@@ -25,6 +25,7 @@ class NGInlineNode; class NGInlineItem; class NGInlineLayoutStateStack; +class NGLineBreaker; class NGLineInfo; struct NGInlineBoxState; struct NGInlineItemResult; @@ -49,6 +50,7 @@ void CreateLine(const NGLineLayoutOpportunity&, NGLineInfo*, NGLogicalLineItems* line_box, + NGLineBreaker*, LayoutUnit* ruby_block_start_adjust); const NGLayoutResult* Layout() override; @@ -111,7 +113,8 @@ const FontHeight&, const NGLineLayoutOpportunity&, LayoutUnit ruby_block_start_adjust, - NGLogicalLineItems* line_box); + NGLogicalLineItems* line_box, + NGLineBreaker*); void PlaceRelativePositionedItems(NGLogicalLineItems* line_box); void PlaceListMarker(const NGInlineItem&, NGInlineItemResult*,
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc index 63e04a3a..e0bc4dbca 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc
@@ -2205,30 +2205,28 @@ return; } - NGPositionedFloat positioned_float = + item_result->positioned_float = PositionFloat(&unpositioned_float, exclusion_space_); if (constraint_space_.HasBlockFragmentation()) { - if (positioned_float.need_break_before) { + if (item_result->positioned_float->need_break_before) { // We broke before the float, and there's no fragment. Create a break // token and propagate it all the way to the block container layout // algorithm. The float will start in the next fragmentainer. auto* break_before = NGBlockBreakToken::CreateBreakBefore( unpositioned_float.node, /* is_forced_break */ false); - RemoveLastItem(line_info); PropagateBreakToken(break_before); return; } // If we broke inside the float, we also need to propagate a break token to // the block container. Layout of the float will resume in the next // fragmentainer. - if (const NGBreakToken* token = - positioned_float.layout_result->PhysicalFragment().BreakToken()) + const NGPhysicalFragment& fragment = + item_result->positioned_float->layout_result->PhysicalFragment(); + if (const NGBreakToken* token = fragment.BreakToken()) PropagateBreakToken(To<NGBlockBreakToken>(token)); } - item_result->positioned_float = positioned_float; - NGLayoutOpportunity opportunity = exclusion_space_->FindLayoutOpportunity( {constraint_space_.BfcOffset().line_offset, bfc_block_offset}, constraint_space_.AvailableSize().inline_size);
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc index b5541d73..ee7de79 100644 --- a/third_party/blink/renderer/core/loader/document_loader.cc +++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -50,7 +50,6 @@ #include "third_party/blink/public/platform/web_content_security_policy_struct.h" #include "third_party/blink/public/platform/web_url_request.h" #include "third_party/blink/renderer/bindings/core/v8/script_controller.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/document_init.h" #include "third_party/blink/renderer/core/dom/document_parser.h" @@ -62,7 +61,7 @@ #include "third_party/blink/renderer/core/execution_context/window_agent_factory.h" #include "third_party/blink/renderer/core/fragment_directive/text_fragment_anchor.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/intervention.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" @@ -88,6 +87,7 @@ #include "third_party/blink/renderer/core/loader/progress_tracker.h" #include "third_party/blink/renderer/core/loader/subresource_filter.h" #include "third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include "third_party/blink/renderer/core/origin_trials/origin_trial_context.h" #include "third_party/blink/renderer/core/page/frame_tree.h" #include "third_party/blink/renderer/core/page/page.h" @@ -815,7 +815,7 @@ probe::DidNavigateWithinDocument(frame_); // If transitionWhile() was called during this same-document navigation's - // AppHistoryNavigateEvent, the navigation will finish asynchronously, so + // NavigateEvent, the navigation will finish asynchronously, so // don't immediately call DidStopLoading() in that case. bool should_send_stop_notification = !was_loading && @@ -824,8 +824,8 @@ if (should_send_stop_notification) GetFrameLoader().Progress().ProgressCompleted(); - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) - app_history->UpdateForNavigation(*history_item_, type); + if (auto* navigation_api = NavigationApi::navigation(*frame_->DomWindow())) + navigation_api->UpdateForNavigation(*history_item_, type); // Aything except a history.pushState/replaceState is considered a new // navigation that resets whether the user has scrolled and fires popstate. @@ -1334,7 +1334,7 @@ mojom::blink::SameDocumentNavigationType same_document_navigation_type = mojom::blink::SameDocumentNavigationType::kFragment; - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) { + if (auto* navigation_api = NavigationApi::navigation(*frame_->DomWindow())) { UserNavigationInvolvement involvement = UserNavigationInvolvement::kNone; if (is_browser_initiated) { involvement = UserNavigationInvolvement::kBrowserUI; @@ -1342,13 +1342,13 @@ mojom::blink::TriggeringEventInfo::kFromTrustedEvent) { involvement = UserNavigationInvolvement::kActivation; } - auto dispatch_result = app_history->DispatchNavigateEvent( + auto dispatch_result = navigation_api->DispatchNavigateEvent( url, nullptr, NavigateEventType::kFragment, frame_load_type, involvement, nullptr, history_item, is_browser_initiated, is_synchronously_committed); - if (dispatch_result == AppHistory::DispatchResult::kAbort) + if (dispatch_result == NavigationApi::DispatchResult::kAbort) return mojom::blink::CommitResult::Aborted; - if (dispatch_result == AppHistory::DispatchResult::kTransitionWhile) + if (dispatch_result == NavigationApi::DispatchResult::kTransitionWhile) return mojom::blink::CommitResult::Ok; } @@ -2397,17 +2397,17 @@ document->SetBaseURLOverride(main_resource_url); } - // appHistory is not set on the initial about:blank document or opaque-origin - // documents. + // The navigation API is not initialized on the initial about:blank document + // or opaque-origin documents. if (commit_reason_ != CommitReason::kInitialization && !frame_->DomWindow()->GetSecurityOrigin()->IsOpaque()) { - AppHistory::From(*frame_->DomWindow()) + NavigationApi::From(*frame_->DomWindow()) ->InitializeForNewWindow(*history_item_, load_type_, commit_reason_, - AppHistory::navigation(*previous_window), + NavigationApi::navigation(*previous_window), app_history_back_entries_, app_history_forward_entries_); - // Now that appHistory's entries array is initialized, we don't need to - // retain the state from which it was initialized. + // Now that the navigation API's entries array is initialized, we don't need + // to retain the state from which it was initialized. app_history_back_entries_.Clear(); app_history_forward_entries_.Clear(); }
diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc index f54e5f1..69e6858 100644 --- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc +++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
@@ -66,7 +66,7 @@ #include "third_party/blink/renderer/core/fileapi/public_url_manager.h" #include "third_party/blink/renderer/core/frame/ad_tracker.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/core/loader/frame_loader.cc b/third_party/blink/renderer/core/loader/frame_loader.cc index 4fc612ba..4958304 100644 --- a/third_party/blink/renderer/core/loader/frame_loader.cc +++ b/third_party/blink/renderer/core/loader/frame_loader.cc
@@ -62,7 +62,6 @@ #include "third_party/blink/public/web/web_navigation_params.h" #include "third_party/blink/renderer/bindings/core/v8/script_controller.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" #include "third_party/blink/renderer/core/dom/document_init.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/ignore_opens_during_unload_count_incrementer.h" @@ -92,6 +91,7 @@ #include "third_party/blink/renderer/core/loader/frame_loader_types.h" #include "third_party/blink/renderer/core/loader/mixed_content_checker.h" #include "third_party/blink/renderer/core/loader/progress_tracker.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/frame_tree.h" #include "third_party/blink/renderer/core/page/page.h" @@ -430,12 +430,13 @@ if (document_loader_) { // Only declare the whole frame finished if the committed navigation is done // and there is no provisional navigation in progress. - // appHistory may prevent a navigation from completing while waiting for a - // JS-provided promise to resolve, so check it as well. + // The navigation API may prevent a navigation from completing while waiting + // for a JS-provided promise to resolve, so check it as well. if (!document_loader_->SentDidFinishLoad() || HasProvisionalNavigation()) return; - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) { - if (app_history->HasOngoingNavigation()) + if (auto* navigation_api = + NavigationApi::navigation(*frame_->DomWindow())) { + if (navigation_api->HasOngoingNavigation()) return; } } @@ -753,18 +754,18 @@ return; } - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) { + if (auto* navigation_api = NavigationApi::navigation(*frame_->DomWindow())) { if (request.GetNavigationPolicy() == kNavigationPolicyCurrentTab && (!origin_window || origin_window->GetSecurityOrigin()->CanAccess( frame_->DomWindow()->GetSecurityOrigin()))) { - if (app_history->DispatchNavigateEvent( + if (navigation_api->DispatchNavigateEvent( url, request.Form(), NavigateEventType::kCrossDocument, frame_load_type, request.GetTriggeringEventInfo() == mojom::blink::TriggeringEventInfo::kFromTrustedEvent ? UserNavigationInvolvement::kActivation : UserNavigationInvolvement::kNone, - nullptr, nullptr) != AppHistory::DispatchResult::kContinue) { + nullptr, nullptr) != NavigationApi::DispatchResult::kContinue) { return; } } @@ -998,16 +999,16 @@ if (!CancelProvisionalLoaderForNewNavigation()) return; - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) { + if (auto* navigation_api = NavigationApi::navigation(*frame_->DomWindow())) { if (navigation_params->frame_load_type == WebFrameLoadType::kBackForward) { - auto result = app_history->DispatchNavigateEvent( + auto result = navigation_api->DispatchNavigateEvent( navigation_params->url, nullptr, NavigateEventType::kCrossDocument, WebFrameLoadType::kBackForward, navigation_params->is_browser_initiated ? UserNavigationInvolvement::kBrowserUI : UserNavigationInvolvement::kNone, nullptr, navigation_params->history_item); - DCHECK_EQ(result, AppHistory::DispatchResult::kContinue); + DCHECK_EQ(result, NavigationApi::DispatchResult::kContinue); if (!document_loader_) return; } @@ -1159,8 +1160,8 @@ } frame_->GetDocument()->CancelParsing(); - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) - app_history->InformAboutCanceledNavigation(); + if (auto* navigation_api = NavigationApi::navigation(*frame_->DomWindow())) + navigation_api->InformAboutCanceledNavigation(); if (document_loader_) document_loader_->StopLoading(); if (abort_client) @@ -1483,8 +1484,9 @@ frame_->GetDocument()); if (!frame_->GetDocument()->DispatchBeforeUnloadEvent( &page->GetChromeClient(), is_reload, did_allow_navigation)) { - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) - app_history->InformAboutCanceledNavigation(); + if (auto* navigation_api = + NavigationApi::navigation(*frame_->DomWindow())) + navigation_api->InformAboutCanceledNavigation(); return false; } @@ -1507,8 +1509,9 @@ descendant_frame->GetDocument()); if (!descendant_frame->GetDocument()->DispatchBeforeUnloadEvent( &page->GetChromeClient(), is_reload, did_allow_navigation)) { - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) - app_history->InformAboutCanceledNavigation(); + if (auto* navigation_api = + NavigationApi::navigation(*frame_->DomWindow())) + navigation_api->InformAboutCanceledNavigation(); return false; } } @@ -1580,8 +1583,8 @@ void FrameLoader::CancelClientNavigation() { if (!client_navigation_) return; - if (auto* app_history = AppHistory::navigation(*frame_->DomWindow())) - app_history->InformAboutCanceledNavigation(); + if (auto* navigation_api = NavigationApi::navigation(*frame_->DomWindow())) + navigation_api->InformAboutCanceledNavigation(); ResourceError error = ResourceError::CancelledError(client_navigation_->url); ClearClientNavigation(); if (WebPluginContainerImpl* plugin = frame_->GetWebPluginContainer())
diff --git a/third_party/blink/renderer/core/loader/http_equiv.cc b/third_party/blink/renderer/core/loader/http_equiv.cc index 3f6887f..5fe4730 100644 --- a/third_party/blink/renderer/core/loader/http_equiv.cc +++ b/third_party/blink/renderer/core/loader/http_equiv.cc
@@ -10,7 +10,6 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/scriptable_document_parser.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h"
diff --git a/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc b/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc index a0e6cf4..6b50371 100644 --- a/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc +++ b/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc
@@ -13,7 +13,7 @@ #include "third_party/blink/public/mojom/frame/frame.mojom-blink.h" #include "third_party/blink/renderer/core/core_probes_inl.h" #include "third_party/blink/renderer/core/frame/attribution_src_loader.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.cc b/third_party/blink/renderer/core/loader/worker_fetch_context.cc index 03d589c..6f90f4d 100644 --- a/third_party/blink/renderer/core/loader/worker_fetch_context.cc +++ b/third_party/blink/renderer/core/loader/worker_fetch_context.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/public/platform/web_url_loader_factory.h" #include "third_party/blink/public/platform/web_url_request.h" #include "third_party/blink/public/platform/web_worker_fetch_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/loader/mixed_content_checker.h" #include "third_party/blink/renderer/core/loader/subresource_filter.h" #include "third_party/blink/renderer/core/probe/core_probes.h"
diff --git a/third_party/blink/renderer/core/app_history/OWNERS b/third_party/blink/renderer/core/navigation_api/OWNERS similarity index 100% rename from third_party/blink/renderer/core/app_history/OWNERS rename to third_party/blink/renderer/core/navigation_api/OWNERS
diff --git a/third_party/blink/renderer/core/navigation_api/build.gni b/third_party/blink/renderer/core/navigation_api/build.gni new file mode 100644 index 0000000..ab401df2 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/build.gni
@@ -0,0 +1,19 @@ +# Copyright 2021 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. + +blink_core_sources_navigation_api = [ + "navigate_event.cc", + "navigate_event.h", + "navigation_api_navigation.cc", + "navigation_api_navigation.h", + "navigation_api.cc", + "navigation_api.h", + "navigation_current_entry_change_event.cc", + "navigation_current_entry_change_event.h", + "navigation_destination.h", + "navigation_history_entry.cc", + "navigation_history_entry.h", + "navigation_transition.cc", + "navigation_transition.h", +]
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_event.cc b/third_party/blink/renderer/core/navigation_api/navigate_event.cc similarity index 76% rename from third_party/blink/renderer/core/app_history/app_history_navigate_event.cc rename to third_party/blink/renderer/core/navigation_api/navigate_event.cc index 2c73e2e..58d3e59f 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_event.cc +++ b/third_party/blink/renderer/core/navigation_api/navigate_event.cc
@@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/app_history/app_history_navigate_event.h" +#include "third_party/blink/renderer/core/navigation_api/navigate_event.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom-shared.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event_init.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_transition_while_options.h" -#include "third_party/blink/renderer/core/app_history/app_history_destination.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigate_event_init.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_transition_while_options.h" #include "third_party/blink/renderer/core/dom/abort_signal.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/event_interface_names.h" @@ -15,14 +14,14 @@ #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/forms/form_data.h" #include "third_party/blink/renderer/core/inspector/console_message.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_destination.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" namespace blink { -AppHistoryNavigateEvent::AppHistoryNavigateEvent( - ExecutionContext* context, - const AtomicString& type, - AppHistoryNavigateEventInit* init) +NavigateEvent::NavigateEvent(ExecutionContext* context, + const AtomicString& type, + NavigateEventInit* init) : Event(type, init), ExecutionContextClient(context), navigation_type_(init->navigationType()), @@ -39,11 +38,10 @@ DCHECK(IsA<LocalDOMWindow>(context)); } -void AppHistoryNavigateEvent::transitionWhile( - ScriptState* script_state, - ScriptPromise newNavigationAction, - AppHistoryTransitionWhileOptions* options, - ExceptionState& exception_state) { +void NavigateEvent::transitionWhile(ScriptState* script_state, + ScriptPromise newNavigationAction, + NavigationTransitionWhileOptions* options, + ExceptionState& exception_state) { if (!DomWindow()) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, @@ -101,25 +99,25 @@ } } -bool AppHistoryNavigateEvent::ShouldResetFocus() const { +bool NavigateEvent::ShouldResetFocus() const { // We only do focus reset if transitionWhile() was called, opting us into the - // new default behavior which app history provides. + // new default behavior which the navigation API provides. if (navigation_action_promises_list_.IsEmpty()) return false; - // If we're in "app history mode" per the above, then either leaving focus + // If we're in "navigation API mode" per the above, then either leaving focus // reset behavior as the default, or setting it to "after-transition" // explicitly, should reset the focus. return !focus_reset_behavior_ || focus_reset_behavior_->AsEnum() == - V8AppHistoryFocusReset::Enum::kAfterTransition; + V8NavigationFocusReset::Enum::kAfterTransition; } -const AtomicString& AppHistoryNavigateEvent::InterfaceName() const { - return event_interface_names::kAppHistoryNavigateEvent; +const AtomicString& NavigateEvent::InterfaceName() const { + return event_interface_names::kNavigateEvent; } -void AppHistoryNavigateEvent::Trace(Visitor* visitor) const { +void NavigateEvent::Trace(Visitor* visitor) const { Event::Trace(visitor); ExecutionContextClient::Trace(visitor); visitor->Trace(destination_);
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_event.h b/third_party/blink/renderer/core/navigation_api/navigate_event.h similarity index 61% rename from third_party/blink/renderer/core/app_history/app_history_navigate_event.h rename to third_party/blink/renderer/core/navigation_api/navigate_event.h index bc336d09..ead9847 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_event.h +++ b/third_party/blink/renderer/core/navigation_api/navigate_event.h
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_NAVIGATE_EVENT_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_NAVIGATE_EVENT_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATE_EVENT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATE_EVENT_H_ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/web/web_frame_load_type.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_focus_reset.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_focus_reset.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" #include "third_party/blink/renderer/platform/heap/member.h" #include "third_party/blink/renderer/platform/supplementable.h" @@ -21,32 +21,31 @@ namespace blink { class AbortSignal; -class AppHistoryDestination; -class AppHistoryNavigateEventInit; -class AppHistoryTransitionWhileOptions; +class NavigationDestination; +class NavigateEventInit; +class NavigationTransitionWhileOptions; class ExceptionState; class FormData; class ScriptPromise; -class AppHistoryNavigateEvent final : public Event, - public ExecutionContextClient { +class NavigateEvent final : public Event, public ExecutionContextClient { DEFINE_WRAPPERTYPEINFO(); public: - static AppHistoryNavigateEvent* Create(ExecutionContext* context, - const AtomicString& type, - AppHistoryNavigateEventInit* init) { - return MakeGarbageCollected<AppHistoryNavigateEvent>(context, type, init); + static NavigateEvent* Create(ExecutionContext* context, + const AtomicString& type, + NavigateEventInit* init) { + return MakeGarbageCollected<NavigateEvent>(context, type, init); } - AppHistoryNavigateEvent(ExecutionContext* context, - const AtomicString& type, - AppHistoryNavigateEventInit* init); + NavigateEvent(ExecutionContext* context, + const AtomicString& type, + NavigateEventInit* init); void SetUrl(const KURL& url) { url_ = url; } String navigationType() { return navigation_type_; } - AppHistoryDestination* destination() { return destination_; } + NavigationDestination* destination() { return destination_; } bool canTransition() const { return can_transition_; } bool userInitiated() const { return user_initiated_; } bool hashChange() const { return hash_change_; } @@ -56,7 +55,7 @@ void transitionWhile(ScriptState*, ScriptPromise newNavigationAction, - AppHistoryTransitionWhileOptions*, + NavigationTransitionWhileOptions*, ExceptionState&); const HeapVector<ScriptPromise>& GetNavigationActionPromisesList() { @@ -69,14 +68,14 @@ private: String navigation_type_; - Member<AppHistoryDestination> destination_; + Member<NavigationDestination> destination_; bool can_transition_; bool user_initiated_; bool hash_change_; Member<AbortSignal> signal_; Member<FormData> form_data_; ScriptValue info_; - absl::optional<V8AppHistoryFocusReset> focus_reset_behavior_ = absl::nullopt; + absl::optional<V8NavigationFocusReset> focus_reset_behavior_ = absl::nullopt; KURL url_; HeapVector<ScriptPromise> navigation_action_promises_list_; @@ -84,4 +83,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_NAVIGATE_EVENT_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATE_EVENT_H_
diff --git a/third_party/blink/renderer/core/navigation_api/navigate_event.idl b/third_party/blink/renderer/core/navigation_api/navigate_event.idl new file mode 100644 index 0000000..09a91140 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigate_event.idl
@@ -0,0 +1,22 @@ +// Copyright 2021 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. + +// https://wicg.github.io/navigation-api/ +[ + Exposed=Window, + RuntimeEnabled=AppHistory +] interface NavigateEvent : Event { + [CallWith=ExecutionContext] constructor(DOMString type, NavigateEventInit eventInit); + + readonly attribute NavigationNavigationType navigationType; + readonly attribute NavigationDestination destination; + readonly attribute boolean canTransition; + readonly attribute boolean userInitiated; + readonly attribute boolean hashChange; + readonly attribute AbortSignal signal; + readonly attribute FormData? formData; + readonly attribute any info; + + [CallWith=ScriptState, RaisesException] void transitionWhile(Promise<void> newNavigationAction, optional NavigationTransitionWhileOptions options = {}); +};
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_event_init.idl b/third_party/blink/renderer/core/navigation_api/navigate_event_init.idl similarity index 63% rename from third_party/blink/renderer/core/app_history/app_history_navigate_event_init.idl rename to third_party/blink/renderer/core/navigation_api/navigate_event_init.idl index 4aaef755..9c8f6b0 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_event_init.idl +++ b/third_party/blink/renderer/core/navigation_api/navigate_event_init.idl
@@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ -enum AppHistoryNavigationType { +// https://wicg.github.io/navigation-api/ + +enum NavigationNavigationType { "reload", "push", "replace", "traverse" }; -dictionary AppHistoryNavigateEventInit : EventInit { - AppHistoryNavigationType navigationType = "push"; - required AppHistoryDestination destination; +dictionary NavigateEventInit : EventInit { + NavigationNavigationType navigationType = "push"; + required NavigationDestination destination; boolean canTransition = false; boolean userInitiated = false; boolean hashChange = false;
diff --git a/third_party/blink/renderer/core/navigation_api/navigation.idl b/third_party/blink/renderer/core/navigation_api/navigation.idl new file mode 100644 index 0000000..3a29669 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation.idl
@@ -0,0 +1,30 @@ +// Copyright 2021 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. + +// https://wicg.github.io/navigation-api/ +[ + Exposed=Window, + RuntimeEnabled=AppHistory, + ImplementedAs=NavigationApi +] interface Navigation : EventTarget { + readonly attribute NavigationHistoryEntry? currentEntry; + sequence<NavigationHistoryEntry> entries(); + [RaisesException, MeasureAs=AppHistory] void updateCurrentEntry(NavigationUpdateCurrentEntryOptions options); + readonly attribute NavigationTransition? transition; + + readonly attribute boolean canGoBack; + readonly attribute boolean canGoForward; + + [CallWith=ScriptState, MeasureAs=AppHistory] NavigationResult navigate(USVString url, optional NavigationNavigateOptions options = {}); + [CallWith=ScriptState, MeasureAs=AppHistory] NavigationResult reload(optional NavigationReloadOptions options = {}); + + [CallWith=ScriptState, MeasureAs=AppHistory] NavigationResult traverseTo(DOMString key, optional NavigationOptions options = {}); + [CallWith=ScriptState, MeasureAs=AppHistory] NavigationResult back(optional NavigationOptions options = {}); + [CallWith=ScriptState, MeasureAs=AppHistory] NavigationResult forward(optional NavigationOptions options = {}); + + attribute EventHandler onnavigate; + attribute EventHandler onnavigatesuccess; + attribute EventHandler onnavigateerror; + attribute EventHandler oncurrententrychange; +};
diff --git a/third_party/blink/renderer/core/app_history/app_history.cc b/third_party/blink/renderer/core/navigation_api/navigation_api.cc similarity index 77% rename from third_party/blink/renderer/core/app_history/app_history.cc rename to third_party/blink/renderer/core/navigation_api/navigation_api.cc index 85b93b5e..6d20791e 100644 --- a/third_party/blink/renderer/core/app_history/app_history.cc +++ b/third_party/blink/renderer/core/navigation_api/navigation_api.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/app_history/app_history.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include <memory> @@ -12,20 +12,14 @@ #include "third_party/blink/renderer/bindings/core/v8/script_function.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_current_change_event_init.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_event_init.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_navigate_options.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_reload_options.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_result.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_transition.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_update_current_options.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" -#include "third_party/blink/renderer/core/app_history/app_history_api_navigation.h" -#include "third_party/blink/renderer/core/app_history/app_history_current_change_event.h" -#include "third_party/blink/renderer/core/app_history/app_history_destination.h" -#include "third_party/blink/renderer/core/app_history/app_history_entry.h" -#include "third_party/blink/renderer/core/app_history/app_history_navigate_event.h" -#include "third_party/blink/renderer/core/app_history/app_history_transition.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigate_event_init.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_current_entry_change_event_init.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_navigate_options.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_reload_options.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_result.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_transition.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_update_current_entry_options.h" #include "third_party/blink/renderer/core/dom/abort_signal.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/event_target_names.h" @@ -36,6 +30,12 @@ #include "third_party/blink/renderer/core/html/forms/html_form_element.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/loader/frame_load_request.h" +#include "third_party/blink/renderer/core/navigation_api/navigate_event.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api_navigation.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_destination.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_history_entry.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_transition.h" #include "third_party/blink/renderer/platform/bindings/exception_context.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/to_v8.h" @@ -49,7 +49,7 @@ enum class ReactType { kImmediate, kTransitionWhile }; static void React(ScriptState* script_state, ScriptPromise promise, - AppHistoryApiNavigation* navigation, + NavigationApiNavigation* navigation, AbortSignal* signal, bool should_reset_focus, ReactType react_type) { @@ -63,7 +63,7 @@ ResolveType::kReject, react_type))); } - NavigateReaction(AppHistoryApiNavigation* navigation, + NavigateReaction(NavigationApiNavigation* navigation, AbortSignal* signal, bool should_reset_focus, ResolveType resolve_type, @@ -87,17 +87,18 @@ return ScriptValue(); } - AppHistory* app_history = AppHistory::navigation(*window); - app_history->ongoing_navigation_signal_ = nullptr; + NavigationApi* navigation_api = NavigationApi::navigation(*window); + navigation_api->ongoing_navigation_signal_ = nullptr; if (resolve_type_ == ResolveType::kFulfill) { - app_history->ResolvePromisesAndFireNavigateSuccessEvent(navigation_); + navigation_api->ResolvePromisesAndFireNavigateSuccessEvent(navigation_); } else { - app_history->RejectPromisesAndFireNavigateErrorEvent(navigation_, value); + navigation_api->RejectPromisesAndFireNavigateErrorEvent(navigation_, + value); } if (should_reset_focus_) { - auto* document = app_history->GetSupplementable()->document(); + auto* document = navigation_api->GetSupplementable()->document(); if (Element* focus_delegate = document->GetAutofocusDelegate()) { focus_delegate->focus(); } else { @@ -116,7 +117,7 @@ } private: - Member<AppHistoryApiNavigation> navigation_; + Member<NavigationApiNavigation> navigation_; Member<AbortSignal> signal_; bool should_reset_focus_; ResolveType resolve_type_; @@ -124,32 +125,32 @@ }; template <typename... DOMExceptionArgs> -AppHistoryResult* EarlyErrorResult(ScriptState* script_state, +NavigationResult* EarlyErrorResult(ScriptState* script_state, DOMExceptionArgs&&... args) { auto* ex = MakeGarbageCollected<DOMException>( std::forward<DOMExceptionArgs>(args)...); return EarlyErrorResult(script_state, ex); } -AppHistoryResult* EarlyErrorResult(ScriptState* script_state, +NavigationResult* EarlyErrorResult(ScriptState* script_state, DOMException* ex) { - auto* result = AppHistoryResult::Create(); + auto* result = NavigationResult::Create(); result->setCommitted(ScriptPromise::RejectWithDOMException(script_state, ex)); result->setFinished(ScriptPromise::RejectWithDOMException(script_state, ex)); return result; } -AppHistoryResult* EarlyErrorResult(ScriptState* script_state, +NavigationResult* EarlyErrorResult(ScriptState* script_state, v8::Local<v8::Value> ex) { - auto* result = AppHistoryResult::Create(); + auto* result = NavigationResult::Create(); result->setCommitted(ScriptPromise::Reject(script_state, ex)); result->setFinished(ScriptPromise::Reject(script_state, ex)); return result; } -AppHistoryResult* EarlySuccessResult(ScriptState* script_state, - AppHistoryEntry* entry) { - auto* result = AppHistoryResult::Create(); +NavigationResult* EarlySuccessResult(ScriptState* script_state, + NavigationHistoryEntry* entry) { + auto* result = NavigationResult::Create(); result->setCommitted( ScriptPromise::Cast(script_state, ToV8(entry, script_state))); result->setFinished( @@ -173,41 +174,42 @@ return String(); } -const char AppHistory::kSupplementName[] = "AppHistory"; +const char NavigationApi::kSupplementName[] = "NavigationApi"; -AppHistory* AppHistory::navigation(LocalDOMWindow& window) { +NavigationApi* NavigationApi::navigation(LocalDOMWindow& window) { return RuntimeEnabledFeatures::AppHistoryEnabled(&window) ? From(window) : nullptr; } -AppHistory* AppHistory::From(LocalDOMWindow& window) { - auto* app_history = Supplement<LocalDOMWindow>::From<AppHistory>(window); - if (!app_history) { - app_history = MakeGarbageCollected<AppHistory>(window); - Supplement<LocalDOMWindow>::ProvideTo(window, app_history); +NavigationApi* NavigationApi::From(LocalDOMWindow& window) { + auto* navigation_api = + Supplement<LocalDOMWindow>::From<NavigationApi>(window); + if (!navigation_api) { + navigation_api = MakeGarbageCollected<NavigationApi>(window); + Supplement<LocalDOMWindow>::ProvideTo(window, navigation_api); } - return app_history; + return navigation_api; } -AppHistory::AppHistory(LocalDOMWindow& window) +NavigationApi::NavigationApi(LocalDOMWindow& window) : Supplement<LocalDOMWindow>(window) {} -void AppHistory::setOnnavigate(EventListener* listener) { +void NavigationApi::setOnnavigate(EventListener* listener) { UseCounter::Count(GetSupplementable(), WebFeature::kAppHistory); SetAttributeEventListener(event_type_names::kNavigate, listener); } -void AppHistory::PopulateKeySet() { +void NavigationApi::PopulateKeySet() { DCHECK(keys_to_indices_.IsEmpty()); for (wtf_size_t i = 0; i < entries_.size(); i++) keys_to_indices_.insert(entries_[i]->key(), i); } -void AppHistory::InitializeForNewWindow( +void NavigationApi::InitializeForNewWindow( HistoryItem& current, WebFrameLoadType load_type, CommitReason commit_reason, - AppHistory* previous, + NavigationApi* previous, const WebVector<WebHistoryItem>& back_entries, const WebVector<WebHistoryItem>& forward_entries) { DCHECK(entries_.IsEmpty()); @@ -219,12 +221,12 @@ return; // Under most circumstances, the browser process provides the information - // need to initialize appHistory's entries array from - // |app_history_back_entries_| and |app_history_forward_entries_|. - // However, these are not available when the renderer handles the - // navigation entirely, so in those cases (javascript: urls, XSLT commits, - // and non-back/forward about:blank), copy the array from the previous - // window and use the same update algorithm as same-document navigations. + // need to initialize the navigation API's entries array from |back_entries| + // and |forward_entries|. However, these are not available when the renderer + // handles the navigation entirely, so in those cases (javascript: urls, XSLT + // commits, and non-back/forward about:blank), copy the array from the + // previous window and use the same update algorithm as same-document + // navigations. if (commit_reason != CommitReason::kRegular || (current.Url() == BlankURL() && !IsBackForwardLoadType(load_type)) || (current.Url().IsAboutSrcdocURL() && !IsBackForwardLoadType(load_type))) { @@ -240,22 +242,22 @@ entries_.ReserveCapacity(base::checked_cast<wtf_size_t>( back_entries.size() + forward_entries.size() + 1)); for (const auto& entry : back_entries) { - entries_.emplace_back( - MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), entry)); + entries_.emplace_back(MakeGarbageCollected<NavigationHistoryEntry>( + GetSupplementable(), entry)); } current_entry_index_ = base::checked_cast<wtf_size_t>(back_entries.size()); - entries_.emplace_back( - MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), ¤t)); + entries_.emplace_back(MakeGarbageCollected<NavigationHistoryEntry>( + GetSupplementable(), ¤t)); for (const auto& entry : forward_entries) { - entries_.emplace_back( - MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), entry)); + entries_.emplace_back(MakeGarbageCollected<NavigationHistoryEntry>( + GetSupplementable(), entry)); } PopulateKeySet(); } -void AppHistory::CloneFromPrevious(AppHistory& previous) { +void NavigationApi::CloneFromPrevious(NavigationApi& previous) { DCHECK(entries_.IsEmpty()); entries_.ReserveCapacity(previous.entries_.size()); for (wtf_size_t i = 0; i < previous.entries_.size(); i++) { @@ -271,23 +273,24 @@ new_item->SetAppHistoryKey(old_item->GetAppHistoryKey()); new_item->SetAppHistoryId(old_item->GetAppHistoryId()); new_item->SetAppHistoryState(old_item->GetAppHistoryState()); - entries_.emplace_back( - MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), new_item)); + entries_.emplace_back(MakeGarbageCollected<NavigationHistoryEntry>( + GetSupplementable(), new_item)); } current_entry_index_ = previous.current_entry_index_; PopulateKeySet(); } -void AppHistory::UpdateForNavigation(HistoryItem& item, WebFrameLoadType type) { +void NavigationApi::UpdateForNavigation(HistoryItem& item, + WebFrameLoadType type) { // A same-document navigation (e.g., a document.open()) in a // |HasEntriesAndEventsDisabled()| situation will try to operate on an empty - // |entries_|. appHistory considers this a no-op. + // |entries_|. The navigation API considers this a no-op. if (entries_.IsEmpty()) return; - AppHistoryEntry* old_current = currentEntry(); + NavigationHistoryEntry* old_current = currentEntry(); - HeapVector<Member<AppHistoryEntry>> disposed_entries; + HeapVector<Member<NavigationHistoryEntry>> disposed_entries; if (type == WebFrameLoadType::kBackForward) { // If this is a same-document back/forward navigation, the new current // entry should already be present in entries_ and its key in @@ -314,7 +317,8 @@ // WebFrameLoadType::kReplaceCurrentItem, it didn't change). Create the new // current entry. entries_[current_entry_index_] = - MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), &item); + MakeGarbageCollected<NavigationHistoryEntry>(GetSupplementable(), + &item); keys_to_indices_.insert(entries_[current_entry_index_]->key(), current_entry_index_); } @@ -330,10 +334,10 @@ entries_[current_entry_index_]); } - auto* init = AppHistoryCurrentChangeEventInit::Create(); + auto* init = NavigationCurrentEntryChangeEventInit::Create(); init->setNavigationType(DetermineNavigationType(type)); init->setFrom(old_current); - DispatchEvent(*AppHistoryCurrentChangeEvent::Create( + DispatchEvent(*NavigationCurrentEntryChangeEvent::Create( event_type_names::kCurrententrychange, init)); for (const auto& disposed_entry : disposed_entries) { @@ -341,11 +345,11 @@ } } -AppHistoryEntry* AppHistory::GetEntryForRestore( +NavigationHistoryEntry* NavigationApi::GetEntryForRestore( const mojom::blink::AppHistoryEntryPtr& entry) { const auto& it = keys_to_indices_.find(entry->key); if (it != keys_to_indices_.end()) { - AppHistoryEntry* existing_entry = entries_[it->value]; + NavigationHistoryEntry* existing_entry = entries_[it->value]; if (existing_entry->id() == entry->id) return existing_entry; } @@ -359,25 +363,26 @@ item->SetAppHistoryKey(entry->key); item->SetAppHistoryId(entry->id); item->SetAppHistoryState(SerializedScriptValue::Create(entry->state)); - return MakeGarbageCollected<AppHistoryEntry>(GetSupplementable(), item); + return MakeGarbageCollected<NavigationHistoryEntry>(GetSupplementable(), + item); } // static void FireDisposeEventsAsync( - HeapVector<Member<AppHistoryEntry>>* disposed_entries) { + HeapVector<Member<NavigationHistoryEntry>>* disposed_entries) { for (const auto& entry : *disposed_entries) { entry->DispatchEvent(*Event::Create(event_type_names::kDispose)); } } -void AppHistory::SetEntriesForRestore( +void NavigationApi::SetEntriesForRestore( const mojom::blink::AppHistoryEntryArraysPtr& entry_arrays) { // If this window HasEntriesAndEventsDisabled(), we shouldn't attempt to // restore anything. if (HasEntriesAndEventsDisabled()) return; - HeapVector<Member<AppHistoryEntry>> new_entries; + HeapVector<Member<NavigationHistoryEntry>> new_entries; new_entries.ReserveCapacity( base::checked_cast<wtf_size_t>(entry_arrays->back_entries.size() + entry_arrays->forward_entries.size() + 1)); @@ -395,8 +400,8 @@ // |new_entries| now contains the previous entries_. Find the ones that are no // longer in entries_ so they can be disposed. - HeapVector<Member<AppHistoryEntry>>* disposed_entries = - MakeGarbageCollected<HeapVector<Member<AppHistoryEntry>>>(); + HeapVector<Member<NavigationHistoryEntry>>* disposed_entries = + MakeGarbageCollected<HeapVector<Member<NavigationHistoryEntry>>>(); for (const auto& entry : new_entries) { const auto& it = keys_to_indices_.find(entry->key()); if (it == keys_to_indices_.end() || entries_[it->value] != entry) @@ -408,28 +413,30 @@ WrapPersistent(disposed_entries))); } -AppHistoryEntry* AppHistory::currentEntry() const { +NavigationHistoryEntry* NavigationApi::currentEntry() const { // current_index_ is initialized to -1 and set >= 0 when entries_ is - // populated. It will still be negative if the appHistory of an initial empty - // document or opaque-origin document is accessed. + // populated. It will still be negative if the navigation object of an initial + // empty document or opaque-origin document is accessed. return !HasEntriesAndEventsDisabled() && current_entry_index_ >= 0 ? entries_[current_entry_index_] : nullptr; } -HeapVector<Member<AppHistoryEntry>> AppHistory::entries() { - return HasEntriesAndEventsDisabled() ? HeapVector<Member<AppHistoryEntry>>() - : entries_; +HeapVector<Member<NavigationHistoryEntry>> NavigationApi::entries() { + return HasEntriesAndEventsDisabled() + ? HeapVector<Member<NavigationHistoryEntry>>() + : entries_; } -void AppHistory::updateCurrentEntry(AppHistoryUpdateCurrentOptions* options, - ExceptionState& exception_state) { - AppHistoryEntry* current_entry = currentEntry(); +void NavigationApi::updateCurrentEntry( + NavigationUpdateCurrentEntryOptions* options, + ExceptionState& exception_state) { + NavigationHistoryEntry* current_entry = currentEntry(); if (!current_entry) { exception_state.ThrowDOMException( DOMExceptionCode::kInvalidStateError, - "updateCurrent() cannot be called when appHistory.current is null."); + "updateCurrent() cannot be called when navigation.current is null."); return; } @@ -440,15 +447,15 @@ current_entry->GetItem()->SetAppHistoryState(std::move(serialized_state)); - auto* init = AppHistoryCurrentChangeEventInit::Create(); + auto* init = NavigationCurrentEntryChangeEventInit::Create(); init->setFrom(current_entry); - DispatchEvent(*AppHistoryCurrentChangeEvent::Create( + DispatchEvent(*NavigationCurrentEntryChangeEvent::Create( event_type_names::kCurrententrychange, init)); } -AppHistoryResult* AppHistory::navigate(ScriptState* script_state, - const String& url, - AppHistoryNavigateOptions* options) { +NavigationResult* NavigationApi::navigate(ScriptState* script_state, + const String& url, + NavigationNavigateOptions* options) { KURL completed_url = GetSupplementable()->CompleteURL(url); if (!completed_url.IsValid()) { return EarlyErrorResult(script_state, DOMExceptionCode::kSyntaxError, @@ -467,7 +474,7 @@ "navigate"); serialized_state = SerializeState(options->state(), exception_state); if (exception_state.HadException()) { - AppHistoryResult* result = + NavigationResult* result = EarlyErrorResult(script_state, exception_state.GetException()); exception_state.ClearException(); return result; @@ -484,8 +491,8 @@ frame_load_type); } -AppHistoryResult* AppHistory::reload(ScriptState* script_state, - AppHistoryReloadOptions* options) { +NavigationResult* NavigationApi::reload(ScriptState* script_state, + NavigationReloadOptions* options) { if (DOMException* maybe_ex = PerformSharedNavigationChecks("reload()")) return EarlyErrorResult(script_state, maybe_ex); @@ -497,12 +504,12 @@ ExceptionContext::Context::kOperationInvoke, "AppHistory", "reload"); serialized_state = SerializeState(options->state(), exception_state); if (exception_state.HadException()) { - AppHistoryResult* result = + NavigationResult* result = EarlyErrorResult(script_state, exception_state.GetException()); exception_state.ClearException(); return result; } - } else if (AppHistoryEntry* current_entry = currentEntry()) { + } else if (NavigationHistoryEntry* current_entry = currentEntry()) { serialized_state = current_entry->GetItem()->GetAppHistoryState(); } } @@ -512,18 +519,18 @@ WebFrameLoadType::kReload); } -AppHistoryResult* AppHistory::PerformNonTraverseNavigation( +NavigationResult* NavigationApi::PerformNonTraverseNavigation( ScriptState* script_state, const KURL& url, scoped_refptr<SerializedScriptValue> serialized_state, - AppHistoryNavigationOptions* options, + NavigationOptions* options, WebFrameLoadType frame_load_type) { DCHECK(frame_load_type == WebFrameLoadType::kReplaceCurrentItem || frame_load_type == WebFrameLoadType::kReload || frame_load_type == WebFrameLoadType::kStandard); - AppHistoryApiNavigation* navigation = - MakeGarbageCollected<AppHistoryApiNavigation>( + NavigationApiNavigation* navigation = + MakeGarbageCollected<NavigationApiNavigation>( script_state, this, options, String(), std::move(serialized_state)); upcoming_non_traversal_navigation_ = navigation; @@ -545,12 +552,12 @@ if (SerializedScriptValue* state = navigation->TakeSerializedState()) { currentEntry()->GetItem()->SetAppHistoryState(state); } - return navigation->GetAppHistoryResult(); + return navigation->GetNavigationResult(); } -AppHistoryResult* AppHistory::traverseTo(ScriptState* script_state, - const String& key, - AppHistoryNavigationOptions* options) { +NavigationResult* NavigationApi::traverseTo(ScriptState* script_state, + const String& key, + NavigationOptions* options) { if (DOMException* maybe_ex = PerformSharedNavigationChecks("goTo()/back()/forward()")) { return EarlyErrorResult(script_state, maybe_ex); @@ -566,10 +573,10 @@ auto previous_navigation = upcoming_traversals_.find(key); if (previous_navigation != upcoming_traversals_.end()) - return previous_navigation->value->GetAppHistoryResult(); + return previous_navigation->value->GetNavigationResult(); - AppHistoryApiNavigation* ongoing_navigation = - MakeGarbageCollected<AppHistoryApiNavigation>(script_state, this, options, + NavigationApiNavigation* ongoing_navigation = + MakeGarbageCollected<NavigationApiNavigation>(script_state, this, options, key); upcoming_traversals_.insert(key, ongoing_navigation); GetSupplementable() @@ -577,20 +584,20 @@ ->GetLocalFrameHostRemote() .NavigateToAppHistoryKey(key, LocalFrame::HasTransientUserActivation( GetSupplementable()->GetFrame())); - return ongoing_navigation->GetAppHistoryResult(); + return ongoing_navigation->GetNavigationResult(); } -bool AppHistory::canGoBack() const { +bool NavigationApi::canGoBack() const { return !HasEntriesAndEventsDisabled() && current_entry_index_ > 0; } -bool AppHistory::canGoForward() const { +bool NavigationApi::canGoForward() const { return !HasEntriesAndEventsDisabled() && current_entry_index_ != -1 && static_cast<size_t>(current_entry_index_) < entries_.size() - 1; } -AppHistoryResult* AppHistory::back(ScriptState* script_state, - AppHistoryNavigationOptions* options) { +NavigationResult* NavigationApi::back(ScriptState* script_state, + NavigationOptions* options) { if (!canGoBack()) { return EarlyErrorResult(script_state, DOMExceptionCode::kInvalidStateError, "Cannot go back"); @@ -599,8 +606,8 @@ options); } -AppHistoryResult* AppHistory::forward(ScriptState* script_state, - AppHistoryNavigationOptions* options) { +NavigationResult* NavigationApi::forward(ScriptState* script_state, + NavigationOptions* options) { if (!canGoForward()) { return EarlyErrorResult(script_state, DOMExceptionCode::kInvalidStateError, "Cannot go forward"); @@ -609,7 +616,7 @@ options); } -DOMException* AppHistory::PerformSharedNavigationChecks( +DOMException* NavigationApi::PerformSharedNavigationChecks( const String& method_name_for_error_message) { if (!GetSupplementable()->GetFrame()) { return MakeGarbageCollected<DOMException>( @@ -626,7 +633,7 @@ return nullptr; } -scoped_refptr<SerializedScriptValue> AppHistory::SerializeState( +scoped_refptr<SerializedScriptValue> NavigationApi::SerializeState( const ScriptValue& value, ExceptionState& exception_state) { return SerializedScriptValue::Serialize( @@ -636,7 +643,7 @@ exception_state); } -void AppHistory::PromoteUpcomingNavigationToOngoing(const String& key) { +void NavigationApi::PromoteUpcomingNavigationToOngoing(const String& key) { DCHECK(!ongoing_navigation_); if (!key.IsNull()) { DCHECK(!upcoming_non_traversal_navigation_); @@ -650,7 +657,7 @@ } } -bool AppHistory::HasEntriesAndEventsDisabled() const { +bool NavigationApi::HasEntriesAndEventsDisabled() const { auto* frame = GetSupplementable()->GetFrame(); return !frame || !GetSupplementable() @@ -660,7 +667,7 @@ GetSupplementable()->GetSecurityOrigin()->IsOpaque(); } -AppHistory::DispatchResult AppHistory::DispatchNavigateEvent( +NavigationApi::DispatchResult NavigationApi::DispatchNavigateEvent( const KURL& url, HTMLFormElement* form, NavigateEventType event_type, @@ -706,7 +713,7 @@ return DispatchResult::kAbort; } - auto* init = AppHistoryNavigateEventInit::Create(); + auto* init = NavigateEventInit::Create(); const String& navigation_type = DetermineNavigationType(type); init->setNavigationType(navigation_type); @@ -715,8 +722,8 @@ destination_state = destination_item->GetAppHistoryState(); else if (ongoing_navigation_) destination_state = ongoing_navigation_->GetSerializedState(); - AppHistoryDestination* destination = - MakeGarbageCollected<AppHistoryDestination>( + NavigationDestination* destination = + MakeGarbageCollected<NavigationDestination>( url, event_type != NavigateEventType::kCrossDocument, destination_state); if (type == WebFrameLoadType::kBackForward) { @@ -744,7 +751,7 @@ if (ongoing_navigation_) init->setInfo(ongoing_navigation_->GetInfo()); init->setSignal(MakeGarbageCollected<AbortSignal>(GetSupplementable())); - auto* navigate_event = AppHistoryNavigateEvent::Create( + auto* navigate_event = NavigateEvent::Create( GetSupplementable(), event_type_names::kNavigate, init); navigate_event->SetUrl(url); @@ -763,7 +770,7 @@ auto promise_list = navigate_event->GetNavigationActionPromisesList(); if (!promise_list.IsEmpty()) { - transition_ = MakeGarbageCollected<AppHistoryTransition>( + transition_ = MakeGarbageCollected<NavigationTransition>( script_state, navigation_type, currentEntry()); // In the spec, the URL and history update steps are not called for reloads. // In our implementation, we call the corresponding function anyway, but @@ -809,7 +816,7 @@ : DispatchResult::kTransitionWhile; } -void AppHistory::InformAboutCanceledNavigation() { +void NavigationApi::InformAboutCanceledNavigation() { if (ongoing_navigation_signal_) { auto* script_state = ToScriptStateForMainWorld(GetSupplementable()->GetFrame()); @@ -829,7 +836,7 @@ ToScriptStateForMainWorld(GetSupplementable()->GetFrame()); ScriptState::Scope scope(script_state); - HeapVector<Member<AppHistoryApiNavigation>> traversals; + HeapVector<Member<NavigationApiNavigation>> traversals; CopyValuesToVector(upcoming_traversals_, traversals); for (auto& traversal : traversals) FinalizeWithAbortedNavigationError(script_state, traversal); @@ -837,8 +844,8 @@ } } -void AppHistory::RejectPromisesAndFireNavigateErrorEvent( - AppHistoryApiNavigation* navigation, +void NavigationApi::RejectPromisesAndFireNavigateErrorEvent( + NavigationApiNavigation* navigation, ScriptValue value) { auto* isolate = GetSupplementable()->GetIsolate(); v8::Local<v8::Message> message = @@ -860,8 +867,8 @@ } } -void AppHistory::ResolvePromisesAndFireNavigateSuccessEvent( - AppHistoryApiNavigation* navigation) { +void NavigationApi::ResolvePromisesAndFireNavigateSuccessEvent( + NavigationApiNavigation* navigation) { DispatchEvent(*Event::Create(event_type_names::kNavigatesuccess)); if (navigation) @@ -873,7 +880,7 @@ } } -void AppHistory::CleanupApiNavigation(AppHistoryApiNavigation& navigation) { +void NavigationApi::CleanupApiNavigation(NavigationApiNavigation& navigation) { if (&navigation == ongoing_navigation_) { ongoing_navigation_ = nullptr; } else { @@ -883,9 +890,9 @@ } } -void AppHistory::FinalizeWithAbortedNavigationError( +void NavigationApi::FinalizeWithAbortedNavigationError( ScriptState* script_state, - AppHistoryApiNavigation* navigation) { + NavigationApiNavigation* navigation) { if (ongoing_navigate_event_) { ongoing_navigate_event_->preventDefault(); ongoing_navigate_event_ = nullptr; @@ -904,18 +911,18 @@ RejectPromisesAndFireNavigateErrorEvent(navigation, error); } -int AppHistory::GetIndexFor(AppHistoryEntry* entry) { +int NavigationApi::GetIndexFor(NavigationHistoryEntry* entry) { const auto& it = keys_to_indices_.find(entry->key()); if (it == keys_to_indices_.end() || entry != entries_[it->value]) return -1; return it->value; } -const AtomicString& AppHistory::InterfaceName() const { - return event_target_names::kAppHistory; +const AtomicString& NavigationApi::InterfaceName() const { + return event_target_names::kNavigation; } -void AppHistory::Trace(Visitor* visitor) const { +void NavigationApi::Trace(Visitor* visitor) const { EventTargetWithInlineData::Trace(visitor); Supplement<LocalDOMWindow>::Trace(visitor); visitor->Trace(entries_);
diff --git a/third_party/blink/renderer/core/app_history/app_history.h b/third_party/blink/renderer/core/navigation_api/navigation_api.h similarity index 63% rename from third_party/blink/renderer/core/app_history/app_history.h rename to third_party/blink/renderer/core/navigation_api/navigation_api.h index aa99d8d6..159f1e59 100644 --- a/third_party/blink/renderer/core/app_history/app_history.h +++ b/third_party/blink/renderer/core/navigation_api/navigation_api.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_API_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_API_H_ #include "base/memory/scoped_refptr.h" #include "third_party/blink/public/mojom/navigation/app_history_entry_arrays.mojom-blink.h" @@ -22,15 +22,15 @@ namespace blink { class AbortSignal; -class AppHistoryApiNavigation; -class AppHistoryUpdateCurrentOptions; -class AppHistoryEntry; -class AppHistoryNavigateEvent; -class AppHistoryNavigateOptions; -class AppHistoryReloadOptions; -class AppHistoryResult; -class AppHistoryNavigationOptions; -class AppHistoryTransition; +class NavigationApiNavigation; +class NavigationUpdateCurrentEntryOptions; +class NavigationHistoryEntry; +class NavigateEvent; +class NavigationNavigateOptions; +class NavigationReloadOptions; +class NavigationResult; +class NavigationOptions; +class NavigationTransition; class DOMException; class HTMLFormElement; class HistoryItem; @@ -42,23 +42,23 @@ enum class UserNavigationInvolvement { kBrowserUI, kActivation, kNone }; enum class NavigateEventType { kFragment, kHistoryApi, kCrossDocument }; -class CORE_EXPORT AppHistory final : public EventTargetWithInlineData, - public Supplement<LocalDOMWindow> { +class CORE_EXPORT NavigationApi final : public EventTargetWithInlineData, + public Supplement<LocalDOMWindow> { DEFINE_WRAPPERTYPEINFO(); public: static const char kSupplementName[]; - static AppHistory* navigation(LocalDOMWindow&); - // Unconditionally creates AppHistory, even if the RuntimeEnabledFeatures is - // disabled. - static AppHistory* From(LocalDOMWindow&); - explicit AppHistory(LocalDOMWindow&); - ~AppHistory() final = default; + static NavigationApi* navigation(LocalDOMWindow&); + // Unconditionally creates NavigationApi, even if the RuntimeEnabledFeatures + // is disabled. + static NavigationApi* From(LocalDOMWindow&); + explicit NavigationApi(LocalDOMWindow&); + ~NavigationApi() final = default; void InitializeForNewWindow(HistoryItem& current, WebFrameLoadType, CommitReason, - AppHistory* previous, + NavigationApi* previous, const WebVector<WebHistoryItem>& back_entries, const WebVector<WebHistoryItem>& forward_entries); void UpdateForNavigation(HistoryItem&, WebFrameLoadType); @@ -67,24 +67,25 @@ bool HasOngoingNavigation() const { return ongoing_navigation_signal_; } // Web-exposed: - AppHistoryEntry* currentEntry() const; - HeapVector<Member<AppHistoryEntry>> entries(); - void updateCurrentEntry(AppHistoryUpdateCurrentOptions*, ExceptionState&); - AppHistoryTransition* transition() const { return transition_; } + NavigationHistoryEntry* currentEntry() const; + HeapVector<Member<NavigationHistoryEntry>> entries(); + void updateCurrentEntry(NavigationUpdateCurrentEntryOptions*, + ExceptionState&); + NavigationTransition* transition() const { return transition_; } bool canGoBack() const; bool canGoForward() const; - AppHistoryResult* navigate(ScriptState*, + NavigationResult* navigate(ScriptState*, const String& url, - AppHistoryNavigateOptions*); - AppHistoryResult* reload(ScriptState*, AppHistoryReloadOptions*); + NavigationNavigateOptions*); + NavigationResult* reload(ScriptState*, NavigationReloadOptions*); - AppHistoryResult* traverseTo(ScriptState*, + NavigationResult* traverseTo(ScriptState*, const String& key, - AppHistoryNavigationOptions*); - AppHistoryResult* back(ScriptState*, AppHistoryNavigationOptions*); - AppHistoryResult* forward(ScriptState*, AppHistoryNavigationOptions*); + NavigationOptions*); + NavigationResult* back(ScriptState*, NavigationOptions*); + NavigationResult* forward(ScriptState*, NavigationOptions*); // onnavigate is defined manually so that a UseCounter can be applied to just // the setter @@ -109,7 +110,7 @@ bool is_synchronously_committed = true); void InformAboutCanceledNavigation(); - int GetIndexFor(AppHistoryEntry*); + int GetIndexFor(NavigationHistoryEntry*); // EventTargetWithInlineData overrides: const AtomicString& InterfaceName() const final; @@ -121,48 +122,49 @@ private: friend class NavigateReaction; - friend class AppHistoryApiNavigation; - void CloneFromPrevious(AppHistory&); - AppHistoryEntry* GetEntryForRestore(const mojom::blink::AppHistoryEntryPtr&); + friend class NavigationApiNavigation; + void CloneFromPrevious(NavigationApi&); + NavigationHistoryEntry* GetEntryForRestore( + const mojom::blink::AppHistoryEntryPtr&); void PopulateKeySet(); void FinalizeWithAbortedNavigationError(ScriptState*, - AppHistoryApiNavigation*); - void ResolvePromisesAndFireNavigateSuccessEvent(AppHistoryApiNavigation*); - void RejectPromisesAndFireNavigateErrorEvent(AppHistoryApiNavigation*, + NavigationApiNavigation*); + void ResolvePromisesAndFireNavigateSuccessEvent(NavigationApiNavigation*); + void RejectPromisesAndFireNavigateErrorEvent(NavigationApiNavigation*, ScriptValue); - AppHistoryResult* PerformNonTraverseNavigation( + NavigationResult* PerformNonTraverseNavigation( ScriptState*, const KURL&, scoped_refptr<SerializedScriptValue>, - AppHistoryNavigationOptions*, + NavigationOptions*, WebFrameLoadType); DOMException* PerformSharedNavigationChecks( const String& method_name_for_error_message); void PromoteUpcomingNavigationToOngoing(const String& key); - void CleanupApiNavigation(AppHistoryApiNavigation&); + void CleanupApiNavigation(NavigationApiNavigation&); scoped_refptr<SerializedScriptValue> SerializeState(const ScriptValue&, ExceptionState&); bool HasEntriesAndEventsDisabled() const; - HeapVector<Member<AppHistoryEntry>> entries_; + HeapVector<Member<NavigationHistoryEntry>> entries_; HashMap<String, int> keys_to_indices_; int current_entry_index_ = -1; - Member<AppHistoryTransition> transition_; + Member<NavigationTransition> transition_; - Member<AppHistoryApiNavigation> ongoing_navigation_; - HeapHashMap<String, Member<AppHistoryApiNavigation>> upcoming_traversals_; - Member<AppHistoryApiNavigation> upcoming_non_traversal_navigation_; + Member<NavigationApiNavigation> ongoing_navigation_; + HeapHashMap<String, Member<NavigationApiNavigation>> upcoming_traversals_; + Member<NavigationApiNavigation> upcoming_non_traversal_navigation_; - Member<AppHistoryNavigateEvent> ongoing_navigate_event_; + Member<NavigateEvent> ongoing_navigate_event_; Member<AbortSignal> ongoing_navigation_signal_; }; } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_API_H_
diff --git a/third_party/blink/renderer/core/app_history/app_history_api_navigation.cc b/third_party/blink/renderer/core/navigation_api/navigation_api_navigation.cc similarity index 66% rename from third_party/blink/renderer/core/app_history/app_history_api_navigation.cc rename to third_party/blink/renderer/core/navigation_api/navigation_api_navigation.cc index 79f9bbd..d433a8c 100644 --- a/third_party/blink/renderer/core/app_history/app_history_api_navigation.cc +++ b/third_party/blink/renderer/core/navigation_api/navigation_api_navigation.cc
@@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/app_history/app_history_api_navigation.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api_navigation.h" #include "base/check_op.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_navigation_options.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_app_history_result.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" -#include "third_party/blink/renderer/core/app_history/app_history_entry.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_options.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_result.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_history_entry.h" #include "third_party/blink/renderer/platform/bindings/script_state.h" namespace blink { -AppHistoryApiNavigation::AppHistoryApiNavigation( +NavigationApiNavigation::NavigationApiNavigation( ScriptState* script_state, - AppHistory* app_history, - AppHistoryNavigationOptions* options, + NavigationApi* navigation_api, + NavigationOptions* options, const String& key, scoped_refptr<SerializedScriptValue> state) : serialized_state_(std::move(state)), @@ -26,19 +26,19 @@ ScriptValue(script_state->GetIsolate(), v8::Undefined(script_state->GetIsolate())))), key_(key), - app_history_(app_history), + navigation_api_(navigation_api), committed_resolver_( MakeGarbageCollected<ScriptPromiseResolver>(script_state)), finished_resolver_( MakeGarbageCollected<ScriptPromiseResolver>(script_state)), - result_(AppHistoryResult::Create()) { + result_(NavigationResult::Create()) { result_->setCommitted(committed_resolver_->Promise()); result_->setFinished(finished_resolver_->Promise()); // The web developer doesn't necessarily care about finished promise // rejections: // * They could be listening to other transition-failure signals, like the - // navigateerror event, or appHistory.transition.finished. + // navigateerror event, or navigation.transition.finished. // * They could be doing synchronous navigations within the same task, in // which case the second will always abort the first (causing a rejected // finished promise), but they might not care @@ -50,26 +50,26 @@ finished_resolver_->Promise().MarkAsHandled(); } -void AppHistoryApiNavigation::NotifyAboutTheCommittedToEntry( - AppHistoryEntry* entry) { +void NavigationApiNavigation::NotifyAboutTheCommittedToEntry( + NavigationHistoryEntry* entry) { DCHECK_EQ(committed_to_entry_, nullptr); committed_to_entry_ = entry; committed_resolver_->Resolve(committed_to_entry_); } -void AppHistoryApiNavigation::ResolveFinishedPromise() { - if (!app_history_) +void NavigationApiNavigation::ResolveFinishedPromise() { + if (!navigation_api_) return; finished_resolver_->Resolve(committed_to_entry_); - app_history_->CleanupApiNavigation(*this); - app_history_ = nullptr; + navigation_api_->CleanupApiNavigation(*this); + navigation_api_ = nullptr; } -void AppHistoryApiNavigation::RejectFinishedPromise(const ScriptValue& value) { - if (!app_history_) +void NavigationApiNavigation::RejectFinishedPromise(const ScriptValue& value) { + if (!navigation_api_) return; finished_resolver_->Reject(value); @@ -82,11 +82,11 @@ serialized_state_.reset(); - app_history_->CleanupApiNavigation(*this); - app_history_ = nullptr; + navigation_api_->CleanupApiNavigation(*this); + navigation_api_ = nullptr; } -void AppHistoryApiNavigation::CleanupForCrossDocument() { +void NavigationApiNavigation::CleanupForCrossDocument() { DCHECK_EQ(committed_to_entry_, nullptr); committed_resolver_->Detach(); @@ -94,13 +94,13 @@ serialized_state_.reset(); - app_history_->CleanupApiNavigation(*this); - app_history_ = nullptr; + navigation_api_->CleanupApiNavigation(*this); + navigation_api_ = nullptr; } -void AppHistoryApiNavigation::Trace(Visitor* visitor) const { +void NavigationApiNavigation::Trace(Visitor* visitor) const { visitor->Trace(info_); - visitor->Trace(app_history_); + visitor->Trace(navigation_api_); visitor->Trace(committed_to_entry_); visitor->Trace(committed_resolver_); visitor->Trace(finished_resolver_);
diff --git a/third_party/blink/renderer/core/app_history/app_history_api_navigation.h b/third_party/blink/renderer/core/navigation_api/navigation_api_navigation.h similarity index 61% rename from third_party/blink/renderer/core/app_history/app_history_api_navigation.h rename to third_party/blink/renderer/core/navigation_api/navigation_api_navigation.h index e70760a..d51b0ad 100644 --- a/third_party/blink/renderer/core/app_history/app_history_api_navigation.h +++ b/third_party/blink/renderer/core/navigation_api/navigation_api_navigation.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_API_NAVIGATION_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_API_NAVIGATION_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_API_NAVIGATION_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_API_NAVIGATION_H_ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" @@ -12,32 +12,32 @@ namespace blink { -class AppHistory; -class AppHistoryEntry; -class AppHistoryResult; -class AppHistoryNavigationOptions; +class NavigationApi; +class NavigationHistoryEntry; +class NavigationResult; +class NavigationOptions; class ScriptState; class ScriptPromiseResolver; class SerializedScriptValue; -class AppHistoryApiNavigation final - : public GarbageCollected<AppHistoryApiNavigation> { +class NavigationApiNavigation final + : public GarbageCollected<NavigationApiNavigation> { public: - AppHistoryApiNavigation(ScriptState*, - AppHistory*, - AppHistoryNavigationOptions*, + NavigationApiNavigation(ScriptState*, + NavigationApi*, + NavigationOptions*, const String& key, scoped_refptr<SerializedScriptValue> state = nullptr); - void NotifyAboutTheCommittedToEntry(AppHistoryEntry*); + void NotifyAboutTheCommittedToEntry(NavigationHistoryEntry*); void ResolveFinishedPromise(); void RejectFinishedPromise(const ScriptValue& value); void CleanupForCrossDocument(); - // Note: even though this returns the same AppHistoryResult every time, the - // bindings layer will create a new JS object for each distinct AppHistory + // Note: even though this returns the same NavigationResult every time, the + // bindings layer will create a new JS object for each distinct navigation API // method call, so we still match the specified semantics. - AppHistoryResult* GetAppHistoryResult() const { return result_; } + NavigationResult* GetNavigationResult() const { return result_; } const ScriptValue& GetInfo() const { return info_; } const String& GetKey() const { return key_; } @@ -55,13 +55,13 @@ scoped_refptr<SerializedScriptValue> serialized_state_; ScriptValue info_; String key_; - Member<AppHistory> app_history_; - Member<AppHistoryEntry> committed_to_entry_; + Member<NavigationApi> navigation_api_; + Member<NavigationHistoryEntry> committed_to_entry_; Member<ScriptPromiseResolver> committed_resolver_; Member<ScriptPromiseResolver> finished_resolver_; - Member<AppHistoryResult> result_; + Member<NavigationResult> result_; }; } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_API_NAVIGATION_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_API_NAVIGATION_H_
diff --git a/third_party/blink/renderer/core/app_history/app_history_test.cc b/third_party/blink/renderer/core/navigation_api/navigation_api_test.cc similarity index 79% rename from third_party/blink/renderer/core/app_history/app_history_test.cc rename to third_party/blink/renderer/core/navigation_api/navigation_api_test.cc index fa9f9ad..92be0c36 100644 --- a/third_party/blink/renderer/core/app_history/app_history_test.cc +++ b/third_party/blink/renderer/core/navigation_api/navigation_api_test.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/app_history/app_history.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/public/mojom/commit_result/commit_result.mojom-blink.h" @@ -14,7 +14,7 @@ namespace blink { -class AppHistoryTest : public testing::Test { +class NavigationApiTest : public testing::Test { public: void TearDown() override { url_test_helpers::UnregisterAllURLsAndClearMemoryCache(); @@ -34,16 +34,17 @@ bool begin_navigation_called_ = false; }; -TEST_F(AppHistoryTest, NavigateEventCtrlClick) { +TEST_F(NavigationApiTest, NavigateEventCtrlClick) { url_test_helpers::RegisterMockedURLLoad( url_test_helpers::ToKURL( - "https://example.com/apphistory/onnavigate-preventDefault.html"), - test::CoreTestDataPath("apphistory/onnavigate-preventDefault.html")); + "https://example.com/navigation-api/onnavigate-preventDefault.html"), + test::CoreTestDataPath("navigation-api/onnavigate-preventDefault.html")); BeginNavigationClient client; frame_test_helpers::WebViewHelper web_view_helper; web_view_helper.InitializeAndLoad( - "https://example.com/apphistory/onnavigate-preventDefault.html", &client); + "https://example.com/navigation-api/onnavigate-preventDefault.html", + &client); ASSERT_FALSE(client.BeginNavigationCalled()); // Emulate a navigation as started by a ctrl+click. @@ -58,15 +59,15 @@ EXPECT_TRUE(client.BeginNavigationCalled()); } -TEST_F(AppHistoryTest, BrowserInitiatedSameDocumentBackForwardUncancelable) { +TEST_F(NavigationApiTest, BrowserInitiatedSameDocumentBackForwardUncancelable) { url_test_helpers::RegisterMockedURLLoad( url_test_helpers::ToKURL( - "https://example.com/apphistory/onnavigate-preventDefault.html"), - test::CoreTestDataPath("apphistory/onnavigate-preventDefault.html")); + "https://example.com/navigation-api/onnavigate-preventDefault.html"), + test::CoreTestDataPath("navigation-api/onnavigate-preventDefault.html")); frame_test_helpers::WebViewHelper web_view_helper; web_view_helper.InitializeAndLoad( - "https://example.com/apphistory/onnavigate-preventDefault.html"); + "https://example.com/navigation-api/onnavigate-preventDefault.html"); // Emulate a same-document back-forward navigation initiated by browser UI. // It should be uncancelable, even though the onnavigate handler will try.
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.cc b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.cc new file mode 100644 index 0000000..77f3e9dd --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.cc
@@ -0,0 +1,30 @@ +// Copyright 2021 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 "third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.h" + +#include "third_party/blink/renderer/bindings/core/v8/v8_navigation_current_entry_change_event_init.h" +#include "third_party/blink/renderer/core/event_interface_names.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_history_entry.h" + +namespace blink { + +NavigationCurrentEntryChangeEvent::NavigationCurrentEntryChangeEvent( + const AtomicString& type, + NavigationCurrentEntryChangeEventInit* init) + : Event(type, init), from_(init->from()) { + if (init->navigationType()) + navigation_type_ = *init->navigationType(); +} + +const AtomicString& NavigationCurrentEntryChangeEvent::InterfaceName() const { + return event_interface_names::kNavigationCurrentEntryChangeEvent; +} + +void NavigationCurrentEntryChangeEvent::Trace(Visitor* visitor) const { + Event::Trace(visitor); + visitor->Trace(from_); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.h b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.h new file mode 100644 index 0000000..0974378 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.h
@@ -0,0 +1,39 @@ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_CURRENT_ENTRY_CHANGE_EVENT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_CURRENT_ENTRY_CHANGE_EVENT_H_ + +#include "third_party/blink/renderer/core/dom/events/event.h" +#include "third_party/blink/renderer/platform/heap/member.h" +#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + +namespace blink { +class NavigationCurrentEntryChangeEventInit; +class NavigationHistoryEntry; + +class NavigationCurrentEntryChangeEvent final : public Event { + DEFINE_WRAPPERTYPEINFO(); + + public: + static NavigationCurrentEntryChangeEvent* Create( + const AtomicString& type, + NavigationCurrentEntryChangeEventInit* init) { + return MakeGarbageCollected<NavigationCurrentEntryChangeEvent>(type, init); + } + + NavigationCurrentEntryChangeEvent( + const AtomicString& type, + NavigationCurrentEntryChangeEventInit* init); + + String navigationType() { return navigation_type_; } + NavigationHistoryEntry* from() { return from_; } + + const AtomicString& InterfaceName() const final; + void Trace(Visitor* visitor) const final; + + private: + String navigation_type_; + Member<NavigationHistoryEntry> from_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_CURRENT_ENTRY_CHANGE_EVENT_H_
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl new file mode 100644 index 0000000..b757e47 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl
@@ -0,0 +1,13 @@ +// Copyright 2021 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. + +// https://wicg.github.io/navigation-api/ +[ + Exposed=Window, + RuntimeEnabled=AppHistory +] interface NavigationCurrentEntryChangeEvent : Event { + constructor(DOMString type, NavigationCurrentEntryChangeEventInit eventInit); + readonly attribute NavigationNavigationType? navigationType; + readonly attribute NavigationHistoryEntry from; +};
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event_init.idl b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event_init.idl new file mode 100644 index 0000000..b468bdb --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event_init.idl
@@ -0,0 +1,9 @@ +// Copyright 2021 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. + +// https://wicg.github.io/navigation-api/ +dictionary NavigationCurrentEntryChangeEventInit : EventInit { + NavigationNavigationType? navigationType = null; + required NavigationHistoryEntry from; +};
diff --git a/third_party/blink/renderer/core/app_history/app_history_destination.h b/third_party/blink/renderer/core/navigation_api/navigation_destination.h similarity index 80% rename from third_party/blink/renderer/core/app_history/app_history_destination.h rename to third_party/blink/renderer/core/navigation_api/navigation_destination.h index 35e2bb8..046508d 100644 --- a/third_party/blink/renderer/core/app_history/app_history_destination.h +++ b/third_party/blink/renderer/core/navigation_api/navigation_destination.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_DESTINATION_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_DESTINATION_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_DESTINATION_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_DESTINATION_H_ #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" @@ -15,15 +15,15 @@ namespace blink { -class CORE_EXPORT AppHistoryDestination final : public ScriptWrappable { +class CORE_EXPORT NavigationDestination final : public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - AppHistoryDestination(const KURL& url, + NavigationDestination(const KURL& url, bool same_document, SerializedScriptValue* state) : url_(url), same_document_(same_document), state_(state) {} - ~AppHistoryDestination() final = default; + ~NavigationDestination() final = default; void SetTraverseProperties(const String& key, const String& id, @@ -55,4 +55,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_DESTINATION_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_DESTINATION_H_
diff --git a/third_party/blink/renderer/core/app_history/app_history_destination.idl b/third_party/blink/renderer/core/navigation_api/navigation_destination.idl similarity index 84% rename from third_party/blink/renderer/core/app_history/app_history_destination.idl rename to third_party/blink/renderer/core/navigation_api/navigation_destination.idl index 79cf81a5f..2e422e06 100644 --- a/third_party/blink/renderer/core/app_history/app_history_destination.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_destination.idl
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ +// https://wicg.github.io/navigation-api/ [ Exposed=Window, RuntimeEnabled=AppHistory -] interface AppHistoryDestination { +] interface NavigationDestination { readonly attribute DOMString? key; readonly attribute DOMString? id; readonly attribute USVString url;
diff --git a/third_party/blink/renderer/core/app_history/app_history_entry.cc b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.cc similarity index 61% rename from third_party/blink/renderer/core/app_history/app_history_entry.cc rename to third_party/blink/renderer/core/navigation_api/navigation_history_entry.cc index c71307cf..5920cb5 100644 --- a/third_party/blink/renderer/core/app_history/app_history_entry.cc +++ b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.cc
@@ -2,38 +2,40 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/app_history/app_history_entry.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_history_entry.h" -#include "third_party/blink/renderer/core/app_history/app_history.h" +#include "third_party/blink/renderer/bindings/core/v8/script_value.h" +#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" #include "third_party/blink/renderer/core/event_target_names.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/loader/document_loader.h" -#include "third_party/blink/renderer/bindings/core/v8/script_value.h" -#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_api.h" namespace blink { -AppHistoryEntry::AppHistoryEntry(ExecutionContext* context, HistoryItem* item) +NavigationHistoryEntry::NavigationHistoryEntry(ExecutionContext* context, + HistoryItem* item) : ExecutionContextClient(context), item_(item) {} -String AppHistoryEntry::key() const { +String NavigationHistoryEntry::key() const { return DomWindow() ? item_->GetAppHistoryKey() : String(); } -String AppHistoryEntry::id() const { +String NavigationHistoryEntry::id() const { return DomWindow() ? item_->GetAppHistoryId() : String(); } -int64_t AppHistoryEntry::index() { - return DomWindow() ? AppHistory::navigation(*DomWindow())->GetIndexFor(this) - : -1; +int64_t NavigationHistoryEntry::index() { + return DomWindow() + ? NavigationApi::navigation(*DomWindow())->GetIndexFor(this) + : -1; } -KURL AppHistoryEntry::url() { +KURL NavigationHistoryEntry::url() { return DomWindow() && !item_->Url().IsEmpty() ? item_->Url() : NullURL(); } -bool AppHistoryEntry::sameDocument() const { +bool NavigationHistoryEntry::sameDocument() const { if (!DomWindow()) return false; auto* current_item = DomWindow()->document()->Loader()->GetHistoryItem(); @@ -41,7 +43,7 @@ item_->DocumentSequenceNumber(); } -ScriptValue AppHistoryEntry::getState() const { +ScriptValue NavigationHistoryEntry::getState() const { SerializedScriptValue* state = item_->GetAppHistoryState(); if (!DomWindow() || !state) return ScriptValue(); @@ -49,11 +51,11 @@ return ScriptValue(isolate, state->Deserialize(isolate)); } -const AtomicString& AppHistoryEntry::InterfaceName() const { - return event_target_names::kAppHistoryEntry; +const AtomicString& NavigationHistoryEntry::InterfaceName() const { + return event_target_names::kNavigationHistoryEntry; } -void AppHistoryEntry::Trace(Visitor* visitor) const { +void NavigationHistoryEntry::Trace(Visitor* visitor) const { EventTargetWithInlineData::Trace(visitor); ExecutionContextClient::Trace(visitor); visitor->Trace(item_);
diff --git a/third_party/blink/renderer/core/app_history/app_history_entry.h b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.h similarity index 70% rename from third_party/blink/renderer/core/app_history/app_history_entry.h rename to third_party/blink/renderer/core/navigation_api/navigation_history_entry.h index d0199c73..7b5ebb8 100644 --- a/third_party/blink/renderer/core/app_history/app_history_entry.h +++ b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_ENTRY_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_ENTRY_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_HISTORY_ENTRY_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_HISTORY_ENTRY_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/events/event_target.h" @@ -16,13 +16,14 @@ class HistoryItem; class ScriptValue; -class CORE_EXPORT AppHistoryEntry final : public EventTargetWithInlineData, - public ExecutionContextClient { +class CORE_EXPORT NavigationHistoryEntry final + : public EventTargetWithInlineData, + public ExecutionContextClient { DEFINE_WRAPPERTYPEINFO(); public: - AppHistoryEntry(ExecutionContext*, HistoryItem*); - ~AppHistoryEntry() final = default; + NavigationHistoryEntry(ExecutionContext*, HistoryItem*); + ~NavigationHistoryEntry() final = default; String key() const; String id() const; @@ -50,4 +51,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_ENTRY_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_HISTORY_ENTRY_H_
diff --git a/third_party/blink/renderer/core/app_history/app_history_entry.idl b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl similarity index 85% rename from third_party/blink/renderer/core/app_history/app_history_entry.idl rename to third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl index e5cc153..85f1f2b 100644 --- a/third_party/blink/renderer/core/app_history/app_history_entry.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ +// https://wicg.github.io/navigation-api/ [ Exposed=Window, RuntimeEnabled=AppHistory -] interface AppHistoryEntry : EventTarget { +] interface NavigationHistoryEntry : EventTarget { readonly attribute DOMString key; readonly attribute DOMString id; readonly attribute USVString? url;
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigate_options.idl b/third_party/blink/renderer/core/navigation_api/navigation_navigate_options.idl similarity index 65% rename from third_party/blink/renderer/core/app_history/app_history_navigate_options.idl rename to third_party/blink/renderer/core/navigation_api/navigation_navigate_options.idl index 959dbf2..f98e2a4 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigate_options.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_navigate_options.idl
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ -dictionary AppHistoryNavigateOptions : AppHistoryNavigationOptions { +// https://wicg.github.io/navigation-api/ +dictionary NavigationNavigateOptions : NavigationOptions { any state; boolean replace = false; };
diff --git a/third_party/blink/renderer/core/app_history/app_history_navigation_options.idl b/third_party/blink/renderer/core/navigation_api/navigation_options.idl similarity index 68% rename from third_party/blink/renderer/core/app_history/app_history_navigation_options.idl rename to third_party/blink/renderer/core/navigation_api/navigation_options.idl index c698c43..0bbfd62 100644 --- a/third_party/blink/renderer/core/app_history/app_history_navigation_options.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_options.idl
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ -dictionary AppHistoryNavigationOptions { +// https://wicg.github.io/navigation-api/ +dictionary NavigationOptions { any info; };
diff --git a/third_party/blink/renderer/core/app_history/app_history_reload_options.idl b/third_party/blink/renderer/core/navigation_api/navigation_reload_options.idl similarity index 62% rename from third_party/blink/renderer/core/app_history/app_history_reload_options.idl rename to third_party/blink/renderer/core/navigation_api/navigation_reload_options.idl index e1103e3..9cc4362 100644 --- a/third_party/blink/renderer/core/app_history/app_history_reload_options.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_reload_options.idl
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ -dictionary AppHistoryReloadOptions : AppHistoryNavigationOptions { +// https://wicg.github.io/navigation-api/ +dictionary NavigationReloadOptions : NavigationOptions { any state; };
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_result.idl b/third_party/blink/renderer/core/navigation_api/navigation_result.idl new file mode 100644 index 0000000..34e01c30 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_result.idl
@@ -0,0 +1,9 @@ +// Copyright 2021 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. + +// https://wicg.github.io/navigation-api/ +dictionary NavigationResult { + Promise<NavigationHistoryEntry> committed; + Promise<NavigationHistoryEntry> finished; +};
diff --git a/third_party/blink/renderer/core/app_history/app_history_transition.cc b/third_party/blink/renderer/core/navigation_api/navigation_transition.cc similarity index 62% rename from third_party/blink/renderer/core/app_history/app_history_transition.cc rename to third_party/blink/renderer/core/navigation_api/navigation_transition.cc index df44cfc..4ae2b97 100644 --- a/third_party/blink/renderer/core/app_history/app_history_transition.cc +++ b/third_party/blink/renderer/core/navigation_api/navigation_transition.cc
@@ -2,40 +2,40 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/app_history/app_history_transition.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_transition.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" -#include "third_party/blink/renderer/core/app_history/app_history_entry.h" +#include "third_party/blink/renderer/core/navigation_api/navigation_history_entry.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/visitor.h" namespace blink { -AppHistoryTransition::AppHistoryTransition(ScriptState* script_state, +NavigationTransition::NavigationTransition(ScriptState* script_state, const String& navigation_type, - AppHistoryEntry* from) + NavigationHistoryEntry* from) : navigation_type_(navigation_type), from_(from), finished_(MakeGarbageCollected<FinishedProperty>( ExecutionContext::From(script_state))) { - // See comment for the finished promise in app_history_api_navigation.cc for + // See comment for the finished promise in navigation_api_navigation.cc for // the reason why we mark finished promises as handled. finished_->MarkAsHandled(); } -ScriptPromise AppHistoryTransition::finished(ScriptState* script_state) { +ScriptPromise NavigationTransition::finished(ScriptState* script_state) { return finished_->Promise(script_state->World()); } -void AppHistoryTransition::ResolveFinishedPromise() { +void NavigationTransition::ResolveFinishedPromise() { finished_->ResolveWithUndefined(); } -void AppHistoryTransition::RejectFinishedPromise(ScriptValue ex) { +void NavigationTransition::RejectFinishedPromise(ScriptValue ex) { finished_->Reject(ex); } -void AppHistoryTransition::Trace(Visitor* visitor) const { +void NavigationTransition::Trace(Visitor* visitor) const { visitor->Trace(from_); visitor->Trace(finished_); ScriptWrappable::Trace(visitor);
diff --git a/third_party/blink/renderer/core/app_history/app_history_transition.h b/third_party/blink/renderer/core/navigation_api/navigation_transition.h similarity index 66% rename from third_party/blink/renderer/core/app_history/app_history_transition.h rename to third_party/blink/renderer/core/navigation_api/navigation_transition.h index fb4e6c133..2c6fa0c 100644 --- a/third_party/blink/renderer/core/app_history/app_history_transition.h +++ b/third_party/blink/renderer/core/navigation_api/navigation_transition.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_TRANSITION_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_TRANSITION_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_TRANSITION_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_TRANSITION_H_ #include "third_party/blink/renderer/bindings/core/v8/script_promise_property.h" #include "third_party/blink/renderer/core/core_export.h" @@ -14,19 +14,19 @@ namespace blink { -class AppHistoryEntry; +class NavigationHistoryEntry; -class CORE_EXPORT AppHistoryTransition final : public ScriptWrappable { +class CORE_EXPORT NavigationTransition final : public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - AppHistoryTransition(ScriptState*, + NavigationTransition(ScriptState*, const String& navigation_type, - AppHistoryEntry* from); - ~AppHistoryTransition() final = default; + NavigationHistoryEntry* from); + ~NavigationTransition() final = default; const String& navigationType() const { return navigation_type_; } - AppHistoryEntry* from() { return from_; } + NavigationHistoryEntry* from() { return from_; } ScriptPromise finished(ScriptState* script_state); void ResolveFinishedPromise(); @@ -39,10 +39,10 @@ ScriptPromiseProperty<ToV8UndefinedGenerator, ScriptValue>; String navigation_type_; - Member<AppHistoryEntry> from_; + Member<NavigationHistoryEntry> from_; Member<FinishedProperty> finished_; }; } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_APP_HISTORY_APP_HISTORY_TRANSITION_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_NAVIGATION_API_NAVIGATION_TRANSITION_H_
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_transition.idl b/third_party/blink/renderer/core/navigation_api/navigation_transition.idl new file mode 100644 index 0000000..2b4c8fd --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_transition.idl
@@ -0,0 +1,9 @@ +[Exposed=Window, + RuntimeEnabled=AppHistory] +interface NavigationTransition { + readonly attribute NavigationNavigationType navigationType; + readonly attribute NavigationHistoryEntry from; + [CallWith=ScriptState] readonly attribute Promise<void> finished; + + // NavigationResult rollback(optional NavigationOptions options = {}); +};
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_transition_while_options.idl b/third_party/blink/renderer/core/navigation_api/navigation_transition_while_options.idl new file mode 100644 index 0000000..9495eff0 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/navigation_transition_while_options.idl
@@ -0,0 +1,8 @@ +dictionary NavigationTransitionWhileOptions { + NavigationFocusReset focusReset; +}; + +enum NavigationFocusReset { + "after-transition", + "manual" +};
diff --git a/third_party/blink/renderer/core/app_history/app_history_update_current_options.idl b/third_party/blink/renderer/core/navigation_api/navigation_update_current_entry_options.idl similarity index 67% rename from third_party/blink/renderer/core/app_history/app_history_update_current_options.idl rename to third_party/blink/renderer/core/navigation_api/navigation_update_current_entry_options.idl index e8a8005a..30747aa 100644 --- a/third_party/blink/renderer/core/app_history/app_history_update_current_options.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_update_current_entry_options.idl
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// https://github.com/WICG/app-history/ -dictionary AppHistoryUpdateCurrentOptions { +// https://wicg.github.io/navigation-api/ +dictionary NavigationUpdateCurrentEntryOptions { required any state; };
diff --git a/third_party/blink/renderer/core/navigation_api/window_navigation.idl b/third_party/blink/renderer/core/navigation_api/window_navigation.idl new file mode 100644 index 0000000..c5b1809 --- /dev/null +++ b/third_party/blink/renderer/core/navigation_api/window_navigation.idl
@@ -0,0 +1,10 @@ +// Copyright 2021 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. + +// https://wicg.github.io/navigation-api/ +[ + ImplementedAs=NavigationApi +] partial interface Window { + [RuntimeEnabled=AppHistory, Replaceable] readonly attribute Navigation navigation; +};
diff --git a/third_party/blink/renderer/core/page/page.h b/third_party/blink/renderer/core/page/page.h index ceee7ce..d466ef8 100644 --- a/third_party/blink/renderer/core/page/page.h +++ b/third_party/blink/renderer/core/page/page.h
@@ -36,7 +36,7 @@ #include "third_party/blink/public/web/web_window_features.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/vision_deficiency.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/settings_delegate.h" #include "third_party/blink/renderer/core/inspector/inspector_issue_storage.h" #include "third_party/blink/renderer/core/page/page_animator.h"
diff --git a/third_party/blink/renderer/core/svg/svg_svg_element.cc b/third_party/blink/renderer/core/svg/svg_svg_element.cc index 6b54a50..2ed563cb4 100644 --- a/third_party/blink/renderer/core/svg/svg_svg_element.cc +++ b/third_party/blink/renderer/core/svg/svg_svg_element.cc
@@ -31,9 +31,9 @@ #include "third_party/blink/renderer/core/dom/static_node_list.h" #include "third_party/blink/renderer/core/dom/xml_document.h" #include "third_party/blink/renderer/core/editing/frame_selection.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_view.h"
diff --git a/third_party/blink/renderer/core/testing/data/apphistory/onnavigate-preventDefault.html b/third_party/blink/renderer/core/testing/data/apphistory/onnavigate-preventDefault.html deleted file mode 100644 index a4dc4b1..0000000 --- a/third_party/blink/renderer/core/testing/data/apphistory/onnavigate-preventDefault.html +++ /dev/null
@@ -1,3 +0,0 @@ -<script> -appHistory.onnavigate = e => e.preventDefault(); -</script>
diff --git a/third_party/blink/renderer/core/testing/data/navigation-api/onnavigate-preventDefault.html b/third_party/blink/renderer/core/testing/data/navigation-api/onnavigate-preventDefault.html new file mode 100644 index 0000000..2689017 --- /dev/null +++ b/third_party/blink/renderer/core/testing/data/navigation-api/onnavigate-preventDefault.html
@@ -0,0 +1,3 @@ +<script> +navigation.onnavigate = e => e.preventDefault(); +</script>
diff --git a/third_party/blink/renderer/core/testing/worker_internals.cc b/third_party/blink/renderer/core/testing/worker_internals.cc index 1561b4cc..c56bd6e 100644 --- a/third_party/blink/renderer/core/testing/worker_internals.cc +++ b/third_party/blink/renderer/core/testing/worker_internals.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/testing/worker_internals.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/testing/origin_trials_test.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h"
diff --git a/third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.cc b/third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.cc index eb21aaa..750a205 100644 --- a/third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.cc +++ b/third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.cc
@@ -5,7 +5,6 @@ #include "third_party/blink/renderer/core/workers/main_thread_worklet_reporting_proxy.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/wtf/wtf.h"
diff --git a/third_party/blink/renderer/core/workers/threaded_messaging_proxy_base.cc b/third_party/blink/renderer/core/workers/threaded_messaging_proxy_base.cc index 4a2f5c35..f2b8f09 100644 --- a/third_party/blink/renderer/core/workers/threaded_messaging_proxy_base.cc +++ b/third_party/blink/renderer/core/workers/threaded_messaging_proxy_base.cc
@@ -11,7 +11,6 @@ #include "third_party/blink/public/platform/web_worker_fetch_context.h" #include "third_party/blink/renderer/bindings/core/v8/source_location.h" #include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/inspector/devtools_agent.h" #include "third_party/blink/renderer/core/inspector/worker_devtools_params.h"
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc index b2774b31..0ef2156 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc
@@ -21,7 +21,7 @@ #include "third_party/blink/renderer/bindings/core/v8/worker_or_worklet_script_controller.h" #include "third_party/blink/renderer/core/dom/events/event_queue.h" #include "third_party/blink/renderer/core/execution_context/agent.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/policy_container.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h"
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h index f9f0e15..7fbf5252 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h
@@ -20,7 +20,7 @@ #include "third_party/blink/renderer/core/dom/events/event_target.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/web_feature_forward.h" #include "third_party/blink/renderer/core/loader/back_forward_cache_loader_helper_impl.h" #include "third_party/blink/renderer/core/script/modulator.h"
diff --git a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc index a94f7ca..69c35483 100644 --- a/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc +++ b/third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc
@@ -55,7 +55,7 @@ #include "third_party/blink/renderer/core/fileapi/file_reader_loader_client.h" #include "third_party/blink/renderer/core/fileapi/public_url_manager.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/frame.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/page_dismissal_scope.h"
diff --git a/third_party/blink/renderer/modules/accessibility/ax_enums.h b/third_party/blink/renderer/modules/accessibility/ax_enums.h index 6fbe0be..bb3dee0 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_enums.h +++ b/third_party/blink/renderer/modules/accessibility/ax_enums.h
@@ -92,7 +92,6 @@ // https://w3c.github.io/html-aam/#accessible-name-and-description-computation enum AXTextSource { kAXTextFromNativeSourceUninitialized = -1, - kAXTextFromNativeHTMLFigcaption, kAXTextFromNativeHTMLLabel, kAXTextFromNativeHTMLLabelFor, kAXTextFromNativeHTMLLabelWrapped,
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc index 16878cae..2a23298 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -2123,6 +2123,22 @@ } } +// According to the standard, the figcaption should only be the first or +// last child: https://html.spec.whatwg.org/#the-figcaption-element +AXObject* AXNodeObject::GetChildFigcaption() const { + AXObject* child = FirstChildIncludingIgnored(); + if (!child) + return nullptr; + if (child->RoleValue() == ax::mojom::blink::Role::kFigcaption) + return child; + + child = LastChildIncludingIgnored(); + if (child->RoleValue() == ax::mojom::blink::Role::kFigcaption) + return child; + + return nullptr; +} + AXObject::AXObjectVector AXNodeObject::RadioButtonsInGroup() const { AXObjectVector radio_buttons; if (!node_ || RoleValue() != ax::mojom::blink::Role::kRadioButton) @@ -4742,22 +4758,6 @@ return AXObjectCache().ValidationMessageObjectIfInvalid(true); } -// According to the standard, the figcaption should only be the first or -// last child: https://html.spec.whatwg.org/#the-figcaption-element -static Element* GetChildFigcaption(const Node& node) { - Element* element = ElementTraversal::FirstChild(node); - if (!element) - return nullptr; - if (element->HasTagName(html_names::kFigcaptionTag)) - return element; - - element = ElementTraversal::LastChild(node); - if (element->HasTagName(html_names::kFigcaptionTag)) - return element; - - return nullptr; -} - // Based on // http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and-description-calculation String AXNodeObject::NativeTextAlternative( @@ -5024,43 +5024,6 @@ return text_alternative; } - // 5.7 figure and figcaption Elements - if (GetNode()->HasTagName(html_names::kFigureTag)) { - // figcaption - name_from = ax::mojom::blink::NameFrom::kRelatedElement; - if (name_sources) { - name_sources->push_back(NameSource(*found_text_alternative)); - name_sources->back().type = name_from; - name_sources->back().native_source = kAXTextFromNativeHTMLFigcaption; - } - Element* figcaption = GetChildFigcaption(*(GetNode())); - if (figcaption) { - AXObject* figcaption_ax_object = AXObjectCache().GetOrCreate(figcaption); - if (figcaption_ax_object) { - text_alternative = - RecursiveTextAlternative(*figcaption_ax_object, nullptr, visited); - - if (related_objects) { - local_related_objects.push_back( - MakeGarbageCollected<NameSourceRelatedObject>( - figcaption_ax_object, text_alternative)); - *related_objects = local_related_objects; - local_related_objects.clear(); - } - - if (name_sources) { - NameSource& source = name_sources->back(); - source.related_objects = *related_objects; - source.text = text_alternative; - *found_text_alternative = true; - } else { - return text_alternative; - } - } - } - return text_alternative; - } - // 5.8 img or area Element if (IsA<HTMLImageElement>(GetNode()) || IsA<HTMLAreaElement>(GetNode()) || (GetLayoutObject() && GetLayoutObject()->IsSVGImage())) {
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.h b/third_party/blink/renderer/modules/accessibility/ax_node_object.h index 1c2c81b3..f1df580 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_node_object.h +++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.h
@@ -141,6 +141,8 @@ AXObject* InPageLinkTarget() const override; AccessibilityOrientation Orientation() const override; + AXObject* GetChildFigcaption() const override; + // Used to compute kRadioGroupIds, which is only used on Mac. // TODO(accessibility) Consider computing on browser side and removing here. AXObjectVector RadioButtonsInGroup() const override;
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 186a0cce..ab37c42 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -1460,6 +1460,16 @@ DCHECK_NE(node_data->role, ax::mojom::blink::Role::kUnknown); DCHECK_NE(node_data->role, ax::mojom::blink::Role::kNone); + if (node_data->role == ax::mojom::blink::Role::kFigure) { + AXObject* fig_caption = GetChildFigcaption(); + if (fig_caption) { + std::vector<int32_t> ids; + ids.push_back(GetChildFigcaption()->AXObjectID()); + node_data->AddIntListAttribute( + ax::mojom::blink::IntListAttribute::kDetailsIds, ids); + } + } + if (ui::IsPlatformDocument(node_data->role) && !IsLoaded()) node_data->AddBoolAttribute(ax::mojom::blink::BoolAttribute::kBusy, true); @@ -3862,6 +3872,8 @@ return kAccessibilityOrientationUndefined; } +AXObject* AXObject::GetChildFigcaption() const { return nullptr; } + void AXObject::LoadInlineTextBoxes() {} void AXObject::ForceAddInlineTextBoxChildren() {}
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.h b/third_party/blink/renderer/modules/accessibility/ax_object.h index b3a9b7ab..1930187d 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.h +++ b/third_party/blink/renderer/modules/accessibility/ax_object.h
@@ -642,6 +642,8 @@ *text_underline_style = ax::mojom::blink::TextDecorationStyle::kNone; } + virtual AXObject* GetChildFigcaption() const; + virtual AXObjectVector RadioButtonsInGroup() const { return AXObjectVector(); }
diff --git a/third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc b/third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc index 89ea9df..0df174a 100644 --- a/third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc +++ b/third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.cc
@@ -193,8 +193,6 @@ switch (native_source) { case kAXTextFromNativeSVGDescElement: return SourceType::Description; - case kAXTextFromNativeHTMLFigcaption: - return SourceType::Figcaption; case kAXTextFromNativeHTMLLabel: return SourceType::Label; case kAXTextFromNativeHTMLLabelFor:
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc index 9187c2d..27c88486 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
@@ -19,7 +19,6 @@ #include "third_party/blink/renderer/core/fetch/body_stream_buffer.h" #include "third_party/blink/renderer/core/fetch/request.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/modules/background_fetch/background_fetch_bridge.h" #include "third_party/blink/renderer/modules/background_fetch/background_fetch_icon_loader.h"
diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc index ada2764..09666dab 100644 --- a/third_party/blink/renderer/modules/battery/battery_manager.cc +++ b/third_party/blink/renderer/modules/battery/battery_manager.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/navigator.h"
diff --git a/third_party/blink/renderer/modules/crypto/subtle_crypto.cc b/third_party/blink/renderer/modules/crypto/subtle_crypto.cc index d158094..11e6ad0 100644 --- a/third_party/blink/renderer/modules/crypto/subtle_crypto.cc +++ b/third_party/blink/renderer/modules/crypto/subtle_crypto.cc
@@ -40,7 +40,6 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_json_web_key.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_union_arraybuffer_arraybufferview_jsonwebkey.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h" #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer_view.h" #include "third_party/blink/renderer/core/typed_arrays/dom_array_piece.h"
diff --git a/third_party/blink/renderer/modules/device_orientation/device_motion_controller.cc b/third_party/blink/renderer/modules/device_orientation/device_motion_controller.cc index 1cba017..a5108a27 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_motion_controller.cc +++ b/third_party/blink/renderer/modules/device_orientation/device_motion_controller.cc
@@ -7,7 +7,6 @@ #include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/modules/device_orientation/device_motion_data.h" #include "third_party/blink/renderer/modules/device_orientation/device_motion_event.h"
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_controller.cc b/third_party/blink/renderer/modules/device_orientation/device_orientation_controller.cc index 851cd08..0680d41 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_orientation_controller.cc +++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_controller.cc
@@ -6,7 +6,6 @@ #include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h" #include "third_party/blink/public/platform/platform.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_console.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/settings.h"
diff --git a/third_party/blink/renderer/modules/direct_sockets/OWNERS b/third_party/blink/renderer/modules/direct_sockets/OWNERS index ef9d017..95fde19 100644 --- a/third_party/blink/renderer/modules/direct_sockets/OWNERS +++ b/third_party/blink/renderer/modules/direct_sockets/OWNERS
@@ -2,3 +2,4 @@ ericwilligers@chromium.org glenrob@chromium.org mgiuca@chromium.org +greengrape@google.com
diff --git a/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc b/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc index 6dc38239..160742f 100644 --- a/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc +++ b/third_party/blink/renderer/modules/encryptedmedia/navigator_request_media_key_system_access.cc
@@ -17,7 +17,6 @@ #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/inspector/console_message.h"
diff --git a/third_party/blink/renderer/modules/geolocation/geolocation.cc b/third_party/blink/renderer/modules/geolocation/geolocation.cc index 2e77b505..d20af60 100644 --- a/third_party/blink/renderer/modules/geolocation/geolocation.cc +++ b/third_party/blink/renderer/modules/geolocation/geolocation.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/bindings/core/v8/source_location.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/navigator.h" #include "third_party/blink/renderer/core/frame/performance_monitor.h"
diff --git a/third_party/blink/renderer/modules/mediasource/media_source.cc b/third_party/blink/renderer/modules/mediasource/media_source.cc index 22a2a68..5cb66f1 100644 --- a/third_party/blink/renderer/modules/mediasource/media_source.cc +++ b/third_party/blink/renderer/modules/mediasource/media_source.cc
@@ -28,7 +28,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_video_decoder_config.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/dom/events/event_queue.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/track/audio_track_list.h" #include "third_party/blink/renderer/core/html/track/video_track_list.h"
diff --git a/third_party/blink/renderer/modules/mediasource/source_buffer.cc b/third_party/blink/renderer/modules/mediasource/source_buffer.cc index ec0c00936..9bc8299 100644 --- a/third_party/blink/renderer/modules/mediasource/source_buffer.cc +++ b/third_party/blink/renderer/modules/mediasource/source_buffer.cc
@@ -56,7 +56,7 @@ #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/dom/events/event_queue.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/html/time_ranges.h" #include "third_party/blink/renderer/core/html/track/audio_track.h"
diff --git a/third_party/blink/renderer/modules/mediastream/media_constraints_impl.cc b/third_party/blink/renderer/modules/mediastream/media_constraints_impl.cc index 563d82db..c185f73 100644 --- a/third_party/blink/renderer/modules/mediastream/media_constraints_impl.cc +++ b/third_party/blink/renderer/modules/mediastream/media_constraints_impl.cc
@@ -47,7 +47,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_union_constraindoublerange_double.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_union_constrainlongrange_long.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/modules/mediastream/media_error_state.h"
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream.cc b/third_party/blink/renderer/modules/mediastream/media_stream.cc index 8010015b..326a437a 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream.cc
@@ -27,7 +27,7 @@ #include "third_party/blink/public/platform/task_type.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/modules/mediastream/focusable_media_stream_track.h" #include "third_party/blink/renderer/modules/mediastream/media_stream_track_event.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h"
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_track.cc b/third_party/blink/renderer/modules/mediastream/media_stream_track.cc index a7a28db..0ebce6f2 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_track.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_track.cc
@@ -45,7 +45,6 @@ #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/modules/imagecapture/image_capture.h"
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 0bc4bc812..fb587b60 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_request.cc +++ b/third_party/blink/renderer/modules/mediastream/user_media_request.cc
@@ -44,7 +44,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_union_domexception_overconstrainederror.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/dom/space_split_string.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/modules/mediastream/identifiability_metrics.h" #include "third_party/blink/renderer/modules/mediastream/media_constraints_impl.h"
diff --git a/third_party/blink/renderer/modules/notifications/notification.cc b/third_party/blink/renderer/modules/notifications/notification.cc index 5e48c60..80dc8f1e 100644 --- a/third_party/blink/renderer/modules/notifications/notification.cc +++ b/third_party/blink/renderer/modules/notifications/notification.cc
@@ -47,7 +47,7 @@ #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/dom/scoped_window_focus_allowed_indicator.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/performance_monitor.h"
diff --git a/third_party/blink/renderer/modules/payments/payment_request.cc b/third_party/blink/renderer/modules/payments/payment_request.cc index 5be57534..3910dea8 100644 --- a/third_party/blink/renderer/modules/payments/payment_request.cc +++ b/third_party/blink/renderer/modules/payments/payment_request.cc
@@ -36,7 +36,7 @@ #include "third_party/blink/renderer/core/dom/events/event_queue.h" #include "third_party/blink/renderer/core/event_type_names.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/frame_owner.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" @@ -807,7 +807,7 @@ bool has_transient_user_activation = LocalFrame::HasTransientUserActivation(local_frame); bool payment_request_token_active = - local_frame->IsPaymentRequestTokenActive(); + DomWindow()->IsPaymentRequestTokenActive(); if (!has_transient_user_activation) { Deprecation::CountDeprecation( @@ -824,7 +824,7 @@ if (RuntimeEnabledFeatures::CapabilityDelegationPaymentRequestEnabled( GetExecutionContext())) { payment_request_allowed |= payment_request_token_active; - local_frame->ConsumePaymentRequestToken(); + DomWindow()->ConsumePaymentRequestToken(); } if (RuntimeEnabledFeatures::PaymentRequestRequiresUserActivationEnabled( GetExecutionContext())) {
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_dtls_transport.cc b/third_party/blink/renderer/modules/peerconnection/rtc_dtls_transport.cc index 94b752fc..2cbcc9ad 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_dtls_transport.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_dtls_transport.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/events/event.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc index 1ea0690..42973ab 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc
@@ -72,7 +72,7 @@ #include "third_party/blink/renderer/core/dom/dom_time_stamp.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_container.cc b/third_party/blink/renderer/modules/service_worker/service_worker_container.cc index d83c59a..2e7ffe48 100644 --- a/third_party/blink/renderer/modules/service_worker/service_worker_container.cc +++ b/third_party/blink/renderer/modules/service_worker/service_worker_container.cc
@@ -48,7 +48,7 @@ #include "third_party/blink/renderer/core/events/message_event.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
diff --git a/third_party/blink/renderer/modules/speech/speech_synthesis.cc b/third_party/blink/renderer/modules/speech/speech_synthesis.cc index b52319f..abd14ce 100644 --- a/third_party/blink/renderer/modules/speech/speech_synthesis.cc +++ b/third_party/blink/renderer/modules/speech/speech_synthesis.cc
@@ -38,7 +38,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_speech_synthesis_error_event_init.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_speech_synthesis_event_init.h" #include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/media/autoplay_policy.h"
diff --git a/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc b/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc index f23a749e..05d00e8 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc
@@ -31,7 +31,6 @@ #include "base/memory/ptr_util.h" #include "build/build_config.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/platform/audio/audio_utilities.h" #include "third_party/blink/renderer/platform/audio/vector_math.h"
diff --git a/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc b/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc index 8b1585a..6535557 100644 --- a/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc +++ b/third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.cc
@@ -29,7 +29,7 @@ #include "third_party/blink/public/platform/task_type.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_media_element_audio_source_options.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/html/media/html_media_element.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/modules/webaudio/audio_context.h"
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame.cc b/third_party/blink/renderer/modules/webcodecs/video_frame.cc index bf54d9a..59694511 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame.cc +++ b/third_party/blink/renderer/modules/webcodecs/video_frame.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_video_frame_copy_to_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_video_frame_init.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_video_pixel_format.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/geometry/dom_rect_read_only.h" #include "third_party/blink/renderer/core/html/canvas/canvas_image_source.h" #include "third_party/blink/renderer/core/html/media/html_video_element.h"
diff --git a/third_party/blink/renderer/modules/webmidi/navigator_web_midi.cc b/third_party/blink/renderer/modules/webmidi/navigator_web_midi.cc index d4cc7858c..5f98dfa 100644 --- a/third_party/blink/renderer/modules/webmidi/navigator_web_midi.cc +++ b/third_party/blink/renderer/modules/webmidi/navigator_web_midi.cc
@@ -36,7 +36,7 @@ #include "third_party/blink/renderer/bindings/modules/v8/v8_midi_options.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" -#include "third_party/blink/renderer/core/frame/deprecation.h" +#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/navigator.h"
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc index 099d276..7d95e60 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -981,8 +981,14 @@ // If we cannot use overlay, we have to remove the scanout flag and the // concurrent read write flag. - if (!is_gpu_memory_buffer_image_allowed || - (is_accelerated && !capabilities.texture_storage_image)) { + bool disable_image_scanout = !is_gpu_memory_buffer_image_allowed; +#if !BUILDFLAG(IS_MAC) + // This check is inappropriate on macOS. + // https://crbug.com/1305679 + disable_image_scanout |= + is_accelerated && !capabilities.texture_storage_image; +#endif + if (disable_image_scanout) { shared_image_usage_flags &= ~gpu::SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE; shared_image_usage_flags &= ~gpu::SHARED_IMAGE_USAGE_SCANOUT; }
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 763498f5..8dc8751 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1329,7 +1329,7 @@ { name: "LayoutNGBlockInInline", depends_on: ["LayoutNG"], - status: "stable", + status: "test", }, { // Block fragmentation support in the flex layout algorithm.
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/mac.py b/third_party/blink/tools/blinkpy/web_tests/port/mac.py index d0b27a8..2d1ae70 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/mac.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/mac.py
@@ -108,18 +108,11 @@ # def path_to_apache(self): - # use system httpd on mac10.12, mac10.13. The httpd from cipd does not work on - # these platforms as that is compiled toward newer version of mac. - if self.host.platform.os_version in ['mac10.12', 'mac10.13']: - return '/usr/sbin/httpd' return self._path_from_chromium_base( 'third_party', 'apache-mac', 'bin', 'httpd') def path_to_apache_config_file(self): - if self.host.platform.os_version in ['mac10.12']: - config_file_basename = 'apache2-httpd-%s.conf' % (self._apache_version(),) - else: - config_file_basename = 'apache2-httpd-%s-php7.conf' % (self._apache_version(),) + config_file_basename = 'apache2-httpd-%s-php7.conf' % (self._apache_version(),) return self._filesystem.join(self.apache_config_directory(), config_file_basename) def _path_to_driver(self, target=None):
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py b/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py index 17fea975..c99069f 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/mac_unittest.py
@@ -68,12 +68,5 @@ port._apache_version = lambda: '2.4' # pylint: disable=protected-access self.assertEqual( port.path_to_apache_config_file(), - '/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4.conf') - - def test_path_to_apache_config_file_on_10_13(self): - port = self.make_port(os_version='mac10.13', port_name='mac') - port._apache_version = lambda: '2.4' # pylint: disable=protected-access - self.assertEqual( - port.path_to_apache_config_file(), '/mock-checkout/third_party/blink/tools/apache_config/apache2-httpd-2.4-php7.conf' )
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 5fc2116..6a885fb 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1998,9 +1998,11 @@ crbug.com/1068610 external/wpt/css/css-color/at-color-profile-001.html [ Failure ] # Some CSS System Colors need to be deprecated +crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-001.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-002.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-004.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-006.html [ Failure ] +crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-008.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-010.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-011.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-013.html [ Failure ] @@ -2010,8 +2012,10 @@ crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-019.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-020.html [ Failure ] crbug.com/1299441 external/wpt/css/css-color/deprecated-sameas-022.html [ Failure ] +crbug.com/1299441 virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-001.html [ Failure ] crbug.com/1299441 virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-002.html [ Failure ] crbug.com/1299441 virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-004.html [ Failure ] +crbug.com/1299441 virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-008.html [ Failure ] crbug.com/1299441 [ Mac11 ] virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-006.html [ Failure Timeout ] crbug.com/1299441 [ Linux ] virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-006.html [ Failure ] crbug.com/1299441 [ Mac10.12 ] virtual/system-color-compute/external/wpt/css/css-color/deprecated-sameas-006.html [ Failure ] @@ -2592,6 +2596,10 @@ crbug.com/1229463 [ Mac ] virtual/oopr-canvas2d/fast/canvas/canvas-largedraws.html [ Crash ] crbug.com/1229486 virtual/oopr-canvas2d/fast/canvas/canvas-incremental-repaint.html [ Failure ] +# Bugs caused by enabling overlay support on OOPR-Canvas on macOS +crbug.com/1305679 [ Mac ] virtual/oopr-canvas2d/fast/canvas/OffscreenCanvas-2d-gradients-in-worker.html [ Failure ] +crbug.com/1305679 [ Mac ] virtual/oopr-canvas2d/fast/canvas/OffscreenCanvas-paths-in-worker.html [ Failure ] + # Temporarily disabled after chromium change crbug.com/492511 [ Mac ] virtual/text-antialias/atsui-negative-spacing-features.html [ Failure ] crbug.com/492511 [ Mac ] virtual/text-antialias/international/arabic-justify.html [ Failure ] @@ -7722,4 +7730,5 @@ crbug.com/1298633 http/tests/inspector-protocol/network/cross-origin-isolation/coep-load-error-reporting-worker.js [ Pass Timeout ] # Sheriff 2022-03-16 +crbug.com/1306848 http/tests/inspector-protocol/conversion/attribution-invalid-data.js [ Failure Timeout Pass ] crbug.com/1306770 http/tests/inspector-protocol/network/interception-download.js [ Failure Pass ]
diff --git a/third_party/blink/web_tests/accessibility/element-role-mapping-normal-expected.txt b/third_party/blink/web_tests/accessibility/element-role-mapping-normal-expected.txt index 41fe3e4..5f34bbf9 100644 --- a/third_party/blink/web_tests/accessibility/element-role-mapping-normal-expected.txt +++ b/third_party/blink/web_tests/accessibility/element-role-mapping-normal-expected.txt
@@ -219,7 +219,7 @@ AXRole: AXCell "Cell2" AXRole: AXStaticText "Cell2" AXRole: AXInlineTextBox "Cell2" - AXRole: AXFigure "Fig1. - Blue Box" + AXRole: AXFigure AXRole: AXImage "blue" AXRole: AXFigcaption AXRole: AXStaticText "Fig1. - Blue Box"
diff --git a/third_party/blink/web_tests/accessibility/name-calc-figure.html b/third_party/blink/web_tests/accessibility/name-calc-figure.html index 3f15cb2..9534f2a3 100644 --- a/third_party/blink/web_tests/accessibility/name-calc-figure.html +++ b/third_party/blink/web_tests/accessibility/name-calc-figure.html
@@ -30,7 +30,7 @@ </script> <div class="container"> - <figure id="figure3" title="figure3-title"> + <figure id="figure3"> <figcaption>figcaption3</figcaption> <img src="resources/cake.png" alt="cake"> </figure> @@ -39,9 +39,9 @@ <script> test(function(t) { var axFigure3 = accessibilityController.accessibleElementById("figure3"); - assert_equals(axFigure3.name, "figcaption3"); - assert_equals(axFigure3.nameFrom, "relatedElement"); -}, "Figure element with figcaption and title"); + assert_equals(axFigure3.name, ""); + assert_equals(axFigure3.nameFrom, ""); +}, "Figure element with figcaption and no title"); </script> <div class="container">
diff --git a/third_party/blink/web_tests/external/Version b/third_party/blink/web_tests/external/Version index b57943c..75be44f7 100644 --- a/third_party/blink/web_tests/external/Version +++ b/third_party/blink/web_tests/external/Version
@@ -1 +1 @@ -Version: ce388248e083cc76ee63ee6be8ffc0f2319194ae +Version: afd66ac5976672821b2788cd5f6ae57701240308
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 5716f24..6724e9a 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -2392,6 +2392,13 @@ {} ] ], + "table-root-direction-propagation-crash.html": [ + "d723c1276ba59bdaa3671d003a90725dff9187d5", + [ + null, + {} + ] + ], "wm-body-propagation-crash.html": [ "a4a24712f4570f661917b0911567ea5bddc7c485", [ @@ -37235,6 +37242,19 @@ {} ] ], + "float-under-flatten-under-preserve-3d.html": [ + "18b6bbc122a5a67ced5a93fc0a00fec10d113ba2", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "floated-table-wider-than-specified.html": [ "f93d50e43dd3eb49d5c8964200b7fe4ebb5bd6c8", [ @@ -78113,7 +78133,7 @@ ] ], "box-shadow-radius-000.html": [ - "69474d1a5d2dcb5a6847c7e7692ee7f1115d772c", + "08822b4ce58a6ae0e6e39cb13edef3b30622dbaa", [ null, [ @@ -78122,7 +78142,23 @@ "==" ] ], - {} + { + "fuzzy": [ + [ + null, + [ + [ + 0, + 25 + ], + [ + 0, + 80 + ] + ] + ] + ] + } ] ], "box-shadow-radius-001.html": [ @@ -245450,7 +245486,7 @@ [] ], "box-shadow-radius-000-ref.html": [ - "aa70cf257806c2640166aae7d5f9a85424c6dd33", + "8e31ec5266facc1d99813f0caa25cb24729ecd43", [] ], "box-shadow-radius-001-ref.html": [ @@ -311975,7 +312011,11 @@ }, "push-api": { "META.yml": [ - "2f5a866d940363a9e514590d496e2fec4f3a3440", + "4886e6a70da668e136d3149ee760c79aaf34be39", + [] + ], + "permission.https-expected.txt": [ + "ed6bba69439064ae5be5d3f2df896ed02eaa9278", [] ] }, @@ -314789,7 +314829,7 @@ [] ], "authentication-invalid-icon.https-expected.txt": [ - "f3a35dff00aff92cbd3970b5f8f4e78e57ebb316", + "627c81d9d302a8bcf6b1a7a0aceecc9f5d6ed305", [] ], "authentication-rejected.https-expected.txt": [ @@ -363533,7 +363573,7 @@ ] ], "at-container-parsing.html": [ - "60a80bf8e4b5e0ba1e140238b87dc74d28a22279", + "886411452eebfbb6f789408e153357e2f11bddee", [ null, {} @@ -363602,8 +363642,15 @@ {} ] ], + "container-longhand-animation-type.html": [ + "aded2a3ec8bae1203e458667bf6ff1f616aca91a", + [ + null, + {} + ] + ], "container-name-computed.html": [ - "a2796fa35fca08c3d12a9f60ecb85821434f2c8f", + "8d8898786343cf34c589af3e216cfdf0fd4fb4af", [ null, {} @@ -363617,7 +363664,7 @@ ] ], "container-name-parsing.html": [ - "77c8d0129c9d78041600d66b5b2217153e604b41", + "d4737ce2dca296ada369fb674c647908ac13d78d", [ null, {} @@ -488683,6 +488730,13 @@ "timeout": "long" } ] + ], + "permission.https.html": [ + "61cb40a843a427af47c3db98944676f19f4c2d25", + [ + null, + {} + ] ] }, "quirks": { @@ -504270,7 +504324,7 @@ ] ], "authentication-invalid-icon.https.html": [ - "28ca629a9447c8da9bd6cc0f8a890b6488487493", + "b94c57c6deb0958bd0285ecfd5b345c7e13cd509", [ null, { @@ -504288,7 +504342,7 @@ ] ], "constructor.https.html": [ - "88b250511d07365b721b64d7999d5d9e1198f0d9", + "6d779308ead249dc5e1bd98b7165cd7a8180ada7", [ null, {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/break-before-float-after-line-after-floats-crash.html b/third_party/blink/web_tests/external/wpt/css/css-break/break-before-float-after-line-after-floats-crash.html new file mode 100644 index 0000000..9066cd7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-break/break-before-float-after-line-after-floats-crash.html
@@ -0,0 +1,9 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1306811"> +<div style="columns:3; column-fill:auto; width:320px; height:100px; orphans:1; widows:1;"> + <div style="float:left; width:50px; height:10px;"></div> + <div style="float:left; width:100px; height:10px;"></div> + <div style="display:inline-block; width:20px; height:20px;"></div> + <div style="float:left; width:10px; height:200px; contain:size;"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-break/line-and-fragmentainer-break-before-float-crash.html b/third_party/blink/web_tests/external/wpt/css/css-break/line-and-fragmentainer-break-before-float-crash.html new file mode 100644 index 0000000..14bce6b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-break/line-and-fragmentainer-break-before-float-crash.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1305497"> +<div style="columns:3; column-fill:auto; height:100px; orphans:1; widows:1;"> + <div style="width:20px;"> + <div style="display:inline-block; width:20px; height:5px;"></div> + <div style="display:inline-block; width:10px; height:5px;"></div> + <div style="float:left; width:10px; height:200px; contain:size;"></div> + <div style="display:inline-block; width:21px; height:5px;"></div> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid-expected.txt index 5194a946..dde0e81 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid-expected.txt
@@ -1,5 +1,6 @@ This is a testharness.js-based test. PASS e.style['color'] = "ActiveText" should set the property value +PASS e.style['color'] = "ButtonBorder" should set the property value PASS e.style['color'] = "ButtonFace" should set the property value PASS e.style['color'] = "ButtonText" should set the property value PASS e.style['color'] = "Canvas" should set the property value
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid.html b/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid.html index 77c6d214..eea01e5 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid.html +++ b/third_party/blink/web_tests/external/wpt/css/css-color/parsing/system-color-valid.html
@@ -12,6 +12,7 @@ <body> <script> test_valid_value("color", "ActiveText", "activetext"); +test_valid_value("color", "ButtonBorder", "buttonborder"); test_valid_value("color", "ButtonFace", "buttonface"); test_valid_value("color", "ButtonText", "buttontext"); test_valid_value("color", "Canvas", "canvas");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/OWNERS b/third_party/blink/web_tests/external/wpt/navigation-api/OWNERS index cc6a94b..e962bea 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/OWNERS +++ b/third_party/blink/web_tests/external/wpt/navigation-api/OWNERS
@@ -1 +1 @@ -file://third_party/blink/renderer/core/app_history/OWNERS +file://third_party/blink/renderer/core/navigation_api/OWNERS
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/README.md b/third_party/blink/web_tests/external/wpt/navigation-api/README.md deleted file mode 100644 index 068ae5b..0000000 --- a/third_party/blink/web_tests/external/wpt/navigation-api/README.md +++ /dev/null
@@ -1,11 +0,0 @@ -# Navigation API tests - -This directory contains tests for the -[navigation API](https://wicg.github.io/navigation-api/), -[formerly known as](https://github.com/WICG/navigation-api/issues/83) the app -history API. - -The tests are currently being updated for the rename, and so are likely to have -filenames, descriptions, etc. which don't match the spec, or mismatch the -contents of the test. The rename is being done in stages and tracked at -<https://crbug.com/1300246>.
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/anchor-click.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/anchor-click.html index 55e45561..e0bf911 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/anchor-click.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/anchor-click.html
@@ -14,5 +14,5 @@ }); a.click(); assert_true(oncurrententrychange_called); -}, "AppHistoryCurrentChangeEvent fires for link click"); +}, "currententrychange fires for link click"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/constructor.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/constructor.html index 64ea8cf3..b09e68e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/constructor.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/constructor.html
@@ -4,20 +4,20 @@ <script> test(() => { assert_throws_js(TypeError, () => { - new AppHistoryCurrentChangeEvent("currententrychange"); + new NavigationCurrentEntryChangeEvent("currententrychange"); }); }, "can't bypass required members by omitting the dictionary entirely"); test(() => { assert_throws_js(TypeError, () => { - new AppHistoryCurrentChangeEvent("currententrychange", { + new NavigationCurrentEntryChangeEvent("currententrychange", { navigationType: "push" }); }); }, "from is required"); test(() => { - const event = new AppHistoryCurrentChangeEvent("currententrychange", { + const event = new NavigationCurrentEntryChangeEvent("currententrychange", { navigationType: "replace", from: navigation.currentEntry }); @@ -26,7 +26,7 @@ }, "all properties are reflected back"); test(t => { - const event = new AppHistoryCurrentChangeEvent("currententrychange", { from: navigation.currentEntry }); + const event = new NavigationCurrentEntryChangeEvent("currententrychange", { from: navigation.currentEntry }); assert_equals(event.navigationType, null); }, "defaults are as expected"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-back-same-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-back-same-doc.html index bee36493..768805b 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-back-same-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-back-same-doc.html
@@ -20,5 +20,5 @@ assert_false(oncurrententrychange_called); await new Promise(resolve => window.onpopstate = resolve); assert_true(oncurrententrychange_called); -}, "AppHistoryCurrentChangeEvent fires for history.back()"); +}, "currententrychange fires for history.back()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-pushState.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-pushState.html index c0e2d9a..1a17a7c 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-pushState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-pushState.html
@@ -12,5 +12,5 @@ }); history.pushState(1, "", "#1"); assert_true(oncurrententrychange_called); -}, "AppHistoryCurrentChangeEvent fires for history.pushState()"); +}, "currententrychange fires for history.pushState()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-replaceState.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-replaceState.html index da5505a..e8ae8ee 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-replaceState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/history-replaceState.html
@@ -14,5 +14,5 @@ }); history.replaceState(1, "", "#1"); assert_true(oncurrententrychange_called); -}, "AppHistoryCurrentChangeEvent fires for history.replaceState()"); +}, "currententrychange fires for history.replaceState()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/location-api.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/location-api.html index f06dc8e..88ebd985 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/location-api.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/location-api.html
@@ -14,5 +14,5 @@ }); location.hash = "#foo"; assert_true(oncurrententrychange_called); -}, "AppHistoryCurrentChangeEvent fires for location API navigations"); +}, "currententrychange fires for location API navigations"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc-popup.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc-popup.html index a8aa2a2..2399fb2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc-popup.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc-popup.html
@@ -11,5 +11,5 @@ assert_equals(w.location.href, "about:blank#2"); await new Promise(resolve => t.step_timeout(resolve, 10)); -}, "AppHistoryCurrentChangeEvent does not fire when navigating away from the initial about:blank (popup window)"); +}, "currententrychange does not fire when navigating away from the initial about:blank (popup window)"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc.html index e2c5674..f0fa9cdf 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank-same-doc.html
@@ -8,5 +8,5 @@ i.contentWindow.location.href = "about:blank#1"; i.contentWindow.location.href = "about:blank#2"; await new Promise(resolve => t.step_timeout(resolve, 10)); -}, "AppHistoryCurrentChangeEvent does not fire when navigating away from the initial about:blank"); +}, "currententrychange does not fire when navigating away from the initial about:blank"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank.html index 7b406c7..56eaa1a 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigate-from-initial-about-blank.html
@@ -7,5 +7,5 @@ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire"); i.contentWindow.navigation.navigate("/common/blank.html"); await new Promise(resolve => t.step_timeout(resolve, 10)); -}, "AppHistoryCurrentChangeEvent does not fire when navigating away from the initial about:blank"); +}, "currententrychange does not fire when navigating away from the initial about:blank"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-cross-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-cross-doc.html index df230bd..7416caa9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-cross-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-cross-doc.html
@@ -16,5 +16,5 @@ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations"); i.contentWindow.navigation.forward(); await new Promise(resolve => i.onload = resolve); -}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.back() and navigation.forward()"); +}, "currententrychange does not fire for cross-document navigation.back() and navigation.forward()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-same-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-same-doc.html index 41cc4af..8182673 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-same-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-back-forward-same-doc.html
@@ -36,5 +36,5 @@ assert_false(oncurrententrychange_forward_called); await forward_result.committed.then(() => forward_committed = true); assert_true(oncurrententrychange_forward_called); -}, "AppHistoryCurrentChangeEvent fires for navigation.back() and navigation.forward()"); +}, "currententrychange fires for same-document navigation.back() and navigation.forward()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-cross-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-cross-doc.html index 2f804a3..81a4e23 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-cross-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-cross-doc.html
@@ -8,5 +8,5 @@ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations"); i.contentWindow.navigation.navigate("/common/blank.html?1"); await new Promise(resolve => i.onload = resolve); -}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.navigate()"); +}, "currententrychange does not fire for cross-document navigation.navigate()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-preventDefault.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-preventDefault.html index 997fb55..34b9835 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-preventDefault.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-preventDefault.html
@@ -6,5 +6,5 @@ navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire"); navigation.onnavigate = e => e.preventDefault(); await promise_rejects_dom(t, "AbortError", navigation.navigate("#foo").committed); -}, "AppHistoryCurrentChangeEvent does not fire when onnavigate preventDefault() is called"); +}, "currententrychange does not fire when onnavigate preventDefault() is called"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-cross-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-cross-doc.html index 52478f22..d37ba34 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-cross-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-cross-doc.html
@@ -8,5 +8,5 @@ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations"); i.contentWindow.navigation.navigate("/common/blank.html?1", { replace: true }); await new Promise(resolve => i.onload = resolve); -}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.navigate() with replace"); +}, "currententrychange does not fire for cross-document navigation.navigate() with replace"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-same-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-same-doc.html index a402770..1c0f985b9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-same-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-same-doc.html
@@ -19,5 +19,5 @@ let result = navigation.navigate("#foo", { replace: true }); assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for navigation.navigate() with replace"); +}, "currententrychange fires for navigation.navigate() with replace"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-transitionWhile.html index 55b314a..a8babf2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-replace-transitionWhile.html
@@ -19,5 +19,5 @@ let result = i.contentWindow.navigation.navigate("/common/blank.html?1", { replace: true }); assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for navigation.navigate() with replace intercepted by transitionWhile"); +}, "currententrychange fires for navigation.navigate() with replace intercepted by transitionWhile()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-same-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-same-doc.html index 96de3de..87fc28d 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-same-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-same-doc.html
@@ -17,5 +17,5 @@ let result = navigation.navigate("#foo"); assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for navigation.navigate()"); +}, "currententrychange fires for navigation.navigate()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-transitionWhile.html index 2132016..e5855cf 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-navigate-transitionWhile.html
@@ -17,5 +17,5 @@ let result = i.contentWindow.navigation.navigate("/common/blank.html?1"); assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for navigation.navigate() intercepted by transitionWhile"); +}, "currententrychange fires for navigation.navigate() intercepted by transitionWhile()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-cross-doc.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-cross-doc.html index cb4279c..e590cab3 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-cross-doc.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-cross-doc.html
@@ -8,5 +8,5 @@ i.contentWindow.navigation.oncurrententrychange = t.unreached_func("currententrychange should not fire for cross-document navigations"); i.contentWindow.navigation.reload(); await new Promise(resolve => i.onload = resolve); -}, "AppHistoryCurrentChangeEvent does not fire for cross-document navigation.reload()"); +}, "currententrychange does not fire for cross-document navigation.reload()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-transitionWhile.html index cfa6258..c732de9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-reload-transitionWhile.html
@@ -17,5 +17,5 @@ let result = i.contentWindow.navigation.reload(); assert_true(oncurrententrychange_called); await result.committed; -}, "AppHistoryCurrentChangeEvent fires for navigation.reload() intercepted by transitionWhile"); +}, "currententrychange fires for navigation.reload() intercepted by transitionWhile()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-updateCurrentEntry.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-updateCurrentEntry.html index 8d548706..4423b2b 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-updateCurrentEntry.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/navigation-updateCurrentEntry.html
@@ -16,5 +16,5 @@ // "Updating" the state to the current state should still fire currententrychange. navigation.updateCurrentEntry({ state: navigation.currentEntry.getState() }); assert_equals(oncurrententrychange_count, 2); -}, "AppHistoryCurrentChangeEvent fires for navigation.updateCurrentEntry()"); +}, "currententrychange fires for navigation.updateCurrentEntry()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/properties.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/properties.html index 7048034e..e862543 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/properties.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/properties.html
@@ -4,11 +4,11 @@ <script> async_test(t => { navigation.oncurrententrychange = t.step_func_done(e => { - assert_equals(e.constructor, AppHistoryCurrentChangeEvent); + assert_equals(e.constructor, NavigationCurrentEntryChangeEvent); assert_false(e.bubbles); assert_false(e.cancelable); assert_true(e.isTrusted); }); location.href = "#1"; -}, "AppHistoryCurrentChangeEvent's properties"); +}, "NavigationCurrentEntryChangeEvent's properties"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html index 501857fe..6ef5cdf 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/event-constructor.html
@@ -4,13 +4,13 @@ <script> test(() => { assert_throws_js(TypeError, () => { - new AppHistoryNavigateEvent("navigate"); + new NavigateEvent("navigate"); }); }, "can't bypass required members by omitting the dictionary entirely"); test(() => { assert_throws_js(TypeError, () => { - new AppHistoryNavigateEvent("navigate", { + new NavigateEvent("navigate", { navigationType: "push", canTransition: false, userInitiated: false, @@ -23,10 +23,10 @@ }, "destination is required"); async_test(t => { - // We need to grab an AppHistoryDestination. + // We need to grab an NavigationDestination. navigation.onnavigate = t.step_func_done(e => { assert_throws_js(TypeError, () => { - new AppHistoryNavigateEvent("navigate", { + new NavigateEvent("navigate", { navigationType: "push", destination: e.destination, canTransition: false, @@ -41,13 +41,13 @@ }, "signal is required"); async_test(t => { - // We need to grab an AppHistoryDestination. + // We need to grab an NavigationDestination. navigation.onnavigate = t.step_func_done(e => { const info = { some: "object with identity" }; const formData = new FormData(); const signal = (new AbortController()).signal; - const event = new AppHistoryNavigateEvent("navigate", { + const event = new NavigateEvent("navigate", { navigationType: "replace", destination: e.destination, canTransition: true, @@ -71,9 +71,9 @@ }, "all properties are reflected back"); async_test(t => { - // We need to grab an AppHistoryDestination. + // We need to grab an NavigationDestination. navigation.onnavigate = t.step_func_done(e => { - const event = new AppHistoryNavigateEvent("navigate", { + const event = new NavigateEvent("navigate", { destination: e.destination, signal: (new AbortController()).signal });
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-detach-in-onnavigate.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-detach-in-onnavigate.html index adef895..467ea88 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-detach-in-onnavigate.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-detach-in-onnavigate.html
@@ -17,5 +17,5 @@ await promise_rejects_dom(t, 'AbortError', iframe_constructor, i.contentWindow.navigation.navigate("#1").committed); assert_true(abort_signal.aborted); assert_true(onabort_called); -}, "window detach inside AppHistoryNavigateEvent signals AppHistoryNavigateEvent.signal"); +}, "window detach inside a navigate event signals event.signal"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-preventDefault.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-preventDefault.html index f2816178..60fed90c 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-preventDefault.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-preventDefault.html
@@ -15,5 +15,5 @@ await promise_rejects_dom(t, 'AbortError', navigation.navigate("?1").committed); assert_true(abort_signal.aborted); assert_array_equals(events, ["onabort", "onnavigateerror"]); -}, "AppHistoryNavigateEvent.preventDefault signals AppHistoryNavigateEvent.signal"); +}, "event.preventDefault() signals event.signal"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-transitionWhile.html index d90ee5b0..ce195cf6 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-transitionWhile.html
@@ -14,5 +14,5 @@ await navigation.navigate("?1").finished; assert_false(abort_signal.aborted); assert_false(onabort_called); -}, "AppHistoryNavigateEvent's transitionWhile() does not signal AppHistoryNavigateEvent's signal"); +}, "event.transitionWhile() does not signal event.signal"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-after-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-after-transitionWhile.html index aad3be3..bc44a07 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-after-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-after-transitionWhile.html
@@ -36,5 +36,5 @@ t.step_timeout(t.step_func_done(() => {}), 5); }); }); -}, "window.stop() cancels AppHistoryNavigateEvent's transitionWhile() and signals AppHistoryNavigateEvent's signal"); +}, "window.stop() cancels the navigate event's transitionWhile() and signals event.signal"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-in-onnavigate.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-in-onnavigate.html index dde666c..1b406c42d36 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-in-onnavigate.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop-in-onnavigate.html
@@ -20,5 +20,5 @@ assert_true(onabort_called); assert_true(canceled_in_second_handler); }); -}, "window.stop() signals AppHistoryNavigateEvent.signal inside a navigate event handler"); +}, "window.stop() signals event.signal inside a navigate event handler"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop.html index 49399fb..43e005e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/signal-abort-window-stop.html
@@ -19,5 +19,5 @@ // didn't fire on a microtask. t.step_timeout(t.step_func_done(() => {}), 0); }); -}, "window.stop() signals AppHistoryNavigateEvent.signal"); +}, "window.stop() signals event.signal"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-after-dispatch.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-after-dispatch.html index 7f4a25ce..910665cb3d 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-after-dispatch.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-after-dispatch.html
@@ -12,5 +12,5 @@ }); location.href = "#1"; -}, "AppHistoryNavigateEvent's transitionWhile() throws if used after the dispatch phase"); +}, "event.transitionWhile() throws if used after the dispatch phase"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-canceled-event.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-canceled-event.html index ed6dbdc8..f1fe3ece 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-canceled-event.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-canceled-event.html
@@ -13,5 +13,5 @@ location.href = "#1"; assert_true(assertionHappened); -}, "AppHistoryNavigateEvent's transitionWhile() throws if used on a canceled event"); +}, "event.transitionWhile() throws if used on a canceled event"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-document-same-origin.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-document-same-origin.html index 79e03f1c..9e55958c 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-document-same-origin.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-document-same-origin.html
@@ -15,5 +15,5 @@ }); window.onload = t.step_func(() => location.href = target_url); -}, "AppHistoryNavigateEvent's transitionWhile() intercepts a same-origin cross-document navigation"); +}, "event.transitionWhile() intercepts a same-origin cross-document navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-origin.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-origin.html index ece79d2..e53371a9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-origin.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-cross-origin.html
@@ -14,5 +14,5 @@ }); window.onload = t.step_func(() => location.href = get_host_info().HTTPS_REMOTE_ORIGIN); -}, "AppHistoryNavigateEvent's transitionWhile() should throw if called for a cross origin navigation"); +}, "event.transitionWhile() should throw if called for a cross origin navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-detach.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-detach.html index d6a7d53..25159850 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-detach.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-detach.html
@@ -13,5 +13,5 @@ i.contentWindow.location.href = "#1"; }); -}, "AppHistoryNavigateEvent's transitionWhile() throws if used on an event from a detached iframe"); +}, "event.transitionWhile() throws if used on an event from a detached iframe"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-pushState.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-pushState.html index fb6152f..a08e4ea2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-pushState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-pushState.html
@@ -19,5 +19,5 @@ assert_equals(location.hash, "#1"); assert_equals(history.state, "update"); assert_equals(history.length, start_length + 1); -}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves"); +}, "event.transitionWhile() should proceed if the given promise resolves"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-replaceState.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-replaceState.html index 00f85dcc..e575876 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-replaceState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-history-replaceState.html
@@ -19,5 +19,5 @@ assert_equals(location.hash, "#1"); assert_equals(history.state, "update"); assert_equals(history.length, start_length); -}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves"); +}, "event.transitionWhile() should proceed if the given promise resolves"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times-reject.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times-reject.html index c325829..0532d75 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times-reject.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times-reject.html
@@ -31,5 +31,5 @@ })); assert_true(onnavigateerror_called); assert_true(caught_rejection); -}, "AppHistoryNavigateEvent's transitionWhile() is called multiple times and one of the promises rejects"); +}, "event.transitionWhile() is called multiple times and one of the promises rejects"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times.html index 0f6caf16..d5661a5 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-multiple-times.html
@@ -37,5 +37,5 @@ assert_true(p1_resolved); assert_true(p2_resolved); assert_true(p3_resolved); -}, "navigation.navigate() returns a finished promise that awaits all promises if AppHistoryNavigateEvent's transitionWhile() is called multiple times"); +}, "navigation.navigate() returns a finished promise that awaits all promises if event.transitionWhile() is called multiple times"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-navigation-back.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-navigation-back.html index a0bc453..3a462900 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-navigation-back.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-navigation-back.html
@@ -15,5 +15,5 @@ })); }); }, 0); -}, "AppHistoryNavigateEvent's transitionWhile() can intercept navigation.back()"); +}, "event.transitionWhile() can intercept navigation.back()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-on-synthetic-event.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-on-synthetic-event.html index 21a32e7..3acf417 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-on-synthetic-event.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-on-synthetic-event.html
@@ -3,9 +3,9 @@ <script src="/resources/testharnessreport.js"></script> <script> async_test(t => { - // We need to grab an AppHistoryDestination to construct the event. + // We need to grab an NavigationDestination to construct the event. navigation.onnavigate = t.step_func_done(e => { - const event = new AppHistoryNavigateEvent("navigate", { + const event = new NavigateEvent("navigate", { destination: e.destination, signal: (new AbortController()).signal }); @@ -13,5 +13,5 @@ assert_throws_dom("SecurityError", () => event.transitionWhile(Promise.resolve())); }); history.pushState(1, null, "#1"); -}, "AppHistoryNavigateEvent's transitionWhile() throws if invoked on a synthetic event"); +}, "event.transitionWhile() throws if invoked on a synthetic event"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-reject.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-reject.html index 2cdea050..28864b38 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-reject.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-reject.html
@@ -22,5 +22,5 @@ location.href = "#1"; assert_equals(location.hash, "#1"); -}, "AppHistoryNavigateEvent's transitionWhile() should abort if the given promise rejects"); +}, "event.transitionWhile() should abort if the given promise rejects"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-resolve.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-resolve.html index 2ee4fb397..b49c663 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-resolve.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-resolve.html
@@ -16,5 +16,5 @@ location.href = "#1"; assert_equals(location.hash, "#1"); -}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves"); +}, "event.transitionWhile() should proceed if the given promise resolves"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-same-document-history-back.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-same-document-history-back.html index 5e8ac39..4c404386 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-same-document-history-back.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigate-event/transitionWhile-same-document-history-back.html
@@ -36,5 +36,5 @@ history.back(); })); }, 0); -}, "AppHistoryNavigateEvent's transitionWhile() can intercept same-document history.back()"); +}, "event.transitionWhile() can intercept same-document history.back()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-bfcache.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-bfcache.html index 11bd7df..ef93d1e2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-bfcache.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-bfcache.html
@@ -32,7 +32,7 @@ assert_equals(entryData.length, 2); // Ensure that [1] has the proper url, and otherwise is initialized as - // a cross-document AppHistoryEntry ought to be. + // a cross-document NavigationHistoryEntry ought to be. assert_equals(entryData[0].url, pageA.url); assert_equals(entryData[1].url, pageB.url);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blank-navigation.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blank-navigation.html index 6f6dbcc2..f54ae06e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blank-navigation.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blank-navigation.html
@@ -21,5 +21,5 @@ }); i.src = "about:blank"; }); -}, "AppHistory behavior after navigation to about:blank"); +}, "entries() after navigation to about:blank"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blob-navigation.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blob-navigation.html index 77c25174..67611f4d 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blob-navigation.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-blob-navigation.html
@@ -21,5 +21,5 @@ }); i.src = URL.createObjectURL(new Blob(["<body></body>"])); }); -}, "AppHistory behavior after navigation to a blob: url"); +}, "entries() after navigation to a blob: URL"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation.html index 27a07c9..c5ef7f3 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-javascript-url-navigation.html
@@ -34,5 +34,5 @@ }); i.contentWindow.navigation.navigate("?1"); }); -}, "AppHistory behavior after navigation to a javascript: url"); +}, "entries() after navigation to a javascript: URL"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-srcdoc-navigation.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-srcdoc-navigation.html index 434b376..b80e8aa0 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-srcdoc-navigation.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-after-srcdoc-navigation.html
@@ -21,5 +21,5 @@ }); i.srcdoc = "new"; }); -}, "AppHistory behavior after setting a srcdoc attribute"); +}, "entries() after setting a srcdoc attribute"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-javascript-url-iframe.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-javascript-url-iframe.html index cd4279a..6f217f5e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-javascript-url-iframe.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-javascript-url-iframe.html
@@ -11,5 +11,5 @@ assert_array_equals(i.contentWindow.navigation.entries(), [i.contentWindow.navigation.currentEntry]); assert_equals(i.contentWindow.navigation.currentEntry.url, "about:blank"); -}, "AppHistory entries() and currentEntry should be set in a new javascript: URL iframe"); +}, "entries() and currentEntry should be set in a new javascript: URL iframe"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-srcdoc-iframe.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-srcdoc-iframe.html index d261efd..a7e0f88 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-srcdoc-iframe.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entries-in-new-srcdoc-iframe.html
@@ -11,5 +11,5 @@ assert_array_equals(i.contentWindow.navigation.entries(), [i.contentWindow.navigation.currentEntry]); assert_equals(i.contentWindow.navigation.currentEntry.url, "about:srcdoc"); -}, "AppHistory entries() and currentEntry should be set in a new srcdoc iframe"); +}, "entries() and currentEntry should be set in a new srcdoc iframe"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entry-after-detach.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entry-after-detach.html index 83962d2a..69c52d1 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entry-after-detach.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/entry-after-detach.html
@@ -16,5 +16,5 @@ assert_equals(i_entry.key, ""); assert_equals(i_entry.id, ""); }); -}, "AppHistoryEntry attributes after detach"); +}, "NavigationHistoryEntry properties after detach"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/index-not-in-entries.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/index-not-in-entries.html index 37cccd3..1c09a0f5 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/index-not-in-entries.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/index-not-in-entries.html
@@ -20,5 +20,5 @@ assert_equals(iframe_entry.index, -1); t.done(); }), 0); -}, "AppHistoryEntry.index should return -1 when not in AppHistory.entries"); +}, "entry.index should return -1 when not in navigation.entries()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-cross-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-cross-document.html index f0dc182..2dd58c0 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-cross-document.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-cross-document.html
@@ -11,5 +11,5 @@ // this window's navigation. assert_equals(navigation.entries().length, 1); }); -}, "AppHistoryEntry's key and id on cross-document back navigation"); +}, "NavigationHistoryEntry's key and id on cross-document back navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-same-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-same-document.html index b5137f3e..858b5fd 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-same-document.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-back-same-document.html
@@ -20,5 +20,5 @@ assert_equals(navigation.currentEntry.index, 0); }); history.back(); -}, "AppHistoryEntry's key and id on same-document back navigation"); +}, "NavigationHistoryEntry's key and id on same-document back navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload-transitionWhile.html index a06b645f..e5924d2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload-transitionWhile.html
@@ -19,5 +19,5 @@ assert_equals(i.contentWindow.navigation.currentEntry, original); assert_equals(i.contentWindow.navigation.currentEntry.key, key); assert_equals(i.contentWindow.navigation.currentEntry.id, id); -}, "AppHistoryEntry's key and id after location.reload() intercepted by transitionWhile()"); +}, "NavigationHistoryEntry's key and id after location.reload() intercepted by transitionWhile()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload.html index 267906d..f950e2f 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-reload.html
@@ -14,5 +14,5 @@ assert_equals(navigation.entries().length, 1); }); }); -}, "AppHistoryEntry's key and id after location.reload()"); +}, "NavigationHistoryEntry's key and id after location.reload()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace-cross-origin.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace-cross-origin.html index ee0f749..65aff4a 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace-cross-origin.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace-cross-origin.html
@@ -13,5 +13,5 @@ cross_origin_url.hostname = get_host_info().REMOTE_HOST; i.contentWindow.location.replace(cross_origin_url.href); }); -}, "AppHistoryEntry's key and id after location.replace()"); +}, "NavigationHistoryEntry's key and id after location.replace()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace.html index ec96371e..a58772a7 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/key-id-location-replace.html
@@ -14,5 +14,5 @@ assert_equals(navigation.entries().length, 1); }); }); -}, "AppHistoryEntry's key and id after location.replace()"); +}, "NavigationHistoryEntry's key and id after location.replace()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-from-meta-url-censored.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-from-meta-url-censored.html index 51eed08..fc563f5 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-from-meta-url-censored.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-from-meta-url-censored.html
@@ -28,5 +28,5 @@ "/navigation-api/navigation-history-entry/resources/no-referrer-meta.html"); assert_equals(new URL(i.contentWindow.navigation.entries()[1].url).pathname, "/navigation-api/navigation-history-entry/resources/no-referrer-meta.html"); -}, "The url of a document with no-referrer referrer meta tag is censored in AppHistoryEntry"); +}, "The url of a document with no-referrer referrer meta tag is censored in NavigationHistoryEntry"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-url-censored.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-url-censored.html index 20397b8..e7eb1af 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-url-censored.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/no-referrer-url-censored.html
@@ -28,5 +28,5 @@ "/navigation-api/navigation-history-entry/resources/no-referrer.html"); assert_equals(new URL(i.contentWindow.navigation.entries()[1].url).pathname, "/navigation-api/navigation-history-entry/resources/no-referrer.html"); -}, "The url of a document with no-referrer referrer policy is censored in AppHistoryEntry"); +}, "The url of a document with no-referrer referrer policy is censored in NavigationHistoryEntry"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/opaque-origin-data-url.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/opaque-origin-data-url.html index 3275a30..65123fa6 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/opaque-origin-data-url.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/opaque-origin-data-url.html
@@ -13,5 +13,5 @@ "currentIsNull: navigation.currentEntry === null}, '*')</sc" + "ript>"; }); -}, "AppHistory behavior after navigation to a data: URL (which has an opaque origin)"); +}, "entries() and currentEntry after navigation to a data: URL (which has an opaque origin)"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html index acb67ee..a197f82 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-fragment-navigate.html
@@ -26,5 +26,5 @@ assert_equals(navigation.entries()[1], entry2); assert_equals(navigation.entries()[2], entry3); }), 0); -}, "AppHistoryEntry.sameDocument after same-document navigations"); +}, "entry.sameDocument after same-document navigations"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-navigate.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-navigate.html index e1376a0..bfcb7c6 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-navigate.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-history-entry/sameDocument-after-navigate.html
@@ -10,5 +10,5 @@ i.onload = t.step_func_done(() => assert_false(i_entry.sameDocument)); i.contentWindow.location = "about:blank"; }); -}, "AppHistoryEntry.sameDocument after cross-document navigation"); +}, "entry.sameDocument after cross-document navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-base-url.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-base-url.html index 936ad75..1e8d3b9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-base-url.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-base-url.html
@@ -12,5 +12,5 @@ assert_equals(iframeURL.pathname, startingURL.pathname); }); }); -}, "reload() must ignore the AppHistory object's base URL"); +}, "reload() must ignore the Navigation object's base URL"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-state-and-info.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-state-and-info.html index 3ee6a8b..a68dd2ab8 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-state-and-info.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/reload-state-and-info.html
@@ -31,7 +31,7 @@ assert_equals(i.contentWindow.location.href, start_url); assert_equals(i.contentWindow.navigation.currentEntry.key, start_key); assert_equals(i.contentWindow.navigation.currentEntry.id, start_id); - assert_equals(i.contentWindow.navigation.currentEntry.getState().key2, "value2", "current.getState() after teh reload"); + assert_equals(i.contentWindow.navigation.currentEntry.getState().key2, "value2", "currentEntry.getState() after the reload"); assert_not_equals(i.contentWindow.navigation.currentEntry.getState(), navState2); })); }));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/return-value/resources/helpers.js b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/return-value/resources/helpers.js index bf711b18..5b147f4 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/return-value/resources/helpers.js +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/return-value/resources/helpers.js
@@ -33,7 +33,7 @@ assert_not_equals(committedValue, undefined, "committed must fulfill before finished"); assert_equals(finishedValue, committedValue, "committed and finished must fulfill with the same value"); - assert_true(finishedValue instanceof w.AppHistoryEntry, "fulfillment value must be an AppHistoryEntry"); + assert_true(finishedValue instanceof w.NavigationHistoryEntry, "fulfillment value must be a NavigationHistoryEntry"); assert_equals(finishedValue, expected); }; @@ -50,11 +50,11 @@ await promise_rejects_exactly(t, expectedRejection, result.finished); assert_not_equals(committedValue, undefined, "committed must fulfill before finished rejects"); - assert_true(committedValue instanceof w.AppHistoryEntry, "fulfillment value must be an AppHistoryEntry"); + assert_true(committedValue instanceof w.NavigationHistoryEntry, "fulfillment value must be a NavigationHistoryEntry"); assert_equals(committedValue, expectedEntry); }; -window.assertCommittedFulfillsFinishedRejectsDOM = async (t, result, expectedEntry, expectedDOMExceptionCode, w = window, domExceptionConstructor = w.DOMException, appHistoryEntryConstuctor = w.AppHistoryEntry) => { +window.assertCommittedFulfillsFinishedRejectsDOM = async (t, result, expectedEntry, expectedDOMExceptionCode, w = window, domExceptionConstructor = w.DOMException, navigationHistoryEntryConstuctor = w.NavigationHistoryEntry) => { assertReturnValue(result, w); // Don't use await here so that we can catch out-of-order settlements. @@ -67,7 +67,7 @@ await promise_rejects_dom(t, expectedDOMExceptionCode, domExceptionConstructor, result.finished); assert_not_equals(committedValue, undefined, "committed must fulfill before finished rejects"); - assert_true(committedValue instanceof appHistoryEntryConstuctor, "fulfillment value must be an AppHistoryEntry"); + assert_true(committedValue instanceof navigationHistoryEntryConstuctor, "fulfillment value must be an NavigationHistoryEntry"); assert_equals(committedValue, expectedEntry); };
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/traverseTo-detach-between-navigate-and-navigatesuccess.html b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/traverseTo-detach-between-navigate-and-navigatesuccess.html index 9a95295..25dd1346 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/traverseTo-detach-between-navigate-and-navigatesuccess.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/navigation-methods/traverseTo-detach-between-navigate-and-navigatesuccess.html
@@ -10,7 +10,7 @@ window.onload = t.step_func(() => { const iWindow = i.contentWindow; const iDOMException = iWindow.DOMException; - const iAppHistoryEntry = iWindow.AppHistoryEntry; + const iNavigationHistoryEntry = iWindow.NavigationHistoryEntry; i.contentWindow.navigation.navigate("#1").finished.then(t.step_func(() => { assert_equals(i.contentWindow.navigation.entries().length, 2); @@ -33,7 +33,7 @@ assert_greater_than(e.lineno, 0); assert_greater_than(e.colno, 0); - assertCommittedFulfillsFinishedRejectsExactly(t, result, iWindow.navigation.currentEntry, e.error, iWindow, iDOMException, iAppHistoryEntry).then( + assertCommittedFulfillsFinishedRejectsExactly(t, result, iWindow.navigation.currentEntry, e.error, iWindow, iDOMException, iNavigationHistoryEntry).then( () => t.done(), t.step_func(err => { throw err; }) );
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile-reject.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile-reject.html index 68cff808..05d86b49 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile-reject.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile-reject.html
@@ -21,7 +21,7 @@ finalExpectedEvent: "transition.finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.reject(expectedError));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile.html index 30d083c9..d435aab3 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document-transitionWhile.html
@@ -20,7 +20,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve());
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document.html index cc30375..76c3e99 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/back-same-document.html
@@ -18,7 +18,7 @@ finalExpectedEvent: "finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); const result = navigation.back(); recorder.setUpResultListeners(result);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-before-popstate-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-before-popstate-transitionWhile.html index f4c36fa0..59f37e97 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-before-popstate-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-before-popstate-transitionWhile.html
@@ -44,5 +44,5 @@ await forward_result.finished; assert_true(oncurrententrychange_back_called); assert_true(onpopstate_forward_called); -}, "AppHistoryCurrentChangeEvent fires for navigation.back() and navigation.forward()"); +}, "currententrychange fires before popstate for navigation.back() and navigation.forward()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html index 396a46f..7cbed8b 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/currententrychange-dispose-ordering.html
@@ -22,5 +22,5 @@ navigation.navigate("#foo", { replace: true }); assert_true(oncurrententrychange_called); assert_true(ondispose_called); -}, "Ordering between AppHistoryCurrentChangeEvent and AppHistoryEntry dispose events"); +}, "Ordering between Navigation currententrychange and NavigationHistoryEntry dispose events"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-canceled.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-canceled.html index f4247413..eef10cd1 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-canceled.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-canceled.html
@@ -14,7 +14,7 @@ finalExpectedEvent: "promise microtask" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", t.step_func(e => { e.preventDefault();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-double-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-double-transitionWhile.html index 6e7c895..5ec22b1 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-double-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-double-transitionWhile.html
@@ -19,7 +19,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(new Promise(r => t.step_timeout(r, 1)));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reentrant.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reentrant.html index 36b2355..4dedb58 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reentrant.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reentrant.html
@@ -20,7 +20,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 2)));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reject.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reject.html index e3f65e81..dbef392 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reject.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile-reject.html
@@ -20,7 +20,7 @@ finalExpectedEvent: "transition.finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.reject(expectedError));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile.html index 0ae4144..0e1d22d 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/location-href-transitionWhile.html
@@ -19,7 +19,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve());
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-canceled.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-canceled.html index 851fa34..2604a60 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-canceled.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-canceled.html
@@ -14,7 +14,7 @@ finalExpectedEvent: "finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", t.step_func(e => { e.preventDefault();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-double-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-double-transitionWhile.html index 4413ca4..556d1737 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-double-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-double-transitionWhile.html
@@ -19,7 +19,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(new Promise(r => t.step_timeout(r, 1)));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-in-transition-finished.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-in-transition-finished.html index f8ebd69..8c74ba2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-in-transition-finished.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-in-transition-finished.html
@@ -20,7 +20,7 @@ finalExpectedEventCount: 2 }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigatesuccess", t.step_func(() => { if (location.hash === "#1") {
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html index 8cbb98e..2ef4c4fe 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reentrant.html
@@ -20,7 +20,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(new Promise(resolve => t.step_timeout(resolve, 2)));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reject.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reject.html index 45ce7000..b3a10b4 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reject.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document-transitionWhile-reject.html
@@ -20,7 +20,7 @@ finalExpectedEvent: "transition.finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.reject(expectedError));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document.html index 07f7bdce..589e110 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-same-document.html
@@ -17,7 +17,7 @@ finalExpectedEvent: "finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); const result = navigation.navigate("#1"); recorder.setUpResultListeners(result);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile-stop.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile-stop.html index 9d06ba1..9a8c412 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile-stop.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile-stop.html
@@ -19,7 +19,7 @@ finalExpectedEvent: "transition.finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve());
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile.html index d3125b0..b72bf49e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/navigate-transitionWhile.html
@@ -19,7 +19,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve());
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-canceled.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-canceled.html index a7ae791..3e9e24e 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-canceled.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-canceled.html
@@ -14,7 +14,7 @@ finalExpectedEvent: "finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", t.step_func(e => { e.preventDefault();
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile-reject.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile-reject.html index 0a70c6d..6939ee2 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile-reject.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile-reject.html
@@ -20,7 +20,7 @@ finalExpectedEvent: "transition.finished rejected" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.reject(expectedError));
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile.html index 8cc237f..31cd813f 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/reload-transitionWhile.html
@@ -19,7 +19,7 @@ finalExpectedEvent: "transition.finished fulfilled" }); - recorder.setUpAppHistoryListeners(); + recorder.setUpNavigationAPIListeners(); navigation.addEventListener("navigate", e => { e.transitionWhile(Promise.resolve());
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/resources/helpers.mjs b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/resources/helpers.mjs index b5a1e6b..359774d 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/resources/helpers.mjs +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/resources/helpers.mjs
@@ -23,7 +23,7 @@ this.#finalExpectedEventCount = finalExpectedEventCount; } - setUpAppHistoryListeners() { + setUpNavigationAPIListeners() { navigation.addEventListener("navigate", e => { this.record("navigate");
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/transition-realms-and-identity.html b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/transition-realms-and-identity.html index 16fb818..c2c06fc 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/transition-realms-and-identity.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/ordering-and-transition/transition-realms-and-identity.html
@@ -17,7 +17,7 @@ const transitionFinished1 = transition1.finished; assert_true(returnValueFinished1 instanceof i.contentWindow.Promise); - assert_true(transition1 instanceof i.contentWindow.AppHistoryTransition); + assert_true(transition1 instanceof i.contentWindow.NavigationTransition); assert_true(transitionFinished1 instanceof i.contentWindow.Promise); assert_not_equals(returnValueFinished1, transitionFinished1);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-away-and-back.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-away-and-back.html index 25d0c1e7..60f7036 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-away-and-back.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-away-and-back.html
@@ -27,5 +27,5 @@ } }); }); -}, "appHistoryEntry.getState() behavior after navigating away and back"); +}, "entry.getState() behavior after navigating away and back"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-location-api.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-location-api.html index 9c869ca..29e5a025 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-location-api.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/cross-document-location-api.html
@@ -16,5 +16,5 @@ assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined); }); }); -}, "appHistoryEntry.getState() behavior after cross-document location API navigation"); +}, "entry.getState() behavior after cross-document location API navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/history-pushState.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/history-pushState.html index 1c8858c0..dad01fd 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/history-pushState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/history-pushState.html
@@ -7,5 +7,5 @@ assert_equals(navigation.currentEntry.getState().data, "value"); history.pushState(1, "", "#push"); assert_equals(navigation.currentEntry.getState(), undefined); -}, "appHistoryEntry.getState() after history.pushState()"); +}, "entry.getState() after history.pushState()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/history-replaceState.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/history-replaceState.html index cc37949..14934d6 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/history-replaceState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/history-replaceState.html
@@ -7,5 +7,5 @@ assert_equals(navigation.currentEntry.getState().data, "value"); history.replaceState(1, "", "#replace"); assert_equals(navigation.currentEntry.getState(), undefined); -}, "appHistoryEntry.getState() after history.replaceState()"); +}, "entry.getState() after history.replaceState()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/location-reload.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/location-reload.html index 94d4664..ae483bf 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/location-reload.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/location-reload.html
@@ -15,5 +15,5 @@ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value"); }); }); -}, "appHistoryEntry.getState() after location.reload()"); +}, "entry.getState() after location.reload()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-location-api.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-location-api.html index 9cb6215..d161df8 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-location-api.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-location-api.html
@@ -43,5 +43,5 @@ assert_equals(back_state.statevar, "state"); }); }, 0); -}, "appHistoryEntry.getState() behavior after navigating away using a fragment change, then back"); +}, "entry.getState() behavior after navigating away using a fragment change, then back"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-navigation-api.html b/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-navigation-api.html index eed296d5..0ece14d 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-navigation-api.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/state/same-document-away-and-back-navigation-api.html
@@ -49,5 +49,5 @@ }); })(); }, 0); -}, "appHistoryEntry.getState() behavior after navigating away using the navigation API, then back"); +}, "entry.getState() behavior after navigating away using the navigation API, then back"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-away-and-back.html b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-away-and-back.html index a192314..c37d5e9 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-away-and-back.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-away-and-back.html
@@ -27,5 +27,5 @@ } }); }); -}, "appHistoryEntry.getState() behavior after navigating away and back"); +}, "entry.getState() behavior after navigating away and back"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-location-api.html b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-location-api.html index 3b4ec68b..26191fb8 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-location-api.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/cross-document-location-api.html
@@ -16,5 +16,5 @@ assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined); }); }); -}, "appHistoryEntry.getState() behavior after cross-document location API navigation"); +}, "entry.getState() behavior after cross-document location API navigation"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-pushState.html b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-pushState.html index 73fb89f2a..852294c6 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-pushState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-pushState.html
@@ -7,5 +7,5 @@ assert_equals(navigation.currentEntry.getState().data, "value"); history.pushState(1, "", "#push"); assert_equals(navigation.currentEntry.getState(), undefined); -}, "appHistoryEntry.getState() after history.pushState()"); +}, "entry.getState() after history.pushState()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-replaceState.html b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-replaceState.html index 15472db..3eb91a9a 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-replaceState.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/history-replaceState.html
@@ -7,5 +7,5 @@ assert_equals(navigation.currentEntry.getState().data, "value"); history.replaceState(1, "", "#replace"); assert_equals(navigation.currentEntry.getState(), undefined); -}, "appHistoryEntry.getState() after history.replaceState()"); +}, "entry.getState() after history.replaceState()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/location-reload.html b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/location-reload.html index 664ff1b..8589eeb6 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/location-reload.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/location-reload.html
@@ -15,5 +15,5 @@ assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value"); }); }); -}, "appHistoryEntry.getState() after location.reload()"); +}, "entry.getState() after location.reload()"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/same-document-away-and-back-location-api.html b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/same-document-away-and-back-location-api.html index a1f54f5..47b1904 100644 --- a/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/same-document-away-and-back-location-api.html +++ b/third_party/blink/web_tests/external/wpt/navigation-api/updateCurrentEntry-method/same-document-away-and-back-location-api.html
@@ -36,5 +36,5 @@ assert_equals(back_state.statevar, "state"); }); }, 0); -}, "appHistoryEntry.getState() behavior after navigating away using the location API, then back"); +}, "entry.getState() behavior after navigating away using the location API, then back"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/push-api/META.yml b/third_party/blink/web_tests/external/wpt/push-api/META.yml index 2f5a866..4886e6a 100644 --- a/third_party/blink/web_tests/external/wpt/push-api/META.yml +++ b/third_party/blink/web_tests/external/wpt/push-api/META.yml
@@ -1,3 +1,4 @@ spec: https://w3c.github.io/push-api/ suggested_reviewers: - beverloo + - marcoscaceres
diff --git a/third_party/blink/web_tests/external/wpt/push-api/permission.https-expected.txt b/third_party/blink/web_tests/external/wpt/push-api/permission.https-expected.txt new file mode 100644 index 0000000..ed6bba6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/push-api/permission.https-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Query "push" powerful feature promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'query' on 'Permissions': Push Permission without userVisibleOnly:true isn't supported yet." +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/push-api/permission.https.html b/third_party/blink/web_tests/external/wpt/push-api/permission.https.html new file mode 100644 index 0000000..61cb40a8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/push-api/permission.https.html
@@ -0,0 +1,14 @@ +<!doctype html> +<meta charset=utf-8> +<title>Test push is a powerful feature via Permissions API</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> + +<script> +promise_test(async (test) => { + const status = await navigator.permissions.query({ name: "push" }); + assert_true(status instanceof PermissionStatus); + assert_equals(status.name, "push", `permission's name must be "push"`); + assert_equals(status.state, "prompt", `permission's state must be "prompt" by default`); +}, `Query "push" powerful feature`); +</script>
diff --git a/third_party/blink/web_tests/fast/css/css2-system-color.html b/third_party/blink/web_tests/fast/css/css2-system-color.html index 8c14597..f140734a 100644 --- a/third_party/blink/web_tests/fast/css/css2-system-color.html +++ b/third_party/blink/web_tests/fast/css/css2-system-color.html
@@ -25,6 +25,7 @@ </style> </head> <body> + <!-- TODO (crbug.com/1299441): Include additional colors such as ButtonBorder and adjust deprecated ones. --> <div class="box"><div class="text">ActiveBorder</div><div class="inner" style="background-color: ActiveBorder"> </div></div> <div class="box"><div class="text">ActiveCaption</div><div class="inner" style="background-color: ActiveCaption"> </div></div> <div class="box"><div class="text">ActiveText</div><div class="inner" style="background-color: ActiveText"> </div></div>
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-img-figure-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-img-figure-expected.txt index b9c59ff9..5a5ff61e 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-img-figure-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/accessibility/accessibility-nameSources-img-figure-expected.txt
@@ -14,10 +14,6 @@ type : attribute } [2] : { - nativeSource : figcaption - type : relatedElement - } - [3] : { attribute : title type : attribute } @@ -49,10 +45,6 @@ type : attribute } [2] : { - nativeSource : figcaption - type : relatedElement - } - [3] : { attribute : title type : attribute value : { @@ -75,10 +67,6 @@ } { childIds : <object> - description : { - type : computedString - value : figure3-title - } domNode : figure#figure3 ignored : false name : { @@ -92,25 +80,7 @@ type : attribute } [2] : { - nativeSource : figcaption - nativeSourceValue : { - relatedNodes : [ - [0] : { - backendDOMNodeId : <number> - text : figcaption3 - } - ] - type : nodeList - } - type : relatedElement - value : { - type : computedString - value : figcaption3 - } - } - [3] : { attribute : title - superseded : true type : attribute value : { type : computedString @@ -119,21 +89,21 @@ } ] type : computedString - value : figcaption3 + value : figure3-title } nodeId : <string> parentId : <string> properties : [ [0] : { - name : labelledby + name : details value : { relatedNodes : [ [0] : { nodeResult : figcaption - text : figcaption3 } ] - type : nodeList + type : idrefList + value : } } ] @@ -169,24 +139,6 @@ } } [2] : { - nativeSource : figcaption - nativeSourceValue : { - relatedNodes : [ - [0] : { - backendDOMNodeId : <number> - text : figcaption4 - } - ] - type : nodeList - } - superseded : true - type : relatedElement - value : { - type : computedString - value : figcaption4 - } - } - [3] : { attribute : title superseded : true type : attribute @@ -202,6 +154,18 @@ nodeId : <string> parentId : <string> properties : [ + [0] : { + name : details + value : { + relatedNodes : [ + [0] : { + nodeResult : figcaption + } + ] + type : idrefList + value : + } + } ] role : { type : role @@ -251,24 +215,6 @@ } } [2] : { - nativeSource : figcaption - nativeSourceValue : { - relatedNodes : [ - [0] : { - backendDOMNodeId : <number> - text : figcaption5 - } - ] - type : nodeList - } - superseded : true - type : relatedElement - value : { - type : computedString - value : figcaption5 - } - } - [3] : { attribute : title superseded : true type : attribute @@ -285,6 +231,18 @@ parentId : <string> properties : [ [0] : { + name : details + value : { + relatedNodes : [ + [0] : { + nodeResult : figcaption + } + ] + type : idrefList + value : + } + } + [1] : { name : labelledby value : { relatedNodes : [
diff --git a/third_party/blink/web_tests/http/tests/origin_trials/webexposed/eventtiming-origin-trial-interfaces.html b/third_party/blink/web_tests/http/tests/origin_trials/webexposed/eventtiming-origin-trial-interfaces.html deleted file mode 100644 index 0522c36c..0000000 --- a/third_party/blink/web_tests/http/tests/origin_trials/webexposed/eventtiming-origin-trial-interfaces.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<!-- Generate token with the command: -generate_token.py http://127.0.0.1:8000 EventTiming --expire-timestamp=2000000000 --- --> -<meta http-equiv="origin-trial" content="AmrQAZL5Rf0y2nmiZrtLBAapfQXYtH0IqA972b1SUWvdizv0fB0yc39ofeP6T8lr/O94N3ZWRzddyhv1EbPeDAUAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRXZlbnRUaW1pbmciLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=" /> -<title>EventTiming API - interfaces and properties exposed by origin trial</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/origin-trials-helper.js"></script> -<script> -test(t => { - OriginTrialsHelper.check_properties_exist(this, - {'PerformanceEventTiming': ['processingStart', 'cancelable'], - }); -}, 'EventTiming API interfaces and properties in Origin-Trial enabled document.'); -</script>
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png index d121d2c6..7ec8d59 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png index 94751b92..e7f7792d 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png index fd4951b..96720f07 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png index 1a4d470..e4f30e0 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png deleted file mode 100644 index 4d9c5ba..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png deleted file mode 100644 index 4d9c5ba..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png index 873eb12..3e2c3ee 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png index bcda39f..86da113a 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png index fff8447..e8b5c77 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png new file mode 100644 index 0000000..b4a6f4f --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png index 2a05776..3387eac 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png new file mode 100644 index 0000000..2a09fd9 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-fill-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-fill-expected.png new file mode 100644 index 0000000..8e1fd7d --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-arc-circumference-fill-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-expected.png index 59b3fa8..47b0fb2 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-transformclip-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-transformclip-expected.png new file mode 100644 index 0000000..3fd6dde --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-composite-transformclip-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-expected.png new file mode 100644 index 0000000..b3cbc604 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-fill-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-fill-expected.png new file mode 100644 index 0000000..8740310 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-circumference-fill-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-connecting-line-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-connecting-line-expected.png new file mode 100644 index 0000000..b4021b6 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-ellipse-connecting-line-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-imageSmoothingEnabled-patterns-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-imageSmoothingEnabled-patterns-expected.png index 5a990a08..dc696cf1 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-imageSmoothingEnabled-patterns-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-imageSmoothingEnabled-patterns-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png new file mode 100644 index 0000000..84989fd4 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-pattern-no-repeat-with-transformations-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-text-baseline-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-text-baseline-expected.png index 6774bff..d487eae 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-text-baseline-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-text-baseline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-zero-length-lineCap-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-zero-length-lineCap-expected.png new file mode 100644 index 0000000..b84e40c640 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/canvas-zero-length-lineCap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png index ccaa51b..a9b1dae 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/image-object-in-canvas-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png index a97034d..6f4c626 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/oopr-canvas2d/fast/canvas/quadraticCurveTo-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png index e1b933ff..56b5c45 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png index d1a7bf5e..65a4a86 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png index 607c5deb..5928dadc 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png index a12da8e..364a96c 100644 --- a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg b/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg index 60e224b..fc70fdb 100644 --- a/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg +++ b/third_party/blink/web_tests/svg/css/css-systemcolors-expected.svg
@@ -423,6 +423,18 @@ </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> </filter> + <filter x="0" y="0" width="1" height="1" id="f35"> + <feFlood flood-color="currentColor" color="ButtonBorder" /> + </filter> + <linearGradient id="g35"> + <stop stop-color="currentColor" color="ButtonBorder" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl35"> + <feDiffuseLighting color="ButtonBorder" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> </defs> <rect width="28" height="28" x="0" filter="url(#f0)" /> <rect width="28" height="28" x="0" y="28" fill="url(#g0)" /> @@ -508,25 +520,28 @@ <rect width="28" height="28" x="756" filter="url(#f27)" /> <rect width="28" height="28" x="756" y="28" fill="url(#g27)" /> <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl27)" /> - <rect width="28" height="28" x="756" filter="url(#f28)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g28)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl28)" /> - <rect width="28" height="28" x="756" filter="url(#f29)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g29)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl29)" /> - <rect width="28" height="28" x="756" filter="url(#f30)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g30)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl30)" /> - <rect width="28" height="28" x="756" filter="url(#f31)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g31)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl31)" /> - <rect width="28" height="28" x="756" filter="url(#f32)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g32)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl32)" /> - <rect width="28" height="28" x="756" filter="url(#f33)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g33)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl33)" /> - <rect width="28" height="28" x="756" filter="url(#f34)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g34)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl34)" /> + <rect width="28" height="28" x="784" filter="url(#f28)" /> + <rect width="28" height="28" x="784" y="28" fill="url(#g28)" /> + <rect width="28" height="28" x="784" y="56" fill="white" filter="url(#fl28)" /> + <rect width="28" height="28" x="812" filter="url(#f29)" /> + <rect width="28" height="28" x="812" y="28" fill="url(#g29)" /> + <rect width="28" height="28" x="812" y="56" fill="white" filter="url(#fl29)" /> + <rect width="28" height="28" x="840" filter="url(#f30)" /> + <rect width="28" height="28" x="840" y="28" fill="url(#g30)" /> + <rect width="28" height="28" x="840" y="56" fill="white" filter="url(#fl30)" /> + <rect width="28" height="28" x="868" filter="url(#f31)" /> + <rect width="28" height="28" x="868" y="28" fill="url(#g31)" /> + <rect width="28" height="28" x="868" y="56" fill="white" filter="url(#fl31)" /> + <rect width="28" height="28" x="896" filter="url(#f32)" /> + <rect width="28" height="28" x="896" y="28" fill="url(#g32)" /> + <rect width="28" height="28" x="896" y="56" fill="white" filter="url(#fl32)" /> + <rect width="28" height="28" x="924" filter="url(#f33)" /> + <rect width="28" height="28" x="924" y="28" fill="url(#g33)" /> + <rect width="28" height="28" x="924" y="56" fill="white" filter="url(#fl33)" /> + <rect width="28" height="28" x="952" filter="url(#f34)" /> + <rect width="28" height="28" x="952" y="28" fill="url(#g34)" /> + <rect width="28" height="28" x="952" y="56" fill="white" filter="url(#fl34)" /> + <rect width="28" height="28" x="980" filter="url(#f35)" /> + <rect width="28" height="28" x="980" y="28" fill="url(#g35)" /> + <rect width="28" height="28" x="980" y="56" fill="white" filter="url(#fl35)" /> </svg>
diff --git a/third_party/blink/web_tests/svg/css/css-systemcolors.svg b/third_party/blink/web_tests/svg/css/css-systemcolors.svg index 9fbf88b..ce1b32d 100644 --- a/third_party/blink/web_tests/svg/css/css-systemcolors.svg +++ b/third_party/blink/web_tests/svg/css/css-systemcolors.svg
@@ -343,10 +343,10 @@ <feFlood flood-color="currentColor" color="LinkText" /> </filter> <linearGradient id="g28"> - <stop stop-color="currentColor" color="LinkColor" /> + <stop stop-color="currentColor" color="LinkText" /> </linearGradient> <filter x="0" y="0" width="1" height="1" id="fl28"> - <feDiffuseLighting color="LinkColor" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDiffuseLighting color="LinkText" lighting-color="currentColor" in="SourceAlpha" result="light"> <feDistantLight azimuth="45" elevation="45" /> </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> @@ -423,6 +423,18 @@ </feDiffuseLighting> <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> </filter> + <filter x="0" y="0" width="1" height="1" id="f35"> + <feFlood flood-color="currentColor" color="ButtonBorder" /> + </filter> + <linearGradient id="g35"> + <stop stop-color="currentColor" color="ButtonBorder" /> + </linearGradient> + <filter x="0" y="0" width="1" height="1" id="fl35"> + <feDiffuseLighting color="ButtonBorder" lighting-color="currentColor" in="SourceAlpha" result="light"> + <feDistantLight azimuth="45" elevation="45" /> + </feDiffuseLighting> + <feComposite in="SourceGraphic" in2="light" k1="1" k2="0" k3="0" k4="0" operator="arithmetic" /> + </filter> </defs> <rect width="28" height="28" x="0" filter="url(#f0)" /> <rect width="28" height="28" x="0" y="28" fill="url(#g0)" /> @@ -508,25 +520,28 @@ <rect width="28" height="28" x="756" filter="url(#f27)" /> <rect width="28" height="28" x="756" y="28" fill="url(#g27)" /> <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl27)" /> - <rect width="28" height="28" x="756" filter="url(#f28)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g28)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl28)" /> - <rect width="28" height="28" x="756" filter="url(#f29)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g29)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl29)" /> - <rect width="28" height="28" x="756" filter="url(#f30)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g30)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl30)" /> - <rect width="28" height="28" x="756" filter="url(#f31)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g31)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl31)" /> - <rect width="28" height="28" x="756" filter="url(#f32)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g32)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl32)" /> - <rect width="28" height="28" x="756" filter="url(#f33)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g33)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl33)" /> - <rect width="28" height="28" x="756" filter="url(#f34)" /> - <rect width="28" height="28" x="756" y="28" fill="url(#g34)" /> - <rect width="28" height="28" x="756" y="56" fill="white" filter="url(#fl34)" /> + <rect width="28" height="28" x="784" filter="url(#f28)" /> + <rect width="28" height="28" x="784" y="28" fill="url(#g28)" /> + <rect width="28" height="28" x="784" y="56" fill="white" filter="url(#fl28)" /> + <rect width="28" height="28" x="812" filter="url(#f29)" /> + <rect width="28" height="28" x="812" y="28" fill="url(#g29)" /> + <rect width="28" height="28" x="812" y="56" fill="white" filter="url(#fl29)" /> + <rect width="28" height="28" x="840" filter="url(#f30)" /> + <rect width="28" height="28" x="840" y="28" fill="url(#g30)" /> + <rect width="28" height="28" x="840" y="56" fill="white" filter="url(#fl30)" /> + <rect width="28" height="28" x="868" filter="url(#f31)" /> + <rect width="28" height="28" x="868" y="28" fill="url(#g31)" /> + <rect width="28" height="28" x="868" y="56" fill="white" filter="url(#fl31)" /> + <rect width="28" height="28" x="896" filter="url(#f32)" /> + <rect width="28" height="28" x="896" y="28" fill="url(#g32)" /> + <rect width="28" height="28" x="896" y="56" fill="white" filter="url(#fl32)" /> + <rect width="28" height="28" x="924" filter="url(#f33)" /> + <rect width="28" height="28" x="924" y="28" fill="url(#g33)" /> + <rect width="28" height="28" x="924" y="56" fill="white" filter="url(#fl33)" /> + <rect width="28" height="28" x="952" filter="url(#f34)" /> + <rect width="28" height="28" x="952" y="28" fill="url(#g34)" /> + <rect width="28" height="28" x="952" y="56" fill="white" filter="url(#fl34)" /> + <rect width="28" height="28" x="980" filter="url(#f35)" /> + <rect width="28" height="28" x="980" y="28" fill="url(#g35)" /> + <rect width="28" height="28" x="980" y="56" fill="white" filter="url(#fl35)" /> </svg>
diff --git a/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt b/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt index e6798f2..3af6d76 100644 --- a/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt +++ b/third_party/blink/web_tests/svg/css/rect-system-color-expected.txt
@@ -19,6 +19,9 @@ Testing system colorBackground PASS computedStyleText.fill is computedStyleDiv.get('color').toString() PASS computedStyleText.stroke is computedStyleDiv.get('color').toString() +Testing system colorButtonBorder +PASS computedStyleText.fill is computedStyleDiv.get('color').toString() +PASS computedStyleText.stroke is computedStyleDiv.get('color').toString() Testing system colorButtonFace PASS computedStyleText.fill is computedStyleDiv.get('color').toString() PASS computedStyleText.stroke is computedStyleDiv.get('color').toString()
diff --git a/third_party/blink/web_tests/svg/css/rect-system-color.xhtml b/third_party/blink/web_tests/svg/css/rect-system-color.xhtml index 86397d8d..4e2492e1 100644 --- a/third_party/blink/web_tests/svg/css/rect-system-color.xhtml +++ b/third_party/blink/web_tests/svg/css/rect-system-color.xhtml
@@ -24,7 +24,7 @@ description('Test that fill and stroke properties accept system colors'); debug(''); -var systemColors = new Array("ActiveBorder", "ActiveCaption", "ActiveText", "AppWorkspace", "Background", +var systemColors = new Array("ActiveBorder", "ActiveCaption", "ActiveText", "AppWorkspace", "Background", "ButtonBorder", "ButtonFace", "ButtonHighlight", "ButtonShadow", "ButtonText", "Canvas", "CanvasText", "CaptionText", "Field", "FieldText", "GrayText", "Highlight", "HighlightText", "InactiveBorder", "InactiveCaption", "InactiveCaptionText", "InfoBackground",
diff --git a/third_party/blink/web_tests/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png b/third_party/blink/web_tests/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png deleted file mode 100644 index 5957ad4..0000000 --- a/third_party/blink/web_tests/virtual/controls-refresh-hc/fast/forms/color-scheme/color/color-suggestion-picker-appearance-with-scrollbar-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt index 18cbe010..4f1215f7 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
@@ -233,71 +233,6 @@ getter duration getter phase method constructor -interface AppHistory : EventTarget - attribute @@toStringTag - getter canGoBack - getter canGoForward - getter currentEntry - getter oncurrententrychange - getter onnavigate - getter onnavigateerror - getter onnavigatesuccess - getter transition - method back - method constructor - method entries - method forward - method navigate - method reload - method traverseTo - method updateCurrentEntry - setter oncurrententrychange - setter onnavigate - setter onnavigateerror - setter onnavigatesuccess -interface AppHistoryCurrentChangeEvent : Event - attribute @@toStringTag - getter from - getter navigationType - method constructor -interface AppHistoryDestination - attribute @@toStringTag - getter id - getter index - getter key - getter sameDocument - getter url - method constructor - method getState -interface AppHistoryEntry : EventTarget - attribute @@toStringTag - getter id - getter index - getter key - getter ondispose - getter sameDocument - getter url - method constructor - method getState - setter ondispose -interface AppHistoryNavigateEvent : Event - attribute @@toStringTag - getter canTransition - getter destination - getter formData - getter hashChange - getter info - getter navigationType - getter signal - getter userInitiated - method constructor - method transitionWhile -interface AppHistoryTransition - attribute @@toStringTag - getter finished - getter from - getter navigationType - method constructor interface Attr : Node attribute @@toStringTag getter localName @@ -5804,6 +5739,65 @@ method releaseCapacity method rename method requestCapacity +interface NavigateEvent : Event + attribute @@toStringTag + getter canTransition + getter destination + getter formData + getter hashChange + getter info + getter navigationType + getter signal + getter userInitiated + method constructor + method transitionWhile +interface Navigation : EventTarget + attribute @@toStringTag + getter canGoBack + getter canGoForward + getter currentEntry + getter oncurrententrychange + getter onnavigate + getter onnavigateerror + getter onnavigatesuccess + getter transition + method back + method constructor + method entries + method forward + method navigate + method reload + method traverseTo + method updateCurrentEntry + setter oncurrententrychange + setter onnavigate + setter onnavigateerror + setter onnavigatesuccess +interface NavigationCurrentEntryChangeEvent : Event + attribute @@toStringTag + getter from + getter navigationType + method constructor +interface NavigationDestination + attribute @@toStringTag + getter id + getter index + getter key + getter sameDocument + getter url + method constructor + method getState +interface NavigationHistoryEntry : EventTarget + attribute @@toStringTag + getter id + getter index + getter key + getter ondispose + getter sameDocument + getter url + method constructor + method getState + setter ondispose interface NavigationPreloadManager attribute @@toStringTag method constructor @@ -5811,6 +5805,12 @@ method enable method getState method setHeaderValue +interface NavigationTransition + attribute @@toStringTag + getter finished + getter from + getter navigationType + method constructor interface Navigator attribute @@toStringTag getter appCodeName
diff --git a/third_party/r8/3pp/patches/0003-Adding-SamePackagePolicy.patch b/third_party/r8/3pp/patches/0003-Adding-SamePackagePolicy.patch index 08f2400..a0e86b81 100644 --- a/third_party/r8/3pp/patches/0003-Adding-SamePackagePolicy.patch +++ b/third_party/r8/3pp/patches/0003-Adding-SamePackagePolicy.patch
@@ -1,7 +1,7 @@ -From 0872badbc2bb59e8ea3f17320dd44a762aaa9a6c Mon Sep 17 00:00:00 2001 +From a9b15fae20d7d6950111568c5338d72ad7ec509d Mon Sep 17 00:00:00 2001 From: Joseph Chao <josephchao@google.com> -Date: Fri, 11 Feb 2022 17:45:00 +0000 -Subject: [PATCH 4/4] Adding SamePackagePolicy +Date: Wed, 16 Mar 2022 18:33:19 +0000 +Subject: [PATCH 3/3] Adding SamePackagePolicy --- .../PolicyScheduler.java | 2 ++ @@ -31,7 +31,7 @@ new SameFeatureSplit(appView), diff --git a/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/SamePackagePolicy.java b/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/SamePackagePolicy.java new file mode 100644 -index 000000000..deae6e78f +index 000000000..b05380e17 --- /dev/null +++ b/src/main/java/com/android/tools/r8/horizontalclassmerging/policies/SamePackagePolicy.java @@ -0,0 +1,29 @@ @@ -48,7 +48,7 @@ + + @Override + public String getMergeKey(DexProgramClass clazz) { -+ String packageName = clazz.getType().getPackageName(); ++ String packageName = clazz.getType().toDescriptorString().replaceAll("\\$.*", ""); + if (isClassesInPackageEligibleForMerging(packageName)) { + return packageName; + } @@ -65,5 +65,5 @@ + } +} -- -2.35.1.265.g69c8d7142f-goog +2.35.1.894.gb6a874cedc-goog
diff --git a/tools/aggregation_service/aggregation_service_tool_network_initializer.cc b/tools/aggregation_service/aggregation_service_tool_network_initializer.cc index 43183d2..a3cc215 100644 --- a/tools/aggregation_service/aggregation_service_tool_network_initializer.cc +++ b/tools/aggregation_service/aggregation_service_tool_network_initializer.cc
@@ -39,6 +39,7 @@ network::mojom::URLLoaderFactoryParams::New(); url_loader_factory_params->process_id = network::mojom::kBrowserProcessId; url_loader_factory_params->is_corb_enabled = false; + url_loader_factory_params->is_trusted = true; network_context_->CreateURLLoaderFactory( url_loader_factory_.BindNewPipeAndPassReceiver(), std::move(url_loader_factory_params));
diff --git a/tools/clang/scripts/OWNERS b/tools/clang/scripts/OWNERS index 6cefb40d..c3a87c5 100644 --- a/tools/clang/scripts/OWNERS +++ b/tools/clang/scripts/OWNERS
@@ -1,6 +1,8 @@ # This is the list of Chromium committers responsible for updating clang. aeubanks@google.com akhuang@google.com +ayzhao@google.com hans@chromium.org rnk@chromium.org thakis@chromium.org +zequanwu@google.com
diff --git a/tools/json_schema_compiler/test/additional_properties_unittest.cc b/tools/json_schema_compiler/test/additional_properties_unittest.cc index 15df873f..fc754d4 100644 --- a/tools/json_schema_compiler/test/additional_properties_unittest.cc +++ b/tools/json_schema_compiler/test/additional_properties_unittest.cc
@@ -45,8 +45,7 @@ std::unique_ptr<ap::AdditionalProperties::Params> params( ap::AdditionalProperties::Params::Create(params_value)); EXPECT_TRUE(params.get()); - EXPECT_TRUE(params->param_object.additional_properties.Equals( - param_object_value.get())); + EXPECT_EQ(params->param_object.additional_properties, *param_object_value); } TEST(JsonSchemaCompilerAdditionalPropertiesTest,
diff --git a/tools/json_schema_compiler/test/arrays_unittest.cc b/tools/json_schema_compiler/test/arrays_unittest.cc index e1aa7287..94a803b 100644 --- a/tools/json_schema_compiler/test/arrays_unittest.cc +++ b/tools/json_schema_compiler/test/arrays_unittest.cc
@@ -83,7 +83,7 @@ // Test ToValue. std::unique_ptr<base::Value> as_value(enum_array_reference.ToValue()); - EXPECT_TRUE(value.Equals(as_value.get())) << value << " != " << *as_value; + EXPECT_EQ(value, *as_value); } TEST(JsonSchemaCompilerArrayTest, EnumArrayMixed) { @@ -125,7 +125,7 @@ // Test ToValue. std::unique_ptr<base::Value> as_value(enum_array_mixed.ToValue()); - EXPECT_TRUE(value.Equals(as_value.get())) << value << " != " << *as_value; + EXPECT_EQ(value, *as_value.get()); } TEST(JsonSchemaCompilerArrayTest, OptionalEnumArrayType) {
diff --git a/tools/json_schema_compiler/test/crossref_unittest.cc b/tools/json_schema_compiler/test/crossref_unittest.cc index 1964280..4680ee7 100644 --- a/tools/json_schema_compiler/test/crossref_unittest.cc +++ b/tools/json_schema_compiler/test/crossref_unittest.cc
@@ -50,7 +50,7 @@ std::unique_ptr<base::DictionaryValue> crossref_value = crossref_type.ToValue(); ASSERT_TRUE(crossref_value); - EXPECT_TRUE(crossref_orig.Equals(crossref_value.get())); + EXPECT_EQ(crossref_orig, *crossref_value); } TEST(JsonSchemaCompilerCrossrefTest, TestTypeOptionalParamCreate) { @@ -61,8 +61,7 @@ params_value->GetListDeprecated())); EXPECT_TRUE(params.get()); EXPECT_TRUE(params->test_type.get()); - EXPECT_TRUE( - CreateTestTypeValue()->Equals(params->test_type->ToValue().get())); + EXPECT_EQ(*CreateTestTypeValue(), *params->test_type->ToValue()); } TEST(JsonSchemaCompilerCrossrefTest, TestTypeOptionalParamFail) { @@ -102,8 +101,8 @@ EXPECT_TRUE(params.get()); EXPECT_TRUE(params->param_object.test_type.get()); EXPECT_TRUE(params->param_object.boolean); - EXPECT_TRUE(CreateTestTypeValue()->Equals( - params->param_object.test_type->ToValue().get())); + EXPECT_EQ(*CreateTestTypeValue(), + *params->param_object.test_type->ToValue()); } { auto params_value = std::make_unique<base::ListValue>();
diff --git a/tools/json_schema_compiler/test/simple_api_unittest.cc b/tools/json_schema_compiler/test/simple_api_unittest.cc index 4703e32..d01026f 100644 --- a/tools/json_schema_compiler/test/simple_api_unittest.cc +++ b/tools/json_schema_compiler/test/simple_api_unittest.cc
@@ -160,7 +160,7 @@ EXPECT_EQ(1.1, test_type->number); EXPECT_EQ(4, test_type->integer); EXPECT_EQ(true, test_type->boolean); - EXPECT_TRUE(value->Equals(test_type->ToValue().get())); + EXPECT_EQ(*value, *test_type->ToValue()); } { auto test_type = std::make_unique<simple_api::TestType>(); @@ -178,7 +178,7 @@ std::vector<base::Value> results = simple_api::GetTestType::Results::Create(*test_type); ASSERT_EQ(1u, results.size()); - EXPECT_TRUE(results[0].Equals(value.get())); + EXPECT_EQ(results[0], *value); } }
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 069f1c7..303fc78 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -119,7 +119,6 @@ 'chromium.android.fyi': { 'Android ASAN (dbg) (reclient)': 'android_clang_asan_debug_bot_reclient', 'Android arm64 Builder (dbg) (reclient)': 'android_webview_google_debug_static_bot_arm64_reclient', - 'Android WebView P FYI (rel)': 'android_release_bot_minimal_symbols_arm64_webview_monochrome_reclient', 'android-annotator-rel': 'android_release_bot_minimal_symbols_arm64_webview_google_reclient', 'android-pie-arm64-wpt-rel-non-cq': 'android_release_bot_minimal_symbols_arm64_webview_monochrome_reclient', 'android-chrome-pie-x86-wpt-fyi-rel': 'android_release_bot_minimal_symbols_x86_fastbuild_webview_monochrome_reclient', @@ -4035,7 +4034,7 @@ }, 'paeverywhere': { - 'gn_args': 'use_allocator="partition"', + 'gn_args': 'use_allocator="none" use_allocator_shim=false', }, 'backuprefptr': {
diff --git a/tools/mb/mb_config_expectations/chromium.android.fyi.json b/tools/mb/mb_config_expectations/chromium.android.fyi.json index 68ad404..7bc5b16 100644 --- a/tools/mb/mb_config_expectations/chromium.android.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.android.fyi.json
@@ -14,22 +14,6 @@ "use_remoteexec": true } }, - "Android WebView P FYI (rel)": { - "gn_args": { - "dcheck_always_on": false, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "strip_debug_info": true, - "symbol_level": 1, - "system_webview_package_name": "com.google.android.apps.chrome", - "target_cpu": "arm64", - "target_os": "android", - "use_rbe": true, - "use_remoteexec": true - } - }, "Android arm64 Builder (dbg) (reclient)": { "gn_args": { "ffmpeg_branding": "Chrome",
diff --git a/tools/mb/mb_config_expectations/chromium.fyi.json b/tools/mb/mb_config_expectations/chromium.fyi.json index 282e7fb..c5f8ed20 100644 --- a/tools/mb/mb_config_expectations/chromium.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.fyi.json
@@ -1371,7 +1371,8 @@ "is_debug": true, "symbol_level": 1, "target_cpu": "x64", - "use_allocator": "partition", + "use_allocator": "none", + "use_allocator_shim": false, "use_goma": true } }, @@ -1383,7 +1384,8 @@ "is_debug": false, "symbol_level": 1, "target_cpu": "x64", - "use_allocator": "partition", + "use_allocator": "none", + "use_allocator_shim": false, "use_goma": true } },
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 4e7fa95..57b0b86 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -11136,6 +11136,11 @@ <int value="1" label="Waited"/> </enum> +<enum name="BooleanWarned"> + <int value="0" label="Not Warned"/> + <int value="1" label="Warned"/> +</enum> + <enum name="BooleanWarningReceived"> <int value="0" label="Warning Not Received"/> <int value="1" label="Warning Received"/> @@ -72930,6 +72935,24 @@ <int value="9" label="PREF_READ_ERROR_FILE_NOT_SPECIFIED"/> </enum> +<enum name="PreinstalledAppDisabledReason"> + <int value="0" label="kNotDisabled"/> + <int value="1" label="kPreinstalledAppsDisabled"/> + <int value="2" label="kUserTypeNotAllowed"/> + <int value="3" label="kGatedFeatureNotEnabled"/> + <int value="4" label="kGatedFeatureNotEnabledAndAppNotInstalled"/> + <int value="5" label="kArcAvailable"/> + <int value="6" label="kTabletFormFactor"/> + <int value="7" label="kNotNewUserAndNotPreviouslyInstalled"/> + <int value="8" label="kNotPreviouslyPreinstalled"/> + <int value="9" label="kReplacingAppBlockedByPolicy"/> + <int value="10" label="kReplacingAppForceInstalled"/> + <int value="11" label="kReplacingAppStillInstalled"/> + <int value="12" label="kDefaultAppAndAppsToReplaceUninstalled"/> + <int value="13" label="kReplacingAppUninstalledByUser"/> + <int value="14" label="kStylusRequired"/> +</enum> + <enum name="PreloadedListCheckResult"> <int value="0" label="origin was found and allowed https only"/> <int value="1" label="origin was not found"/> @@ -88651,6 +88674,17 @@ <int value="3" label="'Manage Passwords' was selected"/> </enum> +<enum name="TouchToFill.SubmissionReadiness"> + <int value="0" label="No information"/> + <int value="1" label="Error occurred"/> + <int value="2" label="Username field not found"/> + <int value="3" label="Fields between username and password fields"/> + <int value="4" label="Field after the password field"/> + <int value="5" label="Empty fields in the form"/> + <int value="6" label="More than two fields in the form"/> + <int value="7" label="2-field form (username+password)"/> +</enum> + <enum name="TouchToFill.UserAction"> <int value="0" label="Selected Credential"/> <int value="1" label="Dismissed"/>
diff --git a/tools/metrics/histograms/metadata/cryptohome/histograms.xml b/tools/metrics/histograms/metadata/cryptohome/histograms.xml index f1d9105..590c83b 100644 --- a/tools/metrics/histograms/metadata/cryptohome/histograms.xml +++ b/tools/metrics/histograms/metadata/cryptohome/histograms.xml
@@ -524,8 +524,7 @@ </summary> </histogram> -<histogram name="Cryptohome.TimeToInitPkcs11" units="ms" - expires_after="2021-10-24"> +<histogram name="Cryptohome.TimeToInitPkcs11" units="ms" expires_after="M112"> <owner>apronin@chromium.org</owner> <owner>cros-hwsec+uma@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index fa993c2..06dc596 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -850,6 +850,38 @@ <summary>Result of Data Leak Prevention evaluation for printing.</summary> </histogram> +<histogram name="Enterprise.Dlp.PrintingWarned" enum="BooleanWarned" + expires_after="2022-12-01"> + <owner>aidazolic@chromium.org</owner> + <owner>chromeos-dlp@google.com</owner> + <summary> + Recorded when there is a "warn" level Data Leak Prevention + evaluation for printing. + </summary> +</histogram> + +<histogram name="Enterprise.Dlp.PrintingWarnProceeded" enum="Boolean" + expires_after="2022-12-01"> + <owner>aidazolic@chromium.org</owner> + <owner>chromeos-dlp@google.com</owner> + <summary> + Recorded when the user proceeded with (True) or canceled (False) the action + after a Data Leak Prevention warning for printing. + </summary> +</histogram> + +<histogram name="Enterprise.Dlp.PrintingWarnSilentProceeded" enum="Boolean" + expires_after="2022-12-01"> + <owner>aidazolic@chromium.org</owner> + <owner>chromeos-dlp@google.com</owner> + <summary> + Recorded when there is a "warn" level Data Leak Prevention + evaluation for a screen share, but it is caused by the content that the user + was already warned about and decided to proceed, so no new warning is shown + and printing is silently allowed. + </summary> +</histogram> + <histogram name="Enterprise.Dlp.PrivacyScreenEnforced" enum="BooleanForced" expires_after="2022-12-01"> <owner>poromov@chromium.org</owner> @@ -938,6 +970,38 @@ </summary> </histogram> +<histogram name="Enterprise.Dlp.ScreenShareWarned" enum="BooleanWarned" + expires_after="2022-12-01"> + <owner>aidazolic@chromium.org</owner> + <owner>chromeos-dlp@google.com</owner> + <summary> + Recorded when there is a "warn" level Data Leak Prevention + evaluation for a screen share. + </summary> +</histogram> + +<histogram name="Enterprise.Dlp.ScreenShareWarnProceeded" enum="Boolean" + expires_after="2022-12-01"> + <owner>aidazolic@chromium.org</owner> + <owner>chromeos-dlp@google.com</owner> + <summary> + Recorded when the user proceeded with (True) or canceled (False) the action + after a Data Leak Prevention warning for a screen share. + </summary> +</histogram> + +<histogram name="Enterprise.Dlp.ScreenShareWarnSilentProceeded" enum="Boolean" + expires_after="2022-12-01"> + <owner>aidazolic@chromium.org</owner> + <owner>chromeos-dlp@google.com</owner> + <summary> + Recorded when there is a "warn" level Data Leak Prevention + evaluation for a screen share, but it is caused by the content that the user + was already warned about and decided to proceed, so no new warning is shown + and the screen share is silently allowed. + </summary> +</histogram> + <histogram name="Enterprise.Dlp.ScreenshotBlocked" enum="BooleanBlocked" expires_after="2022-12-01"> <owner>poromov@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/event/histograms.xml b/tools/metrics/histograms/metadata/event/histograms.xml index e356427e..0e0ed5b 100644 --- a/tools/metrics/histograms/metadata/event/histograms.xml +++ b/tools/metrics/histograms/metadata/event/histograms.xml
@@ -364,7 +364,8 @@ </summary> </histogram> -<histogram name="Event.Latency.OS2" units="ms" expires_after="2022-08-14"> +<histogram name="Event.Latency.OS2.{EventType}" units="ms" + expires_after="2022-08-14"> <owner>flackr@chromium.org</owner> <owner>joenotcharles@google.com</owner> <owner>input-dev@chromium.org</owner> @@ -379,6 +380,14 @@ which usually come from the high-resolution clock when TimeTicks::IsHighResolution returns true. </summary> + <token key="EventType"> + <variant name="KEY_PRESSED"/> + <variant name="MOUSE_PRESSED"/> + <variant name="MOUSE_WHEEL"/> + <variant name="TOUCH_MOVED"/> + <variant name="TOUCH_PRESSED"/> + <variant name="TOUCH_RELEASED"/> + </token> </histogram> <histogram name="Event.Latency.Scroll.Wheel.TimeToHandled2"
diff --git a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml index 0119776..40e94c7 100644 --- a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml
@@ -2731,16 +2731,6 @@ <affected-histogram name="SiteEngagementService.EngagementScoreBucket"/> </histogram_suffixes> -<histogram_suffixes name="EventLatencyOS" separator="."> - <suffix name="KEY_PRESSED" label=""/> - <suffix name="MOUSE_PRESSED" label=""/> - <suffix name="MOUSE_WHEEL" label=""/> - <suffix name="TOUCH_MOVED" label=""/> - <suffix name="TOUCH_PRESSED" label=""/> - <suffix name="TOUCH_RELEASED" label=""/> - <affected-histogram name="Event.Latency.OS2"/> -</histogram_suffixes> - <histogram_suffixes name="ExtensionsDatabaseRestore" separator="."> <suffix name="Rules" label="Rules backing stores"/> <suffix name="Settings" label="Settings backing stores"/>
diff --git a/tools/metrics/histograms/metadata/password/histograms.xml b/tools/metrics/histograms/metadata/password/histograms.xml index ebda1bc..48715ea 100644 --- a/tools/metrics/histograms/metadata/password/histograms.xml +++ b/tools/metrics/histograms/metadata/password/histograms.xml
@@ -2618,6 +2618,18 @@ </summary> </histogram> +<histogram name="PasswordManager.TouchToFill.SubmissionReadiness" + enum="TouchToFill.SubmissionReadiness" expires_after="2022-08-21"> + <owner>kolos@chromium.org</owner> + <owner>fhorschig@chromium.org</owner> + <summary> + A given form's state (e.g. there are empty fields in the form, or there are + only two fields and they both are filled by Chrome) that indicates whether + the form is ready for submission. Recorded when a Touch To Fill sheet is + shown for that form. + </summary> +</histogram> + <histogram name="PasswordManager.TouchToFill.UserAction" enum="TouchToFill.UserAction" expires_after="M92"> <owner>ioanap@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/sb_client/histograms.xml b/tools/metrics/histograms/metadata/sb_client/histograms.xml index d645e083..79c4926 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -119,7 +119,7 @@ </histogram> <histogram name="SBClientDownload.DownloadRequestNetError" enum="NetErrorCodes" - expires_after="2022-04-24"> + expires_after="2023-04-24"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <owner>mattm@chromium.org</owner> @@ -178,7 +178,7 @@ </histogram> <histogram name="SBClientDownload.MalwareDeepScanResult.{trigger}" - enum="SBClientDownloadCheckResult" expires_after="2022-04-28"> + enum="SBClientDownloadCheckResult" expires_after="2023-04-28"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/software/histograms.xml b/tools/metrics/histograms/metadata/software/histograms.xml index 71e0054..d9f88d1 100644 --- a/tools/metrics/histograms/metadata/software/histograms.xml +++ b/tools/metrics/histograms/metadata/software/histograms.xml
@@ -81,7 +81,7 @@ </histogram> <histogram name="SoftwareReporter.Cleaner.TimeToCompleteDownload" units="ms" - expires_after="M100"> + expires_after="2023-03-16"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -165,7 +165,7 @@ </histogram> <histogram name="SoftwareReporter.LastUploadResult" enum="BooleanSuccess" - expires_after="M100"> + expires_after="2023-03-16"> <owner>drubery@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary>The result of the most recent SRT log upload.</summary>
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index 087147d..1eb44f7 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -597,6 +597,17 @@ </summary> </histogram> +<histogram name="WebApp.Preinstalled.DisabledReason" + enum="PreinstalledAppDisabledReason" expires_after="2022-12-01"> + <owner>dmurph@chromium.org</owner> + <owner>desktop-pwas-team@google.com</owner> + <summary> + Records the reason a preinstalled installation was disabled. This is + recorded at startup for every app in the preinstalled apps list, before it + is sent to the ExternallyManagedAppManger for synchronization. + </summary> +</histogram> + <histogram name="WebApp.Preinstalled.EnabledCount" units="apps" expires_after="2022-09-11"> <owner>alancutter@chromium.org</owner>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 935ce1c..85fd96f 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -18699,8 +18699,9 @@ <event name="TouchToFill.Shown"> <owner>kazinova@google.com</owner> <owner>fhorschig@chromium.org</owner> + <owner>kolos@chromium.org</owner> <summary> - Recorded when the Touch To Fill sheet is shown to the user. + Recorded when a user takes an action on the Touch To Fill sheet. </summary> <metric name="UserAction" enum="TouchToFill.UserAction"> <summary> @@ -18709,6 +18710,22 @@ </metric> </event> +<event name="TouchToFill.SubmissionReadiness"> + <owner>kolos@chromium.org</owner> + <owner>fhorschig@chromium.org</owner> + <summary> + Recorded when the Touch To Fill sheet is shown to the user. + </summary> + <metric name="SubmissionReadiness" enum="TouchToFill.SubmissionReadiness"> + <summary> + A given form's state (e.g. there are empty fields in the form, or there + are only two fields and they both are filled by Chrome) that indicates + whether the form is ready for submission. Recorded when a Touch To Fill + sheet is shown for that form. + </summary> + </metric> +</event> + <event name="Translate"> <owner>hamelphi@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 40e25572..c7187d5 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -6,7 +6,7 @@ }, "win": { "hash": "1980118f2ecd347ad388ca1fcd2f12a82b41eb88", - "remote_path": "perfetto_binaries/trace_processor_shell/win/fbff2f18579ba3da4b4c10a61cd13a10bec2deb3/trace_processor_shell.exe" + "remote_path": "perfetto_binaries/trace_processor_shell/win/86fc023993c5b9b98d2333c389af8c2a3026ffcc/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", @@ -14,7 +14,7 @@ }, "mac": { "hash": "38962457d632af2bf5fee5dca48e0940717ea63c", - "remote_path": "perfetto_binaries/trace_processor_shell/mac/fbff2f18579ba3da4b4c10a61cd13a10bec2deb3/trace_processor_shell" + "remote_path": "perfetto_binaries/trace_processor_shell/mac/86fc023993c5b9b98d2333c389af8c2a3026ffcc/trace_processor_shell" }, "mac_arm64": { "hash": "c0397e87456ad6c6a7aa0133e5b81c97adbab4ab", @@ -22,7 +22,7 @@ }, "linux": { "hash": "4cda7ca15effeebf54963042245228e7d936cad4", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/801c6da68c23e9d209f9aa5926b5e80bdd41a7cf/trace_processor_shell" + "remote_path": "perfetto_binaries/trace_processor_shell/linux/86fc023993c5b9b98d2333c389af8c2a3026ffcc/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/ui/android/java/src/org/chromium/ui/base/DropDataContentProvider.java b/ui/android/java/src/org/chromium/ui/base/DropDataContentProvider.java index d40231d..418e0b70 100644 --- a/ui/android/java/src/org/chromium/ui/base/DropDataContentProvider.java +++ b/ui/android/java/src/org/chromium/ui/base/DropDataContentProvider.java
@@ -28,19 +28,18 @@ import java.io.OutputStream; /** ContentProvider for image data of Drag and Drop. */ -// TODO(crbug.com/1302386): Make DropDataContentProvider thread safety. public class DropDataContentProvider extends ContentProvider { /** * Implement {@link ContentProvider.PipeDataWriter} to be used by {@link * ContentProvider#openPipeHelper}, in order to stream image data to drop target. */ - private static class DropPipeDataWriter implements ContentProvider.PipeDataWriter<Void> { + private static class DropPipeDataWriter implements ContentProvider.PipeDataWriter<byte[]> { @Override - public void writeDataToPipe( - ParcelFileDescriptor output, Uri uri, String mimeType, Bundle opts, Void unused) { + public void writeDataToPipe(ParcelFileDescriptor output, Uri uri, String mimeType, + Bundle opts, byte[] imageBytes) { try (OutputStream out = new FileOutputStream(output.getFileDescriptor())) { - if (sImageBytes != null) { - out.write(sImageBytes); + if (imageBytes != null) { + out.write(imageBytes); } else { // TODO: add error handle here } @@ -56,9 +55,13 @@ private static final String[] COLUMNS = {OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE}; private static final String URI_AUTHORITY_SUFFIX = ".DropDataProvider"; + private static final Object LOCK = new Object(); + + // All these static objects must be accessed in a synchronized block: private static int sClearCachedDataIntervalMs = DEFAULT_CLEAR_CACHED_DATA_INTERVAL_MS; private static byte[] sImageBytes; private static String sEncodingFormat; + private static String sMimeType; /** The URI handled by this content provider. */ private static Uri sContentProviderUri; private static String sTimestamp; @@ -69,43 +72,53 @@ private static long sLastUriClearedTimestamp; private static long sLastUriCreatedTimestamp; private static boolean sLastUriRecorded; + private DropPipeDataWriter mDropPipeDataWriter; /** * Update the delayed time before clearing the image cache. */ public static void setClearCachedDataIntervalMs(int milliseconds) { - sClearCachedDataIntervalMs = milliseconds; + synchronized (LOCK) { + sClearCachedDataIntervalMs = milliseconds; + } } /** * Cache the passed-in image data of Drag and Drop. */ static Uri cache(byte[] imageBytes, String encodingFormat) { - // Clear out any old data. - clearCacheData(); - - // Set new data. long elapsedRealtime = SystemClock.elapsedRealtime(); - if (sLastUriCreatedTimestamp > 0) { - long duration = elapsedRealtime - sLastUriCreatedTimestamp; - RecordHistogram.recordMediumTimesHistogram( - "Android.DragDrop.Image.UriCreatedInterval", duration); - } - sLastUriCreatedTimestamp = elapsedRealtime; - sImageBytes = imageBytes; - sEncodingFormat = encodingFormat; - sTimestamp = String.valueOf(System.currentTimeMillis()); - sDragEndTime = 0; - sOpenFileLastAccessTime = 0; + long lastUriCreatedTimestamp = sLastUriCreatedTimestamp; + String timestamp = String.valueOf(System.currentTimeMillis()); + String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(encodingFormat); // TODO(crbug.com/1296795): Replace path with filename with extension Uri newUri = new Uri.Builder() .scheme(ContentResolver.SCHEME_CONTENT) .authority(ContextUtils.getApplicationContext().getPackageName() + URI_AUTHORITY_SUFFIX) - .path(sTimestamp) + .path(timestamp) .build(); - sContentProviderUri = newUri; + + synchronized (LOCK) { + // Clear out any old data. + clearCacheData(); + // Set new data. + sLastUriCreatedTimestamp = elapsedRealtime; + sImageBytes = imageBytes; + sEncodingFormat = encodingFormat; + sMimeType = mimeType; + sTimestamp = timestamp; + sDragEndTime = 0; + sOpenFileLastAccessTime = 0; + sContentProviderUri = newUri; + } + + if (lastUriCreatedTimestamp > 0) { + long duration = elapsedRealtime - lastUriCreatedTimestamp; + RecordHistogram.recordMediumTimesHistogram( + "Android.DragDrop.Image.UriCreatedInterval", duration); + } int sizeInKB = imageBytes.length / BYTES_PER_KILOBYTE; RecordHistogram.recordCustomCountHistogram( "Android.DragDrop.Image.Size", sizeInKB, 1, 100_000, 50); @@ -127,8 +140,10 @@ clearCache(); } else { // Otherwise, clear it with a delay to allow asynchronous data transfer. - clearCacheWithDelay(); - sDragEndTime = SystemClock.elapsedRealtime(); + synchronized (LOCK) { + clearCacheWithDelay(); + sDragEndTime = SystemClock.elapsedRealtime(); + } } } @@ -136,11 +151,13 @@ * Clear the image data of Drag and Drop and record histogram. */ static void clearCache() { - clearCacheData(); - if (sDragEndTime > 0 && sDragEndTime <= sOpenFileLastAccessTime) { - long duration = sOpenFileLastAccessTime - sDragEndTime; - RecordHistogram.recordMediumTimesHistogram( - "Android.DragDrop.Image.OpenFileTime.LastAttempt", duration); + synchronized (LOCK) { + clearCacheData(); + if (sDragEndTime > 0 && sDragEndTime <= sOpenFileLastAccessTime) { + long duration = sOpenFileLastAccessTime - sDragEndTime; + RecordHistogram.recordMediumTimesHistogram( + "Android.DragDrop.Image.OpenFileTime.LastAttempt", duration); + } } } @@ -150,6 +167,7 @@ private static void clearCacheData() { sImageBytes = null; sEncodingFormat = null; + sMimeType = null; if (sContentProviderUri != null) { sLastUri = sContentProviderUri; sLastUriClearedTimestamp = SystemClock.elapsedRealtime(); @@ -186,19 +204,23 @@ @Override public String getType(Uri uri) { - if (uri == null || !uri.equals(sContentProviderUri)) { - return null; + synchronized (LOCK) { + if (uri == null || !uri.equals(sContentProviderUri)) { + return null; + } + return sMimeType; } - - return MimeTypeMap.getSingleton().getMimeTypeFromExtension(sEncodingFormat); } @Override public String[] getStreamTypes(Uri uri, String mimeTypeFilter) { - if (uri == null || !uri.equals(sContentProviderUri)) { - return null; + String mimeType; + synchronized (LOCK) { + if (uri == null || !uri.equals(sContentProviderUri)) { + return null; + } + mimeType = sMimeType; } - String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(sEncodingFormat); return matchMimeType(mimeType, mimeTypeFilter) ? new String[] {mimeType} : null; } @@ -224,29 +246,40 @@ if (uri == null) { return null; } - if (!uri.equals(sContentProviderUri)) { - if (uri.equals(sLastUri)) { - long duration = SystemClock.elapsedRealtime() - sLastUriClearedTimestamp; - RecordHistogram.recordMediumTimesHistogram( - "Android.DragDrop.Image.OpenFileTime.AllExpired", duration); - if (!sLastUriRecorded) { + byte[] imageBytes; + synchronized (LOCK) { + if (!uri.equals(sContentProviderUri)) { + if (uri.equals(sLastUri)) { + long duration = SystemClock.elapsedRealtime() - sLastUriClearedTimestamp; RecordHistogram.recordMediumTimesHistogram( - "Android.DragDrop.Image.OpenFileTime.FirstExpired", duration); - sLastUriRecorded = true; + "Android.DragDrop.Image.OpenFileTime.AllExpired", duration); + if (!sLastUriRecorded) { + RecordHistogram.recordMediumTimesHistogram( + "Android.DragDrop.Image.OpenFileTime.FirstExpired", duration); + sLastUriRecorded = true; + } } + return null; } - return null; + sOpenFileLastAccessTime = SystemClock.elapsedRealtime(); + imageBytes = sImageBytes; } - sOpenFileLastAccessTime = SystemClock.elapsedRealtime(); - return openPipeHelper( - sContentProviderUri, getType(sContentProviderUri), null, null, mDropPipeDataWriter); + return openPipeHelper(uri, getType(uri), null, imageBytes, mDropPipeDataWriter); } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { - if (uri == null || !uri.equals(sContentProviderUri)) { - return new MatrixCursor(COLUMNS, 0); + String timestamp; + String encodingFormat; + byte[] imageBytes; + synchronized (LOCK) { + if (uri == null || !uri.equals(sContentProviderUri)) { + return new MatrixCursor(COLUMNS, 0); + } + timestamp = sTimestamp; + encodingFormat = sEncodingFormat; + imageBytes = sImageBytes; } if (projection == null) { projection = COLUMNS; @@ -271,12 +304,12 @@ if (hasDisplayName) { cols[index] = OpenableColumns.DISPLAY_NAME; // TODO(crbug.com/1296795): Use the real file name from DropDataAndroid - values[index] = sTimestamp + "." + sEncodingFormat; + values[index] = timestamp + "." + encodingFormat; index++; } if (hasSize) { cols[index] = OpenableColumns.SIZE; - values[index] = sImageBytes.length; + values[index] = imageBytes.length; } MatrixCursor cursor = new MatrixCursor(cols, 1); cursor.addRow(values); @@ -300,16 +333,22 @@ @VisibleForTesting static byte[] getImageBytesForTesting() { - return sImageBytes; + synchronized (LOCK) { + return sImageBytes; + } } @VisibleForTesting static Handler getHandlerForTesting() { - return sHandler; + synchronized (LOCK) { + return sHandler; + } } @VisibleForTesting static void clearLastUriCreatedTimestampForTesting() { - sLastUriCreatedTimestamp = 0; + synchronized (LOCK) { + sLastUriCreatedTimestamp = 0; + } } }
diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java index db89c65..cc1cf9b 100644 --- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java +++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -24,6 +24,7 @@ import androidx.annotation.VisibleForTesting; import androidx.core.content.ContextCompat; +import org.chromium.base.BuildInfo; import org.chromium.base.ContentUriUtils; import org.chromium.base.ContextUtils; import org.chromium.base.FileUtils; @@ -39,6 +40,7 @@ import org.chromium.base.task.TaskTraits; import org.chromium.ui.R; import org.chromium.ui.UiUtils; +import org.chromium.ui.permissions.PermissionConstants; import java.io.File; import java.io.IOException; @@ -267,6 +269,16 @@ boolean shouldUsePhotoPicker = shouldUsePhotoPicker(); if (shouldUsePhotoPicker) { if (!window.hasPermission(storagePermission)) missingPermissions.add(storagePermission); + if (BuildInfo.targetsAtLeastT()) { + if (!window.hasPermission(PermissionConstants.READ_MEDIA_IMAGE) + && shouldShowImageTypes()) { + missingPermissions.add(PermissionConstants.READ_MEDIA_IMAGE); + } + if (!window.hasPermission(PermissionConstants.READ_MEDIA_VIDEO) + && shouldShowVideoTypes()) { + missingPermissions.add(PermissionConstants.READ_MEDIA_VIDEO); + } + } } else { if (((mSupportsImageCapture && shouldShowImageTypes()) || (mSupportsVideoCapture && shouldShowVideoTypes())) @@ -307,9 +319,14 @@ } } - if (shouldUsePhotoPicker && permissions[i].equals(storagePermission)) { - onFileNotSelected(); - return; + if (shouldUsePhotoPicker) { + if (permissions[i].equals(storagePermission) + || permissions[i].equals(PermissionConstants.READ_MEDIA_IMAGE) + || permissions[i].equals( + PermissionConstants.READ_MEDIA_VIDEO)) { + onFileNotSelected(); + return; + } } } }
diff --git a/ui/android/java/src/org/chromium/ui/permissions/PermissionConstants.java b/ui/android/java/src/org/chromium/ui/permissions/PermissionConstants.java index ee75960d..618354b 100644 --- a/ui/android/java/src/org/chromium/ui/permissions/PermissionConstants.java +++ b/ui/android/java/src/org/chromium/ui/permissions/PermissionConstants.java
@@ -11,4 +11,8 @@ /** The permission string for notification permission. */ // TODO(shaktisahu): Replace this with permission constant from {@link Manifest.permission}. public static final String NOTIFICATION_PERMISSION = "android.permission.POST_NOTIFICATIONS"; + + // TODO(finnur): Replace this with permission constant from {@link Manifest.permission}. + public static final String READ_MEDIA_IMAGE = "android.permission.READ_MEDIA_IMAGE"; + public static final String READ_MEDIA_VIDEO = "android.permission.READ_MEDIA_VIDEO"; }
diff --git a/ui/ozone/platform/wayland/gpu/wayland_overlay_manager.cc b/ui/ozone/platform/wayland/gpu/wayland_overlay_manager.cc index 1c44f05..e4cb8ec 100644 --- a/ui/ozone/platform/wayland/gpu/wayland_overlay_manager.cc +++ b/ui/ozone/platform/wayland/gpu/wayland_overlay_manager.cc
@@ -80,6 +80,18 @@ kAssumedMaxDeviceScaleFactor) == 0) return false; + // Passing an empty surface size through wayland will actually clear the size + // restriction and display the buffer at full size. The function + // 'set_destination_size' in augmenter will accept empty sizes without + // protocol error but interprets this as a clear. + // TODO(https://crbug.com/1306230) : Move and generalize this fix in wayland + // host. + if (wl_fixed_from_double(candidate.display_rect.width() / + kAssumedMaxDeviceScaleFactor) == 0 || + wl_fixed_from_double(candidate.display_rect.height() / + kAssumedMaxDeviceScaleFactor) == 0) + return false; + if (candidate.transform == gfx::OVERLAY_TRANSFORM_INVALID) return false;
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc index d5cf20d..a4b117c 100644 --- a/ui/views/controls/button/image_button.cc +++ b/ui/views/controls/button/image_button.cc
@@ -16,6 +16,7 @@ #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/scoped_canvas.h" #include "ui/views/background.h" +#include "ui/views/image_model_utils.h" #include "ui/views/painter.h" #include "ui/views/widget/widget.h" @@ -40,8 +41,8 @@ ImageButton::~ImageButton() = default; -const gfx::ImageSkia& ImageButton::GetImage(ButtonState state) const { - return images_[state]; +gfx::ImageSkia ImageButton::GetImage(ButtonState state) const { + return GetImageSkiaFromImageModel(images_[state], GetColorProvider()); } void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia* image) { @@ -49,10 +50,15 @@ } void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia& image) { + SetImageModel(for_state, ui::ImageModel::FromImageSkia(image)); +} + +void ImageButton::SetImageModel(ButtonState for_state, + const ui::ImageModel& image_model) { if (for_state == STATE_HOVERED) - SetAnimateOnStateChange(!image.isNull()); + SetAnimateOnStateChange(!image_model.IsEmpty()); const gfx::Size old_preferred_size = GetPreferredSize(); - images_[for_state] = image; + images_[for_state] = image_model; if (old_preferred_size != GetPreferredSize()) PreferredSizeChanged(); @@ -113,10 +119,8 @@ gfx::Size ImageButton::CalculatePreferredSize() const { gfx::Size size(kDefaultWidth, kDefaultHeight); - if (!images_[STATE_NORMAL].isNull()) { - size = gfx::Size(images_[STATE_NORMAL].width(), - images_[STATE_NORMAL].height()); - } + if (!images_[STATE_NORMAL].IsEmpty()) + size = images_[STATE_NORMAL].Size(); size.SetToMax(GetMinimumImageSize()); @@ -168,17 +172,14 @@ // ImageButton, protected: gfx::ImageSkia ImageButton::GetImageToPaint() { - gfx::ImageSkia img; - - if (!images_[STATE_HOVERED].isNull() && hover_animation().is_animating()) { - img = gfx::ImageSkiaOperations::CreateBlendedImage( - images_[STATE_NORMAL], images_[STATE_HOVERED], + if (!images_[STATE_HOVERED].IsEmpty() && hover_animation().is_animating()) { + return gfx::ImageSkiaOperations::CreateBlendedImage( + GetImage(STATE_NORMAL), GetImage(STATE_HOVERED), hover_animation().GetCurrentValue()); - } else { - img = images_[GetState()]; } - return !img.isNull() ? img : images_[STATE_NORMAL]; + const auto img = GetImage(GetState()); + return !img.isNull() ? img : GetImage(STATE_NORMAL); } //////////////////////////////////////////////////////////////////////////////// @@ -239,12 +240,19 @@ void ToggleImageButton::SetToggledImage(ButtonState image_state, const gfx::ImageSkia* image) { + SetToggledImageModel(image_state, ui::ImageModel::FromImageSkia( + image ? *image : gfx::ImageSkia())); +} + +void ToggleImageButton::SetToggledImageModel( + ButtonState image_state, + const ui::ImageModel& image_model) { if (toggled_) { - images_[image_state] = image ? *image : gfx::ImageSkia(); + images_[image_state] = image_model; if (GetState() == image_state) SchedulePaint(); } else { - alternate_images_[image_state] = image ? *image : gfx::ImageSkia(); + alternate_images_[image_state] = image_model; } } @@ -278,19 +286,20 @@ //////////////////////////////////////////////////////////////////////////////// // ToggleImageButton, ImageButton overrides: -const gfx::ImageSkia& ToggleImageButton::GetImage( - ButtonState image_state) const { - if (toggled_) - return alternate_images_[image_state]; - return images_[image_state]; +gfx::ImageSkia ToggleImageButton::GetImage(ButtonState image_state) const { + if (toggled_) { + return GetImageSkiaFromImageModel(alternate_images_[image_state], + GetColorProvider()); + } + return GetImageSkiaFromImageModel(images_[image_state], GetColorProvider()); } -void ToggleImageButton::SetImage(ButtonState image_state, - const gfx::ImageSkia& image) { +void ToggleImageButton::SetImageModel(ButtonState image_state, + const ui::ImageModel& image_model) { if (toggled_) { - alternate_images_[image_state] = image; + alternate_images_[image_state] = image_model; } else { - images_[image_state] = image; + images_[image_state] = image_model; if (GetState() == image_state) SchedulePaint(); } @@ -327,8 +336,8 @@ // Use the visual pressed image as a cue for making this control into an // accessible toggle button. - if ((toggled_ && !images_[ButtonState::STATE_NORMAL].isNull()) || - (!toggled_ && !alternate_images_[ButtonState::STATE_NORMAL].isNull())) { + if ((toggled_ && !images_[ButtonState::STATE_NORMAL].IsEmpty()) || + (!toggled_ && !alternate_images_[ButtonState::STATE_NORMAL].IsEmpty())) { node_data->role = ax::mojom::Role::kToggleButton; node_data->SetCheckedState(toggled_ ? ax::mojom::CheckedState::kTrue : ax::mojom::CheckedState::kFalse);
diff --git a/ui/views/controls/button/image_button.h b/ui/views/controls/button/image_button.h index 18d6a85..a3fa61d 100644 --- a/ui/views/controls/button/image_button.h +++ b/ui/views/controls/button/image_button.h
@@ -10,6 +10,7 @@ #include "base/gtest_prod_util.h" #include "ui/base/layout.h" +#include "ui/base/models/image_model.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/controls/button/button.h" #include "ui/views/metadata/view_factory.h" @@ -34,7 +35,7 @@ ~ImageButton() override; // Returns the image for a given |state|. - virtual const gfx::ImageSkia& GetImage(ButtonState state) const; + virtual gfx::ImageSkia GetImage(ButtonState state) const; // Set the image the button should use for the provided state. void SetImage(ButtonState state, const gfx::ImageSkia* image); @@ -42,7 +43,11 @@ // As above, but takes a const ref. TODO(estade): all callers should be // updated to use this version, and then the implementations can be // consolidated. - virtual void SetImage(ButtonState state, const gfx::ImageSkia& image); + // TODO(http://crbug.com/1100034) prefer SetImageModel over SetImage(). + void SetImage(ButtonState state, const gfx::ImageSkia& image); + + virtual void SetImageModel(ButtonState state, + const ui::ImageModel& image_model); // Set the background details. The background image uses the same alignment // as the image. @@ -81,7 +86,7 @@ void UpdateButtonBackground(ui::ResourceScaleFactor scale_factor); // The images used to render the different states of this button. - gfx::ImageSkia images_[STATE_COUNT]; + ui::ImageModel images_[STATE_COUNT]; gfx::ImageSkia background_image_; @@ -149,6 +154,8 @@ // "has been toggled" state. Must be called for each button state // before the button is toggled. void SetToggledImage(ButtonState state, const gfx::ImageSkia* image); + void SetToggledImageModel(ButtonState state, + const ui::ImageModel& image_model); // Like Views::SetBackground(), but to set the background color used for the // "has been toggled" state. @@ -164,8 +171,9 @@ void SetToggledAccessibleName(const std::u16string& name); // Overridden from ImageButton: - const gfx::ImageSkia& GetImage(ButtonState state) const override; - void SetImage(ButtonState state, const gfx::ImageSkia& image) override; + gfx::ImageSkia GetImage(ButtonState state) const override; + void SetImageModel(ButtonState state, + const ui::ImageModel& image_model) override; // Overridden from View: std::u16string GetTooltipText(const gfx::Point& p) const override; @@ -176,7 +184,7 @@ // The parent class's images_ member is used for the current images, // and this array is used to hold the alternative images. // We swap between the two when toggling. - gfx::ImageSkia alternate_images_[STATE_COUNT]; + ui::ImageModel alternate_images_[STATE_COUNT]; // True if the button is currently toggled. bool toggled_ = false;
diff --git a/weblayer/browser/password_manager_driver_factory.cc b/weblayer/browser/password_manager_driver_factory.cc index 16381e03..2cc6841 100644 --- a/weblayer/browser/password_manager_driver_factory.cc +++ b/weblayer/browser/password_manager_driver_factory.cc
@@ -72,7 +72,9 @@ const std::u16string& typed_username, int options, const gfx::RectF& bounds) override {} - void ShowTouchToFill(bool trigger_submission) override {} + void ShowTouchToFill( + autofill::mojom::SubmissionReadinessState submission_readiness) override { + } void CheckSafeBrowsingReputation(const GURL& form_action, const GURL& frame_url) override {} void FocusedInputChanged(