diff --git a/AUTHORS b/AUTHORS index 8cdad2a..69b8cec 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -230,6 +230,7 @@ David Erceg <erceg.david@gmail.com> David Fox <david@davidjfox.com> David Futcher <david.mike.futcher@gmail.com> +David Lechner <david@pybricks.com> David Leen <davileen@amazon.com> David Manouchehri <david@davidmanouchehri.com> David McAllister <mcdavid@amazon.com>
diff --git a/DEPS b/DEPS index 7b0821f..2fd2979 100644 --- a/DEPS +++ b/DEPS
@@ -178,11 +178,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': '00ddb0029da729c4cb456d5fe39f4a65c8531ca2', + 'skia_revision': '828d341199a98756b20e70b2c9688e04454800c2', # 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': 'd58488c28be7c9115cd4e4ed2d752102f11c952d', + 'v8_revision': 'd405f8a3d57bd752a8ab2de495e3fbdac8dbe5ff', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -190,7 +190,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '3d598abb3014f0e10a4565a4fb01556e4152ffef', + 'angle_revision': 'e7b9118bb2041af8482e7b4b99b83cf5e7a3c6ff', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -205,7 +205,7 @@ # # Note this revision should be updated with # third_party/boringssl/roll_boringssl.py, not roll-dep. - 'boringssl_revision': '5f43b12d52e94b50e481bae2ccb74ab95904123d', + 'boringssl_revision': 'a810d82575ecbde26406fa583371f807f8721ed7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling google-toolbox-for-mac # and whatever else without interference from each other. @@ -249,7 +249,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': '32b1b68d990ee2c1ceb41109ae19a4a2354e4a2b', + 'devtools_frontend_revision': 'd1c8d6c7215f5cf58a6a822bc23a5d74b8447619', # 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. @@ -301,7 +301,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '02beecaec5cdfa809f1dbea883a60bb040629590', + 'dawn_revision': '4fa5ad4bf047fbe3143378f131f76044bdc88f66', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -866,7 +866,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + 'df8112e7e09f8e81ef6ed9dff4878b8895788445', + 'url': Var('chromium_git') + '/chromiumos/platform2/system_api.git' + '@' + '69985fadf06b213168254b74d963782a7a7a46e4', 'condition': 'checkout_linux', }, @@ -1220,7 +1220,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'd4e0aadfce0df20f5b006c952205e71e9cfe4dde', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '79825c95b6dd67ddb24115d1fcd955ea17a18ea7', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1453,7 +1453,7 @@ }, 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'b0bd0708d6542ce837d0499975fab7b22d2fad20', + Var('webrtc_git') + '/src.git' + '@' + '8c7384c307cadf50f82155078557f0bc04c8a769', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1525,7 +1525,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@568a908f7b188abb0a47e59e101e701df6f780df', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@3b1b6e60931071e1347505fb88b3d4ba2648c939', 'condition': 'checkout_src_internal', }, @@ -1635,6 +1635,17 @@ 'dep_type': 'cipd', }, + 'src/third_party/android_deps/libs/androidx_activity_activity': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/androidx_activity_activity', + 'version': 'version:1.0.0-cr0', + }, + ], + 'condition': 'checkout_android', + 'dep_type': 'cipd', + }, + 'src/third_party/android_deps/libs/androidx_annotation_annotation': { 'packages': [ { @@ -1650,7 +1661,18 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_appcompat_appcompat', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.2.0-beta01-cr0', + }, + ], + 'condition': 'checkout_android', + 'dep_type': 'cipd', + }, + + 'src/third_party/android_deps/libs/androidx_appcompat_appcompat_resources': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/androidx_appcompat_appcompat_resources', + 'version': 'version:1.2.0-beta01-cr0', }, ], 'condition': 'checkout_android', @@ -1661,7 +1683,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_arch_core_core_common', - 'version': 'version:2.0.0-cr0', + 'version': 'version:2.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -1705,7 +1727,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_collection_collection', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -1738,7 +1760,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_core_core', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.3.0-beta01-cr0', }, ], 'condition': 'checkout_android', @@ -1793,7 +1815,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_fragment_fragment', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -1903,7 +1925,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common', - 'version': 'version:2.0.0-cr0', + 'version': 'version:2.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -1947,7 +1969,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime', - 'version': 'version:2.0.0-cr0', + 'version': 'version:2.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -1958,7 +1980,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel', - 'version': 'version:2.0.0-cr0', + 'version': 'version:2.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -2064,6 +2086,17 @@ 'dep_type': 'cipd', }, + 'src/third_party/android_deps/libs/androidx_savedstate_savedstate': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/androidx_savedstate_savedstate', + 'version': 'version:1.0.0-cr0', + }, + ], + 'condition': 'checkout_android', + 'dep_type': 'cipd', + }, + 'src/third_party/android_deps/libs/androidx_slidingpanelayout_slidingpanelayout': { 'packages': [ { @@ -2200,7 +2233,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -2211,7 +2244,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.1.0-cr0', }, ], 'condition': 'checkout_android', @@ -2222,7 +2255,7 @@ 'packages': [ { 'package': 'chromium/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable', - 'version': 'version:1.0.0-cr0', + 'version': 'version:1.1.0-cr0', }, ], 'condition': 'checkout_android',
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java index 98e594db..9bbc40b 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java
@@ -1766,6 +1766,36 @@ waitForCallbackAndVerifyTypes(cnt, expectedValues.toArray(new Integer[0])); } + @Test + @SmallTest + @Feature({"AndroidWebView"}) + public void testMismatchedAutofillValueWontCauseCrash() throws Throwable { + final String data = "<html><head></head><body><form action='a.html' name='formname'>" + + "<input type='text' id='text1' name='username'" + + " placeholder='placeholder@placeholder.com' autocomplete='username name'>" + + "</form></body></html>"; + final String url = mWebServer.setResponse(FILE, data, null); + loadUrlSync(url); + int cnt = 0; + executeJavaScriptAndWaitForResult("document.getElementById('text1').select();"); + dispatchDownAndUpKeyEvents(KeyEvent.KEYCODE_A); + + cnt += waitForCallbackAndVerifyTypes(cnt, + new Integer[] {AUTOFILL_CANCEL, AUTOFILL_VIEW_ENTERED, AUTOFILL_VALUE_CHANGED}); + invokeOnProvideAutoFillVirtualStructure(); + TestViewStructure viewStructure = mTestValues.testViewStructure; + assertNotNull(viewStructure); + assertEquals(1, viewStructure.getChildCount()); + TestViewStructure child0 = viewStructure.getChild(0); + + // Autofill form and verify filled values. + SparseArray<AutofillValue> values = new SparseArray<AutofillValue>(); + // Append wrong autofill value. + values.append(child0.getId(), AutofillValue.forToggle(false)); + // If the test fail, the exception shall be thrown in below. + invokeAutofill(values); + } + private void scrollToBottom() { TestThreadUtils.runOnUiThreadBlocking( () -> { mTestContainerView.scrollTo(0, mTestContainerView.getHeight()); });
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnRenderProcessGoneTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnRenderProcessGoneTest.java index 50a25fc..f885326 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnRenderProcessGoneTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientOnRenderProcessGoneTest.java
@@ -7,8 +7,11 @@ import static org.chromium.android_webview.test.OnlyRunIn.ProcessMode.MULTI_PROCESS; import android.support.test.filters.SmallTest; +import android.util.Pair; +import org.junit.After; import org.junit.Assert; +import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -19,12 +22,16 @@ import org.chromium.android_webview.renderer_priority.RendererPriority; import org.chromium.base.task.PostTask; import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.content_public.browser.UiThreadTaskTraits; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.content_public.common.ContentUrlConstants; +import org.chromium.net.test.util.TestWebServer; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.TimeUnit; /** @@ -32,10 +39,35 @@ */ @RunWith(AwJUnit4ClassRunner.class) public class AwContentsClientOnRenderProcessGoneTest { + private static final String TAG = "AwRendererGone"; @Rule public AwActivityTestRule mActivityTestRule = new AwActivityTestRule(); - private static final String TAG = "AwRendererGone"; + private TestWebServer mWebServer; + private RenderProcessGoneTestAwContentsClient mContentsClient; + private AwTestContainerView mTestView; + private AwContents mAwContents; + + @Before + public void setUp() throws Exception { + mWebServer = TestWebServer.start(); + mContentsClient = new RenderProcessGoneTestAwContentsClient(); + mTestView = mActivityTestRule.createAwTestContainerViewOnMainSync(mContentsClient); + mAwContents = mTestView.getAwContents(); + } + + @After + public void tearDown() { + mWebServer.shutdown(); + } + + private String addPageToTestServer(String httpPath, String html) { + List<Pair<String, String>> headers = new ArrayList<Pair<String, String>>(); + headers.add(Pair.create("Content-Type", "text/html")); + headers.add(Pair.create("Cache-Control", "no-store")); + return mWebServer.setResponse(httpPath, html, headers); + } + private static class GetRenderProcessGoneHelper extends CallbackHelper { private AwRenderProcessGoneDetail mDetail; @@ -70,27 +102,22 @@ } interface Terminator { - void terminate(AwContents awContents); + void terminate(); } private AwRenderProcess createAndTerminateRenderProcess( Terminator terminator, boolean expectCrash) throws Throwable { - RenderProcessGoneTestAwContentsClient contentsClient = - new RenderProcessGoneTestAwContentsClient(); - AwTestContainerView testView = - mActivityTestRule.createAwTestContainerViewOnMainSync(contentsClient); - final AwContents awContents = testView.getAwContents(); - GetRenderProcessGoneHelper helper = contentsClient.getGetRenderProcessGoneHelper(); + GetRenderProcessGoneHelper helper = mContentsClient.getGetRenderProcessGoneHelper(); final AwRenderProcess renderProcess = - TestThreadUtils.runOnUiThreadBlocking(() -> awContents.getRenderProcess()); + TestThreadUtils.runOnUiThreadBlocking(() -> mAwContents.getRenderProcess()); // Ensure that the renderer has started. - mActivityTestRule.loadUrlSync(awContents, contentsClient.getOnPageFinishedHelper(), + mActivityTestRule.loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL); // Terminate the renderer. - PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> terminator.terminate(awContents)); + PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> terminator.terminate()); // Assert that onRenderProcessGone is called once. int callCount = helper.getCallCount(); @@ -110,8 +137,7 @@ @SmallTest @OnlyRunIn(MULTI_PROCESS) public void testOnRenderProcessCrash() throws Throwable { - createAndTerminateRenderProcess( - (AwContents awContents) -> { awContents.loadUrl("chrome://crash"); }, true); + createAndTerminateRenderProcess(() -> { mAwContents.loadUrl("chrome://crash"); }, true); } @Test @@ -119,8 +145,7 @@ @SmallTest @OnlyRunIn(MULTI_PROCESS) public void testOnRenderProcessKill() throws Throwable { - createAndTerminateRenderProcess( - (AwContents awContents) -> { awContents.loadUrl("chrome://kill"); }, false); + createAndTerminateRenderProcess(() -> { mAwContents.loadUrl("chrome://kill"); }, false); } @Test @@ -129,7 +154,7 @@ @OnlyRunIn(MULTI_PROCESS) public void testRenderProcessTermination() throws Throwable { createAndTerminateRenderProcess( - (AwContents awContents) -> { awContents.getRenderProcess().terminate(); }, false); + () -> { mAwContents.getRenderProcess().terminate(); }, false); } @Test @@ -138,9 +163,9 @@ @OnlyRunIn(MULTI_PROCESS) public void testRenderProcessDifferentAfterRestart() throws Throwable { AwRenderProcess renderProcess1 = createAndTerminateRenderProcess( - (AwContents awContents) -> { awContents.getRenderProcess().terminate(); }, false); + () -> { mAwContents.getRenderProcess().terminate(); }, false); AwRenderProcess renderProcess2 = createAndTerminateRenderProcess( - (AwContents awContents) -> { awContents.getRenderProcess().terminate(); }, false); + () -> { mAwContents.getRenderProcess().terminate(); }, false); Assert.assertNotEquals(renderProcess1, renderProcess2); } @@ -149,14 +174,8 @@ @SmallTest @OnlyRunIn(MULTI_PROCESS) public void testRenderProcessCanNotTerminateBeforeStart() throws Throwable { - RenderProcessGoneTestAwContentsClient contentsClient = - new RenderProcessGoneTestAwContentsClient(); - AwTestContainerView testView = - mActivityTestRule.createAwTestContainerViewOnMainSync(contentsClient); - final AwContents awContents = testView.getAwContents(); - Assert.assertFalse(TestThreadUtils.runOnUiThreadBlocking( - () -> awContents.getRenderProcess().terminate())); + () -> mAwContents.getRenderProcess().terminate())); } @Test @@ -164,22 +183,52 @@ @SmallTest @OnlyRunIn(MULTI_PROCESS) public void testRenderProcessSameBeforeAndAfterStart() throws Throwable { - RenderProcessGoneTestAwContentsClient contentsClient = - new RenderProcessGoneTestAwContentsClient(); - AwTestContainerView testView = - mActivityTestRule.createAwTestContainerViewOnMainSync(contentsClient); - final AwContents awContents = testView.getAwContents(); - AwRenderProcess renderProcessBeforeStart = - TestThreadUtils.runOnUiThreadBlocking(() -> awContents.getRenderProcess()); + TestThreadUtils.runOnUiThreadBlocking(() -> mAwContents.getRenderProcess()); // Ensure that the renderer has started. - mActivityTestRule.loadUrlSync(awContents, contentsClient.getOnPageFinishedHelper(), + mActivityTestRule.loadUrlSync(mAwContents, mContentsClient.getOnPageFinishedHelper(), ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL); AwRenderProcess renderProcessAfterStart = - TestThreadUtils.runOnUiThreadBlocking(() -> awContents.getRenderProcess()); + TestThreadUtils.runOnUiThreadBlocking(() -> mAwContents.getRenderProcess()); Assert.assertEquals(renderProcessBeforeStart, renderProcessAfterStart); } + + @Test + @Feature({"AndroidWebView"}) + @SmallTest + @OnlyRunIn(MULTI_PROCESS) + // The RenderDocument feature has a "level" parameter. This enables the feature and sets the + // default level to "crashed-frame" to enable replacing the render frame host of crashed frames + // with a new render frame host (instead of resuing the old one). See + // https://go/force-field-trials-docs for the syntax of these flags. + @CommandLineFlags.Add({ + "enable-features=RenderDocument<RenderDocument", + "force-fieldtrials=RenderDocument/Group1", + "force-fieldtrial-params=RenderDocument.Group1:level/crashed-frame", + }) + public void + testNavigationAfterCrashAndJavaScript() throws Throwable { + // In https://crbug.com/1006814, a crashed frame, reinitialized by running JS fails to + // navigate. + mActivityTestRule.getAwSettingsOnUiThread(mAwContents).setJavaScriptEnabled(true); + // Crash the frame. + AwRenderProcess renderProcess1 = createAndTerminateRenderProcess( + () -> { mAwContents.getRenderProcess().terminate(); }, false); + // Run JS in the frame. + Assert.assertEquals("3", + mActivityTestRule.executeJavaScriptAndWaitForResult( + mAwContents, mContentsClient, "1+2")); + // Navigate to somewhere else. This should not crash the frame. + final String content = "some content"; + final String httpPathOnServer = addPageToTestServer("/page.html", content); + mActivityTestRule.loadUrlSync( + mAwContents, mContentsClient.getOnPageFinishedHelper(), httpPathOnServer); + // Result is a string, so needs "". + Assert.assertEquals("\"" + content + "\"", + mActivityTestRule.executeJavaScriptAndWaitForResult( + mAwContents, mContentsClient, "document.body.textContent")); + } }
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 16accb5..298bade 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -265,6 +265,8 @@ "display/cros_display_config.h", "display/cursor_window_controller.cc", "display/cursor_window_controller.h", + "display/display_alignment_indicator.cc", + "display/display_alignment_indicator.h", "display/display_animator.cc", "display/display_animator.h", "display/display_change_dialog.cc", @@ -1846,6 +1848,7 @@ "dip_unittest.cc", "display/cros_display_config_unittest.cc", "display/cursor_window_controller_unittest.cc", + "display/display_alignment_indicator_unittest.cc", "display/display_color_manager_unittest.cc", "display/display_configuration_controller_unittest.cc", "display/display_error_observer_unittest.cc",
diff --git a/ash/display/display_alignment_indicator.cc b/ash/display/display_alignment_indicator.cc new file mode 100644 index 0000000..2fcfe26 --- /dev/null +++ b/ash/display/display_alignment_indicator.cc
@@ -0,0 +1,391 @@ +// Copyright 2020 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/display/display_alignment_indicator.h" + +#include "ash/public/cpp/shell_window_ids.h" +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/root_window_controller.h" +#include "ash/shell.h" +#include "base/strings/utf_string_conversions.h" +#include "ui/display/display.h" +#include "ui/gfx/color_palette.h" +#include "ui/gfx/image/image_skia_operations.h" +#include "ui/gfx/paint_vector_icon.h" +#include "ui/gfx/vector_icon_types.h" +#include "ui/views/background.h" +#include "ui/views/controls/image_view.h" +#include "ui/views/controls/label.h" +#include "ui/views/view.h" + +namespace ash { + +namespace { + +// Constants for indicator highlights. +constexpr SkColor kEdgeHighlightColor = gfx::kGoogleBlue600; +constexpr int kHighlightShadowElevation = 2; + +// Thickness (and radius) of indicator highlight is dependent on resolution. +// If display has resolution smaller than 1440p, then its thickness is +// |kHighlightRadiusSub1440p|. Otherwise, use |kHighlightRadius1440p|. +constexpr int kHighlightRadiusSub1440p = 4; +constexpr int kHighlightRadius1440p = 6; +constexpr int kHighlightSizeChangeRes = 1440; + +// Constants for pill theme. +// White with ~60% opacity. +constexpr SkColor kPillBackgroundColor = SkColorSetARGB(0x99, 0xFF, 0xFF, 0xFF); +constexpr SkColor kPillTextColor = gfx::kGoogleBlue600; +constexpr int kPillBackgroundBlur = 10; + +// Constants for pill layout. +constexpr int kPillRadius = 12; +constexpr int kMaxPillWidth = 192; +constexpr int kPillHeight = 32; +constexpr int kTextMarginNormal = 24; +constexpr int kTextMarginElided = 20; +// Distance between the indicator highlight and the pill. +constexpr int kPillMargin = 20; + +// Constants for arrow layout. +constexpr int kArrowSize = 28; +constexpr int kArrowHorizontalMargin = 12; +constexpr int kArrowVerticalMargin = (kPillHeight - kArrowSize) / 2; +constexpr int kArrowAllocatedWidth = + kArrowHorizontalMargin + kArrowSize + kArrowHorizontalMargin; + +enum class IndicatorPosition { kTop, kRight, kBottom, kLeft }; + +// Returns IndicatorPosition given the bounds of an indicator highlight along +// with its corresponding display. +IndicatorPosition GetIndicatorPosition(const display::Display& src_display, + const gfx::Rect& indicator_bounds) { + const gfx::Point midpoint = src_display.bounds().CenterPoint(); + + // Horizontal shared edge (kTop or kBottom) + if (indicator_bounds.width() > indicator_bounds.height()) { + return (indicator_bounds.y() < midpoint.y()) ? IndicatorPosition::kTop + : IndicatorPosition::kBottom; + } + // Vertical shared edge (kLeft or kRight) + return (indicator_bounds.x() < midpoint.x()) ? IndicatorPosition::kLeft + : IndicatorPosition::kRight; +} + +// Indicator thickness is dependent on display resolution. +int GetIndicatorThickness(const gfx::Size& display_size) { + return std::min(display_size.width(), display_size.height()) > + kHighlightSizeChangeRes + ? kHighlightRadius1440p + : kHighlightRadiusSub1440p; +} + +// Adjust the indicator bounds to the correct thickness depending on the +// resolution of |display|. +void AdjustIndicatorBounds(const display::Display& display, + gfx::Rect* out_indicator_bounds) { + const int indicator_thickness = GetIndicatorThickness(display.size()); + + // Apply the new thickness to the indicator. + if (out_indicator_bounds->height() > out_indicator_bounds->width()) + out_indicator_bounds->set_width(indicator_thickness); + else + out_indicator_bounds->set_height(indicator_thickness); + + // Create enough space for the full indicator on the x and y axis. + const gfx::Point display_bottom_right = display.bounds().bottom_right(); + if (out_indicator_bounds->x() == (display_bottom_right.x() - 1)) + out_indicator_bounds->set_x(display_bottom_right.x() - indicator_thickness); + else if (out_indicator_bounds->y() == (display_bottom_right.y() - 1)) + out_indicator_bounds->set_y(display_bottom_right.y() - indicator_thickness); +} + +// Returns the pill's origin based on |pill_size| and the indicator's +// |thickened_bounds|. +gfx::Point GetPillOrigin(const gfx::Size& pill_size, + IndicatorPosition src_position, + const gfx::Rect& thickened_bounds) { + gfx::Point pill_origin; + switch (src_position) { + case IndicatorPosition::kLeft: + pill_origin = thickened_bounds.right_center(); + pill_origin.Offset(kPillMargin, -1 * kPillHeight / 2); + break; + case IndicatorPosition::kRight: + pill_origin = thickened_bounds.left_center(); + pill_origin.Offset(-1 * kPillMargin - pill_size.width(), + -1 * kPillHeight / 2); + break; + case IndicatorPosition::kTop: + pill_origin = thickened_bounds.bottom_center(); + pill_origin.Offset(-1 * pill_size.width() / 2, kPillMargin); + break; + case IndicatorPosition::kBottom: + pill_origin = thickened_bounds.top_center(); + pill_origin.Offset(-1 * pill_size.width() / 2, + -1 * kPillMargin - kPillHeight); + break; + } + + return pill_origin; +} + +views::Widget::InitParams CreateInitParams(int64_t display_id, + const std::string& target_name) { + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); + + aura::Window* root = + Shell::GetRootWindowControllerWithDisplayId(display_id)->GetRootWindow(); + + params.parent = Shell::GetContainer(root, kShellWindowId_OverlayContainer); + params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent; + params.ownership = + views::Widget::InitParams::Ownership::WIDGET_OWNS_NATIVE_WIDGET; + params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; + params.accept_events = false; + params.name = target_name; + + return params; +} + +} // namespace + +// ----------------------------------------------------------------------------- +// IndicatorHighlightView: +// View for the indicator highlight that renders on a shared edge of a given +// display. +class IndicatorHighlightView : public views::View { + public: + explicit IndicatorHighlightView(const display::Display& display) + // Corner radius is the same as edge thickness. + : corner_radius_(GetIndicatorThickness(display.size())) { + SetPaintToLayer(ui::LAYER_TEXTURED); + + layer()->SetFillsBoundsOpaquely(false); + layer()->SetIsFastRoundedCorner(true); + SetBackground(views::CreateSolidBackground(kEdgeHighlightColor)); + } + + IndicatorHighlightView(const IndicatorHighlightView&) = delete; + IndicatorHighlightView& operator=(const IndicatorHighlightView&) = delete; + ~IndicatorHighlightView() override = default; + + // Sets which corners should be rounded depending on the position of the + // indicator edge. + void SetPosition(IndicatorPosition position) { + gfx::RoundedCornersF corners; + + switch (position) { + case IndicatorPosition::kLeft: + corners = {0, corner_radius_, corner_radius_, 0}; + break; + case IndicatorPosition::kRight: + corners = {corner_radius_, 0, 0, corner_radius_}; + break; + case IndicatorPosition::kTop: + corners = {0, 0, corner_radius_, corner_radius_}; + break; + case IndicatorPosition::kBottom: + corners = {corner_radius_, corner_radius_, 0, 0}; + break; + } + + layer()->SetRoundedCornerRadius(corners); + } + + // views::View: + const char* GetClassName() const override { return "IndicatorHighlightView"; } + + private: + // Radius for the rounded rectangle highlight. Determined by display + // resolution. + int corner_radius_; +}; + +// ----------------------------------------------------------------------------- +// IndicatorPillView: +// View for the pill with an arrow pointing to an indicator highlight and name +// of the target display. +class IndicatorPillView : public views::View { + public: + explicit IndicatorPillView(const base::string16& text) + : // TODO(1070352): Replace current placeholder arrow in + // IndicatorPillView + icon_(AddChildView(std::make_unique<views::ImageView>())), + text_label_(AddChildView(std::make_unique<views::Label>())), + arrow_image_( + CreateVectorIcon(kLockScreenArrowIcon, gfx::kGoogleBlue600)) { + SetPaintToLayer(ui::LAYER_TEXTURED); + + layer()->SetFillsBoundsOpaquely(false); + layer()->SetIsFastRoundedCorner(true); + layer()->SetBackgroundBlur(kPillBackgroundBlur); + layer()->SetRoundedCornerRadius(gfx::RoundedCornersF{kPillRadius}); + + SetBackground( + views::CreateRoundedRectBackground(kPillBackgroundColor, kPillRadius)); + + text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); + text_label_->SetEnabledColor(kPillTextColor); + text_label_->SetElideBehavior(gfx::ElideBehavior::ELIDE_TAIL); + text_label_->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_CENTER); + text_label_->SetVerticalAlignment(gfx::VerticalAlignment::ALIGN_MIDDLE); + + text_label_->SetText(text); + + icon_->SetImage(arrow_image_); + } + + IndicatorPillView(const IndicatorPillView&) = delete; + IndicatorPillView& operator=(const IndicatorPillView&) = delete; + ~IndicatorPillView() override = default; + + // views::View: + gfx::Size CalculatePreferredSize() const override { + // Pill is laid out as: + // ( | | text ) + // Has max width of kMaxPillWidth. + + const int text_width = text_label_->CalculatePreferredSize().width(); + const int width = kArrowAllocatedWidth + text_width + kTextMarginNormal; + + return gfx::Size(std::min(width, kMaxPillWidth), kPillHeight); + } + + // views::View: + void Layout() override { + icon_->SetImageSize(gfx::Size(kArrowSize, kArrowSize)); + + // IndicatorPosition::kRight is a special case for layout as it is the only + // time where the arrow is on the right of the text instead of the usual + // left. + const int local_width = GetLocalBounds().width(); + int icon_x = position_ == IndicatorPosition::kRight + ? local_width - kArrowHorizontalMargin - kArrowSize + : kArrowHorizontalMargin; + + icon_->SetBoundsRect( + gfx::Rect(icon_x, kArrowVerticalMargin, kArrowSize, kArrowSize)); + + // If width of the pill is equal or greater than the max pill width, then + // text is elided and thus side margin must be reduced. + const int side_margin = CalculatePreferredSize().width() >= kMaxPillWidth + ? kTextMarginElided + : kTextMarginNormal; + + const int text_label_width = + local_width - kArrowAllocatedWidth - side_margin; + + const int text_label_x = position_ == IndicatorPosition::kRight + ? side_margin + : kArrowAllocatedWidth; + + text_label_->SetBoundsRect( + gfx::Rect(text_label_x, 0, text_label_width, kPillHeight)); + } + + // views::View: + const char* GetClassName() const override { return "IndicatorPillView"; } + + // Rotates the arrow depending on indicator highlight's position on-screen. + void SetPosition(IndicatorPosition position) { + if (position_ == position) + return; + + position_ = position; + + switch (position) { + case IndicatorPosition::kLeft: + icon_->SetImage(gfx::ImageSkiaOperations::CreateRotatedImage( + arrow_image_, SkBitmapOperations::ROTATION_180_CW)); + return; + case IndicatorPosition::kRight: + // |arrow_image_| points to right by default; no rotation required. + icon_->SetImage(arrow_image_); + return; + case IndicatorPosition::kTop: + icon_->SetImage(gfx::ImageSkiaOperations::CreateRotatedImage( + arrow_image_, SkBitmapOperations::ROTATION_270_CW)); + return; + case IndicatorPosition::kBottom: + icon_->SetImage(gfx::ImageSkiaOperations::CreateRotatedImage( + arrow_image_, SkBitmapOperations::ROTATION_90_CW)); + return; + } + } + + private: + // Possibly rotated image of an arrow based on |vector_icon_|. + views::ImageView* icon_ = nullptr; // NOT OWNED + // Label containing name of target display in the pill. + views::Label* text_label_ = nullptr; // NOT OWNED + gfx::ImageSkia arrow_image_; + // The side of the display indicator is postioned on. Used to determine arrow + // direction and placement. + IndicatorPosition position_ = IndicatorPosition::kRight; +}; + +// ----------------------------------------------------------------------------- +// DisplayAlignmentIndicator: +DisplayAlignmentIndicator::DisplayAlignmentIndicator( + const display::Display& src_display, + const gfx::Rect& bounds, + const std::string& target_name) + : indicator_view_(new IndicatorHighlightView(src_display)) { + gfx::Rect thickened_bounds = bounds; + AdjustIndicatorBounds(src_display, &thickened_bounds); + + views::Widget::InitParams indicator_widget_params = + CreateInitParams(src_display.id(), "IndicatorHighlight"); + indicator_widget_params.shadow_elevation = kHighlightShadowElevation; + + indicator_widget_.Init(std::move(indicator_widget_params)); + indicator_widget_.SetVisibilityChangedAnimationsEnabled(false); + indicator_widget_.SetContentsView(indicator_view_); + indicator_widget_.SetBounds(thickened_bounds); + + const IndicatorPosition indicator_position = + GetIndicatorPosition(src_display, thickened_bounds); + indicator_view_->SetPosition(indicator_position); + + // Only create IndicatorPillView when |target_name| is specified. + if (!target_name.empty()) { + auto pill_ptr = + std::make_unique<IndicatorPillView>(base::UTF8ToUTF16(target_name)); + pill_view_ = pill_ptr.get(); + pill_view_->SetPosition(indicator_position); + + pill_widget_ = std::make_unique<views::Widget>(); + pill_widget_->Init(CreateInitParams(src_display.id(), "IndicatorPill")); + pill_widget_->SetVisibilityChangedAnimationsEnabled(false); + pill_widget_->SetContentsView(pill_ptr.release()); + + gfx::Size pill_size = pill_view_->GetPreferredSize(); + gfx::Rect pill_bounds = gfx::Rect( + GetPillOrigin(pill_size, indicator_position, thickened_bounds), + pill_size); + pill_widget_->SetBounds(pill_bounds); + } + + Show(); +} + +DisplayAlignmentIndicator::~DisplayAlignmentIndicator() = default; + +void DisplayAlignmentIndicator::Show() { + indicator_widget_.Show(); + + if (pill_widget_) + pill_widget_->Show(); +} + +void DisplayAlignmentIndicator::Hide() { + indicator_widget_.Hide(); + + if (pill_widget_) + pill_widget_->Hide(); +} + +} // namespace ash
diff --git a/ash/display/display_alignment_indicator.h b/ash/display/display_alignment_indicator.h new file mode 100644 index 0000000..316f04e --- /dev/null +++ b/ash/display/display_alignment_indicator.h
@@ -0,0 +1,63 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_DISPLAY_DISPLAY_ALIGNMENT_INDICATOR_H_ +#define ASH_DISPLAY_DISPLAY_ALIGNMENT_INDICATOR_H_ + +#include <memory> + +#include "ash/ash_export.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/views/widget/widget.h" + +namespace display { +class Display; +} // namespace display + +namespace ash { + +class IndicatorHighlightView; +class IndicatorPillView; + +// DisplayAlignmentIndicator is a container for indicator highlighting a shared +// edge between two displays and a pill that contains an arrow and target +// display's name. +class ASH_EXPORT DisplayAlignmentIndicator { + public: + // Construct and show indicator highlight and pill. + // |src_display| is the display that the indicator is shown in. + // |bounds| is the position and size of the 1px thick shared edge between + // |src_display| and target display specified by |target_name|. |target_name| + // is the target display's name that is shown in the display settings. Pill + // does not render if |target_name| is an empty string. + DisplayAlignmentIndicator(const display::Display& src_display, + const gfx::Rect& bounds, + const std::string& target_name); + DisplayAlignmentIndicator(const DisplayAlignmentIndicator&) = delete; + DisplayAlignmentIndicator& operator=(const DisplayAlignmentIndicator&) = + delete; + ~DisplayAlignmentIndicator(); + + // Shows/Hides the indicator. + void Show(); + void Hide(); + + private: + friend class DisplayAlignmentIndicatorTest; + + // View and Widget for showing the blue indicator highlights on the edge of + // the display. + IndicatorHighlightView* indicator_view_ = nullptr; // NOT OWNED + views::Widget indicator_widget_; + + // View and Widget for showing a pill with name of the neighboring display and + // an arrow pointing towards it. May not be initialized if ctor without + // |target_name| is used (for preview indicator). + IndicatorPillView* pill_view_ = nullptr; // NOT OWNED + std::unique_ptr<views::Widget> pill_widget_; +}; + +} // namespace ash + +#endif // ASH_DISPLAY_DISPLAY_ALIGNMENT_INDICATOR_H_
diff --git a/ash/display/display_alignment_indicator_unittest.cc b/ash/display/display_alignment_indicator_unittest.cc new file mode 100644 index 0000000..65d7845 --- /dev/null +++ b/ash/display/display_alignment_indicator_unittest.cc
@@ -0,0 +1,91 @@ +// Copyright 2020 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/display/display_alignment_indicator.h" + +#include "ash/public/cpp/ash_features.h" +#include "ash/public/cpp/shell_window_ids.h" +#include "ash/shell.h" +#include "ash/test/ash_test_base.h" +#include "base/test/scoped_feature_list.h" +#include "ui/display/manager/display_manager.h" +#include "ui/views/widget/widget.h" + +namespace ash { + +class DisplayAlignmentIndicatorTest : public AshTestBase { + public: + DisplayAlignmentIndicatorTest() = default; + ~DisplayAlignmentIndicatorTest() override = default; + + protected: + bool DoesPillExist(const DisplayAlignmentIndicator& indicator) { + return indicator.pill_widget_ != nullptr; + } + + bool IsPillVisible(const DisplayAlignmentIndicator& indicator) { + return indicator.pill_widget_ && indicator.pill_widget_->IsVisible(); + } + + bool IsHighlightVisible(const DisplayAlignmentIndicator& indicator) { + return indicator.indicator_widget_.IsVisible(); + } +}; + +TEST_F(DisplayAlignmentIndicatorTest, IndicatorWithPill) { + UpdateDisplay("1920x1080,1366x768"); + + const auto& primary_display = display_manager()->GetDisplayAt(0); + const auto& secondary_display = display_manager()->GetDisplayAt(1); + + gfx::Rect primary_edge; + gfx::Rect secondary_edge; + + ASSERT_TRUE(display::ComputeBoundary(primary_display, secondary_display, + &primary_edge, &secondary_edge)); + + DisplayAlignmentIndicator indicator(primary_display, primary_edge, "test"); + + ASSERT_TRUE(DoesPillExist(indicator)); + EXPECT_TRUE(IsPillVisible(indicator)); + EXPECT_TRUE(IsHighlightVisible(indicator)); + + indicator.Hide(); + + EXPECT_FALSE(IsPillVisible(indicator)); + EXPECT_FALSE(IsHighlightVisible(indicator)); + + indicator.Show(); + + EXPECT_TRUE(IsPillVisible(indicator)); + EXPECT_TRUE(IsHighlightVisible(indicator)); +} + +TEST_F(DisplayAlignmentIndicatorTest, IndicatorWithoutPill) { + UpdateDisplay("1920x1080,1366x768"); + + const auto& primary_display = display_manager()->GetDisplayAt(0); + const auto& secondary_display = display_manager()->GetDisplayAt(1); + + gfx::Rect primary_edge; + gfx::Rect secondary_edge; + + ASSERT_TRUE(display::ComputeBoundary(primary_display, secondary_display, + &primary_edge, &secondary_edge)); + + DisplayAlignmentIndicator indicator(primary_display, primary_edge, ""); + + ASSERT_FALSE(DoesPillExist(indicator)); + EXPECT_TRUE(IsHighlightVisible(indicator)); + + indicator.Hide(); + + EXPECT_FALSE(IsHighlightVisible(indicator)); + + indicator.Show(); + + EXPECT_TRUE(IsHighlightVisible(indicator)); +} + +} // namespace ash
diff --git a/ash/drag_drop/tab_drag_drop_delegate.cc b/ash/drag_drop/tab_drag_drop_delegate.cc index c176a84..c24060d 100644 --- a/ash/drag_drop/tab_drag_drop_delegate.cc +++ b/ash/drag_drop/tab_drag_drop_delegate.cc
@@ -129,7 +129,23 @@ if (snap_position == SplitViewController::SnapPosition::NONE) return; - SplitViewController::Get(new_window)->SnapWindow(new_window, snap_position); + SplitViewController* const split_view_controller = + SplitViewController::Get(new_window); + split_view_controller->SnapWindow(new_window, snap_position); + + // The tab drag source window is the last window the user was + // interacting with. When dropping into split view, it makes the most + // sense to snap this window to the opposite side. Do this. + SplitViewController::SnapPosition opposite_position = + (snap_position == SplitViewController::SnapPosition::LEFT) + ? SplitViewController::SnapPosition::RIGHT + : SplitViewController::SnapPosition::LEFT; + + // |source_window_| is itself a child window of the browser since it + // hosts web content (specifically, the tab strip WebUI). Snap its + // toplevel window which is the browser window. + split_view_controller->SnapWindow(source_window_->GetToplevelWindow(), + opposite_position); } } // namespace ash
diff --git a/ash/drag_drop/tab_drag_drop_delegate_unittest.cc b/ash/drag_drop/tab_drag_drop_delegate_unittest.cc index b290601..e96107d 100644 --- a/ash/drag_drop/tab_drag_drop_delegate_unittest.cc +++ b/ash/drag_drop/tab_drag_drop_delegate_unittest.cc
@@ -184,6 +184,8 @@ EXPECT_TRUE(split_view_controller->InTabletSplitViewMode()); EXPECT_EQ(new_window.get(), split_view_controller->GetSnappedWindow( SplitViewController::SnapPosition::RIGHT)); + EXPECT_EQ(source_window.get(), split_view_controller->GetSnappedWindow( + SplitViewController::SnapPosition::LEFT)); } } // namespace ash
diff --git a/ash/login/login_screen_test_api.cc b/ash/login/login_screen_test_api.cc index 5f535b39..a9d329c 100644 --- a/ash/login/login_screen_test_api.cc +++ b/ash/login/login_screen_test_api.cc
@@ -182,6 +182,20 @@ } // static +bool LoginScreenTestApi::IsSystemInfoShown() { + LockScreen::TestApi lock_screen_test(LockScreen::Get()); + LockContentsView::TestApi lock_contents_test( + lock_screen_test.contents_view()); + // Check if all views in the hierarchy are visible. + for (views::View* view = lock_contents_test.system_info(); view != nullptr; + view = view->parent()) { + if (!view->GetVisible()) + return false; + } + return true; +} + +// static bool LoginScreenTestApi::IsDisplayPasswordButtonShown( const AccountId& account_id) { if (!FocusUser(account_id)) {
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index 12c28c4f..a2dee96 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -1204,8 +1204,9 @@ oobe_dialog_visible_ = state != OobeDialogState::HIDDEN; extension_ui_visible_ = state == OobeDialogState::EXTENSION_LOGIN; - // Show either oobe dialog or lock screen. - SetVisible(!oobe_dialog_visible_); + // Show either oobe dialog or user pods. + if (main_view_) + main_view_->SetVisible(!oobe_dialog_visible_); GetWidget()->widget_delegate()->SetCanActivate(!oobe_dialog_visible_); UpdateBottomStatusIndicatorVisibility();
diff --git a/ash/login/ui/lock_debug_view.cc b/ash/login/ui/lock_debug_view.cc index 4ba2e506..ebb89c0 100644 --- a/ash/login/ui/lock_debug_view.cc +++ b/ash/login/ui/lock_debug_view.cc
@@ -1136,8 +1136,7 @@ views::View* container) { // Creates a button with |text| that cannot be focused. std::unique_ptr<views::LabelButton> button = - views::MdTextButton::CreateSecondaryUiButton(this, - base::ASCIIToUTF16(text)); + views::MdTextButton::Create(this, base::ASCIIToUTF16(text)); button->SetID(id); button->SetFocusBehavior(views::View::FocusBehavior::NEVER);
diff --git a/ash/public/cpp/OWNERS b/ash/public/cpp/OWNERS index 430b87f..f3c487d 100644 --- a/ash/public/cpp/OWNERS +++ b/ash/public/cpp/OWNERS
@@ -1,2 +1,2 @@ +per-file *login*=file://ash/login/OWNERS per-file *shelf*=file://ash/shelf/OWNERS -
diff --git a/ash/public/cpp/ash_features.cc b/ash/public/cpp/ash_features.cc index 6dbd644b..8b946df9 100644 --- a/ash/public/cpp/ash_features.cc +++ b/ash/public/cpp/ash_features.cc
@@ -274,7 +274,8 @@ } bool IsAppScalingEnabled() { - return base::FeatureList::IsEnabled(kShelfAppScaling); + return base::FeatureList::IsEnabled(kShelfAppScaling) && + chromeos::switches::ShouldShowShelfHotseat(); } namespace {
diff --git a/ash/public/cpp/login_screen_test_api.h b/ash/public/cpp/login_screen_test_api.h index 7812779d..11728fc9 100644 --- a/ash/public/cpp/login_screen_test_api.h +++ b/ash/public/cpp/login_screen_test_api.h
@@ -28,6 +28,7 @@ static bool IsCancelButtonShown(); static bool IsParentAccessButtonShown(); static bool IsWarningBubbleShown(); + static bool IsSystemInfoShown(); static bool IsDisplayPasswordButtonShown(const AccountId& account_id); static bool IsForcedOnlineSignin(const AccountId& account_id); static void SubmitPassword(const AccountId& account_id,
diff --git a/ash/shelf/hotseat_widget.cc b/ash/shelf/hotseat_widget.cc index 7795cef..f617eb7 100644 --- a/ash/shelf/hotseat_widget.cc +++ b/ash/shelf/hotseat_widget.cc
@@ -513,6 +513,10 @@ } target_bounds_ = gfx::Rect(hotseat_origin, gfx::Size(hotseat_width, hotseat_height)); + + // Check whether |target_bounds_| will change the state of app scaling. If + // so, update |target_bounds_| here to avoid re-layout later. + MaybeAdjustTargetBoundsForAppScaling(hotseat_target_state); } gfx::Rect HotseatWidget::GetTargetBounds() const { @@ -586,6 +590,16 @@ GetHotseatSize(); } +bool HotseatWidget::UpdateAppScalingIfNeeded() { + if (ShouldTriggerAppScaling(target_bounds_.size(), state_) == + is_forced_dense_) { + return false; + } + + shelf_->shelf_layout_manager()->LayoutShelf(/*animate=*/true); + return true; +} + int HotseatWidget::GetHotseatBackgroundBlurForTest() const { return delegate_view_->background_blur(); } @@ -630,4 +644,47 @@ layout_manager->is_active_session_state()}; } +void HotseatWidget::MaybeAdjustTargetBoundsForAppScaling( + HotseatState hotseat_target_state) { + // Return early if app scaling state does not change. + const bool should_trigger_app_scaling = + ShouldTriggerAppScaling(target_bounds_.size(), hotseat_target_state); + if (should_trigger_app_scaling == is_forced_dense_) + return; + + is_forced_dense_ = should_trigger_app_scaling; + + // Update app icons of shelf view. + scrollable_shelf_view_->shelf_view()->OnShelfConfigUpdated(); + + const gfx::Point adjusted_hotseat_origin = gfx::Point( + target_bounds_.x(), CalculateHotseatYInScreen(hotseat_target_state)); + target_bounds_ = + gfx::Rect(adjusted_hotseat_origin, + gfx::Size(target_bounds_.width(), GetHotseatSize())); +} + +bool HotseatWidget::ShouldTriggerAppScaling( + const gfx::Size& available_size, + HotseatState hotseat_target_state) const { + if (!ash::features::IsAppScalingEnabled()) + return false; + + // Do not trigger app scaling if shelf is in dense mode. + if (ShelfConfig::Get()->is_dense()) + return false; + + // Currently we only update app scaling in home launcher due to performance + // concerns in hotseat animation transition between home launcher state + // and extended state. + // TODO(crbug.com/1081476). + if (hotseat_target_state != HotseatState::kShownHomeLauncher) + return is_forced_dense_; + + const int normal_button_size = + ShelfConfig::Get()->GetShelfButtonSize(/*force_dense=*/false); + return scrollable_shelf_view_->RequiresScrollingForItemSize( + available_size, normal_button_size); +} + } // namespace ash
diff --git a/ash/shelf/hotseat_widget.h b/ash/shelf/hotseat_widget.h index 1823640b..945a4f0 100644 --- a/ash/shelf/hotseat_widget.h +++ b/ash/shelf/hotseat_widget.h
@@ -100,6 +100,10 @@ // the hidden state. int GetHotseatFullDragAmount() const; + // Updates the app scaling state, if needed. Returns whether the app scaling + // state changed. + bool UpdateAppScalingIfNeeded(); + // Returns the background blur of the |translucent_background_|, for tests. int GetHotseatBackgroundBlurForTest() const; @@ -146,6 +150,14 @@ // Collects the inputs for layout. LayoutInputs GetLayoutInputs() const; + // May update the hotseat widget's target in account of app scaling. + void MaybeAdjustTargetBoundsForAppScaling(HotseatState hotseat_target_state); + + // Returns whether app scaling should be triggered if hotseat's size becomes + // |available_size| and the hotseat's state is |hotseat_target_state|. + bool ShouldTriggerAppScaling(const gfx::Size& available_size, + HotseatState hotseat_target_state) const; + // The set of inputs that impact this widget's layout. The assumption is that // this widget needs a relayout if, and only if, one or more of these has // changed.
diff --git a/ash/shelf/scrollable_shelf_view.cc b/ash/shelf/scrollable_shelf_view.cc index a4a49a2..26aef7c 100644 --- a/ash/shelf/scrollable_shelf_view.cc +++ b/ash/shelf/scrollable_shelf_view.cc
@@ -390,7 +390,7 @@ // CalculateIdealSize. Because ShelfView::CalculatePreferredSize relies on the // bounds of app icon. Meanwhile, the icon's bounds may be updated by // animation. - const gfx::Rect ideal_bounds = gfx::Rect(CalculateIdealSize()); + const gfx::Rect ideal_bounds = gfx::Rect(CalculatePreferredSize()); const gfx::Rect local_bounds = GetLocalBounds(); gfx::Rect shelf_view_bounds = @@ -677,6 +677,14 @@ return icon_bounds; } +bool ScrollableShelfView::RequiresScrollingForItemSize( + const gfx::Size& target_size, + int button_size) const { + const gfx::Size icons_preferred_size = + shelf_container_view_->CalculateIdealSize(button_size); + return !CanFitAllAppsWithoutScrolling(target_size, icons_preferred_size); +} + views::View* ScrollableShelfView::GetShelfContainerViewForTest() { return shelf_container_view_; } @@ -765,8 +773,11 @@ ScrollableShelfView::CalculateLayoutStrategy(float scroll_distance_on_main_axis, int space_for_icons, bool use_target_bounds) const { - if (CanFitAllAppsWithoutScrolling(use_target_bounds)) + if (CanFitAllAppsWithoutScrolling( + GetAvailableLocalBounds(use_target_bounds).size(), + CalculatePreferredSize())) { return kNotShowArrowButtons; + } if (scroll_distance_on_main_axis == 0.f) { // No invisible shelf buttons at the left side. So hide the left button. @@ -971,6 +982,12 @@ shelf_view_->UpdateVisibleIndices(); + // When app scaling state needs update, hotseat bounds should change. Then + // it is not meaningful to do further work in the current view bounds. So + // returns early. + if (GetShelf()->hotseat_widget()->UpdateAppScalingIfNeeded()) + return; + const gfx::Vector2dF old_scroll_offset = scroll_offset_; // Adding/removing an icon may change the padding then affect the available @@ -1382,7 +1399,8 @@ available_local_bounds.height()) - 2 * base_padding_; - int gap = CanFitAllAppsWithoutScrolling(use_target_bounds) + int gap = CanFitAllAppsWithoutScrolling(available_local_bounds.size(), + CalculatePreferredSize()) ? available_size_for_app_icons - icons_size : 0; // overflow @@ -1971,17 +1989,16 @@ } bool ScrollableShelfView::CanFitAllAppsWithoutScrolling( - bool use_target_bounds) const { - const gfx::Rect available_rect = GetAvailableLocalBounds(use_target_bounds); + const gfx::Size& available_size, + const gfx::Size& icons_preferred_size) const { const int available_length = - (GetShelf()->IsHorizontalAlignment() ? available_rect.width() - : available_rect.height()) - + (GetShelf()->IsHorizontalAlignment() ? available_size.width() + : available_size.height()) - 2 * ShelfConfig::Get()->app_icon_group_margin(); - gfx::Size preferred_size = GetPreferredSize(); int preferred_length = GetShelf()->IsHorizontalAlignment() - ? preferred_size.width() - : preferred_size.height(); + ? icons_preferred_size.width() + : icons_preferred_size.height(); preferred_length += 2 * ShelfConfig::Get()->GetAppIconEndPadding(); return available_length >= preferred_length;
diff --git a/ash/shelf/scrollable_shelf_view.h b/ash/shelf/scrollable_shelf_view.h index a856a2c..5972a9d 100644 --- a/ash/shelf/scrollable_shelf_view.h +++ b/ash/shelf/scrollable_shelf_view.h
@@ -96,6 +96,11 @@ // hotseat ends. gfx::Rect GetTargetScreenBoundsOfItemIcon(const ShelfID& id) const; + // Returns whether scrollable shelf should show app buttons with scrolling + // when the view size is |target_size| and app button size is |button_size|. + bool RequiresScrollingForItemSize(const gfx::Size& target_size, + int button_size) const; + views::View* GetShelfContainerViewForTest(); bool ShouldAdjustForTest() const; @@ -371,10 +376,12 @@ // Returns the available space on the main axis for shelf icons. int GetSpaceForIcons() const; - // Returns whether there is available space to accommodate all shelf icons. - // |use_target_bounds| indicates which view bounds are used for - // calculation: actual view bounds or target view bounds. - bool CanFitAllAppsWithoutScrolling(bool use_target_bounds) const; + // Returns whether |available_size| is able to accommodate all shelf icons + // without scrolling. |icons_preferred_size| is the space required by shelf + // icons. + bool CanFitAllAppsWithoutScrolling( + const gfx::Size& available_size, + const gfx::Size& icons_preferred_size) const; // Returns whether scrolling should be handled. |is_gesture_fling| is true // when the scrolling is triggered by gesture fling event; when it is false,
diff --git a/ash/shelf/scrollable_shelf_view_unittest.cc b/ash/shelf/scrollable_shelf_view_unittest.cc index ebf00046..4f5ef67 100644 --- a/ash/shelf/scrollable_shelf_view_unittest.cc +++ b/ash/shelf/scrollable_shelf_view_unittest.cc
@@ -8,6 +8,7 @@ #include "ash/app_list/app_list_presenter_impl.h" #include "ash/app_list/views/app_list_view.h" #include "ash/drag_drop/drag_image_view.h" +#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/shelf_config.h" #include "ash/root_window_controller.h" #include "ash/shelf/shelf_app_button.h" @@ -15,8 +16,10 @@ #include "ash/shelf/shelf_tooltip_manager.h" #include "ash/shelf/shelf_view_test_api.h" #include "ash/shelf/shelf_widget.h" +#include "ash/shelf/test/overview_animation_waiter.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" +#include "ash/wm/overview/overview_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/test/icu_test_util.h" #include "base/test/scoped_feature_list.h" @@ -110,8 +113,9 @@ void AddAppShortcutsUntilOverflow() { while (scrollable_shelf_view_->layout_strategy_for_test() == - ScrollableShelfView::kNotShowArrowButtons) + ScrollableShelfView::kNotShowArrowButtons) { AddAppShortcut(); + } } void AddAppShortcutsUntilRightArrowIsShown() { @@ -901,4 +905,109 @@ } } +class ScrollableShelfViewWithAppScalingTest : public ScrollableShelfViewTest { + public: + ScrollableShelfViewWithAppScalingTest() = default; + ~ScrollableShelfViewWithAppScalingTest() override = default; + + void SetUp() override { + scoped_feature_list_.InitWithFeatures({ash::features::kShelfAppScaling}, + {}); + ScrollableShelfViewTest::SetUp(); + + // Display should be big enough (width and height are bigger than 600). + // Otherwise, shelf is in dense mode by default. + UpdateDisplay("800x601"); + + // App scaling is only used in tablet mode. + Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); + base::RunLoop().RunUntilIdle(); + ASSERT_FALSE(ShelfConfig::Get()->is_dense()); + } + + void TearDown() override { + ScrollableShelfViewTest::TearDown(); + scoped_feature_list_.Reset(); + } + + protected: + // |kAppCount| is a magic number, which satisfies the following + // conditions: + // (1) Scrollable shelf shows |kAppCount| app buttons without scrolling. + // (2) Scrollable shelf shows (|kAppCount| + 1) app buttons with scrolling. + // Addition or removal of shelf button should not change hotseat state. So + // Hotseat widget's width is a constant. Then |kAppCount| is in the range + // of [1, (hotseat width) / (shelf button + button spacing) + 1]. So we can + // get |kAppCount| in that range manually + static constexpr int kAppCount = 9; + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +// Verifies that app scaling is turned on/off when having insufficient/enough +// space for shelf buttons of normal size without scrolling. +TEST_F(ScrollableShelfViewWithAppScalingTest, AppScalingBasics) { + PopulateAppShortcut(kAppCount); + HotseatWidget* hotseat_widget = + GetPrimaryShelf()->shelf_widget()->hotseat_widget(); + EXPECT_FALSE(hotseat_widget->is_forced_dense()); + + // Pin an app icon. Verify that app scaling is turned on. + const ShelfID shelf_id = AddAppShortcut(); + EXPECT_TRUE(hotseat_widget->is_forced_dense()); + + // Unpin an app icon. + ShelfModel* shelf_model = ShelfModel::Get(); + const gfx::Rect bounds_before_unpin = + hotseat_widget->GetWindowBoundsInScreen(); + const int shelf_button_size_before = shelf_view_->GetButtonSize(); + shelf_model->RemoveItemAt(shelf_model->ItemIndexByID(shelf_id)); + test_api_->RunMessageLoopUntilAnimationsDone(); + + // Verify that: + // (1) After unpinning the app scaling is turned off. + // (2) Hotseat widget's size and the shelf button size are expected. + const gfx::Rect bounds_after_unpin = + hotseat_widget->GetWindowBoundsInScreen(); + const int shelf_button_size_after = shelf_view_->GetButtonSize(); + EXPECT_FALSE(hotseat_widget->is_forced_dense()); + EXPECT_EQ(bounds_before_unpin.width(), bounds_after_unpin.width()); + EXPECT_LT(bounds_before_unpin.height(), bounds_after_unpin.height()); + EXPECT_LT(shelf_button_size_before, shelf_button_size_after); +} + +// Verifies that app scaling works as expected with hotseat state transition. +TEST_F(ScrollableShelfViewWithAppScalingTest, + VerifyWithHotseatStateTransition) { + PopulateAppShortcut(kAppCount); + HotseatWidget* hotseat_widget = + GetPrimaryShelf()->shelf_widget()->hotseat_widget(); + EXPECT_FALSE(hotseat_widget->is_forced_dense()); + + // Pin an app icon then enter the overview mode. Verify that app scaling is + // turned on. + const ShelfID shelf_id = AddAppShortcut(); + { + OverviewAnimationWaiter waiter; + Shell::Get()->overview_controller()->StartOverview(); + waiter.Wait(); + } + EXPECT_TRUE(hotseat_widget->is_forced_dense()); + + // Unpin an app icon. Verify that app scaling is still on. + ShelfModel* shelf_model = ShelfModel::Get(); + shelf_model->RemoveItemAt(shelf_model->ItemIndexByID(shelf_id)); + test_api_->RunMessageLoopUntilAnimationsDone(); + EXPECT_TRUE(hotseat_widget->is_forced_dense()); + + // Exit overview mode. Verify that app scaling is off now. + { + OverviewAnimationWaiter waiter; + Shell::Get()->overview_controller()->EndOverview(); + waiter.Wait(); + } + EXPECT_FALSE(hotseat_widget->is_forced_dense()); +} + } // namespace ash
diff --git a/ash/shelf/shelf_container_view.cc b/ash/shelf/shelf_container_view.cc index c81adac..9091efe 100644 --- a/ash/shelf/shelf_container_view.cc +++ b/ash/shelf/shelf_container_view.cc
@@ -23,8 +23,18 @@ AddChildView(shelf_view_); } +gfx::Size ShelfContainerView::CalculateIdealSize(int button_size) const { + const int button_strip_size = + ShelfView::GetSizeOfAppButtons(shelf_view_->last_visible_index() - + shelf_view_->first_visible_index() + 1, + button_size); + return shelf_view_->shelf()->IsHorizontalAlignment() + ? gfx::Size(button_strip_size, button_size) + : gfx::Size(button_size, button_strip_size); +} + gfx::Size ShelfContainerView::CalculatePreferredSize() const { - return CalculateIdealSize(); + return CalculateIdealSize(shelf_view_->GetButtonSize()); } void ShelfContainerView::ChildPreferredSizeChanged(views::View* child) { @@ -52,15 +62,4 @@ true); } -gfx::Size ShelfContainerView::CalculateIdealSize() const { - const int button_size = shelf_view_->GetButtonSize(); - const int width = - ShelfView::GetSizeOfAppButtons(shelf_view_->last_visible_index() - - shelf_view_->first_visible_index() + 1, - button_size); - return shelf_view_->shelf()->IsHorizontalAlignment() - ? gfx::Size(width, button_size) - : gfx::Size(button_size, width); -} - } // namespace ash
diff --git a/ash/shelf/shelf_container_view.h b/ash/shelf/shelf_container_view.h index 4f0892a..c5ea369 100644 --- a/ash/shelf/shelf_container_view.h +++ b/ash/shelf/shelf_container_view.h
@@ -18,6 +18,10 @@ void Initialize(); + // Calculates the ideal size of |shelf_view_| to accommodate all of app + // buttons without scrolling. + gfx::Size CalculateIdealSize(int button_size) const; + // Translate |shelf_view_| by |offset|. // TODO(https://crbug.com/973481): now we implement ShelfView scrolling // through view translation, which is not as efficient as ScrollView. Redesign @@ -30,10 +34,6 @@ const char* GetClassName() const override; protected: - // Calculates the ideal size of |shelf_view_| to accommodate all of app icons - // without scrolling. - gfx::Size CalculateIdealSize() const; - // Owned by views hierarchy. ShelfView* shelf_view_ = nullptr;
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 8435052..63306072 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -58,6 +58,7 @@ #include "ash/shelf/test/shelf_layout_manager_test_base.h" #include "ash/shelf/test/widget_animation_waiter.h" #include "ash/shell.h" +#include "ash/shell_state.h" #include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget_test_helper.h" #include "ash/system/unified/unified_system_tray.h" @@ -3472,6 +3473,37 @@ EXPECT_EQ(display_2.bounds().CenterPoint().x(), app_center_2.x()); } +// Verifies that showing the system tray view on the secondary display +// should not affect the auto-hide shelf on the primary display +// (https://crbug.com/1079464). +TEST_F(ShelfLayoutManagerTest, VerifyAutoHideBehaviorOnMultipleDisplays) { + UpdateDisplay("800x600, 800x600"); + Shelf* shelf = GetPrimaryShelf(); + shelf->SetAutoHideBehavior(ShelfAutoHideBehavior::kAlways); + CreateTestWidget(); + + // The primary shelf should be hidden. + ASSERT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); + ASSERT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); + + // Set focus on the secondary display. + aura::Window* secondary_root_window = + Shell::GetRootWindowForDisplayId(GetSecondaryDisplay().id()); + Shell::Get()->shell_state()->SetRootWindowForNewWindows( + secondary_root_window); + + // Show the system tray on the secondary display. + Shell::Get()->accelerator_controller()->PerformActionIfEnabled( + TOGGLE_SYSTEM_TRAY_BUBBLE, {}); + Shelf* secondary_shelf = + RootWindowController::ForWindow(secondary_root_window)->shelf(); + ASSERT_TRUE(secondary_shelf->status_area_widget()->IsMessageBubbleShown()); + ASSERT_FALSE(GetPrimaryUnifiedSystemTray()->IsBubbleShown()); + + // Verify that the primary shelf is still hidden. + EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); +} + // Tests that pinned app icons are visible on non-primary displays. TEST_F(ShelfLayoutManagerTest, ShelfShowsPinnedAppsOnOtherDisplays) { // Create three displays.
diff --git a/ash/system/status_area_widget.cc b/ash/system/status_area_widget.cc index 1e2294d..2c7ec1b 100644 --- a/ash/system/status_area_widget.cc +++ b/ash/system/status_area_widget.cc
@@ -34,6 +34,27 @@ namespace ash { +//////////////////////////////////////////////////////////////////////////////// +// StatusAreaWidget::ScopedTrayBubbleCounter + +StatusAreaWidget::ScopedTrayBubbleCounter::ScopedTrayBubbleCounter( + StatusAreaWidget* status_area_widget) + : status_area_widget_(status_area_widget->weak_ptr_factory_.GetWeakPtr()) { + ++status_area_widget_->tray_bubble_count_; +} + +StatusAreaWidget::ScopedTrayBubbleCounter::~ScopedTrayBubbleCounter() { + // ScopedTrayBubbleCounter may live longer than StatusAreaWidget. + if (!status_area_widget_) + return; + + --status_area_widget_->tray_bubble_count_; + DCHECK_GE(status_area_widget_->tray_bubble_count_, 0); +} + +//////////////////////////////////////////////////////////////////////////////// +// StatusAreaWidget + StatusAreaWidget::StatusAreaWidget(aura::Window* status_container, Shelf* shelf) : status_area_widget_delegate_(new StatusAreaWidgetDelegate(shelf)), shelf_(shelf) { @@ -104,6 +125,11 @@ Shell::Get()->session_controller()->RemoveObserver(this); } +// static +StatusAreaWidget* StatusAreaWidget::ForWindow(aura::Window* window) { + return Shelf::ForWindow(window)->status_area_widget(); +} + void StatusAreaWidget::UpdateAfterLoginStatusChange(LoginStatus login_status) { if (login_status_ == login_status) return; @@ -358,8 +384,9 @@ if (unified_system_tray_->IsSliderBubbleShown()) return false; - // All other tray bubbles will force the shelf to be visible. - return TrayBubbleView::IsATrayBubbleOpen(); + // All other tray bubbles on the same display with status area widget will + // force the shelf to be visible. + return tray_bubble_count_ > 0; } bool StatusAreaWidget::IsMessageBubbleShown() const {
diff --git a/ash/system/status_area_widget.h b/ash/system/status_area_widget.h index 5b6e1df..4d90e38 100644 --- a/ash/system/status_area_widget.h +++ b/ash/system/status_area_widget.h
@@ -11,6 +11,7 @@ #include "ash/session/session_observer.h" #include "ash/shelf/shelf_component.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "ui/views/widget/widget.h" namespace aura { @@ -43,9 +44,21 @@ // applicable in in-app tablet mode. Otherwise the state is NOT_COLLAPSIBLE. enum class CollapseState { NOT_COLLAPSIBLE, COLLAPSED, EXPANDED }; + class ScopedTrayBubbleCounter { + public: + explicit ScopedTrayBubbleCounter(StatusAreaWidget* status_area_widget); + ~ScopedTrayBubbleCounter(); + + private: + base::WeakPtr<StatusAreaWidget> status_area_widget_; + }; + StatusAreaWidget(aura::Window* status_container, Shelf* shelf); ~StatusAreaWidget() override; + // Returns the status area widget for the display that |window| is on. + static StatusAreaWidget* ForWindow(aura::Window* window); + // Creates the child tray views, initializes them, and shows the widget. Not // part of the constructor because some child views call back into this object // during construction. @@ -200,6 +213,12 @@ bool initialized_ = false; + // Number of active tray bubbles on the display where status area widget + // lives. + int tray_bubble_count_ = 0; + + base::WeakPtrFactory<StatusAreaWidget> weak_ptr_factory_{this}; + DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); };
diff --git a/ash/system/tray/tray_bubble_view.cc b/ash/system/tray/tray_bubble_view.cc index 13a055c0a..1977170 100644 --- a/ash/system/tray/tray_bubble_view.cc +++ b/ash/system/tray/tray_bubble_view.cc
@@ -61,10 +61,6 @@ } } -// Only one TrayBubbleView is visible at a time, but there are cases where the -// lifetimes of two different bubbles can overlap briefly. -int g_current_tray_bubble_showing_count_ = 0; - // Detects any mouse movement. This is needed to detect mouse movements by the // user over the bubble if the bubble got created underneath the cursor. class MouseMoveDetectorHost : public views::MouseWatcherHost { @@ -281,17 +277,14 @@ } } -// static -bool TrayBubbleView::IsATrayBubbleOpen() { - return g_current_tray_bubble_showing_count_ > 0; -} - void TrayBubbleView::InitializeAndShowBubble() { GetWidget()->Show(); UpdateBubble(); - if (IsAnchoredToStatusArea()) - ++g_current_tray_bubble_showing_count_; + if (IsAnchoredToStatusArea()) { + tray_bubble_counter_.emplace( + StatusAreaWidget::ForWindow(GetWidget()->GetNativeView())); + } // If TrayBubbleView cannot be activated and is shown by clicking on the // corresponding tray view, register pre target event handler to reroute key @@ -380,11 +373,8 @@ BubbleDialogDelegateView::OnWidgetClosing(widget); - if (IsAnchoredToStatusArea()) { - --g_current_tray_bubble_showing_count_; - } - DCHECK_GE(g_current_tray_bubble_showing_count_, 0) - << "Closing " << widget->GetName(); + if (IsAnchoredToStatusArea()) + tray_bubble_counter_.reset(); } void TrayBubbleView::OnWidgetActivationChanged(Widget* widget, bool active) {
diff --git a/ash/system/tray/tray_bubble_view.h b/ash/system/tray/tray_bubble_view.h index bfcd2477..2d315a46 100644 --- a/ash/system/tray/tray_bubble_view.h +++ b/ash/system/tray/tray_bubble_view.h
@@ -9,6 +9,7 @@ #include "ash/ash_export.h" #include "ash/public/cpp/shelf_types.h" +#include "ash/system/status_area_widget.h" #include "base/macros.h" #include "base/optional.h" #include "ui/accessibility/ax_enums.mojom-forward.h" @@ -102,9 +103,6 @@ explicit TrayBubbleView(const InitParams& init_params); ~TrayBubbleView() override; - // Returns whether a tray bubble is active. - static bool IsATrayBubbleOpen(); - // Sets up animations, and show the bubble. Must occur after CreateBubble() // is called. void InitializeAndShowBubble(); @@ -235,6 +233,9 @@ // keyboard. std::unique_ptr<EventHandler> reroute_event_handler_; + base::Optional<StatusAreaWidget::ScopedTrayBubbleCounter> + tray_bubble_counter_; + DISALLOW_COPY_AND_ASSIGN(TrayBubbleView); };
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h index a6c1830f..4ef63e8 100644 --- a/base/memory/ref_counted.h +++ b/base/memory/ref_counted.h
@@ -268,9 +268,11 @@ // ~MyFoo(); // }; // -// You should always make your destructor non-public, to avoid any code deleting -// the object accidently while there are references to it. -// +// Usage Notes: +// 1. You should always make your destructor non-public, to avoid any code +// deleting the object accidentally while there are references to it. +// 2. You should always make the ref-counted base class a friend of your class, +// so that it can access the destructor. // // The ref count manipulation to RefCounted is NOT thread safe and has DCHECKs // to trap unsafe cross thread usage. A subclass instance of RefCounted can be
diff --git a/base/values.cc b/base/values.cc index af40853..4315dbc 100644 --- a/base/values.cc +++ b/base/values.cc
@@ -541,6 +541,10 @@ return SetKeyInternal(key, std::make_unique<Value>(value)); } +Value* Value::SetStringKey(StringPiece key, StringPiece16 value) { + return SetKeyInternal(key, std::make_unique<Value>(value)); +} + Value* Value::SetStringKey(StringPiece key, const char* value) { return SetKeyInternal(key, std::make_unique<Value>(value)); } @@ -549,10 +553,6 @@ return SetKeyInternal(key, std::make_unique<Value>(std::move(value))); } -Value* Value::SetStringKey(StringPiece key, StringPiece16 value) { - return SetKeyInternal(key, std::make_unique<Value>(value)); -} - bool Value::RemoveKey(StringPiece key) { CHECK(is_dict()); return dict_.erase(key) != 0;
diff --git a/base/values.h b/base/values.h index f436cbbe..8d1ede3f 100644 --- a/base/values.h +++ b/base/values.h
@@ -305,11 +305,11 @@ Value* SetIntKey(StringPiece key, int val); Value* SetDoubleKey(StringPiece key, double val); Value* SetStringKey(StringPiece key, StringPiece val); - // NOTE: These two overloads are provided as performance / code generation - // optimizations. + Value* SetStringKey(StringPiece key, StringPiece16 val); + // NOTE: The following two overloads are provided as performance / code + // generation optimizations. Value* SetStringKey(StringPiece key, const char* val); Value* SetStringKey(StringPiece key, std::string&& val); - Value* SetStringKey(StringPiece key, StringPiece16 val); // This attempts to remove the value associated with |key|. In case of // failure, e.g. the key does not exist, false is returned and the underlying
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index c0de38f..edbee8e 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -8907,23 +8907,29 @@ // Frame 3 and 4 are counted. See the sequence in DidCommit comment for // normal case that expects 2 for both frames_expected and frames_produced. // - // However, on slow bots, begin frame could be skipped but still counted as - // expected frames, like the following: + // However, on slow bots, things could be different. + // - Begin frame could be skipped but still counted as expected frames, // - // e(5,5)b(8)B(0,8)E(8)s(3)S(8)e(8,8)b(11) - // B(8,11)E(11)ts(4)S(11)e(11,11)P(3)e(14,14)P(4) + // e(5,5)b(8)B(0,8)E(8)s(3)S(8)e(8,8)b(11) + // B(8,11)E(11)ts(4)S(11)e(11,11)P(3)e(14,14)P(4) // - // B(0, 8) and B(8, 11) make frame_expected to be 4, more than 2 expected by - // test. + // B(0, 8) and B(8, 11) make frame_expected to be 4, more than 2 expected + // by test. + // + // - Finish before frame 4 is presented in multi-thread mode. + // + // e(3,3)b(4)B(0,4)E(4)s(2)e(4,4)b(6)B(4,6)E(6)s(3)S(4)e(6,6) + // P(2)e(7,7)P(3) + // + // Only P(3) is counted thus frames_produced is 1. EXPECT_GE(throughput.frames_expected, 2u); - EXPECT_EQ(throughput.frames_produced, 2u); + EXPECT_GE(throughput.frames_produced, 1u); EndTest(); } }; -// TODO(crbug.com/1021774): Revisit after hooking up threaded code path. -SINGLE_THREAD_TEST_F(LayerTreeHostCustomThrougputTrackerTest); +SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCustomThrougputTrackerTest); } // namespace } // namespace cc
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 949fb7b..544ad63 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -536,8 +536,10 @@ } void ProxyImpl::NotifyThroughputTrackerResults(CustomTrackerResults results) { - // TODO(crbug.com/1021774): Hookup threaded code path via ProxyMain. - NOTREACHED(); + DCHECK(IsImplThread()); + MainThreadTaskRunner()->PostTask( + FROM_HERE, base::BindOnce(&ProxyMain::NotifyThroughputTrackerResults, + proxy_main_weak_ptr_, std::move(results))); } bool ProxyImpl::WillBeginImplFrame(const viz::BeginFrameArgs& args) {
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc index 5fb3d5c..22976f6 100644 --- a/cc/trees/proxy_main.cc +++ b/cc/trees/proxy_main.cc
@@ -374,6 +374,10 @@ feedback); } +void ProxyMain::NotifyThroughputTrackerResults(CustomTrackerResults results) { + layer_tree_host_->NotifyThroughputTrackerResults(std::move(results)); +} + bool ProxyMain::IsStarted() const { DCHECK(IsMainThread()); return started_;
diff --git a/cc/trees/proxy_main.h b/cc/trees/proxy_main.h index 27d960b..8738cb1f 100644 --- a/cc/trees/proxy_main.h +++ b/cc/trees/proxy_main.h
@@ -57,6 +57,7 @@ uint32_t frame_token, std::vector<LayerTreeHost::PresentationTimeCallback> callbacks, const gfx::PresentationFeedback& feedback); + void NotifyThroughputTrackerResults(CustomTrackerResults results); CommitPipelineStage max_requested_pipeline_stage() const { return max_requested_pipeline_stage_;
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 64f438e3..37f2ba4 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -86,6 +86,18 @@ "$root_build_dir/gen/chrome/browser/android/chrome_jni_registration.h" chrome_jni_for_test_registration_header = "$root_build_dir/gen/chrome/browser/android/chrome_jni_for_test_registration.h" +# Chosen to match what CQ bots exist. +_enable_libs_and_assets_verification = + !is_component_build && + ((target_cpu == "arm" && android_channel == "stable") || + (target_cpu == "arm64" && android_channel == "default")) + +# Having //clank present causes different flags because of how play services +# is wired up. +# The channel is required because manifest entries vary based on channel. +_enable_manifest_verification = + !enable_chrome_android_internal && android_channel == "stable" + jinja_template("chrome_public_android_manifest") { input = "java/AndroidManifest.xml" output = chrome_public_android_manifest @@ -1953,18 +1965,8 @@ chrome_target = ":trichrome_chrome_bundle" } - if (!is_component_build && (target_cpu == "arm" || target_cpu == "arm64")) { - verify_native_libs_and_assets = true - } - - # Having //clank present causes different flags because of how play services - # is wired up. - # The channel is required because manifest entries vary based on channel. - _verify_android_configuration = - !enable_chrome_android_internal && android_channel == "stable" - if (_verify_android_configuration) { - verify_manifest = true - } + verify_manifest = _enable_manifest_verification + verify_native_libs_and_assets = _enable_libs_and_assets_verification } if (android_64bit_target_cpu) { @@ -2465,9 +2467,8 @@ min_sdk_version = 21 module_descs = chrome_modern_module_descs version_code = chrome_modern_version_code - if (!is_component_build && (target_cpu == "arm" || target_cpu == "arm64")) { - verify_native_libs_and_assets = true - } + + verify_native_libs_and_assets = _enable_libs_and_assets_verification } if (is_official_build) { @@ -2597,18 +2598,10 @@ include_64_bit_webview = true } - if (!is_component_build && (target_cpu == "arm" || target_cpu == "arm64")) { - verify_native_libs_and_assets = true - } - - # Having //clank present causes different flags because of how play services - # is wired up. - # The channel is required because manifest entries vary based on channel. - _verify_android_configuration = - !enable_chrome_android_internal && android_channel == "stable" - if (_verify_android_configuration) { - verify_manifest = true - verify_proguard_flags = true + verify_manifest = _enable_manifest_verification + verify_native_libs_and_assets = _enable_libs_and_assets_verification + if (!is_java_debug) { + verify_proguard_flags = _enable_manifest_verification } } @@ -2639,18 +2632,9 @@ is_64_bit_browser = false include_64_bit_webview = true } - if (!is_component_build && (target_cpu == "arm" || target_cpu == "arm64")) { - verify_native_libs_and_assets = true - } - # Having //clank present causes different flags because of how play services - # is wired up. - # The channel is required because manifest entries vary based on channel. - _verify_android_configuration = - !enable_chrome_android_internal && android_channel == "stable" - if (_verify_android_configuration) { - verify_manifest = true - } + verify_manifest = _enable_manifest_verification + verify_native_libs_and_assets = _enable_libs_and_assets_verification } if (android_64bit_target_cpu) { @@ -3016,6 +3000,7 @@ "native_java_unittests/src/org/chromium/chrome/browser/installedapp/InstalledAppProviderTest.java", "native_java_unittests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeUnitTest.java", "native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java", + "native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResultUnitTest.java", "native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java", "native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/clipboard/ClipboardSuggestionProcessorTest.java", "native_java_unittests/src/org/chromium/chrome/browser/omnibox/status/StatusMediatorUnitTest.java", @@ -3073,6 +3058,7 @@ sources = [ "native_java_unittests/src/org/chromium/chrome/browser/UnitTestUtils.java", + "native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionBuilderForTest.java", ] sources += native_java_unittests_tests
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index 479fc65..123f54fc 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -1387,7 +1387,6 @@ "java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java", "java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java", "java/src/org/chromium/chrome/browser/settings/HyperlinkPreference.java", - "java/src/org/chromium/chrome/browser/settings/LearnMorePreference.java", "java/src/org/chromium/chrome/browser/settings/MainSettings.java", "java/src/org/chromium/chrome/browser/settings/SettingsActivity.java", "java/src/org/chromium/chrome/browser/settings/SettingsLauncherImpl.java",
diff --git a/chrome/android/features/autofill_assistant/java/DEPS b/chrome/android/features/autofill_assistant/java/DEPS index 37154db7..26ed26e 100644 --- a/chrome/android/features/autofill_assistant/java/DEPS +++ b/chrome/android/features/autofill_assistant/java/DEPS
@@ -2,6 +2,7 @@ "+chrome/browser/image_fetcher", "+chrome/browser/ui/messages/android/java", "+components/autofill/android", + "+components/browser_ui/settings/android/java", "+components/browser_ui/widget/android", "+content/public/android/java/src/org/chromium/content_public/browser", "+content/public/android/java/src/org/chromium/content/browser/input",
diff --git a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java index 4e6d90a..e486106 100644 --- a/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java +++ b/chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/header/AssistantHeaderViewBinder.java
@@ -16,10 +16,10 @@ import org.chromium.chrome.browser.autofill_assistant.AssistantTextUtils; import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChip; import org.chromium.chrome.browser.autofill_assistant.carousel.AssistantChipViewHolder; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; import org.chromium.chrome.browser.util.AccessibilityUtil; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.widget.textbubble.TextBubble; import org.chromium.ui.modelutil.PropertyKey; import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
diff --git a/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java b/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java index de67104..1b5e4103 100644 --- a/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java +++ b/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java
@@ -66,7 +66,7 @@ @Before public void setUp() throws InterruptedException { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); ManualFillingTestHelper.disableServerPredictions(); mHelper.loadTestPage(FORM_URL, false); }
diff --git a/chrome/android/java/monochrome_public_bundle.proguard_flags.expected b/chrome/android/java/monochrome_public_bundle.proguard_flags.expected index c9e68901..2cd283a 100644 --- a/chrome/android/java/monochrome_public_bundle.proguard_flags.expected +++ b/chrome/android/java/monochrome_public_bundle.proguard_flags.expected
@@ -536,14 +536,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Ensure that reflectively-loaded inflater is not obfuscated. This can be -# removed when we stop supporting AAPT1 builds. --keepnames class androidx.appcompat.app.AppCompatViewInflater - # aapt is not able to read app::actionViewClass and app:actionProviderClass to produce proguard # keep rules. Add a commonly used SearchView to the keep list until b/109831488 is resolved. -keep class androidx.appcompat.widget.SearchView { <init>(...); } +# Never inline methods, but allow shrinking and obfuscation. +-keepclassmembernames,allowobfuscation,allowshrinking class androidx.appcompat.widget.AppCompatTextViewAutoSizeHelper$Impl* { + <methods>; +} + ################################################################################ # obj/third_party/android_deps/androidx_media_media_java/proguard.txt ################################################################################ @@ -596,6 +597,27 @@ } ################################################################################ +# obj/third_party/android_deps/androidx_savedstate_savedstate_java/proguard.txt +################################################################################ +# Copyright (C) 2019 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +-keepclassmembers,allowobfuscation class * implements androidx.savedstate.SavedStateRegistry$AutoRecreated { + <init>(); +} + +################################################################################ # obj/third_party/android_deps/androidx_transition_transition_java/proguard.txt ################################################################################ # Copyright (C) 2017 The Android Open Source Project @@ -643,7 +665,7 @@ ################################################################################ # obj/third_party/android_deps/androidx_versionedparcelable_versionedparcelable_java/proguard.txt ################################################################################ --keep public class * extends androidx.versionedparcelable.VersionedParcelable +-keep public class * implements androidx.versionedparcelable.VersionedParcelable -keep public class android.support.**Parcelizer { *; } -keep public class androidx.**Parcelizer { *; } -keep public class androidx.versionedparcelable.ParcelImpl
diff --git a/chrome/android/java/res/layout/new_tab_page_snippets_expandable_header_with_menu.xml b/chrome/android/java/res/layout/new_tab_page_snippets_expandable_header_with_menu.xml index 8e813247e..4f9b262 100644 --- a/chrome/android/java/res/layout/new_tab_page_snippets_expandable_header_with_menu.xml +++ b/chrome/android/java/res/layout/new_tab_page_snippets_expandable_header_with_menu.xml
@@ -24,10 +24,10 @@ <org.chromium.components.browser_ui.widget.listmenu.ListMenuButton android:id="@+id/header_menu" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="@dimen/default_list_row_padding" - android:paddingEnd="@dimen/default_list_row_padding" + android:layout_width="48dp" + android:layout_height="48dp" + android:scaleType="fitXY" + android:padding="15dp" android:background="@null" android:src="@drawable/ic_more_vert_24dp" app:tint="@color/default_icon_color_tint_list"
diff --git a/chrome/android/java/res/xml/data_reduction_preferences_off_lite_mode.xml b/chrome/android/java/res/xml/data_reduction_preferences_off_lite_mode.xml index 0dd3ca89..91992a7 100644 --- a/chrome/android/java/res/xml/data_reduction_preferences_off_lite_mode.xml +++ b/chrome/android/java/res/xml/data_reduction_preferences_off_lite_mode.xml
@@ -14,7 +14,7 @@ android:title="@string/data_reduction_description_lite_mode" app:allowDividerBelow="false" /> - <org.chromium.chrome.browser.settings.LearnMorePreference + <org.chromium.components.browser_ui.settings.LearnMorePreference android:key="data_reduction_learn_more" app:allowDividerBelow="false" /> </PreferenceScreen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 3b63d511af..f4d3573b9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -117,7 +117,6 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.printing.TabPrinter; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.share.ShareDelegateImpl; @@ -160,6 +159,7 @@ import org.chromium.chrome.modules.image_editor.ImageEditorModuleProvider; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.browser_ui.modaldialog.AppModalPresenter; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.util.ComposedBrowserControlsVisibilityDelegate; import org.chromium.components.browser_ui.widget.InsetObserverView; import org.chromium.components.browser_ui.widget.MenuOrKeyboardActionController;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfileBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfileBridge.java index 73c4c46..a41a0e3a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfileBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfileBridge.java
@@ -14,8 +14,8 @@ import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.NativeMethods; import org.chromium.base.metrics.RecordUserAction; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.content_public.browser.WebContents; import java.lang.annotation.Retention;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivitySettingsLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivitySettingsLauncher.java index 0bf2459..5be7cbff 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivitySettingsLauncher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivitySettingsLauncher.java
@@ -11,8 +11,8 @@ import org.chromium.base.Log; import org.chromium.chrome.R; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SettingsNavigationSource; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPromoControl.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPromoControl.java index 226aa939..34d3264 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPromoControl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPromoControl.java
@@ -23,8 +23,8 @@ import org.chromium.chrome.browser.compositor.bottombar.OverlayPanelInflater; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.contextualsearch.ContextualSearchPreferenceFragment; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.ui.base.LocalizationUtils; import org.chromium.ui.resources.dynamics.DynamicResourceLoader; import org.chromium.ui.text.NoUnderlineClickableSpan;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityNavigationController.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityNavigationController.java index e5244739..bb6fd6c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityNavigationController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/content/CustomTabActivityNavigationController.java
@@ -259,8 +259,8 @@ StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { - willChromeHandleIntent |= ExternalNavigationDelegateImpl - .willChromeHandleIntent(intent, true); + willChromeHandleIntent |= + ExternalNavigationDelegateImpl.willChromeHandleIntent(intent, true); } finally { StrictMode.setThreadPolicy(oldPolicy); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/datareduction/DataReductionMainMenuItem.java b/chrome/android/java/src/org/chromium/chrome/browser/datareduction/DataReductionMainMenuItem.java index c9c257e..26e2b6c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/datareduction/DataReductionMainMenuItem.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/datareduction/DataReductionMainMenuItem.java
@@ -20,8 +20,8 @@ import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker; import org.chromium.third_party.android.datausagechart.ChartDataUsageView;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactoryHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactoryHelper.java index 2dcf398..b7a7b2da 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactoryHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactoryHelper.java
@@ -12,9 +12,9 @@ import org.chromium.chrome.browser.download.settings.DownloadSettings; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.ui.modaldialog.ModalDialogManager; /** A helper class to build and return an {@link DownloadManagerCoordinator}. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java index 59e2b95..46d08b61 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
@@ -108,7 +108,7 @@ } @Override - public boolean willChromeHandleIntent(Intent intent) { + public boolean willAppHandleIntent(Intent intent) { return willChromeHandleIntent(intent, false); } @@ -251,7 +251,7 @@ } @Override - public boolean isChromeAppInForeground() { + public boolean isApplicationInForeground() { return ApplicationStatus.getStateForApplication() == ApplicationState.HAS_RUNNING_ACTIVITIES; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunSignInProcessor.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunSignInProcessor.java index 945006c..f410822e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunSignInProcessor.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunSignInProcessor.java
@@ -15,7 +15,6 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.signin.SigninManager; @@ -24,6 +23,7 @@ import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.chrome.browser.sync.settings.ManageSyncSettings; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.signin.AccountManagerFacadeProvider; import org.chromium.components.signin.AccountUtils; import org.chromium.components.signin.metrics.SigninAccessPoint;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java index 2ceda3d..040e075 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
@@ -38,7 +38,6 @@ import org.chromium.chrome.browser.preferences.PrefChangeRegistrar.PrefObserver; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.signin.SigninManager.SignInStateObserver; @@ -50,6 +49,7 @@ import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController; import org.chromium.chrome.browser.util.AccessibilityUtil; import org.chromium.chrome.browser.vr.VrModeProviderImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.util.ConversionUtils; import org.chromium.components.browser_ui.widget.selectable_list.SelectableListLayout; import org.chromium.components.browser_ui.widget.selectable_list.SelectableListToolbar.SearchDelegate;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java b/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java index 768e14b..c3d3f60 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/identity_disc/IdentityDiscController.java
@@ -22,7 +22,6 @@ import org.chromium.chrome.browser.lifecycle.NativeInitObserver; import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.signin.ProfileDataCache; @@ -32,6 +31,7 @@ import org.chromium.chrome.browser.toolbar.ButtonDataProvider; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarVariationManager; import org.chromium.chrome.browser.user_education.IPHCommandBuilder; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.FeatureConstants; import org.chromium.components.feature_engagement.Tracker;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java index 313d1db..f4a178be 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java
@@ -8,11 +8,11 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.R; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.ui.messages.infobar.ConfirmInfoBar; import org.chromium.chrome.browser.ui.messages.infobar.InfoBarCompactLayout; import org.chromium.chrome.browser.ui.messages.infobar.InfoBarLayout; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.permissions.AndroidPermissionRequester;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsLitePageInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsLitePageInfoBar.java index 8fe2c668..33a7015 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsLitePageInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/PreviewsLitePageInfoBar.java
@@ -9,10 +9,10 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.R; import org.chromium.chrome.browser.datareduction.settings.DataReductionPreferenceFragment; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.ui.messages.infobar.ConfirmInfoBar; import org.chromium.chrome.browser.ui.messages.infobar.InfoBar; +import org.chromium.components.browser_ui.settings.SettingsLauncher; /** * An InfoBar that lets the user know that Data Saver Lite Mode now also applies to HTTPS pages.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java index 5ff414b..4dc2540 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBar.java
@@ -9,10 +9,10 @@ import org.chromium.base.ContextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.R; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.ui.messages.infobar.InfoBar; import org.chromium.chrome.browser.ui.messages.infobar.InfoBarLayout; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBar.java index c8f814a..2e8aea0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBar.java
@@ -19,7 +19,6 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; @@ -28,6 +27,7 @@ import org.chromium.chrome.browser.ui.messages.infobar.ConfirmInfoBar; import org.chromium.chrome.browser.ui.messages.infobar.InfoBar; import org.chromium.chrome.browser.ui.messages.infobar.InfoBarLayout; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.content_public.browser.WebContents; import java.lang.annotation.Retention;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java index 272fb7a..d77ed995 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java
@@ -15,9 +15,9 @@ import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.settings.SettingsUtils; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java b/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java index ab35774..cf802ccf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java
@@ -28,13 +28,13 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController; import org.chromium.chrome.browser.vr.OnExitVrRequestListener; import org.chromium.chrome.browser.vr.VrModuleProvider; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.widget.PromoDialog; import org.chromium.components.search_engines.TemplateUrl; import org.chromium.ui.base.PageTransition;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/locale/SogouPromoDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/locale/SogouPromoDialog.java index 662a21fd..eb02710 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/locale/SogouPromoDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/locale/SogouPromoDialog.java
@@ -23,8 +23,8 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.widget.PromoDialog; import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.SpanApplier;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java index 64f6814..a590b0d0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
@@ -38,7 +38,6 @@ import org.chromium.chrome.browser.notifications.channels.SiteChannelsManager; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefServiceBridge; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.usage_stats.NotificationSuspender; import org.chromium.chrome.browser.webapps.ChromeWebApkHost; @@ -48,6 +47,7 @@ import org.chromium.components.browser_ui.notifications.NotificationManagerProxyImpl; import org.chromium.components.browser_ui.notifications.NotificationMetadata; import org.chromium.components.browser_ui.notifications.PendingIntentProvider; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java index 28a8505..ea2df64 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoCookieControlsManager.java
@@ -11,10 +11,10 @@ import org.chromium.base.ObserverList; import org.chromium.chrome.R; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.site_settings.CookieControlsServiceBridge; import org.chromium.chrome.browser.site_settings.CookieControlsServiceBridge.CookieControlsServiceObserver; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.content_settings.ContentSettingsFeatureList;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchedPagesNotifier.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchedPagesNotifier.java index 1b198d39..49a3944 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchedPagesNotifier.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchedPagesNotifier.java
@@ -21,7 +21,6 @@ import org.chromium.chrome.browser.notifications.NotificationUmaTracker; import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; import org.chromium.chrome.browser.notifications.settings.NotificationSettings; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.components.browser_ui.notifications.ChromeNotification; import org.chromium.components.browser_ui.notifications.ChromeNotificationBuilder; @@ -29,6 +28,7 @@ import org.chromium.components.browser_ui.notifications.NotificationManagerProxyImpl; import org.chromium.components.browser_ui.notifications.NotificationMetadata; import org.chromium.components.browser_ui.notifications.PendingIntentProvider; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.content_public.browser.BrowserStartupController; import org.chromium.content_public.browser.BrowserStartupController.StartupCallback;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java index 996e0a8..a72b9e8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediator.java
@@ -10,7 +10,6 @@ import android.os.Handler; import android.os.SystemClock; import android.text.TextUtils; -import android.util.SparseArray; import android.view.View; import androidx.annotation.IntDef; @@ -140,8 +139,8 @@ private @Nullable EditUrlSuggestionProcessor mEditUrlProcessor; private final TileSuggestionProcessor mTileSuggestionProcessor; private final List<SuggestionProcessor> mSuggestionProcessors; + private AutocompleteResult mAutocompleteResult; private final List<SuggestionViewInfo> mAvailableSuggestions; - private SparseArray<String> mGroupHeaders; private ToolbarDataProvider mDataProvider; private OverviewModeBehavior mOverviewModeBehavior; @@ -216,7 +215,7 @@ new TileSuggestionProcessor(mContext, queryTileSuggestionCallback); mSuggestionProcessors = new ArrayList<>(); mAvailableSuggestions = new ArrayList<>(); - mGroupHeaders = new SparseArray<>(); + mAutocompleteResult = new AutocompleteResult(null, null); mOverviewModeObserver = new EmptyOverviewModeObserver() { @Override @@ -1036,34 +1035,11 @@ */ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) boolean setNewSuggestions(AutocompleteResult autocompleteResult) { - final List<OmniboxSuggestion> newSuggestions = autocompleteResult.getSuggestionsList(); - boolean sameSuggestions = false; + if (mAutocompleteResult.equals(autocompleteResult)) return false; + mAutocompleteResult = autocompleteResult; + + final List<OmniboxSuggestion> newSuggestions = mAutocompleteResult.getSuggestionsList(); final int newSuggestionsCount = newSuggestions.size(); - if (mAvailableSuggestions.size() == newSuggestionsCount) { - sameSuggestions = true; - for (int i = 0; i < newSuggestionsCount; i++) { - OmniboxSuggestion existingSuggestion = mAvailableSuggestions.get(i).suggestion; - if (!existingSuggestion.equals(newSuggestions.get(i))) { - sameSuggestions = false; - break; - } - } - } - - final SparseArray<String> newGroupHeaders = autocompleteResult.getGroupHeaders(); - final int newHeadersCount = newGroupHeaders.size(); - sameSuggestions &= newHeadersCount == mGroupHeaders.size(); - if (sameSuggestions) { - for (int i = 0; i < mGroupHeaders.size(); i++) { - final int key = mGroupHeaders.keyAt(i); - if (!TextUtils.equals(newGroupHeaders.get(key), mGroupHeaders.get(key))) { - sameSuggestions = false; - break; - } - } - } - - if (sameSuggestions) return false; mAvailableSuggestions.clear(); for (int index = 0; index < newSuggestionsCount; index++) { @@ -1073,13 +1049,12 @@ mAvailableSuggestions.add(new SuggestionViewInfo(processor, suggestion)); } - mGroupHeaders = newGroupHeaders; return true; } @NonNull - SparseArray<String> getGroupHeaders() { - return mGroupHeaders; + AutocompleteResult getAutocompleteResult() { + return mAutocompleteResult; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResult.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResult.java index df06314..0f105cee 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResult.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResult.java
@@ -7,6 +7,7 @@ import android.util.SparseArray; import androidx.annotation.NonNull; +import androidx.core.util.ObjectsCompat; import java.util.ArrayList; import java.util.List; @@ -39,4 +40,35 @@ SparseArray<String> getGroupHeaders() { return mGroupHeaders; } + + @Override + public boolean equals(Object otherObj) { + if (otherObj == this) return true; + if (!(otherObj instanceof AutocompleteResult)) return false; + + AutocompleteResult other = (AutocompleteResult) otherObj; + if (!mSuggestions.equals(other.mSuggestions)) return false; + + final SparseArray<String> otherHeaders = other.mGroupHeaders; + if (mGroupHeaders.size() != otherHeaders.size()) return false; + for (int index = 0; index < mGroupHeaders.size(); index++) { + if (mGroupHeaders.keyAt(index) != otherHeaders.keyAt(index)) return false; + if (!ObjectsCompat.equals(mGroupHeaders.valueAt(index), otherHeaders.valueAt(index))) { + return false; + } + } + + return true; + } + + @Override + public int hashCode() { + int baseHash = 0; + for (int index = 0; index < mGroupHeaders.size(); index++) { + baseHash += mGroupHeaders.keyAt(index); + baseHash ^= mGroupHeaders.valueAt(index).hashCode(); + baseHash = (baseHash << 10) | (baseHash >> 22); + } + return baseHash ^ mSuggestions.hashCode(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java index 411403c..3de872b2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java
@@ -90,7 +90,7 @@ suggestion.getPostContentType()); prefs.writeString(KEY_ZERO_SUGGEST_POST_CONTENT_DATA_PREFIX.createKey(i), suggestion.getPostData() == null - ? "" + ? null : Base64.encodeToString(suggestion.getPostData(), Base64.DEFAULT)); prefs.writeInt(KEY_ZERO_SUGGEST_GROUP_ID_PREFIX.createKey(i), suggestion.getGroupId()); } @@ -122,35 +122,36 @@ // previously cached answers for several releases while any previous // results are cycled through. String answerText = - prefs.readString(KEY_ZERO_SUGGEST_ANSWER_TEXT_PREFIX.createKey(i), ""); + prefs.readString(KEY_ZERO_SUGGEST_ANSWER_TEXT_PREFIX.createKey(i), null); if (!TextUtils.isEmpty(answerText)) continue; GURL url = GURL.deserialize( - prefs.readString(KEY_ZERO_SUGGEST_URL_PREFIX.createKey(i), "")); + prefs.readString(KEY_ZERO_SUGGEST_URL_PREFIX.createKey(i), null)); String displayText = - prefs.readString(KEY_ZERO_SUGGEST_DISPLAY_TEXT_PREFIX.createKey(i), ""); + prefs.readString(KEY_ZERO_SUGGEST_DISPLAY_TEXT_PREFIX.createKey(i), null); String description = - prefs.readString(KEY_ZERO_SUGGEST_DESCRIPTION_PREFIX.createKey(i), ""); - int nativeType = prefs.readInt(KEY_ZERO_SUGGEST_NATIVE_TYPE_PREFIX.createKey(i), -1); + prefs.readString(KEY_ZERO_SUGGEST_DESCRIPTION_PREFIX.createKey(i), null); + int nativeType = prefs.readInt(KEY_ZERO_SUGGEST_NATIVE_TYPE_PREFIX.createKey(i), + OmniboxSuggestion.INVALID_TYPE); boolean isSearchType = - prefs.readBoolean(KEY_ZERO_SUGGEST_IS_SEARCH_TYPE_PREFIX.createKey(i), true); + prefs.readBoolean(KEY_ZERO_SUGGEST_IS_SEARCH_TYPE_PREFIX.createKey(i), false); boolean isStarred = prefs.readBoolean(KEY_ZERO_SUGGEST_IS_STARRED_PREFIX.createKey(i), false); boolean isDeletable = prefs.readBoolean(KEY_ZERO_SUGGEST_IS_DELETABLE_PREFIX.createKey(i), false); String postContentType = - prefs.readString(KEY_ZERO_SUGGEST_POST_CONTENT_TYPE_PREFIX.createKey(i), ""); - byte[] postData = Base64.decode( - prefs.readString(KEY_ZERO_SUGGEST_POST_CONTENT_DATA_PREFIX.createKey(i), ""), - Base64.DEFAULT); + prefs.readString(KEY_ZERO_SUGGEST_POST_CONTENT_TYPE_PREFIX.createKey(i), null); + String postDataStr = + prefs.readString(KEY_ZERO_SUGGEST_POST_CONTENT_DATA_PREFIX.createKey(i), null); + byte[] postData = + postDataStr == null ? null : Base64.decode(postDataStr, Base64.DEFAULT); int groupId = prefs.readInt( KEY_ZERO_SUGGEST_GROUP_ID_PREFIX.createKey(i), OmniboxSuggestion.INVALID_GROUP); OmniboxSuggestion suggestion = new OmniboxSuggestion(nativeType, isSearchType, 0, 0, - displayText, classifications, description, classifications, null, "", url, - GURL.emptyGURL(), null, isStarred, isDeletable, - postContentType.isEmpty() ? null : postContentType, - postData.length == 0 ? null : postData, groupId, null); + displayText, classifications, description, classifications, null, null, url, + GURL.emptyGURL(), null, isStarred, isDeletable, postContentType, postData, + groupId, null); suggestions.add(suggestion); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestion.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestion.java index 30843a9..72d82d9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestion.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestion.java
@@ -24,6 +24,7 @@ @VisibleForTesting public class OmniboxSuggestion { public static final int INVALID_GROUP = -1; + public static final int INVALID_TYPE = -1; /** * Specifies the style of portions of the suggestion text.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java index 5d580f4..fb6111f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/ChromePageInfoControllerDelegate.java
@@ -61,7 +61,6 @@ public class ChromePageInfoControllerDelegate extends PageInfoControllerDelegate { private final WebContents mWebContents; private final Context mContext; - private final @PreviewPageState int mPreviewPageState; private String mOfflinePageCreationDate; private OfflinePageLoadUrlDelegate mOfflinePageLoadUrlDelegate; private PermissionParamsListBuilder mPermissionParamsListBuilder;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/SiteSettingsHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/SiteSettingsHelper.java index 15c2b40..0010379 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/SiteSettingsHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/SiteSettingsHelper.java
@@ -10,8 +10,8 @@ import org.chromium.base.StrictModeContext; import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; import org.chromium.chrome.browser.previews.PreviewsAndroidBridge; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; import org.chromium.components.embedder_support.util.UrlConstants;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java index 7e54b7c..9bdda804 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordManagerLauncher.java
@@ -15,10 +15,10 @@ import org.chromium.chrome.browser.password_manager.settings.PasswordSettings; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.PrefServiceBridge; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.sync.ProfileSyncService; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.sync.ModelType; import org.chromium.content_public.browser.WebContents; import org.chromium.ui.base.WindowAndroid;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordEditingBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordEditingBridge.java index 901e766..c8ed973 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordEditingBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordEditingBridge.java
@@ -9,8 +9,8 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.NativeMethods; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; /** * This is a bridge between PasswordEntryEditor and the C++ code. The bridge is in charge of
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java index 49c89e9..f216b052 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
@@ -34,13 +34,13 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.modules.cablev2_authenticator.CableAuthenticatorModuleProvider; import org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference; import org.chromium.components.browser_ui.settings.ChromeBasePreference; import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; import org.chromium.components.browser_ui.settings.SearchUtils; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.settings.TextMessagePreference; import org.chromium.ui.text.SpanApplier;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java index d098368..993c255 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -38,7 +38,6 @@ import org.chromium.chrome.browser.payments.ui.SectionInformation; import org.chromium.chrome.browser.payments.ui.ShoppingCart; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabSelectionType; @@ -54,6 +53,7 @@ import org.chromium.chrome.browser.widget.ScrimView.ScrimParams; import org.chromium.components.autofill.Completable; import org.chromium.components.autofill.EditableOption; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.page_info.CertificateChainHelper; import org.chromium.components.payments.CurrencyFormatter;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java index c8ecf68e..55e17f2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerCoordinator.java
@@ -64,7 +64,7 @@ /** * Shows the payment-handler UI. * - * @param chromeActivity The activity where the UI should be shown. + * @param activity The activity where the UI should be shown. * @param url The url of the payment handler app, i.e., that of * "PaymentRequestEvent.openWindow(url)". * @param isIncognito Whether the tab is in incognito mode. @@ -104,8 +104,8 @@ ThinWebView thinWebView = ThinWebViewFactory.create(activity, new ThinWebViewConstraints()); assert webContentView.getParent() == null; thinWebView.attachWebContents(mWebContents, webContentView, null); - PaymentHandlerView view = new PaymentHandlerView( - activity, mWebContents, mToolbarCoordinator.getView(), thinWebView.getView()); + PaymentHandlerView view = new PaymentHandlerView(activity, mWebContents, + mToolbarCoordinator.getView(), thinWebView.getView(), mediator); assert mToolbarCoordinator.getToolbarHeightPx() == view.getToolbarHeightPx(); PropertyModelChangeProcessor changeProcessor = PropertyModelChangeProcessor.create(model, view, PaymentHandlerViewBinder::bind);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java index 0e983ba3..96ab566 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerMediator.java
@@ -16,6 +16,7 @@ import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController.SheetState; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetObserver; +import org.chromium.content_public.browser.NavigationController; import org.chromium.content_public.browser.NavigationHandle; import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContentsObserver; @@ -26,7 +27,8 @@ * backend (the coordinator). */ /* package */ class PaymentHandlerMediator extends WebContentsObserver - implements BottomSheetObserver, PaymentHandlerToolbarObserver, View.OnLayoutChangeListener { + implements BottomSheetObserver, PaymentHandlerToolbarObserver, View.OnLayoutChangeListener, + PaymentHandlerView.PaymentHandlerViewObserver { // The value is picked in order to allow users to see the tab behind this UI. /* package */ static final float FULL_HEIGHT_RATIO = 0.9f; /* package */ static final float HALF_HEIGHT_RATIO = 0.5f; @@ -56,8 +58,8 @@ * @param webContents The web-contents that loads the payment app. * @param observer The {@link PaymentHandlerUiObserver} that observes this Payment Handler UI. * @param tabView The view of the main tab. - * @param toolbarView The height of the PaymentHandler toolbar view. - * @param containerTopPaddingPx The padding top of bottom_sheet_toolbar_container. + * @param toolbarViewHeightPx The height of the toolbar view in px. + * @param containerTopPaddingPx The padding top of bottom_sheet_toolbar_container in px */ /* package */ PaymentHandlerMediator(PropertyModel model, Runnable hider, WebContents webContents, PaymentHandlerUiObserver observer, View tabView, @@ -101,12 +103,6 @@ } } - private static int getYLocationOnScreen(View view) { - int[] point = new int[2]; - view.getLocationOnScreen(point); - return point[1]; - } - /** @return The height of visible area of the bottom sheet's content part. */ private int contentVisibleHeight() { return (int) (mTabView.getHeight() * FULL_HEIGHT_RATIO) - mToolbarViewHeightPx @@ -114,8 +110,7 @@ } @Override - public void onSheetOffsetChanged(float heightFraction, float offsetPx) { - } + public void onSheetOffsetChanged(float heightFraction, float offsetPx) {} @Override public void onSheetOpened(@StateChangeReason int reason) { @@ -180,4 +175,10 @@ ServiceWorkerPaymentAppBridge.onClosingPaymentAppWindow(mWebContentsRef); mHandler.post(mHider); } + + @Override + public void onSystemBackButtonClicked() { + NavigationController navigation = mWebContentsRef.getNavigationController(); + if (navigation.canGoBack()) navigation.goBack(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerView.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerView.java index 2162b72..1037323 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/PaymentHandlerView.java
@@ -29,6 +29,13 @@ private final View mThinWebView; private final WebContents mWebContents; private final int mToolbarHeightPx; + private final PaymentHandlerViewObserver mObserver; + + /** The observer of PaymentHandlerView. */ + interface PaymentHandlerViewObserver { + /** A callback that is invoked when the system back button is clicked. */ + void onSystemBackButtonClicked(); + } /** * Construct the PaymentHandlerView. @@ -37,9 +44,11 @@ * @param webContents The web-content of the payment-handler web-app. * @param toolbarView The view of the Payment Handler toolbar. * @param thinWebView The view that shows the WebContents of the payment app. + * @param observer The observer of this view. */ - /* package */ PaymentHandlerView( - Context context, WebContents webContents, View toolbarView, View thinWebView) { + /* package */ PaymentHandlerView(Context context, WebContents webContents, View toolbarView, + View thinWebView, PaymentHandlerViewObserver observer) { + mObserver = observer; mWebContents = webContents; mToolbarView = toolbarView; mThinWebView = thinWebView; @@ -118,6 +127,12 @@ } @Override + public boolean handleBackPress() { + mObserver.onSystemBackButtonClicked(); + return true; // Prevent further handling of the back press. + } + + @Override public int getSheetContentDescriptionStringId() { return R.string.payment_handler_sheet_description; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarMediator.java index 46bf4ba..883f2500 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarMediator.java
@@ -24,7 +24,7 @@ /** The delay (four video frames - for 60Hz) after which the hide progress will be hidden. */ private static final long HIDE_PROGRESS_BAR_DELAY_MS = (1000 / 60) * 4; /** - * The minimum load progress that can be shown when a page is loading. This is not 0 so that + * The minimum load progress that can be shown when a page is loading. This is not 0 so that * it's obvious to the user that something is attempting to load. */ /* package */ static final float MINIMUM_LOAD_PROGRESS = 0.05f; @@ -32,7 +32,7 @@ private final PropertyModel mModel; /** The handler to delay hiding the progress bar. */ private Handler mHideProgressBarHandler; - /** Postfixed with "Ref" to distinguish from mWebContent in WebContentsObserver. */ + /** Postfix with "Ref" to distinguish from mWebContent in WebContentsObserver. */ private final WebContents mWebContentsRef; private final PaymentHandlerToolbarMediatorDelegate mDelegate;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarView.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarView.java index 16af6725b..e1d5089 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/handler/toolbar/PaymentHandlerToolbarView.java
@@ -34,7 +34,7 @@ /** * Construct the PaymentHandlerToolbarView. * - * @param context The context where the bottome-sheet should be shown. + * @param context The context where the bottom-sheet should be shown. * @param securityIconOnClickListener The listener to clicking the security icon. */ /* package */ PaymentHandlerToolbarView(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java index b000d28..fa77da54 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -21,12 +21,12 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; import org.chromium.chrome.browser.usage_stats.UsageStatsConsentDialog; import org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference; import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.settings.SettingsUtils; import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.SpanApplier;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotification.java b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotification.java index 03e6401..5b336b6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotification.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotification.java
@@ -15,11 +15,11 @@ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import java.util.concurrent.TimeUnit;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapter.java index c75eec9..5c2570819 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapter.java
@@ -32,8 +32,8 @@ import org.chromium.chrome.browser.locale.LocaleManager; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.PermissionInfo; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridge;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/send_tab_to_self/DevicePickerBottomSheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/send_tab_to_self/DevicePickerBottomSheetContent.java index d2a49fa6..e080451 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/send_tab_to_self/DevicePickerBottomSheetContent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/send_tab_to_self/DevicePickerBottomSheetContent.java
@@ -20,10 +20,10 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.send_tab_to_self.SendTabToSelfMetrics.SendTabToSelfShareClickResult; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetContent; import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetController; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.sync.AndroidSyncSettings; import org.chromium.content_public.browser.NavigationEntry; import org.chromium.content_public.browser.WebContents;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncherImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncherImpl.java index 088a8b7..39078e3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncherImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncherImpl.java
@@ -13,6 +13,7 @@ import androidx.fragment.app.Fragment; import org.chromium.base.IntentUtils; +import org.chromium.components.browser_ui.settings.SettingsLauncher; /** * Implementation class for launching a {@link SettingsActivity}.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardShareActivity.java index 73463cc..8f58c7f3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardShareActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sharing/shared_clipboard/SharedClipboardShareActivity.java
@@ -22,11 +22,11 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.init.AsyncInitializationActivity; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sharing.SharingAdapter; import org.chromium.chrome.browser.sharing.SharingServiceProxy; import org.chromium.chrome.browser.sharing.SharingServiceProxy.DeviceInfo; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.sync.AndroidSyncSettings; import org.chromium.components.sync.protocol.SharingSpecificFields; import org.chromium.ui.widget.ButtonCompat;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragment.java index e6ffe99..619da50 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninFragment.java
@@ -17,11 +17,11 @@ import org.chromium.chrome.browser.SyncFirstSetupCompleteSource; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.profiles.Profile; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.chrome.browser.sync.settings.ManageSyncSettings; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.signin.AccountManagerFacadeProvider; import org.chromium.components.signin.AccountUtils; import org.chromium.components.signin.metrics.SigninAccessPoint;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java index 9633fb5..a3c9b4e6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java
@@ -18,10 +18,10 @@ import org.chromium.base.IntentUtils; import org.chromium.base.task.PostTask; import org.chromium.chrome.R; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.SigninActivity.AccessPoint; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.signin.metrics.SigninAccessPoint; import org.chromium.components.sync.AndroidSyncSettings; import org.chromium.components.sync.AndroidSyncSettings.AndroidSyncSettingsObserver;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ManageSpaceActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ManageSpaceActivity.java index 95cb657d..d73f593 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ManageSpaceActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ManageSpaceActivity.java
@@ -40,8 +40,8 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory; import org.chromium.components.browser_ui.site_settings.Website;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncNotificationController.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncNotificationController.java index 5f4572c4..f999ccc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncNotificationController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/SyncNotificationController.java
@@ -18,7 +18,6 @@ import org.chromium.chrome.browser.notifications.NotificationConstants; import org.chromium.chrome.browser.notifications.NotificationUmaTracker; import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.sync.GoogleServiceAuthError.State; @@ -30,6 +29,7 @@ import org.chromium.components.browser_ui.notifications.NotificationManagerProxyImpl; import org.chromium.components.browser_ui.notifications.NotificationMetadata; import org.chromium.components.browser_ui.notifications.PendingIntentProvider; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.signin.base.CoreAccountInfo; import org.chromium.components.signin.identitymanager.ConsentLevel; import org.chromium.components.sync.AndroidSyncSettings;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java index 9045b67..9a61a985 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/AccountManagementFragment.java
@@ -34,7 +34,6 @@ import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.ProfileAccountManagementMetrics; import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.signin.IdentityServicesProvider; import org.chromium.chrome.browser.signin.ProfileDataCache; @@ -46,6 +45,7 @@ import org.chromium.chrome.browser.superviseduser.FilteringBehavior; import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.components.browser_ui.settings.ChromeBasePreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.signin.AccountManagerFacade; import org.chromium.components.signin.AccountManagerFacadeProvider; import org.chromium.components.signin.AccountUtils;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java index 25fc6125..64173a7a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/HomeButton.java
@@ -31,10 +31,10 @@ import org.chromium.chrome.browser.homepage.HomepagePolicyManager; import org.chromium.chrome.browser.homepage.settings.HomepageSettings; import org.chromium.chrome.browser.ntp.NewTabPage; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarConfiguration; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.ui.widget.ChromeImageButton; /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java index ac6a63c..405ce91 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webauth/AuthenticatorImpl.java
@@ -127,7 +127,7 @@ (status, response) -> AuthenticatorImplJni.get().invokeMakeCredentialResponse( mNativeInternalAuthenticatorAndroid, status.intValue(), - response.serialize())); + response == null ? ByteBuffer.allocate(0) : response.serialize())); } @Override @@ -161,7 +161,7 @@ (status, response) -> AuthenticatorImplJni.get().invokeGetAssertionResponse( mNativeInternalAuthenticatorAndroid, status.intValue(), - response.serialize())); + response == null ? ByteBuffer.allocate(0) : response.serialize())); } @Override
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillUpstreamTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillUpstreamTest.java index 6aca0c04..612da30 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillUpstreamTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillUpstreamTest.java
@@ -62,7 +62,7 @@ @Before public void setUp() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mServer = new EmbeddedTestServer(); mServer.initializeNative(InstrumentationRegistry.getContext(), EmbeddedTestServer.ServerHTTPSSetting.USE_HTTP);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/BackgroundSyncTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/BackgroundSyncTest.java index aeaaab2..65b6e8ab0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/BackgroundSyncTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/BackgroundSyncTest.java
@@ -68,7 +68,7 @@ // loadNativeLibraryNoBrowserProcess will access AccountManagerFacade, so it should // be initialized beforehand. - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); // This is necessary because our test devices don't have Google Play Services up to date, // and BackgroundSync requires that. Remove this once https://crbug.com/514449 has been @@ -91,7 +91,7 @@ @After public void tearDown() { if (mTestServer != null) mTestServer.stopAndDestroyServer(); - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); BackgroundSyncBackgroundTaskScheduler.getInstance().removeObserver(mSchedulerObserver); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/PeriodicBackgroundSyncTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/PeriodicBackgroundSyncTest.java index 3180f8f..87969c3 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/PeriodicBackgroundSyncTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/background_sync/PeriodicBackgroundSyncTest.java
@@ -76,7 +76,7 @@ public void setUp() throws InterruptedException, TimeoutException { // loadNativeLibraryNoBrowserProcess will access AccountManagerFacade, so it should // be initialized beforehand. - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); // This is necessary because our test devices don't have Google Play Services up to date, // and Periodic Background Sync requires that. Remove this once https://crbug.com/514449 has @@ -102,7 +102,7 @@ @After public void tearDown() throws TimeoutException { if (mTestServer != null) mTestServer.stopAndDestroyServer(); - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); BackgroundSyncBackgroundTaskScheduler.getInstance().removeObserver(mSchedulerObserver); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java index b3df9b2..ff269b6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentBasicTest.java
@@ -57,14 +57,14 @@ @Before public void setUp() throws InterruptedException { - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mActivityTestRule.startMainActivityOnBlankPage(); } @After public void tearDown() { TestThreadUtils.runOnUiThreadBlocking(() -> ProfileSyncService.resetForTests()); - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } private static class StubProfileSyncService extends ProfileSyncService {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java index 13ec31d6..1901a3f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragmentTest.java
@@ -108,7 +108,7 @@ when(mBrowsingDataBridgeMock.getBrowsingDataDeletionTimePeriod(any(), anyInt())) .thenReturn(DEFAULT_TIME_PERIOD); - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mActivityTestRule.startMainActivityOnBlankPage(); @@ -124,7 +124,7 @@ @After public void tearDown() { - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } /** Waits for the progress dialog to disappear from the given CBD preference. */
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityScrollingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityScrollingTest.java index db12fef..b56da773 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityScrollingTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityScrollingTest.java
@@ -126,7 +126,6 @@ // The clear browsing data header, one date view, and two history item views // should be shown, but the info header should not. We enforce a defaultx // state because the number of headers shown depends on the signed-in state. - mHistoryProvider = new StubbedHistoryProvider(); mHistoryProvider.setPaging(mPaging);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java index e24a0f9..805ec6b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java
@@ -95,7 +95,7 @@ // Account not signed in by default. The clear browsing data header, one date view, and two // history item views should be shown, but the info header should not. We enforce a default // state because the number of headers shown depends on the signed-in state. - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mHistoryProvider = new StubbedHistoryProvider(); @@ -116,7 +116,7 @@ @After public void tearDown() { - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } private void launchHistoryActivity() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/identity_disc/IdentityDiscControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/identity_disc/IdentityDiscControllerTest.java index 5bf5638..158884e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/identity_disc/IdentityDiscControllerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/identity_disc/IdentityDiscControllerTest.java
@@ -53,7 +53,7 @@ @Before public void setUp() { - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mActivityTestRule.startMainActivityWithURL(UrlConstants.NTP_URL); mTab = mActivityTestRule.getActivity().getActivityTab(); NewTabPageTestUtils.waitForNtpLoaded(mTab); @@ -61,7 +61,7 @@ @After public void tearDown() { - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBarTest.java index 1ceb643..7b78dc5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBarTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SyncErrorInfoBarTest.java
@@ -33,6 +33,9 @@ import java.io.IOException; +/** + * Test suite for the SyncErrorInfoBar. + */ @RunWith(ChromeJUnit4ClassRunner.class) @CommandLineFlags .Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) @@ -107,7 +110,7 @@ public void testSyncErrorInfoBarNotShownWhenNoError() { Assert.assertEquals("InfoBar should not be shown before signing in", 0, mSyncTestRule.getInfoBars().size()); - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); mFakeProfileSyncService.setEngineInitialized(true); mFakeProfileSyncService.setAuthError(GoogleServiceAuthError.State.NONE); @@ -181,13 +184,13 @@ } private void showSyncErrorInfoBarForAuthError() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mFakeProfileSyncService.setAuthError(GoogleServiceAuthError.State.INVALID_GAIA_CREDENTIALS); mSyncTestRule.loadUrlInNewTab(UrlConstants.CHROME_BLANK_URL); } private void showSyncErrorInfoBarForPassphraseRequired() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mFakeProfileSyncService.setEngineInitialized(true); mFakeProfileSyncService.setPassphraseRequiredForPreferredDataTypes(true); mSyncTestRule.loadUrlInNewTab(UrlConstants.CHROME_BLANK_URL);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/OnboardingDialogIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/OnboardingDialogIntegrationTest.java index b912f62e..eae1a29 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/OnboardingDialogIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/OnboardingDialogIntegrationTest.java
@@ -71,7 +71,7 @@ @Before public void setUp() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); TestThreadUtils.runOnUiThreadBlocking(() -> { PrefServiceBridge.getInstance().setInteger( PASSWORD_MANAGER_ONBOARDING_STATE, SHOULD_SHOW);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java index b05538f..70ffe91 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java
@@ -98,7 +98,6 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.chrome.test.ChromeBrowserTestRule; @@ -106,6 +105,7 @@ import org.chromium.chrome.test.util.browser.signin.SigninTestUtil; import org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference; import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.sync.ModelType; import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.TestThreadUtils;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordViewingTypeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordViewingTypeTest.java index 90a8cc8..dfd5530 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordViewingTypeTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordViewingTypeTest.java
@@ -23,11 +23,11 @@ import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.settings.MainSettings; import org.chromium.chrome.browser.settings.SettingsActivity; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.chrome.test.util.ApplicationTestUtils; import org.chromium.components.browser_ui.settings.ChromeBasePreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.signin.AccountUtils; import org.chromium.components.signin.test.util.AccountHolder; import org.chromium.components.signin.test.util.AccountManagerTestRule;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java index be8f1f7..7caab2e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/settings/MainSettingsFragmentTest.java
@@ -190,7 +190,7 @@ @Test @SmallTest public void testAccountSignIn() throws InterruptedException { - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.signOut(); launchSettingsActivity();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareButtonControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareButtonControllerTest.java index 7c4d2a1..32958dc 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareButtonControllerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareButtonControllerTest.java
@@ -56,7 +56,7 @@ @Before public void setUp() { - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mActivityTestRule.startMainActivityOnBlankPage(); int minimumWidthDp = ChromeFeatureList.getFieldTrialParamByFeatureAsInt( @@ -70,7 +70,7 @@ @After public void tearDown() { - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/IdentityManagerIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/IdentityManagerIntegrationTest.java index 4375496..19bed00 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/IdentityManagerIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/IdentityManagerIntegrationTest.java
@@ -49,7 +49,7 @@ @Before public void setUp() { - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mTestAccount1 = createCoreAccountInfoFromEmail(TEST_ACCOUNT1); mTestAccount2 = createCoreAccountInfoFromEmail(TEST_ACCOUNT2); @@ -77,7 +77,7 @@ public void tearDown() { TestThreadUtils.runOnUiThreadBlocking( () -> { mIdentityMutator.reloadAllAccountsFromSystemWithPrimaryAccount(null); }); - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); // TODO(https://crbug.com/1046412): Remove this. ChromeSigninController.get().setSignedInAccountName(null);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java index 94459934..46a637e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/SigninSignoutIntegrationTest.java
@@ -85,7 +85,7 @@ public void setUp() { initMocks(this); mocker.mock(SigninUtilsJni.TEST_HOOKS, mSigninUtilsNativeMock); - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); mActivityTestRule.startMainActivityOnBlankPage(); TestThreadUtils.runOnUiThreadBlocking( () -> { mSigninManager = IdentityServicesProvider.get().getSigninManager(); }); @@ -95,7 +95,7 @@ @After public void tearDown() { mSigninManager.removeSignInStateObserver(mSignInStateObserverMock); - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } @Test
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java index 1d1c0c7e..c723af79 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTest.java
@@ -36,7 +36,6 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.settings.SettingsActivity; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -46,6 +45,7 @@ import org.chromium.chrome.test.util.browser.LocationSettingsTestUtil; import org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference; import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference; import org.chromium.components.browser_ui.site_settings.FourStateCookieSettingsPreference.CookieSettingsState; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java index 85050f0..3ca4634 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/site_settings/SiteSettingsTestUtils.java
@@ -9,8 +9,8 @@ import android.support.test.InstrumentationRegistry; import org.chromium.chrome.browser.settings.SettingsActivity; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleCategorySettings; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; import org.chromium.components.browser_ui.site_settings.SiteSettings;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java index 529ff57..eab80a35 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/AutofillTest.java
@@ -74,7 +74,7 @@ @Before public void setUp() throws Exception { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); // Make sure the initial state is clean. assertClientAutofillProfileCount(0); assertServerAutofillProfileCountWithName(0, STREET);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java index d007dd1..7847b77 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/BookmarksTest.java
@@ -81,7 +81,7 @@ // Without this call to fake that knowledge for testing, it crashes. mBookmarkBridge.loadEmptyPartnerBookmarkShimForTesting(); }); - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); // Make sure initial state is clean. assertClientBookmarkCount(0); assertServerBookmarkCountWithName(0, TITLE);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsTest.java index dc40082..56e68b30 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsTest.java
@@ -97,7 +97,7 @@ @SmallTest @Feature({"Sync"}) public void testSyncEverythingAndDataTypes() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); ManageSyncSettings fragment = startManageSyncPreferences(); ChromeSwitchPreference syncEverything = getSyncEverything(fragment); @@ -117,7 +117,7 @@ @SmallTest @Feature({"Sync"}) public void testSettingDataTypes() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); ManageSyncSettings fragment = startManageSyncPreferences(); ChromeSwitchPreference syncEverything = getSyncEverything(fragment); @@ -149,7 +149,7 @@ @SmallTest @Feature({"Sync"}) public void testPaymentsIntegrationChecked() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(true); ManageSyncSettings fragment = startManageSyncPreferences(); @@ -166,7 +166,7 @@ @SmallTest @Feature({"Sync"}) public void testPaymentsIntegrationUnchecked() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(false); mSyncTestRule.setChosenDataTypes(false, UI_DATATYPES.keySet()); @@ -184,7 +184,7 @@ @SmallTest @Feature({"Sync"}) public void testPaymentsIntegrationCheckboxDisablesPaymentsIntegration() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(true); ManageSyncSettings fragment = startManageSyncPreferences(); @@ -205,7 +205,7 @@ @FlakyTest(message = "crbug.com/988622") @Feature({"Sync"}) public void testPaymentsIntegrationCheckboxEnablesPaymentsIntegration() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(false); mSyncTestRule.setChosenDataTypes(false, UI_DATATYPES.keySet()); @@ -224,7 +224,7 @@ @SmallTest @Feature({"Sync"}) public void testPaymentsIntegrationCheckboxClearsServerAutofillCreditCards() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(true); Assert.assertFalse( @@ -253,7 +253,7 @@ @SmallTest @Feature({"Sync"}) public void testPaymentsIntegrationDisabledByAutofillSyncCheckbox() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(true); ManageSyncSettings fragment = startManageSyncPreferences(); @@ -278,7 +278,7 @@ @SmallTest @Feature({"Sync"}) public void testPaymentsIntegrationEnabledBySyncEverything() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(false); mSyncTestRule.disableDataType(ModelType.AUTOFILL); @@ -319,7 +319,7 @@ @SmallTest @Feature({"Sync"}) public void testChoosePassphraseTypeWhenSyncIsOff() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); ManageSyncSettings fragment = startManageSyncPreferences(); Preference encryption = getEncryption(fragment); @@ -340,7 +340,7 @@ @SmallTest @Feature({"Sync"}) public void testEnterPassphraseWhenSyncIsOff() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); final ManageSyncSettings fragment = startManageSyncPreferences(); mSyncTestRule.stopSync(); @@ -353,7 +353,7 @@ @SmallTest @Feature({"Sync"}) public void testPassphraseCreation() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); final ManageSyncSettings fragment = startManageSyncPreferences(); TestThreadUtils.runOnUiThreadBlocking( @@ -430,7 +430,7 @@ Collections.singletonList(trustedVaultKey)); mSyncTestRule.getFakeServerHelper().setTrustedVaultNigori(trustedVaultKey); - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); // Initially FakeTrustedVaultClientBackend doesn't provide any keys, so PSS should remain // in TrustedVaultKeyRequired state. @@ -452,7 +452,7 @@ @Feature({"Sync"}) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) public void testAdvancedSyncFlowPreferencesAndBottomBarShown() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow(); Assert.assertTrue( @@ -469,7 +469,7 @@ @Feature({"Sync", "RenderTest"}) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) public void testAdvancedSyncFlowTopView() throws Exception { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow(); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); @@ -481,7 +481,7 @@ @Feature({"Sync", "RenderTest"}) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) public void testAdvancedSyncFlowBottomView() throws Exception { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow(); TestThreadUtils.runOnUiThreadBlocking(() -> {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsWithFakeProfileSyncServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsWithFakeProfileSyncServiceTest.java index 0852c1ce..5d217a1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsWithFakeProfileSyncServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ManageSyncSettingsWithFakeProfileSyncServiceTest.java
@@ -58,7 +58,7 @@ final FakeProfileSyncService fakeProfileSyncService = (FakeProfileSyncService) mSyncTestRule.getProfileSyncService(); - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); // Trigger PassphraseDialogFragment to be shown when taping on Encryption. fakeProfileSyncService.setPassphraseRequiredForPreferredDataTypes(true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java index 3a764e3..a646f78 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/OpenTabsTest.java
@@ -92,7 +92,7 @@ @Before public void setUp() throws Exception { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mClientName = getClientName(); mSessionTagCounter = 0; }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsTest.java index ba1d2d27..5ad6ba7 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsTest.java
@@ -31,7 +31,6 @@ import org.chromium.chrome.browser.preferences.SharedPreferencesManager; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -40,6 +39,7 @@ import org.chromium.chrome.test.util.browser.Features.EnableFeatures; import org.chromium.chrome.test.util.browser.sync.SyncTestUtil; import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.sync.AndroidSyncSettings; import org.chromium.content_public.browser.test.util.TestThreadUtils; @@ -66,7 +66,7 @@ @LargeTest @Feature({"Sync", "Preferences"}) public void testSyncSwitch() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); final ChromeSwitchPreference syncSwitch = getSyncSwitch(fragment); @@ -88,7 +88,7 @@ @LargeTest @Feature({"Sync", "Preferences"}) public void testOpeningSettingsDoesntEnableSync() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.stopSync(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); closeFragment(fragment); @@ -102,7 +102,7 @@ @LargeTest @Feature({"Sync", "Preferences"}) public void testOpeningSettingsDoesntStartEngine() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.stopSync(); startSyncAndServicesPreferences(); TestThreadUtils.runOnUiThreadBlocking(() -> { @@ -114,7 +114,7 @@ @LargeTest @Feature({"Sync", "Preferences"}) public void testDefaultControlStatesWithSyncOffThenOn() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.stopSync(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); assertSyncOffState(fragment); @@ -127,7 +127,7 @@ @LargeTest @Feature({"Sync", "Preferences"}) public void testDefaultControlStatesWithSyncOnThenOff() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); assertSyncOnState(fragment); @@ -140,7 +140,7 @@ @Feature({"Sync", "Preferences"}) @DisabledTest(message = "https://crbug.com/991135") public void testSyncSwitchClearsServerAutofillCreditCards() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setPaymentsIntegrationEnabled(true); Assert.assertFalse(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsWithFakeProfileSyncServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsWithFakeProfileSyncServiceTest.java index 62bb7df..80a1176f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsWithFakeProfileSyncServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncAndServicesSettingsWithFakeProfileSyncServiceTest.java
@@ -45,7 +45,7 @@ public void testTrustedVaultKeyRequiredShowsSyncErrorCard() throws Exception { FakeProfileSyncService fakeProfileSyncService = (FakeProfileSyncService) mSyncTestRule.getProfileSyncService(); - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); SyncTestUtil.waitForSyncActive(); fakeProfileSyncService.setEngineInitialized(true); fakeProfileSyncService.setTrustedVaultKeyRequiredForPreferredDataTypes(true);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java index 09ebdb67..edf27e8c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTest.java
@@ -46,7 +46,7 @@ @LargeTest @Feature({"Sync"}) public void testFlushDirectoryDoesntBreakSync() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); final Activity activity = mSyncTestRule.getActivity(); InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @@ -63,7 +63,7 @@ @LargeTest @Feature({"Sync"}) public void testSignInAndOut() throws InterruptedException { - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); // Signing out should disable sync. mSyncTestRule.signOut(); @@ -78,7 +78,7 @@ @LargeTest @Feature({"Sync"}) public void testStopAndClear() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); CriteriaHelper.pollUiThread( () -> IdentityServicesProvider.get().getIdentityManager().hasPrimaryAccount(), @@ -106,7 +106,7 @@ @DisabledTest(message = "crbug.com/588050,crbug.com/595893") public void testRename() { // The two accounts object that would represent the account rename. - final Account oldAccount = mSyncTestRule.setUpTestAccountAndSignIn(); + final Account oldAccount = mSyncTestRule.setUpAccountAndSignInForTesting(); final Account newAccount = SigninTestUtil.addTestAccount("test2@gmail.com"); TestThreadUtils.runOnUiThreadBlocking(() -> { @@ -137,7 +137,7 @@ @LargeTest @Feature({"Sync"}) public void testStopAndStartSync() { - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.stopSync(); Assert.assertEquals(account, SigninTestUtil.getCurrentAccount()); @@ -150,7 +150,7 @@ @LargeTest @Feature({"Sync"}) public void testStopAndStartSyncThroughAndroidChromeSync() { - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); String authority = AndroidSyncSettings.get().getContractAuthority(); Assert.assertTrue(AndroidSyncSettings.get().isSyncEnabled()); @@ -169,7 +169,7 @@ @LargeTest @Feature({"Sync"}) public void testStopAndStartSyncThroughAndroidMasterSync() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); Assert.assertTrue(AndroidSyncSettings.get().isSyncEnabled()); Assert.assertTrue(SyncTestUtil.isSyncRequested()); @@ -187,7 +187,7 @@ @LargeTest @Feature({"Sync"}) public void testReenableMasterSyncFirst() { - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); String authority = AndroidSyncSettings.get().getContractAuthority(); Assert.assertTrue(AndroidSyncSettings.get().isSyncEnabled()); @@ -219,7 +219,7 @@ @LargeTest @Feature({"Sync"}) public void testReenableChromeSyncFirst() { - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); String authority = AndroidSyncSettings.get().getContractAuthority(); Assert.assertTrue(AndroidSyncSettings.get().isSyncEnabled()); @@ -256,7 +256,7 @@ @LargeTest @Feature({"Sync"}) public void testMasterSyncBlocksSyncStart() { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.stopSync(); Assert.assertFalse(SyncTestUtil.isSyncRequested());
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestRule.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestRule.java index 53eb64ad..57f624a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestRule.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestRule.java
@@ -143,7 +143,7 @@ private void ruleSetUp() { // This must be called before super.setUp() in order for test authentication to work. - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); } private void ruleTearDown() { @@ -151,7 +151,7 @@ mProfileSyncService.requestStop(); FakeServerHelper.deleteFakeServer(); }); - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } public SyncTestRule() { @@ -192,7 +192,7 @@ * this. For most purposes this function should be used as this emulates the basic sign in flow. * @return the test account that is signed in. */ - public Account setUpTestAccountAndSignIn() { + public Account setUpAccountAndSignInForTesting() { Account account = setUpTestAccount(); signinAndEnableSync(account); return account;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestSigninUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestSigninUtils.java index 339d41d..38beea9 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestSigninUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/SyncTestSigninUtils.java
@@ -48,7 +48,7 @@ * Sets up the test account and signs in. */ @CalledByNative - private static Account setUpTestAccountAndSignIn() { + private static Account setUpAccountAndSignInForTesting() { Account account = SigninTestUtil.addTestAccount(); signinTestAccount(account); return account; @@ -58,15 +58,15 @@ * Sets up the test authentication environment. */ @CalledByNative - private static void setUpAuthForTest() { - SigninTestUtil.setUpAuthForTest(); + private static void setUpAuthForTesting() { + SigninTestUtil.setUpAuthForTesting(); } /** * Tears down the test authentication environment. */ @CalledByNative - private static void tearDownAuthForTest() { - SigninTestUtil.tearDownAuthForTest(); + private static void tearDownAuthForTesting() { + SigninTestUtil.tearDownAuthForTesting(); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java index debce19..cd3353f9 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/TypedUrlsTest.java
@@ -67,7 +67,7 @@ @Before public void setUp() throws Exception { - mSyncTestRule.setUpTestAccountAndSignIn(); + mSyncTestRule.setUpAccountAndSignInForTesting(); // Make sure the initial state is clean. assertClientTypedUrlCount(0); assertServerTypedUrlCountWithName(0, URL);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/UkmTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/UkmTest.java index 9d01efd..6c9711c 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/UkmTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/UkmTest.java
@@ -86,7 +86,7 @@ () -> UmaSessionStats.updateMetricsAndCrashReportingForTesting(true)); // Enable a Syncing account. - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Tab normalTab = mSyncTestRule.getActivity().getActivityTab(); Assert.assertTrue("UKM Enabled:", isUkmEnabled(normalTab)); @@ -128,7 +128,7 @@ Assert.assertFalse("UKM Enabled:", isUkmEnabled(normalTab)); // Finally, sign in and UKM is enabled. - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Assert.assertTrue("UKM Enabled:", isUkmEnabled(normalTab)); } @@ -143,7 +143,7 @@ () -> UmaSessionStats.updateMetricsAndCrashReportingForTesting(true)); // Enable a Syncing account. - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Tab normalTab = mSyncTestRule.getActivity().getActivityTab(); Assert.assertTrue("UKM Enabled:", isUkmEnabled(normalTab)); @@ -169,7 +169,7 @@ () -> UmaSessionStats.updateMetricsAndCrashReportingForTesting(true)); // Enable a Syncing account. - Account account = mSyncTestRule.setUpTestAccountAndSignIn(); + Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Tab normalTab = mSyncTestRule.getActivity().getActivityTab(); Assert.assertTrue("UKM Enabled:", isUkmEnabled(normalTab));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java index b7d1882..d73136f 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java
@@ -30,11 +30,11 @@ import org.chromium.chrome.browser.homepage.HomepageManager; import org.chromium.chrome.browser.homepage.HomepageTestRule; import org.chromium.chrome.browser.homepage.settings.HomepageSettings; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.Features.EnableFeatures; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.test.util.DummyUiActivityTestCase;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tracing/settings/TracingSettingsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tracing/settings/TracingSettingsTest.java index 02a76777..6fb1bbb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/tracing/settings/TracingSettingsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tracing/settings/TracingSettingsTest.java
@@ -36,7 +36,6 @@ import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.tracing.TracingController; import org.chromium.chrome.browser.tracing.TracingNotificationManager; @@ -44,6 +43,7 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.components.browser_ui.notifications.MockNotificationManagerProxy; import org.chromium.components.browser_ui.settings.ButtonPreference; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.settings.TextMessagePreference; import org.chromium.content_public.browser.test.util.Criteria; import org.chromium.content_public.browser.test.util.CriteriaHelper;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrBrowserTransitionTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrBrowserTransitionTest.java index be72bb7..5eef5c03 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrBrowserTransitionTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr/VrBrowserTransitionTest.java
@@ -39,7 +39,6 @@ import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.ntp.IncognitoNewTabPage; import org.chromium.chrome.browser.settings.SettingsActivity; -import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncherImpl; import org.chromium.chrome.browser.vr.mock.MockVrDaydreamApi; import org.chromium.chrome.browser.vr.rules.ChromeTabbedActivityVrTestRule; @@ -50,6 +49,7 @@ import org.chromium.chrome.browser.vr.util.VrShellDelegateUtils; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.ActivityUtils; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.components.browser_ui.site_settings.SingleWebsiteSettings; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.content_public.browser.test.util.CriteriaHelper;
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java index 1387a1a..16b8386 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/sharing/click_to_call/ClickToCallMessageHandlerTest.java
@@ -16,7 +16,6 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowNotificationManager; -import org.robolectric.util.ReflectionHelpers; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.Feature; @@ -36,8 +35,8 @@ */ @Test @Feature({"Browser", "Sharing", "ClickToCall"}) + @Config(sdk = Build.VERSION_CODES.Q) public void testHandleMessage_androidQShouldDisplayNotification() { - setAtLeastAndroidQ(true); setIsScreenOnAndUnlocked(true); ClickToCallMessageHandler.handleMessage("18004444444"); @@ -50,8 +49,8 @@ */ @Test @Feature({"Browser", "Sharing", "ClickToCall"}) + @Config(sdk = Build.VERSION_CODES.P) public void testHandleMessage_lockedScreenShouldDisplayNotification() { - setAtLeastAndroidQ(false); setIsScreenOnAndUnlocked(false); ClickToCallMessageHandler.handleMessage("18004444444"); @@ -65,8 +64,8 @@ */ @Test @Feature({"Browser", "Sharing", "ClickToCall"}) + @Config(sdk = Build.VERSION_CODES.P) public void testHandleMessage_opensDialerDirectly() { - setAtLeastAndroidQ(false); setIsScreenOnAndUnlocked(true); ClickToCallMessageHandler.handleMessage("18004444444"); @@ -74,12 +73,6 @@ assertEquals(0, getShadowNotificationManager().size()); } - private void setAtLeastAndroidQ(boolean atLeastAndroidQ) { - // TODO(knollr): update to Build.VERSION_CODES.Q once available. - int versionCode = atLeastAndroidQ ? 29 : Build.VERSION_CODES.P; - ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", versionCode); - } - private void setIsScreenOnAndUnlocked(boolean isScreenOnAndUnlocked) { DeviceConditions deviceConditions = new DeviceConditions(false /* POWER_CONNECTED */, 75 /* BATTERY_LEVEL */, ConnectionType.CONNECTION_WIFI, false /* POWER_SAVE */,
diff --git a/chrome/android/modules/README.md b/chrome/android/modules/README.md index 176bce7..00e6162a 100644 --- a/chrome/android/modules/README.md +++ b/chrome/android/modules/README.md
@@ -1,8 +1,8 @@ # Chrome on Android App Bundles and Dynamic Feature Modules This directory contains GN templates and code for Chrome-specific -[Android app bundles]((../../../docs/android_app_bundles.md)) and -[dynamic feature modules](../../../docs/android_dynamic_feature_modules.md). +[Android app bundles](/build/android/docs/android_app_bundles.md) and +[dynamic feature modules](/docs/android_dynamic_feature_modules.md). Among others, it offers the following: * A list of descriptors for all modules packaged into the Chrome bundles in @@ -10,15 +10,15 @@ * A GN template to instantiate a Chrome-specific module in [`chrome_feature_module_tmpl.gni`](chrome_feature_module_tmpl.gni). It wraps - an [`android_app_bundle_module`](../../../build/config/android/rules.gni) and + an [`android_app_bundle_module`](/build/config/android/rules.gni) and adds things like multi ABI (e.g. 64 bit browser and 32 bit WebView) and auto-generated Java module descriptors (see - [here](../../../components/module_installer/readme.md) for more details). + [here](/components/module_installer/readme.md) for more details). * A GN template to instantiate a Chrome-specific bundle in [`chrome_bundle_tmpl.gni`](chrome_bundle_tmpl.gni). It instantiates a `chrome_feature_module` for each passed module descriptors as well as an - [`android_app_bundle`](../../../build/config/android/rules.gni). + [`android_app_bundle`](/build/config/android/rules.gni). * A subfolder for each module containing module-specific code such as module interfaces and providers.
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java index 8e81256..1a0336a 100644 --- a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteMediatorUnitTest.java
@@ -310,7 +310,7 @@ final List<OmniboxSuggestion> list = new ArrayList<>(); final SparseArray<String> giveHeaders = buildDummyGroupHeaders(3, 1, "Header"); mMediator.setNewSuggestions(new AutocompleteResult(list, giveHeaders)); - final SparseArray<String> haveHeaders = mMediator.getGroupHeaders(); + final SparseArray<String> haveHeaders = mMediator.getAutocompleteResult().getGroupHeaders(); Assert.assertEquals(giveHeaders.size(), haveHeaders.size()); for (int index = 0; index < giveHeaders.size(); index++) { @@ -327,7 +327,7 @@ mMediator.setNewSuggestions(new AutocompleteResult(list, oldHeaders)); mMediator.setNewSuggestions(new AutocompleteResult(list, newHeaders)); - final SparseArray<String> haveHeaders = mMediator.getGroupHeaders(); + final SparseArray<String> haveHeaders = mMediator.getAutocompleteResult().getGroupHeaders(); Assert.assertEquals(newHeaders.size(), haveHeaders.size()); for (int index = 0; index < newHeaders.size(); index++) {
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResultUnitTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResultUnitTest.java new file mode 100644 index 0000000..5039777 --- /dev/null +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteResultUnitTest.java
@@ -0,0 +1,123 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.omnibox.suggestions; + +import android.util.SparseArray; + +import org.junit.Assert; + +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.CalledByNativeJavaTest; +import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; + +import java.util.Arrays; +import java.util.List; + +/** + * Unit tests for {@link AutocompleteResult}. + */ +public class AutocompleteResultUnitTest { + @CalledByNative + private AutocompleteResultUnitTest() {} + + private OmniboxSuggestion buildSuggestionForIndex(int index) { + return OmniboxSuggestionBuilderForTest.searchWithType(OmniboxSuggestionType.SEARCH_SUGGEST) + .setDisplayText("Dummy Suggestion " + index) + .setDescription("Dummy Description " + index) + .build(); + } + + @CalledByNativeJavaTest + public void autocompleteResult_sameContentsAreEqual() { + List<OmniboxSuggestion> list1 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + List<OmniboxSuggestion> list2 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + + SparseArray<String> headers1 = new SparseArray<>(); + SparseArray<String> headers2 = new SparseArray<>(); + + headers1.put(10, "Hello"); + headers1.put(20, "Test"); + + headers2.put(10, "Hello"); + headers2.put(20, "Test"); + + AutocompleteResult res1 = new AutocompleteResult(list1, headers1); + AutocompleteResult res2 = new AutocompleteResult(list2, headers2); + + Assert.assertEquals(res1, res2); + Assert.assertEquals(res1.hashCode(), res2.hashCode()); + } + + @CalledByNativeJavaTest + public void autocompleteResult_itemsOutOfOrderAreNotEqual() { + List<OmniboxSuggestion> list1 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + List<OmniboxSuggestion> list2 = Arrays.asList( + buildSuggestionForIndex(2), buildSuggestionForIndex(1), buildSuggestionForIndex(3)); + + SparseArray<String> headers1 = new SparseArray<>(); + SparseArray<String> headers2 = new SparseArray<>(); + + headers1.put(10, "Hello"); + headers1.put(20, "Test"); + + headers2.put(10, "Hello"); + headers2.put(20, "Test"); + + AutocompleteResult res1 = new AutocompleteResult(list1, headers1); + AutocompleteResult res2 = new AutocompleteResult(list2, headers2); + + Assert.assertNotEquals(res1, res2); + Assert.assertNotEquals(res1.hashCode(), res2.hashCode()); + } + + @CalledByNativeJavaTest + public void autocompleteResult_missingGroupHeadersAreNotEqual() { + List<OmniboxSuggestion> list1 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + List<OmniboxSuggestion> list2 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + + SparseArray<String> headers1 = new SparseArray<>(); + SparseArray<String> headers2 = new SparseArray<>(); + + headers1.put(10, "Hello"); + headers1.put(20, "Test"); + + headers2.put(10, "Hello"); + + AutocompleteResult res1 = new AutocompleteResult(list1, headers1); + AutocompleteResult res2 = new AutocompleteResult(list2, headers2); + + Assert.assertNotEquals(res1, res2); + Assert.assertNotEquals(res1.hashCode(), res2.hashCode()); + } + + @CalledByNativeJavaTest + public void autocompleteResult_extraGroupHeadersAreNotEqual() { + List<OmniboxSuggestion> list1 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + List<OmniboxSuggestion> list2 = Arrays.asList( + buildSuggestionForIndex(1), buildSuggestionForIndex(2), buildSuggestionForIndex(3)); + + SparseArray<String> headers1 = new SparseArray<>(); + SparseArray<String> headers2 = new SparseArray<>(); + + headers1.put(10, "Hello"); + headers1.put(20, "Test"); + + headers2.put(10, "Hello"); + headers2.put(20, "Test"); + headers2.put(30, "Yikes"); + + AutocompleteResult res1 = new AutocompleteResult(list1, headers1); + AutocompleteResult res2 = new AutocompleteResult(list2, headers2); + + Assert.assertNotEquals(res1, res2); + Assert.assertNotEquals(res1.hashCode(), res2.hashCode()); + } +}
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java index 771da40..3ae2bc1d 100644 --- a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java
@@ -11,7 +11,6 @@ import org.chromium.base.ContextUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNativeJavaTest; -import org.chromium.chrome.browser.omnibox.MatchClassificationStyle; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; @@ -27,12 +26,6 @@ @CalledByNative private CachedZeroSuggestionsManagerUnitTest() {} - @CalledByNative - void setUp() { - // Clear cache explicitly, otherwise this test will be flaky until the suite is re-executed. - ContextUtils.getAppSharedPreferences().edit().clear().apply(); - } - /** * Compare two instances of CachedZeroSuggestionsManager to see if they are same, asserting if * they're not. Note that order is just as relevant as the content for caching. @@ -61,42 +54,27 @@ private List<OmniboxSuggestion> buildDummySuggestionsList(int count, boolean hasPostData) { List<OmniboxSuggestion> list = new ArrayList<>(); - List<OmniboxSuggestion.MatchClassification> dummyClassifications = new ArrayList<>(); - dummyClassifications.add( - new OmniboxSuggestion.MatchClassification(0, MatchClassificationStyle.NONE)); - for (int index = 0; index < count; ++index) { - OmniboxSuggestion suggestion = new OmniboxSuggestion( - OmniboxSuggestionType.CLIPBOARD_IMAGE, false /* isSearchType */, - 0 /* relevance */, 0 /* transition */, "dummy text 1" + (index + 1), - dummyClassifications /* displayTextClassifications */, - "dummy description 1" + (index + 1) /* description */, - dummyClassifications /* descriptionClassifications */, null /* answer */, - null /* fillIntoEdit */, new GURL("http://dummy.com/" + (index + 1)) /* url */, - GURL.emptyGURL() /* imageUrl */, null /* imageDominantColor */, - false /* isStarred */, false /* isDeletable */, - hasPostData ? "Dummy Content Type" + (index + 1) : null /* postContentType */, - hasPostData ? new byte[] {4, 5, 6, (byte) (index + 1)} : null /* postData */, - OmniboxSuggestion.INVALID_GROUP, null /* queryTiles */); - list.add(suggestion); + final int id = index + 1; + list.add(createSuggestionBuilder(id) + .setPostContentType(hasPostData ? "Content Type " + id : null) + .setPostData(hasPostData ? new byte[] {4, 5, 6, (byte) id} : null) + .build()); } return list; } - private OmniboxSuggestion buildUninitializedSuggestion() { - List<OmniboxSuggestion.MatchClassification> classifications = new ArrayList<>(); - classifications.add( - new OmniboxSuggestion.MatchClassification(0, MatchClassificationStyle.NONE)); - - return new OmniboxSuggestion(-1, true /* isSearchType */, 0 /* relevance */, - 0 /* transition */, "" /* displayText */, - classifications /* displayTextClassifications */, "" /* description */, - classifications /* descriptionClassifications */, null /* answer */, - "" /* fillIntoEdit */, GURL.emptyGURL() /* url */, GURL.emptyGURL() /* imageUrl */, - null /* imageDominantColor */, false /* isStarred */, false /* isDeletable */, - null /* postContentType */, null /* postData */, OmniboxSuggestion.INVALID_GROUP, - null /* queryTiles */); + /** + * Create and partially initialize suggestion builder constructing dummy OmniboxSuggestions. + * + * @param id Suggestion identifier used to initialize a unique suggestion content. + * @return Newly constructed OmniboxSuggestion. + */ + private OmniboxSuggestionBuilderForTest createSuggestionBuilder(int id) { + return OmniboxSuggestionBuilderForTest.searchWithType(OmniboxSuggestionType.CLIPBOARD_IMAGE) + .setDisplayText("dummy text " + id) + .setDescription("dummy description " + id); } @CalledByNativeJavaTest @@ -170,22 +148,8 @@ @CalledByNativeJavaTest public void dropSuggestions_suggestionsWithValidGroupsAssociation() { - List<OmniboxSuggestion.MatchClassification> dummyClassifications = new ArrayList<>(); - dummyClassifications.add( - new OmniboxSuggestion.MatchClassification(0, MatchClassificationStyle.NONE)); - List<OmniboxSuggestion> list = buildDummySuggestionsList(2, false); - OmniboxSuggestion suggestionWithHeader = - new OmniboxSuggestion(OmniboxSuggestionType.SEARCH_SUGGEST, true /* isSearchType */, - 0 /* relevance */, 0 /* transition */, "dummy text", - dummyClassifications /* displayTextClassifications */, - "dummy description" /* description */, - dummyClassifications /* descriptionClassifications */, null /* answer */, - null /* fillIntoEdit */, new GURL("http://dummy.url") /* url */, - GURL.emptyGURL() /* imageUrl */, null /* imageDominantColor */, - false /* isStarred */, false /* isDeletable */, null /* postContentType */, - null /* postData */, 1 /* groupId */, null /* queryTiles */); - list.add(suggestionWithHeader); + list.add(createSuggestionBuilder(33).setGroupId(1).build()); SparseArray<String> headers = new SparseArray<>(); headers.put(1, "Valid Header"); @@ -199,15 +163,7 @@ public void dropSuggestions_suggestionsWithInvalidGroupsAssociation() { List<OmniboxSuggestion> listExpected = buildDummySuggestionsList(2, false); List<OmniboxSuggestion> listToCache = buildDummySuggestionsList(2, false); - OmniboxSuggestion suggestionWithHeader = new OmniboxSuggestion( - OmniboxSuggestionType.SEARCH_SUGGEST, true /* isSearchType */, 0 /* relevance */, - 0 /* transition */, "dummy text", null /* displayTextClassifications */, - "dummy description" /* description */, null /* descriptionClassifications */, - null /* answer */, null /* fillIntoEdit */, new GURL("dummy url") /* url */, - GURL.emptyGURL() /* imageUrl */, null /* imageDominantColor */, - false /* isStarred */, false /* isDeletable */, null /* postContentType */, - null /* postData */, 1 /* groupId */, null /* queryTiles */); - listToCache.add(suggestionWithHeader); + listToCache.add(createSuggestionBuilder(33).setGroupId(1).build()); AutocompleteResult dataExpected = new AutocompleteResult(listExpected, null); AutocompleteResult dataToCache = new AutocompleteResult(listToCache, null); @@ -218,6 +174,9 @@ @CalledByNativeJavaTest public void malformedCache_dropsMissingSuggestions() { + // Clear cache explicitly, otherwise this test will be flaky until the suite is re-executed. + ContextUtils.getAppSharedPreferences().edit().clear().apply(); + final SharedPreferencesManager manager = SharedPreferencesManager.getInstance(); // Save one valid suggestion to cache. @@ -232,7 +191,7 @@ // and 1 totally empty entry. AutocompleteResult rawDataFromCache = new AutocompleteResult(buildDummySuggestionsList(1, true), null); - rawDataFromCache.getSuggestionsList().add(buildUninitializedSuggestion()); + rawDataFromCache.getSuggestionsList().add(new OmniboxSuggestionBuilderForTest().build()); // readCachedSuggestionList makes full attempt to restore whatever could be scraped from the // cache. @@ -248,6 +207,9 @@ @CalledByNativeJavaTest public void malformedCache_dropsMissingGroupHeaders() { + // Clear cache explicitly, otherwise this test will be flaky until the suite is re-executed. + ContextUtils.getAppSharedPreferences().edit().clear().apply(); + final SharedPreferencesManager manager = SharedPreferencesManager.getInstance(); // Write 3 wrong group headers to the cache @@ -293,40 +255,13 @@ headersWithInvalidItems.put(OmniboxSuggestion.INVALID_GROUP, "Invalid group"); List<OmniboxSuggestion> listExpected = buildDummySuggestionsList(2, false); - listExpected.add(new OmniboxSuggestion(OmniboxSuggestionType.SEARCH_SUGGEST, - true /* isSearchType */, 0 /* relevance */, 0 /* transition */, "dummy text", - null /* displayTextClassifications */, "dummy description" /* description */, - null /* descriptionClassifications */, null /* answer */, null /* fillIntoEdit */, - new GURL("http://url.com") /* url */, GURL.emptyGURL() /* imageUrl */, - null /* imageDominantColor */, false /* isStarred */, false /* isDeletable */, - null /* postContentType */, null /* postData */, 12 /* groupId */, - null /* queryTiles */)); + listExpected.add(createSuggestionBuilder(72).setGroupId(12).build()); List<OmniboxSuggestion> listWithInvalidItems = buildDummySuggestionsList(2, false); - listWithInvalidItems.add(new OmniboxSuggestion(OmniboxSuggestionType.SEARCH_SUGGEST, - true /* isSearchType */, 0 /* relevance */, 0 /* transition */, "dummy text", - null /* displayTextClassifications */, "dummy description" /* description */, - null /* descriptionClassifications */, null /* answer */, null /* fillIntoEdit */, - new GURL("http://url.com") /* url */, GURL.emptyGURL() /* imageUrl */, - null /* imageDominantColor */, false /* isStarred */, false /* isDeletable */, - null /* postContentType */, null /* postData */, 12 /* groupId */, - null /* queryTiles */)); - listWithInvalidItems.add(new OmniboxSuggestion(OmniboxSuggestionType.SEARCH_SUGGEST, - true /* isSearchType */, 0 /* relevance */, 0 /* transition */, "dummy text", - null /* displayTextClassifications */, "dummy description" /* description */, - null /* descriptionClassifications */, null /* answer */, null /* fillIntoEdit */, - new GURL("bad url") /* url */, GURL.emptyGURL() /* imageUrl */, - null /* imageDominantColor */, false /* isStarred */, false /* isDeletable */, - null /* postContentType */, null /* postData */, 12 /* groupId */, - null /* queryTiles */)); - listWithInvalidItems.add(new OmniboxSuggestion(OmniboxSuggestionType.SEARCH_SUGGEST, - true /* isSearchType */, 0 /* relevance */, 0 /* transition */, "dummy text", - null /* displayTextClassifications */, "dummy description" /* description */, - null /* descriptionClassifications */, null /* answer */, null /* fillIntoEdit */, - new GURL("http://url.com") /* url */, GURL.emptyGURL() /* imageUrl */, - null /* imageDominantColor */, false /* isStarred */, false /* isDeletable */, - null /* postContentType */, null /* postData */, 34 /* bad group */, - null /* queryTiles */)); + listWithInvalidItems.add(createSuggestionBuilder(72).setGroupId(12).build()); + listWithInvalidItems.add( + createSuggestionBuilder(73).setGroupId(12).setUrl(new GURL("bad URL")).build()); + listWithInvalidItems.add(createSuggestionBuilder(74).setGroupId(34).build()); AutocompleteResult dataWithInvalidItems = new AutocompleteResult(listWithInvalidItems, headersWithInvalidItems);
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionBuilderForTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionBuilderForTest.java new file mode 100644 index 0000000..ebeab9e --- /dev/null +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxSuggestionBuilderForTest.java
@@ -0,0 +1,175 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.omnibox.suggestions; + +import org.chromium.chrome.browser.omnibox.MatchClassificationStyle; +import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; +import org.chromium.components.omnibox.SuggestionAnswer; +import org.chromium.components.query_tiles.QueryTile; +import org.chromium.url.GURL; + +import java.util.ArrayList; +import java.util.List; + +/** + * Utility class for all omnibox suggestions related tests that aids constructing of Omnibox + * Suggestions. + */ +public class OmniboxSuggestionBuilderForTest { + // Fields below directly represent fields used in OmniboxSuggestion.java. + private @OmniboxSuggestionType int mType; + private boolean mIsSearchType; + private String mDisplayText; + private List<OmniboxSuggestion.MatchClassification> mDisplayTextClassifications; + private String mDescription; + private List<OmniboxSuggestion.MatchClassification> mDescriptionClassifications; + private SuggestionAnswer mAnswer; + private String mFillIntoEdit; + private GURL mUrl; + private GURL mImageUrl; + private String mImageDominantColor; + private int mRelevance; + private int mTransition; + private boolean mIsStarred; + private boolean mIsDeletable; + private String mPostContentType; + private byte[] mPostData; + private int mGroupId; + private List<QueryTile> mQueryTiles; + + /** + * Create a suggestion builder for a search suggestion. + * + * @return Omnibox suggestion builder that can be further refined by the user. + */ + public static OmniboxSuggestionBuilderForTest searchWithType(@OmniboxSuggestionType int type) { + return new OmniboxSuggestionBuilderForTest(type) + .setIsSearch(true) + .setDisplayText("Dummy Suggestion") + .setDescription("Dummy Description") + .setUrl(new GURL("http://dummy-website.com/test")); + } + + public OmniboxSuggestionBuilderForTest(@OmniboxSuggestionType int type) { + mType = type; + mDisplayTextClassifications = new ArrayList<>(); + mDescriptionClassifications = new ArrayList<>(); + mUrl = GURL.emptyGURL(); + mImageUrl = GURL.emptyGURL(); + mGroupId = OmniboxSuggestion.INVALID_GROUP; + + mDisplayTextClassifications.add( + new OmniboxSuggestion.MatchClassification(0, MatchClassificationStyle.NONE)); + mDescriptionClassifications.add( + new OmniboxSuggestion.MatchClassification(0, MatchClassificationStyle.NONE)); + } + + public OmniboxSuggestionBuilderForTest() { + this(OmniboxSuggestion.INVALID_TYPE); + } + + /** + * Construct OmniboxSuggestion from user set parameters. + * Default/fallback values for not explicitly initialized fields are supplied by the builder. + * + * @return New OmniboxSuggestion. + */ + public OmniboxSuggestion build() { + return new OmniboxSuggestion(mType, mIsSearchType, mRelevance, mTransition, mDisplayText, + mDisplayTextClassifications, mDescription, mDescriptionClassifications, mAnswer, + mFillIntoEdit, mUrl, mImageUrl, mImageDominantColor, mIsStarred, mIsDeletable, + mPostContentType, mPostData, mGroupId, mQueryTiles); + } + + /** + * @param text Display text to be used with the built suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setDisplayText(String text) { + mDisplayText = text; + return this; + } + + /** + * @param text Description text to be used with the built suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setDescription(String text) { + mDescription = text; + return this; + } + + /** + * @param id Group Id for newly built suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setGroupId(int id) { + mGroupId = id; + return this; + } + + /** + * @param type Post content type to set for this suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setPostContentType(String type) { + mPostContentType = type; + return this; + } + + /** + * @param data Post data to set for this suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setPostData(byte[] data) { + mPostData = data; + return this; + } + + /** + * @param url URL for the built suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setUrl(GURL url) { + mUrl = url; + return this; + } + + /** + * @param url Image URL for the built suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setImageUrl(GURL url) { + mImageUrl = url; + return this; + } + + /** + * @param color Image dominant color to set for built suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setImageDominantColor(String color) { + mImageDominantColor = color; + return this; + } + + /** + * @param isSearch Whether built suggestion is a search suggestion. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setIsSearch(boolean isSearch) { + mIsSearchType = isSearch; + return this; + } + + /** + * @param isStarred Whether built suggestion is bookmarked. + * @return Omnibox suggestion builder. + */ + public OmniboxSuggestionBuilderForTest setIsStarred(boolean isStarred) { + mIsStarred = isStarred; + return this; + } +}
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java index 2dc6acdf..d3705bf 100644 --- a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java
@@ -32,6 +32,7 @@ import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.omnibox.UrlBarEditingTextStateProvider; import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestion; +import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestionBuilderForTest; import org.chromium.chrome.browser.omnibox.suggestions.base.BaseSuggestionViewProperties; import org.chromium.chrome.browser.omnibox.suggestions.base.SuggestionDrawableState; import org.chromium.chrome.browser.omnibox.suggestions.basic.SuggestionHost; @@ -132,14 +133,11 @@ /** Create Calculation Suggestion. */ SuggestionTestHelper createCalculationSuggestion(String displayText, String userQuery) { - OmniboxSuggestion suggestion = new OmniboxSuggestion(OmniboxSuggestionType.CALCULATOR, - /* isSearchType */ true, /* relevance */ 0, /* transition */ 0, displayText, - /* displayTextClassifications */ null, /* description */ null, - /* descriptionClassifications */ null, - /* suggestionAnswer */ null, /* fillIntoEdit */ "", /* url */ GURL.emptyGURL(), - /* imageUrl */ GURL.emptyGURL(), /* imageDominantColor */ "", - /* isStarred */ false, /* isDeletable */ false, /* postContentType */ null, - /* postData */ null, OmniboxSuggestion.INVALID_GROUP, null); + OmniboxSuggestion suggestion = + OmniboxSuggestionBuilderForTest.searchWithType(OmniboxSuggestionType.CALCULATOR) + .setDisplayText(displayText) + .setDescription(userQuery) + .build(); PropertyModel model = mProcessor.createModel(); return new SuggestionTestHelper(suggestion, null, model, userQuery); }
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorTest.java index 575d4e7..ad6f1e87 100644 --- a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorTest.java +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorTest.java
@@ -23,6 +23,7 @@ import org.chromium.base.annotations.CalledByNativeJavaTest; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestion; +import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestionBuilderForTest; import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestionUiType; import org.chromium.chrome.browser.omnibox.suggestions.basic.SuggestionHost; import org.chromium.chrome.browser.ui.favicon.LargeIconBridge; @@ -30,8 +31,6 @@ import org.chromium.ui.modelutil.PropertyModel; import org.chromium.url.GURL; -import java.util.ArrayList; - /** * Tests for {@link BaseSuggestionViewProcessor}. */ @@ -100,14 +99,7 @@ * Create Suggestion for test. */ private void createSuggestion(int type, GURL url) { - mSuggestion = new OmniboxSuggestion(type, - /* isSearchType */ false, /* relevance */ 0, /* transition */ 0, "title", - /* displayTextClassifications */ new ArrayList<>(), "description", - /* descriptionClassifications */ new ArrayList<>(), - /* suggestionAnswer */ null, /* fillIntoEdit */ null, url, - /* imageUrl */ GURL.emptyGURL(), /* imageDominantColor */ "", false, - /* isDeletable */ false, /* postContentType */ null, /* postData */ null, - OmniboxSuggestion.INVALID_GROUP, null); + mSuggestion = OmniboxSuggestionBuilderForTest.searchWithType(type).setUrl(url).build(); mModel = mProcessor.createModel(); mProcessor.populateModel(mSuggestion, mModel, 0); }
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java index 5138673..31d82a8c 100644 --- a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/basic/BasicSuggestionProcessorUnitTest.java
@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.omnibox.UrlBarEditingTextStateProvider; import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestion; +import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestionBuilderForTest; import org.chromium.chrome.browser.omnibox.suggestions.base.BaseSuggestionViewProperties; import org.chromium.chrome.browser.omnibox.suggestions.base.SuggestionDrawableState; import org.chromium.chrome.browser.omnibox.suggestions.basic.SuggestionViewProperties.SuggestionIcon; @@ -39,7 +40,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.util.ArrayList; /** * Tests for {@link BasicSuggestionProcessor}. @@ -123,14 +123,13 @@ */ private void createSuggestion(int type, boolean isSearch, boolean isBookmark, String title, String description, GURL url) { - mSuggestion = new OmniboxSuggestion(type, - /* isSearchType */ isSearch, /* relevance */ 0, /* transition */ 0, title, - /* displayTextClassifications */ new ArrayList<>(), description, - /* descriptionClassifications */ new ArrayList<>(), - /* suggestionAnswer */ null, /* fillIntoEdit */ null, url, - /* imageUrl */ GURL.emptyGURL(), /* imageDominantColor */ "", isBookmark, - /* isDeletable */ false, /* postContentType */ null, /* postData */ null, - OmniboxSuggestion.INVALID_GROUP, null); + mSuggestion = OmniboxSuggestionBuilderForTest.searchWithType(type) + .setDisplayText(title) + .setDescription(description) + .setUrl(url) + .setIsSearch(isSearch) + .setIsStarred(isBookmark) + .build(); mModel = mProcessor.createModel(); mProcessor.populateModel(mSuggestion, mModel, 0); }
diff --git a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessorUnitTest.java b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessorUnitTest.java index 117e9c1..6441378 100644 --- a/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessorUnitTest.java +++ b/chrome/android/native_java_unittests/src/org/chromium/chrome/browser/omnibox/suggestions/entity/EntitySuggestionProcessorUnitTest.java
@@ -34,6 +34,7 @@ import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; import org.chromium.chrome.browser.omnibox.UrlBarEditingTextStateProvider; import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestion; +import org.chromium.chrome.browser.omnibox.suggestions.OmniboxSuggestionBuilderForTest; import org.chromium.chrome.browser.omnibox.suggestions.base.BaseSuggestionViewProperties; import org.chromium.chrome.browser.omnibox.suggestions.base.SuggestionDrawableState; import org.chromium.chrome.browser.omnibox.suggestions.basic.SuggestionHost; @@ -94,15 +95,13 @@ SuggestionTestHelper createSuggestion( String subject, String description, String color, GURL url) { OmniboxSuggestion suggestion = - new OmniboxSuggestion(OmniboxSuggestionType.SEARCH_SUGGEST_ENTITY, - /* isSearchType */ true, /* relevance */ 0, /* transition */ 0, subject, - /* displayTextClassifications */ null, /* description */ description, - /* descriptionClassifications */ null, - /* suggestionAnswer */ null, /* fillIntoEdit */ "", - /* url */ GURL.emptyGURL(), - /* imageUrl */ url, /* imageDominantColor */ color, - /* isStarred */ false, /* isDeletable */ false, /* postContentType */ null, - /* postData */ null, OmniboxSuggestion.INVALID_GROUP, null); + OmniboxSuggestionBuilderForTest + .searchWithType(OmniboxSuggestionType.SEARCH_SUGGEST_ENTITY) + .setDisplayText(subject) + .setDescription(description) + .setImageUrl(url) + .setImageDominantColor(color) + .build(); PropertyModel model = mProcessor.createModel(); return new SuggestionTestHelper(suggestion, model); }
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index cc6ceac..acad1df 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -110,7 +110,6 @@ #include "components/policy/core/common/features.h" #include "components/previews/core/previews_features.h" #include "components/previews/core/previews_switches.h" -#include "components/printing/browser/features.h" #include "components/query_tiles/switches.h" #include "components/safe_browsing/core/features.h" #include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h" @@ -3655,10 +3654,6 @@ {"ntp-webui", flag_descriptions::kNtpWebUIName, flag_descriptions::kNtpWebUIDescription, kOsDesktop, FEATURE_VALUE_TYPE(ntp_features::kWebUI)}, - - {"webui-a11y-enhancements", flag_descriptions::kWebUIA11yEnhancementsName, - flag_descriptions::kWebUIA11yEnhancementsDescription, kOsDesktop, - FEATURE_VALUE_TYPE(features::kWebUIA11yEnhancements)}, #endif // !defined(OS_ANDROID) #if defined(DCHECK_IS_CONFIGURABLE)
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index ffbed05..45618b85 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -14,11 +14,14 @@ #import "base/mac/foundation_util.h" #include "base/mac/mac_util.h" #include "base/mac/scoped_nsobject.h" +#include "base/metrics/histogram_functions.h" #include "base/path_service.h" +#include "base/strings/sys_string_conversions.h" #include "base/task/post_task.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" +#include "build/branding_buildflags.h" #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" @@ -29,6 +32,7 @@ #import "chrome/browser/mac/keystone_glue.h" #include "chrome/browser/mac/mac_startup_profiler.h" #include "chrome/browser/ui/cocoa/main_menu_builder.h" +#include "chrome/common/channel_info.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" @@ -36,6 +40,7 @@ #include "components/crash/core/app/crashpad.h" #include "components/metrics/metrics_service.h" #include "components/os_crypt/os_crypt.h" +#include "components/version_info/channel.h" #include "content/public/common/main_function_params.h" #include "content/public/common/result_codes.h" #include "ui/base/l10n/l10n_util.h" @@ -67,6 +72,180 @@ base::BindOnce(&EnsureMetadataNeverIndexFileOnFileThread, user_data_dir)); } +#if BUILDFLAG(GOOGLE_CHROME_BRANDING) + +// These values are persisted to logs as OSXOtherChromeInstancesResult. +// Entries should not be renumbered and numeric values should never be reused. +enum class OtherInstancesResult { + kFailureDontKnowWhenOtherChromeUsed, + kFailureToReadPlist, + kNoOtherChrome, + kOneOtherChromeAndLastUsedWithinWeek, + kOneOtherChromeAndLastUsedWithinMonth, + kOneOtherChromeAndLastUsedMoreThanAMonthAgo, + kMoreThanOneOtherChromeAndLastUsedWithinWeek, + kMoreThanOneOtherChromeAndLastUsedWithinMonth, + kMoreThanOneOtherChromeAndLastUsedMoreThanAMonthAgo, + kMaxValue = kMoreThanOneOtherChromeAndLastUsedMoreThanAMonthAgo, +}; + +struct WhenLastUsed { + int within_last_week = 0; + int within_last_month = 0; + int before_last_month = 0; +}; + +OtherInstancesResult OtherInstancesResultForWhenLastUsed( + const WhenLastUsed& used) { + if (used.within_last_week + used.within_last_month + used.before_last_month == + 0) { + return OtherInstancesResult::kNoOtherChrome; + } + + if (used.within_last_week + used.within_last_month + used.before_last_month == + 1) { + if (used.within_last_week) + return OtherInstancesResult::kOneOtherChromeAndLastUsedWithinWeek; + + if (used.within_last_month) + return OtherInstancesResult::kOneOtherChromeAndLastUsedWithinMonth; + + return OtherInstancesResult::kOneOtherChromeAndLastUsedMoreThanAMonthAgo; + } + + if (used.within_last_week) + return OtherInstancesResult::kMoreThanOneOtherChromeAndLastUsedWithinWeek; + + if (used.within_last_month) + return OtherInstancesResult::kMoreThanOneOtherChromeAndLastUsedWithinMonth; + + return OtherInstancesResult:: + kMoreThanOneOtherChromeAndLastUsedMoreThanAMonthAgo; +} + +void RecordChromeQueryResults(NSMetadataQuery* query) { + __block bool other_chrome_last_used_unknown = false; + __block bool failed_to_read_plist = false; + __block WhenLastUsed same_channel; + __block WhenLastUsed different_channel; + + NSURL* this_url = NSBundle.mainBundle.bundleURL; + std::string this_channel = chrome::GetChannelName(); + NSDate* about_a_week_ago = + [[NSDate date] dateByAddingTimeInterval:-7 * 24 * 60 * 60]; + NSDate* about_a_month_ago = + [[NSDate date] dateByAddingTimeInterval:-30 * 24 * 60 * 60]; + + [query enumerateResultsUsingBlock:^(id result, NSUInteger idx, BOOL* stop) { + // Skip this copy of Chrome. Note that NSMetadataItemURLKey is not used as + // it always returns nil while NSMetadataItemPathKey returns a legit path. + // Filed as FB7689234. + NSString* app_path = base::mac::ObjCCast<NSString>( + [result valueForAttribute:NSMetadataItemPathKey]); + NSURL* app_url = [NSURL fileURLWithPath:app_path isDirectory:YES]; + if ([app_url isEqual:this_url]) + return; + + NSURL* plist_url = [[app_url URLByAppendingPathComponent:@"Contents" + isDirectory:YES] + URLByAppendingPathComponent:@"Info.plist" + isDirectory:NO]; + NSDictionary* plist = [NSDictionary dictionaryWithContentsOfURL:plist_url]; + if (!plist) { + failed_to_read_plist = true; + *stop = YES; + return; + } + + // Skip any SxS-capable copies of Chrome. + if (plist[@"CrProductDirName"]) + return; + + WhenLastUsed* when_last_used = &different_channel; + if (this_channel == base::SysNSStringToUTF8(plist[@"KSChannelID"])) + when_last_used = &same_channel; + + NSDate* last_used = base::mac::ObjCCast<NSDate>( + [result valueForAttribute:NSMetadataItemLastUsedDateKey]); + if (!last_used) { + other_chrome_last_used_unknown = true; + *stop = YES; + return; + } + + if ([last_used compare:about_a_week_ago] == NSOrderedDescending) + ++when_last_used->within_last_week; + else if ([last_used compare:about_a_month_ago] == NSOrderedDescending) + ++when_last_used->within_last_month; + else + ++when_last_used->before_last_month; + }]; + + if (other_chrome_last_used_unknown) { + base::UmaHistogramEnumeration( + "OSX.Installation.OtherChromeInstances.SameChannel", + OtherInstancesResult::kFailureDontKnowWhenOtherChromeUsed); + base::UmaHistogramEnumeration( + "OSX.Installation.OtherChromeInstances.DifferentChannel", + OtherInstancesResult::kFailureDontKnowWhenOtherChromeUsed); + return; + } + + if (failed_to_read_plist) { + base::UmaHistogramEnumeration( + "OSX.Installation.OtherChromeInstances.SameChannel", + OtherInstancesResult::kFailureToReadPlist); + base::UmaHistogramEnumeration( + "OSX.Installation.OtherChromeInstances.DifferentChannel", + OtherInstancesResult::kFailureToReadPlist); + return; + } + + base::UmaHistogramEnumeration( + "OSX.Installation.OtherChromeInstances.SameChannel", + OtherInstancesResultForWhenLastUsed(same_channel)); + base::UmaHistogramEnumeration( + "OSX.Installation.OtherChromeInstances.DifferentChannel", + OtherInstancesResultForWhenLastUsed(different_channel)); +} + +void ExecuteChromeQuery() { + __block NSMetadataQuery* query = [[NSMetadataQuery alloc] init]; + + __block id token = [[NSNotificationCenter defaultCenter] + addObserverForName:NSMetadataQueryDidFinishGatheringNotification + object:query + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification* note) { + [query stopQuery]; + RecordChromeQueryResults(query); + [query release]; + [[NSNotificationCenter defaultCenter] removeObserver:token]; + }]; + + query.predicate = + [NSPredicate predicateWithFormat: + @"kMDItemContentType == 'com.apple.application-bundle'" + @"AND kMDItemCFBundleIdentifier == 'com.google.Chrome'"]; + + [query startQuery]; +} + +// Records statistics about this install of Chromium if it is a Google Chrome +// Beta or Google Chrome Dev instance. This is to allow for decisions to be made +// about the migration of user data directories. +void RecordBetaAndDevStats() { + version_info::Channel channel = chrome::GetChannel(); + if (channel != version_info::Channel::BETA && + channel != version_info::Channel::DEV) { + return; + } + + ExecuteChromeQuery(); +} + +#endif // GOOGLE_CHROME_BRANDING + } // namespace // ChromeBrowserMainPartsMac --------------------------------------------------- @@ -153,6 +332,10 @@ MacStartupProfiler::GetInstance()->Profile( MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START); ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); + +#if BUILDFLAG(GOOGLE_CHROME_BRANDING) + RecordBetaAndDevStats(); +#endif // GOOGLE_CHROME_BRANDING } void ChromeBrowserMainPartsMac::PreProfileInit() {
diff --git a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.cc b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.cc index ccd640a..253f3db 100644 --- a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.cc +++ b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.cc
@@ -558,6 +558,7 @@ FailedWorkerInfo info; info.state = worker.GetPreviousState(); info.public_key = worker.GetPublicKey(); + info.last_update_time = worker.GetLastUpdateTime(); failed_cert_profiles_[worker.GetCertProfile().profile_id] = std::move(info); }
diff --git a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.h b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.h index 4a95879f..d0cdcbfc 100644 --- a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.h +++ b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_scheduler.h
@@ -10,6 +10,7 @@ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" +#include "base/time/time.h" #include "chrome/browser/chromeos/cert_provisioning/cert_provisioning_common.h" #include "chrome/browser/chromeos/cert_provisioning/cert_provisioning_invalidator.h" #include "chrome/browser/chromeos/cert_provisioning/cert_provisioning_platform_keys_helpers.h" @@ -41,6 +42,7 @@ struct FailedWorkerInfo { CertProvisioningWorkerState state = CertProvisioningWorkerState::kInitState; std::string public_key; + base::Time last_update_time; }; // This class is a part of certificate provisioning feature. It tracks updates
diff --git a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.cc b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.cc index 58ba7df..cdd578c 100644 --- a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.cc +++ b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.cc
@@ -199,6 +199,7 @@ CancelScheduledTasks(); is_waiting_ = false; + last_update_time_ = base::Time::NowFromSystemTime(); switch (state_) { case CertProvisioningWorkerState::kInitState: @@ -250,6 +251,7 @@ prev_state_ = state_; state_ = new_state; + last_update_time_ = base::Time::NowFromSystemTime(); if (is_continued_without_invalidation_for_uma_) { RecordEvent( @@ -570,6 +572,10 @@ return prev_state_; } +base::Time CertProvisioningWorkerImpl::GetLastUpdateTime() const { + return last_update_time_; +} + CertProvisioningWorkerState CertProvisioningWorkerImpl::GetState() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return state_; @@ -632,6 +638,7 @@ delay); is_waiting_ = true; + last_update_time_ = base::Time::NowFromSystemTime(); VLOG(0) << "Next step scheduled in " << delay; }
diff --git a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.h b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.h index c1d20cf..c6625d44 100644 --- a/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.h +++ b/chrome/browser/chromeos/cert_provisioning/cert_provisioning_worker.h
@@ -9,6 +9,7 @@ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" +#include "base/time/time.h" #include "chrome/browser/chromeos/attestation/tpm_challenge_key_subtle.h" #include "chrome/browser/chromeos/cert_provisioning/cert_provisioning_common.h" #include "chrome/browser/chromeos/platform_keys/platform_keys_service.h" @@ -91,6 +92,8 @@ // Returns state that was before the current one. Especially helpful on failed // workers. virtual CertProvisioningWorkerState GetPreviousState() const = 0; + // Returns the time when this worker has been last updated. + virtual base::Time GetLastUpdateTime() const = 0; }; class CertProvisioningWorkerImpl : public CertProvisioningWorker { @@ -113,6 +116,7 @@ const std::string& GetPublicKey() const override; CertProvisioningWorkerState GetState() const override; CertProvisioningWorkerState GetPreviousState() const override; + base::Time GetLastUpdateTime() const override; private: friend class CertProvisioningSerializer; @@ -211,6 +215,9 @@ // State that was before the current one. Useful for debugging and cleaning // on failure. CertProvisioningWorkerState prev_state_ = state_; + // Time when this worker has been last updated. + base::Time last_update_time_; + bool is_waiting_ = false; // Used for an UMA metric to track situation when the worker did not receive // an invalidation for a completed server side task.
diff --git a/chrome/browser/chromeos/cert_provisioning/mock_cert_provisioning_worker.h b/chrome/browser/chromeos/cert_provisioning/mock_cert_provisioning_worker.h index 907291b..16d7ad51 100644 --- a/chrome/browser/chromeos/cert_provisioning/mock_cert_provisioning_worker.h +++ b/chrome/browser/chromeos/cert_provisioning/mock_cert_provisioning_worker.h
@@ -73,6 +73,7 @@ GetPreviousState, (), (const override)); + MOCK_METHOD(base::Time, GetLastUpdateTime, (), (const override)); void SetExpectations(testing::Cardinality do_step_times, bool is_waiting,
diff --git a/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc b/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc index 79d06ea0..c90a3979 100644 --- a/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc +++ b/chrome/browser/chromeos/login/arc_terms_of_service_browsertest.cc
@@ -2,38 +2,53 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" + +#include "ash/public/cpp/login_screen_test_api.h" #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/guid.h" #include "base/hash/sha1.h" #include "base/memory/ptr_util.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/arc/session/arc_service_launcher.h" +#include "chrome/browser/chromeos/login/existing_user_controller.h" #include "chrome/browser/chromeos/login/login_wizard.h" #include "chrome/browser/chromeos/login/oobe_screen.h" -#include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" +#include "chrome/browser/chromeos/login/screens/recommend_apps_screen.h" #include "chrome/browser/chromeos/login/test/embedded_test_server_mixin.h" #include "chrome/browser/chromeos/login/test/js_checker.h" +#include "chrome/browser/chromeos/login/test/local_policy_test_server_mixin.h" #include "chrome/browser/chromeos/login/test/login_manager_mixin.h" #include "chrome/browser/chromeos/login/test/oobe_base_test.h" #include "chrome/browser/chromeos/login/test/oobe_screen_exit_waiter.h" #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" +#include "chrome/browser/chromeos/login/test/session_manager_state_waiter.h" #include "chrome/browser/chromeos/login/test/webview_content_extractor.h" #include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/wizard_controller.h" +#include "chrome/browser/chromeos/policy/device_local_account.h" +#include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" +#include "chrome/browser/chromeos/policy/device_policy_builder.h" +#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" #include "chrome/browser/consent_auditor/consent_auditor_factory.h" #include "chrome/browser/consent_auditor/consent_auditor_test_utils.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" +#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_switches.h" +#include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "components/arc/arc_prefs.h" +#include "components/arc/arc_util.h" #include "components/consent_auditor/fake_consent_auditor.h" #include "components/prefs/pref_service.h" +#include "components/web_resource/web_resource_pref_names.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "net/dns/mock_host_resolver.h" @@ -41,6 +56,8 @@ #include "net/test/embedded_test_server/http_response.h" #include "ui/base/l10n/l10n_util.h" +namespace em = enterprise_management; + using consent_auditor::FakeConsentAuditor; using sync_pb::UserConsentTypes; using ArcPlayTermsOfServiceConsent = @@ -57,6 +74,9 @@ namespace { +const char kAccountId[] = "dla@example.com"; +const char kDisplayName[] = "display name"; + constexpr char kTosPath[] = "/about/play-terms.html"; constexpr char kTosContent[] = "Arc TOS for test."; @@ -155,6 +175,12 @@ &ArcTermsOfServiceScreenTest::HandleRequest, base::Unretained(this))); } + void SetUpOnMainThread() override { + // Enable ARC for testing. + arc::ArcServiceLauncher::Get()->ResetForTesting(); + OobeBaseTest::SetUpOnMainThread(); + } + void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kArcAvailability, "officially-supported"); @@ -164,22 +190,43 @@ OobeBaseTest::SetUpCommandLine(command_line); } - void TriggerArcTosScreen() { + void SetUpExitCallback() { ArcTermsOfServiceScreen* terms_of_service_screen = static_cast<ArcTermsOfServiceScreen*>( WizardController::default_controller()->screen_manager()->GetScreen( ArcTermsOfServiceScreenView::kScreenId)); + original_callback_ = + terms_of_service_screen->get_exit_callback_for_testing(); terms_of_service_screen->set_exit_callback_for_testing( base::BindRepeating(&ArcTermsOfServiceScreenTest::ScreenExitCallback, base::Unretained(this))); - // Enable ARC for testing. - arc::ArcServiceLauncher::Get()->ResetForTesting(); + // Skip RecommendAppsScreen because it is shown right after the ArcToS + // screen and doesn't work correctly in the test environment. (More precise, + // it requires display with some particular height/width which is not set.) + RecommendAppsScreen* recommend_apps_screen = + static_cast<RecommendAppsScreen*>( + WizardController::default_controller()->screen_manager()->GetScreen( + RecommendAppsScreenView::kScreenId)); + recommend_apps_screen->SetSkipForTesting(); + } + + void LoginAsRegularUser() { + SetUpExitCallback(); login_manager_mixin_.LoginAsNewReguarUser(); OobeScreenExitWaiter(GaiaView::kScreenId).Wait(); + } + + void ShowArcTosScreen() { + ASSERT_FALSE(screen_exit_result_.has_value()); LoginDisplayHost::default_host()->StartWizard( ArcTermsOfServiceScreenView::kScreenId); } + void TriggerArcTosScreen() { + LoginAsRegularUser(); + ShowArcTosScreen(); + } + protected: // When enabled serves terms of service with a footer that contains a link // to the privacy policy. @@ -197,6 +244,7 @@ } void WaitForTermsOfServiceWebViewToLoad() { + OobeScreenWaiter(ArcTermsOfServiceScreenView::kScreenId).Wait(); test::OobeJS() .CreateHasClassWaiter(true, "arc-tos-loaded", {"arc-tos-root", "arcTosDialog"}) @@ -212,11 +260,15 @@ run_loop.Run(); } + base::HistogramTester histogram_tester_; + private: void ScreenExitCallback(ArcTermsOfServiceScreen::Result result) { ASSERT_FALSE(screen_exit_result_.has_value()); screen_exit_result_ = result; - std::move(on_screen_exit_called_).Run(); + original_callback_.Run(result); + if (on_screen_exit_called_) + std::move(on_screen_exit_called_).Run(); } // Returns the base URL of the embedded test server. @@ -267,7 +319,7 @@ bool serve_tos_with_privacy_policy_footer_ = false; base::Optional<ArcTermsOfServiceScreen::Result> screen_exit_result_; - + ArcTermsOfServiceScreen::ScreenExitCallback original_callback_; base::OnceClosure on_screen_exit_called_ = base::DoNothing(); LoginManagerMixin login_manager_mixin_{&mixin_host_}; @@ -341,7 +393,6 @@ IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, ReviewPlayOptions) { TriggerArcTosScreen(); ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad()); - Profile* profile = ProfileManager::GetActiveUserProfile(); EXPECT_FALSE( profile->GetPrefs()->GetBoolean(prefs::kShowArcSettingsOnSessionStart)); @@ -352,9 +403,15 @@ EXPECT_TRUE( profile->GetPrefs()->GetBoolean(prefs::kShowArcSettingsOnSessionStart)); - WaitForScreenExitResult(); EXPECT_EQ(screen_exit_result(), ArcTermsOfServiceScreen::Result::ACCEPTED); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Accepted", 1); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Skipped", 0); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Back", 0); + histogram_tester_.ExpectTotalCount("OOBE.StepCompletionTime.Arc_tos", 1); } // Test whether google privacy policy can be loaded. @@ -374,6 +431,29 @@ EXPECT_FALSE(screen_exit_result().has_value()); } +IN_PROC_BROWSER_TEST_F(ArcTermsOfServiceScreenTest, BackButtonClicked) { + // Back button is shown only in demo mode. + WizardController::default_controller()->SimulateDemoModeSetupForTesting(); + // Accept EULA cause it is expected in case of back button pressed by + // WizardController::OnArcTermsOfServiceScreenExit. + g_browser_process->local_state()->SetBoolean(prefs::kEulaAccepted, true); + + TriggerArcTosScreen(); + WaitForTermsOfServiceWebViewToLoad(); + + test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosBackButton"}); + + WaitForScreenExitResult(); + EXPECT_EQ(screen_exit_result(), ArcTermsOfServiceScreen::Result::BACK); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Accepted", 0); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Skipped", 0); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Back", 1); + histogram_tester_.ExpectTotalCount("OOBE.StepCompletionTime.Arc_tos", 1); +} + // There are two checkboxes for enabling/disabling arc backup restore and // arc location service. This parameterized test executes all 4 combinations // of enabled/disabled states and checks that advancing to the next screen by @@ -401,6 +481,7 @@ ArcBackupAndRestoreConsent backup_and_restore_consent, ArcGoogleLocationServiceConsent location_service_consent) { ASSERT_NO_FATAL_FAILURE(WaitForTermsOfServiceWebViewToLoad()); + test::OobeJS().ClickOnPath({"arc-tos-root", "arcTosNextButton"}); // Wait for checkboxes to become visible. @@ -462,10 +543,129 @@ WaitForScreenExitResult(); EXPECT_EQ(screen_exit_result(), ArcTermsOfServiceScreen::Result::ACCEPTED); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Accepted", 1); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Skipped", 0); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Back", 0); + histogram_tester_.ExpectTotalCount("OOBE.StepCompletionTime.Arc_tos", 1); } INSTANTIATE_TEST_SUITE_P(All, ParameterizedArcTermsOfServiceScreenTest, testing::Combine(testing::Bool(), testing::Bool())); +class PublicAccountArcTermsOfServiceScreenTest + : public ArcTermsOfServiceScreenTest { + public: + PublicAccountArcTermsOfServiceScreenTest() = default; + ~PublicAccountArcTermsOfServiceScreenTest() override = default; + + void SetUpInProcessBrowserTestFixture() override { + ArcTermsOfServiceScreenTest::SetUpInProcessBrowserTestFixture(); + chromeos::SessionManagerClient::InitializeFakeInMemory(); + InitializePolicy(); + } + + void InitializePolicy() { + device_policy()->policy_data().set_public_key_version(1); + policy::DeviceLocalAccountTestHelper::SetupDeviceLocalAccount( + &device_local_account_policy_, kAccountId, kDisplayName); + UploadDeviceLocalAccountPolicy(); + } + + void BuildDeviceLocalAccountPolicy() { + device_local_account_policy_.SetDefaultSigningKey(); + device_local_account_policy_.Build(); + } + + void UploadDeviceLocalAccountPolicy() { + BuildDeviceLocalAccountPolicy(); + ASSERT_TRUE(local_policy_mixin_.server()->UpdatePolicy( + policy::dm_protocol::kChromePublicAccountPolicyType, kAccountId, + device_local_account_policy_.payload().SerializeAsString())); + } + + void UploadAndInstallDeviceLocalAccountPolicy() { + UploadDeviceLocalAccountPolicy(); + session_manager_client()->set_device_local_account_policy( + kAccountId, device_local_account_policy_.GetBlob()); + } + + void AddPublicSessionToDevicePolicy() { + em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); + policy::DeviceLocalAccountTestHelper::AddPublicSession(&proto, kAccountId); + RefreshDevicePolicy(); + ASSERT_TRUE(local_policy_mixin_.UpdateDevicePolicy(proto)); + } + + void WaitForDisplayName() { + policy::DictionaryLocalStateValueWaiter("UserDisplayName", kDisplayName, + account_id_.GetUserEmail()) + .Wait(); + } + + void WaitForPolicy() { + // Wait for the display name becoming available as that indicates + // device-local account policy is fully loaded, which is a prerequisite for + // successful login. + WaitForDisplayName(); + } + + void StartLogin() { + ASSERT_TRUE(ash::LoginScreenTestApi::ExpandPublicSessionPod(account_id_)); + ash::LoginScreenTestApi::ClickPublicExpandedSubmitButton(); + } + + void StartPublicSession() { + UploadAndInstallDeviceLocalAccountPolicy(); + AddPublicSessionToDevicePolicy(); + WaitForPolicy(); + StartLogin(); + } + + private: + chromeos::FakeSessionManagerClient* session_manager_client() { + return chromeos::FakeSessionManagerClient::Get(); + } + + void RefreshDevicePolicy() { policy_helper()->RefreshDevicePolicy(); } + + policy::DevicePolicyBuilder* device_policy() { + return policy_helper()->device_policy(); + } + + policy::DevicePolicyCrosTestHelper* policy_helper() { + return &policy_helper_; + } + + const AccountId account_id_ = + AccountId::FromUserEmail(GenerateDeviceLocalAccountUserId( + kAccountId, + policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION)); + policy::DevicePolicyCrosTestHelper policy_helper_; + policy::UserPolicyBuilder device_local_account_policy_; + chromeos::LocalPolicyTestServerMixin local_policy_mixin_{&mixin_host_}; + chromeos::DeviceStateMixin device_state_{ + &mixin_host_, + chromeos::DeviceStateMixin::State::OOBE_COMPLETED_CLOUD_ENROLLED}; + DISALLOW_COPY_AND_ASSIGN(PublicAccountArcTermsOfServiceScreenTest); +}; + +IN_PROC_BROWSER_TEST_F(PublicAccountArcTermsOfServiceScreenTest, + SkippedForPublicAccount) { + StartPublicSession(); + ShowArcTosScreen(); + + chromeos::test::WaitForPrimaryUserSessionStart(); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Accepted", 0); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Skipped", 0); + histogram_tester_.ExpectTotalCount( + "OOBE.StepCompletionTimeByExitReason.Arc-tos.Back", 0); + histogram_tester_.ExpectTotalCount("OOBE.StepCompletionTime.Arc_tos", 0); +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/configuration_keys.cc b/chrome/browser/chromeos/login/configuration_keys.cc index 5b7925d3..683a96b 100644 --- a/chrome/browser/chromeos/login/configuration_keys.cc +++ b/chrome/browser/chromeos/login/configuration_keys.cc
@@ -11,7 +11,8 @@ // Configuration keys that are used to automate OOBE screens go here. // Please keep keys grouped by screens and ordered according to OOBE flow. // All keys should be listed here, even if they are used in JS code only. -// These keys are used in chrome/browser/resources/chromeos/login/oobe_types.js +// These keys are used in +// chrome/browser/resources/chromeos/login/components/oobe_types.js // == HID Detection screen:
diff --git a/chrome/browser/chromeos/login/login_ui_browsertest.cc b/chrome/browser/chromeos/login/login_ui_browsertest.cc index 7263474..1393111 100644 --- a/chrome/browser/chromeos/login/login_ui_browsertest.cc +++ b/chrome/browser/chromeos/login/login_ui_browsertest.cc
@@ -235,4 +235,17 @@ test_user_.account_id)); } +// Checks that system info is visible independent of the Oobe dialog state. +IN_PROC_BROWSER_TEST_F(LoginUITestBase, SystemInfoVisible) { + // No dialog due to existing users. + EXPECT_FALSE(ash::LoginScreenTestApi::IsOobeDialogVisible()); + EXPECT_TRUE(ash::LoginScreenTestApi::IsSystemInfoShown()); + + // Open Oobe dialog. + EXPECT_TRUE(ash::LoginScreenTestApi::ClickAddUserButton()); + + EXPECT_TRUE(ash::LoginScreenTestApi::IsOobeDialogVisible()); + EXPECT_TRUE(ash::LoginScreenTestApi::IsSystemInfoShown()); +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc b/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc index 57395152..1e0d52a 100644 --- a/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc +++ b/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.cc
@@ -6,6 +6,7 @@ #include "base/feature_list.h" #include "base/metrics/histogram_functions.h" +#include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/metrics/metrics_reporting_state.h" #include "chrome/browser/profiles/profile.h" @@ -15,6 +16,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h" #include "chrome/common/pref_names.h" #include "chrome/common/webui_url_constants.h" +#include "components/arc/arc_prefs.h" #include "components/prefs/pref_service.h" namespace { @@ -33,6 +35,8 @@ return "Accepted"; case Result::BACK: return "Back"; + case Result::NOT_APPLICABLE: + return BaseScreen::kNotApplicable; } } @@ -69,10 +73,20 @@ } } +bool ArcTermsOfServiceScreen::MaybeSkip() { + if (!arc::IsArcTermsOfServiceOobeNegotiationNeeded()) { + exit_callback_.Run(Result::NOT_APPLICABLE); + return true; + } + return false; +} + void ArcTermsOfServiceScreen::ShowImpl() { if (!view_) return; + ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean( + arc::prefs::kArcTermsShownInOobe, true); // Show the screen. view_->Show(); }
diff --git a/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h b/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h index 3f822b59..7170e436 100644 --- a/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h +++ b/chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h
@@ -21,7 +21,7 @@ class ArcTermsOfServiceScreen : public BaseScreen, public ArcTermsOfServiceScreenViewObserver { public: - enum class Result { ACCEPTED, BACK }; + enum class Result { ACCEPTED, BACK, NOT_APPLICABLE }; static std::string GetResultString(Result result); @@ -34,16 +34,21 @@ const ScreenExitCallback& exit_callback); ~ArcTermsOfServiceScreen() override; + void set_exit_callback_for_testing(const ScreenExitCallback& exit_callback) { + exit_callback_ = exit_callback; + } + + const ScreenExitCallback& get_exit_callback_for_testing() { + return exit_callback_; + } + // ArcTermsOfServiceScreenViewObserver: void OnAccept(bool review_arc_settings) override; void OnViewDestroyed(ArcTermsOfServiceScreenView* view) override; - void set_exit_callback_for_testing(ScreenExitCallback exit_callback) { - exit_callback_ = exit_callback; - } - protected: // BaseScreen: + bool MaybeSkip() override; void ShowImpl() override; void HideImpl() override; void OnUserAction(const std::string& action_id) override;
diff --git a/chrome/browser/chromeos/login/screens/recommend_apps_screen.cc b/chrome/browser/chromeos/login/screens/recommend_apps_screen.cc index edce1be..cd7258a 100644 --- a/chrome/browser/chromeos/login/screens/recommend_apps_screen.cc +++ b/chrome/browser/chromeos/login/screens/recommend_apps_screen.cc
@@ -76,7 +76,7 @@ ->GetProfilePolicyConnector() ->IsManaged(); bool is_child_account = user_manager->IsLoggedInAsChildUser(); - if (is_managed_account || is_child_account) { + if (is_managed_account || is_child_account || skip_for_testing_) { exit_callback_.Run(Result::NOT_APPLICABLE); return true; }
diff --git a/chrome/browser/chromeos/login/screens/recommend_apps_screen.h b/chrome/browser/chromeos/login/screens/recommend_apps_screen.h index 54c0419..f097dec88 100644 --- a/chrome/browser/chromeos/login/screens/recommend_apps_screen.h +++ b/chrome/browser/chromeos/login/screens/recommend_apps_screen.h
@@ -51,6 +51,8 @@ // Called when the view is destroyed so there is no dead reference to it. void OnViewDestroyed(RecommendAppsScreenView* view); + void SetSkipForTesting() { skip_for_testing_ = true; } + // RecommendAppsFetcherDelegate: void OnLoadSuccess(const base::Value& app_list) override; void OnLoadError() override; @@ -73,6 +75,9 @@ std::unique_ptr<RecommendAppsFetcher> recommend_apps_fetcher_; + // Skip the screen for testing if set to true. + bool skip_for_testing_ = false; + DISALLOW_COPY_AND_ASSIGN(RecommendAppsScreen); };
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index c45d0816..9358ba4 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -692,13 +692,7 @@ } void WizardController::ShowArcTermsOfServiceScreen() { - if (arc::IsArcTermsOfServiceOobeNegotiationNeeded()) { - SetCurrentScreen(GetScreen(ArcTermsOfServiceScreenView::kScreenId)); - ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean( - arc::prefs::kArcTermsShownInOobe, true); - } else { - ShowAssistantOptInFlowScreen(); - } + SetCurrentScreen(GetScreen(ArcTermsOfServiceScreenView::kScreenId)); } void WizardController::ShowRecommendAppsScreen() { @@ -1120,6 +1114,9 @@ case ArcTermsOfServiceScreen::Result::ACCEPTED: OnArcTermsOfServiceAccepted(); break; + case ArcTermsOfServiceScreen::Result::NOT_APPLICABLE: + ShowAssistantOptInFlowScreen(); + break; case ArcTermsOfServiceScreen::Result::BACK: DCHECK(demo_setup_controller_); DCHECK(StartupUtils::IsEulaAccepted());
diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc index ee7a8d4..898fdc2d0 100644 --- a/chrome/browser/content_settings/content_settings_browsertest.cc +++ b/chrome/browser/content_settings/content_settings_browsertest.cc
@@ -105,7 +105,13 @@ void Wait() { run_loop_.Run(); } - void OnCookiesAccessed(const content::CookieAccessDetails& details) override { + void OnCookiesAccessed(content::RenderFrameHost* render_frame_host, + const content::CookieAccessDetails& details) override { + run_loop_.Quit(); + } + + void OnCookiesAccessed(content::NavigationHandle* navigation, + const content::CookieAccessDetails& details) override { run_loop_.Quit(); }
diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java index 3a4ef1b..0af2e084 100644 --- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java
@@ -18,6 +18,7 @@ import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.modaldialog.DialogDismissalCause; import org.chromium.ui.modaldialog.ModalDialogManager; +import org.chromium.ui.modaldialog.ModalDialogManagerHolder; import org.chromium.ui.modaldialog.ModalDialogProperties; import org.chromium.ui.modelutil.PropertyModel; @@ -65,7 +66,7 @@ return; } - mModalDialogManager = windowAndroid.getModalDialogManager(); + mModalDialogManager = ((ModalDialogManagerHolder) activity).getModalDialogManager(); mContext = activity; mTotalBytes = totalBytes; mDialogType = dialogType;
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 1870aa2..81473247 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -4307,11 +4307,6 @@ "expiry_milestone": 86 }, { - "name": "webui-a11y-enhancements", - "owners": [ "aee" ], - "expiry_milestone": 82 - }, - { "name": "webui-tab-strip", "owners": [ "collinbaker", "johntlee" ], "expiry_milestone": 85
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 2ca838b..07dc288 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2950,15 +2950,6 @@ "Enables freezing eligible tabs when they have been backgrounded for 5 " "minutes."; -const char kWebUIA11yEnhancementsName[] = - "Enable accessibility enhancements in WebUI"; -const char kWebUIA11yEnhancementsDescription[] = - "This flag covers a wide variety of accessibility enhancements in WebUI " - "and is used to demonstrate the enhancements for review and testing. When " - "a enhancement is ready to be released, the enhancement will be taken out " - "from behind this feature flag. This flag will remain disabled and ready " - "to be used for other enhancements."; - const char kSyncSetupFriendlySettingsName[] = "Sync setup friendly settings"; const char kSyncSetupFriendlySettingsDescription[] = "Enable the new sync setup friendly settings";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 683ca3a..fc1afdd52 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1702,9 +1702,6 @@ extern const char kTabFreezeName[]; extern const char kTabFreezeDescription[]; -extern const char kWebUIA11yEnhancementsName[]; -extern const char kWebUIA11yEnhancementsDescription[]; - extern const char kSyncSetupFriendlySettingsName[]; extern const char kSyncSetupFriendlySettingsDescription[];
diff --git a/chrome/browser/media/feeds/media_feeds_converter.cc b/chrome/browser/media/feeds/media_feeds_converter.cc index 5ae5380..0089b7b 100644 --- a/chrome/browser/media/feeds/media_feeds_converter.cc +++ b/chrome/browser/media/feeds/media_feeds_converter.cc
@@ -1126,21 +1126,34 @@ std::map<int, int> number_of_episodes; auto* season = GetProperty(item.get(), schema_org::property::kContainsSeason); + if (season && !GetSeason(*season, &number_of_episodes)) return false; + auto episodes = GetEpisodeCandidates(item.get()); if (!episodes.has_value()) return false; + auto main_episode = PickMainEpisode(episodes.value()); if (main_episode.has_value() && !GetEpisode(main_episode.value(), converted_item)) return false; + auto next_episode = PickPlayNextCandidate(episodes.value(), main_episode, number_of_episodes); if (next_episode.has_value() && !GetPlayNextCandidate(next_episode.value(), converted_item)) { return false; } + + // Attempt to set the duration of the item if there is no embedded duration + // in an episode. + if (!converted_item->tv_episode && + !convert_property.Run( + schema_org::property::kDuration, /*is_required=*/false, + base::BindOnce(&GetDuration<mojom::MediaFeedItem>))) { + return false; + } } bool has_embedded_action =
diff --git a/chrome/browser/media/feeds/media_feeds_converter_unittest.cc b/chrome/browser/media/feeds/media_feeds_converter_unittest.cc index 66e50e0..a67e91e 100644 --- a/chrome/browser/media/feeds/media_feeds_converter_unittest.cc +++ b/chrome/browser/media/feeds/media_feeds_converter_unittest.cc
@@ -874,6 +874,22 @@ EXPECT_TRUE(result.value().empty()); } +TEST_F(MediaFeedsConverterTest, SucceedsTVSeriesWithNoEpisode) { + EntityPtr item = ValidMediaFeedItem(); + item->type = schema_org::entity::kTVSeries; + + EntityPtr entity = AddItemToFeed(ValidMediaFeed(), std::move(item)); + + mojom::MediaFeedItemPtr expected_item = ExpectedFeedItem(); + expected_item->type = mojom::MediaFeedItemType::kTVSeries; + + auto result = GetResults(std::move(entity)); + + ASSERT_TRUE(result.has_value()); + ASSERT_EQ(result.value().size(), 1u); + EXPECT_EQ(expected_item, result.value()[0]); +} + // Successfully converts a TV episode with embedded watch action and optional // identifiers. TEST_F(MediaFeedsConverterTest, SucceedsItemWithTVEpisode) { @@ -978,7 +994,6 @@ mojom::MediaFeedItemPtr expected_item = ExpectedFeedItem(); expected_item->type = mojom::MediaFeedItemType::kTVSeries; - expected_item->duration = base::nullopt; auto result = GetResults(std::move(entity));
diff --git a/chrome/browser/omnibox/suggestions/autocomplete_result_unittest.cc b/chrome/browser/omnibox/suggestions/autocomplete_result_unittest.cc new file mode 100644 index 0000000..ebc3e0d --- /dev/null +++ b/chrome/browser/omnibox/suggestions/autocomplete_result_unittest.cc
@@ -0,0 +1,26 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/android/jni_android.h" +#include "base/test/scoped_feature_list.h" +#include "chrome/android/native_j_unittests_jni_headers/AutocompleteResultUnitTest_jni.h" +#include "testing/gtest/include/gtest/gtest.h" + +using base::android::AttachCurrentThread; + +class AutocompleteResultUnitTest : public ::testing::Test { + public: + AutocompleteResultUnitTest() + : j_test_(Java_AutocompleteResultUnitTest_Constructor( + AttachCurrentThread())) {} + + const base::android::ScopedJavaGlobalRef<jobject>& j_test() { + return j_test_; + } + + private: + base::android::ScopedJavaGlobalRef<jobject> j_test_; +}; + +JAVA_TESTS(AutocompleteResultUnitTest, j_test())
diff --git a/chrome/browser/omnibox/suggestions/cached_zero_suggestions_manager_unittest.cc b/chrome/browser/omnibox/suggestions/cached_zero_suggestions_manager_unittest.cc index 6f308ea..06d04f41 100644 --- a/chrome/browser/omnibox/suggestions/cached_zero_suggestions_manager_unittest.cc +++ b/chrome/browser/omnibox/suggestions/cached_zero_suggestions_manager_unittest.cc
@@ -19,11 +19,6 @@ return j_test_; } - void SetUp() override { - Java_CachedZeroSuggestionsManagerUnitTest_setUp(AttachCurrentThread(), - j_test_); - } - private: base::android::ScopedJavaGlobalRef<jobject> j_test_; };
diff --git a/chrome/browser/printing/print_browsertest.cc b/chrome/browser/printing/print_browsertest.cc index b2de88b..3de2b60 100644 --- a/chrome/browser/printing/print_browsertest.cc +++ b/chrome/browser/printing/print_browsertest.cc
@@ -25,7 +25,6 @@ #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "components/prefs/pref_service.h" -#include "components/printing/browser/features.h" #include "components/printing/browser/print_composite_client.h" #include "components/printing/browser/print_manager_utils.h" #include "components/printing/common/print.mojom.h"
diff --git a/chrome/browser/query_tiles/tile_background_task.cc b/chrome/browser/query_tiles/tile_background_task.cc index 42b6a26..52dab8d 100644 --- a/chrome/browser/query_tiles/tile_background_task.cc +++ b/chrome/browser/query_tiles/tile_background_task.cc
@@ -52,7 +52,7 @@ auto* tile_service = upboarding::TileServiceFactory::GetInstance()->GetForKey(key); DCHECK(tile_service); - tile_service->StartFetchForTiles(std::move(callback)); + tile_service->StartFetchForTiles(is_from_reduced_mode, std::move(callback)); } } // namespace upboarding
diff --git a/chrome/browser/resources/bookmarks/bookmarks.html b/chrome/browser/resources/bookmarks/bookmarks.html index 5869e33..2b1fee2 100644 --- a/chrome/browser/resources/bookmarks/bookmarks.html +++ b/chrome/browser/resources/bookmarks/bookmarks.html
@@ -1,6 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading" - $i18n{a11yenhanced}> +<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading"> <head> <meta charset="utf8"> <base href="chrome://bookmarks">
diff --git a/chrome/browser/resources/bookmarks/item.html b/chrome/browser/resources/bookmarks/item.html index def6e11..f6501519 100644 --- a/chrome/browser/resources/bookmarks/item.html +++ b/chrome/browser/resources/bookmarks/item.html
@@ -15,10 +15,6 @@ background-color: var(--highlight-color); } - :host([is-selected-item_]) cr-icon-button { - --cr-icon-button-fill-color-focus: var(--highlight-color); - } - @media (prefers-color-scheme: dark) { :host([is-selected-item_]), :host([is-selected-item_]) .folder-icon {
diff --git a/chrome/browser/resources/bookmarks/toolbar.html b/chrome/browser/resources/bookmarks/toolbar.html index 1f85ea82..764da79 100644 --- a/chrome/browser/resources/bookmarks/toolbar.html +++ b/chrome/browser/resources/bookmarks/toolbar.html
@@ -10,7 +10,6 @@ } cr-icon-button { - --cr-icon-button-fill-color-focus: var(--cr-toolbar-background-color); justify-content: flex-end; margin: 4px; }
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.html b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.html index 6705547..11e9f0e 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.html +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.html
@@ -19,7 +19,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html"> <include src="../login/components/common_styles.html"> -<include src="../login/hd-iron-icon.html"> +<include src="../login/components/hd-iron-icon.html"> <include src="../login/components/oobe_buttons.html"> <include src="../login/components/oobe_dialog.html"> <include src="assistant_optin_flow.html">
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js index d42c720dc..6632a14 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin.js
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// <include src="../login/hd-iron-icon.js"> -// <include src="../login/oobe_types.js"> -// <include src="../login/oobe_i18n_behavior.js"> +// <include src="../login/components/hd-iron-icon.js"> +// <include src="../login/components/oobe_types.js"> +// <include src="../login/components/oobe_i18n_behavior.js"> // <include src="../login/components/oobe_buttons.js"> -// <include src="../login/oobe_dialog_host_behavior.js"> +// <include src="../login/components/oobe_dialog_host_behavior.js"> // <include src="../login/components/oobe_dialog.js"> // <include src="assistant_optin_flow.js">
diff --git a/chrome/browser/resources/chromeos/login/BUILD.gn b/chrome/browser/resources/chromeos/login/BUILD.gn index 4dc995d..9142c970 100644 --- a/chrome/browser/resources/chromeos/login/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/BUILD.gn
@@ -21,7 +21,6 @@ ":gaia_input_form", ":gaia_password_changed", ":gesture_navigation", - ":hd-iron-icon", ":marketing_opt_in", ":multidevice_setup_first_run", ":navigation_bar", @@ -32,7 +31,6 @@ ":oobe_a11y_option", ":oobe_enable_kiosk", ":oobe_eula", - ":oobe_i18n_behavior", ":oobe_i18n_dropdown", ":oobe_network", ":oobe_reset", @@ -51,51 +49,23 @@ ############################### # Closure compiler libraries below -js_library("oobe_types") { -} - -# This is special file to be used as a substutute of Oobe object for closure -# compilation until we make real one closure compile. -# TODO (https://crbug.com/950198) -js_library("fake_oobe") { - deps = [ - ":oobe_types", - "//ui/login:display_manager_types", - "//ui/webui/resources/js:util", - ] -} - -js_library("login_screen_behavior") { - deps = [ - ":fake_oobe", - "//ui/login:display_manager_types", - ] -} - -js_library("oobe_i18n_behavior") { - deps = [ "//ui/webui/resources/js:i18n_behavior" ] -} - -js_library("oobe_dialog_host_behavior") { -} - js_library("oobe_select") { } js_library("oobe_welcome") { deps = [ - ":fake_oobe", - ":login_screen_behavior", - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:fake_oobe", + "components:login_screen_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("offline_ad_login") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", ":oobe_select", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", "//ui/webui/resources/cr_elements/cr_input:cr_input", "//ui/webui/resources/js:load_time_data", ] @@ -103,7 +73,7 @@ js_library("multidevice_setup_first_run") { deps = [ - ":oobe_i18n_behavior", + "components:oobe_i18n_behavior", "//ui/webui/resources/cr_components/chromeos/multidevice_setup:mojo_api", "//ui/webui/resources/cr_components/chromeos/multidevice_setup:multidevice_setup", "//ui/webui/resources/js:cr", @@ -111,49 +81,49 @@ } js_library("active_directory_password_change") { - deps = [ ":oobe_i18n_behavior" ] + deps = [ "components:oobe_i18n_behavior" ] } js_library("app_downloading") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("arc_terms_of_service") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", "components:oobe_help_dialog", + "components:oobe_i18n_behavior", ] } js_library("demo_preferences") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("demo_setup") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("encryption_migration") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("fingerprint_setup") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", "//ui/webui/resources/cr_elements/chromeos/cr_lottie:cr_lottie", "//ui/webui/resources/cr_elements/cr_fingerprint:cr_fingerprint_progress_arc", ] @@ -175,24 +145,21 @@ } js_library("gaia_password_changed") { - deps = [ ":oobe_i18n_behavior" ] + deps = [ "components:oobe_i18n_behavior" ] } js_library("gesture_navigation") { deps = [ - ":login_screen_behavior", - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:login_screen_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } -js_library("hd-iron-icon") { -} - js_library("marketing_opt_in") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } @@ -211,8 +178,8 @@ js_library("offline_gaia") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } @@ -221,67 +188,67 @@ js_library("oobe_enable_kiosk") { deps = [ - ":login_screen_behavior", - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:login_screen_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("oobe_eula") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", "components:oobe_dialog", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("oobe_i18n_dropdown") { - deps = [ ":oobe_types" ] + deps = [ "components:oobe_types" ] } js_library("oobe_network") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("oobe_reset") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("oobe_supervision_transition") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("oobe_update") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("recommend_apps") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] } js_library("saml_confirm_password") { - deps = [ ":oobe_i18n_behavior" ] + deps = [ "components:oobe_i18n_behavior" ] } js_library("sync_consent") { deps = [ - ":oobe_dialog_host_behavior", - ":oobe_i18n_behavior", + "components:oobe_dialog_host_behavior", + "components:oobe_i18n_behavior", ] }
diff --git a/chrome/browser/resources/chromeos/login/components/BUILD.gn b/chrome/browser/resources/chromeos/login/components/BUILD.gn index 036b2d7..59876172 100644 --- a/chrome/browser/resources/chromeos/login/components/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/components/BUILD.gn
@@ -7,10 +7,16 @@ js_type_check("closure_compile") { deps = [ + ":fake_oobe", + ":hd-iron-icon", ":html-echo", + ":login_screen_behavior", ":oobe_buttons", ":oobe_dialog", + ":oobe_dialog_host_behavior", ":oobe_help_dialog", + ":oobe_i18n_behavior", + ":oobe_types", ":progress_list_item", ] } @@ -18,25 +24,56 @@ ############################### # Closure compiler libraries below +js_library("oobe_types") { +} + +# This is special file to be used as a substutute of Oobe object for closure +# compilation until we make real one closure compile. +# TODO (https://crbug.com/950198) +js_library("fake_oobe") { + deps = [ + ":oobe_types", + "//ui/login:display_manager_types", + "//ui/webui/resources/js:util", + ] +} + +js_library("oobe_i18n_behavior") { + deps = [ "//ui/webui/resources/js:i18n_behavior" ] +} + +js_library("login_screen_behavior") { + deps = [ + ":fake_oobe", + "//ui/login:display_manager_types", + ] +} + js_library("oobe_buttons") { - deps = [ "../:oobe_i18n_behavior" ] + deps = [ ":oobe_i18n_behavior" ] } js_library("oobe_dialog") { deps = [ - "../:fake_oobe", + ":fake_oobe", "//ui/webui/resources/cr_elements:cr_scrollable_behavior", "//ui/webui/resources/cr_elements/cr_lazy_render:cr_lazy_render", ] } +js_library("oobe_dialog_host_behavior") { +} + js_library("oobe_help_dialog") { - deps = [ "../:oobe_i18n_behavior" ] + deps = [ ":oobe_i18n_behavior" ] +} + +js_library("hd-iron-icon") { } js_library("html-echo") { } js_library("progress_list_item") { - deps = [ "../:oobe_i18n_behavior" ] + deps = [ ":oobe_i18n_behavior" ] }
diff --git a/chrome/browser/resources/chromeos/login/fake_oobe.js b/chrome/browser/resources/chromeos/login/components/fake_oobe.js similarity index 100% rename from chrome/browser/resources/chromeos/login/fake_oobe.js rename to chrome/browser/resources/chromeos/login/components/fake_oobe.js
diff --git a/chrome/browser/resources/chromeos/login/hd-iron-icon.css b/chrome/browser/resources/chromeos/login/components/hd-iron-icon.css similarity index 100% rename from chrome/browser/resources/chromeos/login/hd-iron-icon.css rename to chrome/browser/resources/chromeos/login/components/hd-iron-icon.css
diff --git a/chrome/browser/resources/chromeos/login/hd-iron-icon.html b/chrome/browser/resources/chromeos/login/components/hd-iron-icon.html similarity index 100% rename from chrome/browser/resources/chromeos/login/hd-iron-icon.html rename to chrome/browser/resources/chromeos/login/components/hd-iron-icon.html
diff --git a/chrome/browser/resources/chromeos/login/hd-iron-icon.js b/chrome/browser/resources/chromeos/login/components/hd-iron-icon.js similarity index 100% rename from chrome/browser/resources/chromeos/login/hd-iron-icon.js rename to chrome/browser/resources/chromeos/login/components/hd-iron-icon.js
diff --git a/chrome/browser/resources/chromeos/login/login_screen_behavior.js b/chrome/browser/resources/chromeos/login/components/login_screen_behavior.js similarity index 100% rename from chrome/browser/resources/chromeos/login/login_screen_behavior.js rename to chrome/browser/resources/chromeos/login/components/login_screen_behavior.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_dialog_host_behavior.js b/chrome/browser/resources/chromeos/login/components/oobe_dialog_host_behavior.js similarity index 100% rename from chrome/browser/resources/chromeos/login/oobe_dialog_host_behavior.js rename to chrome/browser/resources/chromeos/login/components/oobe_dialog_host_behavior.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_i18n_behavior.js b/chrome/browser/resources/chromeos/login/components/oobe_i18n_behavior.js similarity index 100% rename from chrome/browser/resources/chromeos/login/oobe_i18n_behavior.js rename to chrome/browser/resources/chromeos/login/components/oobe_i18n_behavior.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_icons.html b/chrome/browser/resources/chromeos/login/components/oobe_icons.html similarity index 100% rename from chrome/browser/resources/chromeos/login/oobe_icons.html rename to chrome/browser/resources/chromeos/login/components/oobe_icons.html
diff --git a/chrome/browser/resources/chromeos/login/oobe_types.js b/chrome/browser/resources/chromeos/login/components/oobe_types.js similarity index 100% rename from chrome/browser/resources/chromeos/login/oobe_types.js rename to chrome/browser/resources/chromeos/login/components/oobe_types.js
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_login.html b/chrome/browser/resources/chromeos/login/custom_elements_login.html index 7e0e1f0b..313e359 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_login.html +++ b/chrome/browser/resources/chromeos/login/custom_elements_login.html
@@ -1,4 +1,6 @@ <include src="components/common_styles.html"> +<include src="components/hd-iron-icon.html"> +<include src="components/oobe_icons.html"> <include src="components/oobe_buttons.html"> <include src="components/oobe_dialog.html"> <include src="components/oobe_help_dialog.html"> @@ -8,8 +10,6 @@ <include src="gaia_header.html"> <include src="gaia_input_form.html"> <include src="gaia_input.html"> -<include src="hd-iron-icon.html"> -<include src="oobe_icons.html"> <include src="gaia_password_changed.html"> <include src="screen_gaia_signin.html"> <include src="offline_gaia.html">
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_login.js b/chrome/browser/resources/chromeos/login/custom_elements_login.js index 43f8998..8b370f9 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_login.js +++ b/chrome/browser/resources/chromeos/login/custom_elements_login.js
@@ -3,11 +3,12 @@ // found in the LICENSE file. // This inclusion is types-only. No actual code to execute. -// <include src="oobe_types.js"> +// <include src="components/oobe_types.js"> -// <include src="oobe_i18n_behavior.js"> -// <include src="oobe_dialog_host_behavior.js"> -// <include src="login_screen_behavior.js"> +// <include src="components/oobe_i18n_behavior.js"> +// <include src="components/oobe_dialog_host_behavior.js"> +// <include src="components/login_screen_behavior.js"> +// <include src="components/hd-iron-icon.js"> // <include src="components/html-echo.js"> // <include src="components/oobe_buttons.js"> // <include src="components/oobe_dialog.js"> @@ -17,7 +18,6 @@ // <include src="gaia_header.js"> // <include src="gaia_input_form.js"> // <include src="gaia_input.js"> -// <include src="hd-iron-icon.js"> // <include src="gaia_password_changed.js"> // <include src="screen_gaia_signin.js"> // <include src="offline_gaia.js">
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_oobe.html b/chrome/browser/resources/chromeos/login/custom_elements_oobe.html index d6d4da27..592376c6 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_oobe.html +++ b/chrome/browser/resources/chromeos/login/custom_elements_oobe.html
@@ -1,4 +1,6 @@ <include src="components/common_styles.html"> +<include src="components/hd-iron-icon.html"> +<include src="components/oobe_icons.html"> <include src="components/oobe_buttons.html"> <include src="components/oobe_dialog.html"> <include src="components/oobe_help_dialog.html"> @@ -8,8 +10,6 @@ <include src="gaia_header.html"> <include src="gaia_input_form.html"> <include src="gaia_input.html"> -<include src="hd-iron-icon.html"> -<include src="oobe_icons.html"> <include src="gaia_password_changed.html"> <include src="screen_gaia_signin.html"> <include src="network_select_login.html">
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_oobe.js b/chrome/browser/resources/chromeos/login/custom_elements_oobe.js index 450ea16c..edde8dc 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_oobe.js +++ b/chrome/browser/resources/chromeos/login/custom_elements_oobe.js
@@ -3,15 +3,16 @@ // found in the LICENSE file. // This inclusion is types-only. No actual code to execute. -// <include src="oobe_types.js"> +// <include src="components/oobe_types.js"> // This inclusion should go before other non-trivial includes, as // <{controller,host}-paring-screen> depend of it. // <include src="oobe-screen.js"> -// <include src="oobe_i18n_behavior.js"> -// <include src="oobe_dialog_host_behavior.js"> -// <include src="login_screen_behavior.js"> +// <include src="components/oobe_i18n_behavior.js"> +// <include src="components/oobe_dialog_host_behavior.js"> +// <include src="components/login_screen_behavior.js"> +// <include src="components/hd-iron-icon.js"> // <include src="components/html-echo.js"> // <include src="components/oobe_buttons.js"> // <include src="components/oobe_dialog.js"> @@ -21,7 +22,6 @@ // <include src="gaia_header.js"> // <include src="gaia_input_form.js"> // <include src="gaia_input.js"> -// <include src="hd-iron-icon.js"> // <include src="gaia_password_changed.js"> // <include src="screen_gaia_signin.js"> // <include src="network_select_login.js">
diff --git a/chrome/browser/resources/chromeos/login/discover/discover_app.html b/chrome/browser/resources/chromeos/login/discover/discover_app.html index e4c54ef4..0cb4352 100644 --- a/chrome/browser/resources/chromeos/login/discover/discover_app.html +++ b/chrome/browser/resources/chromeos/login/discover/discover_app.html
@@ -20,10 +20,10 @@ </head> <body> <include src="../components/common_styles.html"> - <include src="../hd-iron-icon.html"> + <include src="../components/hd-iron-icon.html"> <include src="../components/oobe_buttons.html"> <include src="../components/oobe_dialog.html"> - <include src="../oobe_icons.html"> + <include src="../components/oobe_icons.html"> <include src="discover_components.html"> <discover-ui id="discoverUI" class="block"></discover-ui> <script src="chrome://oobe/discover_app.js"></script>
diff --git a/chrome/browser/resources/chromeos/login/discover/discover_app.js b/chrome/browser/resources/chromeos/login/discover/discover_app.js index 04ddb99..6998a74b 100644 --- a/chrome/browser/resources/chromeos/login/discover/discover_app.js +++ b/chrome/browser/resources/chromeos/login/discover/discover_app.js
@@ -8,11 +8,11 @@ console.error(error.stack); }; -// <include src="../oobe_i18n_behavior.js"> -// <include src="../hd-iron-icon.js"> +// <include src="../components/oobe_i18n_behavior.js"> +// <include src="../components/hd-iron-icon.js"> // <include src="../components/oobe_buttons.js"> // <include src="../components/oobe_dialog.js"> -// <include src="../oobe_dialog_host_behavior.js"> +// <include src="../components/oobe_dialog_host_behavior.js"> // <include src="discover_components.js"> /**
diff --git a/chrome/browser/resources/downloads/downloads.html b/chrome/browser/resources/downloads/downloads.html index c7ad2c1..4e1efc9 100644 --- a/chrome/browser/resources/downloads/downloads.html +++ b/chrome/browser/resources/downloads/downloads.html
@@ -1,6 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading" - $i18n{a11yenhanced}> +<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading"> <head> <meta charset="utf-8"> <base href="chrome://downloads">
diff --git a/chrome/browser/resources/downloads/toolbar.html b/chrome/browser/resources/downloads/toolbar.html index 2220c95..b87845d 100644 --- a/chrome/browser/resources/downloads/toolbar.html +++ b/chrome/browser/resources/downloads/toolbar.html
@@ -10,7 +10,6 @@ } cr-icon-button { - --cr-icon-button-fill-color-focus: var(--cr-toolbar-background-color); justify-content: flex-end; margin: 4px; }
diff --git a/chrome/browser/resources/extensions/extensions.html b/chrome/browser/resources/extensions/extensions.html index 087a92f..c5980f41 100644 --- a/chrome/browser/resources/extensions/extensions.html +++ b/chrome/browser/resources/extensions/extensions.html
@@ -1,6 +1,6 @@ <!doctype html> <html dir="$i18n{textdirection}" lang="$i18n{language}" - class="loading $i18n{loadTimeClasses}" $i18n{a11yenhanced}> + class="loading $i18n{loadTimeClasses}"> <head> <meta charset="utf8"> <title>$i18n{title}</title>
diff --git a/chrome/browser/resources/history/history.html b/chrome/browser/resources/history/history.html index 506a68f4..7f78155 100644 --- a/chrome/browser/resources/history/history.html +++ b/chrome/browser/resources/history/history.html
@@ -1,5 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" $i18n{a11yenhanced}> +<html dir="$i18n{textdirection}" lang="$i18n{language}"> <head> <base href="chrome://history"> <meta charset="utf8">
diff --git a/chrome/browser/resources/media/media_feeds.html b/chrome/browser/resources/media/media_feeds.html index 314c522..74429bf9 100644 --- a/chrome/browser/resources/media/media_feeds.html +++ b/chrome/browser/resources/media/media_feeds.html
@@ -225,6 +225,9 @@ <th sort-key="safeSearchResult"> Safe Search Result </th> + <th sort-key="duration"> + Duration (secs) + </th> </tr> </thead> <tbody>
diff --git a/chrome/browser/resources/media/media_feeds.js b/chrome/browser/resources/media/media_feeds.js index e48c5b23..8ec4bee6 100644 --- a/chrome/browser/resources/media/media_feeds.js +++ b/chrome/browser/resources/media/media_feeds.js
@@ -187,7 +187,7 @@ td.textContent = 'Unsafe'; break; } - } else if (key == 'startTime') { + } else if (key == 'startTime' || key == 'duration') { // Format a start time. td.textContent = timeDeltaToSeconds(/** @type {mojoBase.mojom.TimeDelta} */ (data));
diff --git a/chrome/browser/resources/new_tab_page/app.js b/chrome/browser/resources/new_tab_page/app.js index 4b9a9dc..8aab114 100644 --- a/chrome/browser/resources/new_tab_page/app.js +++ b/chrome/browser/resources/new_tab_page/app.js
@@ -53,9 +53,10 @@ oneGoogleBarIframePath_: { type: String, value: () => { - const fromSearch = new URLSearchParams(window.location.search); const params = new URLSearchParams(); - params.set('ogdebencoded', btoa(fromSearch.get('ogdeb') || '')); + params.set( + 'paramsencoded', + btoa(window.location.search.replace(/^[?]/, '&'))); return `one-google-bar?${params}`; }, }, @@ -288,7 +289,7 @@ const {parts} = await BrowserProxy.getInstance().handler.getOneGoogleBarParts( - (new URLSearchParams(window.location.search)).get('ogdeb') || ''); + window.location.search.replace(/^[?]/, '&')); if (!parts) { return; }
diff --git a/chrome/browser/resources/pdf/elements/viewer-zoom-button.html b/chrome/browser/resources/pdf/elements/viewer-zoom-button.html index f51075c..f95c4ea 100644 --- a/chrome/browser/resources/pdf/elements/viewer-zoom-button.html +++ b/chrome/browser/resources/pdf/elements/viewer-zoom-button.html
@@ -35,7 +35,6 @@ --cr-icon-button-fill-color: var(--paper-grey-700); --cr-icon-button-icon-size: 20px; --cr-icon-button-size: 36px; - --cr-icon-button-fill-color-focus: rgb(242, 242, 242); background-color: rgb(242, 242, 242); border-radius: 50%; overflow: visible; @@ -48,7 +47,6 @@ :host-context([is-print-preview]) cr-icon-button { --cr-icon-button-fill-color: white; - --cr-icon-button-fill-color-focus: var(--google-grey-600); --cr-icon-button-size: 32px; background-color: var(--google-grey-600); } @@ -62,7 +60,6 @@ @media (prefers-color-scheme: dark) { :host-context([is-print-preview]) cr-icon-button { --cr-icon-button-fill-color: var(--google-grey-200); - --cr-icon-button-fill-color-focus: var(--google-grey-900); background-color: var(--google-grey-900); } }
diff --git a/chrome/browser/resources/pdf/index.html b/chrome/browser/resources/pdf/index.html index 59965552..4ba6ec4 100644 --- a/chrome/browser/resources/pdf/index.html +++ b/chrome/browser/resources/pdf/index.html
@@ -1,5 +1,5 @@ <!doctype html> -<html $i18n{a11yenhanced}> +<html> <head> <meta charset="utf-8">
diff --git a/chrome/browser/resources/print_preview/print_preview.html b/chrome/browser/resources/print_preview/print_preview.html index 4aa26d7..6a792ccc4 100644 --- a/chrome/browser/resources/print_preview/print_preview.html +++ b/chrome/browser/resources/print_preview/print_preview.html
@@ -1,6 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" $i18n{a11yenhanced} - class="loading"> +<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading"> <head> <title>$i18n{title}</title> <meta charset="utf-8">
diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn index 4e958d7..17a5905 100644 --- a/chrome/browser/resources/settings/BUILD.gn +++ b/chrome/browser/resources/settings/BUILD.gn
@@ -208,8 +208,12 @@ js_library("settings") { deps = [ + ":hats_browser_proxy", ":lifetime_browser_proxy.m", + ":metrics_browser_proxy", + ":open_window_proxy", "about_page:about_page_browser_proxy.m", + "autofill_page:password_manager_proxy", "search_engines_page:search_engines_browser_proxy.m", "settings_ui:settings_ui", ] @@ -241,6 +245,8 @@ js_library("lazy_load") { deps = [ + "autofill_page:autofill_section", + "autofill_page:payments_section", "privacy_page:cookies_page", "site_settings:local_data_browser_proxy", "site_settings:protocol_handlers",
diff --git a/chrome/browser/resources/settings/autofill_page/autofill_section.js b/chrome/browser/resources/settings/autofill_page/autofill_section.js index faab4476..24e799f 100644 --- a/chrome/browser/resources/settings/autofill_page/autofill_section.js +++ b/chrome/browser/resources/settings/autofill_page/autofill_section.js
@@ -26,7 +26,8 @@ import {loadTimeData} from '../i18n_setup.js'; -import {CreditCardEntry} from './credit_card_list_entry.js'; +/** @typedef {chrome.autofillPrivate.CreditCardEntry} */ +let CreditCardEntry; /** * Interface for all callbacks to the autofill API.
diff --git a/chrome/browser/resources/settings/autofill_page/credit_card_list_entry.js b/chrome/browser/resources/settings/autofill_page/credit_card_list_entry.js index bb57f8e..fd19897 100644 --- a/chrome/browser/resources/settings/autofill_page/credit_card_list_entry.js +++ b/chrome/browser/resources/settings/autofill_page/credit_card_list_entry.js
@@ -16,9 +16,6 @@ import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -/** @typedef {chrome.autofillPrivate.CreditCardEntry} */ -export let CreditCardEntry; - Polymer({ is: 'settings-credit-card-list-entry', @@ -31,7 +28,7 @@ properties: { /** * A saved credit card. - * @type {!CreditCardEntry} + * @type {!chrome.autofillPrivate.CreditCardEntry} */ creditCard: Object, },
diff --git a/chrome/browser/resources/settings/autofill_page/payments_list.js b/chrome/browser/resources/settings/autofill_page/payments_list.js index 524cee2c..76947aae 100644 --- a/chrome/browser/resources/settings/autofill_page/payments_list.js +++ b/chrome/browser/resources/settings/autofill_page/payments_list.js
@@ -9,6 +9,7 @@ import 'chrome://resources/cr_elements/shared_vars_css.m.js'; import '../settings_shared_css.m.js'; +import './credit_card_list_entry.js'; import './passwords_shared_css.js'; import './upi_id_list_entry.js'; @@ -16,7 +17,6 @@ import {loadTimeData} from '../i18n_setup.js'; -import {CreditCardEntry} from './credit_card_list_entry.js'; Polymer({ is: 'settings-payments-list', @@ -26,7 +26,7 @@ properties: { /** * An array of all saved credit cards. - * @type {!Array<!CreditCardEntry>} + * @type {!Array<!chrome.autofillPrivate.CreditCardEntry>} */ creditCards: Array,
diff --git a/chrome/browser/resources/settings/autofill_page/payments_section.js b/chrome/browser/resources/settings/autofill_page/payments_section.js index c896cd9..f59b39a 100644 --- a/chrome/browser/resources/settings/autofill_page/payments_section.js +++ b/chrome/browser/resources/settings/autofill_page/payments_section.js
@@ -31,13 +31,15 @@ import {MetricsBrowserProxyImpl, PrivacyElementInteractions} from '../metrics_browser_proxy.js'; import {AutofillManager} from './autofill_section.js'; -import {CreditCardEntry} from './credit_card_list_entry.js'; + +/** @typedef {chrome.autofillPrivate.CreditCardEntry} */ +let CreditCardEntry; /** * Interface for all callbacks to the payments autofill API. * @interface */ -class PaymentsManager { +export class PaymentsManager { /** * Add an observer to the list of personal data. * @param {function(!Array<!AutofillManager.AddressEntry>,
diff --git a/chrome/browser/resources/settings/chromeos/os_settings.html b/chrome/browser/resources/settings/chromeos/os_settings.html index 00bd80d0..1b27721d 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings.html +++ b/chrome/browser/resources/settings/chromeos/os_settings.html
@@ -1,6 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading" - $i18n{a11yenhanced} cros> +<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading" cros> <head> <meta charset="utf-8"> <title>$i18n{settings}</title>
diff --git a/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.html b/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.html index 57e57ddb..e9a7256 100644 --- a/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.html +++ b/chrome/browser/resources/settings/chromeos/os_toolbar/os_toolbar.html
@@ -60,7 +60,6 @@ cr-icon-button { --cr-icon-button-fill-color: currentColor; - --cr-icon-button-fill-color-focus: var(--cros-default-toolbar-bg-color); --cr-icon-button-size: 32px; min-width: 32px; }
diff --git a/chrome/browser/resources/settings/hats_browser_proxy.js b/chrome/browser/resources/settings/hats_browser_proxy.js index 3503ef20..89f4c0eb 100644 --- a/chrome/browser/resources/settings/hats_browser_proxy.js +++ b/chrome/browser/resources/settings/hats_browser_proxy.js
@@ -9,7 +9,7 @@ // clang-format off /** @interface */ - class HatsBrowserProxy { + export class HatsBrowserProxy { /** * Helper function that initiates the launching of HaTS (Happiness Tracking * Surveys) through sending a request to HatsService, which is the entity
diff --git a/chrome/browser/resources/settings/lazy_load.js b/chrome/browser/resources/settings/lazy_load.js index d4c7fa0..748503e8 100644 --- a/chrome/browser/resources/settings/lazy_load.js +++ b/chrome/browser/resources/settings/lazy_load.js
@@ -52,11 +52,11 @@ export {getToastManager} from 'chrome://resources/cr_elements/cr_toast/cr_toast_manager.m.js'; export {FontsBrowserProxy, FontsBrowserProxyImpl} from './appearance_page/fonts_browser_proxy.m.js'; export {CountryDetailManagerImpl} from './autofill_page/address_edit_dialog.js'; -export {AutofillManagerImpl} from './autofill_page/autofill_section.js'; +export {AutofillManager, AutofillManagerImpl} from './autofill_page/autofill_section.js'; // <if expr="chromeos"> export {BlockingRequestManager} from './autofill_page/blocking_request_manager.js'; // </if> -export {PaymentsManagerImpl} from './autofill_page/payments_section.js'; +export {PaymentsManager, PaymentsManagerImpl} from './autofill_page/payments_section.js'; // <if expr="_google_chrome and is_win"> export {ChromeCleanupIdleReason} from './chrome_cleanup_page/chrome_cleanup_page.js'; export {ChromeCleanupProxyImpl} from './chrome_cleanup_page/chrome_cleanup_proxy.js';
diff --git a/chrome/browser/resources/settings/open_window_proxy.js b/chrome/browser/resources/settings/open_window_proxy.js index 2fc302b..7f73130 100644 --- a/chrome/browser/resources/settings/open_window_proxy.js +++ b/chrome/browser/resources/settings/open_window_proxy.js
@@ -10,7 +10,7 @@ import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; /** @interface */ -class OpenWindowProxy { +export class OpenWindowProxy { /** * Opens the specified URL in a new tab. * @param {string} url
diff --git a/chrome/browser/resources/settings/settings.html b/chrome/browser/resources/settings/settings.html index 8353825c..430092fe 100644 --- a/chrome/browser/resources/settings/settings.html +++ b/chrome/browser/resources/settings/settings.html
@@ -1,6 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading" - $i18n{a11yenhanced}> +<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading"> <head> <meta charset="utf-8"> <title>$i18n{settings}</title>
diff --git a/chrome/browser/resources/settings/settings.js b/chrome/browser/resources/settings/settings.js index e39f075..9afbf49c 100644 --- a/chrome/browser/resources/settings/settings.js +++ b/chrome/browser/resources/settings/settings.js
@@ -11,13 +11,13 @@ export {DefaultBrowserBrowserProxyImpl} from './default_browser_page/default_browser_browser_proxy.js'; // </if> export {ExtensionControlBrowserProxyImpl} from './extension_control_browser_proxy.m.js'; -export {HatsBrowserProxyImpl} from './hats_browser_proxy.js'; +export {HatsBrowserProxy, HatsBrowserProxyImpl} from './hats_browser_proxy.js'; export {LifetimeBrowserProxy, LifetimeBrowserProxyImpl} from './lifetime_browser_proxy.m.js'; -export {MetricsBrowserProxyImpl, PrivacyElementInteractions, SafetyCheckInteractions} from './metrics_browser_proxy.js'; +export {MetricsBrowserProxy, MetricsBrowserProxyImpl, PrivacyElementInteractions, SafetyCheckInteractions} from './metrics_browser_proxy.js'; export {OnStartupBrowserProxy, OnStartupBrowserProxyImpl} from './on_startup_page/on_startup_browser_proxy.js'; export {EDIT_STARTUP_URL_EVENT} from './on_startup_page/startup_url_entry.js'; export {StartupUrlsPageBrowserProxy, StartupUrlsPageBrowserProxyImpl} from './on_startup_page/startup_urls_page_browser_proxy.js'; -export {OpenWindowProxyImpl} from './open_window_proxy.js'; +export {OpenWindowProxy, OpenWindowProxyImpl} from './open_window_proxy.js'; export {pageVisibility, setPageVisibilityForTesting} from './page_visibility.js'; // <if expr="chromeos"> export {AccountManagerBrowserProxyImpl} from './people_page/account_manager_browser_proxy.m.js';
diff --git a/chrome/browser/resources/settings/settings_v3.html b/chrome/browser/resources/settings/settings_v3.html index 510ade38..ff56fe33 100644 --- a/chrome/browser/resources/settings/settings_v3.html +++ b/chrome/browser/resources/settings/settings_v3.html
@@ -1,6 +1,5 @@ <!doctype html> -<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading" - $i18n{a11yenhanced}> +<html dir="$i18n{textdirection}" lang="$i18n{language}" class="loading"> <head> <meta charset="utf-8"> <title>$i18n{settings}</title>
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_loader.h b/chrome/browser/search/one_google_bar/one_google_bar_loader.h index 120ddf5..ab0beaf 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_loader.h +++ b/chrome/browser/search/one_google_bar/one_google_bar_loader.h
@@ -38,7 +38,7 @@ virtual GURL GetLoadURLForTesting() const = 0; // Sets ogdeb value to be used as a query param. - virtual bool SetOgdebValue(const std::string& value) = 0; + virtual bool SetAdditionalQueryParams(const std::string& value) = 0; }; #endif // CHROME_BROWSER_SEARCH_ONE_GOOGLE_BAR_ONE_GOOGLE_BAR_LOADER_H_
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc index 4502cb18..7629f8e 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc +++ b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.cc
@@ -40,8 +40,6 @@ const char kResponsePreamble[] = ")]}'"; -const char kUrlOverrideCommandLineSwitch[] = "ogb-parts-test-url"; - // This namespace contains helpers to extract SafeHtml-wrapped strings (see // https://github.com/google/safe-html-types) from the response json. If there // is ever a C++ version of the SafeHtml types, we should consider using that @@ -294,41 +292,40 @@ return GetApiUrl(); } -bool OneGoogleBarLoaderImpl::SetOgdebValue(const std::string& value) { - if (ogdeb_value_ == value) { +bool OneGoogleBarLoaderImpl::SetAdditionalQueryParams( + const std::string& value) { + if (additional_query_params_ == value) { return false; } - ogdeb_value_ = value; + additional_query_params_ = value; return true; } GURL OneGoogleBarLoaderImpl::GetApiUrl() const { GURL api_url; - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - kUrlOverrideCommandLineSwitch)) { - api_url = GURL(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - kUrlOverrideCommandLineSwitch)); - } else { - GURL google_base_url = google_util::CommandLineGoogleBaseURL(); - if (!google_base_url.is_valid()) { - google_base_url = GURL(google_util::kGoogleHomepageURL); - } - - api_url = google_base_url.Resolve(kNewTabOgbApiPath); + GURL google_base_url = google_util::CommandLineGoogleBaseURL(); + if (!google_base_url.is_valid()) { + google_base_url = GURL(google_util::kGoogleHomepageURL); } - // Add the "hl=" parameter. - api_url = net::AppendQueryParameter(api_url, "hl", application_locale_); + api_url = google_base_url.Resolve(kNewTabOgbApiPath); - if (!ogdeb_value_.empty()) { - api_url = net::AppendQueryParameter(api_url, "ogdeb", ogdeb_value_); + // Add the "hl=" parameter. + if (additional_query_params_.find("&hl=") == std::string::npos) { + api_url = net::AppendQueryParameter(api_url, "hl", application_locale_); } // Add the "async=" parameter. We can't use net::AppendQueryParameter for // this because we need the ":" to remain unescaped. GURL::Replacements replacements; std::string query = api_url.query(); - query += "&async=fixed:0"; + query += additional_query_params_; + if (additional_query_params_.find("&async=") == std::string::npos) { + query += "&async=fixed:0"; + } + if (query.at(0) == '&') { + query = query.substr(1); + } replacements.SetQueryStr(query); return api_url.ReplaceComponents(replacements); }
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.h b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.h index 20c6d2c..c731a459 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.h +++ b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl.h
@@ -34,7 +34,7 @@ GURL GetLoadURLForTesting() const override; - bool SetOgdebValue(const std::string& value) override; + bool SetAdditionalQueryParams(const std::string& value) override; private: class AuthenticatedURLLoader; @@ -54,7 +54,7 @@ std::vector<OneGoogleCallback> callbacks_; std::unique_ptr<AuthenticatedURLLoader> pending_request_; - std::string ogdeb_value_; + std::string additional_query_params_; base::WeakPtrFactory<OneGoogleBarLoaderImpl> weak_ptr_factory_{this};
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc index 4ef6877..e50b2a0 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc +++ b/chrome/browser/search/one_google_bar/one_google_bar_loader_impl_unittest.cc
@@ -128,6 +128,21 @@ EXPECT_EQ(expected_query, last_request_url().query()); } +TEST_F(OneGoogleBarLoaderImplTest, RequestUrlWithAdditionalQueryParams) { + one_google_bar_loader()->SetAdditionalQueryParams("&test&hl=&async="); + EXPECT_EQ("test&hl=&async=", + one_google_bar_loader()->GetLoadURLForTesting().query()); + one_google_bar_loader()->SetAdditionalQueryParams("&test&hl="); + EXPECT_EQ("test&hl=&async=fixed:0", + one_google_bar_loader()->GetLoadURLForTesting().query()); + one_google_bar_loader()->SetAdditionalQueryParams("&test&async="); + EXPECT_EQ(base::StringPrintf("hl=%s&test&async=", kApplicationLocale), + one_google_bar_loader()->GetLoadURLForTesting().query()); + one_google_bar_loader()->SetAdditionalQueryParams("&test"); + EXPECT_EQ(base::StringPrintf("hl=%s&test&async=fixed:0", kApplicationLocale), + one_google_bar_loader()->GetLoadURLForTesting().query()); +} + TEST_F(OneGoogleBarLoaderImplTest, RequestReturns) { SetUpResponseWithData(kMinimalValidResponse);
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_service.cc b/chrome/browser/search/one_google_bar/one_google_bar_service.cc index 32c82e1..448c37b 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_service.cc +++ b/chrome/browser/search/one_google_bar/one_google_bar_service.cc
@@ -75,8 +75,8 @@ language_code_ = language_code; } -bool OneGoogleBarService::SetOgdebValue(const std::string& value) { - return loader_->SetOgdebValue(value); +bool OneGoogleBarService::SetAdditionalQueryParams(const std::string& value) { + return loader_->SetAdditionalQueryParams(value); } void OneGoogleBarService::SigninStatusChanged() {
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_service.h b/chrome/browser/search/one_google_bar/one_google_bar_service.h index 081b743b..aeead183 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_service.h +++ b/chrome/browser/search/one_google_bar/one_google_bar_service.h
@@ -52,7 +52,7 @@ void SetLanguageCodeForTesting(const std::string& language_code); // Sets ogdeb query parameter in loader. - bool SetOgdebValue(const std::string& value); + bool SetAdditionalQueryParams(const std::string& value); private: class SigninObserver;
diff --git a/chrome/browser/search/one_google_bar/one_google_bar_service_unittest.cc b/chrome/browser/search/one_google_bar/one_google_bar_service_unittest.cc index 7708aded..f7e406f 100644 --- a/chrome/browser/search/one_google_bar/one_google_bar_service_unittest.cc +++ b/chrome/browser/search/one_google_bar/one_google_bar_service_unittest.cc
@@ -30,7 +30,9 @@ GURL GetLoadURLForTesting() const override { return GURL(); } - bool SetOgdebValue(const std::string& value) override { return false; } + bool SetAdditionalQueryParams(const std::string& value) override { + return false; + } size_t GetCallbackCount() const { return callbacks_.size(); }
diff --git a/chrome/browser/settings/BUILD.gn b/chrome/browser/settings/BUILD.gn index 4e3f885f..898e3d40 100644 --- a/chrome/browser/settings/BUILD.gn +++ b/chrome/browser/settings/BUILD.gn
@@ -5,10 +5,7 @@ import("//build/config/android/rules.gni") android_library("java") { - sources = [ - "android/java/src/org/chromium/chrome/browser/settings/ChromeManagedPreferenceDelegate.java", - "android/java/src/org/chromium/chrome/browser/settings/SettingsLauncher.java", - ] + sources = [ "android/java/src/org/chromium/chrome/browser/settings/ChromeManagedPreferenceDelegate.java" ] deps = [ "//chrome/browser/preferences:java", "//components/browser_ui/settings/android:java",
diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java index 4c1f80bf..0be0e7f6 100644 --- a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java +++ b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java
@@ -31,6 +31,7 @@ import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.components.browser_ui.settings.ChromeImageViewPreference; import org.chromium.components.browser_ui.settings.R; +import org.chromium.components.browser_ui.settings.SettingsLauncher; /** * Tests of {@link ChromeImageViewPreference}.
diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java index b880577..a177593 100644 --- a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java +++ b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java
@@ -31,6 +31,7 @@ import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate; import org.chromium.components.browser_ui.settings.ManagedPreferencesUtils; import org.chromium.components.browser_ui.settings.R; +import org.chromium.components.browser_ui.settings.SettingsLauncher; import org.chromium.content_public.browser.test.util.TestThreadUtils; /**
diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsActivityTestRule.java b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsActivityTestRule.java index 7e7bff6..f3d5256 100644 --- a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsActivityTestRule.java +++ b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsActivityTestRule.java
@@ -14,6 +14,8 @@ import org.junit.Assert; +import org.chromium.components.browser_ui.settings.SettingsLauncher; + /** * Activity test rule that launch {@link SettingsActivity} in tests. *
diff --git a/chrome/browser/sync/test/integration/sync_signin_delegate_android.cc b/chrome/browser/sync/test/integration/sync_signin_delegate_android.cc index 68e6cb8..94c1484 100644 --- a/chrome/browser/sync/test/integration/sync_signin_delegate_android.cc +++ b/chrome/browser/sync/test/integration/sync_signin_delegate_android.cc
@@ -8,7 +8,7 @@ void SyncSigninDelegateAndroid::SigninFake(Profile* profile, const std::string& username) { - sync_test_utils_android::SetUpTestAccountAndSignIn(); + sync_test_utils_android::SetUpAccountAndSignInForTesting(); } bool SyncSigninDelegateAndroid::SigninUI(Profile* profile,
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 2850176..900d177 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -267,7 +267,7 @@ void SyncTest::SetUp() { #if defined(OS_ANDROID) - sync_test_utils_android::SetUpAuthForTest(); + sync_test_utils_android::SetUpAuthForTesting(); sync_test_utils_android::SetUpAndroidSyncSettingsForTesting(); #endif @@ -315,7 +315,7 @@ PlatformBrowserTest::PostRunTestOnMainThread(); #if defined(OS_ANDROID) - sync_test_utils_android::TearDownAuthForTest(); + sync_test_utils_android::TearDownAuthForTesting(); #endif }
diff --git a/chrome/browser/sync/test/integration/sync_test_utils_android.cc b/chrome/browser/sync/test/integration/sync_test_utils_android.cc index bd8233f..00b389b5 100644 --- a/chrome/browser/sync/test/integration/sync_test_utils_android.cc +++ b/chrome/browser/sync/test/integration/sync_test_utils_android.cc
@@ -15,27 +15,27 @@ namespace sync_test_utils_android { -void SetUpTestAccountAndSignIn() { +void SetUpAccountAndSignInForTesting() { base::RunLoop run_loop; base::ThreadPool::PostTask( FROM_HERE, {base::MayBlock()}, base::BindLambdaForTesting([&]() { - Java_SyncTestSigninUtils_setUpTestAccountAndSignIn( + Java_SyncTestSigninUtils_setUpAccountAndSignInForTesting( base::android::AttachCurrentThread()); run_loop.Quit(); })); run_loop.Run(); } -void SetUpAuthForTest() { - Java_SyncTestSigninUtils_setUpAuthForTest( +void SetUpAuthForTesting() { + Java_SyncTestSigninUtils_setUpAuthForTesting( base::android::AttachCurrentThread()); } -void TearDownAuthForTest() { +void TearDownAuthForTesting() { base::RunLoop run_loop; base::ThreadPool::PostTask(FROM_HERE, {base::MayBlock()}, base::BindLambdaForTesting([&]() { - Java_SyncTestSigninUtils_tearDownAuthForTest( + Java_SyncTestSigninUtils_tearDownAuthForTesting( base::android::AttachCurrentThread()); run_loop.Quit(); }));
diff --git a/chrome/browser/sync/test/integration/sync_test_utils_android.h b/chrome/browser/sync/test/integration/sync_test_utils_android.h index f20b856..ffe0441 100644 --- a/chrome/browser/sync/test/integration/sync_test_utils_android.h +++ b/chrome/browser/sync/test/integration/sync_test_utils_android.h
@@ -9,27 +9,25 @@ namespace sync_test_utils_android { -// TODO(crbug/1078923): Make use of the ForTesting suffix. // Sets up the test account and signs in synchronously. -void SetUpTestAccountAndSignIn(); +void SetUpAccountAndSignInForTesting(); // Sets up the test authentication environment synchronously using a worker // thread. // -// We recommend to call this function from the SetUp() method of the test +// We recommend calling this function from the SetUp() method of the test // fixture (e.g., CustomFixture::SetUp()) before calling the other SetUp() // function down the stack (e.g., PlatformBrowserTest::SetUp()). -// TODO(crbug/1078923): Make use of the ForTesting suffix. -void SetUpAuthForTest(); +void SetUpAuthForTesting(); // Tears down the test authentication environment synchronously using a worker // thread. // -// We recommend to call this function from the PostRunTestOnMainThread() method -// of the test fixture which allows multiple threads, see example +// We recommend calling this function from the PostRunTestOnMainThread() method +// of the test fixture, which allows multiple threads. See the following file +// for an example: // chrome/browser/metrics/metrics_service_user_demographics_browsertest.cc. -// TODO(crbug/1078923): Make use of the ForTesting suffix. -void TearDownAuthForTest(); +void TearDownAuthForTesting(); // Sets up AndroidSyncSettings with a mock SyncContentResolver and with // Android's master sync setting enabled.
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 1510223..b126cc8 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2245,6 +2245,7 @@ "signin_reauth_popup_delegate.h", "signin_view_controller.cc", "signin_view_controller.h", + "signin_view_controller_delegate.cc", "signin_view_controller_delegate.h", "tab_contents/chrome_web_contents_view_handle_drop.cc", "tab_contents/chrome_web_contents_view_handle_drop.h",
diff --git a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc index c4b1b66..4a8e69d 100644 --- a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc +++ b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.cc
@@ -39,7 +39,7 @@ } void AssistantWebViewImpl::ChildPreferredSizeChanged(views::View* child) { - DCHECK_EQ(web_view_.get(), child); + DCHECK_EQ(web_view_, child); SetPreferredSize(web_view_->GetPreferredSize()); } @@ -189,11 +189,8 @@ } void AssistantWebViewImpl::InitLayout(Profile* profile) { - // Web view. - web_view_ = std::make_unique<views::WebView>(profile); - web_view_->set_owned_by_client(); + web_view_ = AddChildView(std::make_unique<views::WebView>(profile)); web_view_->SetWebContents(web_contents_.get()); - AddChildView(web_view_.get()); } void AssistantWebViewImpl::NotifyDidSuppressNavigation(
diff --git a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h index 80877635..42e97f2 100644 --- a/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h +++ b/chrome/browser/ui/ash/assistant/assistant_web_view_impl.h
@@ -85,7 +85,7 @@ const InitParams params_; std::unique_ptr<content::WebContents> web_contents_; - std::unique_ptr<views::WebView> web_view_; + views::WebView* web_view_ = nullptr; // Whether or not the embedded |web_contents_| can go back. bool can_go_back_ = false;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 1822ac0..dd1aef6 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -648,6 +648,8 @@ } void ChromeLauncherController::AdditionalUserAddedToSession(Profile* profile) { + AddAppUpdaterAndIconLoader(profile); + // Switch the running applications to the new user. for (auto& controller : app_window_controllers_) controller->AdditionalUserAddedToSession(profile); @@ -785,11 +787,12 @@ std::vector<std::unique_ptr<AppIconLoader>>& loaders) { app_icon_loaders_.clear(); for (auto& loader : loaders) - app_icon_loaders_.push_back(std::move(loader)); + app_icon_loaders_[profile_].push_back(std::move(loader)); } void ChromeLauncherController::SetProfileForTest(Profile* profile) { profile_ = profile; + latest_active_profile_ = profile; } void ChromeLauncherController::PinAppWithID(const std::string& app_id) { @@ -845,7 +848,8 @@ AppIconLoader* ChromeLauncherController::GetAppIconLoaderForApp( const std::string& app_id) { - for (const auto& app_icon_loader : app_icon_loaders_) { + for (const auto& app_icon_loader : + app_icon_loaders_[latest_active_profile_]) { if (app_icon_loader->CanLoadImageForApp(app_id)) return app_icon_loader.get(); } @@ -889,25 +893,23 @@ void ChromeLauncherController::OnAppInstalled( content::BrowserContext* browser_context, const std::string& app_id) { - if (IsAppPinned(app_id)) { - // Clear and re-fetch to ensure icon is up-to-date. - AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id); - if (app_icon_loader) { - app_icon_loader->ClearImage(app_id); - app_icon_loader->FetchImage(app_id); - } - } - // When the app is pinned to the shelf, or added to the shelf, the app - // probably isn't ready in AppService, so set the title again on - // callback when the app is ready in AppService. + // probably isn't ready in AppService, so set the title, and load the icon + // again on callback when the app is ready in AppService. int index = model_->ItemIndexByAppID(app_id); if (index != kInvalidIndex) { ash::ShelfItem item = model_->items()[index]; - if ((item.type == ash::TYPE_APP || item.type == ash::TYPE_PINNED_APP) && - item.title.empty()) { - item.title = LauncherControllerHelper::GetAppTitle(profile(), app_id); - model_->Set(index, item); + if (item.type == ash::TYPE_APP || item.type == ash::TYPE_PINNED_APP) { + AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id); + if (app_icon_loader) { + app_icon_loader->ClearImage(app_id); + app_icon_loader->FetchImage(app_id); + } + if (item.title.empty()) { + item.title = LauncherControllerHelper::GetAppTitle( + latest_active_profile_, app_id); + model_->Set(index, item); + } } } @@ -921,10 +923,14 @@ // is needed when updating chrome launcher controller after user change in // multi-profile sessions, as icon loaders get reset when clearing the state // from the previous profile. - if (IsAppPinned(app_id)) { - AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id); - if (app_icon_loader) - app_icon_loader->FetchImage(app_id); + int index = model_->ItemIndexByAppID(app_id); + if (index != kInvalidIndex) { + ash::ShelfItem item = model_->items()[index]; + if (item.type == ash::TYPE_APP || item.type == ash::TYPE_PINNED_APP) { + AppIconLoader* app_icon_loader = GetAppIconLoaderForApp(app_id); + if (app_icon_loader) + app_icon_loader->FetchImage(app_id); + } } } @@ -1254,32 +1260,58 @@ } } -void ChromeLauncherController::AttachProfile(Profile* profile_to_attach) { - profile_ = profile_to_attach; +void ChromeLauncherController::AddAppUpdaterAndIconLoader(Profile* profile) { + latest_active_profile_ = profile; + // Either add the profile to the list of known profiles and make it the active // one for some functions of LauncherControllerHelper or create a new one. if (!launcher_controller_helper_.get()) { launcher_controller_helper_ = - std::make_unique<LauncherControllerHelper>(profile_); + std::make_unique<LauncherControllerHelper>(profile); } else { - launcher_controller_helper_->set_profile(profile_); + launcher_controller_helper_->set_profile(profile); } - std::unique_ptr<AppIconLoader> app_service_app_icon_loader = - std::make_unique<AppServiceAppIconLoader>( - profile_, extension_misc::EXTENSION_ICON_MEDIUM, this); - app_icon_loaders_.push_back(std::move(app_service_app_icon_loader)); + if (!base::Contains(app_updaters_, profile)) { + std::unique_ptr<LauncherAppUpdater> app_service_app_updater( + new LauncherAppServiceAppUpdater(this, profile)); + app_updaters_[profile].push_back(std::move(app_service_app_updater)); - // Some special extensions open new windows, and on Chrome OS, those windows - // should show the extension icon in the shelf. Extensions are not present - // in the App Service, so try loading extensions icon using - // ChromeAppIconLoader. - std::unique_ptr<extensions::ChromeAppIconLoader> chrome_app_icon_loader = - std::make_unique<extensions::ChromeAppIconLoader>( - profile_, extension_misc::EXTENSION_ICON_MEDIUM, - base::BindRepeating(&app_list::MaybeResizeAndPadIconForMd), this); - chrome_app_icon_loader->SetExtensionsOnly(); - app_icon_loaders_.push_back(std::move(chrome_app_icon_loader)); + // Some special extensions open new windows, and on Chrome OS, those windows + // should show the extension icon in the shelf. Extensions are not present + // in the App Service, so use LauncherExtensionAppUpdater to handle + // extensions life-cycle events. + std::unique_ptr<LauncherExtensionAppUpdater> extension_app_updater( + new LauncherExtensionAppUpdater(this, profile, + true /* extensions_only */)); + app_updaters_[profile].push_back(std::move(extension_app_updater)); + } + + if (!base::Contains(app_icon_loaders_, profile)) { + std::unique_ptr<AppIconLoader> app_service_app_icon_loader = + std::make_unique<AppServiceAppIconLoader>( + profile, extension_misc::EXTENSION_ICON_MEDIUM, this); + app_icon_loaders_[profile].push_back( + std::move(app_service_app_icon_loader)); + + // Some special extensions open new windows, and on Chrome OS, those windows + // should show the extension icon in the shelf. Extensions are not present + // in the App Service, so try loading extensions icon using + // ChromeAppIconLoader. + std::unique_ptr<extensions::ChromeAppIconLoader> chrome_app_icon_loader = + std::make_unique<extensions::ChromeAppIconLoader>( + profile, extension_misc::EXTENSION_ICON_MEDIUM, + base::BindRepeating(&app_list::MaybeResizeAndPadIconForMd), this); + chrome_app_icon_loader->SetExtensionsOnly(); + app_icon_loaders_[profile].push_back(std::move(chrome_app_icon_loader)); + } +} + +void ChromeLauncherController::AttachProfile(Profile* profile_to_attach) { + profile_ = profile_to_attach; + latest_active_profile_ = profile_to_attach; + + AddAppUpdaterAndIconLoader(profile_to_attach); pref_change_registrar_.Init(profile()->GetPrefs()); pref_change_registrar_.Add( @@ -1294,19 +1326,6 @@ base::Bind(&ChromeLauncherController::ScheduleUpdateAppLaunchersFromSync, base::Unretained(this))); - std::unique_ptr<LauncherAppUpdater> app_service_app_updater( - new LauncherAppServiceAppUpdater(this, profile())); - app_updaters_.push_back(std::move(app_service_app_updater)); - - // Some special extensions open new windows, and on Chrome OS, those windows - // should show the extension icon in the shelf. Extensions are not present - // in the App Service, so use LauncherExtensionAppUpdater to handle - // extensions life-cycle events. - std::unique_ptr<LauncherExtensionAppUpdater> extension_app_updater( - new LauncherExtensionAppUpdater(this, profile(), - true /* extensions_only */)); - app_updaters_.push_back(std::move(extension_app_updater)); - app_list::AppListSyncableService* app_list_syncable_service = app_list::AppListSyncableServiceFactory::GetForProfile(profile()); if (app_list_syncable_service) @@ -1316,9 +1335,6 @@ } void ChromeLauncherController::ReleaseProfile() { - app_updaters_.clear(); - app_icon_loaders_.clear(); - pref_change_registrar_.RemoveAll(); app_list::AppListSyncableService* app_list_syncable_service = @@ -1354,7 +1370,8 @@ bool needs_update = false; if (item.title.empty()) { needs_update = true; - item.title = LauncherControllerHelper::GetAppTitle(profile(), id.app_id); + item.title = LauncherControllerHelper::GetAppTitle(latest_active_profile_, + id.app_id); } ash::ShelfItemStatus status = GetAppState(id.app_id); if (status != item.status && status != ash::STATUS_CLOSED) {
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h index dc80d6e7..40c3857 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_CONTROLLER_H_ +#include <map> #include <memory> #include <string> #include <vector> @@ -363,6 +364,9 @@ void CloseWindowedAppsFromRemovedExtension(const std::string& app_id, const Profile* profile); + // Add the app updater and the app icon loder for a specific profile. + void AddAppUpdaterAndIconLoader(Profile* profile); + // Attach to a specific profile. void AttachProfile(Profile* profile_to_attach); @@ -398,6 +402,11 @@ // multi-profile use cases this might change over time. Profile* profile_ = nullptr; + // The profile used to load icons and get the app update information. This is + // the latest active user's profile when switch users in multi-profile use + // cases. + Profile* latest_active_profile_ = nullptr; + // The ShelfModel instance owned by ash::Shell's ShelfController. ash::ShelfModel* model_; @@ -427,7 +436,8 @@ std::unique_ptr<DiscoverWindowObserver> discover_window_observer_; // Used to load the images for app items. - std::vector<std::unique_ptr<AppIconLoader>> app_icon_loaders_; + std::map<Profile*, std::vector<std::unique_ptr<AppIconLoader>>> + app_icon_loaders_; // Direct access to app_id for a web contents. // NOTE: This tracks all WebContents, not just those associated with an app. @@ -441,7 +451,8 @@ ArcAppWindowLauncherController* arc_app_window_controller_ = nullptr; // Used to handle app load/unload events. - std::vector<std::unique_ptr<LauncherAppUpdater>> app_updaters_; + std::map<Profile*, std::vector<std::unique_ptr<LauncherAppUpdater>>> + app_updaters_; PrefChangeRegistrar pref_change_registrar_;
diff --git a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc b/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc index 26f661e..38cb703 100644 --- a/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc +++ b/chrome/browser/ui/ash/launcher/launcher_controller_helper.cc
@@ -180,7 +180,7 @@ auto* extension = registry->GetExtensionById( app_id, extensions::ExtensionRegistry::EVERYTHING); - if (extension) + if (extension && extension->is_extension()) return base::UTF8ToUTF16(extension->name()); return base::string16();
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model_unittest.cc b/chrome/browser/ui/content_settings/content_setting_image_model_unittest.cc index 96e8d0f..495afe5f 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model_unittest.cc +++ b/chrome/browser/ui/content_settings/content_setting_image_model_unittest.cc
@@ -149,7 +149,8 @@ ASSERT_TRUE(cookie); static_cast<content::WebContentsObserver*>( TabSpecificContentSettings::FromWebContents(web_contents())) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie},
diff --git a/chrome/browser/ui/messages/OWNERS b/chrome/browser/ui/messages/OWNERS index 16a3393c..0c68d14 100644 --- a/chrome/browser/ui/messages/OWNERS +++ b/chrome/browser/ui/messages/OWNERS
@@ -1,6 +1,9 @@ +# Primary: +pavely@chromium.org + +# Secondary: dtrainor@chromium.org mdjones@chromium.org -pavely@chromium.org twellington@chromium.org # COMPONENT: UI>Browser>Mobile>Messages
diff --git a/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.cc index d483e024..afba592 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.cc
@@ -3,11 +3,23 @@ // found in the LICENSE file. #include "chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_avatar_icon_util.h" +#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/ui/passwords/passwords_model_delegate.h" #include "chrome/grit/generated_resources.h" #include "components/password_manager/core/common/password_manager_ui.h" +#include "components/signin/public/identity_manager/consent_level.h" +#include "components/signin/public/identity_manager/identity_manager.h" +#include "content/public/browser/browser_context.h" #include "ui/base/l10n/l10n_util.h" +namespace { + +constexpr int icon_size_dip = 48; + +} // namespace + MoveToAccountStoreBubbleController::MoveToAccountStoreBubbleController( base::WeakPtr<PasswordsModelDelegate> delegate) : PasswordBubbleControllerBase( @@ -29,4 +41,21 @@ return delegate_->MovePasswordToAccountStore(); } +gfx::Image MoveToAccountStoreBubbleController::GetProfileIcon() { + if (!GetProfile()) + return gfx::Image(); + signin::IdentityManager* identity_manager = + IdentityManagerFactory::GetForProfile(GetProfile()); + if (!identity_manager) + return gfx::Image(); + base::Optional<AccountInfo> primary_account_info = + identity_manager->FindExtendedAccountInfoForAccountWithRefreshToken( + identity_manager->GetPrimaryAccountInfo( + signin::ConsentLevel::kNotRequired)); + DCHECK(primary_account_info.has_value()); + return profiles::GetSizedAvatarIcon(primary_account_info->account_image, + /*is_rectangle=*/true, icon_size_dip, + icon_size_dip, profiles::SHAPE_CIRCLE); +} + void MoveToAccountStoreBubbleController::ReportInteractions() {}
diff --git a/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.h b/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.h index 5532ba4..ae70d8c 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.h +++ b/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_PASSWORDS_BUBBLE_CONTROLLERS_MOVE_TO_ACCOUNT_STORE_BUBBLE_CONTROLLER_H_ #include "chrome/browser/ui/passwords/bubble_controllers/password_bubble_controller_base.h" +#include "ui/gfx/image/image.h" class PasswordsModelDelegate; @@ -20,6 +21,9 @@ // Called by the view when the user clicks the confirmation button. void AcceptMove(); + // Returns either a large site icon or a fallback icon. + gfx::Image GetProfileIcon(); + private: // PasswordBubbleControllerBase: base::string16 GetTitle() const override;
diff --git a/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller_unittest.cc b/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller_unittest.cc index 94c77b3..bd82f37d 100644 --- a/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller_unittest.cc +++ b/chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller_unittest.cc
@@ -4,20 +4,37 @@ #include "chrome/browser/ui/passwords/bubble_controllers/move_to_account_store_bubble_controller.h" +#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/ui/passwords/passwords_model_delegate_mock.h" #include "chrome/grit/generated_resources.h" +#include "chrome/test/base/testing_profile.h" +#include "components/signin/public/identity_manager/identity_manager.h" +#include "components/signin/public/identity_manager/identity_test_utils.h" +#include "content/public/browser/web_contents.h" +#include "content/public/test/browser_task_environment.h" +#include "content/public/test/web_contents_tester.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/image/image.h" +#include "ui/gfx/image/image_skia.h" +#include "ui/gfx/image/image_unittest_util.h" namespace { +using testing::Return; + class MoveToAccountStoreBubbleControllerTest : public ::testing::Test { public: MoveToAccountStoreBubbleControllerTest() { + web_contents_ = + content::WebContentsTester::CreateTestWebContents(&profile_, nullptr); mock_delegate_ = std::make_unique<testing::NiceMock<PasswordsModelDelegateMock>>(); + EXPECT_CALL(*delegate(), OnBubbleShown()); + ON_CALL(*delegate(), GetWebContents()) + .WillByDefault(Return(web_contents_.get())); controller_ = std::make_unique<MoveToAccountStoreBubbleController>( mock_delegate_->AsWeakPtr()); EXPECT_TRUE(testing::Mock::VerifyAndClearExpectations(delegate())); @@ -25,9 +42,13 @@ ~MoveToAccountStoreBubbleControllerTest() override = default; PasswordsModelDelegateMock* delegate() { return mock_delegate_.get(); } + TestingProfile* profile() { return &profile_; } MoveToAccountStoreBubbleController* controller() { return controller_.get(); } private: + content::BrowserTaskEnvironment task_environment_; + TestingProfile profile_; + std::unique_ptr<content::WebContents> web_contents_; std::unique_ptr<PasswordsModelDelegateMock> mock_delegate_; std::unique_ptr<MoveToAccountStoreBubbleController> controller_; }; @@ -48,4 +69,15 @@ l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_MOVE_TITLE)); } +TEST_F(MoveToAccountStoreBubbleControllerTest, ProvidesProfileIcon) { + signin::IdentityManager* identity_manager = + IdentityManagerFactory::GetForProfile(profile()); + AccountInfo info = signin::MakePrimaryAccountAvailable( + identity_manager, "todd.tester@gmail.com"); + signin::SimulateAccountImageFetch( + identity_manager, info.account_id, "https://todd.tester.com/avatar.png", + gfx::Image(gfx::test::CreateImageSkia(96, 96))); + EXPECT_FALSE(controller()->GetProfileIcon().IsEmpty()); +} + } // namespace
diff --git a/chrome/browser/ui/passwords/settings/password_manager_presenter.cc b/chrome/browser/ui/passwords/settings/password_manager_presenter.cc index 99ee1c90..50e1c2f 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_presenter.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_presenter.cc
@@ -338,6 +338,15 @@ } } +void PasswordManagerPresenter::RemoveSavedPasswords( + const std::vector<std::string>& sort_keys) { + undo_manager_.StartGroupingActions(); + for (const std::string& sort_key : sort_keys) { + RemoveSavedPassword(sort_key); + } + undo_manager_.EndGroupingActions(); +} + void PasswordManagerPresenter::RemovePasswordException(size_t index) { if (TryRemovePasswordEntries(&exception_map_, index)) { base::RecordAction( @@ -353,6 +362,15 @@ } } +void PasswordManagerPresenter::RemovePasswordExceptions( + const std::vector<std::string>& sort_keys) { + undo_manager_.StartGroupingActions(); + for (const std::string& sort_key : sort_keys) { + RemovePasswordException(sort_key); + } + undo_manager_.EndGroupingActions(); +} + void PasswordManagerPresenter::UndoRemoveSavedPasswordOrException() { undo_manager_.Undo(); }
diff --git a/chrome/browser/ui/passwords/settings/password_manager_presenter.h b/chrome/browser/ui/passwords/settings/password_manager_presenter.h index b740ade..5ec11b3 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_presenter.h +++ b/chrome/browser/ui/passwords/settings/password_manager_presenter.h
@@ -81,6 +81,7 @@ // across Desktop and Android. void RemoveSavedPassword(size_t index); void RemoveSavedPassword(const std::string& sort_key); + void RemoveSavedPasswords(const std::vector<std::string>& sort_keys); // Removes the saved exception entries at |index|, or corresponding to // |sort_key|, respectively. @@ -88,6 +89,7 @@ // across Desktop and Android. void RemovePasswordException(size_t index); void RemovePasswordException(const std::string& sort_key); + void RemovePasswordExceptions(const std::vector<std::string>& sort_keys); // Undoes the last saved password or exception removal. void UndoRemoveSavedPasswordOrException();
diff --git a/chrome/browser/ui/passwords/settings/password_manager_presenter_unittest.cc b/chrome/browser/ui/passwords/settings/password_manager_presenter_unittest.cc index 021ea65..ec1a43a0 100644 --- a/chrome/browser/ui/passwords/settings/password_manager_presenter_unittest.cc +++ b/chrome/browser/ui/passwords/settings/password_manager_presenter_unittest.cc
@@ -59,6 +59,10 @@ return !arg->blacklisted_by_user; } +MATCHER_P(HasOrigin, origin, "") { + return arg->origin == origin; +} + std::vector<std::pair<std::string, std::string>> GetUsernamesAndPasswords( const std::vector<autofill::PasswordForm>& forms) { std::vector<std::pair<std::string, std::string>> result; @@ -105,11 +109,12 @@ return form; } - void AddPasswordException(const GURL& origin) { + autofill::PasswordForm AddPasswordException(const GURL& origin) { autofill::PasswordForm form; form.origin = origin; form.blacklisted_by_user = true; store_->AddLogin(form); + return form; } void ChangeSavedPasswordBySortKey( @@ -428,4 +433,95 @@ } #endif +TEST_F(PasswordManagerPresenterTest, TestPasswordRemovalAndUndo) { + autofill::PasswordForm password1 = + AddPasswordEntry(GURL(kExampleCom), kUsername, kPassword); + autofill::PasswordForm password2 = + AddPasswordEntry(GURL(kExampleCom), kUsername2, kPassword2); + UpdatePasswordLists(); + ASSERT_THAT(GetUsernamesAndPasswords(GetStoredPasswordsForRealm(kExampleCom)), + UnorderedElementsAre(Pair(kUsername, kPassword), + Pair(kUsername2, kPassword2))); + + GetUIController().GetPasswordManagerPresenter()->RemoveSavedPassword( + password_manager::CreateSortKey(password1)); + UpdatePasswordLists(); + EXPECT_THAT(GetUsernamesAndPasswords(GetStoredPasswordsForRealm(kExampleCom)), + UnorderedElementsAre(Pair(kUsername2, kPassword2))); + + GetUIController() + .GetPasswordManagerPresenter() + ->UndoRemoveSavedPasswordOrException(); + UpdatePasswordLists(); + EXPECT_THAT(GetUsernamesAndPasswords(GetStoredPasswordsForRealm(kExampleCom)), + UnorderedElementsAre(Pair(kUsername, kPassword), + Pair(kUsername2, kPassword2))); +} + +TEST_F(PasswordManagerPresenterTest, TestExceptionRemovalAndUndo) { + autofill::PasswordForm exception1 = AddPasswordException(GURL(kExampleCom)); + autofill::PasswordForm exception2 = AddPasswordException(GURL(kExampleOrg)); + UpdatePasswordLists(); + + GetUIController().GetPasswordManagerPresenter()->RemovePasswordException( + password_manager::CreateSortKey(exception1)); + EXPECT_CALL(GetUIController(), SetPasswordExceptionList(UnorderedElementsAre( + HasOrigin(exception2.origin)))); + UpdatePasswordLists(); + + GetUIController() + .GetPasswordManagerPresenter() + ->UndoRemoveSavedPasswordOrException(); + EXPECT_CALL(GetUIController(), + SetPasswordExceptionList(UnorderedElementsAre( + HasOrigin(exception1.origin), HasOrigin(exception2.origin)))); + UpdatePasswordLists(); +} + +TEST_F(PasswordManagerPresenterTest, TestPasswordBatchRemovalAndUndo) { + autofill::PasswordForm password1 = + AddPasswordEntry(GURL(kExampleCom), kUsername, kPassword); + autofill::PasswordForm password2 = + AddPasswordEntry(GURL(kExampleCom), kUsername2, kPassword2); + UpdatePasswordLists(); + ASSERT_THAT(GetUsernamesAndPasswords(GetStoredPasswordsForRealm(kExampleCom)), + UnorderedElementsAre(Pair(kUsername, kPassword), + Pair(kUsername2, kPassword2))); + + GetUIController().GetPasswordManagerPresenter()->RemoveSavedPasswords( + {password_manager::CreateSortKey(password1), + password_manager::CreateSortKey(password2)}); + UpdatePasswordLists(); + EXPECT_THAT(GetUsernamesAndPasswords(GetStoredPasswordsForRealm(kExampleCom)), + IsEmpty()); + + GetUIController() + .GetPasswordManagerPresenter() + ->UndoRemoveSavedPasswordOrException(); + UpdatePasswordLists(); + EXPECT_THAT(GetUsernamesAndPasswords(GetStoredPasswordsForRealm(kExampleCom)), + UnorderedElementsAre(Pair(kUsername, kPassword), + Pair(kUsername2, kPassword2))); +} + +TEST_F(PasswordManagerPresenterTest, TestExceptionBatchRemovalAndUndo) { + autofill::PasswordForm exception1 = AddPasswordException(GURL(kExampleCom)); + autofill::PasswordForm exception2 = AddPasswordException(GURL(kExampleOrg)); + UpdatePasswordLists(); + + GetUIController().GetPasswordManagerPresenter()->RemovePasswordExceptions( + {password_manager::CreateSortKey(exception1), + password_manager::CreateSortKey(exception2)}); + EXPECT_CALL(GetUIController(), SetPasswordExceptionList(IsEmpty())); + UpdatePasswordLists(); + + GetUIController() + .GetPasswordManagerPresenter() + ->UndoRemoveSavedPasswordOrException(); + EXPECT_CALL(GetUIController(), + SetPasswordExceptionList(UnorderedElementsAre( + HasOrigin(exception1.origin), HasOrigin(exception2.origin)))); + UpdatePasswordLists(); +} + } // namespace
diff --git a/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc b/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc index 2b7d1431..8b4dded 100644 --- a/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc +++ b/chrome/browser/ui/search/local_ntp_one_google_bar_browsertest.cc
@@ -37,7 +37,9 @@ GURL GetLoadURLForTesting() const override { return GURL(); } - bool SetOgdebValue(const std::string& value) override { return false; } + bool SetAdditionalQueryParams(const std::string& value) override { + return false; + } void set_one_google_bar_data( const base::Optional<OneGoogleBarData>& one_google_bar_data) {
diff --git a/chrome/browser/ui/signin_reauth_popup_delegate.cc b/chrome/browser/ui/signin_reauth_popup_delegate.cc index 9e82e20d..6623f8f 100644 --- a/chrome/browser/ui/signin_reauth_popup_delegate.cc +++ b/chrome/browser/ui/signin_reauth_popup_delegate.cc
@@ -10,7 +10,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_navigator_params.h" -#include "chrome/browser/ui/signin_view_controller.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" @@ -27,13 +26,10 @@ } // namespace SigninReauthPopupDelegate::SigninReauthPopupDelegate( - SigninViewController* signin_view_controller, Browser* browser, const CoreAccountId& account_id, base::OnceCallback<void(signin::ReauthResult)> reauth_callback) - : signin_view_controller_(signin_view_controller), - browser_(browser), - reauth_callback_(std::move(reauth_callback)) { + : browser_(browser), reauth_callback_(std::move(reauth_callback)) { const GURL& reauth_url = GaiaUrls::GetInstance()->reauth_url(); NavigateParams nav_params(browser_, reauth_url, ui::PAGE_TRANSITION_AUTO_TOPLEVEL); @@ -73,10 +69,7 @@ } void SigninReauthPopupDelegate::WebContentsDestroyed() { - if (signin_view_controller_) { - signin_view_controller_->ResetModalSigninDelegate(); - signin_view_controller_ = nullptr; - } + NotifyModalSigninClosed(); delete this; }
diff --git a/chrome/browser/ui/signin_reauth_popup_delegate.h b/chrome/browser/ui/signin_reauth_popup_delegate.h index b43f124..dddb9064 100644 --- a/chrome/browser/ui/signin_reauth_popup_delegate.h +++ b/chrome/browser/ui/signin_reauth_popup_delegate.h
@@ -10,7 +10,6 @@ #include "chrome/browser/ui/signin_view_controller_delegate.h" #include "content/public/browser/web_contents_observer.h" -class SigninViewController; class Browser; struct CoreAccountId; @@ -22,7 +21,6 @@ public content::WebContentsObserver { public: SigninReauthPopupDelegate( - SigninViewController* signin_view_controller, Browser* browser, const CoreAccountId& account_id, base::OnceCallback<void(signin::ReauthResult)> reauth_callback); @@ -40,7 +38,6 @@ void CompleteReauth(signin::ReauthResult result); void CloseWebContents(); - SigninViewController* signin_view_controller_; Browser* const browser_; base::OnceCallback<void(signin::ReauthResult)> reauth_callback_; content::WebContents* web_contents_;
diff --git a/chrome/browser/ui/signin_view_controller.cc b/chrome/browser/ui/signin_view_controller.cc index 316ece8..1cfe9fea 100644 --- a/chrome/browser/ui/signin_view_controller.cc +++ b/chrome/browser/ui/signin_view_controller.cc
@@ -147,7 +147,7 @@ } // namespace SigninViewController::SigninViewController(Browser* browser) - : browser_(browser), delegate_(nullptr) {} + : browser_(browser) {} SigninViewController::~SigninViewController() { CloseModalSignin(); @@ -186,8 +186,9 @@ CloseModalSignin(); // The delegate will delete itself on request of the UI code when the widget // is closed. - delegate_ = SigninViewControllerDelegate::CreateSyncConfirmationDelegate( - this, browser_); + delegate_ = + SigninViewControllerDelegate::CreateSyncConfirmationDelegate(browser_); + delegate_observer_.Add(delegate_); chrome::RecordDialogCreation( chrome::DialogIdentifier::SIGN_IN_SYNC_CONFIRMATION); } @@ -196,8 +197,8 @@ CloseModalSignin(); // The delegate will delete itself on request of the UI code when the widget // is closed. - delegate_ = - SigninViewControllerDelegate::CreateSigninErrorDelegate(this, browser_); + delegate_ = SigninViewControllerDelegate::CreateSigninErrorDelegate(browser_); + delegate_observer_.Add(delegate_); chrome::RecordDialogCreation(chrome::DialogIdentifier::SIGN_IN_ERROR); } @@ -229,7 +230,8 @@ // This currently displays a fake dialog for development purposes. Should // not be called in production. delegate_ = SigninViewControllerDelegate::CreateFakeReauthDelegate( - this, browser_, account_id, std::move(wrapped_reauth_callback)); + browser_, account_id, std::move(wrapped_reauth_callback)); + delegate_observer_.Add(delegate_); return abort_handle; } @@ -255,10 +257,12 @@ // Display a popup for Dasher users. Ideally it should only be shown for // SAML users but there is no way to distinguish them. delegate_ = new SigninReauthPopupDelegate( - this, browser_, account_id, std::move(wrapped_reauth_callback)); + browser_, account_id, std::move(wrapped_reauth_callback)); + delegate_observer_.Add(delegate_); } else { delegate_ = SigninViewControllerDelegate::CreateReauthDelegate( - this, browser_, account_id, std::move(wrapped_reauth_callback)); + browser_, account_id, std::move(wrapped_reauth_callback)); + delegate_observer_.Add(delegate_); } chrome::RecordDialogCreation(chrome::DialogIdentifier::SIGNIN_REAUTH); return abort_handle; @@ -280,7 +284,8 @@ delegate_->ResizeNativeView(height); } -void SigninViewController::ResetModalSigninDelegate() { +void SigninViewController::OnModalSigninClosed() { + delegate_observer_.Remove(delegate_); delegate_ = nullptr; } @@ -433,8 +438,9 @@ // The delegate will delete itself on request of the UI code when the widget // is closed. delegate_ = SigninEmailConfirmationDialog::AskForConfirmation( - this, active_contents, browser_->profile(), last_email, email, + active_contents, browser_->profile(), last_email, email, std::move(callback)); + delegate_observer_.Add(delegate_); chrome::RecordDialogCreation( chrome::DialogIdentifier::SIGN_IN_EMAIL_CONFIRMATION); }
diff --git a/chrome/browser/ui/signin_view_controller.h b/chrome/browser/ui/signin_view_controller.h index 6b382c5..3f8df30 100644 --- a/chrome/browser/ui/signin_view_controller.h +++ b/chrome/browser/ui/signin_view_controller.h
@@ -10,8 +10,10 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "base/scoped_observer.h" #include "build/build_config.h" #include "chrome/browser/ui/profile_chooser_constants.h" +#include "chrome/browser/ui/signin_view_controller_delegate.h" #include "components/signin/public/base/signin_buildflags.h" #include "url/gurl.h" @@ -24,7 +26,6 @@ #endif class Browser; -class SigninViewControllerDelegate; struct CoreAccountId; namespace content { @@ -51,7 +52,7 @@ // error dialog, reauth prompt). Sync confirmation is used on // Win/Mac/Linux/Chrome OS. Sign-in is only used on Win/Mac/Linux because // Chrome OS has its own sign-in flow and doesn't use DICE. -class SigninViewController { +class SigninViewController : public SigninViewControllerDelegate::Observer { public: // Handle that will stop ongoing reauths upon destruction. class ReauthAbortHandle { @@ -60,7 +61,7 @@ }; explicit SigninViewController(Browser* browser); - virtual ~SigninViewController(); + ~SigninViewController() override; // Returns true if the signin flow should be shown for |mode|. static bool ShouldShowSigninForMode(profiles::BubbleViewMode mode); @@ -134,8 +135,8 @@ // Sets the height of the modal signin dialog. void SetModalSigninHeight(int height); - // Notifies this object that it's |delegate_| member has become invalid. - void ResetModalSigninDelegate(); + // SigninViewControllerDelegate::Observer: + void OnModalSigninClosed() override; private: friend class login_ui_test_utils::SigninViewControllerTestUtil; @@ -156,7 +157,10 @@ // Browser owning this controller. Browser* browser_; - SigninViewControllerDelegate* delegate_; + SigninViewControllerDelegate* delegate_ = nullptr; + ScopedObserver<SigninViewControllerDelegate, + SigninViewControllerDelegate::Observer> + delegate_observer_{this}; base::WeakPtrFactory<SigninViewController> weak_ptr_factory_{this};
diff --git a/chrome/browser/ui/signin_view_controller_delegate.cc b/chrome/browser/ui/signin_view_controller_delegate.cc new file mode 100644 index 0000000..f63b9f7 --- /dev/null +++ b/chrome/browser/ui/signin_view_controller_delegate.cc
@@ -0,0 +1,20 @@ +// Copyright 2020 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/signin_view_controller_delegate.h" + +SigninViewControllerDelegate::SigninViewControllerDelegate() = default; +SigninViewControllerDelegate::~SigninViewControllerDelegate() = default; + +void SigninViewControllerDelegate::AddObserver(Observer* observer) { + observer_list_.AddObserver(observer); +} +void SigninViewControllerDelegate::RemoveObserver(Observer* observer) { + observer_list_.RemoveObserver(observer); +} + +void SigninViewControllerDelegate::NotifyModalSigninClosed() { + for (auto& observer : observer_list_) + observer.OnModalSigninClosed(); +}
diff --git a/chrome/browser/ui/signin_view_controller_delegate.h b/chrome/browser/ui/signin_view_controller_delegate.h index 5c2599f..3d41a9b1 100644 --- a/chrome/browser/ui/signin_view_controller_delegate.h +++ b/chrome/browser/ui/signin_view_controller_delegate.h
@@ -6,15 +6,12 @@ #define CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_ #include "base/callback_forward.h" +#include "base/observer_list.h" +#include "base/observer_list_types.h" class Browser; -class SigninViewController; struct CoreAccountId; -namespace signin_metrics { -enum class AccessPoint; -} - namespace content { class WebContents; } @@ -31,25 +28,33 @@ // managing closes. class SigninViewControllerDelegate { public: + class Observer : public base::CheckedObserver { + public: + // Called when a dialog controlled by this SigninViewControllerDelegate is + // closed. + virtual void OnModalSigninClosed() = 0; + }; + + SigninViewControllerDelegate(const SigninViewControllerDelegate&) = delete; + SigninViewControllerDelegate& operator=(const SigninViewControllerDelegate&) = + delete; + // Returns a platform-specific SigninViewControllerDelegate instance that // displays the sync confirmation dialog. The returned object should delete // itself when the window it's managing is closed. static SigninViewControllerDelegate* CreateSyncConfirmationDelegate( - SigninViewController* signin_view_controller, Browser* browser); // Returns a platform-specific SigninViewControllerDelegate instance that // displays the modal sign in error dialog. The returned object should delete // itself when the window it's managing is closed. static SigninViewControllerDelegate* CreateSigninErrorDelegate( - SigninViewController* signin_view_controller, Browser* browser); // Returns a platform-specific SigninViewContolllerDelegate instance that // displays the reauth modal dialog. The returned object should delete itself // when the window it's managing is closed. static SigninViewControllerDelegate* CreateReauthDelegate( - SigninViewController* signin_view_controller, Browser* browser, const CoreAccountId& account_id, base::OnceCallback<void(signin::ReauthResult)> reauth_callback); @@ -60,11 +65,13 @@ // WARNING: This dialog is for development use only and should not be used in // production. static SigninViewControllerDelegate* CreateFakeReauthDelegate( - SigninViewController* signin_view_controller, Browser* browser, const CoreAccountId& account_id, base::OnceCallback<void(signin::ReauthResult)> reauth_callback); + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + // Closes the sign-in dialog. Note that this method may destroy this object, // so the caller should no longer use this object after calling this method. virtual void CloseModalSignin() = 0; @@ -78,7 +85,13 @@ virtual content::WebContents* GetWebContents() = 0; protected: - virtual ~SigninViewControllerDelegate() = default; + SigninViewControllerDelegate(); + virtual ~SigninViewControllerDelegate(); + + void NotifyModalSigninClosed(); + + private: + base::ObserverList<Observer, true> observer_list_; }; #endif // CHROME_BROWSER_UI_SIGNIN_VIEW_CONTROLLER_DELEGATE_H_
diff --git a/chrome/browser/ui/views/accessibility/caption_bubble.cc b/chrome/browser/ui/views/accessibility/caption_bubble.cc index 3c4b374..1a86644 100644 --- a/chrome/browser/ui/views/accessibility/caption_bubble.cc +++ b/chrome/browser/ui/views/accessibility/caption_bubble.cc
@@ -412,6 +412,17 @@ node_data->role = ax::mojom::Role::kCaption; } +void CaptionBubble::AddedToWidget() { + DCHECK(GetWidget()); + DCHECK(GetAnchorView()); + DCHECK(anchor_widget()); + GetWidget()->SetFocusTraversableParent( + anchor_widget()->GetFocusTraversable()); + GetWidget()->SetFocusTraversableParentView(GetAnchorView()); + GetAnchorView()->SetProperty(views::kAnchoredDialogKey, + static_cast<BubbleDialogDelegateView*>(this)); +} + void CaptionBubble::ButtonPressed(views::Button* sender, const ui::Event& event) { if (sender == close_button_) {
diff --git a/chrome/browser/ui/views/accessibility/caption_bubble.h b/chrome/browser/ui/views/accessibility/caption_bubble.h index de8bb3b3..71fb4ce8 100644 --- a/chrome/browser/ui/views/accessibility/caption_bubble.h +++ b/chrome/browser/ui/views/accessibility/caption_bubble.h
@@ -70,6 +70,7 @@ void OnFocus() override; void OnBlur() override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override; + void AddedToWidget() override; // Views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override;
diff --git a/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc b/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc index d43ca1c..fe2c820 100644 --- a/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc +++ b/chrome/browser/ui/views/accessibility/caption_bubble_controller_views_browsertest.cc
@@ -27,6 +27,11 @@ #include "ui/views/test/widget_test.h" #include "ui/views/widget/widget.h" +#if defined(USE_AURA) +#include "ui/aura/client/focus_client.h" +#include "ui/views/widget/native_widget_aura.h" +#endif // USE_AURA + namespace captions { namespace { @@ -61,6 +66,10 @@ return controller_ ? controller_->caption_bubble_->title_ : nullptr; } + views::Button* GetCloseButton() { + return controller_ ? controller_->caption_bubble_->close_button_ : nullptr; + } + views::Label* GetErrorMessage() { return controller_ ? controller_->caption_bubble_->error_message_ : nullptr; } @@ -78,14 +87,14 @@ } void ClickCloseButton() { - CaptionBubble* bubble = GetBubble(); - if (!bubble) + views::Button* button = GetCloseButton(); + if (!button) return; views::test::WidgetDestroyedWaiter waiter(GetCaptionWidget()); - bubble->close_button_->OnMousePressed( + button->OnMousePressed( ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0), ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0)); - bubble->close_button_->OnMouseReleased(ui::MouseEvent( + button->OnMouseReleased(ui::MouseEvent( ui::ET_MOUSE_RELEASED, gfx::Point(0, 0), gfx::Point(0, 0), ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0)); waiter.Wait(); @@ -396,6 +405,44 @@ #endif } +IN_PROC_BROWSER_TEST_F(CaptionBubbleControllerViewsTest, FocusableInTabOrder) { + OnPartialTranscription( + "A narwhal's tusk is an enlarged tooth containing " + "millions of nerve endings"); + // Not initially focused. + EXPECT_FALSE(GetBubble()->HasFocus()); + EXPECT_FALSE(GetCloseButton()->HasFocus()); + EXPECT_FALSE(GetBubble()->GetFocusManager()->GetFocusedView()); + + // Press tab until we enter the bubble. + while (!GetBubble()->HasFocus()) + EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_TAB, false, + false, false, false)); +#if defined(USE_AURA) && !defined(OS_CHROMEOS) + // Check the native widget has focus. + aura::client::FocusClient* focus_client = + aura::client::GetFocusClient(GetCaptionWidget()->GetNativeView()); + EXPECT_TRUE(GetCaptionWidget()->GetNativeView() == + focus_client->GetFocusedWindow()); +#endif + // Next tab should be the close button. + EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_TAB, false, + false, false, false)); + EXPECT_TRUE(GetCloseButton()->HasFocus()); + + // Next tab exits the bubble entirely. + EXPECT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_TAB, false, + false, false, false)); +#if defined(USE_AURA) && !defined(OS_CHROMEOS) + // The native widget should no longer have focus. + EXPECT_FALSE(GetCaptionWidget()->GetNativeView() == + focus_client->GetFocusedWindow()); +#endif + EXPECT_FALSE(GetBubble()->HasFocus()); + EXPECT_FALSE(GetCloseButton()->HasFocus()); + EXPECT_FALSE(GetBubble()->GetFocusManager()->GetFocusedView()); +} + IN_PROC_BROWSER_TEST_F(CaptionBubbleControllerViewsTest, UpdateCaptionTextSize) { int textSize = 16;
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc index d6702bd..3771833d 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
@@ -60,26 +60,23 @@ void AppInfoFooterPanel::CreateButtons() { if (CanCreateShortcuts(app_)) { - create_shortcuts_button_ = - AddChildView(views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16( - IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT))); + create_shortcuts_button_ = AddChildView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16( + IDS_APPLICATION_INFO_CREATE_SHORTCUTS_BUTTON_TEXT))); } #if defined(OS_CHROMEOS) if (CanSetPinnedToShelf(profile_, app_)) { - pin_to_shelf_button_ = - AddChildView(views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_APP_LIST_CONTEXT_MENU_PIN))); - unpin_from_shelf_button_ = - AddChildView(views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_APP_LIST_CONTEXT_MENU_UNPIN))); + pin_to_shelf_button_ = AddChildView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_APP_LIST_CONTEXT_MENU_PIN))); + unpin_from_shelf_button_ = AddChildView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_APP_LIST_CONTEXT_MENU_UNPIN))); UpdatePinButtons(false); } #endif if (CanUninstallApp(profile_, app_)) { - remove_button_ = AddChildView(views::MdTextButton::CreateSecondaryUiButton( + remove_button_ = AddChildView(views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_APPLICATION_INFO_UNINSTALL_BUTTON_TEXT))); }
diff --git a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc index d0788350..01cba17 100644 --- a/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc +++ b/chrome/browser/ui/views/autofill/payments/save_card_manage_cards_bubble_views.cc
@@ -25,7 +25,7 @@ std::unique_ptr<views::View> CreateManageCardsButton( views::ButtonListener* listener) { - auto manage_cards_button = views::MdTextButton::CreateSecondaryUiButton( + auto manage_cards_button = views::MdTextButton::Create( listener, l10n_util::GetStringUTF16(IDS_AUTOFILL_MANAGE_CARDS)); manage_cards_button->SetID(autofill::DialogViewId::MANAGE_CARDS_BUTTON); return manage_cards_button;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index 7e782c3..aba5da8e 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -45,7 +45,7 @@ namespace { std::unique_ptr<views::View> CreateEditButton(views::ButtonListener* listener) { - auto edit_button = views::MdTextButton::CreateSecondaryUiButton( + auto edit_button = views::MdTextButton::Create( listener, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS)); edit_button->AddAccelerator(ui::Accelerator(ui::VKEY_E, ui::EF_ALT_DOWN)); return edit_button;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc index dbcf834..f828b27 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -49,7 +49,7 @@ std::unique_ptr<views::LabelButton> CreateNewFolderButton( views::ButtonListener* listener, bool enabled) { - auto new_folder_button = views::MdTextButton::CreateSecondaryUiButton( + auto new_folder_button = views::MdTextButton::Create( listener, l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON)); new_folder_button->SetEnabled(enabled);
diff --git a/chrome/browser/ui/views/certificate_selector.cc b/chrome/browser/ui/views/certificate_selector.cc index 296fdc8..fab7636c 100644 --- a/chrome/browser/ui/views/certificate_selector.cc +++ b/chrome/browser/ui/views/certificate_selector.cc
@@ -118,9 +118,8 @@ : web_contents_(web_contents) { CHECK(web_contents_); - view_cert_button_ = - DialogDelegate::SetExtraView(views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_PAGE_INFO_CERT_INFO_BUTTON))); + view_cert_button_ = DialogDelegate::SetExtraView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_PAGE_INFO_CERT_INFO_BUTTON))); set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( views::TEXT, views::CONTROL));
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc index 76b593f..ba1f407 100644 --- a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc +++ b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc
@@ -61,10 +61,9 @@ DialogDelegate::SetButtonLabel( ui::DIALOG_BUTTON_OK, l10n_util::GetStringUTF16(IDS_CHROME_CLEANUP_PROMPT_REMOVE_BUTTON_LABEL)); - details_button_ = - DialogDelegate::SetExtraView(views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16( - IDS_CHROME_CLEANUP_PROMPT_DETAILS_BUTTON_LABEL))); + details_button_ = DialogDelegate::SetExtraView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16( + IDS_CHROME_CLEANUP_PROMPT_DETAILS_BUTTON_LABEL))); DialogDelegate::SetAcceptCallback( base::BindOnce(&ChromeCleanerDialog::HandleDialogInteraction,
diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc index 96bb7e2..a515ac1 100644 --- a/chrome/browser/ui/views/collected_cookies_views.cc +++ b/chrome/browser/ui/views/collected_cookies_views.cc
@@ -547,16 +547,11 @@ views::GridLayout* layout = allowed->SetLayoutManager(std::make_unique<views::GridLayout>()); - std::unique_ptr<views::LabelButton> block_allowed_button = - views::MdTextButton::CreateSecondaryUiButton( - this, - l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON)); - std::unique_ptr<views::LabelButton> delete_allowed_button = - views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_COOKIES_REMOVE_LABEL)); StartNewButtonColumnSet(layout, 0); - block_allowed_button_ = layout->AddView(std::move(block_allowed_button)); - delete_allowed_button_ = layout->AddView(std::move(delete_allowed_button)); + block_allowed_button_ = layout->AddView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON))); + delete_allowed_button_ = layout->AddView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_COOKIES_REMOVE_LABEL))); allowed_buttons_pane_ = view->AddChildView(std::move(allowed)); } @@ -567,18 +562,12 @@ blocked->SetLayoutManager(std::make_unique<views::GridLayout>()); blocked->SetVisible(false); - std::unique_ptr<views::LabelButton> allow_blocked_button = - views::MdTextButton::CreateSecondaryUiButton( - this, - l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON)); - std::unique_ptr<views::LabelButton> for_session_blocked_button = - views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16( - IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON)); StartNewButtonColumnSet(layout, 0); - allow_blocked_button_ = layout->AddView(std::move(allow_blocked_button)); - for_session_blocked_button_ = - layout->AddView(std::move(for_session_blocked_button)); + allow_blocked_button_ = layout->AddView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON))); + for_session_blocked_button_ = layout->AddView(views::MdTextButton::Create( + this, + l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON))); blocked_buttons_pane_ = view->AddChildView(std::move(blocked)); }
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 8f5035a8..22e5d5033 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -589,8 +589,7 @@ base::string16 title = bubble_content.manage_text; if (title.empty()) title = l10n_util::GetStringUTF16(IDS_MANAGE); - auto manage_button = - views::MdTextButton::CreateSecondaryUiButton(this, title); + auto manage_button = views::MdTextButton::Create(this, title); manage_button->SetMinSize(gfx::Size( layout->GetDistanceMetric(views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH), 0));
diff --git a/chrome/browser/ui/views/device_chooser_content_view.cc b/chrome/browser/ui/views/device_chooser_content_view.cc index ac58b50..8df3c15 100644 --- a/chrome/browser/ui/views/device_chooser_content_view.cc +++ b/chrome/browser/ui/views/device_chooser_content_view.cc
@@ -65,7 +65,7 @@ views::BoxLayout::Orientation::kHorizontal)) ->set_cross_axis_alignment(views::BoxLayout::CrossAxisAlignment::kCenter); - auto re_scan_button = views::MdTextButton::CreateSecondaryUiButton( + auto re_scan_button = views::MdTextButton::Create( listener, l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_RE_SCAN)); re_scan_button->SetTooltipText(
diff --git a/chrome/browser/ui/views/extensions/extension_action_test_helper_views.cc b/chrome/browser/ui/views/extensions/extension_action_test_helper_views.cc index 5b2ef37..a3060ad6 100644 --- a/chrome/browser/ui/views/extensions/extension_action_test_helper_views.cc +++ b/chrome/browser/ui/views/extensions/extension_action_test_helper_views.cc
@@ -35,7 +35,6 @@ BrowserActionsContainer* main_bar) : browser_actions_container_( new BrowserActionsContainer(browser, main_bar, this, true)) { - container_parent_.set_owned_by_client(); container_parent_.SetSize(gfx::Size(1000, 1000)); container_parent_.Layout(); container_parent_.AddChildView(browser_actions_container_);
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_item_unittest.cc b/chrome/browser/ui/views/extensions/extensions_menu_item_unittest.cc index dd03499..2027dec 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_item_unittest.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_item_unittest.cc
@@ -48,11 +48,11 @@ controller_ = controller.get(); controller_->SetActionName(initial_extension_name_); controller_->SetTooltip(initial_tooltip_); - menu_item_ = std::make_unique<ExtensionsMenuItemView>( + auto menu_item = std::make_unique<ExtensionsMenuItemView>( browser(), std::move(controller)); - menu_item_->set_owned_by_client(); + primary_button_on_menu_ = menu_item->primary_action_button_for_testing(); - widget_->SetContentsView(menu_item_.get()); + widget_->SetContentsView(menu_item.release()); } void TearDown() override { @@ -62,15 +62,13 @@ BrowserWithTestWindowTest::TearDown(); } - ExtensionsMenuButton* primary_button() { - return menu_item_->primary_action_button_for_testing(); - } + ExtensionsMenuButton* primary_button() { return primary_button_on_menu_; } base::test::ScopedFeatureList scoped_feature_list_; const base::string16 initial_extension_name_; const base::string16 initial_tooltip_; std::unique_ptr<views::Widget> widget_; - std::unique_ptr<ExtensionsMenuItemView> menu_item_; + ExtensionsMenuButton* primary_button_on_menu_ = nullptr; TestToolbarActionViewController* controller_ = nullptr; };
diff --git a/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc b/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc index 2a0bb47..15e94bff 100644 --- a/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc +++ b/chrome/browser/ui/views/extensions/extensions_menu_test_util.cc
@@ -31,7 +31,6 @@ public: explicit Wrapper(Browser* browser) : extensions_container_(new ExtensionsToolbarContainer(browser)) { - container_parent_.set_owned_by_client(); container_parent_.SetSize(gfx::Size(1000, 1000)); container_parent_.Layout(); container_parent_.AddChildView(extensions_container_); @@ -66,7 +65,6 @@ menu_view_ = std::make_unique<ExtensionsMenuView>( extensions_container_->extensions_button(), browser_, extensions_container_); - menu_view_->set_owned_by_client(); } ExtensionsMenuTestUtil::~ExtensionsMenuTestUtil() = default;
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc index 93b17ef..a0ec0bb 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
@@ -65,9 +65,7 @@ std::unique_ptr<views::LabelButton> CreateAuxiliaryButton( views::ButtonListener* listener, const base::string16& label) { - return label.empty() - ? nullptr - : views::MdTextButton::CreateSecondaryUiButton(listener, label); + return label.empty() ? nullptr : views::MdTextButton::Create(listener, label); } } // namespace
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc index 900f70f..ec96ee6 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.cc
@@ -71,6 +71,7 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/view_class_properties.h" #include "ui/views/view_observer.h" +#include "ui/views/view_tracker.h" #include "ui/views/widget/widget.h" namespace { @@ -243,6 +244,107 @@ bool drag_in_progress_ = false; }; +class WebUITabStripContainerView::IPHController : public TabStripModelObserver, + public views::WidgetObserver { + public: + explicit IPHController(Browser* browser) + : browser_(browser), + widget_observer_(this), + iph_tracker_(feature_engagement::TrackerFactory::GetForBrowserContext( + browser_->profile())) { + browser_->tab_strip_model()->AddObserver(this); + } + + ~IPHController() override { + browser_->tab_strip_model()->RemoveObserver(this); + } + + void SetAnchorView(views::View* anchor_view) { + DCHECK(!anchor_.view()); + anchor_.SetView(anchor_view); + } + + void NotifyOpened() { + iph_tracker_->NotifyEvent(feature_engagement::events::kWebUITabStripOpened); + } + + void NotifyClosed() { + iph_tracker_->NotifyEvent(feature_engagement::events::kWebUITabStripClosed); + } + + void UpdatePromoBounds() { + if (!promo_) + return; + promo_->OnAnchorBoundsChanged(); + } + + // Ends the promo if it's showing. + void AbortPromo() { + if (!promo_) + return; + + widget_observer_.Remove(promo_->GetWidget()); + promo_->GetWidget()->CloseWithReason( + views::Widget::ClosedReason::kUnspecified); + PromoBubbleDismissed(); + } + + // TabStripModelObserver: + void OnTabStripModelChanged( + TabStripModel* tab_strip_model, + const TabStripModelChange& change, + const TabStripSelectionChange& selection) override { + // We want to show the IPH to let the user know where their new tabs + // are. So, ignore changes other than insertions. + if (change.type() != TabStripModelChange::kInserted) + return; + + // Abort if we shouldn't show IPH right now. + if (!iph_tracker_->ShouldTriggerHelpUI( + feature_engagement::kIPHWebUITabStripFeature)) + return; + + views::View* const anchor_view = anchor_.view(); + + // In the off chance this is called while the browser is being destroyed, + // return. + if (!anchor_view) + return; + + anchor_view->SetProperty(kHasInProductHelpPromoKey, true); + promo_ = FeaturePromoBubbleView::CreateOwned( + anchor_view, views::BubbleBorder::TOP_RIGHT, + FeaturePromoBubbleView::ActivationAction::DO_NOT_ACTIVATE, + IDS_WEBUI_TAB_STRIP_PROMO); + promo_->set_close_on_deactivate(false); + widget_observer_.Add(promo_->GetWidget()); + } + + // views::WidgetObserver: + void OnWidgetDestroying(views::Widget* widget) override { + // This call should only happen at the end of IPH. + DCHECK_EQ(widget, promo_->GetWidget()); + widget_observer_.Remove(widget); + PromoBubbleDismissed(); + } + + private: + void PromoBubbleDismissed() { + promo_ = nullptr; + iph_tracker_->Dismissed(feature_engagement::kIPHWebUITabStripFeature); + views::View* const anchor_view = anchor_.view(); + if (anchor_view) + anchor_view->SetProperty(kHasInProductHelpPromoKey, false); + } + + Browser* const browser_; + ScopedObserver<views::Widget, views::WidgetObserver> widget_observer_; + feature_engagement::Tracker* const iph_tracker_; + views::ViewTracker anchor_; + + FeaturePromoBubbleView* promo_ = nullptr; +}; + WebUITabStripContainerView::WebUITabStripContainerView( Browser* browser, views::View* tab_contents_container, @@ -251,15 +353,14 @@ web_view_(AddChildView( std::make_unique<WebUITabStripWebView>(browser->profile()))), tab_contents_container_(tab_contents_container), - iph_tracker_(feature_engagement::TrackerFactory::GetForBrowserContext( - browser_->profile())), auto_closer_(std::make_unique<AutoCloser>( base::Bind(&WebUITabStripContainerView::EventShouldPropagate, base::Unretained(this)), base::Bind(&WebUITabStripContainerView::CloseForEventOutsideTabStrip, base::Unretained(this)))), drag_to_open_handler_( - std::make_unique<DragToOpenHandler>(this, drag_handle)) { + std::make_unique<DragToOpenHandler>(this, drag_handle)), + iph_controller_(std::make_unique<IPHController>(browser_)) { TRACE_EVENT0("ui", "WebUITabStripContainerView.Init"); DCHECK(UseTouchableTabStrip()); animation_.SetTweenType(gfx::Tween::Type::FAST_OUT_SLOW_IN); @@ -302,9 +403,8 @@ } WebUITabStripContainerView::~WebUITabStripContainerView() { - // The NewTabButton and TabCounter button both use |this| as a listener. We - // need to make sure we outlive them. - delete new_tab_button_; + // The TabCounter button uses |this| as a listener. We need to make + // sure we outlive it. delete tab_counter_; } @@ -354,24 +454,6 @@ return web_view_->holder(); } -std::unique_ptr<ToolbarButton> -WebUITabStripContainerView::CreateNewTabButton() { - DCHECK_EQ(nullptr, new_tab_button_); - auto new_tab_button = std::make_unique<ToolbarButton>(this); - new_tab_button->SetID(VIEW_ID_WEBUI_TAB_STRIP_NEW_TAB_BUTTON); - new_tab_button->SetTooltipText( - l10n_util::GetStringUTF16(IDS_TOOLTIP_NEW_TAB)); - - const int button_height = GetLayoutConstant(TOOLBAR_BUTTON_HEIGHT); - new_tab_button->SetPreferredSize(gfx::Size(button_height, button_height)); - new_tab_button->SetHorizontalAlignment(gfx::ALIGN_CENTER); - - new_tab_button_ = new_tab_button.get(); - view_observer_.Add(new_tab_button_); - - return new_tab_button; -} - std::unique_ptr<views::View> WebUITabStripContainerView::CreateTabCounter() { DCHECK_EQ(nullptr, tab_counter_); @@ -381,23 +463,13 @@ tab_counter_ = tab_counter.get(); view_observer_.Add(tab_counter_); + iph_controller_->SetAnchorView(tab_counter_); + return tab_counter; } -void WebUITabStripContainerView::UpdateButtons() { - const SkColor normal_color = - GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); - if (new_tab_button_) { - new_tab_button_->SetImage( - views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(kNewTabToolbarButtonIcon, normal_color)); - } -} - void WebUITabStripContainerView::UpdatePromoBubbleBounds() { - if (!tab_counter_promo_) - return; - tab_counter_promo_->OnAnchorBoundsChanged(); + iph_controller_->UpdatePromoBounds(); } void WebUITabStripContainerView::SetVisibleForTesting(bool visible) { @@ -414,7 +486,7 @@ void WebUITabStripContainerView::CloseContainer() { SetContainerTargetVisibility(false); - iph_tracker_->NotifyEvent(feature_engagement::events::kWebUITabStripClosed); + iph_controller_->NotifyClosed(); } void WebUITabStripContainerView::UpdateHeightForDragToOpen(float height_delta) { @@ -455,8 +527,8 @@ } if (opening) { - iph_tracker_->NotifyEvent(feature_engagement::events::kWebUITabStripOpened); RecordTabStripUIOpenHistogram(TabStripUIOpenAction::kToolbarDrag); + iph_controller_->NotifyOpened(); } animation_.Reset(open_proportion); @@ -477,14 +549,7 @@ time_at_open_ = base::TimeTicks::Now(); // If we're opening, end IPH if it's showing. - if (tab_counter_promo_) { - widget_observer_.Remove(tab_counter_promo_->GetWidget()); - tab_counter_promo_->GetWidget()->CloseWithReason( - views::Widget::ClosedReason::kUnspecified); - tab_counter_promo_ = nullptr; - tab_counter_->SetProperty(kHasInProductHelpPromoKey, false); - iph_tracker_->Dismissed(feature_engagement::kIPHWebUITabStripFeature); - } + iph_controller_->AbortPromo(); } else { if (time_at_open_) { RecordTabStripUIOpenDurationHistogram(base::TimeTicks::Now() - @@ -532,9 +597,7 @@ return true; // If the event is in the container or control buttons, let it be handled. - for (views::View* view : - {static_cast<views::View*>(this), - static_cast<views::View*>(new_tab_button_), tab_counter_}) { + for (views::View* view : {static_cast<views::View*>(this), tab_counter_}) { if (!view) continue; @@ -551,7 +614,7 @@ void WebUITabStripContainerView::CloseForEventOutsideTabStrip() { RecordTabStripUICloseHistogram(TabStripUICloseAction::kTapOutsideTabStrip); - iph_tracker_->NotifyEvent(feature_engagement::events::kWebUITabStripClosed); + iph_controller_->NotifyClosed(); SetContainerTargetVisibility(false); } @@ -624,44 +687,22 @@ void WebUITabStripContainerView::ButtonPressed(views::Button* sender, const ui::Event& event) { - if (sender->GetID() == VIEW_ID_WEBUI_TAB_STRIP_TAB_COUNTER) { - const bool new_visibility = !GetVisible(); - if (new_visibility) { - RecordTabStripUIOpenHistogram(TabStripUIOpenAction::kTapOnTabCounter); - iph_tracker_->NotifyEvent( - feature_engagement::events::kWebUITabStripOpened); - } else { - RecordTabStripUICloseHistogram(TabStripUICloseAction::kTapOnTabCounter); - iph_tracker_->NotifyEvent( - feature_engagement::events::kWebUITabStripClosed); - } - - SetContainerTargetVisibility(new_visibility); - - if (GetVisible() && sender->HasFocus()) { - // Automatically move focus to the tab strip WebUI if the focus is - // currently on the toggle button. - SetPaneFocusAndFocusDefault(); - } - } else if (sender->GetID() == VIEW_ID_WEBUI_TAB_STRIP_NEW_TAB_BUTTON) { - chrome::ExecuteCommand(browser_, IDC_NEW_TAB); - UMA_HISTOGRAM_ENUMERATION( - "Tab.NewTab", TabStripModel::NEW_TAB_BUTTON_IN_TOOLBAR_FOR_TOUCH, - TabStripModel::NEW_TAB_ENUM_COUNT); - - if (iph_tracker_->ShouldTriggerHelpUI( - feature_engagement::kIPHWebUITabStripFeature)) { - DCHECK(tab_counter_); - tab_counter_->SetProperty(kHasInProductHelpPromoKey, true); - tab_counter_promo_ = FeaturePromoBubbleView::CreateOwned( - tab_counter_, views::BubbleBorder::TOP_RIGHT, - FeaturePromoBubbleView::ActivationAction::DO_NOT_ACTIVATE, - IDS_WEBUI_TAB_STRIP_PROMO); - tab_counter_promo_->set_close_on_deactivate(false); - widget_observer_.Add(tab_counter_promo_->GetWidget()); - } + DCHECK_EQ(sender->GetID(), VIEW_ID_WEBUI_TAB_STRIP_TAB_COUNTER); + const bool new_visibility = !GetVisible(); + if (new_visibility) { + RecordTabStripUIOpenHistogram(TabStripUIOpenAction::kTapOnTabCounter); + iph_controller_->NotifyOpened(); } else { - NOTREACHED(); + RecordTabStripUICloseHistogram(TabStripUICloseAction::kTapOnTabCounter); + iph_controller_->NotifyClosed(); + } + + SetContainerTargetVisibility(new_visibility); + + if (GetVisible() && sender->HasFocus()) { + // Automatically move focus to the tab strip WebUI if the focus is + // currently on the toggle button. + SetPaneFocusAndFocusDefault(); } } @@ -685,9 +726,7 @@ void WebUITabStripContainerView::OnViewIsDeleting(View* observed_view) { view_observer_.Remove(observed_view); - if (observed_view == new_tab_button_) - new_tab_button_ = nullptr; - else if (observed_view == tab_counter_) + if (observed_view == tab_counter_) tab_counter_ = nullptr; else if (observed_view == tab_contents_container_) tab_contents_container_ = nullptr; @@ -695,16 +734,6 @@ NOTREACHED(); } -void WebUITabStripContainerView::OnWidgetDestroying(views::Widget* widget) { - // This call should only happen at the end of IPH. - DCHECK_EQ(widget, tab_counter_promo_->GetWidget()); - tab_counter_promo_ = nullptr; - widget_observer_.Remove(widget); - - tab_counter_->SetProperty(kHasInProductHelpPromoKey, false); - iph_tracker_->Dismissed(feature_engagement::kIPHWebUITabStripFeature); -} - bool WebUITabStripContainerView::SetPaneFocusAndFocusDefault() { // Make sure the pane first receives focus, then send a WebUI event to the // front-end so the correct HTML element receives focus.
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h index e01afe1..64ded8f 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view.h
@@ -26,10 +26,6 @@ #error #endif -namespace feature_engagement { -class Tracker; -} // namespace feature_engagement - namespace ui { class MenuModel; } // namespace ui @@ -41,14 +37,12 @@ } // namespace views class Browser; -class FeaturePromoBubbleView; class WebUITabStripContainerView : public TabStripUIEmbedder, public gfx::AnimationDelegate, public views::AccessiblePaneView, public views::ButtonListener, - public views::ViewObserver, - public views::WidgetObserver { + public views::ViewObserver { public: WebUITabStripContainerView(Browser* browser, views::View* tab_contents_container, @@ -67,12 +61,9 @@ views::NativeViewHost* GetNativeViewHost(); - // Control buttons. Each must only be called once. - std::unique_ptr<ToolbarButton> CreateNewTabButton(); + // Control button. Must only be called once. std::unique_ptr<views::View> CreateTabCounter(); - void UpdateButtons(); - // Should be called on BrowserView re-layout. If IPH is showing, // updates the promo for the new tab counter location. void UpdatePromoBubbleBounds(); @@ -83,12 +74,12 @@ // the container's preferred size will change. void SetVisibleForTesting(bool visible); views::WebView* web_view_for_testing() const { return web_view_; } - ToolbarButton* new_tab_button_for_testing() const { return new_tab_button_; } views::View* tab_counter_for_testing() const { return tab_counter_; } private: class AutoCloser; class DragToOpenHandler; + class IPHController; // Called as we are dragged open. void UpdateHeightForDragToOpen(float height_delta); @@ -142,17 +133,12 @@ void OnViewBoundsChanged(View* observed_view) override; void OnViewIsDeleting(View* observed_view) override; - // views::WidgetObserver: - void OnWidgetDestroying(views::Widget* widget) override; - // views::AccessiblePaneView bool SetPaneFocusAndFocusDefault() override; Browser* const browser_; views::WebView* const web_view_; views::View* tab_contents_container_; - // TODO(1045669): Remove this, or run an experiment on bringing it back. - ToolbarButton* new_tab_button_ = nullptr; views::View* tab_counter_ = nullptr; int desired_height_ = 0; @@ -162,19 +148,16 @@ // long the tab strip is kept open. base::Optional<base::TimeTicks> time_at_open_; - feature_engagement::Tracker* const iph_tracker_; - FeaturePromoBubbleView* tab_counter_promo_ = nullptr; - gfx::SlideAnimation animation_{this}; std::unique_ptr<AutoCloser> auto_closer_; std::unique_ptr<DragToOpenHandler> drag_to_open_handler_; + std::unique_ptr<IPHController> iph_controller_; std::unique_ptr<views::MenuRunner> context_menu_runner_; std::unique_ptr<ui::MenuModel> context_menu_model_; ScopedObserver<views::View, views::ViewObserver> view_observer_{this}; - ScopedObserver<views::Widget, views::WidgetObserver> widget_observer_{this}; }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_WEBUI_TAB_STRIP_CONTAINER_VIEW_H_
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_container_view_unittest.cc b/chrome/browser/ui/views/frame/webui_tab_strip_container_view_unittest.cc index d296380..78355b3d 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_container_view_unittest.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_container_view_unittest.cc
@@ -5,15 +5,21 @@ #include "chrome/browser/ui/views/frame/webui_tab_strip_container_view.h" #include <utility> +#include "base/bind.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/extensions/extension_tab_util.h" +#include "chrome/browser/feature_engagement/tracker_factory.h" +#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/test_with_browser_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/browser/ui/webui/tab_strip/tab_strip_ui.h" #include "chrome/test/base/test_browser_window.h" +#include "components/feature_engagement/public/feature_constants.h" +#include "components/feature_engagement/test/mock_tracker.h" #include "content/public/common/drop_data.h" +#include "testing/gmock/include/gmock/gmock.h" #include "ui/base/pointer/touch_ui_controller.h" class WebUITabStripContainerViewTest : public TestWithBrowserView { @@ -144,4 +150,62 @@ EXPECT_EQ(nullptr, browser_view()->webui_tab_strip()); } +class WebUITabStripIPHTest : public WebUITabStripContainerViewTest { + public: + void SetUp() override { + WebUITabStripContainerViewTest::SetUp(); + + mock_tracker_ = static_cast<MockTracker*>( + feature_engagement::TrackerFactory::GetForBrowserContext( + browser()->profile())); + } + + protected: + using MockTracker = + ::testing::NiceMock<feature_engagement::test::MockTracker>; + + TestingProfile::TestingFactories GetTestingFactories() override { + auto factories = WebUITabStripContainerViewTest::GetTestingFactories(); + factories.emplace_back(feature_engagement::TrackerFactory::GetInstance(), + base::Bind(MakeMockTracker)); + return factories; + } + + MockTracker* mock_tracker_; + + private: + static std::unique_ptr<KeyedService> MakeMockTracker( + content::BrowserContext* _context) { + using ::testing::_; + using ::testing::AnyNumber; + using ::testing::Return; + + auto mock_tracker = std::make_unique<MockTracker>(); + + // By default, allow calls to ShouldTriggerHelpUI. Other features + // may query this. We will set WebUI tab strip-specific expectations + // later. + EXPECT_CALL(*mock_tracker, ShouldTriggerHelpUI(_)) + .Times(AnyNumber()) + .WillRepeatedly(Return(false)); + return mock_tracker; + } +}; + +TEST_F(WebUITabStripIPHTest, OpeningNewTabAttemptsIPH) { + using ::testing::Eq; + using ::testing::Field; + using ::testing::Return; + + // Ensure the IPH attempts to show upon opening a new tab. + EXPECT_CALL(*mock_tracker_, + ShouldTriggerHelpUI( + Field(&base::Feature::name, + Eq(feature_engagement::kIPHWebUITabStripFeature.name)))) + .Times(1) + .WillOnce(Return(false)); + + chrome::NewTab(browser()); +} + // TODO(crbug.com/1066624): add coverage of open and close gestures.
diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc index 065bb81..2eaa126 100644 --- a/chrome/browser/ui/views/global_error_bubble_view.cc +++ b/chrome/browser/ui/views/global_error_bubble_view.cc
@@ -88,7 +88,7 @@ base::Unretained(browser_))); if (!error_->GetBubbleViewDetailsButtonLabel().empty()) { - DialogDelegate::SetExtraView(views::MdTextButton::CreateSecondaryUiButton( + DialogDelegate::SetExtraView(views::MdTextButton::Create( this, error_->GetBubbleViewDetailsButtonLabel())); }
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc index 6da6b98..b7ec2929 100644 --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -417,7 +417,7 @@ gfx::Insets(vector_button_margin)); // Add "Reset" button. - auto reset_button = views::MdTextButton::CreateSecondaryUiButton( + auto reset_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_ZOOM_SET_DEFAULT)); reset_button->SetTooltipText( l10n_util::GetStringUTF16(IDS_ACCNAME_ZOOM_SET_DEFAULT));
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc index 328cff9..9861c62 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
@@ -322,19 +322,17 @@ : IDS_PAGE_INFO_CHANGE_PASSWORD_BUTTON; } - std::unique_ptr<views::MdTextButton::LabelButton> change_password_button; + std::unique_ptr<views::MdTextButton> change_password_button; if (change_password_template) { - change_password_button = - views::MdTextButton::CreateSecondaryUiProminentButton( - button_listener_, - l10n_util::GetStringUTF16(change_password_template)); + change_password_button = views::MdTextButton::Create( + button_listener_, l10n_util::GetStringUTF16(change_password_template)); + change_password_button->SetProminent(true); change_password_button->SetID( PageInfoBubbleView::VIEW_ID_PAGE_INFO_BUTTON_CHANGE_PASSWORD); } - auto whitelist_password_reuse_button = - views::MdTextButton::CreateSecondaryUiButton( - button_listener_, l10n_util::GetStringUTF16( - IDS_PAGE_INFO_WHITELIST_PASSWORD_REUSE_BUTTON)); + auto whitelist_password_reuse_button = views::MdTextButton::Create( + button_listener_, + l10n_util::GetStringUTF16(IDS_PAGE_INFO_WHITELIST_PASSWORD_REUSE_BUTTON)); whitelist_password_reuse_button->SetID( PageInfoBubbleView::VIEW_ID_PAGE_INFO_BUTTON_WHITELIST_PASSWORD_REUSE);
diff --git a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc index f63e5f8..9c9fea1f 100644 --- a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc
@@ -180,10 +180,10 @@ info_button_ = button_layout->AddView(std::move(info_link)); // Leave site button. - std::unique_ptr<views::Button> leave_button( - views::MdTextButton::CreateSecondaryUiProminentButton( - this, l10n_util::GetStringUTF16( - GetSafetyTipLeaveButtonId(safety_tip_status)))); + auto leave_button = views::MdTextButton::Create( + this, + l10n_util::GetStringUTF16(GetSafetyTipLeaveButtonId(safety_tip_status))); + leave_button->SetProminent(true); leave_button->SetID(PageInfoBubbleView::VIEW_ID_PAGE_INFO_BUTTON_LEAVE_SITE); leave_button_ = button_layout->AddView(std::move(leave_button));
diff --git a/chrome/browser/ui/views/passwords/password_items_view.cc b/chrome/browser/ui/views/passwords/password_items_view.cc index efa72d0c..417d47c3 100644 --- a/chrome/browser/ui/views/passwords/password_items_view.cc +++ b/chrome/browser/ui/views/passwords/password_items_view.cc
@@ -93,9 +93,8 @@ std::unique_ptr<views::LabelButton> CreateUndoButton( views::ButtonListener* listener, const base::string16& username) { - std::unique_ptr<views::LabelButton> undo_button( - views::MdTextButton::CreateSecondaryUiButton( - listener, l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_UNDO))); + auto undo_button = views::MdTextButton::Create( + listener, l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_UNDO)); undo_button->set_tag(kUndoButtonTag); undo_button->SetFocusForPlatform(); undo_button->SetTooltipText( @@ -105,7 +104,7 @@ std::unique_ptr<views::View> CreateManageButton( views::ButtonListener* listener) { - return views::MdTextButton::CreateSecondaryUiButton( + return views::MdTextButton::Create( listener, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_MANAGE_PASSWORDS_BUTTON)); }
diff --git a/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc b/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc index 56be46d..2e2a42b 100644 --- a/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc +++ b/chrome/browser/ui/views/payments/cvc_unmask_view_controller.cc
@@ -257,9 +257,9 @@ } std::unique_ptr<views::Button> CvcUnmaskViewController::CreatePrimaryButton() { - std::unique_ptr<views::Button> button( - views::MdTextButton::CreateSecondaryUiProminentButton( - this, l10n_util::GetStringUTF16(IDS_CONFIRM))); + auto button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_CONFIRM)); + button->SetProminent(true); button->SetEnabled(false); // Only enabled when a valid CVC is entered. button->SetID(static_cast<int>(DialogViewID::CVC_PROMPT_CONFIRM_BUTTON)); button->set_tag(static_cast<int>(Tags::CONFIRM_TAG));
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc index 043b4f5f..1aca81b 100644 --- a/chrome/browser/ui/views/payments/editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -129,9 +129,9 @@ } std::unique_ptr<views::Button> EditorViewController::CreatePrimaryButton() { - std::unique_ptr<views::Button> button( - views::MdTextButton::CreateSecondaryUiProminentButton( - this, l10n_util::GetStringUTF16(IDS_DONE))); + auto button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_DONE)); + button->SetProminent(true); button->set_tag(static_cast<int>(EditorViewControllerTags::SAVE_BUTTON)); button->SetID(static_cast<int>(DialogViewID::EDITOR_SAVE_BUTTON)); return button;
diff --git a/chrome/browser/ui/views/payments/error_message_view_controller.cc b/chrome/browser/ui/views/payments/error_message_view_controller.cc index 1fbca04..d5f0e21 100644 --- a/chrome/browser/ui/views/payments/error_message_view_controller.cc +++ b/chrome/browser/ui/views/payments/error_message_view_controller.cc
@@ -27,9 +27,9 @@ std::unique_ptr<views::Button> ErrorMessageViewController::CreatePrimaryButton() { - std::unique_ptr<views::Button> button( - views::MdTextButton::CreateSecondaryUiProminentButton( - this, l10n_util::GetStringUTF16(IDS_CLOSE))); + auto button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_CLOSE)); + button->SetProminent(true); button->set_tag(static_cast<int>(PaymentRequestCommonTags::CLOSE_BUTTON_TAG)); button->SetID(static_cast<int>(DialogViewID::CANCEL_BUTTON)); return button;
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc index 67bf2a6d..93692de 100644 --- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc +++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -142,12 +142,12 @@ std::unique_ptr<views::Button> OrderSummaryViewController::CreatePrimaryButton() { - std::unique_ptr<views::Button> button( - views::MdTextButton::CreateSecondaryUiProminentButton( - this, state()->selected_app() && state()->selected_app()->type() != - PaymentApp::Type::AUTOFILL - ? l10n_util::GetStringUTF16(IDS_PAYMENTS_CONTINUE_BUTTON) - : l10n_util::GetStringUTF16(IDS_PAYMENTS_PAY_BUTTON))); + auto button = views::MdTextButton::Create( + this, state()->selected_app() && state()->selected_app()->type() != + PaymentApp::Type::AUTOFILL + ? l10n_util::GetStringUTF16(IDS_PAYMENTS_CONTINUE_BUTTON) + : l10n_util::GetStringUTF16(IDS_PAYMENTS_PAY_BUTTON)); + button->SetProminent(true); button->set_tag(static_cast<int>(PaymentRequestCommonTags::PAY_BUTTON_TAG)); button->SetID(static_cast<int>(DialogViewID::PAY_BUTTON)); pay_button_ = button.get();
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc index d45f8ae..ccb501b 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -75,9 +75,7 @@ request->spec()->AddObserver(this); SetLayoutManager(std::make_unique<views::FillLayout>()); - view_stack_ = std::make_unique<ViewStack>(); - view_stack_->set_owned_by_client(); - AddChildView(view_stack_.get()); + view_stack_ = AddChildView(std::make_unique<ViewStack>()); SetupSpinnerOverlay(); @@ -116,7 +114,7 @@ } views::View* PaymentRequestDialogView::GetInitiallyFocusedView() { - return view_stack_.get(); + return view_stack_; } void PaymentRequestDialogView::OnDialogClosed() { @@ -132,7 +130,7 @@ for (const auto& controller : controller_map_) { controller.second->Stop(); } - view_stack_.reset(); + RemoveChildViewT(view_stack_); controller_map_.clear(); request_->UserCancelled(); }
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.h b/chrome/browser/ui/views/payments/payment_request_dialog_view.h index 6f2c532c..ff901e0 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.h +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
@@ -187,7 +187,7 @@ // handler window is currently showing. int GetActualDialogWidth() const; - ViewStack* view_stack_for_testing() { return view_stack_.get(); } + ViewStack* view_stack_for_testing() { return view_stack_; } views::View* throbber_overlay_for_testing() { return throbber_overlay_; } private: @@ -211,7 +211,7 @@ // between the two. PaymentRequest* request_; ControllerMap controller_map_; - std::unique_ptr<ViewStack> view_stack_; + ViewStack* view_stack_; // A full dialog overlay that shows a spinner and the "processing" label. It's // hidden until ShowProcessingSpinner is called.
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc index b439277..2b845d2e 100644 --- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc +++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -521,9 +521,8 @@ void PaymentRequestSheetController::AddSecondaryButton(views::View* container) { if (ShouldShowSecondaryButton()) { - std::unique_ptr<views::Button> secondary_button = - views::MdTextButton::CreateSecondaryUiButton(this, - GetSecondaryButtonLabel()); + auto secondary_button = + views::MdTextButton::Create(this, GetSecondaryButtonLabel()); secondary_button->set_tag(GetSecondaryButtonTag()); secondary_button->SetID(GetSecondaryButtonId()); secondary_button->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc index 92beefb..f404a35f 100644 --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -350,9 +350,8 @@ std::unique_ptr<views::View> content_view, const base::string16& button_string, bool button_enabled) { - std::unique_ptr<views::Button> button( - views::MdTextButton::CreateSecondaryUiProminentButton(listener_, - button_string)); + auto button = views::MdTextButton::Create(listener_, button_string); + button->SetProminent(true); button->set_tag(tag_); button->SetID(id_); button->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); @@ -407,9 +406,9 @@ std::unique_ptr<views::Button> PaymentSheetViewController::CreatePrimaryButton() { - std::unique_ptr<views::Button> button( - views::MdTextButton::CreateSecondaryUiProminentButton( - this, CalculatePrimaryButtonLabel(state()))); + auto button = + views::MdTextButton::Create(this, CalculatePrimaryButtonLabel(state())); + button->SetProminent(true); button->set_tag(static_cast<int>(PaymentRequestCommonTags::PAY_BUTTON_TAG)); button->SetID(static_cast<int>(DialogViewID::PAY_BUTTON)); button->SetEnabled(state()->is_ready_to_pay());
diff --git a/chrome/browser/ui/views/profiles/avatar_toolbar_button_unittest.cc b/chrome/browser/ui/views/profiles/avatar_toolbar_button_unittest.cc index ce46fac..c5d3d107 100644 --- a/chrome/browser/ui/views/profiles/avatar_toolbar_button_unittest.cc +++ b/chrome/browser/ui/views/profiles/avatar_toolbar_button_unittest.cc
@@ -7,21 +7,17 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/test_with_browser_view.h" -#include "chrome/browser/ui/views/toolbar/toolbar_account_icon_container_view.h" #include "ui/gfx/color_utils.h" #include "ui/views/widget/widget.h" -class AvatarToolbarButtonTest : public TestWithBrowserView {}; +using AvatarToolbarButtonTest = TestWithBrowserView; // CrOS only shows the avatar button for incognito/guest. #if !defined(OS_CHROMEOS) TEST_F(AvatarToolbarButtonTest, HighlightMeetsMinimumContrast) { - auto parent = std::make_unique<ToolbarAccountIconContainerView>(browser()); - auto button = std::make_unique<AvatarToolbarButton>(browser(), parent.get()); - button->set_owned_by_client(); - - browser_view()->GetWidget()->GetContentsView()->AddChildView(button.get()); + auto* button = browser_view()->GetWidget()->GetContentsView()->AddChildView( + std::make_unique<AvatarToolbarButton>(browser())); SkColor toolbar_color = ToolbarButton::GetDefaultBackgroundColor(button->GetThemeProvider()); @@ -35,6 +31,8 @@ SkColorSetRGB(0xFF, 0x00, 0x00), SK_ColorBLACK, SK_ColorWHITE); EXPECT_GT(color_utils::GetContrastRatio(result, toolbar_color), color_utils::kMinimumReadableContrastRatio); + + button->parent()->RemoveChildViewT(button); } #endif
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view_base.cc b/chrome/browser/ui/views/profiles/profile_menu_view_base.cc index fb8062620..e21c9f27 100644 --- a/chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ b/chrome/browser/ui/views/profiles/profile_menu_view_base.cc
@@ -491,11 +491,11 @@ label->SetMultiLine(true); label->SetHandlesTooltips(false); - // Add blue button at the bottom. - views::Button* button = sync_info_container_->AddChildView( - views::MdTextButton::CreateSecondaryUiProminentButton(this, - clickable_text)); - RegisterClickAction(button, std::move(action)); + // Add the prominent button at the bottom. + auto button = views::MdTextButton::Create(this, clickable_text); + button->SetProminent(true); + RegisterClickAction(sync_info_container_->AddChildView(std::move(button)), + std::move(action)); } void ProfileMenuViewBase::AddShortcutFeatureButton(
diff --git a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc index a1b178ec..443be6d 100644 --- a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc +++ b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.cc
@@ -66,7 +66,6 @@ public SigninViewControllerDelegate { public: SigninViewControllerFakeReauthDelegateView( - SigninViewController* signin_view_controller, Browser* browser, base::OnceCallback<void(signin::ReauthResult)> reauth_callback); @@ -87,9 +86,6 @@ void OnCancel(); void OnClose(); - void ResetSigninViewControllerDelegate(); - - SigninViewController* signin_view_controller_; Browser* browser_; base::OnceCallback<void(signin::ReauthResult)> reauth_callback_; views::Widget* widget_ = nullptr; @@ -97,12 +93,9 @@ SigninViewControllerFakeReauthDelegateView:: SigninViewControllerFakeReauthDelegateView( - SigninViewController* signin_view_controller, Browser* browser, base::OnceCallback<void(signin::ReauthResult)> reauth_callback) - : signin_view_controller_(signin_view_controller), - browser_(browser), - reauth_callback_(std::move(reauth_callback)) { + : browser_(browser), reauth_callback_(std::move(reauth_callback)) { DialogDelegate::SetButtons(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL); DialogDelegate::SetAcceptCallback( base::BindOnce(&SigninViewControllerFakeReauthDelegateView::OnAccept, @@ -117,7 +110,7 @@ } void SigninViewControllerFakeReauthDelegateView::CloseModalSignin() { - ResetSigninViewControllerDelegate(); + NotifyModalSigninClosed(); if (widget_) widget_->Close(); } @@ -130,7 +123,7 @@ } void SigninViewControllerFakeReauthDelegateView::DeleteDelegate() { - ResetSigninViewControllerDelegate(); + NotifyModalSigninClosed(); delete this; } @@ -172,14 +165,6 @@ std::move(reauth_callback_).Run(signin::ReauthResult::kCancelled); } -void SigninViewControllerFakeReauthDelegateView:: - ResetSigninViewControllerDelegate() { - if (signin_view_controller_) { - signin_view_controller_->ResetModalSigninDelegate(); - signin_view_controller_ = nullptr; - } -} - } // namespace // static @@ -238,7 +223,7 @@ } void SigninViewControllerDelegateViews::DeleteDelegate() { - ResetSigninViewControllerDelegate(); + NotifyModalSigninClosed(); delete this; } @@ -257,7 +242,7 @@ reauth_tab_helper->CompleteReauth(signin::ReauthResult::kCancelled); } - ResetSigninViewControllerDelegate(); + NotifyModalSigninClosed(); if (modal_signin_widget_) modal_signin_widget_->Close(); } @@ -307,14 +292,12 @@ } SigninViewControllerDelegateViews::SigninViewControllerDelegateViews( - SigninViewController* signin_view_controller, std::unique_ptr<views::WebView> content_view, Browser* browser, ui::ModalType dialog_modal_type, bool wait_for_size, bool should_show_close_button) - : signin_view_controller_(signin_view_controller), - web_contents_(content_view->GetWebContents()), + : web_contents_(content_view->GetWebContents()), browser_(browser), content_view_(content_view.release()), modal_signin_widget_(nullptr), @@ -367,13 +350,6 @@ return std::unique_ptr<views::WebView>(web_view); } -void SigninViewControllerDelegateViews::ResetSigninViewControllerDelegate() { - if (signin_view_controller_) { - signin_view_controller_->ResetModalSigninDelegate(); - signin_view_controller_ = nullptr; - } -} - void SigninViewControllerDelegateViews::DisplayModal() { DCHECK(!modal_signin_widget_); @@ -415,22 +391,16 @@ // static SigninViewControllerDelegate* -SigninViewControllerDelegate::CreateSyncConfirmationDelegate( - SigninViewController* signin_view_controller, - Browser* browser) { +SigninViewControllerDelegate::CreateSyncConfirmationDelegate(Browser* browser) { return new SigninViewControllerDelegateViews( - signin_view_controller, SigninViewControllerDelegateViews::CreateSyncConfirmationWebView(browser), browser, ui::MODAL_TYPE_WINDOW, true, false); } // static SigninViewControllerDelegate* -SigninViewControllerDelegate::CreateSigninErrorDelegate( - SigninViewController* signin_view_controller, - Browser* browser) { +SigninViewControllerDelegate::CreateSigninErrorDelegate(Browser* browser) { return new SigninViewControllerDelegateViews( - signin_view_controller, SigninViewControllerDelegateViews::CreateSigninErrorWebView(browser), browser, ui::MODAL_TYPE_WINDOW, true, false); } @@ -438,12 +408,10 @@ // static SigninViewControllerDelegate* SigninViewControllerDelegate::CreateReauthDelegate( - SigninViewController* signin_view_controller, Browser* browser, const CoreAccountId& account_id, base::OnceCallback<void(signin::ReauthResult)> reauth_callback) { return new SigninViewControllerDelegateViews( - signin_view_controller, SigninViewControllerDelegateViews::CreateReauthWebView( browser, std::move(reauth_callback)), browser, ui::MODAL_TYPE_CHILD, false, true); @@ -452,10 +420,9 @@ // static SigninViewControllerDelegate* SigninViewControllerDelegate::CreateFakeReauthDelegate( - SigninViewController* signin_view_controller, Browser* browser, const CoreAccountId& account_id, base::OnceCallback<void(signin::ReauthResult)> reauth_callback) { return new SigninViewControllerFakeReauthDelegateView( - signin_view_controller, browser, std::move(reauth_callback)); + browser, std::move(reauth_callback)); }
diff --git a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h index a5831ce0..b0bd737 100644 --- a/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h +++ b/chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h
@@ -14,6 +14,7 @@ #include "ui/views/window/dialog_delegate.h" namespace content { +class WebContents; class WebContentsDelegate; } @@ -72,7 +73,6 @@ // |wait_for_size| is true, the delegate will wait for ResizeNativeView() to // be called by the base class before displaying the constrained window. SigninViewControllerDelegateViews( - SigninViewController* signin_view_controller, std::unique_ptr<views::WebView> content_view, Browser* browser, ui::ModalType dialog_modal_type, @@ -87,15 +87,11 @@ int dialog_height, base::Optional<int> dialog_width); - // Notifies the SigninViewController that this instance is being deleted. - void ResetSigninViewControllerDelegate(); - // Displays the modal dialog. void DisplayModal(); Browser* browser() { return browser_; } - SigninViewController* signin_view_controller_; // Not owned. content::WebContents* const web_contents_; // Not owned. Browser* const browser_; // Not owned. views::WebView* content_view_;
diff --git a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc index 9bdef909..e538f0ca 100644 --- a/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc +++ b/chrome/browser/ui/views/qrcode_generator/qrcode_generator_bubble.cc
@@ -257,10 +257,9 @@ tooltip_icon_ = layout->AddView(std::move(tooltip_icon)); // Download button. - std::unique_ptr<views::LabelButton> download_button = - views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16( - IDS_BROWSER_SHARING_QR_CODE_DIALOG_DOWNLOAD_BUTTON_LABEL)); + auto download_button = views::MdTextButton::Create( + this, l10n_util::GetStringUTF16( + IDS_BROWSER_SHARING_QR_CODE_DIALOG_DOWNLOAD_BUTTON_LABEL)); download_button->SetHorizontalAlignment(gfx::ALIGN_RIGHT); download_button_ = layout->AddView(std::move(download_button)); // End controls row
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc index af225c6..5ec1bc0f 100644 --- a/chrome/browser/ui/views/sad_tab_view.cc +++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -149,6 +149,9 @@ case 33: error_string = "RESULT_CODE_DOWNGRADE_AND_RELAUNCH"; break; + case 34: + error_string = "RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST"; + break; case 131: error_string = "SIGQUIT"; break; @@ -570,9 +573,6 @@ CreateErrorCodeLabel(GetErrorCodeFormatString(), GetCrashedErrorCode()), 2, 1.0, views::GridLayout::LEADING, views::GridLayout::LEADING); - std::unique_ptr<views::LabelButton> action_button = - views::MdTextButton::CreateSecondaryUiProminentButton( - this, l10n_util::GetStringUTF16(GetButtonTitle())); auto help_link = std::make_unique<views::Link>( l10n_util::GetStringUTF16(GetHelpLinkTitle())); help_link->set_callback(base::BindRepeating( @@ -582,6 +582,9 @@ unrelated_vertical_spacing_large); layout->AddView(std::move(help_link), 1.0, 1.0, views::GridLayout::LEADING, views::GridLayout::CENTER); + auto action_button = views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(GetButtonTitle())); + action_button->SetProminent(true); action_button_ = layout->AddView(std::move(action_button), 1.0, 1.0, views::GridLayout::TRAILING, views::GridLayout::LEADING);
diff --git a/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc b/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc index 936bc23..f6edc9da 100644 --- a/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc +++ b/chrome/browser/ui/views/safe_browsing/deep_scanning_failure_modal_dialog.cc
@@ -45,10 +45,9 @@ IDS_DEEP_SCANNING_TIMED_OUT_DIALOG_CANCEL_BUTTON)); DialogDelegate::SetAcceptCallback(std::move(accept_callback)); DialogDelegate::SetCancelCallback(std::move(cancel_callback)); - auto open_now_button = views::MdTextButton::CreateSecondaryUiButton( - this, - l10n_util::GetStringUTF16(IDS_DEEP_SCANNING_INFO_DIALOG_OPEN_NOW_BUTTON)); - open_now_button_ = DialogDelegate::SetExtraView(std::move(open_now_button)); + open_now_button_ = DialogDelegate::SetExtraView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16( + IDS_DEEP_SCANNING_INFO_DIALOG_OPEN_NOW_BUTTON))); set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( views::TEXT, views::TEXT));
diff --git a/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc b/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc index c3dbe5d..b7e58ad 100644 --- a/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc +++ b/chrome/browser/ui/views/safe_browsing/prompt_for_scanning_modal_dialog.cc
@@ -53,10 +53,9 @@ ui::DIALOG_BUTTON_CANCEL, l10n_util::GetStringUTF16(IDS_DEEP_SCANNING_INFO_DIALOG_CANCEL_BUTTON)); DialogDelegate::SetAcceptCallback(std::move(accept_callback)); - auto open_now_button = views::MdTextButton::CreateSecondaryUiButton( - this, - l10n_util::GetStringUTF16(IDS_DEEP_SCANNING_INFO_DIALOG_OPEN_NOW_BUTTON)); - open_now_button_ = DialogDelegate::SetExtraView(std::move(open_now_button)); + open_now_button_ = DialogDelegate::SetExtraView(views::MdTextButton::Create( + this, l10n_util::GetStringUTF16( + IDS_DEEP_SCANNING_INFO_DIALOG_OPEN_NOW_BUTTON))); set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( views::TEXT, views::TEXT));
diff --git a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc index 2b41ffe6..4695d4b0 100644 --- a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc +++ b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
@@ -136,14 +136,12 @@ base::string16 source_text = l10n_util::GetStringUTF16(IDS_MEDIA_SCREEN_CAPTURE_NOTIFICATION_SOURCE); - auto source_button = - views::MdTextButton::CreateSecondaryUiButton(this, source_text); - source_button_ = AddChildView(std::move(source_button)); + source_button_ = AddChildView(views::MdTextButton::Create(this, source_text)); base::string16 stop_text = l10n_util::GetStringUTF16(IDS_MEDIA_SCREEN_CAPTURE_NOTIFICATION_STOP); - auto stop_button = - views::MdTextButton::CreateSecondaryUiProminentButton(this, stop_text); + auto stop_button = views::MdTextButton::Create(this, stop_text); + stop_button->SetProminent(true); stop_button_ = AddChildView(std::move(stop_button)); auto hide_link = std::make_unique<views::Link>(
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.cc b/chrome/browser/ui/views/sync/dice_signin_button_view.cc index febf8e6..9c125da 100644 --- a/chrome/browser/ui/views/sync/dice_signin_button_view.cc +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.cc
@@ -69,10 +69,11 @@ // Add a stretching column for the sign in button. columns->AddColumn(views::GridLayout::FILL, views::GridLayout::TRAILING, 1.0, views::GridLayout::ColumnSize::kUsePreferred, 0, 0); - signin_button_ = grid_layout->AddView( - views::MdTextButton::CreateSecondaryUiProminentButton( - button_listener, - l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON))); + auto signin_button = views::MdTextButton::Create( + button_listener, + l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON)); + signin_button->SetProminent(true); + signin_button_ = grid_layout->AddView(std::move(signin_button)); } DiceSigninButtonView::~DiceSigninButtonView() = default;
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc index a0f9360c..59397c89 100644 --- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc +++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
@@ -63,7 +63,7 @@ l10n_util::GetStringUTF16(IDS_ENTERPRISE_SIGNIN_CANCEL)); if (prompt_for_new_profile) { - DialogDelegate::SetExtraView(views::MdTextButton::CreateSecondaryUiButton( + DialogDelegate::SetExtraView(views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_ENTERPRISE_SIGNIN_CONTINUE))); }
diff --git a/chrome/browser/ui/views/tabs/tab_unittest.cc b/chrome/browser/ui/views/tabs/tab_unittest.cc index 9e3a5f3..e3598f9 100644 --- a/chrome/browser/ui/views/tabs/tab_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -358,18 +358,18 @@ // The tab strip must be added to the view hierarchy for it to create the // buttons. + auto parent = std::make_unique<views::View>(); views::FlexLayout* layout_manager = - parent_.SetLayoutManager(std::make_unique<views::FlexLayout>()); + parent->SetLayoutManager(std::make_unique<views::FlexLayout>()); layout_manager->SetOrientation(views::LayoutOrientation::kHorizontal) .SetDefault( views::kFlexBehaviorKey, views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero, views::MaximumFlexSizeRule::kUnbounded)); - parent_.AddChildView(tab_strip_); - parent_.set_owned_by_client(); + parent->AddChildView(tab_strip_); widget_ = CreateTestWidget(); - widget_->SetContentsView(&parent_); + widget_->SetContentsView(parent.release()); } void TearDown() override { @@ -395,8 +395,6 @@ // Owned by TabStrip. FakeBaseTabStripController* controller_ = nullptr; - // Owns |tab_strip_|. - views::View parent_; TabStrip* tab_strip_ = nullptr; std::unique_ptr<views::Widget> widget_;
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc b/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc index 1e0ab5d..725ddc33 100644 --- a/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc +++ b/chrome/browser/ui/views/toolbar/browser_actions_container_browsertest.cc
@@ -535,11 +535,10 @@ main_bar_ = BrowserView::GetBrowserViewForBrowser(browser()) ->toolbar()->browser_actions(); overflow_parent_ = std::make_unique<views::ResizeAwareParentView>(); - overflow_parent_->set_owned_by_client(); - overflow_bar_ = new BrowserActionsContainer( - browser(), main_bar_, - BrowserView::GetBrowserViewForBrowser(browser())->toolbar(), true); - overflow_parent_->AddChildView(overflow_bar_); + overflow_bar_ = + overflow_parent_->AddChildView(std::make_unique<BrowserActionsContainer>( + browser(), main_bar_, + BrowserView::GetBrowserViewForBrowser(browser())->toolbar(), true)); } void BrowserActionsContainerOverflowTest::TearDownOnMainThread() {
diff --git a/chrome/browser/ui/views/toolbar/toolbar_view.cc b/chrome/browser/ui/views/toolbar/toolbar_view.cc index c5ca47a..5f7d135 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
@@ -924,11 +924,6 @@ if (media_button_) media_button_->UpdateIcon(); -#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) - if (browser_view_->webui_tab_strip()) - browser_view_->webui_tab_strip()->UpdateButtons(); -#endif // BUILDFLAG(ENABLE_WEBUI_TAB_STRIP) - if (avatar_) avatar_->UpdateIcon();
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc index fb8f6b8..8d33d64 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -853,7 +853,7 @@ views::GridLayout::kFixedSize, provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL)); - auto accept_button = views::MdTextButton::CreateSecondaryUiButton( + auto accept_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT)); accept_button->SetID(BUTTON_ID_TRANSLATE); accept_button->SetIsDefault(true); @@ -1010,7 +1010,7 @@ layout->StartRow(views::GridLayout::kFixedSize, kColumnSetId); - auto revert_button = views::MdTextButton::CreateSecondaryUiButton( + auto revert_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_REVERT)); revert_button->SetID(BUTTON_ID_SHOW_ORIGINAL); revert_button->SetEnabled(false); @@ -1046,7 +1046,7 @@ provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL)); layout->StartRow(views::GridLayout::kFixedSize, kColumnSetId); - auto button = views::MdTextButton::CreateSecondaryUiButton( + auto button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_REVERT)); button->SetID(BUTTON_ID_SHOW_ORIGINAL); layout->AddView(std::move(button)); @@ -1089,12 +1089,12 @@ layout->StartRow(views::GridLayout::kFixedSize, kColumnSetId); - auto try_again_button = views::MdTextButton::CreateSecondaryUiButton( + auto try_again_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_TRY_AGAIN)); try_again_button->SetID(BUTTON_ID_TRY_AGAIN); layout->AddView(std::move(try_again_button)); - auto advanced_button = views::MdTextButton::CreateSecondaryUiButton( + auto advanced_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ADVANCED_BUTTON)); advanced_button->SetID(BUTTON_ID_ADVANCED); layout->AddView(std::move(advanced_button)); @@ -1163,7 +1163,7 @@ views::GridLayout::kFixedSize, COLUMN_SET_ID_BUTTONS, views::GridLayout::kFixedSize, provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL)); - auto try_again_button = views::MdTextButton::CreateSecondaryUiButton( + auto try_again_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_TRY_AGAIN)); try_again_button->SetID(BUTTON_ID_TRY_AGAIN); layout->AddView(std::move(try_again_button)); @@ -1274,12 +1274,12 @@ layout->StartRow(views::GridLayout::kFixedSize, COLUMN_SET_ID_BUTTONS); layout->SkipColumns(1); - auto advanced_done_button = views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_DONE)); + auto advanced_done_button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_DONE)); advanced_done_button->SetID(BUTTON_ID_DONE); advanced_done_button->SetIsDefault(true); - auto advanced_cancel_button = views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_CANCEL)); + auto advanced_cancel_button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_CANCEL)); advanced_cancel_button->SetID(BUTTON_ID_CANCEL); advanced_done_button_ = layout->AddView(std::move(advanced_done_button)); layout->AddView(std::move(advanced_cancel_button)); @@ -1324,8 +1324,8 @@ source_language_combobox->set_listener(this); source_language_combobox_ = source_language_combobox.get(); - auto advanced_done_button = views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_DONE)); + auto advanced_done_button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_DONE)); advanced_done_button->SetID(BUTTON_ID_DONE); advanced_done_button->SetIsDefault(true); advanced_done_button_source_ = advanced_done_button.get(); @@ -1357,8 +1357,8 @@ target_language_combobox->set_listener(this); target_language_combobox_ = target_language_combobox.get(); - auto advanced_done_button = views::MdTextButton::CreateSecondaryUiButton( - this, l10n_util::GetStringUTF16(IDS_DONE)); + auto advanced_done_button = + views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_DONE)); advanced_done_button->SetID(BUTTON_ID_DONE); advanced_done_button->SetIsDefault(true); advanced_done_button_target_ = advanced_done_button.get(); @@ -1492,7 +1492,7 @@ layout->StartRow(views::GridLayout::kFixedSize, COLUMN_SET_ID_BUTTONS); layout->SkipColumns(1); - auto advanced_reset_button = views::MdTextButton::CreateSecondaryUiButton( + auto advanced_reset_button = views::MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_RESET)); advanced_reset_button->SetID(BUTTON_ID_RESET); layout->AddView(std::move(advanced_reset_button));
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom b/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom index 6963cc30..22000bf 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom
@@ -282,10 +282,10 @@ GetDoodle() => (Doodle? doodle); // Choose custom background from local file system. ChooseLocalCustomBackground() => (bool success); - // Get the OneGoogleBarParts to be inlined in the NTP. Forwards the - // "ogdeb" query parameter to the endpoint that serves the OneGoogleBar - // parts with |ogdeb_value|. - GetOneGoogleBarParts(string ogdeb_value) => (OneGoogleBarParts? parts); + // Get the OneGoogleBarParts to be inlined in the NTP. Forwards the query + // parameters to the endpoint that serves the OneGoogleBar parts with + // |query_params|. + GetOneGoogleBarParts(string query_params) => (OneGoogleBarParts? parts); // ======= METRICS ======= // Logs that |tiles| were displayed / updated at |time|. The first instance of
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc index 627805d..ded2eac78 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -460,13 +460,14 @@ } void NewTabPageHandler::GetOneGoogleBarParts( - const std::string& ogdeb_value, + const std::string& query_params, GetOneGoogleBarPartsCallback callback) { if (!one_google_bar_service_) { return; } one_google_bar_parts_callbacks_.push_back(std::move(callback)); - bool wait_for_refresh = one_google_bar_service_->SetOgdebValue(ogdeb_value); + bool wait_for_refresh = + one_google_bar_service_->SetAdditionalQueryParams(query_params); if (one_google_bar_service_->one_google_bar_data().has_value() && !wait_for_refresh) { OnOneGoogleBarDataUpdated();
diff --git a/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc b/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc index 651df206..9b817aa 100644 --- a/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc +++ b/chrome/browser/ui/webui/new_tab_page/untrusted_source.cc
@@ -95,10 +95,11 @@ const std::string path = url.has_path() ? url.path().substr(1) : ""; GURL url_param = GURL(url.query()); if (path == "one-google-bar" && one_google_bar_service_) { - std::string ogdeb_value; - net::GetValueForKeyInQuery(url, "ogdebencoded", &ogdeb_value); - base::Base64Decode(ogdeb_value, &ogdeb_value); - bool wait_for_refresh = one_google_bar_service_->SetOgdebValue(ogdeb_value); + std::string query_params; + net::GetValueForKeyInQuery(url, "paramsencoded", &query_params); + base::Base64Decode(query_params, &query_params); + bool wait_for_refresh = + one_google_bar_service_->SetAdditionalQueryParams(query_params); one_google_bar_callbacks_.push_back(std::move(callback)); if (one_google_bar_service_->one_google_bar_data().has_value() && !wait_for_refresh) {
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index 819351e..8b3cd01 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -129,6 +129,22 @@ const int kWebAppIconLargeNonDefault = 128; const int kWebAppIconSmallNonDefault = 16; +// The Youtube app is incorrectly harded to be a 'bookmark app'. However, it is +// a platform app. This helper method special cases that, and should be used +// instead of extension->from_bookmark(). +// TODO(crbug.com/1065748): Remove this hack once the youtube app is fixed. +bool FromBookmark(const extensions::Extension* extension) { + return extension->from_bookmark() && + extension->id() != extension_misc::kYoutubeAppId; +} + +// The Youtube app is incorrectly harded to be a 'bookmark app'. However, it is +// a platform app. +// TODO(crbug.com/1065748): Remove this hack once the youtube app is fixed. +bool IsYoutubeExtension(const std::string& extension_id) { + return extension_id == extension_misc::kYoutubeAppId; +} + void GetWebAppBasicInfo(const web_app::AppId& app_id, const web_app::AppRegistrar& app_registrar, base::DictionaryValue* info) { @@ -262,7 +278,7 @@ void AppLauncherHandler::CreateExtensionInfo(const Extension* extension, base::DictionaryValue* value) { - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); // The items which are to be written into |value| are also described in // chrome/browser/resources/ntp4/page_list_view.js in @typedef for AppInfo. // Please update it whenever you add or remove any keys here. @@ -480,8 +496,7 @@ const Extension* extension) { if (!ShouldShow(extension)) return; - - if (extension->from_bookmark()) + if (FromBookmark(extension)) return; std::unique_ptr<base::DictionaryValue> app_info(GetExtensionInfo(extension)); @@ -508,7 +523,7 @@ const Extension* extension, extensions::UninstallReason reason) { // Exclude events from bookmarks apps if BMO is turned on. - if (extension->from_bookmark()) + if (FromBookmark(extension)) return; ExtensionRemoved(extension, /*is_uninstall=*/true); } @@ -557,6 +572,11 @@ std::set<web_app::AppId> web_app_ids; web_app::AppRegistrar& registrar = web_app_provider_->registrar(); for (const web_app::AppId& web_app_id : registrar.GetAppIds()) { + // The Youtube app is harded to be a 'bookmark app', however it is not, it + // is a platform app. + // TODO(crbug.com/1065748): Remove this hack once the youtube app is fixed. + if (IsYoutubeExtension(web_app_id)) + continue; installed_extensions->Append(GetWebAppInfo(web_app_id)); web_app_ids.insert(web_app_id); } @@ -569,7 +589,7 @@ const Extension* extension = registry->GetInstalledExtension(*it); if (extension && extensions::ui_util::ShouldDisplayInNewTabPage(extension, profile)) { - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); installed_extensions->Append(GetExtensionInfo(extension)); } } @@ -625,7 +645,7 @@ const ExtensionSet& enabled_set = registry->enabled_extensions(); for (extensions::ExtensionSet::const_iterator it = enabled_set.begin(); it != enabled_set.end(); ++it) { - if ((*it)->from_bookmark()) + if (FromBookmark(it->get())) continue; visible_apps_.insert((*it)->id()); } @@ -633,7 +653,7 @@ const ExtensionSet& disabled_set = registry->disabled_extensions(); for (ExtensionSet::const_iterator it = disabled_set.begin(); it != disabled_set.end(); ++it) { - if ((*it)->from_bookmark()) + if (FromBookmark(it->get())) continue; visible_apps_.insert((*it)->id()); } @@ -641,7 +661,7 @@ const ExtensionSet& terminated_set = registry->terminated_extensions(); for (ExtensionSet::const_iterator it = terminated_set.begin(); it != terminated_set.end(); ++it) { - if ((*it)->from_bookmark()) + if (FromBookmark(it->get())) continue; visible_apps_.insert((*it)->id()); } @@ -693,7 +713,8 @@ apps::mojom::LaunchContainer launch_container; web_app::AppRegistrar& registrar = web_app_provider_->registrar(); - if (registrar.IsInstalled(extension_id)) { + if (registrar.IsInstalled(extension_id) && + !IsYoutubeExtension(extension_id)) { type = extensions::Manifest::Type::TYPE_HOSTED_APP; full_launch_url = registrar.GetAppLaunchURL(extension_id); launch_container = web_app::ConvertDisplayModeToAppLaunchContainer( @@ -708,7 +729,7 @@ PromptToEnableApp(extension_id); return; } - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); type = extension->GetType(); full_launch_url = extensions::AppLaunchInfo::GetFullLaunchURL(extension); launch_container = @@ -819,7 +840,7 @@ extensions::ExtensionRegistry::TERMINATED); if (!extension) return; - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); // Don't update the page; it already knows about the launch type change. base::AutoReset<bool> auto_reset(&ignore_changes_, true); @@ -830,7 +851,8 @@ std::string extension_id; CHECK(args->GetString(0, &extension_id)); - if (web_app_provider_->registrar().IsInstalled(extension_id)) { + if (web_app_provider_->registrar().IsInstalled(extension_id) && + !IsYoutubeExtension(extension_id)) { if (!extension_id_prompting_.empty()) return; // Only one prompt at a time. if (!web_app_provider_->install_finalizer().CanUserUninstallExternalApp( @@ -872,7 +894,7 @@ ->GetInstalledExtension(extension_id); if (!extension) return; - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); if (!extensions::ExtensionSystem::Get(extension_service_->profile()) ->management_policy() @@ -905,7 +927,8 @@ std::string app_id; CHECK(args->GetString(0, &app_id)); - if (web_app_provider_->registrar().IsInstalled(app_id)) { + if (web_app_provider_->registrar().IsInstalled(app_id) && + !IsYoutubeExtension(app_id)) { Browser* browser = chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); chrome::ShowCreateChromeAppShortcutsDialog( @@ -925,7 +948,7 @@ extensions::ExtensionRegistry::TERMINATED); if (!extension) return; - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); Browser* browser = chrome::FindBrowserWithWebContents( web_ui()->GetWebContents()); @@ -966,7 +989,8 @@ std::string extension_id; CHECK(args->GetString(0, &extension_id)); - if (web_app_provider_->registrar().IsInstalled(extension_id)) { + if (web_app_provider_->registrar().IsInstalled(extension_id) && + !IsYoutubeExtension(extension_id)) { chrome::ShowSiteSettings( chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()), web_app_provider_->registrar().GetAppLaunchURL(extension_id)); @@ -981,7 +1005,7 @@ extensions::ExtensionRegistry::TERMINATED); if (!extension) return; - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", AppInfoLaunchSource::FROM_APPS_PAGE, @@ -1241,7 +1265,7 @@ void AppLauncherHandler::ExtensionRemoved(const Extension* extension, bool is_uninstall) { - DCHECK(!extension->from_bookmark()); + DCHECK(!FromBookmark(extension)); if (!ShouldShow(extension)) return;
diff --git a/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc b/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc index 146d3b6..89955ca 100644 --- a/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc +++ b/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc
@@ -22,8 +22,8 @@ #include "content/public/browser/browser_thread.h" #if defined(OS_MACOSX) -#include "components/printing/browser/features.h" #include "components/printing/browser/printer_capabilities_mac.h" +#include "printing/printing_features.h" #endif #if defined(OS_WIN)
diff --git a/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc b/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc index 394ce8f..c3a1e23 100644 --- a/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ b/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
@@ -45,8 +45,8 @@ #include "url/gurl.h" #if defined(OS_MACOSX) -#include "components/printing/browser/features.h" #include "components/printing/browser/printer_capabilities_mac.h" +#include "printing/printing_features.h" #endif namespace printing {
diff --git a/chrome/browser/ui/webui/print_preview/pdf_printer_handler_unittest.cc b/chrome/browser/ui/webui/print_preview/pdf_printer_handler_unittest.cc index 628284d2..c037aa7 100644 --- a/chrome/browser/ui/webui/print_preview/pdf_printer_handler_unittest.cc +++ b/chrome/browser/ui/webui/print_preview/pdf_printer_handler_unittest.cc
@@ -18,9 +18,9 @@ #if defined(OS_MACOSX) #include "base/test/scoped_feature_list.h" -#include "components/printing/browser/features.h" #include "components/printing/browser/printer_capabilities_mac.h" #include "printing/backend/print_backend.h" +#include "printing/printing_features.h" #include "ui/gfx/geometry/size.h" #endif
diff --git a/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.cc b/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.cc index d2c7fcf..025f594 100644 --- a/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.cc +++ b/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.cc
@@ -13,7 +13,6 @@ #include "base/metrics/user_metrics.h" #include "base/notreached.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/signin_view_controller.h" #include "chrome/browser/ui/webui/signin/signin_email_confirmation_ui.h" #include "chrome/common/url_constants.h" #include "content/public/browser/host_zoom_map.h" @@ -65,14 +64,12 @@ }; SigninEmailConfirmationDialog::SigninEmailConfirmationDialog( - SigninViewController* signin_view_controller, content::WebContents* contents, Profile* profile, const std::string& last_email, const std::string& new_email, Callback callback) - : signin_view_controller_(signin_view_controller), - web_contents_(contents), + : web_contents_(contents), profile_(profile), last_email_(last_email), new_email_(new_email), @@ -83,7 +80,6 @@ // static SigninEmailConfirmationDialog* SigninEmailConfirmationDialog::AskForConfirmation( - SigninViewController* signin_view_controller, content::WebContents* contents, Profile* profile, const std::string& last_email, @@ -92,8 +88,7 @@ base::RecordAction(base::UserMetricsAction("Signin_Show_ImportDataPrompt")); // ShowDialog() will take care of ownership. SigninEmailConfirmationDialog* dialog = new SigninEmailConfirmationDialog( - signin_view_controller, contents, profile, last_email, email, - std::move(callback)); + contents, profile, last_email, email, std::move(callback)); dialog->ShowDialog(); return dialog; } @@ -205,10 +200,7 @@ action = CLOSE; } - if (signin_view_controller_) { - signin_view_controller_->ResetModalSigninDelegate(); - signin_view_controller_ = nullptr; - } + NotifyModalSigninClosed(); if (callback_) std::move(callback_).Run(action);
diff --git a/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.h b/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.h index ec519573..587587a 100644 --- a/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.h +++ b/chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.h
@@ -17,7 +17,6 @@ #include "ui/web_dialogs/web_dialog_ui.h" class Profile; -class SigninViewController; namespace content { class WebContents; @@ -47,7 +46,6 @@ // Create and show the dialog, which owns itself. // Ask the user for confirmation before starting to sync. static SigninEmailConfirmationDialog* AskForConfirmation( - SigninViewController* signin_view_controller, content::WebContents* contents, Profile* profile, const std::string& last_email, @@ -59,8 +57,7 @@ private: class DialogWebContentsObserver; - SigninEmailConfirmationDialog(SigninViewController* signin_view_controller, - content::WebContents* contents, + SigninEmailConfirmationDialog(content::WebContents* contents, Profile* profile, const std::string& last_email, const std::string& new_email, @@ -98,8 +95,6 @@ // Returns nullptr if there is no dialog. content::WebContents* GetDialogWebContents() const; - SigninViewController* signin_view_controller_; - // Web contents from which the "Learn more" link should be opened. content::WebContents* const web_contents_; Profile* const profile_;
diff --git a/chrome/browser/web_applications/web_app_install_finalizer.cc b/chrome/browser/web_applications/web_app_install_finalizer.cc index 10baa07..6080ad6 100644 --- a/chrome/browser/web_applications/web_app_install_finalizer.cc +++ b/chrome/browser/web_applications/web_app_install_finalizer.cc
@@ -346,6 +346,7 @@ base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(std::move(callback), /*uninstalled=*/false)); + return; } if (app->HasOnlySource(source)) {
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index ed2fe93..57d7ce2f 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -96,7 +96,6 @@ static_library("common") { sources = [ "all_messages.h", - "attrition_experiments.h", "auto_start_linux.cc", "auto_start_linux.h", "child_process_logging.h",
diff --git a/chrome/common/attrition_experiments.h b/chrome/common/attrition_experiments.h deleted file mode 100644 index 56c08b3f..0000000 --- a/chrome/common/attrition_experiments.h +++ /dev/null
@@ -1,26 +0,0 @@ -// Copyright (c) 2012 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_COMMON_ATTRITION_EXPERIMENTS_H_ -#define CHROME_COMMON_ATTRITION_EXPERIMENTS_H_ - -#include "chrome/grit/chromium_strings.h" - -namespace attrition_experiments { - -// A list of all the IDs we use for the attrition experiments. -enum Experiment { - kEnUs1 = IDS_TRY_TOAST_HEADING, - kEnUs2 = IDS_TRY_TOAST_HEADING2, - kEnUs3 = IDS_TRY_TOAST_HEADING3, - kEnUs4 = IDS_TRY_TOAST_HEADING4, - kSkype1 = IDS_TRY_TOAST_HEADING_SKYPE, -}; - -// A comma-separated list of brand codes that are associated with Skype. -const wchar_t kSkypeBrandCode[] = L"SKPC,SKPG,SKPH,SKPI,SKPL,SKPM,SKPN"; - -} // namespace attrition_experiments - -#endif // CHROME_COMMON_ATTRITION_EXPERIMENTS_H_
diff --git a/chrome/common/chrome_result_codes.h b/chrome/common/chrome_result_codes.h index 43d4a98..0b835045 100644 --- a/chrome/common/chrome_result_codes.h +++ b/chrome/common/chrome_result_codes.h
@@ -109,11 +109,15 @@ // and relaunch. RESULT_CODE_DOWNGRADE_AND_RELAUNCH, + // The GPU process was terminated due to context lost. This is in sync with + // viz::ExitCode in components/viz/service/gl/gpu_service_impl.h. + RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST, + // Last return code (keep this last). RESULT_CODE_CHROME_LAST_CODE }; -static_assert(RESULT_CODE_CHROME_LAST_CODE == 34, +static_assert(RESULT_CODE_CHROME_LAST_CODE == 35, "Please make sure the enum values are in sync with enums.xml"); } // namespace chrome
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 33b878f..81c16a2 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -3871,6 +3871,7 @@ "../browser/omnibox/status/status_mediator_unittest.cc", "../browser/omnibox/suggestions/answer/answer_suggestion_processor_unittest.cc", "../browser/omnibox/suggestions/autocomplete_mediator_unittest.cc", + "../browser/omnibox/suggestions/autocomplete_result_unittest.cc", "../browser/omnibox/suggestions/base/base_suggestion_processor_unittest.cc", "../browser/omnibox/suggestions/basic/basic_suggestion_processor_unittest.cc", "../browser/omnibox/suggestions/cached_zero_suggestions_manager_unittest.cc",
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeBrowserTestRule.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeBrowserTestRule.java index 5bf8d65..5d823c3 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeBrowserTestRule.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeBrowserTestRule.java
@@ -16,7 +16,7 @@ */ public class ChromeBrowserTestRule extends NativeLibraryTestRule { private void setUp() { - SigninTestUtil.setUpAuthForTest(); + SigninTestUtil.setUpAuthForTesting(); loadNativeLibraryAndInitBrowserProcess(); } @@ -41,6 +41,6 @@ } private void tearDown() { - SigninTestUtil.tearDownAuthForTest(); + SigninTestUtil.tearDownAuthForTesting(); } }
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestUtil.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestUtil.java index 2f5448b..543eae4 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestUtil.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/signin/SigninTestUtil.java
@@ -52,7 +52,7 @@ * This must be called before native is loaded. */ @WorkerThread - public static void setUpAuthForTest() { + public static void setUpAuthForTesting() { sAccountManager = new FakeAccountManagerDelegate( FakeAccountManagerDelegate.DISABLE_PROFILE_DATA_SOURCE); TestThreadUtils.runOnUiThreadBlocking(() -> { @@ -65,7 +65,7 @@ * Tears down the test authentication environment. */ @WorkerThread - public static void tearDownAuthForTest() { + public static void tearDownAuthForTesting() { if (getCurrentAccount() != null) { signOut(); }
diff --git a/chrome/test/chromedriver/chrome/stub_web_view.cc b/chrome/test/chromedriver/chrome/stub_web_view.cc index 8aeeb00b..39d8752b 100644 --- a/chrome/test/chromedriver/chrome/stub_web_view.cc +++ b/chrome/test/chromedriver/chrome/stub_web_view.cc
@@ -117,7 +117,7 @@ return Status(kOk); } -Status StubWebView::DispatchMouseEvents(const std::list<MouseEvent>& events, +Status StubWebView::DispatchMouseEvents(const std::vector<MouseEvent>& events, const std::string& frame, bool async_dispatch_events) { return Status(kOk); @@ -128,18 +128,18 @@ return Status(kOk); } -Status StubWebView::DispatchTouchEvents(const std::list<TouchEvent>& events, +Status StubWebView::DispatchTouchEvents(const std::vector<TouchEvent>& events, bool async_dispatch_events) { return Status(kOk); } Status StubWebView::DispatchTouchEventWithMultiPoints( - const std::list<TouchEvent>& events, + const std::vector<TouchEvent>& events, bool async_dispatch_events) { return Status(kOk); } -Status StubWebView::DispatchKeyEvents(const std::list<KeyEvent>& events, +Status StubWebView::DispatchKeyEvents(const std::vector<KeyEvent>& events, bool async_dispatch_events) { return Status(kOk); }
diff --git a/chrome/test/chromedriver/chrome/stub_web_view.h b/chrome/test/chromedriver/chrome/stub_web_view.h index 4167937..c6cd158 100644 --- a/chrome/test/chromedriver/chrome/stub_web_view.h +++ b/chrome/test/chromedriver/chrome/stub_web_view.h
@@ -5,7 +5,6 @@ #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_STUB_WEB_VIEW_H_ #define CHROME_TEST_CHROMEDRIVER_CHROME_STUB_WEB_VIEW_H_ -#include <list> #include <memory> #include <string> @@ -63,17 +62,17 @@ const std::string& function, const base::ListValue& args, std::string* out_frame) override; - Status DispatchMouseEvents(const std::list<MouseEvent>& events, + Status DispatchMouseEvents(const std::vector<MouseEvent>& events, const std::string& frame, bool async_dispatch_events = false) override; Status DispatchTouchEvent(const TouchEvent& event, bool async_dispatch_events = false) override; - Status DispatchTouchEvents(const std::list<TouchEvent>& events, + Status DispatchTouchEvents(const std::vector<TouchEvent>& events, bool async_dispatch_events = false) override; Status DispatchTouchEventWithMultiPoints( - const std::list<TouchEvent>& events, + const std::vector<TouchEvent>& events, bool async_dispatch_events = false) override; - Status DispatchKeyEvents(const std::list<KeyEvent>& events, + Status DispatchKeyEvents(const std::vector<KeyEvent>& events, bool async_dispatch_events = false) override; Status GetCookies(std::unique_ptr<base::ListValue>* cookies, const std::string& current_page_url) override;
diff --git a/chrome/test/chromedriver/chrome/ui_events.cc b/chrome/test/chromedriver/chrome/ui_events.cc index 347ce6be..cde9d16 100644 --- a/chrome/test/chromedriver/chrome/ui_events.cc +++ b/chrome/test/chromedriver/chrome/ui_events.cc
@@ -130,7 +130,7 @@ return key_event_; } -void KeyEventBuilder::Generate(std::list<KeyEvent>* key_events) { +void KeyEventBuilder::Generate(std::vector<KeyEvent>* key_events) { key_events->push_back(SetType(kRawKeyDownEventType)->Build()); if (key_event_.modified_text.length() || key_event_.unmodified_text.length()) key_events->push_back(SetType(kCharEventType)->Build());
diff --git a/chrome/test/chromedriver/chrome/ui_events.h b/chrome/test/chromedriver/chrome/ui_events.h index 0a434b2..55537e8 100644 --- a/chrome/test/chromedriver/chrome/ui_events.h +++ b/chrome/test/chromedriver/chrome/ui_events.h
@@ -5,8 +5,8 @@ #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_UI_EVENTS_H_ #define CHROME_TEST_CHROMEDRIVER_CHROME_UI_EVENTS_H_ -#include <list> #include <string> +#include <vector> #include "base/macros.h" #include "ui/events/keycodes/keyboard_codes.h" @@ -139,7 +139,7 @@ KeyEventBuilder* SetCode(const std::string& key); KeyEventBuilder* SetIsFromAction(); KeyEvent Build(); - void Generate(std::list<KeyEvent>* key_events); + void Generate(std::vector<KeyEvent>* key_events); private: void UpdateKeyString();
diff --git a/chrome/test/chromedriver/chrome/web_view.h b/chrome/test/chromedriver/chrome/web_view.h index 04a5e7f..a82bb3f4 100644 --- a/chrome/test/chromedriver/chrome/web_view.h +++ b/chrome/test/chromedriver/chrome/web_view.h
@@ -5,7 +5,6 @@ #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ #define CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_H_ -#include <list> #include <memory> #include <string> #include <vector> @@ -144,7 +143,7 @@ std::string* out_frame) = 0; // Dispatch a sequence of mouse events. - virtual Status DispatchMouseEvents(const std::list<MouseEvent>& events, + virtual Status DispatchMouseEvents(const std::vector<MouseEvent>& events, const std::string& frame, bool async_dispatch_events) = 0; @@ -153,15 +152,15 @@ bool async_dispatch_events) = 0; // Dispatch a sequence of touch events. - virtual Status DispatchTouchEvents(const std::list<TouchEvent>& events, + virtual Status DispatchTouchEvents(const std::vector<TouchEvent>& events, bool async_dispatch_events) = 0; // Dispatch a single touch event with more than one touch point. virtual Status DispatchTouchEventWithMultiPoints( - const std::list<TouchEvent>& events, + const std::vector<TouchEvent>& events, bool async_dispatch_events) = 0; // Dispatch a sequence of key events. - virtual Status DispatchKeyEvents(const std::list<KeyEvent>& events, + virtual Status DispatchKeyEvents(const std::vector<KeyEvent>& events, bool async_dispatch_events) = 0; // Return all the cookies visible to the current page.
diff --git a/chrome/test/chromedriver/chrome/web_view_impl.cc b/chrome/test/chromedriver/chrome/web_view_impl.cc index e36b48d..92817a0 100644 --- a/chrome/test/chromedriver/chrome/web_view_impl.cc +++ b/chrome/test/chromedriver/chrome/web_view_impl.cc
@@ -503,7 +503,7 @@ } Status WebViewImpl::DispatchTouchEventsForMouseEvents( - const std::list<MouseEvent>& events, + const std::vector<MouseEvent>& events, const std::string& frame) { // Touch events are filtered by the compositor if there are no touch listeners // on the page. Wait two frames for the compositor to sync with the main @@ -549,7 +549,7 @@ return Status(kOk); } -Status WebViewImpl::DispatchMouseEvents(const std::list<MouseEvent>& events, +Status WebViewImpl::DispatchMouseEvents(const std::vector<MouseEvent>& events, const std::string& frame, bool async_dispatch_events) { if (mobile_emulation_override_manager_->IsEmulatingTouch()) @@ -567,7 +567,8 @@ params.SetInteger("clickCount", it->click_count); params.SetString("pointerType", GetAsString(it->pointer_type)); - if (async_dispatch_events) { + const bool last_event = (it == events.end() - 1); + if (async_dispatch_events || !last_event) { status = client_->SendCommandAndIgnoreResponse("Input.dispatchMouseEvent", params); } else { @@ -601,10 +602,12 @@ return status; } -Status WebViewImpl::DispatchTouchEvents(const std::list<TouchEvent>& events, +Status WebViewImpl::DispatchTouchEvents(const std::vector<TouchEvent>& events, bool async_dispatch_events) { for (auto it = events.begin(); it != events.end(); ++it) { - Status status = DispatchTouchEvent(*it, async_dispatch_events); + const bool last_event = (it == events.end() - 1); + Status status = + DispatchTouchEvent(*it, async_dispatch_events || !last_event); if (status.IsError()) return status; } @@ -612,7 +615,7 @@ } Status WebViewImpl::DispatchTouchEventWithMultiPoints( - const std::list<TouchEvent>& events, + const std::vector<TouchEvent>& events, bool async_dispatch_events) { if (events.size() == 0) return Status(kOk); @@ -647,7 +650,7 @@ return Status(kOk); } -Status WebViewImpl::DispatchKeyEvents(const std::list<KeyEvent>& events, +Status WebViewImpl::DispatchKeyEvents(const std::vector<KeyEvent>& events, bool async_dispatch_events) { Status status(kOk); for (auto it = events.begin(); it != events.end(); ++it) { @@ -686,7 +689,8 @@ params.SetInteger("location", it->location); } - if (async_dispatch_events) { + const bool last_event = (it == events.end() - 1); + if (async_dispatch_events || !last_event) { status = client_->SendCommandAndIgnoreResponse("Input.dispatchKeyEvent", params); } else {
diff --git a/chrome/test/chromedriver/chrome/web_view_impl.h b/chrome/test/chromedriver/chrome/web_view_impl.h index be968075..4f4cb94 100644 --- a/chrome/test/chromedriver/chrome/web_view_impl.h +++ b/chrome/test/chromedriver/chrome/web_view_impl.h
@@ -5,7 +5,6 @@ #ifndef CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_IMPL_H_ #define CHROME_TEST_CHROMEDRIVER_CHROME_WEB_VIEW_IMPL_H_ -#include <list> #include <memory> #include <string> @@ -106,17 +105,17 @@ const std::string& function, const base::ListValue& args, std::string* out_frame) override; - Status DispatchMouseEvents(const std::list<MouseEvent>& events, + Status DispatchMouseEvents(const std::vector<MouseEvent>& events, const std::string& frame, bool async_dispatch_events = false) override; Status DispatchTouchEvent(const TouchEvent& event, bool async_dispatch_events = false) override; - Status DispatchTouchEvents(const std::list<TouchEvent>& events, + Status DispatchTouchEvents(const std::vector<TouchEvent>& events, bool async_dispatch_events = false) override; Status DispatchTouchEventWithMultiPoints( - const std::list<TouchEvent>& events, + const std::vector<TouchEvent>& events, bool async_dispatch_events = false) override; - Status DispatchKeyEvents(const std::list<KeyEvent>& events, + Status DispatchKeyEvents(const std::vector<KeyEvent>& events, bool async_dispatch_events = false) override; Status GetCookies(std::unique_ptr<base::ListValue>* cookies, const std::string& current_page_url) override; @@ -191,8 +190,9 @@ Status InitProfileInternal(); Status StopProfileInternal(); - Status DispatchTouchEventsForMouseEvents(const std::list<MouseEvent>& events, - const std::string& frame); + Status DispatchTouchEventsForMouseEvents( + const std::vector<MouseEvent>& events, + const std::string& frame); std::string id_; bool w3c_compliant_;
diff --git a/chrome/test/chromedriver/element_commands.cc b/chrome/test/chromedriver/element_commands.cc index b5e3231..a8ee244 100644 --- a/chrome/test/chromedriver/element_commands.cc +++ b/chrome/test/chromedriver/element_commands.cc
@@ -7,7 +7,6 @@ #include <stddef.h> #include <cmath> -#include <list> #include <vector> #include "base/callback.h" @@ -198,7 +197,7 @@ if (status.IsError()) return status; - std::list<MouseEvent> events; + std::vector<MouseEvent> events; events.push_back(MouseEvent(kMovedMouseEventType, kNoneMouseButton, location.x, location.y, session->sticky_modifiers, 0, 0)); @@ -228,7 +227,7 @@ return status; if (!session->chrome->HasTouchScreen()) { // TODO(samuong): remove this once we stop supporting M44. - std::list<TouchEvent> events; + std::vector<TouchEvent> events; events.push_back( TouchEvent(kTouchStart, location.x, location.y)); events.push_back(
diff --git a/chrome/test/chromedriver/key_converter.cc b/chrome/test/chromedriver/key_converter.cc index 0123bee5..637a3cc1 100644 --- a/chrome/test/chromedriver/key_converter.cc +++ b/chrome/test/chromedriver/key_converter.cc
@@ -451,8 +451,8 @@ Status ConvertKeysToKeyEvents(const base::string16& client_keys, bool release_modifiers, int* modifiers, - std::list<KeyEvent>* client_key_events) { - std::list<KeyEvent> key_events; + std::vector<KeyEvent>* client_key_events) { + std::vector<KeyEvent> key_events; base::string16 keys = client_keys; // Add an implicit NULL character to the end of the input to depress all @@ -617,7 +617,7 @@ Status ConvertKeyActionToKeyEvent(const base::DictionaryValue* action_object, base::DictionaryValue* input_state, bool is_key_down, - std::list<KeyEvent>* key_events) { + std::vector<KeyEvent>* key_events) { std::string raw_key; if (!action_object->GetString("value", &raw_key)) return Status(kUnknownError, "missing 'value'");
diff --git a/chrome/test/chromedriver/key_converter.h b/chrome/test/chromedriver/key_converter.h index 9aa640e..d525a02 100644 --- a/chrome/test/chromedriver/key_converter.h +++ b/chrome/test/chromedriver/key_converter.h
@@ -5,8 +5,8 @@ #ifndef CHROME_TEST_CHROMEDRIVER_KEY_CONVERTER_H_ #define CHROME_TEST_CHROMEDRIVER_KEY_CONVERTER_H_ -#include <list> #include <string> +#include <vector> #include "base/strings/string16.h" #include "base/values.h" @@ -23,11 +23,11 @@ Status ConvertKeysToKeyEvents(const base::string16& keys, bool release_modifiers, int* modifiers, - std::list<KeyEvent>* key_events); + std::vector<KeyEvent>* key_events); Status ConvertKeyActionToKeyEvent(const base::DictionaryValue* action_object, base::DictionaryValue* input_state, bool is_key_down, - std::list<KeyEvent>* client_key_events); + std::vector<KeyEvent>* client_key_events); #endif // CHROME_TEST_CHROMEDRIVER_KEY_CONVERTER_H_
diff --git a/chrome/test/chromedriver/key_converter_unittest.cc b/chrome/test/chromedriver/key_converter_unittest.cc index a779463..707b48d5 100644 --- a/chrome/test/chromedriver/key_converter_unittest.cc +++ b/chrome/test/chromedriver/key_converter_unittest.cc
@@ -4,7 +4,6 @@ #include <stddef.h> -#include <list> #include <string> #include "base/stl_util.h" @@ -20,16 +19,16 @@ namespace { void CheckEvents(const base::string16& keys, - const std::list<KeyEvent>& expected_events, + const std::vector<KeyEvent>& expected_events, bool release_modifiers, int expected_modifiers) { int modifiers = 0; - std::list<KeyEvent> events; + std::vector<KeyEvent> events; EXPECT_EQ(kOk, ConvertKeysToKeyEvents(keys, release_modifiers, &modifiers, &events).code()); EXPECT_EQ(expected_events.size(), events.size()); auto expected = expected_events.begin(); - std::list<KeyEvent>::const_iterator actual = events.begin(); + std::vector<KeyEvent>::const_iterator actual = events.begin(); while (expected != expected_events.end() && actual != events.end()) { EXPECT_EQ(expected->type, actual->type); EXPECT_EQ(expected->modifiers, actual->modifiers); @@ -44,13 +43,13 @@ } void CheckEventsReleaseModifiers(const base::string16& keys, - const std::list<KeyEvent>& expected_events) { + const std::vector<KeyEvent>& expected_events) { CheckEvents(keys, expected_events, true /* release_modifier */, 0 /* expected_modifiers */); } void CheckEventsReleaseModifiers(const std::string& keys, - std::list<KeyEvent>& expected_events) { + std::vector<KeyEvent>& expected_events) { CheckEventsReleaseModifiers(base::UTF8ToUTF16(keys), expected_events); } @@ -58,12 +57,12 @@ int modifiers = 0; std::string char_string; char_string.push_back(character); - std::list<KeyEvent> events; + std::vector<KeyEvent> events; EXPECT_EQ(kOk, ConvertKeysToKeyEvents(base::ASCIIToUTF16(char_string), true /* release_modifiers*/, &modifiers, &events).code()); ASSERT_EQ(3u, events.size()) << "Char: " << character; - std::list<KeyEvent>::const_iterator it = events.begin(); + std::vector<KeyEvent>::const_iterator it = events.begin(); EXPECT_EQ(key_code, it->key_code) << "Char: " << character; ++it; // Move to the second event. ASSERT_EQ(1u, it->modified_text.length()) << "Char: " << character; @@ -78,12 +77,12 @@ int modifiers = 0; std::string char_string; char_string.push_back(character); - std::list<KeyEvent> events; + std::vector<KeyEvent> events; EXPECT_EQ(kOk, ConvertKeysToKeyEvents(base::ASCIIToUTF16(char_string), true /* release_modifiers*/, &modifiers, &events).code()); ASSERT_EQ(5u, events.size()) << "Char: " << character; - std::list<KeyEvent>::const_iterator it = events.begin(); + std::vector<KeyEvent>::const_iterator it = events.begin(); EXPECT_EQ(ui::VKEY_SHIFT, it->key_code) << "Char: " << character; ++it; // Move to second event. EXPECT_EQ(key_code, it->key_code) << "Char: " << character; @@ -103,7 +102,7 @@ TEST(KeyConverter, SingleChar) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); KeyEventBuilder builder; - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetText("h", "h")->SetKeyCode(ui::VKEY_H)->Generate(&key_events); CheckEventsReleaseModifiers("h", key_events); } @@ -111,7 +110,7 @@ TEST(KeyConverter, SingleNumber) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); KeyEventBuilder builder; - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetText("1", "1")->SetKeyCode(ui::VKEY_1)->Generate(&key_events); CheckEventsReleaseModifiers("1", key_events); } @@ -119,7 +118,7 @@ TEST(KeyConverter, MultipleChars) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); KeyEventBuilder builder; - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetText("h", "h")->SetKeyCode(ui::VKEY_H)->Generate(&key_events); builder.SetText("e", "e")->SetKeyCode(ui::VKEY_E)->Generate(&key_events); builder.SetText("y", "y")->SetKeyCode(ui::VKEY_Y)->Generate(&key_events); @@ -129,7 +128,7 @@ TEST(KeyConverter, WebDriverSpecialChar) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); KeyEventBuilder builder; - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetKeyCode(ui::VKEY_SPACE)->SetText(" ", " ")->Generate(&key_events); base::string16 keys; keys.push_back(static_cast<base::char16>(0xE00DU)); @@ -138,7 +137,7 @@ TEST(KeyConverter, WebDriverSpecialNonCharKey) { KeyEventBuilder builder; - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetKeyCode(ui::VKEY_F1)->Generate(&key_events); base::string16 keys; keys.push_back(static_cast<base::char16>(0xE031U)); @@ -149,7 +148,7 @@ ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); KeyEventBuilder builder; std::string e_acute = base::WideToUTF8(L"\u00E9"); - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetText(e_acute, e_acute)->Generate(&key_events); CheckEventsReleaseModifiers(base::WideToUTF16(L"\u00E9"), key_events); } @@ -167,7 +166,7 @@ ->SetKeyCode(ui::VKEY_Q) ->SetText("q", "@"); - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; key_events.push_back(ctrl_builder.SetType(kRawKeyDownEventType)->Build()); key_events.push_back(alt_builder.SetType(kRawKeyDownEventType)->Build()); q_builder.Generate(&key_events); @@ -187,7 +186,7 @@ a_builder.SetKeyCode(ui::VKEY_A) ->SetModifiers(kShiftKeyModifierMask) ->SetText("a", "A"); - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; key_events.push_back(shift_builder.SetType(kRawKeyDownEventType)->Build()); a_builder.Generate(&key_events); key_events.push_back(shift_builder.SetType(kKeyUpEventType)->Build()); @@ -202,7 +201,7 @@ one_builder.SetModifiers(kShiftKeyModifierMask) ->SetKeyCode(ui::VKEY_1) ->SetText("1", "!"); - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; key_events.push_back(shift_builder.SetType(kRawKeyDownEventType)->Build()); one_builder.Generate(&key_events); key_events.push_back(shift_builder.SetType(kKeyUpEventType)->Build()); @@ -211,7 +210,7 @@ TEST(KeyConverter, UppercaseCharUsesShiftOnlyIfNecessary) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; KeyEventBuilder shift_builder; key_events.push_back(shift_builder.SetType(kRawKeyDownEventType) ->SetKeyCode(ui::VKEY_SHIFT) @@ -231,7 +230,7 @@ } TEST(KeyConverter, ToggleModifiers) { - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; KeyEventBuilder builder; key_events.push_back(builder.SetType(kRawKeyDownEventType) ->SetKeyCode(ui::VKEY_SHIFT) @@ -272,7 +271,7 @@ TEST(KeyConverter, AllShorthandKeys) { ui::ScopedKeyboardLayout keyboard_layout(ui::KEYBOARD_LAYOUT_ENGLISH_US); KeyEventBuilder builder; - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; builder.SetKeyCode(ui::VKEY_RETURN) ->SetText("\r", "\r") ->Generate(&key_events); @@ -368,7 +367,7 @@ base::string16 keys; int modifiers = 0; keys.push_back(0xE000U + i); - std::list<KeyEvent> events; + std::vector<KeyEvent> events; EXPECT_EQ(kOk, ConvertKeysToKeyEvents(keys, true /* release_modifiers */, &modifiers, &events).code()) @@ -379,7 +378,7 @@ EXPECT_EQ(2u, events.size()) << "Index: " << i; } else { ASSERT_EQ(3u, events.size()) << "Index: " << i; - std::list<KeyEvent>::const_iterator it = events.begin(); + std::vector<KeyEvent>::const_iterator it = events.begin(); ++it; // Move to the second event. ASSERT_EQ(1u, it->unmodified_text.length()) << "Index: " << i; EXPECT_EQ(kTextForKeys[i], it->unmodified_text[0]) @@ -391,7 +390,7 @@ TEST(KeyConverter, ModifiersState) { KeyEventBuilder builder; builder.SetType(kRawKeyDownEventType); - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; key_events.push_back(builder.SetKeyCode(ui::VKEY_SHIFT) ->AddModifiers(kShiftKeyModifierMask) ->Build()); @@ -417,7 +416,7 @@ } TEST(KeyConverter, ReleaseModifiers) { - std::list<KeyEvent> key_events; + std::vector<KeyEvent> key_events; KeyEventBuilder builder; key_events.push_back(builder.SetType(kRawKeyDownEventType) ->SetKeyCode(ui::VKEY_SHIFT)
diff --git a/chrome/test/chromedriver/util.cc b/chrome/test/chromedriver/util.cc index 710cb73..56fc9627 100644 --- a/chrome/test/chromedriver/util.cc +++ b/chrome/test/chromedriver/util.cc
@@ -70,7 +70,7 @@ Status status = FlattenStringArray(key_list, &keys); if (status.IsError()) return status; - std::list<KeyEvent> events; + std::vector<KeyEvent> events; int sticky_modifiers_tmp = *sticky_modifiers; status = ConvertKeysToKeyEvents( keys, release_modifiers, &sticky_modifiers_tmp, &events);
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc index 6da0da6..8f268364 100644 --- a/chrome/test/chromedriver/window_commands.cc +++ b/chrome/test/chromedriver/window_commands.cc
@@ -356,7 +356,7 @@ session, web_view, x, y, &relative_x, &relative_y); if (!status.IsOk()) return status; - std::list<TouchEvent> events; + std::vector<TouchEvent> events; events.push_back( TouchEvent(type, relative_x, relative_y)); return web_view->DispatchTouchEvents(events, false); @@ -885,7 +885,7 @@ location.Offset(x_offset, y_offset); } - std::list<MouseEvent> events; + std::vector<MouseEvent> events; events.push_back(MouseEvent(kMovedMouseEventType, session->pressed_mouse_button, location.x, location.y, session->sticky_modifiers, 0, 0)); @@ -905,7 +905,7 @@ Status status = GetMouseButton(params, &button); if (status.IsError()) return status; - std::list<MouseEvent> events; + std::vector<MouseEvent> events; events.push_back( MouseEvent(kPressedMouseEventType, button, session->mouse_position.x, session->mouse_position.y, session->sticky_modifiers, 0, 1)); @@ -927,7 +927,7 @@ Status status = GetMouseButton(params, &button); if (status.IsError()) return status; - std::list<MouseEvent> events; + std::vector<MouseEvent> events; events.push_back( MouseEvent(kPressedMouseEventType, button, session->mouse_position.x, session->mouse_position.y, session->sticky_modifiers, 0, 1)); @@ -945,7 +945,7 @@ Status status = GetMouseButton(params, &button); if (status.IsError()) return status; - std::list<MouseEvent> events; + std::vector<MouseEvent> events; events.push_back( MouseEvent(kReleasedMouseEventType, button, session->mouse_position.x, session->mouse_position.y, session->sticky_modifiers, @@ -964,7 +964,7 @@ Status status = GetMouseButton(params, &button); if (status.IsError()) return status; - std::list<MouseEvent> events; + std::vector<MouseEvent> events; events.push_back( MouseEvent(kPressedMouseEventType, button, session->mouse_position.x, session->mouse_position.y, session->sticky_modifiers, 0, 1)); @@ -1334,7 +1334,7 @@ // (https://w3c.github.io/webdriver/#dfn-computing-the-tick-duration). // This is the duration for actions in one tick. int tick_duration = 0; - std::list<TouchEvent> dispatch_touch_events; + std::vector<TouchEvent> dispatch_touch_events; for (size_t j = 0; j < actions_list.size(); j++) { if (actions_list[j].size() > i) { const base::DictionaryValue* action = actions_list[j][i].get(); @@ -1389,7 +1389,7 @@ if (type == "key") { if (action_type != "pause") { - std::list<KeyEvent> dispatch_key_events; + std::vector<KeyEvent> dispatch_key_events; KeyEventBuilder builder; Status status = ConvertKeyActionToKeyEvent( action, input_state, action_type == "keyDown", @@ -1458,7 +1458,7 @@ if (pointer_type == "mouse" || pointer_type == "pen") { if (action_type != "pause") { - std::list<MouseEvent> dispatch_mouse_events; + std::vector<MouseEvent> dispatch_mouse_events; int click_count = 0; if (action_type == "pointerDown" || action_type == "pointerUp") {
diff --git a/chrome/test/data/media/feeds/media-feed.json b/chrome/test/data/media/feeds/media-feed.json index 1d0f26e..43268413 100644 --- a/chrome/test/data/media/feeds/media-feed.json +++ b/chrome/test/data/media/feeds/media-feed.json
@@ -12,7 +12,6 @@ "url": "https://www.youtube.com/user/ChromeDevelopers" }, "datePublished": "2019-05-09", - "description": "You'll learn about the insights that led to our redesigned native media controls in Chrome and what it took to convert these into a customizable UI library that now ships as part of Shaka player.", "duration": "PT34M41S", "genre": "Factual", "interactionStatistic": [ @@ -60,7 +59,6 @@ "url": "https://www.youtube.com/user/ChromeDevelopers" }, "datePublished": "2018-11-12", - "description": "Learn about how the latest media-related capabilities on the web platform can be used to build efficient and delightful web media experiences.", "duration": "PT21M24S", "genre": "Factual", "identifier": { @@ -362,7 +360,6 @@ "ratingValue": "G" }, "datePublished": "2008-01-01", - "description": "A large and lovable rabbit deals with three tiny bullies, led by a flying squirrel, who are determined to squelch his happiness.", "duration": "PT12M", "genre": "Comedy", "isFamilyFriendly": "https://schema.org/False", @@ -426,7 +423,7 @@ "additionalProperty": { "@type": "PropertyValue", "name": "contentAttributes", - "value": ["hasTitle", "centered"] + "value": ["forLightBackground", "hasTitle", "centered"] } }] },
diff --git a/chrome/test/data/pdf/accessibility/text_fields-expected-mac.txt b/chrome/test/data/pdf/accessibility/text_fields-expected-mac.txt index 3355a32..a397863 100644 --- a/chrome/test/data/pdf/accessibility/text_fields-expected-mac.txt +++ b/chrome/test/data/pdf/accessibility/text_fields-expected-mac.txt
@@ -11,7 +11,7 @@ ++++++++AXStaticText AXValue='*required field<newline>' ++++++AXGroup ++++++++AXStaticText AXValue='Password:' -++++++++AXTextField AXValue='Text' AXDescription='Text Box' -++++++++AXTextField AXValue='Elephant' AXDescription='ReadOnly' -++++++++AXTextField AXValue='Required Field' AXDescription='Required' +++++++++AXTextField AXDescription='Text Box' AXValue='Text' +++++++++AXTextField AXDescription='ReadOnly' AXValue='Elephant' +++++++++AXTextField AXDescription='Required' AXValue='Required Field' ++++++++AXTextField AXDescription='Password'
diff --git a/chrome/test/data/webui/media/media_feeds_webui_browsertest.js b/chrome/test/data/webui/media/media_feeds_webui_browsertest.js index dc0187ef..28fed64 100644 --- a/chrome/test/data/webui/media/media_feeds_webui_browsertest.js +++ b/chrome/test/data/webui/media/media_feeds_webui_browsertest.js
@@ -225,11 +225,26 @@ assertDeepEquals( [ - 'Type', 'Name', 'Author', 'Date Published', 'Family Friendly', - 'Action Status', 'Action URL', 'Action Start Time (secs)', - 'Interaction Counters', 'Content Ratings', 'Genre', 'Live Details', - 'TV Episode', 'Play Next Candidate', 'Identifiers', 'Shown Count', - 'Clicked', 'Images', 'Safe Search Result' + 'Type', + 'Name', + 'Author', + 'Date Published', + 'Family Friendly', + 'Action Status', + 'Action URL', + 'Action Start Time (secs)', + 'Interaction Counters', + 'Content Ratings', + 'Genre', + 'Live Details', + 'TV Episode', + 'Play Next Candidate', + 'Identifiers', + 'Shown Count', + 'Clicked', + 'Images', + 'Safe Search Result', + 'Duration (secs)' ], feedItemsHeaders.map(x => x.textContent.trim())); @@ -274,6 +289,7 @@ 'https://www.example.org/image1.pngContentAttributes=Iconichttps://www.example.org/image2.png', feedItemsContents.childNodes[17].textContent.trim()); assertEquals('Safe', feedItemsContents.childNodes[18].textContent.trim()); + assertEquals('30', feedItemsContents.childNodes[19].textContent.trim()); }); });
diff --git a/chrome/test/data/webui/settings/BUILD.gn b/chrome/test/data/webui/settings/BUILD.gn index 29c68eb..ba6f10c 100644 --- a/chrome/test/data/webui/settings/BUILD.gn +++ b/chrome/test/data/webui/settings/BUILD.gn
@@ -61,13 +61,18 @@ deps = [ ":about_page_tests", ":advanced_page_test", + ":passwords_and_autofill_fake_data", ":search_page_test", ":settings_page_test_util", ":site_list_tests", ":site_settings_page_test", ":test_about_page_browser_proxy", + ":test_hats_browser_proxy", ":test_lifetime_browser_proxy.m", ":test_local_data_browser_proxy", + ":test_metrics_browser_proxy", + ":test_open_window_proxy", + ":test_password_manager_proxy", ":test_search_engines_browser_proxy.m", ":test_site_settings_prefs_browser_proxy", ":test_util", @@ -96,6 +101,41 @@ externs_list = [ "$externs_path/mocha-2.5.js" ] } +js_library("passwords_and_autofill_fake_data") { + deps = [ + "..:chai_assert", + "//chrome/browser/resources/settings:lazy_load", + "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", + ] + externs_list = [ + "$externs_path/autofill_private.js", + "$externs_path/passwords_private.js", + ] +} + +js_library("test_metrics_browser_proxy") { + deps = [ + "..:test_browser_proxy.m", + "//chrome/browser/resources/settings:settings", + ] +} + +js_library("test_open_window_proxy") { + deps = [ + "..:test_browser_proxy.m", + "//chrome/browser/resources/settings:settings", + ] +} + +js_library("test_password_manager_proxy") { + deps = [ + ":passwords_and_autofill_fake_data", + "..:chai_assert", + "..:test_browser_proxy.m", + "//chrome/browser/resources/settings:settings", + ] +} + js_library("search_page_test") { deps = [ ":test_search_engines_browser_proxy.m", @@ -143,6 +183,13 @@ extra_deps = [ ":modulize" ] } +js_library("test_hats_browser_proxy") { + deps = [ + "..:test_browser_proxy.m", + "//chrome/browser/resources/settings:settings", + ] +} + js_library("test_lifetime_browser_proxy.m") { sources = [ "$root_gen_dir/chrome/test/data/webui/settings/test_lifetime_browser_proxy.m.js" ] deps = [
diff --git a/chrome/test/data/webui/settings/autofill_page_test.js b/chrome/test/data/webui/settings/autofill_page_test.js index af0160b1..164eeb5 100644 --- a/chrome/test/data/webui/settings/autofill_page_test.js +++ b/chrome/test/data/webui/settings/autofill_page_test.js
@@ -7,10 +7,10 @@ import {AutofillManagerImpl, PaymentsManagerImpl} from 'chrome://settings/lazy_load.js'; import {CrSettingsPrefs, OpenWindowProxyImpl, PasswordManagerImpl, PluralStringProxyImpl, Router, routes} from 'chrome://settings/settings.js'; import {FakeSettingsPrivate} from 'chrome://test/settings/fake_settings_private.m.js'; -import {AutofillManagerExpectations, createAddressEntry, createCreditCardEntry, createExceptionEntry, createPasswordEntry, PasswordManagerExpectations, PaymentsManagerExpectations, TestAutofillManager, TestPaymentsManager} from 'chrome://test/settings/passwords_and_autofill_fake_data.js'; +import {AutofillManagerExpectations, createAddressEntry, createCreditCardEntry, createExceptionEntry, createPasswordEntry, PaymentsManagerExpectations, TestAutofillManager, TestPaymentsManager} from 'chrome://test/settings/passwords_and_autofill_fake_data.js'; import {makeCompromisedCredential} from 'chrome://test/settings/passwords_and_autofill_fake_data.js'; import {TestOpenWindowProxy} from 'chrome://test/settings/test_open_window_proxy.js'; -import {TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.js'; +import { PasswordManagerExpectations,TestPasswordManagerProxy} from 'chrome://test/settings/test_password_manager_proxy.js'; import {TestPluralStringProxy} from 'chrome://test/settings/test_plural_string_proxy.js'; // clang-format on
diff --git a/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js b/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js index 1b4420d..ff2df81c6 100644 --- a/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js +++ b/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js
@@ -4,6 +4,11 @@ // clang-format off import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {AutofillManager, PaymentsManager} from 'chrome://settings/lazy_load.js'; + +import {assertEquals} from '../chai_assert.js'; + +import {TestPasswordManagerProxy} from './test_password_manager_proxy.js'; // clang-format on /** @@ -27,6 +32,7 @@ }, username: username, id: id, + fromAccountStore: false, }; } @@ -46,6 +52,7 @@ link: 'http://' + url + '/login', }, id: id, + fromAccountStore: false, }; } @@ -114,9 +121,9 @@ /** * Creates a new compromised credential. - * @param {string=} url - * @param {string=} username - * @param {string=} type + * @param {string} url + * @param {string} username + * @param {chrome.passwordsPrivate.CompromiseType} type * @param {number=} id * @param {number=} elapsedMinSinceCompromise * @return {chrome.passwordsPrivate.CompromisedCredential} @@ -125,21 +132,24 @@ export function makeCompromisedCredential( url, username, type, id, elapsedMinSinceCompromise) { return { - id: id, + id: id || 0, formattedOrigin: url, changePasswordUrl: `http://${url}/`, username: username, elapsedTimeSinceCompromise: `${elapsedMinSinceCompromise} minutes ago`, compromiseTime: Date.now() - (elapsedMinSinceCompromise * 60000), compromiseType: type, + detailedOrigin: '', + isAndroidCredential: false, + signonRealm: '', }; } /** * Creates a new password check status. - * @param {!chrome.passwordsPrivate.PasswordCheckState} state - * @param {!number|undefined} checked - * @param {!number|undefined} remaining + * @param {!chrome.passwordsPrivate.PasswordCheckState=} state + * @param {number=} checked + * @param {number=} remaining * @param {string=} lastCheck * @return {!chrome.passwordsPrivate.PasswordCheckStatus} */ @@ -188,13 +198,13 @@ /** * Helper method used to create a password section for the given lists. - * @param {!PasswordManagerProxy} passwordManager + * @param {!TestPasswordManagerProxy} passwordManager * @param {!Array<!chrome.passwordsPrivate.PasswordUiEntry>} passwordList * @param {!Array<!chrome.passwordsPrivate.ExceptionEntry>} exceptionList * @return {!Object} */ createPasswordsSection(passwordManager, passwordList, exceptionList) { - // Override the PasswordManagerProxy data for testing. + // Override the TestPasswordManagerProxy data for testing. passwordManager.data.passwords = passwordList; passwordManager.data.exceptions = exceptionList; @@ -263,28 +273,6 @@ } } -export class PasswordManagerExpectations { - constructor() { - this.requested = { - passwords: 0, - exceptions: 0, - plaintextPassword: 0, - accountStorageOptInState: 0, - }; - - this.removed = { - passwords: 0, - exceptions: 0, - }; - - this.listening = { - passwords: 0, - exceptions: 0, - accountStorageOptInState: 0, - }; - } -} - /** Helper class to track AutofillManager expectations. */ export class AutofillManagerExpectations { constructor() { @@ -329,6 +317,12 @@ callback(this.data.addresses); } + /** @override */ + saveAddress() {} + + /** @override */ + removeAddress() {} + /** * Verifies expectations. * @param {!AutofillManagerExpectations} expected @@ -345,6 +339,7 @@ constructor() { this.requestedCreditCards = 0; this.listeningCreditCards = 0; + this.requestedUpiIds = 0; } } @@ -354,6 +349,7 @@ */ export class TestPaymentsManager { constructor() { + /** @private {!PaymentsManagerExpectations} */ this.actual_ = new PaymentsManagerExpectations(); // Set these to have non-empty data. @@ -391,6 +387,24 @@ callback(this.data.upiIds); } + /** @override */ + clearCachedCreditCard() {} + + /** @override */ + logServerCardLinkClicked() {} + + /** @override */ + migrateCreditCards() {} + + /** @override */ + removeCreditCard() {} + + /** @override */ + saveCreditCard() {} + + /** @override */ + setCreditCardFIDOAuthEnabledState() {} + /** * Verifies expectations. * @param {!PaymentsManagerExpectations} expected
diff --git a/chrome/test/data/webui/settings/passwords_section_test.js b/chrome/test/data/webui/settings/passwords_section_test.js index bf6dc66..f6776c6 100644 --- a/chrome/test/data/webui/settings/passwords_section_test.js +++ b/chrome/test/data/webui/settings/passwords_section_test.js
@@ -272,7 +272,7 @@ // Test verifies that pressing the 'remove' button will trigger a remove // event. Does not actually remove any passwords. - test('verifyPasswordItemRemoveButton', function(done) { + test('verifyPasswordItemRemoveButton', function() { const passwordList = [ createPasswordEntry('one', 'six'), createPasswordEntry('two', 'five'), @@ -289,22 +289,17 @@ assertTrue(!!firstNode); const firstPassword = passwordList[0]; - passwordManager.onRemoveSavedPassword = function(id) { - // Verify that the event matches the expected value. - assertEquals(firstPassword.id, id); - - // Clean up after self. - passwordManager.onRemoveSavedPassword = null; - - done(); - }; - // Click the remove button on the first password. firstNode.$$('#passwordMenu').click(); passwordsSection.$.menuRemovePassword.click(); - assertEquals( - passwordsSection.i18n('passwordDeleted'), - getToastManager().$.content.textContent); + + return passwordManager.whenCalled('removeSavedPassword').then(id => { + // Verify that the expected value was passed to the proxy. + assertEquals(firstPassword.id, id); + assertEquals( + passwordsSection.i18n('passwordDeleted'), + getToastManager().$.content.textContent); + }); }); // Test verifies that 'Copy password' button is hidden for Federated @@ -490,7 +485,7 @@ // Test verifies that pressing the 'remove' button will trigger a remove // event. Does not actually remove any exceptions. - test('verifyPasswordExceptionRemoveButton', function(done) { + test('verifyPasswordExceptionRemoveButton', function() { const exceptionList = [ createExceptionEntry('docs.google.com'), createExceptionEntry('mail.com'), @@ -513,23 +508,25 @@ exceptions[item].querySelector('#removeExceptionButton').click(); }; - passwordManager.onRemoveException = function(id) { - // Verify that the event matches the expected value. - assertTrue(item < exceptionList.length); - assertEquals(id, exceptionList[item].id); + // Removes the next exception item, verifies that the expected method was + // called on |passwordManager| and continues recursively until no more items + // exist. + function removeNextRecursive() { + passwordManager.resetResolver('removeException'); + clickRemoveButton(); + return passwordManager.whenCalled('removeException').then(id => { + // Verify that the event matches the expected value. + assertTrue(item < exceptionList.length); + assertEquals(id, exceptionList[item].id); - if (++item < exceptionList.length) { - clickRemoveButton(); // Click 'remove' on all passwords, one by one. - } else { - // Clean up after self. - passwordManager.onRemoveException = null; + if (++item < exceptionList.length) { + return removeNextRecursive(); + } + }); + } - done(); - } - }; - - // Start removing. - clickRemoveButton(); + // Click 'remove' on all passwords, one by one. + return removeNextRecursive(); }); test('verifyFederatedPassword', function() {
diff --git a/chrome/test/data/webui/settings/test_hats_browser_proxy.js b/chrome/test/data/webui/settings/test_hats_browser_proxy.js index 8c4eed4..bf526d9 100644 --- a/chrome/test/data/webui/settings/test_hats_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_hats_browser_proxy.js
@@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js'; +import {HatsBrowserProxy} from 'chrome://settings/settings.js'; + +import {TestBrowserProxy} from '../test_browser_proxy.m.js'; /** @implements {HatsBrowserProxy} */ export class TestHatsBrowserProxy extends TestBrowserProxy {
diff --git a/chrome/test/data/webui/settings/test_metrics_browser_proxy.js b/chrome/test/data/webui/settings/test_metrics_browser_proxy.js index 97b9a62..128ed9f1 100644 --- a/chrome/test/data/webui/settings/test_metrics_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_metrics_browser_proxy.js
@@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js'; +import {MetricsBrowserProxy} from 'chrome://settings/settings.js'; + +import {TestBrowserProxy} from '../test_browser_proxy.m.js'; /** @implements {MetricsBrowserProxy} */ export class TestMetricsBrowserProxy extends TestBrowserProxy {
diff --git a/chrome/test/data/webui/settings/test_open_window_proxy.js b/chrome/test/data/webui/settings/test_open_window_proxy.js index 9dde5998..e563604 100644 --- a/chrome/test/data/webui/settings/test_open_window_proxy.js +++ b/chrome/test/data/webui/settings/test_open_window_proxy.js
@@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js'; +import {OpenWindowProxy} from 'chrome://settings/settings.js'; + +import {TestBrowserProxy} from '../test_browser_proxy.m.js'; /** @implements {OpenWindowProxy} */ export class TestOpenWindowProxy extends TestBrowserProxy {
diff --git a/chrome/test/data/webui/settings/test_password_manager_proxy.js b/chrome/test/data/webui/settings/test_password_manager_proxy.js index 6bcdbca5..d68cc194 100644 --- a/chrome/test/data/webui/settings/test_password_manager_proxy.js +++ b/chrome/test/data/webui/settings/test_password_manager_proxy.js
@@ -5,14 +5,40 @@ /** @fileoverview Test implementation of PasswordManagerProxy. */ // clang-format off -import {makePasswordCheckStatus, PasswordManagerExpectations} from 'chrome://test/settings/passwords_and_autofill_fake_data.js'; -import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js'; +import {PasswordManagerProxy} from 'chrome://settings/settings.js'; + +import {assertEquals} from '../chai_assert.js'; +import {TestBrowserProxy} from '../test_browser_proxy.m.js'; + +import {makePasswordCheckStatus} from './passwords_and_autofill_fake_data.js'; + // clang-format on +export class PasswordManagerExpectations { + constructor() { + this.requested = { + passwords: 0, + exceptions: 0, + plaintextPassword: 0, + accountStorageOptInState: 0, + }; + + this.removed = { + passwords: 0, + exceptions: 0, + }; + + this.listening = { + passwords: 0, + exceptions: 0, + accountStorageOptInState: 0, + }; + } +} + /** * Test implementation * @implements {PasswordManagerProxy} - * @constructor */ export class TestPasswordManagerProxy extends TestBrowserProxy { constructor() { @@ -27,8 +53,11 @@ 'removeCompromisedCredential', 'recordPasswordCheckInteraction', 'recordPasswordCheckReferrer', + 'removeSavedPassword', + 'removeException', ]); + /** @private {!PasswordManagerExpectations} */ this.actual_ = new PasswordManagerExpectations(); // Set these to have non-empty data. @@ -49,8 +78,10 @@ addAccountStorageOptInStateListener: null, }; + /** @private {string} */ this.plaintextPassword_ = ''; + /** @private {boolean} */ this.isOptedInForAccountStorage_ = false; } @@ -77,10 +108,7 @@ /** @override */ removeSavedPassword(id) { this.actual_.removed.passwords++; - - if (this.onRemoveSavedPassword) { - this.onRemoveSavedPassword(id); - } + this.methodCalled('removeSavedPassword', id); } /** @override */ @@ -103,10 +131,7 @@ /** @override */ removeException(id) { this.actual_.removed.exceptions++; - - if (this.onRemoveException) { - this.onRemoveException(id); - } + this.methodCalled('removeException', id); } /** @override */ @@ -222,7 +247,9 @@ return Promise.reject('Could not obtain plaintext password'); } - const newCredential = Object.assign({}, credential); + const newCredential = + /** @type {PasswordManagerProxy.CompromisedCredential} */ ( + Object.assign({}, credential)); newCredential.password = this.plaintextPassword_; return Promise.resolve(newCredential); } @@ -247,4 +274,28 @@ recordPasswordCheckReferrer(referrer) { this.methodCalled('recordPasswordCheckReferrer', referrer); } + + /** override */ + addPasswordsFileExportProgressListener() {} + + /** override */ + cancelExportPasswords() {} + + /** override */ + exportPasswords() {} + + /** override */ + importPasswords() {} + + /** override */ + optInForAccountStorage() {} + + /** override */ + removePasswordsFileExportProgressListener() {} + + /** override */ + requestExportProgressStatus() {} + + /** override */ + undoRemoveSavedPasswordOrException() {} }
diff --git a/chromeos/components/security_token_pin/constants.h b/chromeos/components/security_token_pin/constants.h index a057c7a4..eb7df21 100644 --- a/chromeos/components/security_token_pin/constants.h +++ b/chromeos/components/security_token_pin/constants.h
@@ -13,7 +13,7 @@ // Type of the information asked from the user during a security token PIN // request. // Must be kept in sync with -// chrome/browser/resources/chromeos/login/oobe_types.js. +// chrome/browser/resources/chromeos/login/components/oobe_types.js. enum class CodeType { kPin = 0, kPuk = 1, @@ -21,7 +21,7 @@ // Error to be displayed in the security token PIN request. // Must be kept in sync with -// chrome/browser/resources/chromeos/login/oobe_types.js. +// chrome/browser/resources/chromeos/login/components/oobe_types.js. enum class ErrorLabel { kNone = 0, kUnknown = 1,
diff --git a/chromeos/dbus/dlcservice/OWNERS b/chromeos/dbus/dlcservice/OWNERS new file mode 100644 index 0000000..fc6b079 --- /dev/null +++ b/chromeos/dbus/dlcservice/OWNERS
@@ -0,0 +1,3 @@ +kimjae@chromium.org +ahassani@chromium.org +andrewlassalle@chromium.org
diff --git a/chromeos/dbus/dlcservice/dlcservice_client.cc b/chromeos/dbus/dlcservice/dlcservice_client.cc index daf8051..07880e71 100644 --- a/chromeos/dbus/dlcservice/dlcservice_client.cc +++ b/chromeos/dbus/dlcservice/dlcservice_client.cc
@@ -183,25 +183,6 @@ weak_ptr_factory_.GetWeakPtr())); } - void GetInstalled(GetInstalledCallback callback) override { - if (!service_available_ || task_running_) { - EnqueueTask(base::BindOnce(&DlcserviceClientImpl::GetInstalled, - weak_ptr_factory_.GetWeakPtr(), - std::move(callback))); - return; - } - - TaskStarted(); - dbus::MethodCall method_call(dlcservice::kDlcServiceInterface, - dlcservice::kGetInstalledMethod); - - VLOG(1) << "Requesting to get installed DLC(s)."; - dlcservice_proxy_->CallMethodWithErrorResponse( - &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, - base::BindOnce(&DlcserviceClientImpl::OnGetInstalled, - weak_ptr_factory_.GetWeakPtr(), std::move(callback))); - } - void GetExistingDlcs(GetExistingDlcsCallback callback) override { if (!service_available_ || task_running_) { EnqueueTask(base::BindOnce(&DlcserviceClientImpl::GetExistingDlcs, @@ -240,12 +221,12 @@ private: // Set the indication that an operation is being performed, which consists of - // either |Install()|, |Uninstall()|, or |GetInstalled()|. Should always be + // either |Install()| or |Uninstall()|. Should always be // called after calling dlcservice in platform. void TaskStarted() { task_running_ = true; } // Clears any indication that an operation had setup while being performed, - // which consists of either |Install()|, |Uninstall()|, or |GetInstalled()|. + // which consists of either |Install()| or |Uninstall()|. void TaskEnded() { task_running_ = false; // |Install()| @@ -412,21 +393,6 @@ CheckAndRunPendingTask(); } - void OnGetInstalled(GetInstalledCallback callback, - dbus::Response* response, - dbus::ErrorResponse* err_response) { - dlcservice::DlcModuleList dlc_module_list; - if (response && dbus::MessageReader(response).PopArrayOfBytesAsProto( - &dlc_module_list)) { - std::move(callback).Run(dlcservice::kErrorNone, dlc_module_list); - } else { - std::move(callback).Run( - DlcserviceErrorResponseHandler(err_response).get_err(), - dlcservice::DlcModuleList()); - } - CheckAndRunPendingTask(); - } - void OnGetExistingDlcs(GetExistingDlcsCallback callback, dbus::Response* response, dbus::ErrorResponse* err_response) {
diff --git a/chromeos/dbus/dlcservice/dlcservice_client.h b/chromeos/dbus/dlcservice/dlcservice_client.h index 08b63d2..30f73c1 100644 --- a/chromeos/dbus/dlcservice/dlcservice_client.h +++ b/chromeos/dbus/dlcservice/dlcservice_client.h
@@ -61,13 +61,6 @@ // |dlcservice::kErrorNone| the call has failed. using PurgeCallback = base::OnceCallback<void(const std::string& err)>; - // The callback used for |GetInstalled()|, if the error is something other - // than |dlcservice::kErrorNone| the call has failed. It is a very rare case - // for |GetInstalled()| call to fail. - using GetInstalledCallback = base::OnceCallback<void( - const std::string& err, - const dlcservice::DlcModuleList& dlc_module_list)>; - // The callback used for |GetExistingDlcs()|, if the error is something other // than |dlcservice::kErrorNone| the call has failed. It is a very rare case // for |GetExistingDlcs()| call to fail. @@ -100,10 +93,6 @@ virtual void Purge(const std::string& dlc_id, PurgeCallback purge_callback) = 0; - // DEPRECATING: Please do not use this method call. - // Provides the DLC(s) information such as id and root mount point. - virtual void GetInstalled(GetInstalledCallback callback) = 0; - // Provides the DLC(s) information such as: // id, name, description, used_bytes_on_disk. (reference // |dlcservice::DlcsWithContent| proto for complete details)
diff --git a/chromeos/dbus/dlcservice/dlcservice_client_unittest.cc b/chromeos/dbus/dlcservice/dlcservice_client_unittest.cc index 818ca7ef..7ec93a4 100644 --- a/chromeos/dbus/dlcservice/dlcservice_client_unittest.cc +++ b/chromeos/dbus/dlcservice/dlcservice_client_unittest.cc
@@ -105,52 +105,6 @@ std::deque<std::unique_ptr<dbus::ErrorResponse>> used_err_responses_; }; -TEST_F(DlcserviceClientTest, GetInstalledSuccessTest) { - responses_.push_back(dbus::Response::CreateEmpty()); - auto* response = responses_.front().get(); - dbus::MessageWriter writer(response); - dlcservice::DlcModuleList dlc_module_list; - writer.AppendProtoAsArrayOfBytes(dlc_module_list); - - EXPECT_CALL(*mock_proxy_.get(), DoCallMethodWithErrorResponse(_, _, _)) - .WillOnce( - Invoke(this, &DlcserviceClientTest::CallMethodWithErrorResponse)); - - DlcserviceClient::GetInstalledCallback callback = base::BindOnce( - [](const std::string& err, const dlcservice::DlcModuleList&) { - EXPECT_EQ(dlcservice::kErrorNone, err); - }); - client_->GetInstalled(std::move(callback)); - base::RunLoop().RunUntilIdle(); -} - -TEST_F(DlcserviceClientTest, GetInstalledFailureTest) { - dbus::MethodCall method_call(dlcservice::kDlcServiceInterface, - dlcservice::kGetInstalledMethod); - method_call.SetSerial(123); - err_responses_.push_back(dbus::ErrorResponse::FromMethodCall( - &method_call, DBUS_ERROR_FAILED, "some-unknown-error")); - - EXPECT_CALL(*mock_proxy_.get(), DoCallMethodWithErrorResponse(_, _, _)) - .WillRepeatedly( - Invoke(this, &DlcserviceClientTest::CallMethodWithErrorResponse)); - - client_->GetInstalled(base::BindOnce( - [](const std::string& err, const dlcservice::DlcModuleList&) { - EXPECT_EQ(dlcservice::kErrorInternal, err); - })); - base::RunLoop().RunUntilIdle(); - - err_responses_.push_back(dbus::ErrorResponse::FromMethodCall( - &method_call, dlcservice::kErrorInvalidDlc, "Bad DLC ID.")); - - client_->GetInstalled(base::BindOnce( - [](const std::string& err, const dlcservice::DlcModuleList&) { - EXPECT_EQ(dlcservice::kErrorInvalidDlc, err); - })); - base::RunLoop().RunUntilIdle(); -} - TEST_F(DlcserviceClientTest, GetExistingDlcsSuccessTest) { responses_.push_back(dbus::Response::CreateEmpty()); dbus::Response* response = responses_.front().get();
diff --git a/chromeos/dbus/dlcservice/fake_dlcservice_client.cc b/chromeos/dbus/dlcservice/fake_dlcservice_client.cc index c4807a5..5c96ecc1 100644 --- a/chromeos/dbus/dlcservice/fake_dlcservice_client.cc +++ b/chromeos/dbus/dlcservice/fake_dlcservice_client.cc
@@ -41,13 +41,6 @@ FROM_HERE, base::BindOnce(std::move(callback), purge_err_)); } -void FakeDlcserviceClient::GetInstalled(GetInstalledCallback callback) { - VLOG(1) << "Requesting to get installed DLC(s)."; - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), get_installed_err_, - dlc_module_list_)); -} - void FakeDlcserviceClient::GetExistingDlcs(GetExistingDlcsCallback callback) { VLOG(1) << "Requesting to get existing DLC(s)."; base::ThreadTaskRunnerHandle::Get()->PostTask(
diff --git a/chromeos/dbus/dlcservice/fake_dlcservice_client.h b/chromeos/dbus/dlcservice/fake_dlcservice_client.h index a9e53d2a..0b67be5 100644 --- a/chromeos/dbus/dlcservice/fake_dlcservice_client.h +++ b/chromeos/dbus/dlcservice/fake_dlcservice_client.h
@@ -29,7 +29,6 @@ UninstallCallback callback) override; // Purging removes the DLC entirely from disk. void Purge(const std::string& dlc_id, PurgeCallback callback) override; - void GetInstalled(GetInstalledCallback callback) override; void GetExistingDlcs(GetExistingDlcsCallback callback) override; void OnInstallStatusForTest(dbus::Signal* signal) override; @@ -39,9 +38,6 @@ void SetInstallError(const std::string& err) { install_err_ = err; } void SetUninstallError(const std::string& err) { uninstall_err_ = err; } void SetPurgeError(const std::string& err) { purge_err_ = err; } - void SetGetInstalledError(const std::string& err) { - get_installed_err_ = err; - } void SetGetExistingDlcsError(const std::string& err) { get_existing_dlcs_err_ = err; }
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProviderImpl.java b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProviderImpl.java index 08c34b4e..e531880 100644 --- a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProviderImpl.java +++ b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProviderImpl.java
@@ -19,6 +19,7 @@ import androidx.annotation.VisibleForTesting; +import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.DoNotInline; import org.chromium.base.metrics.ScopedSysTraceEvent; @@ -42,6 +43,7 @@ @DoNotInline @TargetApi(Build.VERSION_CODES.O) public class AutofillProviderImpl extends AutofillProvider { + private static final String TAG = "AutofillProviderImpl"; private static class FocusField { public final short fieldIndex; public final Rect absBound; @@ -138,20 +140,26 @@ if (index < 0 || index >= mFormData.mFields.size()) return false; FormFieldData field = mFormData.mFields.get(index); if (field == null) return false; - switch (field.getControlType()) { - case FormFieldData.ControlType.LIST: - int j = value.getListValue(); - if (j < 0 && j >= field.mOptionValues.length) continue; - field.setAutofillValue(field.mOptionValues[j]); - break; - case FormFieldData.ControlType.TOGGLE: - field.setChecked(value.getToggleValue()); - break; - case FormFieldData.ControlType.TEXT: - field.setAutofillValue((String) value.getTextValue()); - break; - default: - break; + try { + switch (field.getControlType()) { + case FormFieldData.ControlType.LIST: + int j = value.getListValue(); + if (j < 0 && j >= field.mOptionValues.length) continue; + field.setAutofillValue(field.mOptionValues[j]); + break; + case FormFieldData.ControlType.TOGGLE: + field.setChecked(value.getToggleValue()); + break; + case FormFieldData.ControlType.TEXT: + field.setAutofillValue((String) value.getTextValue()); + break; + default: + break; + } + } catch (IllegalStateException e) { + // Refer to crbug.com/1080580 . + Log.e(TAG, "The given AutofillValue wasn't expected, abort autofill.", e); + return false; } } return true;
diff --git a/components/autofill_assistant/browser/actions/action_delegate.h b/components/autofill_assistant/browser/actions/action_delegate.h index b9497c1..1f0f3d0f 100644 --- a/components/autofill_assistant/browser/actions/action_delegate.h +++ b/components/autofill_assistant/browser/actions/action_delegate.h
@@ -135,6 +135,10 @@ base::OnceCallback<void(UserData*, UserData::FieldChange*)> write_callback) = 0; + // Executes |write_callback| on the currently stored user_model. + virtual void WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) = 0; + using GetFullCardCallback = base::OnceCallback<void(std::unique_ptr<autofill::CreditCard> card, const base::string16& cvc)>;
diff --git a/components/autofill_assistant/browser/actions/mock_action_delegate.h b/components/autofill_assistant/browser/actions/mock_action_delegate.h index 03260dd..2d026918 100644 --- a/components/autofill_assistant/browser/actions/mock_action_delegate.h +++ b/components/autofill_assistant/browser/actions/mock_action_delegate.h
@@ -135,6 +135,7 @@ MOCK_METHOD1( WriteUserData, void(base::OnceCallback<void(UserData*, UserData::FieldChange*)>)); + MOCK_METHOD1(WriteUserModel, void(base::OnceCallback<void(UserModel*)>)); MOCK_METHOD1(OnGetFullCard, void(base::OnceCallback<void(const autofill::CreditCard& card,
diff --git a/components/autofill_assistant/browser/actions/show_generic_ui_action.cc b/components/autofill_assistant/browser/actions/show_generic_ui_action.cc index 7631a6d..1d23970 100644 --- a/components/autofill_assistant/browser/actions/show_generic_ui_action.cc +++ b/components/autofill_assistant/browser/actions/show_generic_ui_action.cc
@@ -10,16 +10,91 @@ #include "components/autofill_assistant/browser/actions/action_delegate.h" #include "components/autofill_assistant/browser/client_status.h" #include "components/autofill_assistant/browser/user_model.h" +#include "content/public/browser/web_contents.h" namespace autofill_assistant { +namespace { + +void WriteCreditCardsToUserModel( + std::unique_ptr<std::vector<std::unique_ptr<autofill::CreditCard>>> + credit_cards, + const ShowGenericUiProto::RequestAutofillCreditCards& proto, + UserModel* user_model) { + DCHECK(credit_cards); + DCHECK(user_model); + ValueProto model_value; + model_value.set_is_client_side_only(true); + for (const auto& credit_card : *credit_cards) { + DCHECK(!credit_card->guid().empty()); + model_value.mutable_credit_cards()->add_values()->set_guid( + credit_card->guid()); + } + user_model->SetAutofillCreditCards(std::move(credit_cards)); + user_model->SetValue(proto.model_identifier(), model_value); +} + +void WriteProfilesToUserModel( + std::unique_ptr<std::vector<std::unique_ptr<autofill::AutofillProfile>>> + profiles, + const ShowGenericUiProto::RequestAutofillProfiles& proto, + UserModel* user_model) { + DCHECK(profiles); + DCHECK(user_model); + ValueProto model_value; + model_value.set_is_client_side_only(true); + for (const auto& profile : *profiles) { + DCHECK(!profile->guid().empty()); + model_value.mutable_profiles()->add_values()->set_guid(profile->guid()); + } + user_model->SetAutofillProfiles(std::move(profiles)); + user_model->SetValue(proto.model_identifier(), model_value); +} + +void WriteLoginOptionsToUserModel( + const ShowGenericUiProto::RequestLoginOptions& proto, + std::vector<WebsiteLoginManager::Login> logins, + UserModel* user_model) { + DCHECK(user_model); + ValueProto model_value; + model_value.set_is_client_side_only(true); + for (const auto& login_option : proto.login_options()) { + switch (login_option.type_case()) { + case ShowGenericUiProto::RequestLoginOptions::LoginOption:: + kCustomLoginOption: + *model_value.mutable_login_options()->add_values() = + login_option.custom_login_option(); + break; + case ShowGenericUiProto::RequestLoginOptions::LoginOption:: + kPasswordManagerLogins: { + for (const auto& login : logins) { + auto* option = model_value.mutable_login_options()->add_values(); + option->set_label(login.username); + option->set_sublabel( + login_option.password_manager_logins().sublabel()); + option->set_payload(login_option.password_manager_logins().payload()); + } + break; + } + case ShowGenericUiProto::RequestLoginOptions::LoginOption::TYPE_NOT_SET: + NOTREACHED(); + break; + } + } + user_model->SetValue(proto.model_identifier(), model_value); +} + +} // namespace + ShowGenericUiAction::ShowGenericUiAction(ActionDelegate* delegate, const ActionProto& proto) : Action(delegate, proto) { DCHECK(proto_.has_show_generic_ui()); } -ShowGenericUiAction::~ShowGenericUiAction() {} +ShowGenericUiAction::~ShowGenericUiAction() { + delegate_->GetPersonalDataManager()->RemoveObserver(this); +} void ShowGenericUiAction::InternalProcessAction( ProcessActionCallback callback) { @@ -43,6 +118,33 @@ proto_.show_generic_ui().generic_user_interface()), base::BindOnce(&ShowGenericUiAction::EndAction, weak_ptr_factory_.GetWeakPtr())); + + // Note: it is important to write autofill profiles etc. to the model AFTER + // the UI has been inflated, otherwise the UI won't get change notifications + // for them. + if (proto_.show_generic_ui().has_request_login_options()) { + auto login_options = + proto_.show_generic_ui().request_login_options().login_options(); + if (std::find_if(login_options.begin(), login_options.end(), + [&](const auto& option) { + return option.type_case() == + ShowGenericUiProto::RequestLoginOptions:: + LoginOption::kPasswordManagerLogins; + }) != login_options.end()) { + delegate_->GetWebsiteLoginManager()->GetLoginsForUrl( + delegate_->GetWebContents()->GetLastCommittedURL(), + base::BindOnce(&ShowGenericUiAction::OnGetLogins, + weak_ptr_factory_.GetWeakPtr(), + proto_.show_generic_ui().request_login_options())); + } else { + delegate_->WriteUserModel(base::BindOnce( + &WriteLoginOptionsToUserModel, + proto_.show_generic_ui().request_login_options(), + /* logins = */ std::vector<WebsiteLoginManager::Login>())); + } + } + delegate_->GetPersonalDataManager()->AddObserver(this); + OnPersonalDataChanged(); } void ShowGenericUiAction::EndAction(bool view_inflation_successful, @@ -74,4 +176,40 @@ std::move(callback_).Run(std::move(processed_action_proto_)); } +void ShowGenericUiAction::OnPersonalDataChanged() { + if (proto_.show_generic_ui().has_request_profiles()) { + auto profiles = std::make_unique< + std::vector<std::unique_ptr<autofill::AutofillProfile>>>(); + for (const auto* profile : + delegate_->GetPersonalDataManager()->GetProfilesToSuggest()) { + profiles->emplace_back( + std::make_unique<autofill::AutofillProfile>(*profile)); + } + delegate_->WriteUserModel( + base::BindOnce(&WriteProfilesToUserModel, std::move(profiles), + proto_.show_generic_ui().request_profiles())); + } + + if (proto_.show_generic_ui().has_request_credit_cards()) { + auto credit_cards = + std::make_unique<std::vector<std::unique_ptr<autofill::CreditCard>>>(); + for (const auto* credit_card : + delegate_->GetPersonalDataManager()->GetCreditCardsToSuggest(true)) { + credit_cards->emplace_back( + std::make_unique<autofill::CreditCard>(*credit_card)); + } + delegate_->WriteUserModel( + base::BindOnce(&WriteCreditCardsToUserModel, std::move(credit_cards), + proto_.show_generic_ui().request_credit_cards())); + } +} + +void ShowGenericUiAction::OnGetLogins( + const ShowGenericUiProto::RequestLoginOptions& proto, + std::vector<WebsiteLoginManager::Login> logins) { + LOG(ERROR) << "Retrieved " << logins.size() << " logins"; + delegate_->WriteUserModel( + base::BindOnce(&WriteLoginOptionsToUserModel, proto, logins)); +} + } // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/actions/show_generic_ui_action.h b/components/autofill_assistant/browser/actions/show_generic_ui_action.h index b2e296e0..091191a 100644 --- a/components/autofill_assistant/browser/actions/show_generic_ui_action.h +++ b/components/autofill_assistant/browser/actions/show_generic_ui_action.h
@@ -8,13 +8,17 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "components/autofill/core/browser/personal_data_manager.h" +#include "components/autofill/core/browser/personal_data_manager_observer.h" #include "components/autofill_assistant/browser/actions/action.h" +#include "components/autofill_assistant/browser/website_login_manager.h" namespace autofill_assistant { class UserModel; // Action to show generic UI in the sheet. -class ShowGenericUiAction : public Action { +class ShowGenericUiAction : public Action, + public autofill::PersonalDataManagerObserver { public: explicit ShowGenericUiAction(ActionDelegate* delegate, const ActionProto& proto); @@ -31,6 +35,12 @@ ProcessedActionStatusProto status, const UserModel* user_model); + // From autofill::PersonalDataManagerObserver. + void OnPersonalDataChanged() override; + + void OnGetLogins(const ShowGenericUiProto::RequestLoginOptions& proto, + std::vector<WebsiteLoginManager::Login> logins); + ProcessActionCallback callback_; base::WeakPtrFactory<ShowGenericUiAction> weak_ptr_factory_{this}; };
diff --git a/components/autofill_assistant/browser/actions/show_generic_ui_action_unittest.cc b/components/autofill_assistant/browser/actions/show_generic_ui_action_unittest.cc index 6ef0e5d..8464d22 100644 --- a/components/autofill_assistant/browser/actions/show_generic_ui_action_unittest.cc +++ b/components/autofill_assistant/browser/actions/show_generic_ui_action_unittest.cc
@@ -4,31 +4,45 @@ #include "components/autofill_assistant/browser/actions/show_generic_ui_action.h" +#include "base/guid.h" #include "base/test/gmock_callback_support.h" #include "base/test/mock_callback.h" +#include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill_assistant/browser/actions/mock_action_delegate.h" +#include "components/autofill_assistant/browser/mock_personal_data_manager.h" +#include "components/autofill_assistant/browser/mock_website_login_manager.h" #include "components/autofill_assistant/browser/service.pb.h" #include "components/autofill_assistant/browser/user_model.h" #include "components/autofill_assistant/browser/value_util.h" +#include "content/public/test/test_renderer_host.h" +#include "content/public/test/web_contents_tester.h" #include "testing/gmock/include/gmock/gmock.h" namespace autofill_assistant { namespace { +const char kFakeUrl[] = "https://www.example.com"; +const char kFakeUsername[] = "user@example.com"; using ::base::test::RunOnceCallback; using ::testing::_; +using ::testing::Eq; using ::testing::InSequence; using ::testing::Invoke; +using ::testing::IsNull; +using ::testing::Not; using ::testing::Property; using ::testing::Return; using ::testing::SizeIs; using ::testing::UnorderedElementsAre; +using ::testing::UnorderedElementsAreArray; -class ShowGenericUiActionTest : public testing::Test { +class ShowGenericUiActionTest : public content::RenderViewHostTestHarness { public: ShowGenericUiActionTest() {} void SetUp() override { + RenderViewHostTestHarness::SetUp(); + ON_CALL(mock_action_delegate_, OnSetGenericUi(_, _)) .WillByDefault(Invoke( [this](std::unique_ptr<GenericUserInterfaceProto> generic_ui, @@ -38,21 +52,41 @@ std::move(end_action_callback) .Run(true, UNKNOWN_ACTION_STATUS, &user_model_); })); - ON_CALL(mock_action_delegate_, ClearGenericUi()).WillByDefault(Return()); + ON_CALL(mock_action_delegate_, WriteUserModel(_)) + .WillByDefault( + Invoke([this](base::OnceCallback<void(UserModel*)> write_callback) { + std::move(write_callback).Run(&user_model_); + })); + ON_CALL(mock_action_delegate_, GetPersonalDataManager) + .WillByDefault(Return(&mock_personal_data_manager_)); + ON_CALL(mock_action_delegate_, GetWebsiteLoginManager) + .WillByDefault(Return(&mock_website_login_manager_)); + ON_CALL(mock_website_login_manager_, OnGetLoginsForUrl(_, _)) + .WillByDefault( + RunOnceCallback<1>(std::vector<WebsiteLoginManager::Login>{ + WebsiteLoginManager::Login(GURL(kFakeUrl), kFakeUsername)})); + content::WebContentsTester::For(web_contents()) + ->SetLastCommittedURL(GURL(kFakeUrl)); + ON_CALL(mock_action_delegate_, GetWebContents()) + .WillByDefault(Return(web_contents())); } protected: - void Run() { + std::unique_ptr<ShowGenericUiAction> Run() { // Apply initial model values as specified by proto. user_model_.MergeWithProto(proto_.generic_user_interface().model(), false); ActionProto action_proto; *action_proto.mutable_show_generic_ui() = proto_; - ShowGenericUiAction action(&mock_action_delegate_, action_proto); - action.ProcessAction(callback_.Get()); + auto action = std::make_unique<ShowGenericUiAction>(&mock_action_delegate_, + action_proto); + action->ProcessAction(callback_.Get()); + return action; } UserModel user_model_; + MockPersonalDataManager mock_personal_data_manager_; + MockWebsiteLoginManager mock_website_login_manager_; MockActionDelegate mock_action_delegate_; base::MockCallback<Action::ProcessActionCallback> callback_; ShowGenericUiProto proto_; @@ -236,5 +270,197 @@ Run(); } +TEST_F(ShowGenericUiActionTest, RequestProfiles) { + autofill::AutofillProfile profile_a(base::GenerateGUID(), kFakeUrl); + autofill::test::SetProfileInfo( + &profile_a, "Marion", "Mitchell", "Morrison", "marion@me.xyz", "Fox", + "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); + ON_CALL(mock_personal_data_manager_, IsAutofillProfileEnabled) + .WillByDefault(Return(true)); + ON_CALL(mock_personal_data_manager_, GetProfiles) + .WillByDefault( + Return(std::vector<autofill::AutofillProfile*>({&profile_a}))); + + proto_.mutable_request_profiles()->set_model_identifier("profiles"); + // Keep action alive by storing it in local variable. + auto action = Run(); + + EXPECT_THAT(user_model_.GetProfile(profile_a.guid())->Compare(profile_a), + Eq(0)); + ValueProto expected_value; + expected_value.set_is_client_side_only(true); + expected_value.mutable_profiles()->add_values()->set_guid(profile_a.guid()); + EXPECT_EQ(*user_model_.GetValue("profiles"), expected_value); + + // Add second profile. + autofill::AutofillProfile profile_b(base::GenerateGUID(), kFakeUrl); + autofill::test::SetProfileInfo(&profile_b, "John", "", "Doe", + "editor@gmail.com", "", "203 Barfield Lane", + "", "Mountain View", "CA", "94043", "US", + "+12345678901"); + ON_CALL(mock_personal_data_manager_, GetProfiles) + .WillByDefault(Return( + std::vector<autofill::AutofillProfile*>({&profile_a, &profile_b}))); + mock_personal_data_manager_.NotifyPersonalDataObserver(); + EXPECT_THAT(user_model_.GetProfile(profile_a.guid())->Compare(profile_a), + Eq(0)); + EXPECT_THAT(user_model_.GetProfile(profile_b.guid())->Compare(profile_b), + Eq(0)); + expected_value.mutable_profiles()->add_values()->set_guid(profile_b.guid()); + EXPECT_THAT(user_model_.GetValue("profiles")->profiles().values(), + UnorderedElementsAreArray(expected_value.profiles().values())); + + // Remove profile_a. + ON_CALL(mock_personal_data_manager_, GetProfiles) + .WillByDefault( + Return(std::vector<autofill::AutofillProfile*>({&profile_b}))); + mock_personal_data_manager_.NotifyPersonalDataObserver(); + EXPECT_EQ(user_model_.GetProfile(profile_a.guid()), nullptr); + EXPECT_THAT(user_model_.GetProfile(profile_b.guid())->Compare(profile_b), + Eq(0)); + expected_value.Clear(); + expected_value.set_is_client_side_only(true); + expected_value.mutable_profiles()->add_values()->set_guid(profile_b.guid()); + EXPECT_THAT(user_model_.GetValue("profiles")->profiles().values(), + UnorderedElementsAreArray(expected_value.profiles().values())); + + // After the action has ended, updates to the PDM are ignored. + action.reset(); + ON_CALL(mock_personal_data_manager_, GetProfiles) + .WillByDefault(Return( + std::vector<autofill::AutofillProfile*>({&profile_a, &profile_b}))); + mock_personal_data_manager_.NotifyPersonalDataObserver(); + EXPECT_EQ(user_model_.GetProfile(profile_a.guid()), nullptr); + EXPECT_THAT(user_model_.GetProfile(profile_b.guid())->Compare(profile_b), + Eq(0)); + expected_value.Clear(); + expected_value.set_is_client_side_only(true); + expected_value.mutable_profiles()->add_values()->set_guid(profile_b.guid()); + EXPECT_THAT(user_model_.GetValue("profiles")->profiles().values(), + UnorderedElementsAreArray(expected_value.profiles().values())); +} + +TEST_F(ShowGenericUiActionTest, RequestCreditCards) { + ON_CALL(mock_personal_data_manager_, IsAutofillCreditCardEnabled) + .WillByDefault(Return(true)); + ON_CALL(mock_personal_data_manager_, ShouldSuggestServerCards) + .WillByDefault(Return(true)); + ON_CALL(mock_personal_data_manager_, IsAutofillProfileEnabled) + .WillByDefault(Return(true)); + + autofill::AutofillProfile profile_a(base::GenerateGUID(), kFakeUrl); + autofill::test::SetProfileInfo( + &profile_a, "Marion", "Mitchell", "Morrison", "marion@me.xyz", "Fox", + "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); + + autofill::CreditCard credit_card_a(base::GenerateGUID(), kFakeUrl); + autofill::test::SetCreditCardInfo(&credit_card_a, "Marion Mitchell", + "4111 1111 1111 1111", "01", "2050", + profile_a.guid()); + ON_CALL(mock_personal_data_manager_, GetCreditCards) + .WillByDefault( + Return(std::vector<autofill::CreditCard*>({&credit_card_a}))); + + proto_.mutable_request_credit_cards()->set_model_identifier("cards"); + // Keep action alive by storing it in local variable. + auto action = Run(); + + EXPECT_THAT( + user_model_.GetCreditCard(credit_card_a.guid())->Compare(credit_card_a), + Eq(0)); + ValueProto expected_value; + expected_value.set_is_client_side_only(true); + expected_value.mutable_credit_cards()->add_values()->set_guid( + credit_card_a.guid()); + EXPECT_EQ(*user_model_.GetValue("cards"), expected_value); + + // Add second card. + autofill::AutofillProfile profile_b(base::GenerateGUID(), kFakeUrl); + autofill::test::SetProfileInfo(&profile_b, "John", "", "Doe", + "editor@gmail.com", "", "203 Barfield Lane", + "", "Mountain View", "CA", "94043", "US", + "+12345678901"); + autofill::CreditCard credit_card_b(base::GenerateGUID(), kFakeUrl); + autofill::test::SetCreditCardInfo(&credit_card_b, "John Doe", + "4111 1111 1111 1111", "01", "2050", + profile_b.guid()); + ON_CALL(mock_personal_data_manager_, GetCreditCards) + .WillByDefault(Return(std::vector<autofill::CreditCard*>( + {&credit_card_a, &credit_card_b}))); + mock_personal_data_manager_.NotifyPersonalDataObserver(); + EXPECT_THAT( + user_model_.GetCreditCard(credit_card_a.guid())->Compare(credit_card_a), + Eq(0)); + EXPECT_THAT( + user_model_.GetCreditCard(credit_card_b.guid())->Compare(credit_card_b), + Eq(0)); + expected_value.mutable_credit_cards()->add_values()->set_guid( + credit_card_b.guid()); + EXPECT_THAT( + user_model_.GetValue("cards")->credit_cards().values(), + UnorderedElementsAreArray(expected_value.credit_cards().values())); + + // Remove credit_card_a. + ON_CALL(mock_personal_data_manager_, GetCreditCards) + .WillByDefault( + Return(std::vector<autofill::CreditCard*>({&credit_card_b}))); + mock_personal_data_manager_.NotifyPersonalDataObserver(); + EXPECT_EQ(user_model_.GetCreditCard(credit_card_a.guid()), nullptr); + EXPECT_THAT( + user_model_.GetCreditCard(credit_card_b.guid())->Compare(credit_card_b), + Eq(0)); + expected_value.Clear(); + expected_value.set_is_client_side_only(true); + expected_value.mutable_credit_cards()->add_values()->set_guid( + credit_card_b.guid()); + EXPECT_THAT( + user_model_.GetValue("cards")->credit_cards().values(), + UnorderedElementsAreArray(expected_value.credit_cards().values())); + + // After the action has ended, updates to the PDM are ignored. + action.reset(); + ON_CALL(mock_personal_data_manager_, GetCreditCards) + .WillByDefault(Return(std::vector<autofill::CreditCard*>( + {&credit_card_a, &credit_card_b}))); + mock_personal_data_manager_.NotifyPersonalDataObserver(); + EXPECT_EQ(user_model_.GetCreditCard(credit_card_a.guid()), nullptr); + EXPECT_THAT( + user_model_.GetCreditCard(credit_card_b.guid())->Compare(credit_card_b), + Eq(0)); + expected_value.Clear(); + expected_value.set_is_client_side_only(true); + expected_value.mutable_credit_cards()->add_values()->set_guid( + credit_card_b.guid()); + EXPECT_THAT( + user_model_.GetValue("cards")->credit_cards().values(), + UnorderedElementsAreArray(expected_value.credit_cards().values())); +} + +TEST_F(ShowGenericUiActionTest, RequestLogins) { + auto* request_login_options = proto_.mutable_request_login_options(); + request_login_options->set_model_identifier("login_options"); + auto* login_option_a = + request_login_options->add_login_options()->mutable_custom_login_option(); + login_option_a->set_label("label_a"); + login_option_a->set_sublabel("sublabel_a"); + login_option_a->set_payload("payload_a"); + + auto* login_option_b = request_login_options->add_login_options() + ->mutable_password_manager_logins(); + login_option_b->set_sublabel("sublabel_b"); + login_option_b->set_payload("payload_b"); + + Run(); + + ValueProto expected_value; + expected_value.set_is_client_side_only(true); + *expected_value.mutable_login_options()->add_values() = *login_option_a; + auto* expected_b = expected_value.mutable_login_options()->add_values(); + expected_b->set_label("user@example.com"); + expected_b->set_sublabel("sublabel_b"); + expected_b->set_payload("payload_b"); + EXPECT_EQ(*user_model_.GetValue("login_options"), expected_value); +} + } // namespace } // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/basic_interactions_unittest.cc b/components/autofill_assistant/browser/basic_interactions_unittest.cc index 2c83b02..6b9e10a 100644 --- a/components/autofill_assistant/browser/basic_interactions_unittest.cc +++ b/components/autofill_assistant/browser/basic_interactions_unittest.cc
@@ -414,8 +414,11 @@ "https://www.example.com"); autofill::test::SetCreditCardInfo(&credit_card, "Marion Mitchell", "4111 1111 1111 1111", "01", "2050", ""); - user_model_.AddCreditCard( + auto credit_cards = + std::make_unique<std::vector<std::unique_ptr<autofill::CreditCard>>>(); + credit_cards->emplace_back( std::make_unique<autofill::CreditCard>(credit_card)); + user_model_.SetAutofillCreditCards(std::move(credit_cards)); ValueProto value_wrong_guid; value_wrong_guid.mutable_credit_cards()->add_values()->set_guid("wrong");
diff --git a/components/autofill_assistant/browser/controller.cc b/components/autofill_assistant/browser/controller.cc index caa6e8da..cf6c47ea 100644 --- a/components/autofill_assistant/browser/controller.cc +++ b/components/autofill_assistant/browser/controller.cc
@@ -1748,6 +1748,11 @@ } } +void Controller::WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) { + std::move(write_callback).Run(&user_model_); +} + ElementArea* Controller::touchable_element_area() { if (!touchable_element_area_) { touchable_element_area_ = std::make_unique<ElementArea>(this);
diff --git a/components/autofill_assistant/browser/controller.h b/components/autofill_assistant/browser/controller.h index 978017b..d10f961 100644 --- a/components/autofill_assistant/browser/controller.h +++ b/components/autofill_assistant/browser/controller.h
@@ -153,6 +153,8 @@ void SetCollectUserDataOptions(CollectUserDataOptions* options) override; void WriteUserData( base::OnceCallback<void(UserData*, UserData::FieldChange*)>) override; + void WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) override; void OnScriptError(const std::string& error_message, Metrics::DropOutReason reason);
diff --git a/components/autofill_assistant/browser/fake_script_executor_delegate.cc b/components/autofill_assistant/browser/fake_script_executor_delegate.cc index 3533e6d..3cd70d24 100644 --- a/components/autofill_assistant/browser/fake_script_executor_delegate.cc +++ b/components/autofill_assistant/browser/fake_script_executor_delegate.cc
@@ -126,6 +126,11 @@ std::move(write_callback).Run(payment_request_info_.get(), &field_change); } +void FakeScriptExecutorDelegate::WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) { + std::move(write_callback).Run(user_model_); +} + void FakeScriptExecutorDelegate::SetViewportMode(ViewportMode mode) { viewport_mode_ = mode; }
diff --git a/components/autofill_assistant/browser/fake_script_executor_delegate.h b/components/autofill_assistant/browser/fake_script_executor_delegate.h index 54a660d..b027946c 100644 --- a/components/autofill_assistant/browser/fake_script_executor_delegate.h +++ b/components/autofill_assistant/browser/fake_script_executor_delegate.h
@@ -52,6 +52,8 @@ void SetCollectUserDataOptions(CollectUserDataOptions* options) override; void WriteUserData( base::OnceCallback<void(UserData*, UserData::FieldChange*)>) override; + void WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) override; void SetViewportMode(ViewportMode mode) override; ViewportMode GetViewportMode() override; void SetPeekMode(ConfigureBottomSheetProto::PeekMode peek_mode) override;
diff --git a/components/autofill_assistant/browser/script_executor.cc b/components/autofill_assistant/browser/script_executor.cc index fa30b047..1ec72e8 100644 --- a/components/autofill_assistant/browser/script_executor.cc +++ b/components/autofill_assistant/browser/script_executor.cc
@@ -242,6 +242,11 @@ delegate_->WriteUserData(std::move(write_callback)); } +void ScriptExecutor::WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) { + delegate_->WriteUserModel(std::move(write_callback)); +} + void ScriptExecutor::OnGetUserData( base::OnceCallback<void(UserData*, const UserModel*)> callback, UserData* user_data,
diff --git a/components/autofill_assistant/browser/script_executor.h b/components/autofill_assistant/browser/script_executor.h index f3fe5dd9..96d0844 100644 --- a/components/autofill_assistant/browser/script_executor.h +++ b/components/autofill_assistant/browser/script_executor.h
@@ -124,6 +124,8 @@ CollectUserDataOptions* collect_user_data_options) override; void WriteUserData( base::OnceCallback<void(UserData*, UserData::FieldChange*)>) override; + void WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) override; void GetFullCard(GetFullCardCallback callback) override; void Prompt(std::unique_ptr<std::vector<UserAction>> user_actions, bool disable_force_expand_sheet,
diff --git a/components/autofill_assistant/browser/script_executor_delegate.h b/components/autofill_assistant/browser/script_executor_delegate.h index 27b9ca9..07475be 100644 --- a/components/autofill_assistant/browser/script_executor_delegate.h +++ b/components/autofill_assistant/browser/script_executor_delegate.h
@@ -78,6 +78,8 @@ virtual void WriteUserData( base::OnceCallback<void(UserData*, UserData::FieldChange*)> write_callback) = 0; + virtual void WriteUserModel( + base::OnceCallback<void(UserModel*)> write_callback) = 0; virtual void SetProgress(int progress) = 0; virtual void SetProgressVisible(bool visible) = 0; virtual void SetUserActions(
diff --git a/components/autofill_assistant/browser/service.proto b/components/autofill_assistant/browser/service.proto index 116ec800..2ae3af2 100644 --- a/components/autofill_assistant/browser/service.proto +++ b/components/autofill_assistant/browser/service.proto
@@ -1106,6 +1106,23 @@ // log should contain additional information about the issue, if verbose // logging is enabled (suggested level: 2 or 3). message ShowGenericUiProto { + message RequestAutofillCreditCards { optional string model_identifier = 1; } + message RequestAutofillProfiles { optional string model_identifier = 1; } + message RequestLoginOptions { + message PasswordManagerLogins { + optional string sublabel = 1; + optional bytes payload = 2; + } + message LoginOption { + oneof type { + LoginOptionProto custom_login_option = 1; + PasswordManagerLogins password_manager_logins = 2; + } + } + + repeated LoginOption login_options = 1; + optional string model_identifier = 2; + } message Result { // The model containing the values for all keys specified in // |output_model_identifiers|. @@ -1118,6 +1135,19 @@ // The set of model identifiers to write to the result. Note: this must be a // subset of the input model identifiers! repeated string output_model_identifiers = 2; + + // If specified, available autofill credit cards will be provided and + // auto-updated in the specified |model_identifier|. + optional RequestAutofillCreditCards request_credit_cards = 3; + + // If specified, available autofill profiles will be provided and auto-updated + // in the specified |model_identifier|. + optional RequestAutofillProfiles request_profiles = 4; + + // If specified, available login options (including those provided by password + // manager) will be provided and auto-updated in the specified + // |model_identifier|. + optional RequestLoginOptions request_login_options = 5; } // Allow choosing one or more possibility. If FocusElement was called just
diff --git a/components/autofill_assistant/browser/user_model.cc b/components/autofill_assistant/browser/user_model.cc index 9520b83..df113f1 100644 --- a/components/autofill_assistant/browser/user_model.cc +++ b/components/autofill_assistant/browser/user_model.cc
@@ -143,19 +143,22 @@ observers_.RemoveObserver(observer); } -void UserModel::AddCreditCard( - std::unique_ptr<autofill::CreditCard> credit_card) { - if (!credit_card) { - return; +void UserModel::SetAutofillCreditCards( + std::unique_ptr<std::vector<std::unique_ptr<autofill::CreditCard>>> + credit_cards) { + credit_cards_.clear(); + for (auto& credit_card : *credit_cards) { + credit_cards_[credit_card->guid()] = std::move(credit_card); } - credit_cards_[credit_card->guid()] = std::move(credit_card); } -void UserModel::AddProfile(std::unique_ptr<autofill::AutofillProfile> profile) { - if (!profile) { - return; +void UserModel::SetAutofillProfiles( + std::unique_ptr<std::vector<std::unique_ptr<autofill::AutofillProfile>>> + profiles) { + profiles_.clear(); + for (auto& profile : *profiles) { + profiles_[profile->guid()] = std::move(profile); } - profiles_[profile->guid()] = std::move(profile); } const autofill::CreditCard* UserModel::GetCreditCard(
diff --git a/components/autofill_assistant/browser/user_model.h b/components/autofill_assistant/browser/user_model.h index dc0dba8..e0b4189 100644 --- a/components/autofill_assistant/browser/user_model.h +++ b/components/autofill_assistant/browser/user_model.h
@@ -72,11 +72,15 @@ return values; } - // Adds |credit_card| to the set of available cards. - void AddCreditCard(std::unique_ptr<autofill::CreditCard> credit_card); + // Replaces the set of available autofill credit cards. + void SetAutofillCreditCards( + std::unique_ptr<std::vector<std::unique_ptr<autofill::CreditCard>>> + credit_cards); - // Adds |profile| to the set of available cards. - void AddProfile(std::unique_ptr<autofill::AutofillProfile> profile); + // Replaces the set of available autofill profiles. + void SetAutofillProfiles( + std::unique_ptr<std::vector<std::unique_ptr<autofill::AutofillProfile>>> + profiles); // Returns the credit card with |guid| or nullptr if there is no such card. const autofill::CreditCard* GetCreditCard(const std::string& guid) const;
diff --git a/components/autofill_assistant/browser/user_model_unittest.cc b/components/autofill_assistant/browser/user_model_unittest.cc index b7316fea..e88182c 100644 --- a/components/autofill_assistant/browser/user_model_unittest.cc +++ b/components/autofill_assistant/browser/user_model_unittest.cc
@@ -3,10 +3,13 @@ // found in the LICENSE file. #include "components/autofill_assistant/browser/user_model.h" +#include "base/guid.h" +#include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill_assistant/browser/mock_user_model_observer.h" #include "testing/gmock/include/gmock/gmock.h" namespace autofill_assistant { +const char kFakeUrl[] = "https://www.example.com"; using ::testing::_; using ::testing::Eq; @@ -305,4 +308,47 @@ EXPECT_EQ(model_.GetValue("utf_8_ü万𠜎[1]"), base::nullopt); } +TEST_F(UserModelTest, SetCreditCards) { + autofill::CreditCard credit_card_a(base::GenerateGUID(), kFakeUrl); + autofill::test::SetCreditCardInfo(&credit_card_a, "Marion Mitchell", + "4111 1111 1111 1111", "01", "2050", ""); + autofill::CreditCard credit_card_b(base::GenerateGUID(), kFakeUrl); + autofill::test::SetCreditCardInfo(&credit_card_b, "John Doe", + "4111 1111 1111 1111", "01", "2050", ""); + auto credit_cards = + std::make_unique<std::vector<std::unique_ptr<autofill::CreditCard>>>(); + credit_cards->emplace_back( + std::make_unique<autofill::CreditCard>(credit_card_a)); + credit_cards->emplace_back( + std::make_unique<autofill::CreditCard>(credit_card_b)); + model_.SetAutofillCreditCards(std::move(credit_cards)); + EXPECT_THAT( + model_.GetCreditCard(credit_card_a.guid())->Compare(credit_card_a), + Eq(0)); + EXPECT_THAT( + model_.GetCreditCard(credit_card_b.guid())->Compare(credit_card_b), + Eq(0)); +} + +TEST_F(UserModelTest, SetProfiles) { + autofill::AutofillProfile profile_a(base::GenerateGUID(), kFakeUrl); + autofill::test::SetProfileInfo( + &profile_a, "Marion", "Mitchell", "Morrison", "marion@me.xyz", "Fox", + "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); + autofill::AutofillProfile profile_b(base::GenerateGUID(), kFakeUrl); + autofill::test::SetProfileInfo(&profile_b, "John", "", "Doe", + "editor@gmail.com", "", "203 Barfield Lane", + "", "Mountain View", "CA", "94043", "US", + "+12345678901"); + auto profiles = std::make_unique< + std::vector<std::unique_ptr<autofill::AutofillProfile>>>(); + profiles->emplace_back( + std::make_unique<autofill::AutofillProfile>(profile_a)); + profiles->emplace_back( + std::make_unique<autofill::AutofillProfile>(profile_b)); + model_.SetAutofillProfiles(std::move(profiles)); + EXPECT_THAT(model_.GetProfile(profile_a.guid())->Compare(profile_a), Eq(0)); + EXPECT_THAT(model_.GetProfile(profile_b.guid())->Compare(profile_b), Eq(0)); +} + } // namespace autofill_assistant
diff --git a/components/browser_ui/settings/android/BUILD.gn b/components/browser_ui/settings/android/BUILD.gn index d8e1bf4..29a3fa9 100644 --- a/components/browser_ui/settings/android/BUILD.gn +++ b/components/browser_ui/settings/android/BUILD.gn
@@ -9,6 +9,7 @@ "java/src/org/chromium/components/browser_ui/settings/ManagedPreferenceDelegate.java", "java/src/org/chromium/components/browser_ui/settings/ManagedPreferencesUtils.java", "java/src/org/chromium/components/browser_ui/settings/SearchUtils.java", + "java/src/org/chromium/components/browser_ui/settings/SettingsLauncher.java", "java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java", "widget/java/src/org/chromium/components/browser_ui/settings/ButtonPreference.java", "widget/java/src/org/chromium/components/browser_ui/settings/ChromeBaseCheckBoxPreference.java", @@ -16,6 +17,7 @@ "widget/java/src/org/chromium/components/browser_ui/settings/ChromeImageViewPreference.java", "widget/java/src/org/chromium/components/browser_ui/settings/ChromeSwitchPreference.java", "widget/java/src/org/chromium/components/browser_ui/settings/ExpandablePreferenceGroup.java", + "widget/java/src/org/chromium/components/browser_ui/settings/LearnMorePreference.java", "widget/java/src/org/chromium/components/browser_ui/settings/SpinnerPreference.java", "widget/java/src/org/chromium/components/browser_ui/settings/TextMessagePreference.java", ]
diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncher.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsLauncher.java similarity index 97% rename from chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncher.java rename to components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsLauncher.java index 8a213c0..356f30d8 100644 --- a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/SettingsLauncher.java +++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsLauncher.java
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.chrome.browser.settings; +package org.chromium.components.browser_ui.settings; import android.content.Context; import android.content.Intent;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/LearnMorePreference.java b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/LearnMorePreference.java similarity index 94% rename from chrome/android/java/src/org/chromium/chrome/browser/settings/LearnMorePreference.java rename to components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/LearnMorePreference.java index d3aec750..82330fb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/LearnMorePreference.java +++ b/components/browser_ui/settings/android/widget/java/src/org/chromium/components/browser_ui/settings/LearnMorePreference.java
@@ -2,15 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.chrome.browser.settings; +package org.chromium.components.browser_ui.settings; import android.content.Context; import android.util.AttributeSet; import android.widget.TextView; + import androidx.preference.Preference; import androidx.preference.PreferenceViewHolder; + import org.chromium.base.ApiCompatibilityUtils; -import org.chromium.chrome.R; /** * A preference with a clickable "Learn more" link. @@ -35,4 +36,4 @@ titleView.setClickable(true); titleView.setOnClickListener(v -> getOnPreferenceClickListener().onPreferenceClick(this)); } -} \ No newline at end of file +}
diff --git a/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml index 643318b..c4de0e7 100644 --- a/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml +++ b/components/browser_ui/site_settings/android/java/res/xml/website_preferences.xml
@@ -46,8 +46,8 @@ android:title="@string/enable_notifications_vibrate_title" android:summary="@string/enable_notifications_vibrate_summary" android:defaultValue="true" /> - <!-- An hyperlink to explain more about Protected Media content settings. --> - <org.chromium.chrome.browser.settings.LearnMorePreference + <!-- A hyperlink to explain more about Protected Media content settings. --> + <org.chromium.components.browser_ui.settings.LearnMorePreference android:key="protected_content_learn_more" /> <!-- Collapsible headers for sorting preferences. -->
diff --git a/components/content_settings/browser/tab_specific_content_settings.cc b/components/content_settings/browser/tab_specific_content_settings.cc index 3c53ef4..9b74009 100644 --- a/components/content_settings/browser/tab_specific_content_settings.cc +++ b/components/content_settings/browser/tab_specific_content_settings.cc
@@ -332,6 +332,18 @@ } void TabSpecificContentSettings::OnCookiesAccessed( + content::NavigationHandle* navigation, + const content::CookieAccessDetails& details) { + OnCookiesAccessedImpl(details); +} + +void TabSpecificContentSettings::OnCookiesAccessed( + content::RenderFrameHost* rfh, + const content::CookieAccessDetails& details) { + OnCookiesAccessedImpl(details); +} + +void TabSpecificContentSettings::OnCookiesAccessedImpl( const content::CookieAccessDetails& details) { if (details.cookie_list.empty()) return;
diff --git a/components/content_settings/browser/tab_specific_content_settings.h b/components/content_settings/browser/tab_specific_content_settings.h index 7957a680..6e55188 100644 --- a/components/content_settings/browser/tab_specific_content_settings.h +++ b/components/content_settings/browser/tab_specific_content_settings.h
@@ -364,7 +364,10 @@ content::NavigationHandle* navigation_handle) override; void AppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy) override; - void OnCookiesAccessed(const content::CookieAccessDetails& details) override; + void OnCookiesAccessed(content::NavigationHandle* navigation, + const content::CookieAccessDetails& details) override; + void OnCookiesAccessed(content::RenderFrameHost* rfh, + const content::CookieAccessDetails& details) override; // Called when a specific Service Worker scope was accessed. // If access was blocked due to the user's content settings, // |blocked_by_policy_javascript| or/and |blocked_by_policy_cookie| should be @@ -397,6 +400,9 @@ // Updates MIDI settings on navigation. void MidiDidNavigate(content::NavigationHandle* navigation_handle); + // Updates the list of allowed and blocked cookies. + void OnCookiesAccessedImpl(const content::CookieAccessDetails& details); + std::unique_ptr<Delegate> delegate_; // All currently registered |SiteDataObserver|s.
diff --git a/components/content_settings/browser/tab_specific_content_settings_unittest.cc b/components/content_settings/browser/tab_specific_content_settings_unittest.cc index 93083d2..46a10f54 100644 --- a/components/content_settings/browser/tab_specific_content_settings_unittest.cc +++ b/components/content_settings/browser/tab_specific_content_settings_unittest.cc
@@ -132,7 +132,8 @@ origin, "A=B", base::Time::Now(), base::nullopt /* server_time */)); ASSERT_TRUE(cookie1); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie1}, @@ -168,7 +169,8 @@ EXPECT_TRUE(content_settings->IsContentBlocked( ContentSettingsType::MEDIASTREAM_CAMERA)); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie1}, @@ -179,7 +181,8 @@ origin, "C=D", base::Time::Now(), base::nullopt /* server_time */)); ASSERT_TRUE(cookie2); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie2}, @@ -274,7 +277,8 @@ origin, "A=B", base::Time::Now(), base::nullopt /* server_time */)); ASSERT_TRUE(cookie1); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie1}, @@ -288,7 +292,8 @@ origin, "C=D", base::Time::Now(), base::nullopt /* server_time */)); ASSERT_TRUE(cookie2); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie2}, @@ -306,9 +311,10 @@ ASSERT_FALSE( content_settings->IsContentBlocked(ContentSettingsType::COOKIES)); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kRead, - GURL("http://google.com"), GURL("http://google.com"), - net::CookieList(), true}); + ->OnCookiesAccessed( + web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kRead, GURL("http://google.com"), + GURL("http://google.com"), net::CookieList(), true}); ASSERT_FALSE( content_settings->IsContentAllowed(ContentSettingsType::COOKIES)); ASSERT_FALSE( @@ -327,7 +333,8 @@ origin, "A=B", base::Time::Now(), base::nullopt /* server_time */)); ASSERT_TRUE(cookie); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kChange, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kChange, origin, origin, {*cookie}, @@ -342,9 +349,10 @@ cookie_list.push_back(*other_cookie); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kRead, - GURL("http://google.com"), GURL("http://google.com"), - cookie_list, blocked_by_policy}); + ->OnCookiesAccessed( + web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kRead, GURL("http://google.com"), + GURL("http://google.com"), cookie_list, blocked_by_policy}); content_settings->OnFileSystemAccessed(GURL("http://google.com"), blocked_by_policy); content_settings->OnIndexedDBAccessed(GURL("http://google.com"), @@ -363,7 +371,8 @@ base::Time::Now(), base::nullopt /* server_time */); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kRead, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kRead, GURL("http://google.com"), GURL("http://google.com"), {*cookie}, @@ -408,7 +417,8 @@ GURL("http://www.google.com"), "k4=v; Domain=.www.google.com", base::Time::Now(), base::nullopt /* server_time */); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kRead, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kRead, GURL("http://www.google.com"), GURL("http://www.google.com"), {*cookie1, *cookie2, *cookie3, *cookie4}, @@ -418,7 +428,8 @@ "k5=v", base::Time::Now(), base::nullopt /* server_time */); static_cast<content::WebContentsObserver*>(content_settings) - ->OnCookiesAccessed({content::CookieAccessDetails::Type::kRead, + ->OnCookiesAccessed(web_contents()->GetMainFrame(), + {content::CookieAccessDetails::Type::kRead, GURL("https://www.google.com"), GURL("https://www.google.com"), {*cookie5},
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java index 83916ea..15612851 100644 --- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java +++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationDelegate.java
@@ -19,8 +19,7 @@ import java.lang.annotation.RetentionPolicy; /** - * A delegate for the class responsible for navigating to external applications from Chrome. Used - * by {@link ExternalNavigationHandler}. + * A delegate for {@link ExternalNavigationHandler}. */ public interface ExternalNavigationDelegate { /** @@ -30,10 +29,10 @@ Activity getActivityContext(); /** - * Determine if Chrome is the default or only handler for a given intent. If true, Chrome + * Determine if this app is the default or only handler for a given intent. If true, this app * will handle the intent when started. */ - boolean willChromeHandleIntent(Intent intent); + boolean willAppHandleIntent(Intent intent); /** * Returns whether to disable forwarding URL requests to external intents for the passed-in URL. @@ -89,9 +88,9 @@ int maybeHandleStartActivityIfNeeded(Intent intent, boolean proxy); /** - * Display a dialog warning the user that they may be leaving Chrome by starting this + * Display a dialog warning the user that they may be leaving this app by starting this * intent. Give the user the opportunity to cancel the action. And if it is canceled, a - * navigation will happen in Chrome. Catches BadTokenExceptions caused by showing the dialog + * navigation will happen in this app. Catches BadTokenExceptions caused by showing the dialog * on certain devices. (crbug.com/782602) * @param intent The intent for external application that will be sent. * @param referrerUrl The referrer for the current navigation. @@ -144,9 +143,9 @@ void maybeSetPendingIncognitoUrl(Intent intent); /** - * Determine if the Chrome app is in the foreground. + * Determine if the application of the embedder is in the foreground. */ - boolean isChromeAppInForeground(); + boolean isApplicationInForeground(); /** * Check if the URL should be handled by an instant app, or kick off an async request for an @@ -202,7 +201,7 @@ /** * @param intent The intent to launch. - * @return Whether the Intent points to an app that we trust and that launched Chrome. + * @return Whether the Intent points to an app that we trust and that launched this app. */ boolean isIntentForTrustedCallingApp(Intent intent);
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java index 1c780c86..b1b9bff 100644 --- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java +++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
@@ -63,7 +63,7 @@ /** * Logic related to the URL overriding/intercepting functionality. - * This feature allows Chrome to convert certain navigations to Android Intents allowing + * This feature supports conversion of certain navigations to Android Intents allowing * applications like Youtube to direct users clicking on a http(s) link to their native app. */ public class ExternalNavigationHandler { @@ -300,11 +300,11 @@ } /** - * http://crbug.com/441284 : Disallow firing external intent while Chrome is in the background. + * http://crbug.com/441284 : Disallow firing external intent while the app is in the background. */ private boolean blockExternalNavWhileBackgrounded(ExternalNavigationParams params) { - if (params.isApplicationMustBeInForeground() && !mDelegate.isChromeAppInForeground()) { - if (DEBUG) Log.i(TAG, "Chrome is not in foreground"); + if (params.isApplicationMustBeInForeground() && !mDelegate.isApplicationInForeground()) { + if (DEBUG) Log.i(TAG, "App is not in foreground"); return true; } return false; @@ -331,11 +331,11 @@ return false; } - /** http://crbug.com/605302 : Allow Chrome to handle all pdf file downloads. */ + /** http://crbug.com/605302 : Allow embedders to handle all pdf file downloads. */ private boolean isInternalPdfDownload( boolean isExternalProtocol, ExternalNavigationParams params) { if (!isExternalProtocol && isPdfDownload(params.getUrl())) { - if (DEBUG) Log.i(TAG, "PDF downloads are now handled by Chrome"); + if (DEBUG) Log.i(TAG, "PDF downloads are now handled internally"); return true; } return false; @@ -343,7 +343,7 @@ /** * If accessing a file URL, ensure that the user has granted the necessary file access - * to Chrome. + * to the app. */ private boolean startFileIntentIfNecessary( ExternalNavigationParams params, Intent targetIntent) { @@ -512,7 +512,7 @@ return false; } - private boolean redirectShouldStayInChrome( + private boolean redirectShouldStayInApp( ExternalNavigationParams params, boolean isExternalProtocol, Intent targetIntent) { RedirectHandler handler = params.getRedirectHandler(); if (handler == null) return false; @@ -554,7 +554,7 @@ } // http://crbug.com/839751: Require user gestures for form submits to external // protocols. - // TODO(tedchoc): Remove the ChromeFeatureList check once we verify this change does + // TODO(tedchoc): Turn this on by default once we verify this change does // not break the world. if (isRedirectFromFormSubmit && !incomingIntentRedirect && !params.hasUserGesture() && blockExternalFormRedirectsWithoutGesture()) { @@ -753,10 +753,10 @@ } /** - * This is the catch-all path for any intent that Chrome can handle that doesn't have a + * This is the catch-all path for any intent that the app can handle that doesn't have a * specialized external app handling it. */ - private @OverrideUrlLoadingResult int fallBackToHandlingInChrome() { + private @OverrideUrlLoadingResult int fallBackToHandlingInApp() { if (DEBUG) Log.i(TAG, "No specialized handler for URL"); return OverrideUrlLoadingResult.NO_OVERRIDE; } @@ -826,9 +826,9 @@ */ private void prepareExternalIntent(Intent targetIntent, ExternalNavigationParams params, List<ResolveInfo> resolvingInfos, boolean shouldProxyForInstantApps) { - // Set the Browser application ID to us in case the user chooses Chrome + // Set the Browser application ID to us in case the user chooses this app // as the app. This will make sure the link is opened in the same tab - // instead of making a new one. + // instead of making a new one in the case of Chrome. targetIntent.putExtra(Browser.EXTRA_APPLICATION_ID, ContextUtils.getApplicationContext().getPackageName()); if (params.isOpenInNewTab()) targetIntent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true); @@ -857,8 +857,8 @@ private @OverrideUrlLoadingResult int handleExternalIncognitoIntent(Intent targetIntent, ExternalNavigationParams params, String browserFallbackUrl, boolean shouldProxyForInstantApps) { - // This intent may leave Chrome. Warn the user that incognito does not carry over - // to apps out side of Chrome. + // This intent may leave this app. Warn the user that incognito does not carry over + // to external apps. if (mDelegate.startIncognitoIntent(targetIntent, params.getReferrerUrl(), browserFallbackUrl, params.shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(), @@ -871,13 +871,13 @@ } /** - * If some third-party app launched Chrome with an intent, and the URL got redirected, and the - * user explicitly chose Chrome over other intent handlers, stay in Chrome unless there was a - * new intent handler after redirection or Chrome cannot handle it any more. + * If some third-party app launched this app with an intent, and the URL got redirected, and the + * user explicitly chose this app over other intent handlers, stay in the app unless there was a + * new intent handler after redirection or the app cannot handle it internally any more. * Custom tabs are an exception to this rule, since at no point, the user sees an intent picker - * and "picking Chrome" is handled inside the support library. + * and "picking the Chrome app" is handled inside the support library. */ - private boolean shouldKeepIntentRedirectInChrome(ExternalNavigationParams params, + private boolean shouldKeepIntentRedirectInApp(ExternalNavigationParams params, boolean incomingIntentRedirect, List<ResolveInfo> resolvingInfos, boolean isExternalProtocol) { if (params.getRedirectHandler() != null && incomingIntentRedirect && !isExternalProtocol @@ -989,7 +989,7 @@ if (handleCCTRedirectsToInstantApps(params, isExternalProtocol, incomingIntentRedirect)) { return OverrideUrlLoadingResult.OVERRIDE_WITH_EXTERNAL_INTENT; - } else if (redirectShouldStayInChrome(params, isExternalProtocol, targetIntent)) { + } else if (redirectShouldStayInApp(params, isExternalProtocol, targetIntent)) { return OverrideUrlLoadingResult.NO_OVERRIDE; } @@ -1040,11 +1040,11 @@ params, incomingIntentRedirect, linkNotFromIntent)) { return OverrideUrlLoadingResult.OVERRIDE_WITH_EXTERNAL_INTENT; } - return fallBackToHandlingInChrome(); + return fallBackToHandlingInApp(); } - // From this point on we should only have intents Chrome can't handle, or intents for apps - // with specialized handlers. + // From this point on we should only have intents that this app can't handle, or intents for + // apps with specialized handlers. if (shouldStayWithinHost( params, isLink, isFormSubmit, resolvingInfos, isExternalProtocol)) { @@ -1064,22 +1064,22 @@ assert intentResolutionMatches(debugIntent, targetIntent); if (params.isIncognito()) { - boolean intentTargetedToChrome = mDelegate.willChromeHandleIntent(targetIntent); + boolean intentTargetedToApp = mDelegate.willAppHandleIntent(targetIntent); - // The user is about to potentially leave Chrome, so we should ask whether they want to + // The user is about to potentially leave the app, so we should ask whether they want to // leave incognito or not. - if (!intentTargetedToChrome) { + if (!intentTargetedToApp) { return handleExternalIncognitoIntent( targetIntent, params, browserFallbackUrl, shouldProxyForInstantApps); } - // The intent is staying in Chrome, so we can simply navigate to the intent's URL, while - // staying in incognito. + // The intent is staying in the app, so we can simply navigate to the intent's URL, + // while staying in incognito. return mDelegate.handleIncognitoIntentTargetingSelf( targetIntent, params.getReferrerUrl(), browserFallbackUrl); } - if (shouldKeepIntentRedirectInChrome( + if (shouldKeepIntentRedirectInApp( params, incomingIntentRedirect, resolvingInfos, isExternalProtocol)) { return OverrideUrlLoadingResult.NO_OVERRIDE; } @@ -1183,7 +1183,7 @@ // NOTE: any further redirection from fall-back URL should not override URL loading. // Otherwise, it can be used in chain for fingerprinting multiple app installation // status in one shot. In order to prevent this scenario, we notify redirection - // handler that redirection from the current navigation should stay in Chrome. + // handler that redirection from the current navigation should stay in this app. if (params.getRedirectHandler() != null) { params.getRedirectHandler().setShouldNotOverrideUrlLoadingOnCurrentRedirectChain(); }
diff --git a/components/external_intents/android/javatests/src/org/chromium/components/external_intents/ExternalNavigationHandlerTest.java b/components/external_intents/android/javatests/src/org/chromium/components/external_intents/ExternalNavigationHandlerTest.java index e46b66cb..867a67a2 100644 --- a/components/external_intents/android/javatests/src/org/chromium/components/external_intents/ExternalNavigationHandlerTest.java +++ b/components/external_intents/android/javatests/src/org/chromium/components/external_intents/ExternalNavigationHandlerTest.java
@@ -1945,7 +1945,7 @@ } @Override - public boolean willChromeHandleIntent(Intent intent) { + public boolean willAppHandleIntent(Intent intent) { String chromePackageName = ContextUtils.getApplicationContext().getPackageName(); if (chromePackageName.equals(intent.getPackage()) || (intent.getComponent() != null @@ -2054,7 +2054,7 @@ public void maybeSetPendingIncognitoUrl(Intent intent) {} @Override - public boolean isChromeAppInForeground() { + public boolean isApplicationInForeground() { return mIsChromeAppInForeground; }
diff --git a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoControllerDelegate.java b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoControllerDelegate.java index 3a4fe85..10a54a42 100644 --- a/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoControllerDelegate.java +++ b/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoControllerDelegate.java
@@ -49,7 +49,7 @@ private final VrHandler mVrHandler; private final boolean mIsSiteSettingsAvailable; private final boolean mCookieControlsShown; - protected final @PreviewPageState int mPreviewPageState; + protected @PreviewPageState int mPreviewPageState; protected @OfflinePageState int mOfflinePageState; protected String mOfflinePageUrl;
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.cc b/components/page_load_metrics/browser/metrics_web_contents_observer.cc index aae6ead..c718da7 100644 --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc
@@ -365,6 +365,18 @@ } void MetricsWebContentsObserver::OnCookiesAccessed( + content::NavigationHandle* navigation, + const content::CookieAccessDetails& details) { + OnCookiesAccessedImpl(details); +} + +void MetricsWebContentsObserver::OnCookiesAccessed( + content::RenderFrameHost* rfh, + const content::CookieAccessDetails& details) { + OnCookiesAccessedImpl(details); +} + +void MetricsWebContentsObserver::OnCookiesAccessedImpl( const content::CookieAccessDetails& details) { if (!committed_load_) return;
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.h b/components/page_load_metrics/browser/metrics_web_contents_observer.h index ed64cca4..e511b3f 100644 --- a/components/page_load_metrics/browser/metrics_web_contents_observer.h +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h
@@ -123,7 +123,10 @@ bool is_display_none) override; void FrameSizeChanged(content::RenderFrameHost* render_frame_host, const gfx::Size& frame_size) override; - void OnCookiesAccessed(const content::CookieAccessDetails& details) override; + void OnCookiesAccessed(content::NavigationHandle* navigation, + const content::CookieAccessDetails& details) override; + void OnCookiesAccessed(content::RenderFrameHost* rfh, + const content::CookieAccessDetails& details) override; void OnStorageAccessed(const GURL& url, const GURL& first_party_url, bool blocked_by_policy, @@ -245,6 +248,9 @@ bool MaybeRestorePageLoadTrackerForBackForwardCache( content::NavigationHandle* navigation_handle); + // Notify PageLoadTrackers about cookie read or write. + void OnCookiesAccessedImpl(const content::CookieAccessDetails& details); + // True if the web contents is currently in the foreground. bool in_foreground_;
diff --git a/components/page_load_metrics/browser/observers/page_load_metrics_observer_tester.cc b/components/page_load_metrics/browser/observers/page_load_metrics_observer_tester.cc index 4941cc4..a7ead53 100644 --- a/components/page_load_metrics/browser/observers/page_load_metrics_observer_tester.cc +++ b/components/page_load_metrics/browser/observers/page_load_metrics_observer_tester.cc
@@ -293,7 +293,8 @@ void PageLoadMetricsObserverTester::SimulateCookieAccess( const content::CookieAccessDetails& details) { - metrics_web_contents_observer_->OnCookiesAccessed(details); + metrics_web_contents_observer_->OnCookiesAccessed( + metrics_web_contents_observer_->web_contents()->GetMainFrame(), details); } void PageLoadMetricsObserverTester::SimulateStorageAccess(
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc index bdb87218..a4f62f50 100644 --- a/components/password_manager/core/browser/login_database.cc +++ b/components/password_manager/core/browser/login_database.cc
@@ -107,6 +107,9 @@ namespace { +// Common prefix for all histograms. +constexpr char kPasswordManager[] = "PasswordManager"; + // Need to stay in sync with the PasswordGenerated suffix in histograms.xml. constexpr char kAutoGeneratedSuffix[] = ".AutoGenerated"; constexpr char kUserCreatedSuffix[] = ".UserCreated"; @@ -783,6 +786,12 @@ } #endif +base::StringPiece LoginDatabase::GetMetricsSuffixForStore() const { + // Note: For historic reasons, the profile store does not use a suffix, only + // the account store does. + return is_account_store_.value() ? ".AccountStore" : ""; +} + void LoginDatabase::ReportNumberOfAccountsMetrics( bool custom_passphrase_sync_enabled) { sql::Statement s(db_.GetCachedStatement( @@ -794,13 +803,7 @@ if (!s.is_valid()) return; - constexpr base::StringPiece kPasswordManager = "PasswordManager"; - - // Note: For historic reasons, the profile store does not use a suffix, only - // the account store does. - base::StringPiece store_suffix = - is_account_store_.value() ? ".AccountStore" : ""; - + base::StringPiece store_suffix = GetMetricsSuffixForStore(); base::StringPiece custom_passphrase_suffix = GetCustomPassphraseSuffix(custom_passphrase_sync_enabled); @@ -871,6 +874,7 @@ if (!usage_statement.is_valid()) return; + base::StringPiece store_suffix = GetMetricsSuffixForStore(); base::StringPiece custom_passphrase_suffix = GetCustomPassphraseSuffix(custom_passphrase_sync_enabled); @@ -878,21 +882,26 @@ auto type = static_cast<PasswordForm::Type>(usage_statement.ColumnInt(0)); const int times_used = usage_statement.ColumnInt(1); - static constexpr base::StringPiece kTimesPasswordUsed = - "PasswordManager.TimesPasswordUsed"; + static constexpr base::StringPiece kTimesPasswordUsedSuffix = + ".TimesPasswordUsed"; if (type == PasswordForm::Type::kGenerated) { - LogTimesUsedStat(base::StrCat({kTimesPasswordUsed, kAutoGeneratedSuffix, - custom_passphrase_suffix}), - times_used); + LogTimesUsedStat( + base::StrCat({kPasswordManager, store_suffix, + kTimesPasswordUsedSuffix, kAutoGeneratedSuffix, + custom_passphrase_suffix}), + times_used); } else { - LogTimesUsedStat(base::StrCat({kTimesPasswordUsed, kUserCreatedSuffix, - custom_passphrase_suffix}), - times_used); + LogTimesUsedStat( + base::StrCat({kPasswordManager, store_suffix, + kTimesPasswordUsedSuffix, kUserCreatedSuffix, + custom_passphrase_suffix}), + times_used); } - LogTimesUsedStat(base::StrCat({kTimesPasswordUsed, kOverallSuffix, - custom_passphrase_suffix}), - times_used); + LogTimesUsedStat( + base::StrCat({kPasswordManager, store_suffix, kTimesPasswordUsedSuffix, + kOverallSuffix, custom_passphrase_suffix}), + times_used); } } @@ -1074,6 +1083,7 @@ TRACE_EVENT0("passwords", "LoginDatabase::ReportMetrics"); ReportNumberOfAccountsMetrics(custom_passphrase_sync_enabled); + RecordTimesPasswordUsedMetrics(custom_passphrase_sync_enabled); // TODO(crbug.com/1063852): For now, don't record the remaining metrics for // the account store, so as to not break the existing profile store metrics. @@ -1082,7 +1092,6 @@ if (is_account_store_.value()) return; - RecordTimesPasswordUsedMetrics(custom_passphrase_sync_enabled); ReportSyncingAccountStateMetrics(sync_username); ReportEmptyUsernamesMetrics(); ReportLoginsWithSchemesMetrics();
diff --git a/components/password_manager/core/browser/login_database.h b/components/password_manager/core/browser/login_database.h index a5530a9..f6f510bb 100644 --- a/components/password_manager/core/browser/login_database.h +++ b/components/password_manager/core/browser/login_database.h
@@ -231,6 +231,10 @@ std::string GetEncryptedPasswordById(int id) const; #endif + // Returns a suffix (infix, really) to be used in histogram names to + // differentiate the profile store from the account store. + base::StringPiece GetMetricsSuffixForStore() const; + void ReportNumberOfAccountsMetrics(bool custom_passphrase_sync_enabled); void RecordTimesPasswordUsedMetrics(bool custom_passphrase_sync_enabled); void ReportSyncingAccountStateMetrics(const std::string& sync_username);
diff --git a/components/printing/browser/BUILD.gn b/components/printing/browser/BUILD.gn index f6958cd..e25da9d 100644 --- a/components/printing/browser/BUILD.gn +++ b/components/printing/browser/BUILD.gn
@@ -32,8 +32,6 @@ static_library("browser") { sources = [ - "features.cc", - "features.h", "print_composite_client.cc", "print_composite_client.h", "print_manager.cc",
diff --git a/components/printing/browser/features.cc b/components/printing/browser/features.cc deleted file mode 100644 index 501987b..0000000 --- a/components/printing/browser/features.cc +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2018 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 "components/printing/browser/features.h" - -namespace printing { -namespace features { - -#if defined(OS_MACOSX) -const base::Feature kEnableCustomMacPaperSizes{ - "EnableCustomMacPaperSizes", base::FEATURE_DISABLED_BY_DEFAULT}; -#endif - -} // namespace features -} // namespace printing
diff --git a/components/printing/browser/features.h b/components/printing/browser/features.h deleted file mode 100644 index 8d113ef2..0000000 --- a/components/printing/browser/features.h +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2018 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 COMPONENTS_PRINTING_BROWSER_FEATURES_H_ -#define COMPONENTS_PRINTING_BROWSER_FEATURES_H_ - -#include "base/feature_list.h" -#include "build/build_config.h" - -namespace printing { -namespace features { - -#if defined(OS_MACOSX) -extern const base::Feature kEnableCustomMacPaperSizes; -#endif - -} // namespace features -} // namespace printing - -#endif // COMPONENTS_PRINTING_BROWSER_FEATURES_H_
diff --git a/components/query_tiles/internal/init_aware_tile_service.cc b/components/query_tiles/internal/init_aware_tile_service.cc index c70ff75..3bb1a0b 100644 --- a/components/query_tiles/internal/init_aware_tile_service.cc +++ b/components/query_tiles/internal/init_aware_tile_service.cc
@@ -66,9 +66,11 @@ } void InitAwareTileService::StartFetchForTiles( + bool is_from_reduced_mode, BackgroundTaskFinishedCallback callback) { if (IsReady()) { - tile_service_->StartFetchForTiles(std::move(callback)); + tile_service_->StartFetchForTiles(is_from_reduced_mode, + std::move(callback)); return; } @@ -81,7 +83,7 @@ MaybeCacheApiCall(base::BindOnce(&InitAwareTileService::StartFetchForTiles, weak_ptr_factory_.GetWeakPtr(), - std::move(callback))); + is_from_reduced_mode, std::move(callback))); } void InitAwareTileService::MaybeCacheApiCall(base::OnceClosure api_call) {
diff --git a/components/query_tiles/internal/init_aware_tile_service.h b/components/query_tiles/internal/init_aware_tile_service.h index 7db4562..beffa71 100644 --- a/components/query_tiles/internal/init_aware_tile_service.h +++ b/components/query_tiles/internal/init_aware_tile_service.h
@@ -29,7 +29,8 @@ // TileService implementation. void GetQueryTiles(GetTilesCallback callback) override; void GetTile(const std::string& tile_id, TileCallback callback) override; - void StartFetchForTiles(BackgroundTaskFinishedCallback callback) override; + void StartFetchForTiles(bool is_from_reduced_mode, + BackgroundTaskFinishedCallback callback) override; void OnTileServiceInitialized(bool success); void MaybeCacheApiCall(base::OnceClosure api_call);
diff --git a/components/query_tiles/internal/init_aware_tile_service_unittest.cc b/components/query_tiles/internal/init_aware_tile_service_unittest.cc index 1691fdf..2821b777 100644 --- a/components/query_tiles/internal/init_aware_tile_service_unittest.cc +++ b/components/query_tiles/internal/init_aware_tile_service_unittest.cc
@@ -40,7 +40,7 @@ MOCK_METHOD(void, GetTile, (const std::string&, TileCallback), (override)); MOCK_METHOD(void, StartFetchForTiles, - (BackgroundTaskFinishedCallback), + (bool, BackgroundTaskFinishedCallback), (override)); // Callback stubs. @@ -73,10 +73,11 @@ .WillByDefault(Invoke([](const std::string&, TileCallback callback) { std::move(callback).Run(Tile()); })); - ON_CALL(*mock_service_, StartFetchForTiles(_)) - .WillByDefault(Invoke([](BackgroundTaskFinishedCallback callback) { - std::move(callback).Run(true); - })); + ON_CALL(*mock_service_, StartFetchForTiles(_, _)) + .WillByDefault( + Invoke([](bool, BackgroundTaskFinishedCallback callback) { + std::move(callback).Run(true); + })); } protected: @@ -112,7 +113,8 @@ auto callback = base::BindOnce( &MockInitializableTileService::BackgroundTaskFinishedCallbackStub, base::Unretained(mock_service_)); - init_aware_service()->StartFetchForTiles(std::move(callback)); + init_aware_service()->StartFetchForTiles(false /*is_from_reduced_mode*/, + std::move(callback)); } void RunUntilIdle() { task_environment_.RunUntilIdle(); } @@ -130,7 +132,7 @@ InSequence sequence; EXPECT_CALL(*mock_service(), GetQueryTiles(_)); EXPECT_CALL(*mock_service(), GetTile(_, _)); - EXPECT_CALL(*mock_service(), StartFetchForTiles(_)); + EXPECT_CALL(*mock_service(), StartFetchForTiles(false, _)); } EXPECT_CALL(*mock_service(), GetTilesCallbackStub(TileList({Tile()}))); @@ -150,7 +152,7 @@ InSequence sequence; EXPECT_CALL(*mock_service(), GetQueryTiles(_)).Times(0); EXPECT_CALL(*mock_service(), GetTile(_, _)).Times(0); - EXPECT_CALL(*mock_service(), StartFetchForTiles(_)).Times(0); + EXPECT_CALL(*mock_service(), StartFetchForTiles(_, _)).Times(0); } EXPECT_CALL(*mock_service(), GetTilesCallbackStub(TileList())); @@ -169,7 +171,7 @@ InSequence sequence; EXPECT_CALL(*mock_service(), GetQueryTiles(_)); EXPECT_CALL(*mock_service(), GetTile(_, _)); - EXPECT_CALL(*mock_service(), StartFetchForTiles(_)); + EXPECT_CALL(*mock_service(), StartFetchForTiles(false, _)); } EXPECT_CALL(*mock_service(), GetTilesCallbackStub(TileList({Tile()}))); @@ -189,7 +191,7 @@ InSequence sequence; EXPECT_CALL(*mock_service(), GetQueryTiles(_)).Times(0); EXPECT_CALL(*mock_service(), GetTile(_, _)).Times(0); - EXPECT_CALL(*mock_service(), StartFetchForTiles(_)).Times(0); + EXPECT_CALL(*mock_service(), StartFetchForTiles(_, _)).Times(0); } EXPECT_CALL(*mock_service(), GetTilesCallbackStub(TileList()));
diff --git a/components/query_tiles/internal/tile_config.cc b/components/query_tiles/internal/tile_config.cc index d3c2f34..ab04523 100644 --- a/components/query_tiles/internal/tile_config.cc +++ b/components/query_tiles/internal/tile_config.cc
@@ -28,6 +28,8 @@ // Finch parameter key for expire duration in seconds. const char kIsUnmeteredNetworkRequiredKey[] = "is_unmetered_network_required"; +const char kImagePrefetchModeKey[] = "image_prefetch_mode"; + // Default expire duration. const int kDefaultExpireDurationInSeconds = 48 * 60 * 60; @@ -67,4 +69,18 @@ return base::TimeDelta::FromSeconds(time_in_seconds); } +// static +ImagePrefetchMode TileConfig::GetImagePrefetchMode() { + std::string image_prefetch_mode = base::GetFieldTrialParamValueByFeature( + features::kQueryTiles, kImagePrefetchModeKey); + if (image_prefetch_mode == "none") + return ImagePrefetchMode::kNone; + if (image_prefetch_mode == "top") + return ImagePrefetchMode::kTopLevel; + if (image_prefetch_mode == "all") + return ImagePrefetchMode::kAll; + + return ImagePrefetchMode::kTopLevel; +} + } // namespace upboarding
diff --git a/components/query_tiles/internal/tile_config.h b/components/query_tiles/internal/tile_config.h index dc8f1a3..cb017d70 100644 --- a/components/query_tiles/internal/tile_config.h +++ b/components/query_tiles/internal/tile_config.h
@@ -9,6 +9,7 @@ #include <string> #include "base/time/time.h" +#include "components/query_tiles/internal/tile_types.h" #include "url/gurl.h" namespace upboarding { @@ -28,6 +29,9 @@ // Finch parameter key for expire duration in seconds. extern const char kIsUnmeteredNetworkRequiredKey[]; +// Finch parameter key for image prefetch mode. +extern const char kImagePrefetchModeKey[]; + class TileConfig { public: // Gets the URL for the Query Tiles server. @@ -42,6 +46,10 @@ // Gets the maximum duration for holding current group's info and images. static base::TimeDelta GetExpireDuration(); + + // Gets the image prefetch mode to determine how many images will be + // prefetched in background task. + static ImagePrefetchMode GetImagePrefetchMode(); }; } // namespace upboarding
diff --git a/components/query_tiles/internal/tile_config_unittest.cc b/components/query_tiles/internal/tile_config_unittest.cc index 6dcdc5a6..ad4ca42 100644 --- a/components/query_tiles/internal/tile_config_unittest.cc +++ b/components/query_tiles/internal/tile_config_unittest.cc
@@ -10,6 +10,18 @@ namespace upboarding { +namespace { + +void TestImagePrefetchMode(std::map<std::string, std::string> params, + ImagePrefetchMode expected) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeatureWithParameters(features::kQueryTiles, + params); + EXPECT_EQ(TileConfig::GetImagePrefetchMode(), expected); +} + +} // namespace + // Test to verify Finch parameters for enabled experiment group is read // correctly. TEST(TileConfigTest, FinchConfigEnabled) { @@ -41,4 +53,19 @@ base::TimeDelta::FromSeconds(48 * 60 * 60)); } +// Test to verify ImagePrefetchMode can be parsed correctly from Finch +// parameters. +TEST(TileConfigTest, GetImagePrefetchMode) { + TestImagePrefetchMode({{kImagePrefetchModeKey, "none"}}, + ImagePrefetchMode::kNone); + TestImagePrefetchMode(std::map<std::string, std::string>(), + ImagePrefetchMode::kTopLevel); + TestImagePrefetchMode({{kImagePrefetchModeKey, ""}}, + ImagePrefetchMode::kTopLevel); + TestImagePrefetchMode({{kImagePrefetchModeKey, "top"}}, + ImagePrefetchMode::kTopLevel); + TestImagePrefetchMode({{kImagePrefetchModeKey, "all"}}, + ImagePrefetchMode::kAll); +} + } // namespace upboarding
diff --git a/components/query_tiles/internal/tile_service_impl.cc b/components/query_tiles/internal/tile_service_impl.cc index cd8bf1b..8999801 100644 --- a/components/query_tiles/internal/tile_service_impl.cc +++ b/components/query_tiles/internal/tile_service_impl.cc
@@ -71,6 +71,7 @@ FROM_HERE, base::BindOnce(&TileServiceImpl::StartFetchForTiles, weak_ptr_factory_.GetWeakPtr(), + false /*is_from_reduced_mode*/, base::BindOnce(&OnInstantFetchComplete)), base::TimeDelta::FromSeconds(2)); } @@ -106,6 +107,7 @@ } void TileServiceImpl::StartFetchForTiles( + bool is_from_reduced_mode, BackgroundTaskFinishedCallback task_finished_callback) { DCHECK(tile_fetcher_); tile_fetcher_->StartFetchForTiles(base::BindOnce(
diff --git a/components/query_tiles/internal/tile_service_impl.h b/components/query_tiles/internal/tile_service_impl.h index d6e53d3e..b83460e1 100644 --- a/components/query_tiles/internal/tile_service_impl.h +++ b/components/query_tiles/internal/tile_service_impl.h
@@ -46,7 +46,8 @@ void Initialize(SuccessCallback callback) override; void GetQueryTiles(GetTilesCallback callback) override; void GetTile(const std::string& tile_id, TileCallback callback) override; - void StartFetchForTiles(BackgroundTaskFinishedCallback callback) override; + void StartFetchForTiles(bool is_from_reduced_mode, + BackgroundTaskFinishedCallback callback) override; // Called when tile manager is initialized. void OnTileManagerInitialized(SuccessCallback callback,
diff --git a/components/query_tiles/internal/tile_types.h b/components/query_tiles/internal/tile_types.h index d49343d..7b92bb4 100644 --- a/components/query_tiles/internal/tile_types.h +++ b/components/query_tiles/internal/tile_types.h
@@ -31,6 +31,17 @@ kMaxValue = kInvalidGroup, }; +// Config to control how tile images are prefetched in background task. +enum class ImagePrefetchMode { + // No images will be prefetched. + kNone = 0, + // Only the top level images are prefetched. + kTopLevel = 1, + // All tile images are prefetched. + kAll = 2, + kMaxValue = kAll +}; + using SuccessCallback = base::OnceCallback<void(bool)>; #endif // COMPONENTS_QUERY_TILES_INTERNAL_TILE_TYPES_H_
diff --git a/components/query_tiles/test/fake_tile_service.cc b/components/query_tiles/test/fake_tile_service.cc index bfe1231..72d3adc8 100644 --- a/components/query_tiles/test/fake_tile_service.cc +++ b/components/query_tiles/test/fake_tile_service.cc
@@ -85,6 +85,7 @@ } void FakeTileService::StartFetchForTiles( + bool is_from_reduced_mode, BackgroundTaskFinishedCallback callback) {} } // namespace upboarding \ No newline at end of file
diff --git a/components/query_tiles/test/fake_tile_service.h b/components/query_tiles/test/fake_tile_service.h index 55c1df1c..f56e258 100644 --- a/components/query_tiles/test/fake_tile_service.h +++ b/components/query_tiles/test/fake_tile_service.h
@@ -27,7 +27,8 @@ // TileService implementation. void GetQueryTiles(GetTilesCallback callback) override; void GetTile(const std::string& tile_id, TileCallback callback) override; - void StartFetchForTiles(BackgroundTaskFinishedCallback callback) override; + void StartFetchForTiles(bool is_from_reduced_mode, + BackgroundTaskFinishedCallback callback) override; std::vector<std::unique_ptr<Tile>> tiles_; base::WeakPtrFactory<FakeTileService> weak_ptr_factory_{this};
diff --git a/components/query_tiles/tile_service.h b/components/query_tiles/tile_service.h index e37ae06e..42fe58d1 100644 --- a/components/query_tiles/tile_service.h +++ b/components/query_tiles/tile_service.h
@@ -37,7 +37,8 @@ virtual void GetTile(const std::string& tile_id, TileCallback callback) = 0; // Start fetch query tiles from server. - virtual void StartFetchForTiles(BackgroundTaskFinishedCallback callback) = 0; + virtual void StartFetchForTiles(bool is_from_reduced_mode, + BackgroundTaskFinishedCallback callback) = 0; TileService() = default; ~TileService() override = default;
diff --git a/components/update_client/request_sender.cc b/components/update_client/request_sender.cc index 47cac69..3f0ae03 100644 --- a/components/update_client/request_sender.cc +++ b/components/update_client/request_sender.cc
@@ -140,6 +140,7 @@ return; } + VLOG(2) << "Omaha send error: " << response_body; HandleSendError(error, retry_after_sec); }
diff --git a/components/viz/host/gpu_host_impl.cc b/components/viz/host/gpu_host_impl.cc index c1578a21..414ba48b 100644 --- a/components/viz/host/gpu_host_impl.cc +++ b/components/viz/host/gpu_host_impl.cc
@@ -476,16 +476,7 @@ TRACE_EVENT2("gpu", "GpuHostImpl::DidLoseContext", "reason", reason, "url", active_url.possibly_invalid_spec()); - if (!offscreen || active_url.is_empty()) { - // Assume that the loss of the compositor's or accelerated canvas' - // context is a serious event and blame the loss on all live - // offscreen contexts. This more robustly handles situations where - // the GPU process may not actually detect the context loss in the - // offscreen context. However, situations have been seen where the - // compositor's context can be lost due to driver bugs (as of this - // writing, on Android), so allow that possibility. - if (!dont_disable_webgl_when_compositor_context_lost_) - BlockLiveOffscreenContexts(); + if (active_url.is_empty()) { return; }
diff --git a/components/viz/service/gl/gpu_service_impl.cc b/components/viz/service/gl/gpu_service_impl.cc index 07040c15..5534701 100644 --- a/components/viz/service/gl/gpu_service_impl.cc +++ b/components/viz/service/gl/gpu_service_impl.cc
@@ -323,7 +323,7 @@ gpu_feature_info_for_hardware_gpu, const gpu::GpuExtraInfo& gpu_extra_info, gpu::VulkanImplementation* vulkan_implementation, - base::OnceCallback<void(bool /*immediately*/)> exit_callback) + base::OnceCallback<void(base::Optional<ExitCode>)> exit_callback) : main_runner_(base::ThreadTaskRunnerHandle::Get()), io_runner_(std::move(io_runner)), watchdog_thread_(std::move(watchdog_thread)), @@ -1115,7 +1115,11 @@ // For the unsandboxed GPU info collection process used for info collection, // if we exit immediately, then the reply message could be lost. That's why // the |exit_callback_| takes the boolean argument. - std::move(exit_callback_).Run(/*immediately=*/for_context_loss); + if (for_context_loss) + std::move(exit_callback_) + .Run(ExitCode::RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST); + else + std::move(exit_callback_).Run(base::nullopt); } gpu::Scheduler* GpuServiceImpl::GetGpuScheduler() {
diff --git a/components/viz/service/gl/gpu_service_impl.h b/components/viz/service/gl/gpu_service_impl.h index 28a415c..018be6ac 100644 --- a/components/viz/service/gl/gpu_service_impl.h +++ b/components/viz/service/gl/gpu_service_impl.h
@@ -73,23 +73,31 @@ class MetalContextProvider; class DawnContextProvider; +enum class ExitCode { + // Matches service_manager::ResultCode::RESULT_CODE_NORMAL_EXIT + RESULT_CODE_NORMAL_EXIT = 0, + // Matches chrome::ResultCode::RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST + RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST = 34, +}; + // This runs in the GPU process, and communicates with the gpu host (which is // the window server) over the mojom APIs. This is responsible for setting up // the connection to clients, allocating/free'ing gpu memory etc. class VIZ_SERVICE_EXPORT GpuServiceImpl : public gpu::GpuChannelManagerDelegate, public mojom::GpuService { public: - GpuServiceImpl(const gpu::GPUInfo& gpu_info, - std::unique_ptr<gpu::GpuWatchdogThread> watchdog, - scoped_refptr<base::SingleThreadTaskRunner> io_runner, - const gpu::GpuFeatureInfo& gpu_feature_info, - const gpu::GpuPreferences& gpu_preferences, - const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu, - const base::Optional<gpu::GpuFeatureInfo>& - gpu_feature_info_for_hardware_gpu, - const gpu::GpuExtraInfo& gpu_extra_info, - gpu::VulkanImplementation* vulkan_implementation, - base::OnceCallback<void(bool /*immediately*/)> exit_callback); + GpuServiceImpl( + const gpu::GPUInfo& gpu_info, + std::unique_ptr<gpu::GpuWatchdogThread> watchdog, + scoped_refptr<base::SingleThreadTaskRunner> io_runner, + const gpu::GpuFeatureInfo& gpu_feature_info, + const gpu::GpuPreferences& gpu_preferences, + const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu, + const base::Optional<gpu::GpuFeatureInfo>& + gpu_feature_info_for_hardware_gpu, + const gpu::GpuExtraInfo& gpu_extra_info, + gpu::VulkanImplementation* vulkan_implementation, + base::OnceCallback<void(base::Optional<ExitCode>)> exit_callback); ~GpuServiceImpl() override; @@ -392,7 +400,7 @@ base::WaitableEvent* shutdown_event_ = nullptr; // Callback that safely exits GPU process. - base::OnceCallback<void(bool)> exit_callback_; + base::OnceCallback<void(base::Optional<ExitCode>)> exit_callback_; base::AtomicFlag is_exiting_; // Used for performing hardware decode acceleration of images. This is shared
diff --git a/components/viz/service/main/viz_main_impl.cc b/components/viz/service/main/viz_main_impl.cc index 03e938a2..13c8e2a1 100644 --- a/components/viz/service/main/viz_main_impl.cc +++ b/components/viz/service/main/viz_main_impl.cc
@@ -16,7 +16,6 @@ #include "base/trace_event/memory_dump_manager.h" #include "build/build_config.h" #include "components/ui_devtools/buildflags.h" -#include "components/viz/service/gl/gpu_service_impl.h" #include "gpu/command_buffer/common/activity_flags.h" #include "gpu/config/gpu_finch_features.h" #include "gpu/ipc/service/gpu_init.h" @@ -265,12 +264,13 @@ return gpu_service_->share_group(); } -void VizMainImpl::ExitProcess(bool immediately) { +void VizMainImpl::ExitProcess(base::Optional<ExitCode> immediate_exit_code) { DCHECK(gpu_thread_task_runner_->BelongsToCurrentThread()); - if (!gpu_init_->gpu_info().in_process_gpu && immediately) { + if (!gpu_init_->gpu_info().in_process_gpu && immediate_exit_code) { // Atomically shut down GPU process to make it faster and simpler. - base::Process::TerminateCurrentProcessImmediately(/*exit_code=*/0); + base::Process::TerminateCurrentProcessImmediately( + static_cast<int>(immediate_exit_code.value())); return; }
diff --git a/components/viz/service/main/viz_main_impl.h b/components/viz/service/main/viz_main_impl.h index 7878f95..a0ab831 100644 --- a/components/viz/service/main/viz_main_impl.h +++ b/components/viz/service/main/viz_main_impl.h
@@ -46,7 +46,6 @@ } namespace viz { -class GpuServiceImpl; #if defined(OS_WIN) class InfoCollectionGpuServiceImpl; #endif @@ -141,8 +140,10 @@ return discardable_shared_memory_manager_.get(); } - // Cleanly exits the process. - void ExitProcess(bool immediately); + // Cleanly exits the process. If |immediate_exit_code| is base::nullopt, the + // process exits by shutting down the GPU main thread. Otherwise, the process + // is terminated immediately with the specified exit code. + void ExitProcess(base::Optional<ExitCode> immediate_exit_code); private: void CreateFrameSinkManagerInternal(mojom::FrameSinkManagerParamsPtr params);
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 1732842..223ae5e 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -884,6 +884,8 @@ "frame_host/clipboard_host_impl.cc", "frame_host/clipboard_host_impl.h", "frame_host/clipboard_host_impl_mac.mm", + "frame_host/cookie_utils.cc", + "frame_host/cookie_utils.h", "frame_host/cross_process_frame_connector.cc", "frame_host/cross_process_frame_connector.h", "frame_host/debug_urls.cc",
diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm index 2be9e1b3..bc6b73b3 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
@@ -152,71 +152,6 @@ SysNSStringToUTF16([NSString stringWithFormat:@"%@", value]))); } -NSArray* AllAttributesArray() { - static NSArray* all_attributes = [@[ - NSAccessibilityRoleDescriptionAttribute, - NSAccessibilityTitleAttribute, - NSAccessibilityValueAttribute, - NSAccessibilityMinValueAttribute, - NSAccessibilityMaxValueAttribute, - NSAccessibilityValueDescriptionAttribute, - NSAccessibilityDescriptionAttribute, - NSAccessibilityHelpAttribute, - @"AXInvalid", - NSAccessibilityDisclosingAttribute, - NSAccessibilityDisclosureLevelAttribute, - @"AXAccessKey", - @"AXARIAAtomic", - @"AXARIABusy", - @"AXARIAColumnCount", - @"AXARIAColumnIndex", - @"AXARIALive", - @"AXARIARelevant", - @"AXARIARowCount", - @"AXARIARowIndex", - @"AXARIASetSize", - @"AXARIAPosInSet", - @"AXAutocomplete", - @"AXAutocompleteValue", - @"AXBlockQuoteLevel", - NSAccessibilityColumnHeaderUIElementsAttribute, - NSAccessibilityColumnIndexRangeAttribute, - @"AXDOMIdentifier", - @"AXDropEffects", - @"AXEditableAncestor", - NSAccessibilityEnabledAttribute, - NSAccessibilityExpandedAttribute, - @"AXFocusableAncestor", - NSAccessibilityFocusedAttribute, - @"AXGrabbed", - NSAccessibilityHeaderAttribute, - @"AXHasPopup", - @"AXHasPopupValue", - @"AXHighestEditableAncestor", - NSAccessibilityIndexAttribute, - @"AXLanguage", - @"AXLoaded", - @"AXLoadingProcess", - NSAccessibilityNumberOfCharactersAttribute, - NSAccessibilitySortDirectionAttribute, - NSAccessibilityOrientationAttribute, - NSAccessibilityPlaceholderValueAttribute, - @"AXRequired", - NSAccessibilityRowHeaderUIElementsAttribute, - NSAccessibilityRowIndexRangeAttribute, - NSAccessibilitySelectedAttribute, - NSAccessibilitySelectedChildrenAttribute, - NSAccessibilityTitleUIElementAttribute, - NSAccessibilityURLAttribute, - NSAccessibilityVisibleCharacterRangeAttribute, - NSAccessibilityVisibleChildrenAttribute, - @"AXVisited", - @"AXLinkedUIElements" - ] retain]; - - return all_attributes; -} - } // namespace class AccessibilityTreeFormatterMac : public AccessibilityTreeFormatterBase { @@ -275,8 +210,8 @@ void AccessibilityTreeFormatterMac::AddDefaultFilters( std::vector<PropertyFilter>* property_filters) { static NSArray* default_attributes = [@[ - @"AXValueAutofill*", @"AXAutocomplete*", @"AXDescription=*", @"AXTitle=*", - @"AXTitleUIElement=*", @"AXHelp=*", @"AXValue=*" + @"AXAutocomplete*", @"AXDescription=*", @"AXTitle=*", @"AXTitleUIElement=*", + @"AXHelp=*", @"AXValue=*" ] retain]; for (NSString* attribute : default_attributes) { @@ -339,27 +274,13 @@ const BrowserAccessibilityCocoa* cocoa_node, base::DictionaryValue* dict) { BrowserAccessibility* node = [cocoa_node owner]; - dict->SetInteger("id", node->GetId()); + dict->SetString("id", base::NumberToString16(node->GetId())); - NSArray* supportedAttributes = [cocoa_node accessibilityAttributeNames]; - - string role = SysNSStringToUTF8( - [cocoa_node accessibilityAttributeValue:NSAccessibilityRoleAttribute]); - dict->SetString(SysNSStringToUTF8(NSAccessibilityRoleAttribute), role); - - NSString* subrole = - [cocoa_node accessibilityAttributeValue:NSAccessibilitySubroleAttribute]; - if (subrole != nil) { - dict->SetString(SysNSStringToUTF8(NSAccessibilitySubroleAttribute), - SysNSStringToUTF8(subrole)); - } - - for (NSString* requestedAttribute in AllAttributesArray()) { - if (![supportedAttributes containsObject:requestedAttribute]) - continue; - id value = [cocoa_node accessibilityAttributeValue:requestedAttribute]; + for (NSString* supportedAttribute in + [cocoa_node accessibilityAttributeNames]) { + id value = [cocoa_node accessibilityAttributeValue:supportedAttribute]; if (value != nil) { - dict->Set(SysNSStringToUTF8(requestedAttribute), PopulateObject(value)); + dict->Set(SysNSStringToUTF8(supportedAttribute), PopulateObject(value)); } } dict->Set(kPositionDictAttr, PopulatePosition(*node)); @@ -374,52 +295,59 @@ return error_value; base::string16 line; - int id_value; - dict.GetInteger("id", &id_value); - WriteAttribute(false, base::NumberToString16(id_value), &line); - string s_value; - dict.GetString(SysNSStringToUTF8(NSAccessibilityRoleAttribute), &s_value); - WriteAttribute(true, s_value, &line); - - string subroleAttribute = SysNSStringToUTF8(NSAccessibilitySubroleAttribute); - if (dict.GetString(subroleAttribute, &s_value)) { - WriteAttribute( - false, StringPrintf("%s=%s", subroleAttribute.c_str(), s_value.c_str()), - &line); + // AXRole and AXSubrole have own formatting and should be listed upfront. + std::string role_attr = SysNSStringToUTF8(NSAccessibilityRoleAttribute); + const std::string* value = dict.FindStringPath(role_attr); + if (value) { + WriteAttribute(true, *value, &line); + } + std::string subrole_attr = SysNSStringToUTF8(NSAccessibilitySubroleAttribute); + value = dict.FindStringPath(subrole_attr); + if (value) { + WriteAttribute(false, + StringPrintf("%s=%s", subrole_attr.c_str(), value->c_str()), + &line); } - for (NSString* requestedAttribute in AllAttributesArray()) { - string requestedAttributeUTF8 = SysNSStringToUTF8(requestedAttribute); - if (dict.GetString(requestedAttributeUTF8, &s_value)) { - WriteAttribute(false, - StringPrintf("%s='%s'", requestedAttributeUTF8.c_str(), - s_value.c_str()), - &line); + // Expose all other attributes. + for (auto item : dict.DictItems()) { + if (item.second.is_string()) { + if (item.first != role_attr && item.first != subrole_attr) { + WriteAttribute(false, + StringPrintf("%s='%s'", item.first.c_str(), + item.second.GetString().c_str()), + &line); + } continue; } - const base::Value* value; - if (dict.Get(requestedAttributeUTF8, &value)) { - std::string json_value; - base::JSONWriter::Write(*value, &json_value); - WriteAttribute(false, - StringPrintf("%s=%s", requestedAttributeUTF8.c_str(), - json_value.c_str()), - &line); + + // Special processing for position and size. + if (item.second.is_dict()) { + if (item.first == kPositionDictAttr) { + WriteAttribute(false, + FormatCoordinates( + base::Value::AsDictionaryValue(item.second), + kPositionDictAttr, kXCoordDictAttr, kYCoordDictAttr), + &line); + continue; + } + if (item.first == kSizeDictAttr) { + WriteAttribute( + false, + FormatCoordinates(base::Value::AsDictionaryValue(item.second), + kSizeDictAttr, kWidthDictAttr, kHeightDictAttr), + &line); + continue; + } } - } - const base::DictionaryValue* d_value = NULL; - if (dict.GetDictionary(kPositionDictAttr, &d_value)) { - WriteAttribute(false, - FormatCoordinates(*d_value, kPositionDictAttr, - kXCoordDictAttr, kYCoordDictAttr), - &line); - } - if (dict.GetDictionary(kSizeDictAttr, &d_value)) { - WriteAttribute(false, - FormatCoordinates(*d_value, kSizeDictAttr, kWidthDictAttr, - kHeightDictAttr), - &line); + + // Write everything else as JSON. + std::string json_value; + base::JSONWriter::Write(item.second, &json_value); + WriteAttribute( + false, StringPrintf("%s=%s", item.first.c_str(), json_value.c_str()), + &line); } return line;
diff --git a/content/browser/browser_interface_binders.cc b/content/browser/browser_interface_binders.cc index d830102..ccaa51e 100644 --- a/content/browser/browser_interface_binders.cc +++ b/content/browser/browser_interface_binders.cc
@@ -631,7 +631,7 @@ base::Unretained(host))); map->Add<media::mojom::ImageCapture>( - base::BindRepeating(&ImageCaptureImpl::Create)); + base::BindRepeating(&ImageCaptureImpl::Create, base::Unretained(host))); map->Add<media::mojom::InterfaceFactory>(base::BindRepeating( &RenderFrameHostImpl::BindMediaInterfaceFactoryReceiver,
diff --git a/content/browser/conversions/impression_declaration_browsertest.cc b/content/browser/conversions/impression_declaration_browsertest.cc index 33f86ca..0362c6a 100644 --- a/content/browser/conversions/impression_declaration_browsertest.cc +++ b/content/browser/conversions/impression_declaration_browsertest.cc
@@ -165,7 +165,7 @@ WebContents* initial_web_contents = web_contents(); ShellAddedObserver new_shell_observer; - GURL remote_url = https_server()->GetURL("c.test", "/title.html"); + GURL remote_url = https_server()->GetURL("c.test", "/title1.html"); EXPECT_TRUE(ExecJs(web_contents(), JsReplace("window.open($1, 'target');", remote_url)));
diff --git a/content/browser/frame_host/back_forward_cache_impl.cc b/content/browser/frame_host/back_forward_cache_impl.cc index 8cddd1253..e2355271 100644 --- a/content/browser/frame_host/back_forward_cache_impl.cc +++ b/content/browser/frame_host/back_forward_cache_impl.cc
@@ -414,7 +414,7 @@ } #endif - entry->render_frame_host->EnterBackForwardCache(); + entry->render_frame_host->DidEnterBackForwardCache(); entries_.push_front(std::move(entry)); size_t size_limit = cache_size_limit_for_testing_ @@ -459,7 +459,7 @@ std::unique_ptr<Entry> entry = std::move(*matching_entry); entries_.erase(matching_entry); RequestRecordTimeToVisible(entry->render_frame_host.get(), navigation_start); - entry->render_frame_host->LeaveBackForwardCache(); + entry->render_frame_host->WillLeaveBackForwardCache(); RestoreBrowserControlsState(entry->render_frame_host.get());
diff --git a/content/browser/frame_host/cookie_utils.cc b/content/browser/frame_host/cookie_utils.cc new file mode 100644 index 0000000..c854504 --- /dev/null +++ b/content/browser/frame_host/cookie_utils.cc
@@ -0,0 +1,161 @@ +// Copyright 2020 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 "content/browser/frame_host/cookie_utils.h" + +#include "content/browser/devtools/devtools_instrumentation.h" +#include "content/browser/frame_host/frame_tree_node.h" +#include "content/browser/frame_host/render_frame_host_impl.h" +#include "content/public/browser/browser_context.h" +#include "content/public/browser/cookie_access_details.h" +#include "content/public/common/content_client.h" +#include "content/public/common/content_features.h" +#include "net/cookies/cookie_util.h" +#include "services/metrics/public/cpp/ukm_builders.h" + +namespace content { + +namespace { + +void RecordContextDowngradeUKM( + RenderFrameHost* rfh, + CookieAccessDetails::Type access_type, + const net::CanonicalCookie::CookieInclusionStatus& status, + const GURL& url) { + DCHECK(rfh); + ukm::SourceId source_id = rfh->GetPageUkmSourceId(); + + if (access_type == CookieAccessDetails::Type::kRead) { + ukm::builders::SchemefulSameSiteContextDowngrade(source_id) + .SetRequestPerCookie(status.GetBreakingDowngradeMetricsEnumValue(url)) + .Record(ukm::UkmRecorder::Get()); + } else { + DCHECK(access_type == CookieAccessDetails::Type::kChange); + ukm::builders::SchemefulSameSiteContextDowngrade(source_id) + .SetResponsePerCookie(status.GetBreakingDowngradeMetricsEnumValue(url)) + .Record(ukm::UkmRecorder::Get()); + } +} + +} // namespace + +void SplitCookiesIntoAllowedAndBlocked( + const network::mojom::CookieAccessDetailsPtr& cookie_details, + CookieAccessDetails* allowed, + CookieAccessDetails* blocked) { + *allowed = + CookieAccessDetails({cookie_details->type, + cookie_details->url, + cookie_details->site_for_cookies.RepresentativeUrl(), + {}, + /* blocked_by_policy=*/false}); + *blocked = + CookieAccessDetails({cookie_details->type, + cookie_details->url, + cookie_details->site_for_cookies.RepresentativeUrl(), + {}, + /* blocked_by_policy=*/true}); + + for (auto& cookie_and_status : cookie_details->cookie_list) { + if (cookie_and_status.status.HasExclusionReason( + net::CanonicalCookie::CookieInclusionStatus:: + EXCLUDE_USER_PREFERENCES)) { + blocked->cookie_list.push_back(std::move(cookie_and_status.cookie)); + } else if (cookie_and_status.status.IsInclude()) { + allowed->cookie_list.push_back(std::move(cookie_and_status.cookie)); + } + } +} + +void EmitSameSiteCookiesDeprecationWarning( + RenderFrameHostImpl* rfh, + const network::mojom::CookieAccessDetailsPtr& cookie_details) { + RenderFrameHostImpl* root_frame_host = rfh->GetMainFrame(); + + if (!root_frame_host->IsCurrent()) + return; + + bool samesite_treated_as_lax_cookies = false; + bool samesite_none_insecure_cookies = false; + + bool messages_disabled_by_cmdline = + base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine( + features::kCookieDeprecationMessages.name, + base::FeatureList::OVERRIDE_DISABLE_FEATURE); + bool emit_messages = + !messages_disabled_by_cmdline && + (net::cookie_util::IsSameSiteByDefaultCookiesEnabled() || + net::cookie_util::IsCookiesWithoutSameSiteMustBeSecureEnabled() || + base::FeatureList::IsEnabled(features::kCookieDeprecationMessages)); + + bool breaking_context_downgrade = false; + + for (const net::CookieWithStatus& excluded_cookie : + cookie_details->cookie_list) { + std::string cookie_url = + net::cookie_util::CookieOriginToURL(excluded_cookie.cookie.Domain(), + excluded_cookie.cookie.IsSecure()) + .possibly_invalid_spec(); + + if (excluded_cookie.status.ShouldWarn()) { + if (excluded_cookie.status.HasWarningReason( + net::CanonicalCookie::CookieInclusionStatus:: + WARN_SAMESITE_UNSPECIFIED_CROSS_SITE_CONTEXT)) { + samesite_treated_as_lax_cookies = true; + } + + if (excluded_cookie.status.HasWarningReason( + net::CanonicalCookie::CookieInclusionStatus:: + WARN_SAMESITE_UNSPECIFIED_LAX_ALLOW_UNSAFE)) { + samesite_treated_as_lax_cookies = true; + } + + if (excluded_cookie.status.HasWarningReason( + net::CanonicalCookie::CookieInclusionStatus:: + WARN_SAMESITE_NONE_INSECURE)) { + samesite_none_insecure_cookies = true; + } + devtools_instrumentation::ReportSameSiteCookieIssue( + root_frame_host, excluded_cookie, cookie_details->url, + cookie_details->site_for_cookies, + cookie_details->type == CookieAccessDetails::Type::kRead + ? blink::mojom::SameSiteCookieOperation::ReadCookie + : blink::mojom::SameSiteCookieOperation::SetCookie, + cookie_details->devtools_request_id); + } + if (emit_messages) { + root_frame_host->AddSameSiteCookieDeprecationMessage( + cookie_url, excluded_cookie.status, + net::cookie_util::IsSameSiteByDefaultCookiesEnabled(), + net::cookie_util::IsCookiesWithoutSameSiteMustBeSecureEnabled()); + } + + breaking_context_downgrade = breaking_context_downgrade || + excluded_cookie.status.HasDowngradeWarning(); + + if (excluded_cookie.status.ShouldRecordDowngradeMetrics()) { + RecordContextDowngradeUKM(rfh, cookie_details->type, + excluded_cookie.status, cookie_details->url); + } + } + + // TODO(crbug.com/990439): Do we need separate UseCounter metrics for + // Lax-allow-unsafe? We already have histograms in CanonicalCookie. + if (samesite_treated_as_lax_cookies) { + GetContentClient()->browser()->LogWebFeatureForCurrentPage( + rfh, blink::mojom::WebFeature::kCookieNoSameSite); + } + + if (samesite_none_insecure_cookies) { + GetContentClient()->browser()->LogWebFeatureForCurrentPage( + rfh, blink::mojom::WebFeature::kCookieInsecureAndSameSiteNone); + } + + if (breaking_context_downgrade) { + GetContentClient()->browser()->LogWebFeatureForCurrentPage( + rfh, blink::mojom::WebFeature::kSchemefulSameSiteContextDowngrade); + } +} + +} // namespace content
diff --git a/content/browser/frame_host/cookie_utils.h b/content/browser/frame_host/cookie_utils.h new file mode 100644 index 0000000..09042230 --- /dev/null +++ b/content/browser/frame_host/cookie_utils.h
@@ -0,0 +1,27 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_FRAME_HOST_COOKIE_UTILS_H_ +#define CONTENT_BROWSER_FRAME_HOST_COOKIE_UTILS_H_ + +#include "services/network/public/mojom/cookie_access_observer.mojom.h" + +namespace content { + +class RenderFrameHostImpl; +struct CookieAccessDetails; + +void SplitCookiesIntoAllowedAndBlocked( + const network::mojom::CookieAccessDetailsPtr& cookie_details, + CookieAccessDetails* allowed, + CookieAccessDetails* blocked); + +// TODO(crbug.com/977040): Remove when no longer needed. +void EmitSameSiteCookiesDeprecationWarning( + RenderFrameHostImpl* rfh, + const network::mojom::CookieAccessDetailsPtr& cookie_details); + +} // namespace content + +#endif // CONTENT_BROWSER_FRAME_HOST_COOKIE_UTILS_H_
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc index f838189..005d9dc 100644 --- a/content/browser/frame_host/navigation_controller_impl.cc +++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -2988,8 +2988,7 @@ DiscardNonCommittedEntries(); return; } - frame_tree_node->render_manager() - ->InitializeRenderFrameForDebugURLIfNecessary(); + frame_tree_node->render_manager()->InitializeRenderFrameForImmediateUse(); } frame_tree_node->current_frame_host()->HandleRendererDebugURL(url); }
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc index 6ae6698..df0eef5 100644 --- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -888,7 +888,7 @@ // Don't pay attention to pending delete RenderFrameHosts in the main frame, // which might happen in a race if a cross-process navigation happens // quickly. - if (!rfh->is_active()) { + if (rfh->IsPendingDeletion()) { DLOG(INFO) << "Skipping pending delete RFH: " << rfh->GetSiteInstance()->GetSiteURL(); return; @@ -8655,7 +8655,7 @@ EXPECT_EQ("\"done\"", message); // |frame| is now pending deletion. - EXPECT_FALSE(static_cast<RenderFrameHostImpl*>(frame)->is_active()); + EXPECT_TRUE(static_cast<RenderFrameHostImpl*>(frame)->IsPendingDeletion()); std::string error_html = "Error page"; DidStartNavigationObserver did_start_navigation_observer(
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index 05ac3a6..f0535102 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc
@@ -32,6 +32,7 @@ #include "content/browser/client_hints/client_hints.h" #include "content/browser/devtools/devtools_instrumentation.h" #include "content/browser/download/download_manager_impl.h" +#include "content/browser/frame_host/cookie_utils.h" #include "content/browser/frame_host/debug_urls.h" #include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/frame_tree_node.h" @@ -2551,7 +2552,8 @@ std::move(cors_exempt_headers)), std::move(navigation_ui_data), service_worker_handle_.get(), appcache_handle_.get(), std::move(prefetched_signed_exchange_cache_), - this, IsServedFromBackForwardCache(), std::move(interceptor)); + this, IsServedFromBackForwardCache(), CreateCookieAccessObserver(), + std::move(interceptor)); DCHECK(!render_frame_host_); } @@ -4348,4 +4350,38 @@ frame_tree_node_->navigator()->GetController()); } +mojo::PendingRemote<network::mojom::CookieAccessObserver> +NavigationRequest::CreateCookieAccessObserver() { + mojo::PendingRemote<network::mojom::CookieAccessObserver> remote; + cookie_observers_.Add(this, remote.InitWithNewPipeAndPassReceiver()); + return remote; +} + +void NavigationRequest::OnCookiesAccessed( + network::mojom::CookieAccessDetailsPtr details) { + // TODO(721329): We should not send information to the current frame about + // (potentially unrelated) ongoing navigation, but at the moment we don't + // have another way to add messages to DevTools console. + EmitSameSiteCookiesDeprecationWarning(frame_tree_node()->current_frame_host(), + details); + + CookieAccessDetails allowed; + CookieAccessDetails blocked; + SplitCookiesIntoAllowedAndBlocked(details, &allowed, &blocked); + if (!allowed.cookie_list.empty()) + GetDelegate()->OnCookiesAccessed(this, allowed); + if (!blocked.cookie_list.empty()) + GetDelegate()->OnCookiesAccessed(this, blocked); +} + +void NavigationRequest::Clone( + mojo::PendingReceiver<network::mojom::CookieAccessObserver> observer) { + cookie_observers_.Add(this, std::move(observer)); +} + +std::vector<mojo::PendingReceiver<network::mojom::CookieAccessObserver>> +NavigationRequest::TakeCookieObservers() { + return cookie_observers_.TakeReceivers(); +} + } // namespace content
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h index 5601243..875bf29d 100644 --- a/content/browser/frame_host/navigation_request.h +++ b/content/browser/frame_host/navigation_request.h
@@ -83,7 +83,8 @@ : public NavigationHandle, public NavigationURLLoaderDelegate, public NavigationThrottleRunner::Delegate, - private RenderProcessHostObserver { + private RenderProcessHostObserver, + private network::mojom::CookieAccessObserver { public: // Keeps track of the various stages of a NavigationRequest. enum NavigationState { @@ -606,6 +607,12 @@ void OnServiceWorkerAccessed(const GURL& scope, AllowServiceWorkerResult allowed); + // Take all cookie observers associated with this navigation. + // Typically this is called when navigation commits to move these observers to + // the committed document. + std::vector<mojo::PendingReceiver<network::mojom::CookieAccessObserver>> + TakeCookieObservers() WARN_UNUSED_RESULT; + private: friend class NavigationRequestTest; @@ -935,6 +942,15 @@ // Returns the user-agent override, or an empty string if one isn't set. std::string GetUserAgentOverride(); + mojo::PendingRemote<network::mojom::CookieAccessObserver> + CreateCookieAccessObserver(); + + // network::mojom::CookieAccessObserver: + void OnCookiesAccessed( + network::mojom::CookieAccessDetailsPtr details) override; + void Clone(mojo::PendingReceiver<network::mojom::CookieAccessObserver> + observer) override; + // Convenience function to return the NavigationControllerImpl this // NavigationRequest is in. NavigationControllerImpl* GetNavigationController(); @@ -1307,6 +1323,10 @@ // reload is not necessary. bool ua_change_requires_reload_ = true; + // Observers listening to cookie access notifications for the network requests + // made by this navigation. + mojo::ReceiverSet<network::mojom::CookieAccessObserver> cookie_observers_; + base::WeakPtrFactory<NavigationRequest> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
diff --git a/content/browser/frame_host/navigator_delegate.h b/content/browser/frame_host/navigator_delegate.h index b425752e..69e8c8a7 100644 --- a/content/browser/frame_host/navigator_delegate.h +++ b/content/browser/frame_host/navigator_delegate.h
@@ -7,6 +7,7 @@ #include "base/strings/string16.h" #include "content/public/browser/allow_service_worker_result.h" +#include "content/public/browser/cookie_access_details.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_throttle.h" @@ -135,6 +136,10 @@ virtual void OnServiceWorkerAccessed(NavigationHandle* navigation, const GURL& scope, AllowServiceWorkerResult allowed) {} + // Called when a network request issued by this navigation set or read a + // cookie. + virtual void OnCookiesAccessed(NavigationHandle* navigation, + const CookieAccessDetails& details) {} // Does a global walk of the session history and all committed/pending-commit // origins, and registers origins that match |origin| to their respective
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc index 3928a64..27a7fb9 100644 --- a/content/browser/frame_host/navigator_impl_unittest.cc +++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -99,7 +99,9 @@ // Commit the navigation. navigation->Commit(); - EXPECT_TRUE(main_test_rfh()->is_active()); + EXPECT_TRUE(main_test_rfh()->IsCurrent()); + EXPECT_EQ(main_test_rfh()->lifecycle_state(), + RenderFrameHostImpl::LifecycleState::kActive); if (AreDefaultSiteInstancesEnabled()) { EXPECT_TRUE(main_test_rfh()->GetSiteInstance()->IsDefaultSiteInstance()); } else { @@ -156,7 +158,7 @@ // Commit the navigation. navigation->Commit(); - EXPECT_TRUE(main_test_rfh()->is_active()); + EXPECT_TRUE(main_test_rfh()->IsCurrent()); if (AreDefaultSiteInstancesEnabled()) { EXPECT_TRUE(main_test_rfh()->GetSiteInstance()->IsDefaultSiteInstance()); } else { @@ -210,7 +212,7 @@ // Commit the navigation. navigation->Commit(); - EXPECT_TRUE(main_test_rfh()->is_active()); + EXPECT_TRUE(main_test_rfh()->IsCurrent()); EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL()); EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
diff --git a/content/browser/frame_host/render_frame_host_delegate.h b/content/browser/frame_host/render_frame_host_delegate.h index 0f95d9a2..f20bbc7 100644 --- a/content/browser/frame_host/render_frame_host_delegate.h +++ b/content/browser/frame_host/render_frame_host_delegate.h
@@ -611,6 +611,9 @@ // of foo() here. virtual void DomOperationResponse(const std::string& json_string) {} + virtual void OnCookiesAccessed(RenderFrameHostImpl* render_frame_host, + const CookieAccessDetails& details) {} + protected: virtual ~RenderFrameHostDelegate() = default; };
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index ca5e9b2..f36ca2f 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -52,6 +52,7 @@ #include "content/browser/file_system/file_system_manager_impl.h" #include "content/browser/file_system/file_system_url_loader_factory.h" #include "content/browser/frame_host/back_forward_cache_impl.h" +#include "content/browser/frame_host/cookie_utils.h" #include "content/browser/frame_host/cross_process_frame_connector.h" #include "content/browser/frame_host/debug_urls.h" #include "content/browser/frame_host/file_chooser_impl.h" @@ -193,6 +194,7 @@ #include "services/network/public/cpp/is_potentially_trustworthy.h" #include "services/network/public/cpp/web_sandbox_flags.h" #include "services/network/public/cpp/wrapper_shared_url_loader_factory.h" +#include "services/network/public/mojom/cookie_access_observer.mojom.h" #include "services/network/public/mojom/network_service.mojom.h" #include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h" #include "services/service_manager/public/cpp/connector.h" @@ -1075,7 +1077,7 @@ } // The current frame went into the BackForwardCache. -void RenderFrameHostImpl::EnterBackForwardCache() { +void RenderFrameHostImpl::DidEnterBackForwardCache() { TRACE_EVENT0("navigation", "RenderFrameHostImpl::EnterBackForwardCache"); DCHECK(IsBackForwardCacheEnabled()); DCHECK_EQ(lifecycle_state_, LifecycleState::kActive); @@ -1085,7 +1087,7 @@ if (!GetParent()) StartBackForwardCacheEvictionTimer(); for (auto& child : children_) - child->current_frame_host()->EnterBackForwardCache(); + child->current_frame_host()->DidEnterBackForwardCache(); if (service_worker_container_hosts_.empty()) return; @@ -1105,15 +1107,14 @@ } // The frame as been restored from the BackForwardCache. -void RenderFrameHostImpl::LeaveBackForwardCache() { +void RenderFrameHostImpl::WillLeaveBackForwardCache() { TRACE_EVENT0("navigation", "RenderFrameHostImpl::LeaveBackForwardCache"); DCHECK(IsBackForwardCacheEnabled()); DCHECK_EQ(lifecycle_state_, LifecycleState::kInBackForwardCache); - SetLifecycleState(LifecycleState::kActive); if (back_forward_cache_eviction_timer_.IsRunning()) back_forward_cache_eviction_timer_.Stop(); for (auto& child : children_) - child->current_frame_host()->LeaveBackForwardCache(); + child->current_frame_host()->WillLeaveBackForwardCache(); if (service_worker_container_hosts_.empty()) return; @@ -7138,12 +7139,13 @@ void RenderFrameHostImpl::BindRestrictedCookieManager( mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver) { - GetProcess()->GetStoragePartition()->CreateRestrictedCookieManager( - network::mojom::RestrictedCookieManagerRole::SCRIPT, - GetLastCommittedOrigin(), isolation_info_.site_for_cookies(), - ComputeTopFrameOrigin(GetLastCommittedOrigin()), - /* is_service_worker = */ false, GetProcess()->GetID(), routing_id(), - std::move(receiver)); + static_cast<StoragePartitionImpl*>(GetProcess()->GetStoragePartition()) + ->CreateRestrictedCookieManager( + network::mojom::RestrictedCookieManagerRole::SCRIPT, + GetLastCommittedOrigin(), isolation_info_.site_for_cookies(), + ComputeTopFrameOrigin(GetLastCommittedOrigin()), + /* is_service_worker = */ false, GetProcess()->GetID(), routing_id(), + std::move(receiver), CreateCookieAccessObserver()); } void RenderFrameHostImpl::BindHasTrustTokensAnswerer( @@ -7758,14 +7760,18 @@ } last_committed_cross_document_navigation_id_ = navigation_request->GetNavigationId(); - } - // Clear all the user data associated with the non speculative RenderFrameHost - // when the navigation is a cross-document navigation not served from the - // back-forward cache. - if (!is_same_document_navigation && - !navigation_request->IsServedFromBackForwardCache() && IsCurrent()) { - document_associated_data_.ClearAllUserData(); + if (IsCurrent()) { + // Clear all the user data associated with the non speculative + // RenderFrameHost when the navigation is a cross-document navigation not + // served from the back-forward cache. + document_associated_data_.ClearAllUserData(); + } + + // Continue observing the events for the committed navigation. + for (auto& receiver : navigation_request->TakeCookieObservers()) { + cookie_observers_.Add(this, std::move(receiver)); + } } // If we still have a PeakGpuMemoryTracker, then the loading it was observing @@ -8720,6 +8726,17 @@ } void RenderFrameHostImpl::SetLifecycleStateToActive() { + // If the RenderFrameHost is restored from BackForwardCache, update states of + // all the children to kActive. This is called from + // RenderFrameHostManager::SetRenderFrameHost which happens after commit. + if (IsInBackForwardCache()) { + for (auto& child : children_) { + DCHECK_EQ(child->current_frame_host()->lifecycle_state_, + LifecycleState::kInBackForwardCache); + child->current_frame_host()->SetLifecycleStateToActive(); + } + } + SetLifecycleState(LifecycleState::kActive); } @@ -8757,4 +8774,29 @@ GetAssociatedLocalFrame()->BindReportingObserver(std::move(receiver)); } +mojo::PendingRemote<network::mojom::CookieAccessObserver> +RenderFrameHostImpl::CreateCookieAccessObserver() { + mojo::PendingRemote<network::mojom::CookieAccessObserver> remote; + cookie_observers_.Add(this, remote.InitWithNewPipeAndPassReceiver()); + return remote; +} + +void RenderFrameHostImpl::Clone( + mojo::PendingReceiver<network::mojom::CookieAccessObserver> observer) { + cookie_observers_.Add(this, std::move(observer)); +} + +void RenderFrameHostImpl::OnCookiesAccessed( + network::mojom::CookieAccessDetailsPtr details) { + EmitSameSiteCookiesDeprecationWarning(this, details); + + CookieAccessDetails allowed; + CookieAccessDetails blocked; + SplitCookiesIntoAllowedAndBlocked(details, &allowed, &blocked); + if (!allowed.cookie_list.empty()) + delegate_->OnCookiesAccessed(this, allowed); + if (!blocked.cookie_list.empty()) + delegate_->OnCookiesAccessed(this, blocked); +} + } // namespace content
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index 9cdade0..94e7342 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -241,7 +241,8 @@ public blink::mojom::LocalFrameHost, public network::CSPContext, public blink::mojom::LocalMainFrameHost, - public ui::AXActionHandler { + public ui::AXActionHandler, + public network::mojom::CookieAccessObserver { public: using AXTreeSnapshotCallback = base::OnceCallback<void(const ui::AXTreeUpdate&)>; @@ -1068,11 +1069,11 @@ // Called when this RenderFrameHostImpl enters the BackForwardCache, the // document enters in a "Frozen" state where no Javascript can run. - void EnterBackForwardCache(); + void DidEnterBackForwardCache(); // Called when this RenderFrameHostImpl leaves the BackForwardCache. This // occurs immediately before a restored document is committed. - void LeaveBackForwardCache(); + void WillLeaveBackForwardCache(); // Take ownership over the DidCommitProvisionalLoad_Params that // were last used to commit this navigation. @@ -1596,6 +1597,13 @@ RenderFrameHostImpl* FindAndVerifyChild(int32_t child_frame_routing_id, bad_message::BadMessageReason reason); + mojo::PendingRemote<network::mojom::CookieAccessObserver> + CreateCookieAccessObserver(); + + // network::mojom::CookieAccessObserver: + void OnCookiesAccessed( + network::mojom::CookieAccessDetailsPtr details) override; + protected: friend class RenderFrameHostFactory; @@ -1874,6 +1882,10 @@ // mojom::DomAutomationControllerHost: void DomOperationResponse(const std::string& json_string) override; + // network::mojom::CookieAccessObserver + void Clone(mojo::PendingReceiver<network::mojom::CookieAccessObserver> + observer) override; + // Resets any waiting state of this RenderFrameHost that is no longer // relevant. void ResetWaitingState(); @@ -2926,6 +2938,16 @@ // Embedding token for the document in this RenderFrameHost. base::Optional<base::UnguessableToken> embedding_token_; + // Observers listening to cookie access notifications for the current document + // in this RenderFrameHost. + // Note: at the moment this set is not cleared when a new document is created + // in this RenderFrameHost. This is done because the first observer is created + // before the navigation actually commits and because the old routing id-based + // behaved in the same way as well. + // This problem should go away with RenderDocumentHost in any case. + // TODO(crbug.com/936696): Remove this warning after the RDH ships. + mojo::ReceiverSet<network::mojom::CookieAccessObserver> cookie_observers_; + // NOTE: This must be the last member. base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_{this};
diff --git a/content/browser/frame_host/render_frame_host_impl_browsertest.cc b/content/browser/frame_host/render_frame_host_impl_browsertest.cc index 52e4161..fb39921 100644 --- a/content/browser/frame_host/render_frame_host_impl_browsertest.cc +++ b/content/browser/frame_host/render_frame_host_impl_browsertest.cc
@@ -787,7 +787,7 @@ // navigation, so it swapped RenderFrameHosts. |main_frame| should now be // pending deletion and waiting for unload ACK, but it should not be waiting // for the beforeunload completion callback. - EXPECT_FALSE(main_frame->is_active()); + EXPECT_TRUE(main_frame->IsPendingDeletion()); EXPECT_FALSE(main_frame->is_waiting_for_beforeunload_completion()); EXPECT_EQ(0u, main_frame->beforeunload_pending_replies_.size()); EXPECT_EQ(nullptr, main_frame->GetBeforeUnloadInitiator()); @@ -3673,10 +3673,10 @@ // The old RFH should be pending deletion, but its site_for_cookies should // be unchanged. - EXPECT_FALSE(child_rfh->is_active()); + EXPECT_TRUE(child_rfh->IsPendingDeletion()); EXPECT_EQ(kid_url, child_rfh->GetLastCommittedURL()); EXPECT_EQ(url, main_frame->GetLastCommittedURL()); - EXPECT_FALSE(main_frame->is_active()); + EXPECT_TRUE(main_frame->IsPendingDeletion()); EXPECT_FALSE(main_frame->IsCurrent()); net::SiteForCookies computed_for_child = child_rfh->ComputeSiteForCookies(); EXPECT_TRUE(
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index 94e8f4d4..04cbf44 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1565,20 +1565,19 @@ return new_instance; } -void RenderFrameHostManager::InitializeRenderFrameForDebugURLIfNecessary() { +bool RenderFrameHostManager::InitializeRenderFrameForImmediateUse() { // TODO(jam): this copies some logic inside GetFrameHostForNavigation, which // also duplicates logic in Navigate. They should all use this method, but // that involves slight reordering. // http://crbug.com/794229 - if (render_frame_host_->IsRenderFrameLive()) { - NOTREACHED(); - return; - } + if (render_frame_host_->IsRenderFrameLive()) + return true; render_frame_host_->reset_must_be_replaced(); + if (!ReinitializeRenderFrame(render_frame_host_.get())) { NOTREACHED(); - return; + return false; } // TODO(jam): uncomment this when the method is shared. Not adding the call @@ -1595,6 +1594,7 @@ delegate_->NotifyMainFrameSwappedFromRenderManager( nullptr, render_frame_host_.get()); } + return true; } void RenderFrameHostManager::PrepareForInnerDelegateAttach(
diff --git a/content/browser/frame_host/render_frame_host_manager.h b/content/browser/frame_host/render_frame_host_manager.h index 2cba341b..0277347 100644 --- a/content/browser/frame_host/render_frame_host_manager.h +++ b/content/browser/frame_host/render_frame_host_manager.h
@@ -484,9 +484,10 @@ NavigationRequest* navigation_request); // Helper to initialize the current RenderFrame if it's not initialized. - // TODO(https://crbug.com/1006814): Remove this. For now debug URLs are an - // exception to replacing all crashed frames for RenderDocument. - void InitializeRenderFrameForDebugURLIfNecessary(); + // TODO(https://crbug.com/1006814): Remove this. For now debug URLs and + // WebView JS execution are an exception to replacing all crashed frames for + // RenderDocument. This is a no-op if the frame is already initialized. + bool InitializeRenderFrameForImmediateUse(); // Prepares the FrameTreeNode for attaching an inner WebContents. This step // may involve replacing |current_frame_host()| with a new RenderFrameHost
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc index cb67a4d..b0028e5 100644 --- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -2614,7 +2614,7 @@ // The previous RFH should still be pending deletion, as we wait for either // the FrameHostMsg_Unload_ACK or a timeout. ASSERT_TRUE(rfh->IsRenderFrameLive()); - ASSERT_FALSE(rfh->is_active()); + ASSERT_TRUE(rfh->IsPendingDeletion()); // We specifically want verify behavior between unload and RFH destruction. ASSERT_FALSE(rfh_observer.deleted()); @@ -3339,7 +3339,7 @@ // The previous RFH should still be pending deletion, as we wait for either // the FrameHostMsg_Unload_ACK or a timeout. ASSERT_TRUE(rfh_a->IsRenderFrameLive()); - ASSERT_FALSE(rfh_a->is_active()); + ASSERT_TRUE(rfh_a->IsPendingDeletion()); // The corresponding RVH should still be referenced by the proxy and the old // frame. @@ -3409,7 +3409,7 @@ // The previous RFH should still be pending deletion, as we wait for either // the unload ACK or a timeout. ASSERT_TRUE(rfh_a->IsRenderFrameLive()); - ASSERT_FALSE(rfh_a->is_active()); + ASSERT_TRUE(rfh_a->IsPendingDeletion()); // When the previous RFH was unloaded, it should have still gotten a // replacement proxy even though it's the last active frame in the process. @@ -3793,7 +3793,7 @@ // The old RFH should now be pending deletion. Verify it still has correct // last committed origin. EXPECT_EQ(url::Origin::Create(url_a), rfh_a->GetLastCommittedOrigin()); - EXPECT_FALSE(rfh_a->is_active()); + EXPECT_TRUE(rfh_a->IsPendingDeletion()); // Wait for |rfh_a| to be deleted and double-check |rfh_b|'s origin. deleted_observer.WaitUntilDeleted(); @@ -3827,7 +3827,7 @@ // the iframe's old RFH still has correct origin, even though it's pending // deletion. if (AreAllSitesIsolatedForTesting()) { - EXPECT_FALSE(child_rfh_b->is_active()); + EXPECT_TRUE(child_rfh_b->IsPendingDeletion()); EXPECT_NE(child_rfh_b, child->current_frame_host()); EXPECT_EQ(url::Origin::Create(url_b), child_rfh_b->GetLastCommittedOrigin()); @@ -6188,7 +6188,7 @@ // At this point, |rfh| should still be live and pending deletion. EXPECT_FALSE(rfh_observer.deleted()); - EXPECT_FALSE(rfh->is_active()); + EXPECT_TRUE(rfh->IsPendingDeletion()); EXPECT_TRUE(rfh->IsRenderFrameLive()); // Meanwhile, the new page should have two subframes.
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc index 3e1fca4..7c72abc 100644 --- a/content/browser/frame_host/render_frame_host_manager_unittest.cc +++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -591,8 +591,8 @@ navigation->set_drop_unload_ack(true); navigation->Commit(); TestRenderFrameHost* dest_rfh = contents()->GetMainFrame(); - EXPECT_FALSE(ntp_rfh->is_active()); - EXPECT_TRUE(dest_rfh->is_active()); + EXPECT_TRUE(ntp_rfh->IsPendingDeletion()); + EXPECT_TRUE(dest_rfh->IsCurrent()); // The new RFH should be able to update its favicons. { @@ -1160,11 +1160,11 @@ back_navigation1->set_drop_unload_ack(true); back_navigation1->Commit(); EXPECT_TRUE(rfh2->IsWaitingForUnloadACK()); - EXPECT_FALSE(rfh2->is_active()); + EXPECT_TRUE(rfh2->IsPendingDeletion()); // We should be able to navigate forward. NavigationSimulator::GoForward(contents()); - EXPECT_TRUE(main_test_rfh()->is_active()); + EXPECT_TRUE(main_test_rfh()->IsCurrent()); } // Test that we create RenderFrameProxy objects for the opener chain when @@ -1630,21 +1630,21 @@ contents()->NavigateAndCommit(kUrl1); TestRenderFrameHost* rfh1 = contents()->GetMainFrame(); RenderFrameDeletedObserver rfh_deleted_observer(rfh1); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); // Navigate to new site, simulating onbeforeunload approval. auto navigation = NavigationSimulatorImpl::CreateBrowserInitiated(kUrl2, contents()); navigation->ReadyToCommit(); EXPECT_TRUE(contents()->CrossProcessNavigationPending()); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); // Simulate the unload ack, unexpectedly early (before commit). It should // have no effect. rfh1->SimulateUnloadACK(); EXPECT_TRUE(contents()->CrossProcessNavigationPending()); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); // The new page commits. navigation->set_drop_unload_ack(true); @@ -1652,8 +1652,8 @@ EXPECT_FALSE(contents()->CrossProcessNavigationPending()); EXPECT_EQ(rfh2, contents()->GetMainFrame()); EXPECT_TRUE(contents()->GetPendingMainFrame() == nullptr); - EXPECT_TRUE(rfh2->is_active()); - EXPECT_FALSE(rfh1->is_active()); + EXPECT_TRUE(rfh2->IsCurrent()); + EXPECT_TRUE(rfh1->IsPendingDeletion()); // Simulate the unload ack. rfh1->SimulateUnloadACK(); @@ -1678,7 +1678,7 @@ contents()->NavigateAndCommit(kUrl1); TestRenderFrameHost* rfh1 = contents()->GetMainFrame(); RenderFrameDeletedObserver rfh_deleted_observer(rfh1); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); // Increment the number of active frames in SiteInstanceImpl so that rfh1 is // not deleted on unload. @@ -1689,7 +1689,7 @@ NavigationSimulatorImpl::CreateBrowserInitiated(kUrl2, contents()); navigation->ReadyToCommit(); EXPECT_TRUE(contents()->CrossProcessNavigationPending()); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); // The new page commits. @@ -1698,8 +1698,8 @@ EXPECT_FALSE(contents()->CrossProcessNavigationPending()); EXPECT_EQ(rfh2, contents()->GetMainFrame()); EXPECT_TRUE(contents()->GetPendingMainFrame() == nullptr); - EXPECT_FALSE(rfh1->is_active()); - EXPECT_TRUE(rfh2->is_active()); + EXPECT_TRUE(rfh1->IsPendingDeletion()); + EXPECT_TRUE(rfh2->IsCurrent()); // Simulate the unload ack. rfh1->OnUnloaded(); @@ -1725,7 +1725,7 @@ contents()->NavigateAndCommit(kUrl1); TestRenderFrameHost* rfh1 = contents()->GetMainFrame(); RenderFrameDeletedObserver rfh_deleted_observer(rfh1); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); // Increment the number of active frames in rfh1's SiteInstance so that the // SiteInstance is not deleted on unload. @@ -1737,7 +1737,7 @@ NavigationSimulatorImpl::CreateBrowserInitiated(kUrl2, contents()); navigation->ReadyToCommit(); EXPECT_TRUE(contents()->CrossProcessNavigationPending()); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); TestRenderFrameHost* rfh2 = contents()->GetPendingMainFrame(); // The new page commits. @@ -1746,8 +1746,8 @@ EXPECT_FALSE(contents()->CrossProcessNavigationPending()); EXPECT_EQ(rfh2, contents()->GetMainFrame()); EXPECT_TRUE(contents()->GetPendingMainFrame() == nullptr); - EXPECT_FALSE(rfh1->is_active()); - EXPECT_TRUE(rfh2->is_active()); + EXPECT_TRUE(rfh1->IsPendingDeletion()); + EXPECT_TRUE(rfh2->IsCurrent()); // Simulate the unload ack. rfh1->OnUnloaded(); @@ -1771,7 +1771,7 @@ // Navigate to the first page. contents()->NavigateAndCommit(kUrl1); TestRenderFrameHost* rfh1 = main_test_rfh(); - EXPECT_TRUE(rfh1->is_active()); + EXPECT_TRUE(rfh1->IsCurrent()); // Navigate to a new site, starting a cross-site navigation. controller().LoadURL(kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, @@ -1889,8 +1889,10 @@ EXPECT_TRUE(GetPendingFrameHost(iframe2)); EXPECT_EQ(host1, GetPendingFrameHost(iframe1)); EXPECT_EQ(host2, GetPendingFrameHost(iframe2)); - EXPECT_TRUE(GetPendingFrameHost(iframe1)->is_active()); - EXPECT_TRUE(GetPendingFrameHost(iframe2)->is_active()); + EXPECT_EQ(GetPendingFrameHost(iframe1)->lifecycle_state(), + RenderFrameHostImpl::LifecycleState::kActive); + EXPECT_EQ(GetPendingFrameHost(iframe2)->lifecycle_state(), + RenderFrameHostImpl::LifecycleState::kActive); EXPECT_NE(GetPendingFrameHost(iframe1), GetPendingFrameHost(iframe2)); EXPECT_EQ(GetPendingFrameHost(iframe1)->GetSiteInstance(), GetPendingFrameHost(iframe2)->GetSiteInstance()); @@ -3229,7 +3231,7 @@ navigation_to_kUrl2->Commit(); EXPECT_NE(initial_rfh, main_test_rfh()); ASSERT_FALSE(delete_observer.deleted()); - EXPECT_FALSE(initial_rfh->is_active()); + EXPECT_TRUE(initial_rfh->IsPendingDeletion()); // The initial RFH receives a BeginNavigation IPC. The navigation should not // start.
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 1aeb66f8..c0ce98fe 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc
@@ -752,11 +752,7 @@ // Don't block offscreen contexts (and force page reload for webgl) // if this was an intentional shutdown or the OOM killer on Android // killed us while Chrome was in the background. -// TODO(crbug.com/598400): Restrict this to Android for now, since other -// platforms might fall through here for the 'exit_on_context_lost' workaround. -#if defined(OS_ANDROID) block_offscreen_contexts = false; -#endif message += "exited normally. Everything is okay."; break; case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
diff --git a/content/browser/image_capture/image_capture_impl.cc b/content/browser/image_capture/image_capture_impl.cc index 9ef9af82..0469a43 100644 --- a/content/browser/image_capture/image_capture_impl.cc +++ b/content/browser/image_capture/image_capture_impl.cc
@@ -8,19 +8,24 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/command_line.h" #include "base/task/post_task.h" #include "base/unguessable_token.h" +#include "build/build_config.h" #include "content/browser/browser_main_loop.h" #include "content/browser/renderer_host/media/media_stream_manager.h" #include "content/browser/renderer_host/media/video_capture_manager.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/permission_controller.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" #include "media/base/bind_to_current_loop.h" #include "media/capture/mojom/image_capture_types.h" #include "media/capture/video/video_capture_device.h" #include "mojo/public/cpp/bindings/callback_helpers.h" -#include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "third_party/blink/public/common/mediastream/media_stream_request.h" namespace content { @@ -74,15 +79,15 @@ } // anonymous namespace -ImageCaptureImpl::ImageCaptureImpl() {} - -ImageCaptureImpl::~ImageCaptureImpl() {} - // static void ImageCaptureImpl::Create( + RenderFrameHost* render_frame_host, mojo::PendingReceiver<media::mojom::ImageCapture> receiver) { - mojo::MakeSelfOwnedReceiver(std::make_unique<ImageCaptureImpl>(), - std::move(receiver)); + DCHECK(render_frame_host); + // ImageCaptureImpl owns itself. It will self-destruct when a Mojo interface + // error occurs, the render frame host is deleted, or the render frame host + // navigates to a new document. + new ImageCaptureImpl(render_frame_host, std::move(receiver)); } void ImageCaptureImpl::GetPhotoState(const std::string& source_id, @@ -94,7 +99,9 @@ GetPhotoStateCallback scoped_callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun( - media::BindToCurrentLoop(std::move(callback)), + media::BindToCurrentLoop( + base::BindOnce(&ImageCaptureImpl::OnGetPhotoState, + weak_factory_.GetWeakPtr(), std::move(callback))), mojo::CreateEmptyPhotoState()); base::PostTask( FROM_HERE, {BrowserThread::IO}, @@ -111,6 +118,14 @@ "ImageCaptureImpl::SetOptions", TRACE_EVENT_SCOPE_PROCESS); + // TODO(crbug.com/934063): Check "has_zoom" as well if upcoming metrics show + // that zoom may be moved under this permission. + if ((settings->has_pan || settings->has_tilt) && + !HasPanTiltZoomPermissionGranted()) { + std::move(callback).Run(false); + return; + } + SetOptionsCallback scoped_callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun( media::BindToCurrentLoop(std::move(callback)), false); @@ -139,4 +154,48 @@ std::move(scoped_callback))); } +ImageCaptureImpl::ImageCaptureImpl( + RenderFrameHost* render_frame_host, + mojo::PendingReceiver<media::mojom::ImageCapture> receiver) + : FrameServiceBase(render_frame_host, std::move(receiver)) {} + +ImageCaptureImpl::~ImageCaptureImpl() = default; + +void ImageCaptureImpl::OnGetPhotoState(GetPhotoStateCallback callback, + media::mojom::PhotoStatePtr state) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + // TODO(crbug.com/934063): Reset "zoom" as well if upcoming metrics show + // that zoom may be moved under this permission. + if (!HasPanTiltZoomPermissionGranted()) { + state->pan = media::mojom::Range::New(); + state->tilt = media::mojom::Range::New(); + } + std::move(callback).Run(std::move(state)); +} + +bool ImageCaptureImpl::HasPanTiltZoomPermissionGranted() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +#if defined(OS_ANDROID) + // Camera PTZ is desktop only at the moment. + return true; +#else + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableExperimentalWebPlatformFeatures)) { + return false; + } + + auto* web_contents = WebContents::FromRenderFrameHost(render_frame_host()); + auto* permission_controller = BrowserContext::GetPermissionController( + web_contents->GetBrowserContext()); + DCHECK(permission_controller); + + blink::mojom::PermissionStatus status = + permission_controller->GetPermissionStatusForFrame( + PermissionType::CAMERA_PAN_TILT_ZOOM, render_frame_host(), + origin().GetURL()); + + return status == blink::mojom::PermissionStatus::GRANTED; +#endif +} } // namespace content
diff --git a/content/browser/image_capture/image_capture_impl.h b/content/browser/image_capture/image_capture_impl.h index b7bc6f8..1f2bf3f 100644 --- a/content/browser/image_capture/image_capture_impl.h +++ b/content/browser/image_capture/image_capture_impl.h
@@ -5,17 +5,18 @@ #ifndef CONTENT_BROWSER_IMAGE_CAPTURE_IMAGE_CAPTURE_IMPL_H_ #define CONTENT_BROWSER_IMAGE_CAPTURE_IMAGE_CAPTURE_IMPL_H_ +#include "base/memory/weak_ptr.h" +#include "content/public/browser/frame_service_base.h" #include "media/capture/mojom/image_capture.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" namespace content { -class ImageCaptureImpl : public media::mojom::ImageCapture { +class ImageCaptureImpl final + : public content::FrameServiceBase<media::mojom::ImageCapture> { public: - ImageCaptureImpl(); - ~ImageCaptureImpl() override; - static void Create( + RenderFrameHost* render_frame_host, mojo::PendingReceiver<media::mojom::ImageCapture> receiver); void GetPhotoState(const std::string& source_id, @@ -29,6 +30,17 @@ TakePhotoCallback callback) override; private: + ImageCaptureImpl(RenderFrameHost* render_frame_host, + mojo::PendingReceiver<media::mojom::ImageCapture> receiver); + ~ImageCaptureImpl() override; + + void OnGetPhotoState(GetPhotoStateCallback callback, + media::mojom::PhotoStatePtr); + + bool HasPanTiltZoomPermissionGranted(); + + base::WeakPtrFactory<ImageCaptureImpl> weak_factory_{this}; + DISALLOW_COPY_AND_ASSIGN(ImageCaptureImpl); };
diff --git a/content/browser/loader/navigation_url_loader.cc b/content/browser/loader/navigation_url_loader.cc index 7e82408..ab426e24 100644 --- a/content/browser/loader/navigation_url_loader.cc +++ b/content/browser/loader/navigation_url_loader.cc
@@ -31,6 +31,7 @@ prefetched_signed_exchange_cache, NavigationURLLoaderDelegate* delegate, bool is_served_from_back_forward_cache, + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer, std::vector<std::unique_ptr<NavigationLoaderInterceptor>> initial_interceptors) { if (g_loader_factory) { @@ -47,7 +48,7 @@ browser_context, storage_partition, std::move(request_info), std::move(navigation_ui_data), service_worker_handle, appcache_handle, std::move(prefetched_signed_exchange_cache), delegate, - std::move(initial_interceptors)); + std::move(cookie_observer), std::move(initial_interceptors)); } void NavigationURLLoader::SetFactoryForTesting(
diff --git a/content/browser/loader/navigation_url_loader.h b/content/browser/loader/navigation_url_loader.h index 35355fbe..7322f60 100644 --- a/content/browser/loader/navigation_url_loader.h +++ b/content/browser/loader/navigation_url_loader.h
@@ -59,6 +59,7 @@ prefetched_signed_exchange_cache, NavigationURLLoaderDelegate* delegate, bool is_served_from_back_forward_cache, + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer, std::vector<std::unique_ptr<NavigationLoaderInterceptor>> initial_interceptors = {});
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc index 3ddd4ca..6ed68531 100644 --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -195,7 +195,7 @@ std::unique_ptr<network::ResourceRequest> CreateResourceRequest( NavigationRequestInfo* request_info, int frame_tree_node_id, - StoragePartitionImpl* storage_partition) { + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer) { // TODO(scottmg): Port over stuff from RDHI::BeginNavigationRequest() here. auto new_request = std::make_unique<network::ResourceRequest>(); @@ -207,10 +207,7 @@ request_info->begin_params->force_ignore_site_for_cookies; new_request->trusted_params = network::ResourceRequest::TrustedParams(); new_request->trusted_params->isolation_info = request_info->isolation_info; - new_request->trusted_params->cookie_observer = - storage_partition->CreateCookieAccessObserver( - /*is_service_worker=*/false, network::mojom::kBrowserProcessId, - frame_tree_node_id); + new_request->trusted_params->cookie_observer = std::move(cookie_observer); new_request->is_main_frame = request_info->is_main_frame; net::RequestPriority net_priority = net::HIGHEST; @@ -1332,6 +1329,7 @@ scoped_refptr<PrefetchedSignedExchangeCache> prefetched_signed_exchange_cache, NavigationURLLoaderDelegate* delegate, + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer, std::vector<std::unique_ptr<NavigationLoaderInterceptor>> initial_interceptors) : delegate_(delegate), @@ -1353,8 +1351,8 @@ partition->GetPrefetchURLLoaderService() ->signed_exchange_prefetch_metric_recorder(); - std::unique_ptr<network::ResourceRequest> new_request = - CreateResourceRequest(request_info.get(), frame_tree_node_id, partition); + std::unique_ptr<network::ResourceRequest> new_request = CreateResourceRequest( + request_info.get(), frame_tree_node_id, std::move(cookie_observer)); std::string accept_langs = GetContentClient()->browser()->GetAcceptLangs( partition->browser_context());
diff --git a/content/browser/loader/navigation_url_loader_impl.h b/content/browser/loader/navigation_url_loader_impl.h index ae8c8c0..0d856e8 100644 --- a/content/browser/loader/navigation_url_loader_impl.h +++ b/content/browser/loader/navigation_url_loader_impl.h
@@ -47,6 +47,7 @@ scoped_refptr<PrefetchedSignedExchangeCache> prefetched_signed_exchange_cache, NavigationURLLoaderDelegate* delegate, + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer, std::vector<std::unique_ptr<NavigationLoaderInterceptor>> initial_interceptors); ~NavigationURLLoaderImpl() override;
diff --git a/content/browser/loader/navigation_url_loader_impl_unittest.cc b/content/browser/loader/navigation_url_loader_impl_unittest.cc index 6453133..82ebc55 100644 --- a/content/browser/loader/navigation_url_loader_impl_unittest.cc +++ b/content/browser/loader/navigation_url_loader_impl_unittest.cc
@@ -219,6 +219,7 @@ std::move(request_info), nullptr /* navigation_ui_data */, nullptr /* service_worker_handle */, nullptr /* appcache_handle */, nullptr /* prefetched_signed_exchange_cache */, delegate, + mojo::NullRemote() /* cookie_access_obsever */, std::move(interceptors)); }
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc index 8bc29fcb..4701e28 100644 --- a/content/browser/loader/navigation_url_loader_unittest.cc +++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -95,7 +95,7 @@ browser_context_.get(), BrowserContext::GetDefaultStoragePartition(browser_context_.get()), std::move(request_info), nullptr, nullptr, nullptr, nullptr, delegate, - false); + false, mojo::NullRemote()); } protected:
diff --git a/content/browser/media/android/media_resource_getter_impl.cc b/content/browser/media/android/media_resource_getter_impl.cc index fb0d57dd..010b1e33 100644 --- a/content/browser/media/android/media_resource_getter_impl.cc +++ b/content/browser/media/android/media_resource_getter_impl.cc
@@ -12,6 +12,7 @@ #include "content/browser/child_process_security_policy_impl.h" #include "content/browser/file_system/browser_file_system_helper.h" #include "content/browser/frame_host/render_frame_host_impl.h" +#include "content/browser/storage_partition_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -19,6 +20,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/common/content_client.h" #include "content/public/common/url_constants.h" +#include "ipc/ipc_message.h" #include "media/base/android/media_url_interceptor.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/base/auth.h" @@ -42,8 +44,7 @@ const GURL& url, const net::SiteForCookies& site_for_cookies, const url::Origin& top_frame_origin, - int render_process_id, - int render_frame_id) { + RenderFrameHostImpl* render_frame_host) { DCHECK_CURRENTLY_ON(BrowserThread::UI); url::Origin origin = url::Origin::Create(url); @@ -51,11 +52,16 @@ BrowserContext::GetDefaultStoragePartition(browser_context); mojo::PendingRemote<network::mojom::RestrictedCookieManager> pipe; - storage_partition->CreateRestrictedCookieManager( - network::mojom::RestrictedCookieManagerRole::NETWORK, origin, - site_for_cookies, top_frame_origin, - /* is_service_worker = */ false, render_process_id, render_frame_id, - pipe.InitWithNewPipeAndPassReceiver()); + static_cast<StoragePartitionImpl*>(storage_partition) + ->CreateRestrictedCookieManager( + network::mojom::RestrictedCookieManagerRole::NETWORK, origin, + site_for_cookies, top_frame_origin, + /* is_service_worker = */ false, + render_frame_host ? render_frame_host->GetProcess()->GetID() : -1, + render_frame_host ? render_frame_host->GetRoutingID() + : MSG_ROUTING_NONE, + pipe.InitWithNewPipeAndPassReceiver(), + render_frame_host->CreateCookieAccessObserver()); return pipe; } @@ -163,7 +169,7 @@ mojo::Remote<network::mojom::RestrictedCookieManager> cookie_manager( GetRestrictedCookieManagerForContext( browser_context_, url, site_for_cookies, top_frame_origin, - render_process_id_, render_frame_id_)); + RenderFrameHostImpl::FromID(render_process_id_, render_frame_id_))); network::mojom::RestrictedCookieManager* cookie_manager_ptr = cookie_manager.get(); cookie_manager_ptr->GetCookiesString(
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index aa2bbcba..e753093 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2063,11 +2063,14 @@ const url::Origin& origin, mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - GetStoragePartition()->CreateRestrictedCookieManager( + StoragePartitionImpl* storage_partition = + static_cast<StoragePartitionImpl*>(GetStoragePartition()); + storage_partition->CreateRestrictedCookieManager( network::mojom::RestrictedCookieManagerRole::SCRIPT, origin, net::SiteForCookies::FromOrigin(origin), origin, true /* is_service_worker */, GetID(), MSG_ROUTING_NONE, - std::move(receiver)); + std::move(receiver), + storage_partition->CreateCookieAccessObserverForServiceWorker()); } void RenderProcessHostImpl::BindVideoDecodePerfHistory(
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index a26ec1e6..02768a8 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -5621,7 +5621,7 @@ // Since the FrameHostMsg_Unload_ACK for A->B is dropped, the first page's // RenderFrameHost should be pending deletion after the last navigation. - EXPECT_FALSE(rfh->is_active()); + EXPECT_TRUE(rfh->IsPendingDeletion()); // Without the FrameHostMsg_Unload_ACK and timer, the process A will never // shutdown. Simulate the process being killed now. @@ -8552,7 +8552,7 @@ // At this point, the subframe's old RFH for b.com should be pending // deletion, and the subframe's proxy in a.com should've been cleared. - EXPECT_FALSE(child_rfh->is_active()); + EXPECT_TRUE(child_rfh->IsPendingDeletion()); EXPECT_FALSE(child->render_manager()->GetProxyToParent()); // Simulate that the load event is dispatched from |child_rfh| just after @@ -11328,7 +11328,7 @@ // The previous RFH should still be pending deletion, as we wait for either // the FrameHostMsg_Unload_ACK or a timeout. ASSERT_TRUE(rfh->IsRenderFrameLive()); - ASSERT_FALSE(rfh->is_active()); + ASSERT_TRUE(rfh->IsPendingDeletion()); ASSERT_FALSE(rfh_observer.deleted()); // Check sandbox flags on old RFH -- they should be unchanged. @@ -11959,7 +11959,7 @@ // The old RenderFrameHost is now pending deletion. ASSERT_TRUE(rfh->IsRenderFrameLive()); - ASSERT_FALSE(rfh->is_active()); + ASSERT_TRUE(rfh->IsPendingDeletion()); // Kill the b.com process. RenderProcessHost* b_process = popup_contents->GetMainFrame()->GetProcess(); @@ -12354,7 +12354,7 @@ shell(), embedded_test_server()->GetURL("b.com", "/title3.html"))); // The old RFH should be pending deletion. - EXPECT_FALSE(rfh->is_active()); + EXPECT_TRUE(rfh->IsPendingDeletion()); EXPECT_FALSE(rfh->IsCurrent()); EXPECT_NE(rfh, web_contents()->GetMainFrame()); @@ -14079,7 +14079,7 @@ commit_observer.WaitForCommit(); // At this point, popup's original RFH is pending deletion. - EXPECT_FALSE(rfh->is_active()); + EXPECT_TRUE(rfh->IsPendingDeletion()); // When the opener receives a postMessage from the popup's unload handler, it // should start a navigation back to b.com. Wait for it. This navigation
diff --git a/content/browser/site_per_process_unload_browsertest.cc b/content/browser/site_per_process_unload_browsertest.cc index 3ef629b..ae037dd 100644 --- a/content/browser/site_per_process_unload_browsertest.cc +++ b/content/browser/site_per_process_unload_browsertest.cc
@@ -1207,11 +1207,11 @@ EXPECT_TRUE(B2->GetSuddenTerminationDisablerState( blink::mojom::SuddenTerminationDisablerType::kUnloadHandler)); - EXPECT_TRUE(B2->is_active()); + EXPECT_TRUE(B2->IsCurrent()); EXPECT_TRUE(ExecJs(A1, "document.querySelector('iframe').remove()")); EXPECT_EQ(nullptr, frame_tree->GetFocusedFrame()); EXPECT_EQ(2u, A1->child_count()); - EXPECT_FALSE(B2->is_active()); + EXPECT_TRUE(B2->IsPendingDeletion()); // 3. C3 navigates. NavigateFrameToURL(C3->frame_tree_node(),
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index 8e644aef..875d8a13 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -427,243 +427,6 @@ return weak_partition_ptr ? weak_partition_ptr->browser_context() : nullptr; } -// TODO(crbug.com/977040): Remove when no longer needed. - -void DeprecateSameSiteCookies( - int process_id, - int routing_id, - const net::CookieStatusList& cookie_list, - const GURL& url, - const net::SiteForCookies& site_for_cookies, - blink::mojom::SameSiteCookieOperation operation, - const base::Optional<std::string>& devtools_request_id) { - // Navigation requests start in the browser, before process_id is assigned, so - // the id is set to network::mojom::kBrowserProcessId. In these situations, - // the routing_id is the frame tree node id, and can be used directly. - RenderFrameHostImpl* frame = nullptr; - if (process_id == network::mojom::kBrowserProcessId) { - FrameTreeNode* ftn = FrameTreeNode::GloballyFindByID(routing_id); - if (ftn) - frame = ftn->current_frame_host(); - } else { - frame = RenderFrameHostImpl::FromID(process_id, routing_id); - } - - if (!frame) - return; - - // Because of the nature of mojo and calling cross process, there's the - // possibility of calling this method after the page has already been - // navigated away from, which is DCHECKed against in - // LogWebFeatureForCurrentPage. We're replicating the DCHECK here and - // returning early should this be the case. - WebContents* web_contents = WebContents::FromRenderFrameHost(frame); - - // |web_contents| will be null on interstitial pages, which means the frame - // has been navigated away from and the function should return early. - if (!web_contents) - return; - - RenderFrameHostImpl* root_frame_host = frame; - while (root_frame_host->GetParent() != nullptr) - root_frame_host = root_frame_host->GetParent(); - - if (root_frame_host != web_contents->GetMainFrame()) - return; - - bool samesite_treated_as_lax_cookies = false; - bool samesite_none_insecure_cookies = false; - - bool messages_disabled_by_cmdline = - base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine( - features::kCookieDeprecationMessages.name, - base::FeatureList::OVERRIDE_DISABLE_FEATURE); - bool emit_messages = - !messages_disabled_by_cmdline && - (net::cookie_util::IsSameSiteByDefaultCookiesEnabled() || - net::cookie_util::IsCookiesWithoutSameSiteMustBeSecureEnabled() || - base::FeatureList::IsEnabled(features::kCookieDeprecationMessages)); - - bool breaking_context_downgrade = false; - - for (const net::CookieWithStatus& excluded_cookie : cookie_list) { - std::string cookie_url = - net::cookie_util::CookieOriginToURL(excluded_cookie.cookie.Domain(), - excluded_cookie.cookie.IsSecure()) - .possibly_invalid_spec(); - - if (excluded_cookie.status.ShouldWarn()) { - if (excluded_cookie.status.HasWarningReason( - net::CanonicalCookie::CookieInclusionStatus:: - WARN_SAMESITE_UNSPECIFIED_CROSS_SITE_CONTEXT)) { - samesite_treated_as_lax_cookies = true; - } - - if (excluded_cookie.status.HasWarningReason( - net::CanonicalCookie::CookieInclusionStatus:: - WARN_SAMESITE_UNSPECIFIED_LAX_ALLOW_UNSAFE)) { - samesite_treated_as_lax_cookies = true; - } - - if (excluded_cookie.status.HasWarningReason( - net::CanonicalCookie::CookieInclusionStatus:: - WARN_SAMESITE_NONE_INSECURE)) { - samesite_none_insecure_cookies = true; - } - devtools_instrumentation::ReportSameSiteCookieIssue( - root_frame_host, excluded_cookie, url, site_for_cookies, operation, - devtools_request_id); - } - if (emit_messages) { - root_frame_host->AddSameSiteCookieDeprecationMessage( - cookie_url, excluded_cookie.status, - net::cookie_util::IsSameSiteByDefaultCookiesEnabled(), - net::cookie_util::IsCookiesWithoutSameSiteMustBeSecureEnabled()); - } - - breaking_context_downgrade = breaking_context_downgrade || - excluded_cookie.status.HasDowngradeWarning(); - } - - // TODO(crbug.com/990439): Do we need separate UseCounter metrics for - // Lax-allow-unsafe? We already have histograms in CanonicalCookie. - if (samesite_treated_as_lax_cookies) { - GetContentClient()->browser()->LogWebFeatureForCurrentPage( - frame, blink::mojom::WebFeature::kCookieNoSameSite); - } - - if (samesite_none_insecure_cookies) { - GetContentClient()->browser()->LogWebFeatureForCurrentPage( - frame, blink::mojom::WebFeature::kCookieInsecureAndSameSiteNone); - } - - if (breaking_context_downgrade) { - GetContentClient()->browser()->LogWebFeatureForCurrentPage( - frame, blink::mojom::WebFeature::kSchemefulSameSiteContextDowngrade); - } -} - -void RecordContextDowngradeUKM( - WebContents* web_contents, - CookieAccessDetails::Type access_type, - const net::CanonicalCookie::CookieInclusionStatus& status, - const GURL& url) { - DCHECK(web_contents); - - ukm::SourceId source_id = static_cast<WebContentsImpl*>(web_contents) - ->GetMainFrame() - ->GetPageUkmSourceId(); - - if (access_type == CookieAccessDetails::Type::kRead) { - ukm::builders::SchemefulSameSiteContextDowngrade(source_id) - .SetRequestPerCookie(status.GetBreakingDowngradeMetricsEnumValue(url)) - .Record(ukm::UkmRecorder::Get()); - } else { - DCHECK(access_type == CookieAccessDetails::Type::kChange); - ukm::builders::SchemefulSameSiteContextDowngrade(source_id) - .SetResponsePerCookie(status.GetBreakingDowngradeMetricsEnumValue(url)) - .Record(ukm::UkmRecorder::Get()); - } -} - -void ReportCookiesAccessedOnUI( - CookieAccessDetails::Type access_type, - std::vector<GlobalFrameRoutingId> destinations, - const GURL& url, - const net::SiteForCookies& site_for_cookies, - const std::vector<net::CookieWithStatus>& cookie_list, - const base::Optional<std::string>& devtools_request_id) { - for (const GlobalFrameRoutingId& id : destinations) { - DeprecateSameSiteCookies( - id.child_id, id.frame_routing_id, cookie_list, url, site_for_cookies, - access_type == CookieAccessDetails::Type::kRead - ? blink::mojom::SameSiteCookieOperation::ReadCookie - : blink::mojom::SameSiteCookieOperation::SetCookie, - devtools_request_id); - } - - net::CookieList accepted, blocked; - std::vector<net::CanonicalCookie::CookieInclusionStatus> accepted_status, - blocked_status_for_metrics; - for (auto& cookie_and_status : cookie_list) { - if (cookie_and_status.status.HasExclusionReason( - net::CanonicalCookie::CookieInclusionStatus:: - EXCLUDE_USER_PREFERENCES)) { - blocked.push_back(std::move(cookie_and_status.cookie)); - } else if (cookie_and_status.status.IsInclude()) { - accepted.push_back(std::move(cookie_and_status.cookie)); - accepted_status.push_back(std::move(cookie_and_status.status)); - } else if (cookie_and_status.status.ShouldRecordDowngradeMetrics()) { - // Must run after the case for |accepted_status| because - // ShouldRecordDowngradeMetrics() will match on status.IsInclude() which - // would steal the status from |accepted_status|. - blocked_status_for_metrics.push_back(std::move(cookie_and_status.status)); - } - } - - if (!accepted.empty()) { - for (const GlobalFrameRoutingId& id : destinations) { - WebContents* web_contents = - GetWebContentsForStoragePartition(id.child_id, id.frame_routing_id); - if (!web_contents) - continue; - static_cast<WebContentsImpl*>(web_contents) - ->OnCookiesAccessed({access_type, url, - site_for_cookies.RepresentativeUrl(), accepted, - /* blocked_by_policy =*/false}); - - for (const auto& status : accepted_status) { - RecordContextDowngradeUKM(web_contents, access_type, status, url); - } - } - } - - if (!blocked.empty()) { - for (const GlobalFrameRoutingId& id : destinations) { - WebContents* web_contents = - GetWebContentsForStoragePartition(id.child_id, id.frame_routing_id); - if (!web_contents) - continue; - static_cast<WebContentsImpl*>(web_contents) - ->OnCookiesAccessed({access_type, url, - site_for_cookies.RepresentativeUrl(), blocked, - /* blocked_by_policy =*/true}); - } - } - - for (const auto& status : blocked_status_for_metrics) { - for (const GlobalFrameRoutingId& id : destinations) { - WebContents* web_contents = - GetWebContentsForStoragePartition(id.child_id, id.frame_routing_id); - if (!web_contents) - continue; - - RecordContextDowngradeUKM(web_contents, access_type, status, url); - } - } -} - -void OnServiceWorkerCookiesAccessedOnCoreThread( - CookieAccessDetails::Type access_type, - scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, - const GURL& url, - const net::SiteForCookies& site_for_cookies, - const std::vector<net::CookieWithStatus>& cookie_list, - const base::Optional<std::string>& devtools_request_id) { - DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); - // Notify all the frames associated with this service worker of its cookie - // activity. - std::unique_ptr<std::vector<GlobalFrameRoutingId>> frame_routing_ids = - service_worker_context->GetWindowClientFrameRoutingIds(url.GetOrigin()); - if (!frame_routing_ids->empty()) { - RunOrPostTaskOnThread( - FROM_HERE, BrowserThread::UI, - base::BindOnce(ReportCookiesAccessedOnUI, access_type, - *frame_routing_ids, url, site_for_cookies, cookie_list, - devtools_request_id)); - } -} - WebContents* GetWebContents(int process_id, int routing_id) { if (process_id != network::mojom::kBrowserProcessId) { return WebContentsImpl::FromRenderFrameHostID(process_id, routing_id); @@ -1272,6 +1035,60 @@ perform_storage_cleanup); } +class StoragePartitionImpl::ServiceWorkerCookieAccessObserver + : public network::mojom::CookieAccessObserver { + public: + explicit ServiceWorkerCookieAccessObserver( + StoragePartitionImpl* storage_partition) + : storage_partition_(storage_partition) {} + + private: + void Clone(mojo::PendingReceiver<network::mojom::CookieAccessObserver> + observer) override { + storage_partition_->service_worker_cookie_observers_.Add( + std::make_unique<ServiceWorkerCookieAccessObserver>(storage_partition_), + std::move(observer)); + } + + void OnCookiesAccessed( + network::mojom::CookieAccessDetailsPtr details) override { + scoped_refptr<ServiceWorkerContextWrapper> service_worker_context = + storage_partition_->GetServiceWorkerContext(); + RunOrPostTaskOnThread( + FROM_HERE, ServiceWorkerContext::GetCoreThreadId(), + base::BindOnce(&OnServiceWorkerCookiesAccessedOnCoreThread, + service_worker_context, std::move(details))); + } + + static void OnServiceWorkerCookiesAccessedOnCoreThread( + scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, + network::mojom::CookieAccessDetailsPtr details) { + std::vector<GlobalFrameRoutingId> destinations = + *service_worker_context->GetWindowClientFrameRoutingIds( + details->url.GetOrigin()); + if (destinations.empty()) + return; + RunOrPostTaskOnThread( + FROM_HERE, BrowserThread::UI, + base::BindOnce(&ReportCookiesAccessedOnUI, std::move(destinations), + std::move(details))); + } + + static void ReportCookiesAccessedOnUI( + std::vector<GlobalFrameRoutingId> destinations, + network::mojom::CookieAccessDetailsPtr details) { + for (GlobalFrameRoutingId frame_id : destinations) { + if (RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(frame_id)) { + rfh->OnCookiesAccessed(mojo::Clone(details)); + } + } + } + + // |storage_partition_| owns this object via UniqueReceiverSet + // (service_worker_cookie_observers_). + StoragePartitionImpl* storage_partition_; +}; + StoragePartitionImpl::StoragePartitionImpl( BrowserContext* browser_context, const base::FilePath& partition_path, @@ -1608,54 +1425,6 @@ return cookie_manager_for_browser_process_.get(); } -class StoragePartitionImpl::CookieAccessObserver - : public network::mojom::CookieAccessObserver { - public: - CookieAccessObserver(StoragePartitionImpl* partition, - bool is_service_worker, - int process_id, - int routing_id) - : partition_(partition), - is_service_worker_(is_service_worker), - process_id_(process_id), - routing_id_(routing_id) {} - - private: - void Clone(mojo::PendingReceiver<network::mojom::CookieAccessObserver> - observer) override { - partition_->cookie_observers_.Add( - std::make_unique<CookieAccessObserver>(partition_, is_service_worker_, - process_id_, routing_id_), - std::move(observer)); - } - - void OnCookiesAccessed( - network::mojom::CookieAccessDetailsPtr details) override { - partition_->OnCookiesAccessed( - details->type, is_service_worker_, process_id_, routing_id_, - details->url, details->site_for_cookies, details->cookie_list, - details->devtools_request_id); - } - - // |partition_| owns this via mojo::UniqueReceiverSet (cookie_observers_). - StoragePartitionImpl* const partition_; - const bool is_service_worker_; - const int process_id_; - const int routing_id_; -}; - -mojo::PendingRemote<network::mojom::CookieAccessObserver> -StoragePartitionImpl::CreateCookieAccessObserver(bool is_service_worker, - int32_t process_id, - int32_t routing_id) { - mojo::PendingRemote<network::mojom::CookieAccessObserver> remote; - cookie_observers_.Add(std::make_unique<CookieAccessObserver>( - this, is_service_worker, process_id, routing_id), - remote.InitWithNewPipeAndPassReceiver()); - - return remote; -} - void StoragePartitionImpl::CreateRestrictedCookieManager( network::mojom::RestrictedCookieManagerRole role, const url::Origin& origin, @@ -1664,14 +1433,15 @@ bool is_service_worker, int process_id, int routing_id, - mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver) { + mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver, + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer) { DCHECK(initialized_); if (!GetContentClient()->browser()->WillCreateRestrictedCookieManager( role, browser_context_, origin, site_for_cookies, top_frame_origin, is_service_worker, process_id, routing_id, &receiver)) { GetNetworkContext()->GetRestrictedCookieManager( std::move(receiver), role, origin, site_for_cookies, top_frame_origin, - CreateCookieAccessObserver(is_service_worker, process_id, routing_id)); + std::move(cookie_observer)); } } @@ -2060,31 +1830,6 @@ load_flags, std::move(callback)); } -void StoragePartitionImpl::OnCookiesAccessed( - CookieAccessDetails::Type access_type, - bool is_service_worker, - int32_t process_id, - int32_t routing_id, - const GURL& url, - const net::SiteForCookies& site_for_cookies, - const std::vector<net::CookieWithStatus>& cookie_list, - const base::Optional<std::string>& devtools_request_id) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(initialized_); - if (is_service_worker) { - RunOrPostTaskOnThread( - FROM_HERE, ServiceWorkerContext::GetCoreThreadId(), - base::BindOnce(&OnServiceWorkerCookiesAccessedOnCoreThread, access_type, - service_worker_context_, url, site_for_cookies, - std::move(cookie_list), devtools_request_id)); - } else { - std::vector<GlobalFrameRoutingId> destination; - destination.emplace_back(process_id, routing_id); - ReportCookiesAccessedOnUI(access_type, destination, url, site_for_cookies, - cookie_list, devtools_request_id); - } -} - #if defined(OS_ANDROID) void StoragePartitionImpl::OnGenerateHttpNegotiateAuthToken( const std::string& server_auth_token, @@ -2719,4 +2464,13 @@ return base::FeatureList::IsEnabled(blink::features::kAppCache); } +mojo::PendingRemote<network::mojom::CookieAccessObserver> +StoragePartitionImpl::CreateCookieAccessObserverForServiceWorker() { + mojo::PendingRemote<network::mojom::CookieAccessObserver> remote; + service_worker_cookie_observers_.Add( + std::make_unique<ServiceWorkerCookieAccessObserver>(this), + remote.InitWithNewPipeAndPassReceiver()); + return remote; +} + } // namespace content
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index 54e6eae..5a34344 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h
@@ -124,16 +124,6 @@ std::unique_ptr<network::PendingSharedURLLoaderFactory> GetURLLoaderFactoryForBrowserProcessIOThread() override; network::mojom::CookieManager* GetCookieManagerForBrowserProcess() override; - void CreateRestrictedCookieManager( - network::mojom::RestrictedCookieManagerRole role, - const url::Origin& origin, - const net::SiteForCookies& site_for_cookies, - const url::Origin& top_frame_origin, - bool is_service_worker, - int process_id, - int routing_id, - mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver) - override; void CreateHasTrustTokensAnswerer( mojo::PendingReceiver<network::mojom::HasTrustTokensAnswerer> receiver, const url::Origin& top_frame_origin) override; @@ -318,20 +308,20 @@ network::mojom::OriginPolicyManager* GetOriginPolicyManagerForBrowserProcess(); - mojo::PendingRemote<network::mojom::CookieAccessObserver> - CreateCookieAccessObserver(bool is_service_worker, - int32_t process_id, - int32_t routing_id); - - void OnCookiesAccessed( - CookieAccessDetails::Type access_type, - bool is_service_worker, - int32_t process_id, - int32_t routing_id, - const GURL& url, + // We have to plumb |is_service_worker|, |process_id| and |routing_id| because + // they are plumbed to WebView via WillCreateRestrictedCookieManager, which + // makes some decision based on that. + void CreateRestrictedCookieManager( + network::mojom::RestrictedCookieManagerRole role, + const url::Origin& origin, const net::SiteForCookies& site_for_cookies, - const std::vector<net::CookieWithStatus>& cookie_list, - const base::Optional<std::string>& devtools_request_id); + const url::Origin& top_frame_origin, + bool is_service_worker, + int process_id, + int routing_id, + mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver, + mojo::PendingRemote<network::mojom::CookieAccessObserver> + cookie_observer); // Override the origin policy manager for testing use only. void SetOriginPolicyManagerForBrowserProcessForTesting( @@ -339,11 +329,14 @@ test_origin_policy_manager); void ResetOriginPolicyManagerForBrowserProcessForTesting(); + mojo::PendingRemote<network::mojom::CookieAccessObserver> + CreateCookieAccessObserverForServiceWorker(); + private: class DataDeletionHelper; class QuotaManagedDataDeletionHelper; class URLLoaderFactoryForBrowserProcess; - class CookieAccessObserver; + class ServiceWorkerCookieAccessObserver; friend class BackgroundSyncManagerTest; friend class BackgroundSyncServiceImplTestHarness; @@ -553,18 +546,17 @@ // See comments for site_for_guest_service_worker(). GURL site_for_guest_service_worker_; - // A set of connections to network service used to notify browser process - // about cookie reads and writes. Each connection corresponds to a different - // context (frame / navigation / service worker). - mojo::UniqueReceiverSet<network::mojom::CookieAccessObserver> - cookie_observers_; - // Track number of running deletion. For test use only. int deletion_helpers_running_; // Called when all deletions are done. For test use only. base::OnceClosure on_deletion_helpers_done_callback_; + // A set of connections to the network service used to notify browser process + // about cookie reads and writes made by a service worker in this process. + mojo::UniqueReceiverSet<network::mojom::CookieAccessObserver> + service_worker_cookie_observers_; + base::WeakPtrFactory<StoragePartitionImpl> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl);
diff --git a/content/browser/url_loader_factory_params_helper.cc b/content/browser/url_loader_factory_params_helper.cc index 2329a08..13af71a 100644 --- a/content/browser/url_loader_factory_params_helper.cc +++ b/content/browser/url_loader_factory_params_helper.cc
@@ -50,8 +50,7 @@ coep_reporter, bool allow_universal_access_from_file_urls, bool is_for_isolated_world, - bool is_for_service_worker, - int frame_routing_id) { + mojo::PendingRemote<network::mojom::CookieAccessObserver> cookie_observer) { DCHECK(process); // "chrome-guest://..." is never used as a main or isolated world origin. @@ -94,11 +93,7 @@ process->GetBrowserContext(), origin, is_for_isolated_world, params.get()); - params->cookie_observer = - static_cast<StoragePartitionImpl*>(process->GetStoragePartition()) - ->CreateCookieAccessObserver(is_for_service_worker, process->GetID(), - frame_routing_id); - + params->cookie_observer = std::move(cookie_observer); return params; } @@ -126,8 +121,7 @@ ->GetWebkitPreferences() .allow_universal_access_from_file_urls, false, // is_for_isolated_world - false, // is_for_service_worker - frame->GetRoutingID()); + frame->CreateCookieAccessObserver()); } // static @@ -149,9 +143,8 @@ frame->GetRenderViewHost() ->GetWebkitPreferences() .allow_universal_access_from_file_urls, - true, // is_for_isolated_world - false, // is_for_service_worker - frame->GetRoutingID()); + true, // is_for_isolated_world + frame->CreateCookieAccessObserver()); } network::mojom::URLLoaderFactoryParamsPtr @@ -176,8 +169,7 @@ ->GetWebkitPreferences() .allow_universal_access_from_file_urls, false, // is_for_isolated_world - false, // is_for_service_worker - frame->GetRoutingID()); + frame->CreateCookieAccessObserver()); } // static @@ -188,19 +180,20 @@ const net::IsolationInfo& isolation_info, mojo::PendingRemote<network::mojom::CrossOriginEmbedderPolicyReporter> coep_reporter) { - return CreateParams(process, - request_initiator, // origin - request_initiator, // request_initiator_site_lock - base::nullopt, // top_frame_origin - false, // is_trusted - base::nullopt, // top_frame_token - isolation_info, - nullptr, // client_security_state - std::move(coep_reporter), - false, // allow_universal_access_from_file_urls - false, // is_for_isolated_world - false, // is_for_service_worker - MSG_ROUTING_NONE); + return CreateParams( + process, + request_initiator, // origin + request_initiator, // request_initiator_site_lock + base::nullopt, // top_frame_origin + false, // is_trusted + base::nullopt, // top_frame_token + isolation_info, + nullptr, // client_security_state + std::move(coep_reporter), + false, // allow_universal_access_from_file_urls + false, // is_for_isolated_world + static_cast<StoragePartitionImpl*>(process->GetStoragePartition()) + ->CreateCookieAccessObserverForServiceWorker()); } // static @@ -236,8 +229,7 @@ mojo::NullRemote(), // coep_reporter false, // allow_universal_access_from_file_urls false, // is_for_isolated_world - false, // is_for_service_worker - MSG_ROUTING_NONE); + mojo::NullRemote()); } } // namespace content
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc index ba3aeee..fdcf78a8 100644 --- a/content/browser/web_contents/web_contents_android.cc +++ b/content/browser/web_contents/web_contents_android.cc
@@ -506,6 +506,17 @@ show_selection_menu); } +bool WebContentsAndroid::InitializeRenderFrameForJavaScript() { + if (!web_contents_->GetFrameTree() + ->root() + ->render_manager() + ->InitializeRenderFrameForImmediateUse()) { + LOG(ERROR) << "Failed to initialize RenderFrame to evaluate javascript"; + return false; + } + return true; +} + void WebContentsAndroid::EvaluateJavaScript( JNIEnv* env, const JavaParamRef<jobject>& obj, @@ -514,13 +525,8 @@ RenderViewHost* rvh = web_contents_->GetRenderViewHost(); DCHECK(rvh); - if (!rvh->IsRenderViewLive()) { - if (!static_cast<WebContentsImpl*>(web_contents_)-> - CreateRenderViewForInitialEmptyDocument()) { - LOG(ERROR) << "Failed to create RenderView in EvaluateJavaScript"; - return; - } - } + if (!InitializeRenderFrameForJavaScript()) + return; if (!callback) { // No callback requested. @@ -547,13 +553,8 @@ RenderViewHost* rvh = web_contents_->GetRenderViewHost(); DCHECK(rvh); - if (!rvh->IsRenderViewLive()) { - if (!static_cast<WebContentsImpl*>(web_contents_)-> - CreateRenderViewForInitialEmptyDocument()) { - LOG(ERROR) << "Failed to create RenderView in EvaluateJavaScriptForTests"; - return; - } - } + if (!InitializeRenderFrameForJavaScript()) + return; if (!callback) { // No callback requested.
diff --git a/content/browser/web_contents/web_contents_android.h b/content/browser/web_contents/web_contents_android.h index fe03e87..b846fb0 100644 --- a/content/browser/web_contents/web_contents_android.h +++ b/content/browser/web_contents/web_contents_android.h
@@ -35,6 +35,10 @@ base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); + // Ensure that the render frame host etc are ready to handle JS eval + // (e.g. recover from a crashed state). + bool InitializeRenderFrameForJavaScript(); + // Methods called from Java void ClearNativeReference(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 8a9c988..195e936 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2001,9 +2001,17 @@ new PageMsg_SetRendererPrefs(MSG_ROUTING_NONE, renderer_preferences)); } -void WebContentsImpl::OnCookiesAccessed(const CookieAccessDetails& details) { +void WebContentsImpl::OnCookiesAccessed(NavigationHandle* navigation, + const CookieAccessDetails& details) { for (auto& observer : observers_) { - observer.OnCookiesAccessed(details); + observer.OnCookiesAccessed(navigation, details); + } +} + +void WebContentsImpl::OnCookiesAccessed(RenderFrameHostImpl* rfh, + const CookieAccessDetails& details) { + for (auto& observer : observers_) { + observer.OnCookiesAccessed(rfh, details); } } @@ -6657,14 +6665,6 @@ GetOrCreateFindRequestManager()->RequestFindMatchRects(current_version); } -bool WebContentsImpl::CreateRenderViewForInitialEmptyDocument() { - return CreateRenderViewForRenderManager( - GetRenderViewHost(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, - frame_tree_.root()->current_frame_host()->frame_token(), - frame_tree_.root()->devtools_frame_token(), - frame_tree_.root()->current_replication_state()); -} - service_manager::InterfaceProvider* WebContentsImpl::GetJavaInterfaces() { if (!java_interfaces_) { mojo::PendingRemote<service_manager::mojom::InterfaceProvider> provider;
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index b20acb3..5686b4e 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -207,15 +207,6 @@ // Returns the SavePackage which manages the page saving job. May be NULL. SavePackage* save_package() const { return save_package_.get(); } -#if defined(OS_ANDROID) - // In Android WebView, the RenderView needs created even there is no - // navigation entry, this allows Android WebViews to use - // javascript: URLs that load into the DOMWindow before the first page - // load. This is not safe to do in any context that a web page could get a - // reference to the DOMWindow before the first page load. - bool CreateRenderViewForInitialEmptyDocument(); -#endif - // Expose the render manager for testing. // TODO(creis): Remove this now that we can get to it via FrameTreeNode. RenderFrameHostManager* GetRenderManagerForTesting(); @@ -695,6 +686,8 @@ RenderFrameHost* render_frame_host, const GlobalRequestID& request_id, blink::mojom::ResourceLoadInfoPtr resource_load_information) override; + void OnCookiesAccessed(RenderFrameHostImpl*, + const CookieAccessDetails& details) override; // Called when WebAudio starts or stops playing audible audio in an // AudioContext. @@ -854,6 +847,8 @@ void OnServiceWorkerAccessed(NavigationHandle* navigation, const GURL& scope, AllowServiceWorkerResult allowed) override; + void OnCookiesAccessed(NavigationHandle*, + const CookieAccessDetails& details) override; void RegisterExistingOriginToPreventOptInIsolation( const url::Origin& origin, NavigationRequest* navigation_request_to_exclude) override; @@ -1208,8 +1203,6 @@ // Returns the focused frame's input handler. mojom::FrameInputHandler* GetFocusedFrameInputHandler(); - void OnCookiesAccessed(const CookieAccessDetails& details); - private: friend class WebContentsObserver; friend class WebContents; // To implement factory methods.
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 5eb130df..20ed0b3 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -96,17 +96,14 @@ void ResizeWebContentsView(Shell* shell, const gfx::Size& size, bool set_start_page) { - // Shell::SizeTo is not implemented on Aura; WebContentsView::SizeContents - // works on Win and ChromeOS but not Linux - we need to resize the shell - // window on Linux because if we don't, the next layout of the unchanged shell - // window will resize WebContentsView back to the previous size. - // SizeContents is a hack and should not be relied on. #if defined(OS_MACOSX) - shell->SizeTo(size); - // If |set_start_page| is true, start with blank page to make sure resize - // takes effect. + // Mac requires platform-specific code to resize the WebContents directly + // (independent of the Shell window). It needs to happen after the + // RenderWidgetHostView exists, so we do a navigation first if + // |set_start_page| is true. if (set_start_page) EXPECT_TRUE(NavigateToURL(shell, GURL(url::kAboutBlankURL))); + shell->ResizeWebContentForTests(size); #else static_cast<WebContentsImpl*>(shell->web_contents())->GetView()-> SizeContents(size);
diff --git a/content/browser/web_contents/web_contents_observer_browsertest.cc b/content/browser/web_contents/web_contents_observer_browsertest.cc index 4c96c9a..44078c4 100644 --- a/content/browser/web_contents/web_contents_observer_browsertest.cc +++ b/content/browser/web_contents/web_contents_observer_browsertest.cc
@@ -8,6 +8,7 @@ #include "content/browser/service_worker/embedded_worker_status.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/allow_service_worker_result.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" @@ -216,6 +217,11 @@ namespace { +enum class ContextType { + kNavigation, + kFrame, +}; + class CookieTracker : public WebContentsObserver { public: explicit CookieTracker(WebContentsImpl* web_contents) @@ -224,6 +230,10 @@ struct CookieAccessDescription { CookieAccessDetails::Type type; + ContextType context_type; + GlobalRoutingID frame_id; + int navigation_id = -1; + GURL url; GURL first_party_url; std::string cookie_name; @@ -236,12 +246,26 @@ o << " first_party_url=" << d.first_party_url; o << " name=" << d.cookie_name; o << " value=" << d.cookie_value; + switch (d.context_type) { + case ContextType::kNavigation: + o << " context=navigation("; + o << "id=" << d.navigation_id; + o << ")"; + break; + case ContextType::kFrame: + o << " context=frame("; + o << "process_id=" << d.frame_id.child_id; + o << " frame_id=" << d.frame_id.route_id; + o << ")"; + break; + } return o; } private: auto comparison_key() const { - return std::tie(type, url, first_party_url, cookie_name, cookie_value); + return std::tie(type, url, first_party_url, cookie_name, cookie_value, + frame_id, navigation_id); } public: @@ -250,16 +274,39 @@ } }; - void OnCookiesAccessed(const CookieAccessDetails& details) override { + void OnCookiesAccessed(NavigationHandle* navigation, + const CookieAccessDetails& details) override { for (const auto& cookie : details.cookie_list) { - cookie_accesses_.push_back({details.type, details.url, - details.first_party_url, cookie.Name(), + cookie_accesses_.push_back({details.type, + ContextType::kNavigation, + {}, + navigation->GetNavigationId(), + details.url, + details.first_party_url, + cookie.Name(), cookie.Value()}); } QuitIfReady(); } + void OnCookiesAccessed(RenderFrameHost* rfh, + const CookieAccessDetails& details) override { + for (const auto& cookie : details.cookie_list) { + cookie_accesses_.push_back( + {details.type, + ContextType::kFrame, + {rfh->GetProcess()->GetID(), rfh->GetRoutingID()}, + -1, + details.url, + details.first_party_url, + cookie.Name(), + cookie.Value()}); + } + + QuitIfReady(); + } + void WaitForCookies(size_t count) { waiting_for_cookies_count_ = count; @@ -273,6 +320,32 @@ return cookie_accesses_; } + GlobalRoutingID frame_id(size_t index) { + if (index < frame_ids_.size()) + return frame_ids_[index]; + // Return bogus values which will never be returned by the code we are + // testing. This ensures that if we return this value, the subsequent + // comparison will fail. + return {-42, -42}; + } + + int64_t navigation_id(size_t index) { + if (index < navigation_ids_.size()) + return navigation_ids_[index]; + // Return bogus values which will never be returned by the code we are + // testing. This ensures that if we return this value, the subsequent + // comparison will fail. + return -42; + } + + void DidFinishNavigation(NavigationHandle* navigation) override { + navigation_ids_.push_back(navigation->GetNavigationId()); + } + + void RenderFrameCreated(RenderFrameHost* rfh) override { + frame_ids_.emplace_back(rfh->GetProcess()->GetID(), rfh->GetRoutingID()); + } + private: void QuitIfReady() { if (quit_closure_.is_null()) @@ -284,6 +357,10 @@ std::vector<CookieAccessDescription> cookie_accesses_; + // List of observed navigation and frame ids to be used in testing. + std::vector<GlobalRoutingID> frame_ids_; + std::vector<int64_t> navigation_ids_; + size_t waiting_for_cookies_count_ = 0; base::OnceClosure quit_closure_; }; @@ -309,7 +386,13 @@ EXPECT_THAT( cookie_tracker.cookie_accesses(), testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kChange, - url1, first_party_url, "foo", "bar"})); + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(0), + url1, + first_party_url, + "foo", + "bar"})); cookie_tracker.cookie_accesses().clear(); // 2) Navigate to |url2| on the same site. Given that we have set a cookie @@ -320,8 +403,14 @@ EXPECT_THAT( cookie_tracker.cookie_accesses(), - testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kRead, url2, - first_party_url, "foo", "bar"})); + testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(1), + url2, + first_party_url, + "foo", + "bar"})); cookie_tracker.cookie_accesses().clear(); } @@ -342,14 +431,25 @@ // about this as well). EXPECT_TRUE(NavigateToURL(web_contents(), url1, url1_after_redirect)); - cookie_tracker.WaitForCookies(1); - EXPECT_THAT( - cookie_tracker.cookie_accesses(), - testing::UnorderedElementsAre( - CookieAccess{CookieAccessDetails::Type::kChange, url1, - first_party_url, "foo", "bar"}, - CookieAccess{CookieAccessDetails::Type::kRead, url1_after_redirect, - first_party_url, "foo", "bar"})); + cookie_tracker.WaitForCookies(2); + EXPECT_THAT(cookie_tracker.cookie_accesses(), + testing::UnorderedElementsAre( + CookieAccess{CookieAccessDetails::Type::kChange, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(0), + url1, + first_party_url, + "foo", + "bar"}, + CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(0), + url1_after_redirect, + first_party_url, + "foo", + "bar"})); cookie_tracker.cookie_accesses().clear(); // 2) Navigate to another url on the same site and expect a notification about @@ -359,8 +459,14 @@ cookie_tracker.WaitForCookies(1); EXPECT_THAT( cookie_tracker.cookie_accesses(), - testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kRead, url2, - first_party_url, "foo", "bar"})); + testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(1), + url2, + first_party_url, + "foo", + "bar"})); cookie_tracker.cookie_accesses().clear(); } @@ -384,10 +490,16 @@ cookie_tracker.WaitForCookies(1); // Navigations are: main frame (0), subframe (1). - EXPECT_THAT(cookie_tracker.cookie_accesses(), - testing::ElementsAre( - CookieAccess{CookieAccessDetails::Type::kChange, - url1_subframe, first_party_url, "foo", "bar"})); + EXPECT_THAT( + cookie_tracker.cookie_accesses(), + testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kChange, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(1), + url1_subframe, + first_party_url, + "foo", + "bar"})); cookie_tracker.cookie_accesses().clear(); EXPECT_TRUE(NavigateToURL(web_contents(), url2)); @@ -396,12 +508,24 @@ // cookie read. cookie_tracker.WaitForCookies(2); // Navigations are: main frame (2), subframe (3). - EXPECT_THAT(cookie_tracker.cookie_accesses(), - testing::ElementsAre( - CookieAccess{CookieAccessDetails::Type::kRead, url2, - first_party_url, "foo", "bar"}, - CookieAccess{CookieAccessDetails::Type::kRead, url2_subframe, - first_party_url, "foo", "bar"})); + EXPECT_THAT( + cookie_tracker.cookie_accesses(), + testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(2), + url2, + first_party_url, + "foo", + "bar"}, + CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(3), + url2_subframe, + first_party_url, + "foo", + "bar"})); cookie_tracker.cookie_accesses().clear(); } @@ -426,8 +550,9 @@ cookie_tracker.WaitForCookies(1); EXPECT_THAT(cookie_tracker.cookie_accesses(), testing::ElementsAre( - CookieAccess{CookieAccessDetails::Type::kChange, url1_image, - first_party_url, "foo", "bar"})); + CookieAccess{CookieAccessDetails::Type::kChange, + ContextType::kFrame, cookie_tracker.frame_id(0), + -1, url1_image, first_party_url, "foo", "bar"})); cookie_tracker.cookie_accesses().clear(); // 2) Load a page with subresource. Both the page and the resource should get @@ -437,10 +562,17 @@ cookie_tracker.WaitForCookies(2); EXPECT_THAT(cookie_tracker.cookie_accesses(), testing::ElementsAre( - CookieAccess{CookieAccessDetails::Type::kRead, url2, - first_party_url, "foo", "bar"}, - CookieAccess{CookieAccessDetails::Type::kRead, url2_image, - first_party_url, "foo", "bar"})); + CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kNavigation, + {}, + cookie_tracker.navigation_id(1), + url2, + first_party_url, + "foo", + "bar"}, + CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kFrame, cookie_tracker.frame_id(0), + -1, url2_image, first_party_url, "foo", "bar"})); cookie_tracker.cookie_accesses().clear(); } @@ -455,19 +587,21 @@ EXPECT_TRUE(ExecJs(web_contents(), "document.cookie='foo=bar'")); cookie_tracker.WaitForCookies(1); - EXPECT_THAT( - cookie_tracker.cookie_accesses(), - testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kChange, - url1, first_party_url, "foo", "bar"})); + EXPECT_THAT(cookie_tracker.cookie_accesses(), + testing::ElementsAre( + CookieAccess{CookieAccessDetails::Type::kChange, + ContextType::kFrame, cookie_tracker.frame_id(0), + -1, url1, first_party_url, "foo", "bar"})); cookie_tracker.cookie_accesses().clear(); EXPECT_EQ("foo=bar", EvalJs(web_contents(), "document.cookie")); cookie_tracker.WaitForCookies(1); - EXPECT_THAT( - cookie_tracker.cookie_accesses(), - testing::ElementsAre(CookieAccess{CookieAccessDetails::Type::kRead, url1, - first_party_url, "foo", "bar"})); + EXPECT_THAT(cookie_tracker.cookie_accesses(), + testing::ElementsAre( + CookieAccess{CookieAccessDetails::Type::kRead, + ContextType::kFrame, cookie_tracker.frame_id(0), + -1, url1, first_party_url, "foo", "bar"})); cookie_tracker.cookie_accesses().clear(); }
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index cbee761d..0ae0a63 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc
@@ -235,7 +235,8 @@ return; GpuChildThread* gpu_child_thread = static_cast<GpuChildThread*>(current_child_thread); - gpu_child_thread->viz_main_.ExitProcess(/*immediately=*/true); + gpu_child_thread->viz_main_.ExitProcess( + viz::ExitCode::RESULT_CODE_NORMAL_EXIT); })); }
diff --git a/content/public/browser/cookie_access_details.cc b/content/public/browser/cookie_access_details.cc index 5485ecbb..e0e84f4 100644 --- a/content/public/browser/cookie_access_details.cc +++ b/content/public/browser/cookie_access_details.cc
@@ -20,4 +20,9 @@ cookie_list(cookie_list), blocked_by_policy(blocked_by_policy) {} +CookieAccessDetails::CookieAccessDetails(const CookieAccessDetails& details) = + default; +CookieAccessDetails& CookieAccessDetails::operator=( + const CookieAccessDetails& details) = default; + } // namespace content
diff --git a/content/public/browser/cookie_access_details.h b/content/public/browser/cookie_access_details.h index b1d1d832..56d2d41c 100644 --- a/content/public/browser/cookie_access_details.h +++ b/content/public/browser/cookie_access_details.h
@@ -23,6 +23,9 @@ bool blocked_by_policy = false); ~CookieAccessDetails(); + CookieAccessDetails(const CookieAccessDetails&); + CookieAccessDetails& operator=(const CookieAccessDetails&); + Type type; GURL url; GURL first_party_url;
diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h index 8fc224cd..c47368e8 100644 --- a/content/public/browser/storage_partition.h +++ b/content/public/browser/storage_partition.h
@@ -107,21 +107,6 @@ virtual network::mojom::CookieManager* GetCookieManagerForBrowserProcess() = 0; - // See documentation for - // ContentBrowserClient::WillCreateRestrictedCookieManager for description of - // the parameters. The method here is expected pass things through that hook - // and then go to the NetworkContext if needed. - virtual void CreateRestrictedCookieManager( - network::mojom::RestrictedCookieManagerRole role, - const url::Origin& origin, - const net::SiteForCookies& site_for_cookies, - const url::Origin& top_frame_origin, - bool is_service_worker, - int process_id, - int routing_id, - mojo::PendingReceiver<network::mojom::RestrictedCookieManager> - receiver) = 0; - virtual void CreateHasTrustTokensAnswerer( mojo::PendingReceiver<network::mojom::HasTrustTokensAnswerer> receiver, const url::Origin& top_frame_origin) = 0;
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h index 1cfb09f..c4cc607 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h
@@ -284,10 +284,18 @@ const GlobalRequestID& request_id, const blink::mojom::ResourceLoadInfo& resource_load_info) {} - // This method is invoked when a document or resource reads or sets a cookie. - // Note that this isn't tied to any particular navigation (e.g., it may be - // called after a subsequent navigation commits). - virtual void OnCookiesAccessed(const CookieAccessDetails& details) {} + // Called when document reads or sets a cookie (either via document.cookie or + // issuing a network request). + // Cookie reads/writes for a dedicated worker are attributed to the + // RenderFrameHost which created it. + virtual void OnCookiesAccessed(RenderFrameHost* render_frame_host, + const CookieAccessDetails& details) {} + + // Called when a network request issued by the navigation reads or sets a + // cookie. If a notification is received after the navigation has committed, + // it will be attributed to the RenderFrameHost created by the navigation. + virtual void OnCookiesAccessed(NavigationHandle* navigation_handle, + const CookieAccessDetails& details) {} // This method is invoked when a new non-pending navigation entry is created. // This corresponds to one NavigationController entry being created
diff --git a/content/public/test/android/web_contents_utils.cc b/content/public/test/android/web_contents_utils.cc index 5803fd0..294147d7d 100644 --- a/content/public/test/android/web_contents_utils.cc +++ b/content/public/test/android/web_contents_utils.cc
@@ -7,6 +7,7 @@ #include "base/android/scoped_java_ref.h" #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/web_contents/web_contents_android.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/render_frame_metadata_provider.h" #include "content/public/browser/render_view_host.h" @@ -44,19 +45,14 @@ JNIEnv* env, const JavaParamRef<jobject>& jweb_contents, const JavaParamRef<jstring>& script) { - WebContents* web_contents = WebContents::FromJavaWebContents(jweb_contents); + WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( + WebContents::FromJavaWebContents(jweb_contents)); RenderViewHost* rvh = web_contents->GetRenderViewHost(); DCHECK(rvh); - if (!rvh->IsRenderViewLive()) { - if (!static_cast<WebContentsImpl*>(web_contents) - ->CreateRenderViewForInitialEmptyDocument()) { - LOG(ERROR) - << "Failed to create RenderView in EvaluateJavaScriptWithUserGesture"; - return; - } - } - + if (!web_contents->GetWebContentsAndroid() + ->InitializeRenderFrameForJavaScript()) + return; web_contents->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests( ConvertJavaStringToUTF16(env, script)); }
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 893a1742..5be2e82 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -3424,10 +3424,7 @@ if (RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(process_id, render_frame_id)) { url_loader_factory_params->cookie_observer = - static_cast<StoragePartitionImpl*>( - rfh->GetProcess()->GetStoragePartition()) - ->CreateCookieAccessObserver( - /* is_service_worker=*/false, process_id, render_frame_id); + rfh->CreateCookieAccessObserver(); } url::Origin origin = url::Origin::Create(url); url_loader_factory_params->isolation_info =
diff --git a/content/public/test/test_storage_partition.cc b/content/public/test/test_storage_partition.cc index 0f74de1..c94e579 100644 --- a/content/public/test/test_storage_partition.cc +++ b/content/public/test/test_storage_partition.cc
@@ -41,18 +41,6 @@ return cookie_manager_for_browser_process_; } -void TestStoragePartition::CreateRestrictedCookieManager( - network::mojom::RestrictedCookieManagerRole role, - const url::Origin& origin, - const net::SiteForCookies& site_for_cookies, - const url::Origin& top_frame_origin, - bool is_service_worker, - int process_id, - int routing_id, - mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver) { - NOTREACHED(); -} - void TestStoragePartition::CreateHasTrustTokensAnswerer( mojo::PendingReceiver<network::mojom::HasTrustTokensAnswerer> receiver, const url::Origin& top_frame_origin) {
diff --git a/content/public/test/test_storage_partition.h b/content/public/test/test_storage_partition.h index 46ff7ef..37aca9b 100644 --- a/content/public/test/test_storage_partition.h +++ b/content/public/test/test_storage_partition.h
@@ -65,16 +65,6 @@ cookie_manager_for_browser_process_ = cookie_manager_for_browser_process; } network::mojom::CookieManager* GetCookieManagerForBrowserProcess() override; - void CreateRestrictedCookieManager( - network::mojom::RestrictedCookieManagerRole role, - const url::Origin& origin, - const net::SiteForCookies& site_for_cookies, - const url::Origin& top_frame_origin, - bool is_service_worker, - int process_id, - int routing_id, - mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver) - override; void CreateHasTrustTokensAnswerer( mojo::PendingReceiver<network::mojom::HasTrustTokensAnswerer> receiver,
diff --git a/content/renderer/gpu_benchmarking_extension.cc b/content/renderer/gpu_benchmarking_extension.cc index e6f8714c..4576608 100644 --- a/content/renderer/gpu_benchmarking_extension.cc +++ b/content/renderer/gpu_benchmarking_extension.cc
@@ -618,6 +618,8 @@ .SetMethod("hasGpuChannel", &GpuBenchmarking::HasGpuChannel) .SetMethod("hasGpuProcess", &GpuBenchmarking::HasGpuProcess) .SetMethod("crashGpuProcess", &GpuBenchmarking::CrashGpuProcess) + .SetMethod("terminateGpuProcessNormally", + &GpuBenchmarking::TerminateGpuProcessNormally) .SetMethod("getGpuDriverBugWorkarounds", &GpuBenchmarking::GetGpuDriverBugWorkarounds) .SetMethod("startProfiling", &GpuBenchmarking::StartProfiling) @@ -1253,6 +1255,15 @@ gpu_channel->CrashGpuProcessForTesting(); } +// Terminates the GPU process with an exit code of 0. +void GpuBenchmarking::TerminateGpuProcessNormally() { + gpu::GpuChannelHost* gpu_channel = + RenderThreadImpl::current()->GetGpuChannel(); + if (!gpu_channel) + return; + gpu_channel->TerminateGpuProcessForTesting(); +} + void GpuBenchmarking::GetGpuDriverBugWorkarounds(gin::Arguments* args) { std::vector<std::string> gpu_driver_bug_workarounds; gpu::GpuChannelHost* gpu_channel =
diff --git a/content/renderer/gpu_benchmarking_extension.h b/content/renderer/gpu_benchmarking_extension.h index 7e1e83c..edd2c918 100644 --- a/content/renderer/gpu_benchmarking_extension.h +++ b/content/renderer/gpu_benchmarking_extension.h
@@ -83,6 +83,7 @@ bool HasGpuChannel(); bool HasGpuProcess(); void CrashGpuProcess(); + void TerminateGpuProcessNormally(); void GetGpuDriverBugWorkarounds(gin::Arguments* args); // Starts/stops the sampling profiler. StartProfiling takes one optional
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index f6c6552..acf456f 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn
@@ -248,7 +248,6 @@ "browser/renderer_host/shell_render_widget_host_view_mac_delegate.mm", "browser/shell.cc", "browser/shell.h", - "browser/shell_android.cc", "browser/shell_application_mac.h", "browser/shell_application_mac.mm", "browser/shell_browser_context.cc", @@ -271,11 +270,13 @@ "browser/shell_javascript_dialog_manager.cc", "browser/shell_javascript_dialog_manager.h", "browser/shell_javascript_dialog_win.cc", - "browser/shell_mac.mm", "browser/shell_permission_manager.cc", "browser/shell_permission_manager.h", "browser/shell_platform_data_aura.cc", "browser/shell_platform_data_aura.h", + "browser/shell_platform_delegate.h", + "browser/shell_platform_delegate_android.cc", + "browser/shell_platform_delegate_mac.mm", "browser/shell_plugin_service_filter.cc", "browser/shell_plugin_service_filter.h", "browser/shell_quota_permission_context.cc", @@ -560,7 +561,7 @@ if (toolkit_views && !is_chromecast) { sources += [ - "browser/shell_views.cc", + "browser/shell_platform_delegate_views.cc", "browser/shell_web_contents_view_delegate_views.cc", ] deps += [ @@ -572,7 +573,7 @@ ] } else { sources += [ - "browser/shell_aura.cc", + "browser/shell_platform_delegate_aura.cc", "browser/shell_web_contents_view_delegate_aura.cc", ] }
diff --git a/content/shell/android/java/src/org/chromium/content_shell/Shell.java b/content/shell/android/java/src/org/chromium/content_shell/Shell.java index abc171b..18efab50 100644 --- a/content/shell/android/java/src/org/chromium/content_shell/Shell.java +++ b/content/shell/android/java/src/org/chromium/content_shell/Shell.java
@@ -358,11 +358,6 @@ } } - @CalledByNative - public void sizeTo(int width, int height) { - mWebContents.setSize(width, height); - } - public void setOverayModeChangedCallbackForTesting(Callback<Boolean> callback) { mOverlayModeChangedCallbackForTesting = callback; }
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc index 05c8b3cb..d8c95f9 100644 --- a/content/shell/browser/shell.cc +++ b/content/shell/browser/shell.cc
@@ -33,6 +33,7 @@ #include "content/public/browser/renderer_preferences_util.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h" +#include "content/shell/app/resource.h" #include "content/shell/browser/shell_content_browser_client.h" #include "content/shell/browser/shell_devtools_frontend.h" #include "content/shell/browser/shell_javascript_dialog_manager.h" @@ -59,6 +60,8 @@ std::vector<Shell*> Shell::windows_; base::OnceCallback<void(Shell*)> Shell::shell_created_callback_; +ShellPlatformDelegate* g_platform; + class Shell::DevToolsWebContentsObserver : public WebContentsObserver { public: DevToolsWebContentsObserver(Shell* shell, WebContents* web_contents) @@ -80,15 +83,7 @@ Shell::Shell(std::unique_ptr<WebContents> web_contents, bool should_set_delegate) : WebContentsObserver(web_contents.get()), - web_contents_(std::move(web_contents)), - devtools_frontend_(nullptr), - is_fullscreen_(false), - window_(nullptr), -#if defined(OS_MACOSX) - url_edit_view_(NULL), -#endif - headless_(false), - hide_toolbar_(false) { + web_contents_(std::move(web_contents)) { if (should_set_delegate) web_contents_->SetDelegate(this); @@ -100,10 +95,6 @@ web_contents_->GetMutableRendererPrefs()); } - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kContentShellHideToolbar)) - hide_toolbar_ = true; - windows_.push_back(this); if (shell_created_callback_) @@ -111,7 +102,7 @@ } Shell::~Shell() { - PlatformCleanUp(); + g_platform->CleanUp(this); for (size_t i = 0; i < windows_.size(); ++i) { if (windows_[i] == this) { @@ -120,15 +111,20 @@ } } - // Always destroy WebContents before calling PlatformExit(). WebContents - // destruction sequence may depend on the resources destroyed in - // PlatformExit() (e.g. the display::Screen singleton). + // Always destroy WebContents before destroying ShellPlatformDelegate. + // WebContents destruction sequence may depend on the resources destroyed with + // ShellPlatformDelegate (e.g. the display::Screen singleton). web_contents_->SetDelegate(nullptr); web_contents_.reset(); if (windows_.empty()) { - if (headless_) - PlatformExit(); + // TODO(danakj): Do we need both this one and the call in CloseAllWindows()? + // Can we just always destroy ShellPlatformDelegate in one place? + if (headless_) { + delete g_platform; + g_platform = nullptr; + } + for (auto it = RenderProcessHost::AllHostsIterator(); !it.IsAtEnd(); it.Advance()) { it.GetCurrentValue()->DisableKeepAliveRefCount(); @@ -143,11 +139,8 @@ bool should_set_delegate) { WebContents* raw_web_contents = web_contents.get(); Shell* shell = new Shell(std::move(web_contents), should_set_delegate); - shell->PlatformCreateWindow(initial_size.width(), initial_size.height()); - - shell->PlatformSetContents(); - - shell->PlatformResizeSubViews(); + g_platform->CreatePlatformWindow(shell, initial_size); + g_platform->SetContents(shell); // Note: Do not make RenderFrameHost or RenderViewHost specific state changes // here, because they will be forgotten after a cross-process navigation. Use @@ -169,19 +162,26 @@ void Shell::CloseAllWindows() { DevToolsAgentHost::DetachAllClients(); - std::vector<Shell*> open_windows(windows_); - for (size_t i = 0; i < open_windows.size(); ++i) - open_windows[i]->Close(); - // Pump the message loop to allow window teardown tasks to run. - base::RunLoop().RunUntilIdle(); + if (windows_.empty()) { + if (*g_quit_main_message_loop) + std::move(*g_quit_main_message_loop).Run(); + } else { + std::vector<Shell*> open_windows(windows_); + for (Shell* open_window : open_windows) + open_window->Close(); + DCHECK(windows_.empty()); - // If there were no windows open then the message loop quit closure will - // not have been run. - if (*g_quit_main_message_loop) - std::move(*g_quit_main_message_loop).Run(); + // Pump the message loop to allow window teardown tasks to run. + base::RunLoop().RunUntilIdle(); + } - PlatformExit(); + // The |g_platform| is destroyed when the last window is closed, but only + // in headless mode. + if (g_platform) { + delete g_platform; + g_platform = nullptr; + } } void Shell::SetMainMessageLoopQuitClosure(base::OnceClosure quit_closure) { @@ -199,6 +199,12 @@ shell_created_callback_ = std::move(shell_created_callback); } +// static +bool Shell::ShouldHideToolbar() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kContentShellHideToolbar); +} + Shell* Shell::FromWebContents(WebContents* web_contents) { for (Shell* window : windows_) { if (window->web_contents() && window->web_contents() == web_contents) { @@ -208,8 +214,9 @@ return nullptr; } -void Shell::Initialize() { - PlatformInitialize(GetShellDefaultSize()); +void Shell::Initialize(std::unique_ptr<ShellPlatformDelegate> platform) { + g_platform = platform.release(); + g_platform->Initialize(GetShellDefaultSize()); } gfx::Size Shell::AdjustWindowSize(const gfx::Size& initial_size) { @@ -357,9 +364,12 @@ int current_index = web_contents_->GetController().GetCurrentEntryIndex(); int max_index = web_contents_->GetController().GetEntryCount() - 1; - PlatformEnableUIControl(BACK_BUTTON, current_index > 0); - PlatformEnableUIControl(FORWARD_BUTTON, current_index < max_index); - PlatformEnableUIControl(STOP_BUTTON, + g_platform->EnableUIControl(this, ShellPlatformDelegate::BACK_BUTTON, + current_index > 0); + g_platform->EnableUIControl(this, ShellPlatformDelegate::FORWARD_BUTTON, + current_index < max_index); + g_platform->EnableUIControl( + this, ShellPlatformDelegate::STOP_BUTTON, to_different_document && web_contents_->IsLoading()); } @@ -381,12 +391,52 @@ devtools_frontend_ = nullptr; } +#if defined(OS_MACOSX) +void Shell::ResizeWebContentForTests(const gfx::Size& content_size) { + g_platform->ResizeWebContent(this, content_size); +} +#endif + gfx::NativeView Shell::GetContentView() { if (!web_contents_) return nullptr; return web_contents_->GetNativeView(); } +#if !defined(OS_ANDROID) +gfx::NativeWindow Shell::window() { + return g_platform->GetNativeWindow(this); +} +#endif + +#if defined(OS_MACOSX) +void Shell::ActionPerformed(int control) { + switch (control) { + case IDC_NAV_BACK: + GoBackOrForward(-1); + break; + case IDC_NAV_FORWARD: + GoBackOrForward(1); + break; + case IDC_NAV_RELOAD: + Reload(); + break; + case IDC_NAV_STOP: + Stop(); + break; + } +} + +void Shell::URLEntered(const std::string& url_string) { + if (!url_string.empty()) { + GURL url(url_string); + if (!url.has_scheme()) + url = GURL("http://" + url_string); + LoadURL(url); + } +} +#endif + WebContents* Shell::OpenURLFromTab(WebContents* source, const OpenURLParams& params) { WebContents* target = nullptr; @@ -441,9 +491,15 @@ void Shell::LoadingStateChanged(WebContents* source, bool to_different_document) { UpdateNavigationControls(to_different_document); - PlatformSetIsLoading(source->IsLoading()); + g_platform->SetIsLoading(this, source->IsLoading()); } +#if defined(OS_ANDROID) +void Shell::SetOverlayMode(bool use_overlay_mode) { + g_platform->SetOverlayMode(this, use_overlay_mode); +} +#endif + void Shell::EnterFullscreenModeForTab( WebContents* web_contents, const GURL& origin, @@ -458,7 +514,7 @@ void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, bool enter_fullscreen) { #if defined(OS_ANDROID) - PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen); + g_platform->ToggleFullscreenModeForTab(this, web_contents, enter_fullscreen); #endif if (is_fullscreen_ != enter_fullscreen) { is_fullscreen_ = enter_fullscreen; @@ -470,7 +526,7 @@ bool Shell::IsFullscreenForTabOrPending(const WebContents* web_contents) { #if defined(OS_ANDROID) - return PlatformIsFullscreenForTabOrPending(web_contents); + return g_platform->IsFullscreenForTabOrPending(this, web_contents); #else return is_fullscreen_; #endif @@ -493,6 +549,13 @@ blink::mojom::PointerLockResult::kSuccess); } +void Shell::Close() { + // Shell is "self-owned" and destroys itself. The ShellPlatformDelegate + // has the chance to co-opt this and do its own destruction. + if (!g_platform->DestroyShell(this)) + delete this; +} + void Shell::CloseContents(WebContents* source) { Close(); } @@ -508,7 +571,7 @@ void Shell::NavigationStateChanged(WebContents* source, InvalidateTypes changed_flags) { if (changed_flags & INVALIDATE_TYPE_URL) - PlatformSetAddressBarURL(source->GetVisibleURL()); + g_platform->SetAddressBarURL(this, source->GetVisibleURL()); } JavaScriptDialogManager* Shell::GetJavaScriptDialogManager( @@ -537,6 +600,13 @@ return std::make_unique<FakeBluetoothScanningPrompt>(event_handler); } +#if defined(OS_MACOSX) +bool Shell::HandleKeyboardEvent(WebContents* source, + const NativeWebKeyboardEvent& event) { + return g_platform->HandleKeyboardEvent(this, source, event); +} +#endif + bool Shell::DidAddMessageToConsole(WebContents* source, blink::mojom::ConsoleMessageLevel log_level, const base::string16& message, @@ -567,7 +637,7 @@ // focusing the WebContents would cause the OS to focus the window. Because // headless mac doesn't actually have system windows, we can't go down the // normal path and have to fake it out in the browser process. - PlatformActivateContents(contents); + g_platform->ActivateContents(this, contents); #endif } @@ -583,8 +653,8 @@ shell_devtools_bindings->UpdateInspectedWebContents(portal_contents.get()); } std::swap(web_contents_, portal_contents); - PlatformSetContents(); - PlatformSetAddressBarURL(web_contents_->GetVisibleURL()); + g_platform->SetContents(this); + g_platform->SetAddressBarURL(this, web_contents_->GetVisibleURL()); LoadingStateChanged(web_contents_.get(), true); return portal_contents; } @@ -637,9 +707,15 @@ return default_shell_size; } +#if defined(OS_ANDROID) +void Shell::LoadProgressChanged(double progress) { + g_platform->LoadProgressChanged(this, progress); +} +#endif + void Shell::TitleWasSet(NavigationEntry* entry) { if (entry) - PlatformSetTitle(entry->GetTitle()); + g_platform->SetTitle(this, entry->GetTitle()); } void Shell::OnDevToolsWebContentsDestroyed() {
diff --git a/content/shell/browser/shell.h b/content/shell/browser/shell.h index 17299a9f..b64497f 100644 --- a/content/shell/browser/shell.h +++ b/content/shell/browser/shell.h
@@ -17,35 +17,14 @@ #include "content/public/browser/session_storage_namespace.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" +#include "content/shell/browser/shell_platform_delegate.h" #include "ipc/ipc_channel.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/native_widget_types.h" -#if defined(OS_ANDROID) -#include "base/android/scoped_java_ref.h" -#elif defined(USE_AURA) -#if defined(OS_CHROMEOS) - -namespace wm { -class WMTestHelper; -} -#endif // defined(OS_CHROMEOS) -namespace views { -class Widget; -class ViewsDelegate; -} -namespace wm { -class WMState; -} -#endif // defined(USE_AURA) - class GURL; + namespace content { - -#if defined(USE_AURA) -class ShellPlatformDataAura; -#endif - class BrowserContext; class ShellDevToolsFrontend; class ShellJavaScriptDialogManager; @@ -81,14 +60,13 @@ void Close(); void ShowDevTools(); void CloseDevTools(); - bool hide_toolbar() { return hide_toolbar_; } -#if defined(OS_MACOSX) || defined(OS_ANDROID) +#if defined(OS_MACOSX) // Resizes the web content view to the given dimensions. - void SizeTo(const gfx::Size& content_size); + void ResizeWebContentForTests(const gfx::Size& content_size); #endif - // Do one time initialization at application startup. - static void Initialize(); + // Do one-time initialization at application startup. + static void Initialize(std::unique_ptr<ShellPlatformDelegate> platform); static Shell* CreateNewWindow( BrowserContext* browser_context, @@ -125,8 +103,13 @@ static void SetShellCreatedCallback( base::OnceCallback<void(Shell*)> shell_created_callback); + static bool ShouldHideToolbar(); + WebContents* web_contents() const { return web_contents_.get(); } - gfx::NativeWindow window() { return window_; } + +#if !defined(OS_ANDROID) + gfx::NativeWindow window(); +#endif #if defined(OS_MACOSX) // Public to be called by an ObjC bridge object. @@ -206,13 +189,19 @@ delay_popup_contents_delegate_for_testing_ = delay; } - private: - enum UIControl { - BACK_BUTTON, - FORWARD_BUTTON, - STOP_BUTTON - }; + // This pointer is owned and used only by ShellPlatformDelegate. + void set_platform_data(ShellPlatformDelegate::ShellData* data) { + platform_data_ = data; + } + ShellPlatformDelegate::ShellData* platform_data() const { + return platform_data_; + } + // TODO(danakj): Move this to WebTestShellPlatformDelegate (a test-only + // subclass of ShellPlatformDelegate that does not exist yet). + bool headless() const { return headless_; } + + private: class DevToolsWebContentsObserver; Shell(std::unique_ptr<WebContents> web_contents, bool should_set_delegate); @@ -222,44 +211,10 @@ const gfx::Size& initial_size, bool should_set_delegate); - // Helper for one time initialization of application - static void PlatformInitialize(const gfx::Size& default_window_size); - // Helper for one time deinitialization of platform specific state. - static void PlatformExit(); - // Adjust the size when Blink sends 0 for width and/or height. // This happens when Blink requests a default-sized window. static gfx::Size AdjustWindowSize(const gfx::Size& initial_size); - // All the methods that begin with Platform need to be implemented by the - // platform specific Shell implementation. - // Called from the destructor to let each platform do any necessary cleanup. - void PlatformCleanUp(); - // Creates the main window GUI. - void PlatformCreateWindow(int width, int height); - // Links the WebContents into the newly created window. - void PlatformSetContents(); - // Resize the content area and GUI. - void PlatformResizeSubViews(); - // Enable/disable a button. - void PlatformEnableUIControl(UIControl control, bool is_enabled); - // Updates the url in the url bar. - void PlatformSetAddressBarURL(const GURL& url); - // Sets whether the spinner is spinning. - void PlatformSetIsLoading(bool loading); - // Set the title of shell window - void PlatformSetTitle(const base::string16& title); -#if defined(OS_MACOSX) - // Activate (make key) the native window, and focus the web contents. - void PlatformActivateContents(WebContents* contents); -#endif -#if defined(OS_ANDROID) - void PlatformToggleFullscreenModeForTab(WebContents* web_contents, - bool enter_fullscreen); - bool PlatformIsFullscreenForTabOrPending( - const WebContents* web_contents) const; -#endif - // Helper method for the two public LoadData methods. void LoadDataWithBaseURLInternal(const GURL& url, const std::string& data, @@ -278,40 +233,20 @@ void OnDevToolsWebContentsDestroyed(); + ShellPlatformDelegate::ShellData* platform_data_ = nullptr; + std::unique_ptr<ShellJavaScriptDialogManager> dialog_manager_; std::unique_ptr<WebContents> web_contents_; std::unique_ptr<DevToolsWebContentsObserver> devtools_observer_; - ShellDevToolsFrontend* devtools_frontend_; + ShellDevToolsFrontend* devtools_frontend_ = nullptr; - bool is_fullscreen_; - - gfx::NativeWindow window_; -#if defined(OS_MACOSX) - NSTextField* url_edit_view_; -#endif + bool is_fullscreen_ = false; gfx::Size content_size_; -#if defined(OS_ANDROID) - base::android::ScopedJavaGlobalRef<jobject> java_object_; -#elif defined(USE_AURA) -#if defined(OS_CHROMEOS) - static wm::WMTestHelper* wm_test_helper_; -#else - static wm::WMState* wm_state_; -#endif -#if defined(TOOLKIT_VIEWS) - static views::ViewsDelegate* views_delegate_; - - views::Widget* window_widget_; -#endif // defined(TOOLKIT_VIEWS) - static ShellPlatformDataAura* platform_; -#endif // defined(USE_AURA) - - bool headless_; - bool hide_toolbar_; + bool headless_ = false; bool delay_popup_contents_delegate_for_testing_ = false; // A container of all the open windows. We use a vector so we can keep track
diff --git a/content/shell/browser/shell_android.cc b/content/shell/browser/shell_android.cc deleted file mode 100644 index 7e5584b..0000000 --- a/content/shell/browser/shell_android.cc +++ /dev/null
@@ -1,116 +0,0 @@ -// Copyright 2013 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 "content/shell/browser/shell.h" - -#include <jni.h> - -#include "base/android/jni_string.h" -#include "base/android/scoped_java_ref.h" -#include "base/command_line.h" -#include "base/notreached.h" -#include "base/strings/string_piece.h" -#include "content/public/browser/web_contents.h" -#include "content/public/common/content_switches.h" -#include "content/shell/android/content_shell_jni_headers/Shell_jni.h" -#include "content/shell/android/shell_manager.h" - -using base::android::AttachCurrentThread; -using base::android::ConvertUTF8ToJavaString; -using base::android::JavaParamRef; -using base::android::ScopedJavaLocalRef; - -namespace content { - -void Shell::PlatformInitialize(const gfx::Size& default_window_size) { -} - -void Shell::PlatformExit() { - DestroyShellManager(); -} - -void Shell::PlatformCleanUp() { - JNIEnv* env = AttachCurrentThread(); - if (java_object_.is_null()) - return; - Java_Shell_onNativeDestroyed(env, java_object_); -} - -void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { - JNIEnv* env = AttachCurrentThread(); - if (java_object_.is_null()) - return; - Java_Shell_enableUiControl(env, java_object_, control, is_enabled); -} - -void Shell::PlatformSetAddressBarURL(const GURL& url) { - JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); - Java_Shell_onUpdateUrl(env, java_object_, j_url); -} - -void Shell::PlatformSetIsLoading(bool loading) { - JNIEnv* env = AttachCurrentThread(); - Java_Shell_setIsLoading(env, java_object_, loading); -} - -void Shell::PlatformCreateWindow(int width, int height) { - java_object_.Reset(CreateShellView(this)); -} - -void Shell::PlatformSetContents() { - JNIEnv* env = AttachCurrentThread(); - Java_Shell_initFromNativeTabContents(env, java_object_, - web_contents()->GetJavaWebContents()); -} - -void Shell::PlatformResizeSubViews() { - // Not needed; subviews are bound. -} - -void Shell::SizeTo(const gfx::Size& content_size) { - JNIEnv* env = AttachCurrentThread(); - Java_Shell_sizeTo(env, java_object_, content_size.width(), - content_size.height()); -} - -void Shell::PlatformSetTitle(const base::string16& title) { - NOTIMPLEMENTED() << ": " << title; -} - -void Shell::SetOverlayMode(bool use_overlay_mode) { - JNIEnv* env = base::android::AttachCurrentThread(); - return Java_Shell_setOverlayMode(env, java_object_, use_overlay_mode); -} - -void Shell::PlatformToggleFullscreenModeForTab(WebContents* web_contents, - bool enter_fullscreen) { - JNIEnv* env = AttachCurrentThread(); - Java_Shell_toggleFullscreenModeForTab(env, java_object_, enter_fullscreen); -} - -bool Shell::PlatformIsFullscreenForTabOrPending( - const WebContents* web_contents) const { - JNIEnv* env = AttachCurrentThread(); - return Java_Shell_isFullscreenForTabOrPending(env, java_object_); -} - -void Shell::LoadProgressChanged(double progress) { - JNIEnv* env = AttachCurrentThread(); - Java_Shell_onLoadProgressChanged(env, java_object_, progress); -} - -void Shell::Close() { - RemoveShellView(java_object_); - delete this; -} - -// static -void JNI_Shell_CloseShell(JNIEnv* env, - jlong shellPtr) { - Shell* shell = reinterpret_cast<Shell*>(shellPtr); - shell->Close(); -} - -} // namespace content
diff --git a/content/shell/browser/shell_aura.cc b/content/shell/browser/shell_aura.cc deleted file mode 100644 index 10ae46aa..0000000 --- a/content/shell/browser/shell_aura.cc +++ /dev/null
@@ -1,60 +0,0 @@ -// Copyright 2013 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 "content/shell/browser/shell.h" - -#include "content/public/browser/web_contents.h" -#include "content/shell/browser/shell_platform_data_aura.h" -#include "ui/aura/env.h" -#include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" - -namespace content { - -// static -void Shell::PlatformInitialize(const gfx::Size& default_window_size) { - CHECK(!platform_); - platform_ = new ShellPlatformDataAura(default_window_size); -} - -void Shell::PlatformExit() { - delete platform_; - platform_ = nullptr; -} - -void Shell::PlatformCleanUp() {} - -void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) {} - -void Shell::PlatformSetAddressBarURL(const GURL& url) {} - -void Shell::PlatformSetIsLoading(bool loading) {} - -void Shell::PlatformCreateWindow(int width, int height) { - CHECK(platform_); - if (!headless_) - platform_->ShowWindow(); - platform_->ResizeWindow(gfx::Size(width, height)); - window_ = platform_->host()->window(); -} - -void Shell::PlatformSetContents() { - CHECK(platform_); - aura::Window* content = web_contents_->GetNativeView(); - aura::Window* parent = platform_->host()->window(); - if (!parent->Contains(content)) - parent->AddChild(content); - - content->Show(); -} - -void Shell::PlatformResizeSubViews() {} - -void Shell::Close() { - delete this; -} - -void Shell::PlatformSetTitle(const base::string16& title) {} - -} // namespace content
diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc index 99f7e987..d5d2fda 100644 --- a/content/shell/browser/shell_browser_main_parts.cc +++ b/content/shell/browser/shell_browser_main_parts.cc
@@ -24,6 +24,7 @@ #include "content/shell/browser/shell.h" #include "content/shell/browser/shell_browser_context.h" #include "content/shell/browser/shell_devtools_manager_delegate.h" +#include "content/shell/browser/shell_platform_delegate.h" #include "content/shell/common/shell_switches.h" #include "device/bluetooth/bluetooth_adapter_factory.h" #include "net/base/filename_util.h" @@ -181,7 +182,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() { InitializeBrowserContexts(); - Shell::Initialize(); + Shell::Initialize(CreateShellPlatformDelegate()); net::NetModule::SetResourceProvider(PlatformResourceProvider); ShellDevToolsManagerDelegate::StartHttpHandler(browser_context_.get()); InitializeMessageLoopContext(); @@ -222,4 +223,9 @@ #endif } +std::unique_ptr<ShellPlatformDelegate> +ShellBrowserMainParts::CreateShellPlatformDelegate() { + return std::make_unique<ShellPlatformDelegate>(); +} + } // namespace
diff --git a/content/shell/browser/shell_browser_main_parts.h b/content/shell/browser/shell_browser_main_parts.h index 87c5f47..935065a 100644 --- a/content/shell/browser/shell_browser_main_parts.h +++ b/content/shell/browser/shell_browser_main_parts.h
@@ -22,6 +22,7 @@ #endif namespace content { +class ShellPlatformDelegate; class ShellBrowserMainParts : public BrowserMainParts { public: @@ -48,6 +49,9 @@ protected: virtual void InitializeBrowserContexts(); virtual void InitializeMessageLoopContext(); + // Gets the ShellPlatformDelegate to be used. May be a subclass of + // ShellPlatformDelegate to change behaviour based on platform or for tests. + virtual std::unique_ptr<ShellPlatformDelegate> CreateShellPlatformDelegate(); void set_browser_context(ShellBrowserContext* context) { browser_context_.reset(context);
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc index 8290f96f..bd0a322 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc
@@ -134,8 +134,7 @@ return g_browser_client; } -ShellContentBrowserClient::ShellContentBrowserClient() - : shell_browser_main_parts_(nullptr) { +ShellContentBrowserClient::ShellContentBrowserClient() { DCHECK(!g_browser_client); g_browser_client = this; }
diff --git a/content/shell/browser/shell_content_browser_client.h b/content/shell/browser/shell_content_browser_client.h index 1a1580f..c79bc97 100644 --- a/content/shell/browser/shell_content_browser_client.h +++ b/content/shell/browser/shell_content_browser_client.h
@@ -17,7 +17,6 @@ #include "services/network/public/mojom/network_context.mojom-forward.h" namespace content { - class ShellBrowserContext; class ShellBrowserMainParts; @@ -89,23 +88,19 @@ bool first_auth_attempt, LoginAuthRequiredCallback auth_required_callback) override; base::FilePath GetSandboxedStorageServiceDataDirectory() override; - std::string GetUserAgent() override; blink::UserAgentMetadata GetUserAgentMetadata() override; - void OverrideURLLoaderFactoryParams( BrowserContext* browser_context, const url::Origin& origin, bool is_for_isolated_world, network::mojom::URLLoaderFactoryParams* factory_params) override; - #if defined(OS_LINUX) || defined(OS_ANDROID) void GetAdditionalMappedFilesForChildProcess( const base::CommandLine& command_line, int child_process_id, content::PosixFileDescriptorInfo* mappings) override; #endif // defined(OS_LINUX) || defined(OS_ANDROID) - mojo::Remote<network::mojom::NetworkContext> CreateNetworkContext( BrowserContext* context, bool in_memory, @@ -191,7 +186,7 @@ register_browser_interface_binders_for_frame_callback_; // Owned by content::BrowserMainLoop. - ShellBrowserMainParts* shell_browser_main_parts_; + ShellBrowserMainParts* shell_browser_main_parts_ = nullptr; }; // The delay for sending reports when running with --run-web-tests
diff --git a/content/shell/browser/shell_platform_data_aura.cc b/content/shell/browser/shell_platform_data_aura.cc index 3d12b2ea..3f9dd25 100644 --- a/content/shell/browser/shell_platform_data_aura.cc +++ b/content/shell/browser/shell_platform_data_aura.cc
@@ -77,8 +77,6 @@ } -ShellPlatformDataAura* Shell::platform_ = nullptr; - ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) { CHECK(aura::Env::GetInstance());
diff --git a/content/shell/browser/shell_platform_delegate.h b/content/shell/browser/shell_platform_delegate.h new file mode 100644 index 0000000..8b5dd712 --- /dev/null +++ b/content/shell/browser/shell_platform_delegate.h
@@ -0,0 +1,110 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_SHELL_BROWSER_SHELL_PLATFORM_DELEGATE_H_ +#define CONTENT_SHELL_BROWSER_SHELL_PLATFORM_DELEGATE_H_ + +#include "base/strings/string16.h" +#include "build/build_config.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/native_widget_types.h" + +#if defined(OS_MACOSX) +#include "content/public/browser/native_web_keyboard_event.h" +#endif + +class GURL; + +namespace content { +class Shell; +class WebContents; + +class ShellPlatformDelegate { + public: + enum UIControl { BACK_BUTTON, FORWARD_BUTTON, STOP_BUTTON }; + + // Data held for each Shell instance, since there is one ShellPlatformDelegate + // for the whole browser process (shared across Shells). This is defined for + // each platform implementation. + struct ShellData; + + ShellPlatformDelegate(); + virtual ~ShellPlatformDelegate(); + + // Helper for one time initialization of application. + virtual void Initialize(const gfx::Size& default_window_size); + + // Called after creating a Shell instance, with its initial size. + virtual void CreatePlatformWindow(Shell* shell, + const gfx::Size& initial_size); + + // Called from the Shell destructor to let each platform do any necessary + // cleanup. + virtual void CleanUp(Shell* shell); + + // Links the WebContents into the newly created window. + virtual void SetContents(Shell* shell); + + // Enable/disable a button. + virtual void EnableUIControl(Shell* shell, + UIControl control, + bool is_enabled); + + // Updates the url in the url bar. + virtual void SetAddressBarURL(Shell* shell, const GURL& url); + + // Sets whether the spinner is spinning. + virtual void SetIsLoading(Shell* shell, bool loading); + + // Set the title of shell window + virtual void SetTitle(Shell* shell, const base::string16& title); + + // Destroy the Shell. Returns true if the ShellPlatformDelegate did the + // destruction. Returns false if the Shell should destroy itself. + virtual bool DestroyShell(Shell* shell); + +#if !defined(OS_ANDROID) + // Returns the native window. Valid after calling CreatePlatformWindow(). + virtual gfx::NativeWindow GetNativeWindow(Shell* shell); +#endif + +#if defined(OS_MACOSX) + // Resize the web contents in the shell window to the given size. + void ResizeWebContent(Shell* shell, const gfx::Size& content_size); + + // Activate (make key) the native window, and focus the web contents. + virtual void ActivateContents(Shell* shell, WebContents* contents); + + // Handle + virtual bool HandleKeyboardEvent(Shell* shell, + WebContents* source, + const NativeWebKeyboardEvent& event); +#endif + +#if defined(OS_ANDROID) + void ToggleFullscreenModeForTab(Shell* shell, + WebContents* web_contents, + bool enter_fullscreen); + + bool IsFullscreenForTabOrPending(Shell* shell, + const WebContents* web_contents) const; + + // Forwarded from WebContentsDelegate. + void SetOverlayMode(Shell* shell, bool use_overlay_mode); + + // Forwarded from WebContentsObserver. + void LoadProgressChanged(Shell* shell, double progress); +#endif + + private: + // Data held in ShellPlatformDelegate that is shared between all Shells. This + // is created in Initialize(), and is defined for each platform + // implementation. + struct PlatformData; + std::unique_ptr<PlatformData> platform_; +}; + +} // namespace content + +#endif // CONTENT_SHELL_BROWSER_SHELL_PLATFORM_DELEGATE_H_
diff --git a/content/shell/browser/shell_platform_delegate_android.cc b/content/shell/browser/shell_platform_delegate_android.cc new file mode 100644 index 0000000..833c470 --- /dev/null +++ b/content/shell/browser/shell_platform_delegate_android.cc
@@ -0,0 +1,150 @@ +// Copyright 2020 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 "content/shell/browser/shell_platform_delegate.h" + +#include <jni.h> + +#include "base/android/jni_string.h" +#include "base/android/scoped_java_ref.h" +#include "base/command_line.h" +#include "base/notreached.h" +#include "base/strings/string_piece.h" +#include "content/public/browser/web_contents.h" +#include "content/public/common/content_switches.h" +#include "content/shell/android/content_shell_jni_headers/Shell_jni.h" +#include "content/shell/android/shell_manager.h" +#include "content/shell/browser/shell.h" + +using base::android::AttachCurrentThread; +using base::android::ConvertUTF8ToJavaString; +using base::android::JavaParamRef; +using base::android::ScopedJavaLocalRef; + +namespace content { + +struct ShellPlatformDelegate::ShellData { + base::android::ScopedJavaGlobalRef<jobject> java_object; +}; + +struct ShellPlatformDelegate::PlatformData {}; + +ShellPlatformDelegate::ShellPlatformDelegate() = default; + +void ShellPlatformDelegate::Initialize(const gfx::Size& default_window_size) { + // |platform_| is not used on this platform. +} + +ShellPlatformDelegate::~ShellPlatformDelegate() { + DestroyShellManager(); +} + +void ShellPlatformDelegate::CreatePlatformWindow( + Shell* shell, + const gfx::Size& initial_size) { + ShellData* shell_data = new ShellData; + shell->set_platform_data(shell_data); + + shell_data->java_object.Reset(CreateShellView(shell)); +} + +void ShellPlatformDelegate::CleanUp(Shell* shell) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + RemoveShellView(shell_data->java_object); + + if (!shell_data->java_object.is_null()) + Java_Shell_onNativeDestroyed(env, shell_data->java_object); + + delete shell_data; + // This shouldn't be used anymore, but just in case. + shell->set_platform_data(nullptr); +} + +void ShellPlatformDelegate::SetContents(Shell* shell) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + Java_Shell_initFromNativeTabContents( + env, shell_data->java_object, + shell->web_contents()->GetJavaWebContents()); +} + +void ShellPlatformDelegate::EnableUIControl(Shell* shell, + UIControl control, + bool is_enabled) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + if (shell_data->java_object.is_null()) + return; + Java_Shell_enableUiControl(env, shell_data->java_object, control, is_enabled); +} + +void ShellPlatformDelegate::SetAddressBarURL(Shell* shell, const GURL& url) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); + Java_Shell_onUpdateUrl(env, shell_data->java_object, j_url); +} + +void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + Java_Shell_setIsLoading(env, shell_data->java_object, loading); +} + +void ShellPlatformDelegate::SetTitle(Shell* shell, + const base::string16& title) {} + +bool ShellPlatformDelegate::DestroyShell(Shell* shell) { + return false; // Shell destroys itself. +} + +void ShellPlatformDelegate::ToggleFullscreenModeForTab( + Shell* shell, + WebContents* web_contents, + bool enter_fullscreen) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + Java_Shell_toggleFullscreenModeForTab(env, shell_data->java_object, + enter_fullscreen); +} + +bool ShellPlatformDelegate::IsFullscreenForTabOrPending( + Shell* shell, + const WebContents* web_contents) const { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + return Java_Shell_isFullscreenForTabOrPending(env, shell_data->java_object); +} + +void ShellPlatformDelegate::SetOverlayMode(Shell* shell, + bool use_overlay_mode) { + JNIEnv* env = base::android::AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + return Java_Shell_setOverlayMode(env, shell_data->java_object, + use_overlay_mode); +} + +void ShellPlatformDelegate::LoadProgressChanged(Shell* shell, double progress) { + JNIEnv* env = AttachCurrentThread(); + ShellData* shell_data = shell->platform_data(); + + Java_Shell_onLoadProgressChanged(env, shell_data->java_object, progress); +} + +// static +void JNI_Shell_CloseShell(JNIEnv* env, jlong shellPtr) { + Shell* shell = reinterpret_cast<Shell*>(shellPtr); + shell->Close(); +} + +} // namespace content
diff --git a/content/shell/browser/shell_platform_delegate_aura.cc b/content/shell/browser/shell_platform_delegate_aura.cc new file mode 100644 index 0000000..802947e --- /dev/null +++ b/content/shell/browser/shell_platform_delegate_aura.cc
@@ -0,0 +1,85 @@ +// Copyright 2020 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 "content/shell/browser/shell_platform_delegate.h" + +#include "content/public/browser/web_contents.h" +#include "content/shell/browser/shell.h" +#include "content/shell/browser/shell_platform_data_aura.h" +#include "ui/aura/env.h" +#include "ui/aura/window.h" +#include "ui/aura/window_event_dispatcher.h" + +namespace content { + +struct ShellPlatformDelegate::ShellData { + gfx::NativeWindow window; +}; + +struct ShellPlatformDelegate::PlatformData { + std::unique_ptr<ShellPlatformDataAura> aura; +}; + +ShellPlatformDelegate::ShellPlatformDelegate() = default; +ShellPlatformDelegate::~ShellPlatformDelegate() = default; + +void ShellPlatformDelegate::Initialize(const gfx::Size& default_window_size) { + platform_ = std::make_unique<PlatformData>(); + platform_->aura = + std::make_unique<ShellPlatformDataAura>(default_window_size); +} + +void ShellPlatformDelegate::CreatePlatformWindow( + Shell* shell, + const gfx::Size& initial_size) { + ShellData* shell_data = new ShellData; + shell->set_platform_data(shell_data); + + if (!shell->headless()) + platform_->aura->ShowWindow(); + platform_->aura->ResizeWindow(initial_size); + + shell_data->window = platform_->aura->host()->window(); +} + +gfx::NativeWindow ShellPlatformDelegate::GetNativeWindow(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + return shell_data->window; +} + +void ShellPlatformDelegate::CleanUp(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + + // Any ShellData cleanup happens here. + + delete shell_data; + // This shouldn't be used anymore, but just in case. + shell->set_platform_data(nullptr); +} + +void ShellPlatformDelegate::SetContents(Shell* shell) { + aura::Window* content = shell->web_contents()->GetNativeView(); + aura::Window* parent = platform_->aura->host()->window(); + if (!parent->Contains(content)) + parent->AddChild(content); + + content->Show(); +} + +void ShellPlatformDelegate::EnableUIControl(Shell* shell, + UIControl control, + bool is_enabled) {} + +void ShellPlatformDelegate::SetAddressBarURL(Shell* shell, const GURL& url) {} + +void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) {} + +void ShellPlatformDelegate::SetTitle(Shell* shell, + const base::string16& title) {} + +bool ShellPlatformDelegate::DestroyShell(Shell* shell) { + return false; // Shell destroys itself. +} + +} // namespace content
diff --git a/content/shell/browser/shell_mac.mm b/content/shell/browser/shell_platform_delegate_mac.mm similarity index 64% rename from content/shell/browser/shell_mac.mm rename to content/shell/browser/shell_platform_delegate_mac.mm index eec0e2d..1d0630cf 100644 --- a/content/shell/browser/shell_mac.mm +++ b/content/shell/browser/shell_platform_delegate_mac.mm
@@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2020 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 "content/shell/browser/shell.h" +#include "content/shell/browser/shell_platform_delegate.h" #include <algorithm> @@ -17,12 +17,13 @@ #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/shell/app/resource.h" +#include "content/shell/browser/shell.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h" #include "url/gurl.h" // Receives notification that the window is closing so that it can start the // tear-down process. Is responsible for deleting itself when done. -@interface ContentShellWindowDelegate : NSObject<NSWindowDelegate> { +@interface ContentShellWindowDelegate : NSObject <NSWindowDelegate> { @private content::Shell* _shell; } @@ -121,99 +122,75 @@ namespace content { -void Shell::PlatformInitialize(const gfx::Size& default_window_size) { +struct ShellPlatformDelegate::ShellData { + gfx::NativeWindow window; + NSTextField* url_edit_view; + gfx::Size content_size; +}; + +struct ShellPlatformDelegate::PlatformData {}; + +ShellPlatformDelegate::ShellPlatformDelegate() = default; +ShellPlatformDelegate::~ShellPlatformDelegate() = default; + +void ShellPlatformDelegate::Initialize(const gfx::Size& default_window_size) { + // |platform_| is unused on this platform. } -void Shell::PlatformExit() { -} +void ShellPlatformDelegate::CreatePlatformWindow( + Shell* shell, + const gfx::Size& initial_size) { + ShellData* shell_data = new ShellData; + shell->set_platform_data(shell_data); -void Shell::PlatformCleanUp() { -} - -void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { - if (headless_) - return; - - int id; - switch (control) { - case BACK_BUTTON: - id = IDC_NAV_BACK; - break; - case FORWARD_BUTTON: - id = IDC_NAV_FORWARD; - break; - case STOP_BUTTON: - id = IDC_NAV_STOP; - break; - default: - NOTREACHED() << "Unknown UI control"; - return; - } - [[[window_.GetNativeNSWindow() contentView] viewWithTag:id] - setEnabled:is_enabled]; -} - -void Shell::PlatformSetAddressBarURL(const GURL& url) { - if (headless_ || hide_toolbar_) - return; - - NSString* url_string = base::SysUTF8ToNSString(url.spec()); - [url_edit_view_ setStringValue:url_string]; -} - -void Shell::PlatformSetIsLoading(bool loading) { -} - -void Shell::PlatformCreateWindow(int width, int height) { - if (headless_) { - content_size_ = gfx::Size(width, height); + if (shell->headless()) { + shell_data->content_size = initial_size; return; } - if (!hide_toolbar_) + int width = initial_size.width(); + int height = initial_size.height(); + + if (!Shell::ShouldHideToolbar()) height += kURLBarHeight; NSRect initial_window_bounds = NSMakeRect(0, 0, width, height); NSRect content_rect = initial_window_bounds; - NSUInteger style_mask = NSTitledWindowMask | - NSClosableWindowMask | - NSMiniaturizableWindowMask | - NSResizableWindowMask; + NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask | + NSMiniaturizableWindowMask | NSResizableWindowMask; CrShellWindow* window = [[CrShellWindow alloc] initWithContentRect:content_rect styleMask:style_mask backing:NSBackingStoreBuffered defer:NO]; - window_ = window; - [window setShell:this]; - [window_.GetNativeNSWindow() setTitle:kWindowTitle]; - NSView* content = [window_.GetNativeNSWindow() contentView]; + [window setShell:shell]; + [window setTitle:kWindowTitle]; + NSView* content = [window contentView]; // If the window is allowed to get too small, it will wreck the view bindings. NSSize min_size = NSMakeSize(kMinimumWindowWidth, kMinimumWindowHeight); min_size = [content convertSize:min_size toView:nil]; // Note that this takes window coordinates. - [window_.GetNativeNSWindow() setContentMinSize:min_size]; + [window setContentMinSize:min_size]; // Set the shell window to participate in Lion Fullscreen mode. Set // Setting this flag has no effect on Snow Leopard or earlier. - NSUInteger collectionBehavior = - [window_.GetNativeNSWindow() collectionBehavior]; + NSUInteger collectionBehavior = [window collectionBehavior]; collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; - [window_.GetNativeNSWindow() setCollectionBehavior:collectionBehavior]; + [window setCollectionBehavior:collectionBehavior]; // Rely on the window delegate to clean us up rather than immediately // releasing when the window gets closed. We use the delegate to do // everything from the autorelease pool so the shell isn't on the stack // during cleanup (ie, a window close from javascript). - [window_.GetNativeNSWindow() setReleasedWhenClosed:NO]; + [window setReleasedWhenClosed:NO]; // Create a window delegate to watch for when it's asked to go away. It will // clean itself up so we don't need to hold a reference. ContentShellWindowDelegate* delegate = - [[ContentShellWindowDelegate alloc] initWithShell:this]; - [window_.GetNativeNSWindow() setDelegate:delegate]; + [[ContentShellWindowDelegate alloc] initWithShell:shell]; + [window setDelegate:delegate]; - if (!hide_toolbar_) { + if (!Shell::ShouldHideToolbar()) { NSRect button_frame = NSMakeRect(0, NSMaxY(initial_window_bounds) - kURLBarHeight, kButtonWidth, kURLBarHeight); @@ -237,15 +214,133 @@ [url_edit_view setAction:@selector(takeURLStringValueFrom:)]; [[url_edit_view cell] setWraps:NO]; [[url_edit_view cell] setScrollable:YES]; - url_edit_view_ = url_edit_view.get(); + shell_data->url_edit_view = url_edit_view.get(); } // Show the new window. - [window_.GetNativeNSWindow() makeKeyAndOrderFront:nil]; + [window makeKeyAndOrderFront:nil]; + + shell_data->window = window; } -void Shell::PlatformActivateContents(WebContents* top_contents) { - if (!headless_) { +gfx::NativeWindow ShellPlatformDelegate::GetNativeWindow(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + return shell_data->window; +} + +void ShellPlatformDelegate::CleanUp(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + + // Any ShellData cleanup happens here. + + delete shell_data; + // This shouldn't be used anymore, but just in case. + shell->set_platform_data(nullptr); +} + +void ShellPlatformDelegate::SetContents(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + + NSView* web_view = shell->web_contents()->GetNativeView().GetNativeNSView(); + [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; + + if (shell->headless()) { + ResizeWebContent(shell, shell_data->content_size); + return; + } + + NSView* content = [shell_data->window.GetNativeNSWindow() contentView]; + [content addSubview:web_view]; + + NSRect frame = [content bounds]; + if (!Shell::ShouldHideToolbar()) + frame.size.height -= kURLBarHeight; + [web_view setFrame:frame]; + [web_view setNeedsDisplay:YES]; +} + +void ShellPlatformDelegate::EnableUIControl(Shell* shell, + UIControl control, + bool is_enabled) { + if (shell->headless()) + return; + + ShellData* shell_data = shell->platform_data(); + + int id; + switch (control) { + case BACK_BUTTON: + id = IDC_NAV_BACK; + break; + case FORWARD_BUTTON: + id = IDC_NAV_FORWARD; + break; + case STOP_BUTTON: + id = IDC_NAV_STOP; + break; + default: + NOTREACHED() << "Unknown UI control"; + return; + } + [[[shell_data->window.GetNativeNSWindow() contentView] viewWithTag:id] + setEnabled:is_enabled]; +} + +void ShellPlatformDelegate::SetAddressBarURL(Shell* shell, const GURL& url) { + if (shell->headless() || Shell::ShouldHideToolbar()) + return; + + ShellData* shell_data = shell->platform_data(); + + NSString* url_string = base::SysUTF8ToNSString(url.spec()); + [shell_data->url_edit_view setStringValue:url_string]; +} + +void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) {} + +void ShellPlatformDelegate::SetTitle(Shell* shell, + const base::string16& title) { + if (shell->headless()) + return; + + ShellData* shell_data = shell->platform_data(); + + NSString* title_string = base::SysUTF16ToNSString(title); + [shell_data->window.GetNativeNSWindow() setTitle:title_string]; +} + +bool ShellPlatformDelegate::DestroyShell(Shell* shell) { + if (shell->headless()) + return false; // Shell destroys itself. + + ShellData* shell_data = shell->platform_data(); + + [shell_data->window.GetNativeNSWindow() performClose:nil]; + return true; // The performClose() will do the destruction of Shell. +} + +void ShellPlatformDelegate::ResizeWebContent(Shell* shell, + const gfx::Size& content_size) { + ShellData* shell_data = shell->platform_data(); + + if (!shell->headless()) { + int toolbar_height = Shell::ShouldHideToolbar() ? 0 : kURLBarHeight; + NSRect frame = NSMakeRect(0, 0, content_size.width(), + content_size.height() + toolbar_height); + [shell_data->window.GetNativeNSWindow().contentView setFrame:frame]; + return; + } + + NSView* web_view = shell->web_contents()->GetNativeView().GetNativeNSView(); + NSRect frame = NSMakeRect(0, 0, content_size.width(), content_size.height()); + [web_view setFrame:frame]; +} + +void ShellPlatformDelegate::ActivateContents(Shell* shell, + WebContents* top_contents) { + ShellData* shell_data = shell->platform_data(); + + if (!shell->headless()) { // This focuses the main frame RenderWidgetHost in the window, but does not // make the window itself active. The WebContentsDelegate (this class) is // responsible for doing both. @@ -253,7 +348,7 @@ // This makes the window the active window for the application, and when the // app is active, the window will be also. That makes all RenderWidgetHosts // for the window active (which is separate from focused on mac). - [window_.GetNativeNSWindow() makeKeyAndOrderFront:nil]; + [shell_data->window.GetNativeNSWindow() makeKeyAndOrderFront:nil]; // This makes the application active so that we can actually move focus // between windows and the renderer can receive focus/blur events. [NSApp activateIgnoringOtherApps:YES]; @@ -265,8 +360,8 @@ // Instead we fake it out by just informing the RenderWidgetHost directly. // For all windows other than this one, blur them. - for (Shell* window : windows_) { - if (window != this) { + for (Shell* window : Shell::windows()) { + if (window != shell) { WebContents* other_top_contents = window->web_contents(); RenderWidgetHost* other_main_widget = other_top_contents->GetMainFrame()->GetView()->GetRenderWidgetHost(); @@ -281,94 +376,22 @@ main_widget->SetActive(true); } -void Shell::PlatformSetContents() { - NSView* web_view = web_contents_->GetNativeView().GetNativeNSView(); - [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; - - if (headless_) { - SizeTo(content_size_); - return; - } - - NSView* content = [window_.GetNativeNSWindow() contentView]; - [content addSubview:web_view]; - - NSRect frame = [content bounds]; - if (!hide_toolbar_) - frame.size.height -= kURLBarHeight; - [web_view setFrame:frame]; - [web_view setNeedsDisplay:YES]; -} - -void Shell::SizeTo(const gfx::Size& content_size) { - if (!headless_) { - int toolbar_height = hide_toolbar_ ? 0 : kURLBarHeight; - NSRect frame = NSMakeRect(0, 0, content_size.width(), - content_size.height() + toolbar_height); - [window().GetNativeNSWindow().contentView setFrame:frame]; - return; - } - NSView* web_view = web_contents_->GetNativeView().GetNativeNSView(); - NSRect frame = NSMakeRect(0, 0, content_size.width(), content_size.height()); - [web_view setFrame:frame]; -} - -void Shell::PlatformResizeSubViews() { - // Not needed; subviews are bound. -} - -void Shell::PlatformSetTitle(const base::string16& title) { - if (headless_) - return; - - NSString* title_string = base::SysUTF16ToNSString(title); - [window_.GetNativeNSWindow() setTitle:title_string]; -} - -void Shell::Close() { - if (headless_) - delete this; - else - [window_.GetNativeNSWindow() performClose:nil]; -} - -void Shell::ActionPerformed(int control) { - switch (control) { - case IDC_NAV_BACK: - GoBackOrForward(-1); - break; - case IDC_NAV_FORWARD: - GoBackOrForward(1); - break; - case IDC_NAV_RELOAD: - Reload(); - break; - case IDC_NAV_STOP: - Stop(); - break; - } -} - -void Shell::URLEntered(const std::string& url_string) { - if (!url_string.empty()) { - GURL url(url_string); - if (!url.has_scheme()) - url = GURL("http://" + url_string); - LoadURL(url); - } -} - -bool Shell::HandleKeyboardEvent(WebContents* source, - const NativeWebKeyboardEvent& event) { - if (event.skip_in_browser || headless_ || hide_toolbar_) +bool ShellPlatformDelegate::HandleKeyboardEvent( + Shell* shell, + WebContents* source, + const NativeWebKeyboardEvent& event) { + if (event.skip_in_browser || shell->headless() || Shell::ShouldHideToolbar()) return false; + ShellData* shell_data = shell->platform_data(); + // The event handling to get this strictly right is a tangle; cheat here a bit // by just letting the menus have a chance at it. if ([event.os_event type] == NSKeyDown) { if (([event.os_event modifierFlags] & NSCommandKeyMask) && [[event.os_event characters] isEqual:@"l"]) { - [window_.GetNativeNSWindow() makeFirstResponder:url_edit_view_]; + [shell_data->window.GetNativeNSWindow() + makeFirstResponder:shell_data->url_edit_view]; return true; }
diff --git a/content/shell/browser/shell_views.cc b/content/shell/browser/shell_platform_delegate_views.cc similarity index 67% rename from content/shell/browser/shell_views.cc rename to content/shell/browser/shell_platform_delegate_views.cc index 3c0b170..7201630 100644 --- a/content/shell/browser/shell_views.cc +++ b/content/shell/browser/shell_platform_delegate_views.cc
@@ -1,4 +1,4 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2020 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. @@ -37,9 +37,6 @@ #include "ui/wm/test/wm_test_helper.h" #else // !defined(OS_CHROMEOS) #include "ui/views/widget/desktop_aura/desktop_screen.h" -#endif - -#if defined(USE_AURA) #include "ui/wm/core/wm_state.h" #endif @@ -50,6 +47,26 @@ namespace content { +struct ShellPlatformDelegate::ShellData { + gfx::Size content_size; + // Self-owned Widget, destroyed through CloseNow(). + views::Widget* window_widget = nullptr; +}; + +struct ShellPlatformDelegate::PlatformData { +#if defined(OS_CHROMEOS) + std::unique_ptr<wm::WMTestHelper> wm_test_helper; +#else + std::unique_ptr<wm::WMState> wm_state; +#endif + + // Only used in headless mode. Uses |wm_state| which must outlive this. + std::unique_ptr<ShellPlatformDataAura> aura; + + // TODO(danakj): This looks unused? + std::unique_ptr<views::ViewsDelegate> views_delegate; +}; + namespace { // Maintain the UI controls and web view for content shell @@ -57,11 +74,7 @@ public views::TextfieldController, public views::ButtonListener { public: - enum UIControl { - BACK_BUTTON, - FORWARD_BUTTON, - STOP_BUTTON - }; + enum UIControl { BACK_BUTTON, FORWARD_BUTTON, STOP_BUTTON }; ShellWindowDelegateView(Shell* shell) : shell_(shell) {} @@ -128,22 +141,21 @@ using ColumnSize = views::GridLayout::ColumnSize; views::ColumnSet* column_set = layout->AddColumnSet(0); - if (!shell_->hide_toolbar()) + if (!Shell::ShouldHideToolbar()) column_set->AddPaddingColumn(0, 2); column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, ColumnSize::kUsePreferred, 0, 0); - if (!shell_->hide_toolbar()) + if (!Shell::ShouldHideToolbar()) column_set->AddPaddingColumn(0, 2); // Add toolbar buttons and URL text field - if (!shell_->hide_toolbar()) { + if (!Shell::ShouldHideToolbar()) { layout->AddPaddingRow(0, 2); layout->StartRow(0, 0); views::GridLayout* toolbar_layout = toolbar_view->SetLayoutManager(std::make_unique<views::GridLayout>()); - views::ColumnSet* toolbar_column_set = - toolbar_layout->AddColumnSet(0); + views::ColumnSet* toolbar_column_set = toolbar_layout->AddColumnSet(0); // Back button auto back_button = views::MdTextButton::Create(this, base::ASCIIToUTF16("Back")); @@ -206,20 +218,18 @@ contents_view_ = layout->AddView(std::move(contents_view)); } - if (!shell_->hide_toolbar()) + if (!Shell::ShouldHideToolbar()) layout->AddPaddingRow(0, 5); InitAccelerators(); } void InitAccelerators() { - static const ui::KeyboardCode keys[] = { ui::VKEY_F5, - ui::VKEY_BROWSER_BACK, - ui::VKEY_BROWSER_FORWARD }; + static const ui::KeyboardCode keys[] = {ui::VKEY_F5, ui::VKEY_BROWSER_BACK, + ui::VKEY_BROWSER_FORWARD}; for (size_t i = 0; i < base::size(keys); ++i) { GetFocusManager()->RegisterAccelerator( - ui::Accelerator(keys[i], ui::EF_NONE), - ui::AcceleratorManager::kNormalPriority, - this); + ui::Accelerator(keys[i], ui::EF_NONE), + ui::AcceleratorManager::kNormalPriority, this); } } // Overridden from TextfieldController @@ -237,8 +247,8 @@ } shell_->LoadURL(url); return true; - } - return false; + } + return false; } // Overridden from ButtonListener @@ -281,17 +291,17 @@ // Overridden from AcceleratorTarget: bool AcceleratorPressed(const ui::Accelerator& accelerator) override { switch (accelerator.key_code()) { - case ui::VKEY_F5: - shell_->Reload(); - return true; - case ui::VKEY_BROWSER_BACK: - shell_->GoBackOrForward(-1); - return true; - case ui::VKEY_BROWSER_FORWARD: - shell_->GoBackOrForward(1); - return true; - default: - return views::WidgetDelegateView::AcceleratorPressed(accelerator); + case ui::VKEY_F5: + shell_->Reload(); + return true; + case ui::VKEY_BROWSER_BACK: + shell_->GoBackOrForward(-1); + return true; + case ui::VKEY_BROWSER_FORWARD: + shell_->GoBackOrForward(1); + return true; + default: + return views::WidgetDelegateView::AcceleratorPressed(accelerator); } } @@ -319,112 +329,84 @@ } // namespace -#if defined(OS_CHROMEOS) -// static -wm::WMTestHelper* Shell::wm_test_helper_ = nullptr; -#elif defined(USE_AURA) -// static -wm::WMState* Shell::wm_state_ = nullptr; -#endif -// static -views::ViewsDelegate* Shell::views_delegate_ = nullptr; +ShellPlatformDelegate::ShellPlatformDelegate() = default; -// static -void Shell::PlatformInitialize(const gfx::Size& default_window_size) { +void ShellPlatformDelegate::Initialize(const gfx::Size& default_window_size) { #if defined(OS_WIN) _setmode(_fileno(stdout), _O_BINARY); _setmode(_fileno(stderr), _O_BINARY); #endif + + platform_ = std::make_unique<PlatformData>(); + #if defined(OS_CHROMEOS) - wm_test_helper_ = new wm::WMTestHelper(default_window_size); + platform_->wm_test_helper = + std::make_unique<wm::WMTestHelper>(default_window_size); #else - wm_state_ = new wm::WMState; + platform_->wm_state = std::make_unique<wm::WMState>(); views::InstallDesktopScreenIfNecessary(); #endif - views_delegate_ = new views::DesktopTestViewsDelegate(); + + platform_->views_delegate = + std::make_unique<views::DesktopTestViewsDelegate>(); } -void Shell::PlatformExit() { -#if defined(OS_CHROMEOS) - delete wm_test_helper_; - wm_test_helper_ = nullptr; -#endif - delete views_delegate_; - views_delegate_ = nullptr; - delete platform_; - platform_ = nullptr; -#if defined(USE_AURA) && !defined(OS_CHROMEOS) - delete wm_state_; - wm_state_ = nullptr; -#endif -} +ShellPlatformDelegate::~ShellPlatformDelegate() = default; -void Shell::PlatformCleanUp() { -} +void ShellPlatformDelegate::CreatePlatformWindow( + Shell* shell, + const gfx::Size& initial_size) { + ShellData* shell_data = new ShellData; + shell->set_platform_data(shell_data); -void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { - if (headless_ || hide_toolbar_) - return; - ShellWindowDelegateView* delegate_view = - static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); - if (control == BACK_BUTTON) { - delegate_view->EnableUIControl(ShellWindowDelegateView::BACK_BUTTON, - is_enabled); - } else if (control == FORWARD_BUTTON) { - delegate_view->EnableUIControl(ShellWindowDelegateView::FORWARD_BUTTON, - is_enabled); - } else if (control == STOP_BUTTON) { - delegate_view->EnableUIControl(ShellWindowDelegateView::STOP_BUTTON, - is_enabled); - } -} + shell_data->content_size = initial_size; -void Shell::PlatformSetAddressBarURL(const GURL& url) { - if (headless_ || hide_toolbar_) - return; - ShellWindowDelegateView* delegate_view = - static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); - delegate_view->SetAddressBarURL(url); -} - -void Shell::PlatformSetIsLoading(bool loading) { -} - -void Shell::PlatformCreateWindow(int width, int height) { - content_size_ = gfx::Size(width, height); - - if (headless_) { - if (!platform_) - platform_ = new ShellPlatformDataAura(content_size_); + if (shell->headless()) { + if (!platform_->aura) + platform_->aura = std::make_unique<ShellPlatformDataAura>(initial_size); else - platform_->ResizeWindow(content_size_); + platform_->aura->ResizeWindow(initial_size); return; } + #if defined(OS_CHROMEOS) - window_widget_ = views::Widget::CreateWindowWithContext( - new ShellWindowDelegateView(this), - wm_test_helper_->GetDefaultParent(nullptr, gfx::Rect()), - gfx::Rect(content_size_)); + shell_data->window_widget = views::Widget::CreateWindowWithContext( + new ShellWindowDelegateView(shell), + platform_->wm_test_helper->GetDefaultParent(nullptr, gfx::Rect()), + gfx::Rect(initial_size)); #else - window_widget_ = new views::Widget; + shell_data->window_widget = new views::Widget(); views::Widget::InitParams params; - params.bounds = gfx::Rect(content_size_); - params.delegate = new ShellWindowDelegateView(this); + params.bounds = gfx::Rect(initial_size); + params.delegate = new ShellWindowDelegateView(shell); params.wm_class_class = "chromium-content_shell"; params.wm_class_name = params.wm_class_class; - window_widget_->Init(std::move(params)); + shell_data->window_widget->Init(std::move(params)); #endif - // |window_widget_| is made visible in PlatformSetContents(), so that the + // |window_widget| is made visible in PlatformSetContents(), so that the // platform-window size does not need to change due to layout again. - window_ = window_widget_->GetNativeWindow(); } -void Shell::PlatformSetContents() { - if (headless_) { - CHECK(platform_); - aura::Window* content = web_contents_->GetNativeView(); - aura::Window* parent = platform_->host()->window(); +gfx::NativeWindow ShellPlatformDelegate::GetNativeWindow(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + return shell_data->window_widget->GetNativeWindow(); +} + +void ShellPlatformDelegate::CleanUp(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + + delete shell_data; + // This shouldn't be used anymore, but just in case. + shell->set_platform_data(nullptr); +} + +void ShellPlatformDelegate::SetContents(Shell* shell) { + ShellData* shell_data = shell->platform_data(); + + if (shell->headless()) { + aura::Window* content = shell->web_contents()->GetNativeView(); + aura::Window* parent = platform_->aura->host()->window(); if (!parent->Contains(content)) { parent->AddChild(content); // Move the cursor to a fixed position before tests run to avoid getting @@ -432,37 +414,79 @@ content->MoveCursorTo(gfx::Point()); content->Show(); } - content->SetBounds(gfx::Rect(content_size_)); - RenderWidgetHostView* host_view = web_contents_->GetRenderWidgetHostView(); + content->SetBounds(gfx::Rect(shell_data->content_size)); + RenderWidgetHostView* host_view = + shell->web_contents()->GetRenderWidgetHostView(); if (host_view) - host_view->SetSize(content_size_); + host_view->SetSize(shell_data->content_size); } else { - views::WidgetDelegate* widget_delegate = window_widget_->widget_delegate(); - ShellWindowDelegateView* delegate_view = + views::WidgetDelegate* widget_delegate = + shell_data->window_widget->widget_delegate(); + auto* delegate_view = static_cast<ShellWindowDelegateView*>(widget_delegate); - delegate_view->SetWebContents(web_contents_.get(), content_size_); - window_->GetHost()->Show(); - window_widget_->Show(); + delegate_view->SetWebContents(shell->web_contents(), + shell_data->content_size); + shell_data->window_widget->GetNativeWindow()->GetHost()->Show(); + shell_data->window_widget->Show(); } } -void Shell::PlatformResizeSubViews() { -} - -void Shell::Close() { - if (headless_) - delete this; - else - window_widget_->CloseNow(); -} - -void Shell::PlatformSetTitle(const base::string16& title) { - if (headless_) +void ShellPlatformDelegate::EnableUIControl(Shell* shell, + UIControl control, + bool is_enabled) { + if (shell->headless() || Shell::ShouldHideToolbar()) return; - ShellWindowDelegateView* delegate_view = - static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); + + ShellData* shell_data = shell->platform_data(); + + auto* delegate_view = static_cast<ShellWindowDelegateView*>( + shell_data->window_widget->widget_delegate()); + if (control == BACK_BUTTON) { + delegate_view->EnableUIControl(ShellWindowDelegateView::BACK_BUTTON, + is_enabled); + } else if (control == FORWARD_BUTTON) { + delegate_view->EnableUIControl(ShellWindowDelegateView::FORWARD_BUTTON, + is_enabled); + } else if (control == STOP_BUTTON) { + delegate_view->EnableUIControl(ShellWindowDelegateView::STOP_BUTTON, + is_enabled); + } +} + +void ShellPlatformDelegate::SetAddressBarURL(Shell* shell, const GURL& url) { + if (shell->headless() || Shell::ShouldHideToolbar()) + return; + + ShellData* shell_data = shell->platform_data(); + + auto* delegate_view = static_cast<ShellWindowDelegateView*>( + shell_data->window_widget->widget_delegate()); + delegate_view->SetAddressBarURL(url); +} + +void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) {} + +void ShellPlatformDelegate::SetTitle(Shell* shell, + const base::string16& title) { + if (shell->headless()) + return; + + ShellData* shell_data = shell->platform_data(); + + auto* delegate_view = static_cast<ShellWindowDelegateView*>( + shell_data->window_widget->widget_delegate()); delegate_view->SetWindowTitle(title); - window_widget_->UpdateWindowTitle(); + shell_data->window_widget->UpdateWindowTitle(); +} + +bool ShellPlatformDelegate::DestroyShell(Shell* shell) { + if (shell->headless()) + return false; // Shell destroys itself. + + ShellData* shell_data = shell->platform_data(); + + shell_data->window_widget->CloseNow(); + return true; // The CloseNow() will do the destruction of Shell. } } // namespace content
diff --git a/content/shell/browser/web_test/web_test_control_host.cc b/content/shell/browser/web_test/web_test_control_host.cc index 0f9f3e44..73edf54 100644 --- a/content/shell/browser/web_test/web_test_control_host.cc +++ b/content/shell/browser/web_test/web_test_control_host.cc
@@ -524,8 +524,9 @@ ->GetWebkitPreferences(); } else { #if defined(OS_MACOSX) - // Shell::SizeTo is not implemented on all platforms. - main_window_->SizeTo(initial_size_); + // Mac requires platform-specific code to resize the main frame's + // RenderWidgetHostView (independent of the Shell window). + main_window_->ResizeWebContentForTests(initial_size_); #endif RenderViewHost* render_view_host = main_window_->web_contents()->GetRenderViewHost();
diff --git a/content/test/data/accessibility/aria/annotation-roles-expected-mac.txt b/content/test/data/accessibility/aria/annotation-roles-expected-mac.txt index 924f76b..15798bc 100644 --- a/content/test/data/accessibility/aria/annotation-roles-expected-mac.txt +++ b/content/test/data/accessibility/aria/annotation-roles-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXRoleDescription='comment' AXDescription='comment' -++AXGroup AXRoleDescription='suggestion' AXDescription='suggestion' +++AXGroup AXDescription='comment' AXRoleDescription='comment' +++AXGroup AXDescription='suggestion' AXRoleDescription='suggestion' ++AXGroup AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='This is ' ++++AXGroup AXRoleDescription='highlight'
diff --git a/content/test/data/accessibility/aria/aria-alert-expected-mac.txt b/content/test/data/accessibility/aria/aria-alert-expected-mac.txt index aced76b..39d9a44 100644 --- a/content/test/data/accessibility/aria/aria-alert-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-alert-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea -++AXGroup AXSubrole=AXApplicationAlert AXRoleDescription='alert' AXARIAAtomic='1' -++++AXStaticText AXValue='This test is for aria role="alert"' AXARIAAtomic='0' +++AXGroup AXSubrole=AXApplicationAlert AXARIAAtomic='1' AXRoleDescription='alert' +++++AXStaticText AXARIAAtomic='0' AXValue='This test is for aria role="alert"'
diff --git a/content/test/data/accessibility/aria/aria-alertdialog-expected-mac.txt b/content/test/data/accessibility/aria/aria-alertdialog-expected-mac.txt index 3dbdd687..4cabffd 100644 --- a/content/test/data/accessibility/aria/aria-alertdialog-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-alertdialog-expected-mac.txt
@@ -1,2 +1,2 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXSubrole=AXApplicationAlertDialog AXRoleDescription='alertdialog' \ No newline at end of file +++AXGroup AXSubrole=AXApplicationAlertDialog AXRoleDescription='alertdialog'
diff --git a/content/test/data/accessibility/aria/aria-atomic-expected-mac.txt b/content/test/data/accessibility/aria/aria-atomic-expected-mac.txt index 4748569..e4d5e91 100644 --- a/content/test/data/accessibility/aria/aria-atomic-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-atomic-expected-mac.txt
@@ -1,9 +1,9 @@ AXWebArea -++AXGroup AXDescription='This test is for aria-atomic="false"' AXARIAAtomic='0' -++++AXStaticText AXValue='This test is for aria-atomic="false"' AXARIAAtomic='0' -++AXGroup AXDescription='This test is for aria-atomic="true"' AXARIAAtomic='1' -++++AXStaticText AXValue='This test is for aria-atomic="true"' AXARIAAtomic='0' -++AXGroup AXDescription='This test is for alert.' AXARIAAtomic='1' -++++AXStaticText AXValue='This test is for alert.' AXARIAAtomic='0' -++AXGroup AXDescription='This test is for status.' AXARIAAtomic='1' -++++AXStaticText AXValue='This test is for status.' AXARIAAtomic='0' +++AXGroup AXARIAAtomic='0' AXDescription='This test is for aria-atomic="false"' +++++AXStaticText AXARIAAtomic='0' AXValue='This test is for aria-atomic="false"' +++AXGroup AXARIAAtomic='1' AXDescription='This test is for aria-atomic="true"' +++++AXStaticText AXARIAAtomic='0' AXValue='This test is for aria-atomic="true"' +++AXGroup AXARIAAtomic='1' AXDescription='This test is for alert.' +++++AXStaticText AXARIAAtomic='0' AXValue='This test is for alert.' +++AXGroup AXARIAAtomic='1' AXDescription='This test is for status.' +++++AXStaticText AXARIAAtomic='0' AXValue='This test is for status.'
diff --git a/content/test/data/accessibility/aria/aria-autocomplete-expected-mac.txt b/content/test/data/accessibility/aria/aria-autocomplete-expected-mac.txt index 653bf83..4a7281b 100644 --- a/content/test/data/accessibility/aria/aria-autocomplete-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-autocomplete-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea ++AXGroup -++++AXComboBox AXValue='autocomplete=inline' AXAutocompleteValue='inline' -++++AXComboBox AXValue='autocomplete=list' AXAutocompleteValue='list' -++++AXComboBox AXValue='autocomplete=both' AXAutocompleteValue='both' +++++AXComboBox AXAutocompleteValue='inline' AXValue='autocomplete=inline' +++++AXComboBox AXAutocompleteValue='list' AXValue='autocomplete=list' +++++AXComboBox AXAutocompleteValue='both' AXValue='autocomplete=both' ++++AXComboBox AXValue='autocomplete=none' -++++AXTextField AXValue='No role with autocomplete=inline' AXAutocompleteValue='inline' +++++AXTextField AXAutocompleteValue='inline' AXValue='No role with autocomplete=inline'
diff --git a/content/test/data/accessibility/aria/aria-busy-expected-mac.txt b/content/test/data/accessibility/aria/aria-busy-expected-mac.txt index 45a5805..1198c66 100644 --- a/content/test/data/accessibility/aria/aria-busy-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-busy-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXSubrole=AXApplicationLog AXRoleDescription='log' AXDescription='Busy log' AXARIABusy='1' -++AXGroup AXSubrole=AXApplicationLog AXRoleDescription='log' AXDescription='Not-busy log' -++AXGroup AXRoleDescription='group' AXDescription='plain div' AXARIABusy='1' \ No newline at end of file +++AXGroup AXSubrole=AXApplicationLog AXARIABusy='1' AXDescription='Busy log' AXRoleDescription='log' +++AXGroup AXSubrole=AXApplicationLog AXDescription='Not-busy log' AXRoleDescription='log' +++AXGroup AXARIABusy='1' AXDescription='plain div' AXRoleDescription='group'
diff --git a/content/test/data/accessibility/aria/aria-checkbox-expected-mac.txt b/content/test/data/accessibility/aria/aria-checkbox-expected-mac.txt index 3a00470..0a276a4 100644 --- a/content/test/data/accessibility/aria/aria-checkbox-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-checkbox-expected-mac.txt
@@ -6,4 +6,4 @@ ++AXCheckBox AXRoleDescription='checkbox' AXTitle='Complex checkbox' AXValue='0' ++++AXStaticText AXRoleDescription='text' AXValue='Complex ' ++++AXTextField AXRoleDescription='text field' -++++AXStaticText AXRoleDescription='text' AXValue=' checkbox' \ No newline at end of file +++++AXStaticText AXRoleDescription='text' AXValue=' checkbox'
diff --git a/content/test/data/accessibility/aria/aria-code-expected-mac.txt b/content/test/data/accessibility/aria/aria-code-expected-mac.txt index cb3ad03c9..677c475 100644 --- a/content/test/data/accessibility/aria/aria-code-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-code-expected-mac.txt
@@ -3,5 +3,5 @@ ++++AXStaticText AXRoleDescription='text' AXValue='role' ++AXStaticText AXRoleDescription='text' AXValue='element (no name)' ++AXStaticText AXRoleDescription='text' AXValue=' ' -++AXGroup AXSubrole=AXCodeStyleGroup AXRoleDescription='group' AXDescription='include me' +++AXGroup AXSubrole=AXCodeStyleGroup AXDescription='include me' AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'
diff --git a/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt b/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt index d28f2235..a656835 100644 --- a/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea ++AXGroup ++++AXStaticText AXValue='State' -++AXComboBox AXTitle='State' AXAutocompleteValue='list' AXFocused='1' +++AXComboBox AXAutocompleteValue='list' AXFocused='1' AXTitle='State' ++AXList ++++AXStaticText AXValue='Alabama' -++++AXStaticText AXValue='Alaska' \ No newline at end of file +++++AXStaticText AXValue='Alaska'
diff --git a/content/test/data/accessibility/aria/aria-combobox-uneditable-expected-mac.txt b/content/test/data/accessibility/aria/aria-combobox-uneditable-expected-mac.txt index b2bb751..d9f65555 100644 --- a/content/test/data/accessibility/aria/aria-combobox-uneditable-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-combobox-uneditable-expected-mac.txt
@@ -1,9 +1,9 @@ AXWebArea AXFocused='1' ++AXGroup ++++AXStaticText AXValue='Choose a fruit, with text content' -++AXPopUpButton AXTitle='Choose a fruit, with text content' AXValue='Apple' AXLinkedUIElements=["AXList"] +++AXPopUpButton AXLinkedUIElements=["AXList"] AXTitle='Choose a fruit, with text content' AXValue='Apple' ++++AXStaticText AXValue='Apple' ++AXList ++++AXStaticText AXValue='Apple' ++++AXStaticText AXValue='Banana' -++++AXStaticText AXValue='Cherry' \ No newline at end of file +++++AXStaticText AXValue='Cherry'
diff --git a/content/test/data/accessibility/aria/aria-controls-expected-mac.txt b/content/test/data/accessibility/aria/aria-controls-expected-mac.txt index 4771074..1b9cb409 100644 --- a/content/test/data/accessibility/aria/aria-controls-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-controls-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea ++AXMenuBar -++++AXMenuItem AXTitle='File' AXLinkedUIElements=["AXMenu File"] +++++AXMenuItem AXLinkedUIElements=["AXMenu File"] AXTitle='File' ++++AXMenuItem AXTitle='Edit' ++AXMenu AXDescription='File' ++++AXMenuItem AXTitle='New'
diff --git a/content/test/data/accessibility/aria/aria-definition-expected-mac.txt b/content/test/data/accessibility/aria/aria-definition-expected-mac.txt index 964ff3d..8bcf6f7 100644 --- a/content/test/data/accessibility/aria/aria-definition-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-definition-expected-mac.txt
@@ -1,2 +1,2 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXSubrole=AXDefinition AXRoleDescription='definition' \ No newline at end of file +++AXGroup AXSubrole=AXDefinition AXRoleDescription='definition'
diff --git a/content/test/data/accessibility/aria/aria-describedby-expected-mac.txt b/content/test/data/accessibility/aria/aria-describedby-expected-mac.txt index f767042e..74a7926 100644 --- a/content/test/data/accessibility/aria/aria-describedby-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-describedby-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXRoleDescription='HTML content' -++AXTextField AXRoleDescription='text field' AXHelp='Your username should be your email id' +++AXTextField AXHelp='Your username should be your email id' AXRoleDescription='text field' ++AXGroup AXSubrole=AXUserInterfaceTooltip AXRoleDescription='tooltip' AXTitle='Your username should be your email id' ++++AXStaticText AXRoleDescription='text' AXValue='Your username should be your email id' -++AXTextField AXRoleDescription='text field' AXHelp='mmddyy' +++AXTextField AXHelp='mmddyy' AXRoleDescription='text field'
diff --git a/content/test/data/accessibility/aria/aria-disabled-expected-mac.txt b/content/test/data/accessibility/aria/aria-disabled-expected-mac.txt index 8083ccc..4c19797 100644 --- a/content/test/data/accessibility/aria/aria-disabled-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-disabled-expected-mac.txt
@@ -10,4 +10,4 @@ ++AXGroup AXEnabled='1' ++++AXTextField AXEnabled='1' ++++AXTextField AXEnabled='0' -++++AXTextField AXEnabled='1' \ No newline at end of file +++++AXTextField AXEnabled='1'
diff --git a/content/test/data/accessibility/aria/aria-emphasis-expected-mac.txt b/content/test/data/accessibility/aria/aria-emphasis-expected-mac.txt index 64fcf2b..1eb73c3 100644 --- a/content/test/data/accessibility/aria/aria-emphasis-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-emphasis-expected-mac.txt
@@ -3,5 +3,5 @@ ++++AXStaticText AXRoleDescription='text' AXValue='role' ++AXStaticText AXRoleDescription='text' AXValue='element (no name)' ++AXStaticText AXRoleDescription='text' AXValue=' ' -++AXGroup AXSubrole=AXEmphasisStyleGroup AXRoleDescription='group' AXDescription='include me' +++AXGroup AXSubrole=AXEmphasisStyleGroup AXDescription='include me' AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'
diff --git a/content/test/data/accessibility/aria/aria-expanded-expected-mac.txt b/content/test/data/accessibility/aria/aria-expanded-expected-mac.txt index 6686824..0ef4d9b 100644 --- a/content/test/data/accessibility/aria/aria-expanded-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-expanded-expected-mac.txt
@@ -1,9 +1,9 @@ AXWebArea ++AXMenu -++++AXMenuItem AXTitle='New' AXExpanded='0' -++++AXMenuItem AXTitle='Open' AXExpanded='1' -++++AXMenuItem AXTitle='Save' AXExpanded='0' -++++AXMenuItem AXTitle='Quit' AXExpanded='1' +++++AXMenuItem AXExpanded='0' AXTitle='New' +++++AXMenuItem AXExpanded='1' AXTitle='Open' +++++AXMenuItem AXExpanded='0' AXTitle='Save' +++++AXMenuItem AXExpanded='1' AXTitle='Quit' ++AXSplitter ++AXSplitter ++AXSplitter
diff --git a/content/test/data/accessibility/aria/aria-feed-expected-mac.txt b/content/test/data/accessibility/aria/aria-feed-expected-mac.txt index facb8ecc..8c4fa38 100644 --- a/content/test/data/accessibility/aria/aria-feed-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-feed-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXRoleDescription='article' AXDescription='First' +++AXGroup AXDescription='First' AXRoleDescription='article' ++++AXStaticText AXRoleDescription='text' AXValue='First' -++AXGroup AXRoleDescription='article' AXDescription='Second' +++AXGroup AXDescription='Second' AXRoleDescription='article' ++++AXStaticText AXRoleDescription='text' AXValue='Second'
diff --git a/content/test/data/accessibility/aria/aria-figure-expected-mac.txt b/content/test/data/accessibility/aria/aria-figure-expected-mac.txt index 27476bc85..7a9046bd 100644 --- a/content/test/data/accessibility/aria/aria-figure-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-figure-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='figure' -++++AXStaticText AXRoleDescription='text' AXValue='Figure' \ No newline at end of file +++++AXStaticText AXRoleDescription='text' AXValue='Figure'
diff --git a/content/test/data/accessibility/aria/aria-flowto-expected-mac.txt b/content/test/data/accessibility/aria/aria-flowto-expected-mac.txt index 8652ad1..4f17d3e 100644 --- a/content/test/data/accessibility/aria/aria-flowto-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-flowto-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXRoleDescription='region' AXLinkedUIElements=["AXGroup footer next"] +++AXGroup AXLinkedUIElements=["AXGroup footer next"] AXRoleDescription='region' ++++AXStaticText AXRoleDescription='text' AXValue='Lorem ipsum' ++AXGroup AXRoleDescription='footer' ++++AXStaticText AXRoleDescription='text' AXValue='dolor sit amet'
diff --git a/content/test/data/accessibility/aria/aria-gridcell-focused-only-expected-mac.txt b/content/test/data/accessibility/aria/aria-gridcell-focused-only-expected-mac.txt index 13523fc..e23481a 100644 --- a/content/test/data/accessibility/aria/aria-gridcell-focused-only-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-gridcell-focused-only-expected-mac.txt
@@ -2,27 +2,27 @@ ++AXTable AXRoleDescription='table' AXSelected='0' ++++AXRow AXRoleDescription='row' AXSelected='0' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Browser' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Browser' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Rendering Engine' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Rendering Engine' ++++AXRow AXRoleDescription='row' AXSelected='0' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Chrome' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Chrome' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Blink' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Blink' ++++AXColumn AXRoleDescription='column' AXSelected='0' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Browser' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Browser' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Chrome' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Chrome' ++++AXColumn AXRoleDescription='column' AXSelected='0' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Rendering Engine' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Rendering Engine' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Blink' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Blink' ++++AXGroup AXRoleDescription='group' AXSelected='0' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Browser' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Browser' ++++++AXCell AXRoleDescription='cell' AXSelected='0' -++++++++AXStaticText AXRoleDescription='text' AXValue='Rendering Engine' AXSelected='0' -++AXStaticText AXRoleDescription='text' AXValue='Done' AXSelected='0' +++++++++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Rendering Engine' +++AXStaticText AXRoleDescription='text' AXSelected='0' AXValue='Done'
diff --git a/content/test/data/accessibility/aria/aria-gridcell-focused-only.html b/content/test/data/accessibility/aria/aria-gridcell-focused-only.html index 28a8f17..b93975aea 100644 --- a/content/test/data/accessibility/aria/aria-gridcell-focused-only.html +++ b/content/test/data/accessibility/aria/aria-gridcell-focused-only.html
@@ -1,6 +1,6 @@ <!-- @MAC-ALLOW:AXRole* -@MAC-ALLOW:AXSelected* +@MAC-ALLOW:AXSelected=* @WIN-ALLOW:SELECT* @WIN-ALLOW:xml-roles* @AURALINUX-ALLOW:xml-roles*
diff --git a/content/test/data/accessibility/aria/aria-group-expected-mac.txt b/content/test/data/accessibility/aria/aria-group-expected-mac.txt index a7b5b14..73f62ec 100644 --- a/content/test/data/accessibility/aria/aria-group-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-group-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXLink AXRoleDescription='link' AXDescription='Group Link1' +++++AXLink AXDescription='Group Link1' AXRoleDescription='link' ++++++AXStaticText AXRoleDescription='text' AXValue='Group Link1' -++++AXLink AXRoleDescription='link' AXDescription='Group Link2' -++++++AXStaticText AXRoleDescription='text' AXValue='Group Link2' \ No newline at end of file +++++AXLink AXDescription='Group Link2' AXRoleDescription='link' +++++++AXStaticText AXRoleDescription='text' AXValue='Group Link2'
diff --git a/content/test/data/accessibility/aria/aria-haspopup-expected-mac.txt b/content/test/data/accessibility/aria/aria-haspopup-expected-mac.txt index 5aff3b3e..adecde3 100644 --- a/content/test/data/accessibility/aria/aria-haspopup-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-haspopup-expected-mac.txt
@@ -7,4 +7,4 @@ ++AXPopUpButton AXHasPopup='1' AXHasPopupValue='dialog' ++AXPopUpButton AXHasPopup='1' AXHasPopupValue='menu' ++AXPopUpButton AXHasPopup='1' AXHasPopupValue='listbox' -++AXPopUpButton AXHasPopup='1' AXHasPopupValue='listbox' \ No newline at end of file +++AXPopUpButton AXHasPopup='1' AXHasPopupValue='listbox'
diff --git a/content/test/data/accessibility/aria/aria-heading-expected-mac.txt b/content/test/data/accessibility/aria/aria-heading-expected-mac.txt index aab26d1f..6a8d46c 100644 --- a/content/test/data/accessibility/aria/aria-heading-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-heading-expected-mac.txt
@@ -13,4 +13,4 @@ ++++AXStaticText AXValue='ARIA Heading 6' ++AXGroup ++++AXHeading AXTitle='Heading' AXValue='2' -++++++AXStaticText AXValue='Heading' \ No newline at end of file +++++++AXStaticText AXValue='Heading'
diff --git a/content/test/data/accessibility/aria/aria-invalid-expected-mac.txt b/content/test/data/accessibility/aria/aria-invalid-expected-mac.txt index 5010121..3d4655ad6 100644 --- a/content/test/data/accessibility/aria/aria-invalid-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-invalid-expected-mac.txt
@@ -1,12 +1,12 @@ AXWebArea AXInvalid='false' ++AXGroup AXInvalid='true' ++++AXStaticText AXValue='invalid=true' -++AXTextArea AXValue='An eror via invalid=spelling' AXInvalid='false' +++AXTextArea AXInvalid='false' AXValue='An eror via invalid=spelling' ++++AXStaticText AXValue='An ' ++++AXGroup AXInvalid='spelling' ++++++AXStaticText AXValue='eror' ++++AXStaticText AXValue=' via invalid=spelling' -++AXTextArea AXValue='An errors via invalid=grammar' AXInvalid='false' +++AXTextArea AXInvalid='false' AXValue='An errors via invalid=grammar' ++++AXStaticText AXValue='An ' ++++AXGroup AXInvalid='grammar' ++++++AXStaticText AXValue='errors' @@ -20,4 +20,4 @@ ++AXGroup AXInvalid='unknown' ++++AXStaticText AXValue='invalid=unknown' ++AXGroup -++++AXTextField AXValue='1234' AXInvalid='true' \ No newline at end of file +++++AXTextField AXInvalid='true' AXValue='1234'
diff --git a/content/test/data/accessibility/aria/aria-label-expected-mac.txt b/content/test/data/accessibility/aria/aria-label-expected-mac.txt index 08967d4..6f1a40a 100644 --- a/content/test/data/accessibility/aria/aria-label-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-label-expected-mac.txt
@@ -1,2 +1,2 @@ AXWebArea AXRoleDescription='HTML content' -++AXCheckBox AXRoleDescription='checkbox' AXValue='0' AXDescription='aria label' +++AXCheckBox AXDescription='aria label' AXRoleDescription='checkbox' AXValue='0'
diff --git a/content/test/data/accessibility/aria/aria-level-expected-mac.txt b/content/test/data/accessibility/aria/aria-level-expected-mac.txt index 8c867c0..ccfe803a 100644 --- a/content/test/data/accessibility/aria/aria-level-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-level-expected-mac.txt
@@ -14,12 +14,12 @@ ++AXHeading AXTitle='Level 5' AXValue='5' ++++AXStaticText AXValue='Level 5' ++AXOutline -++++AXRow AXSubrole=AXOutlineRow AXTitle='Tree item at level 1' AXDisclosing='1' AXDisclosureLevel='0' +++++AXRow AXSubrole=AXOutlineRow AXDisclosing='1' AXDisclosureLevel='0' AXTitle='Tree item at level 1' ++++++AXStaticText AXValue='Tree item at level 1' ++++++AXGroup -++++++++AXRow AXSubrole=AXOutlineRow AXTitle='Tree item at level 2' AXDisclosing='0' AXDisclosureLevel='1' +++++++++AXRow AXSubrole=AXOutlineRow AXDisclosing='0' AXDisclosureLevel='1' AXTitle='Tree item at level 2' ++++++++++AXStaticText AXValue='Tree item at level 2' -++++AXRow AXSubrole=AXOutlineRow AXTitle='Tree item at level 3' AXDisclosing='0' AXDisclosureLevel='2' +++++AXRow AXSubrole=AXOutlineRow AXDisclosing='0' AXDisclosureLevel='2' AXTitle='Tree item at level 3' ++++++AXStaticText AXValue='Tree item at level 3' ++AXTable ++++AXRow AXDisclosureLevel='0'
diff --git a/content/test/data/accessibility/aria/aria-link-expected-mac.txt b/content/test/data/accessibility/aria/aria-link-expected-mac.txt index a09352c..3ec29c1 100644 --- a/content/test/data/accessibility/aria/aria-link-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-link-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' -++AXLink AXRoleDescription='link' AXDescription='ARIA Link' -++++AXStaticText AXRoleDescription='text' AXValue='ARIA Link' \ No newline at end of file +++AXLink AXDescription='ARIA Link' AXRoleDescription='link' +++++AXStaticText AXRoleDescription='text' AXValue='ARIA Link'
diff --git a/content/test/data/accessibility/aria/aria-listbox-aria-selected-expected-mac.txt b/content/test/data/accessibility/aria/aria-listbox-aria-selected-expected-mac.txt index 3fc6144e..a6a0aaa 100644 --- a/content/test/data/accessibility/aria/aria-listbox-aria-selected-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-listbox-aria-selected-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea AXSelected='0' ++AXList AXOrientation='AXVerticalOrientation' AXSelected='0' AXSelectedChildren=["AXStaticText Item 4 selected","AXStaticText Item 5 selected"] AXVisibleChildren=["AXStaticText Item 1 not selected","AXStaticText Item 2 not selected","AXStaticText Item 3 not selected","AXStaticText Item 4 selected","AXStaticText Item 5 selected"] -++++AXStaticText AXValue='Item 1 not selected' AXSelected='0' -++++AXStaticText AXValue='Item 2 not selected' AXSelected='0' -++++AXStaticText AXValue='Item 3 not selected' AXSelected='0' -++++AXStaticText AXValue='Item 4 selected' AXSelected='1' -++++AXStaticText AXValue='Item 5 selected' AXSelected='1' \ No newline at end of file +++++AXStaticText AXSelected='0' AXValue='Item 1 not selected' +++++AXStaticText AXSelected='0' AXValue='Item 2 not selected' +++++AXStaticText AXSelected='0' AXValue='Item 3 not selected' +++++AXStaticText AXSelected='1' AXValue='Item 4 selected' +++++AXStaticText AXSelected='1' AXValue='Item 5 selected'
diff --git a/content/test/data/accessibility/aria/aria-listbox-aria-selected.html b/content/test/data/accessibility/aria/aria-listbox-aria-selected.html index f6d5da9..bb229299 100644 --- a/content/test/data/accessibility/aria/aria-listbox-aria-selected.html +++ b/content/test/data/accessibility/aria/aria-listbox-aria-selected.html
@@ -3,7 +3,8 @@ @MAC-ALLOW:AXFocusable* @MAC-ALLOW:AXTitle* @MAC-ALLOW:AXOrientation* -@MAC-ALLOW:AXSelect* +@MAC-ALLOW:AXSelected=* +@MAC-ALLOW:AXSelectedChildren=* @MAC-ALLOW:AXVisibleChildren* @WIN-ALLOW:ia2_hypertext=* -->
diff --git a/content/test/data/accessibility/aria/aria-listbox-childfocus-expected-mac.txt b/content/test/data/accessibility/aria/aria-listbox-childfocus-expected-mac.txt index b92e538e..b1249e9 100644 --- a/content/test/data/accessibility/aria/aria-listbox-childfocus-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-listbox-childfocus-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXList AXOrientation='AXVerticalOrientation' AXSelectedChildren=["AXStaticText 2"] AXVisibleChildren=["AXStaticText 1","AXStaticText 2","AXStaticText 3"] ++++AXStaticText AXValue='1' ++++AXStaticText AXValue='2' -++++AXStaticText AXValue='3' \ No newline at end of file +++++AXStaticText AXValue='3'
diff --git a/content/test/data/accessibility/aria/aria-listbox-expected-mac.txt b/content/test/data/accessibility/aria/aria-listbox-expected-mac.txt index 0ff11c30..eac737c 100644 --- a/content/test/data/accessibility/aria/aria-listbox-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-listbox-expected-mac.txt
@@ -4,4 +4,4 @@ ++++AXStaticText AXRoleDescription='text' AXValue='Item 2' ++++AXSplitter AXRoleDescription='splitter' ++++AXStaticText AXRoleDescription='text' AXValue='Second group item 1' -++++AXStaticText AXRoleDescription='text' AXValue='Second group item 2' \ No newline at end of file +++++AXStaticText AXRoleDescription='text' AXValue='Second group item 2'
diff --git a/content/test/data/accessibility/aria/aria-live-expected-mac.txt b/content/test/data/accessibility/aria/aria-live-expected-mac.txt index 3ab5c51..693f6e2 100644 --- a/content/test/data/accessibility/aria/aria-live-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-live-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='off' ++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='polite' ++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='assertive' -++AXGroup AXSubrole=AXApplicationAlert AXARIALive='assertive' \ No newline at end of file +++AXGroup AXSubrole=AXApplicationAlert AXARIALive='assertive'
diff --git a/content/test/data/accessibility/aria/aria-live-with-content-expected-mac.txt b/content/test/data/accessibility/aria/aria-live-with-content-expected-mac.txt index 28121b5..7badec5 100644 --- a/content/test/data/accessibility/aria/aria-live-with-content-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-live-with-content-expected-mac.txt
@@ -4,4 +4,4 @@ ++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='polite' ++++AXStaticText AXValue='Polite' ++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='assertive' -++++AXStaticText AXValue='Assertive' \ No newline at end of file +++++AXStaticText AXValue='Assertive'
diff --git a/content/test/data/accessibility/aria/aria-marquee-expected-mac.txt b/content/test/data/accessibility/aria/aria-marquee-expected-mac.txt index 0ccfc31..43221d9d 100644 --- a/content/test/data/accessibility/aria/aria-marquee-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-marquee-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXSubrole=AXApplicationMarquee AXRoleDescription='marquee' AXARIALive='off' -++AXGroup AXSubrole=AXApplicationMarquee AXRoleDescription='marquee' AXARIALive='polite' -++AXGroup AXSubrole=AXApplicationMarquee AXRoleDescription='marquee' AXARIALive='assertive' \ No newline at end of file +++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='off' AXRoleDescription='marquee' +++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='polite' AXRoleDescription='marquee' +++AXGroup AXSubrole=AXApplicationMarquee AXARIALive='assertive' AXRoleDescription='marquee'
diff --git a/content/test/data/accessibility/aria/aria-math-expected-mac.txt b/content/test/data/accessibility/aria/aria-math-expected-mac.txt index 7f64c77..af70c5b 100644 --- a/content/test/data/accessibility/aria/aria-math-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-math-expected-mac.txt
@@ -1,2 +1,2 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXSubrole=AXDocumentMath AXRoleDescription='math' \ No newline at end of file +++AXGroup AXSubrole=AXDocumentMath AXRoleDescription='math'
diff --git a/content/test/data/accessibility/aria/aria-menu-expected-mac.txt b/content/test/data/accessibility/aria/aria-menu-expected-mac.txt index 4f505e8..541f4b9 100644 --- a/content/test/data/accessibility/aria/aria-menu-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-menu-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea ++AXMenuBar -++++AXMenuItem AXTitle='File' AXLinkedUIElements=["AXMenu File"] +++++AXMenuItem AXLinkedUIElements=["AXMenu File"] AXTitle='File' ++++AXMenuItem AXTitle='Edit' ++++AXMenuItem AXTitle='View' ++AXMenu AXDescription='File'
diff --git a/content/test/data/accessibility/aria/aria-menuitem-expected-mac.txt b/content/test/data/accessibility/aria/aria-menuitem-expected-mac.txt index d60aad6..07c25ddb 100644 --- a/content/test/data/accessibility/aria/aria-menuitem-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-menuitem-expected-mac.txt
@@ -5,4 +5,4 @@ ++++AXMenuItem AXTitle='Complex menuitem' ++++++AXStaticText AXValue='Complex ' ++++++AXTextField -++++++AXStaticText AXValue=' menuitem' \ No newline at end of file +++++++AXStaticText AXValue=' menuitem'
diff --git a/content/test/data/accessibility/aria/aria-menuitemcheckbox-expected-mac.txt b/content/test/data/accessibility/aria/aria-menuitemcheckbox-expected-mac.txt index 3e20a16..b9ae7254 100644 --- a/content/test/data/accessibility/aria/aria-menuitemcheckbox-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-menuitemcheckbox-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXMenu AXRoleDescription='menu' ++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 1' AXValue='0' ++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 2' AXValue='1' -++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 3' AXValue='2' \ No newline at end of file +++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 3' AXValue='2'
diff --git a/content/test/data/accessibility/aria/aria-menuitemradio-expected-mac.txt b/content/test/data/accessibility/aria/aria-menuitemradio-expected-mac.txt index 3e20a16..b9ae7254 100644 --- a/content/test/data/accessibility/aria/aria-menuitemradio-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-menuitemradio-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXMenu AXRoleDescription='menu' ++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 1' AXValue='0' ++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 2' AXValue='1' -++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 3' AXValue='2' \ No newline at end of file +++++AXMenuItem AXRoleDescription='menu item' AXTitle='Menu item 3' AXValue='2'
diff --git a/content/test/data/accessibility/aria/aria-meter-expected-mac.txt b/content/test/data/accessibility/aria/aria-meter-expected-mac.txt index 57c5b02..b9d4befe 100644 --- a/content/test/data/accessibility/aria/aria-meter-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-meter-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea -++AXLevelIndicator AXValue='50' AXDescription='funding' -++AXLevelIndicator AXValue='10' AXDescription='funding' +++AXLevelIndicator AXDescription='funding' AXValue='50' +++AXLevelIndicator AXDescription='funding' AXValue='10'
diff --git a/content/test/data/accessibility/aria/aria-multiselectable-expected-mac.txt b/content/test/data/accessibility/aria/aria-multiselectable-expected-mac.txt index f1dcb28..b88eea5 100644 --- a/content/test/data/accessibility/aria/aria-multiselectable-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-multiselectable-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea ++AXList -++AXList \ No newline at end of file +++AXList
diff --git a/content/test/data/accessibility/aria/aria-orientation-expected-mac.txt b/content/test/data/accessibility/aria/aria-orientation-expected-mac.txt index 804bcdd..fd63edb 100644 --- a/content/test/data/accessibility/aria/aria-orientation-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-orientation-expected-mac.txt
@@ -14,12 +14,12 @@ ++AXRadioGroup ++AXRadioGroup AXOrientation='AXHorizontalOrientation' ++AXRadioGroup AXOrientation='AXVerticalOrientation' -++AXScrollBar AXValue='50' AXOrientation='AXVerticalOrientation' -++AXScrollBar AXValue='50' AXOrientation='AXHorizontalOrientation' -++AXScrollBar AXValue='50' AXOrientation='AXVerticalOrientation' -++AXSlider AXValue='50' AXOrientation='AXHorizontalOrientation' -++AXSlider AXValue='50' AXOrientation='AXHorizontalOrientation' -++AXSlider AXValue='50' AXOrientation='AXVerticalOrientation' +++AXScrollBar AXOrientation='AXVerticalOrientation' AXValue='50' +++AXScrollBar AXOrientation='AXHorizontalOrientation' AXValue='50' +++AXScrollBar AXOrientation='AXVerticalOrientation' AXValue='50' +++AXSlider AXOrientation='AXHorizontalOrientation' AXValue='50' +++AXSlider AXOrientation='AXHorizontalOrientation' AXValue='50' +++AXSlider AXOrientation='AXVerticalOrientation' AXValue='50' ++AXSplitter AXOrientation='AXHorizontalOrientation' ++AXSplitter AXOrientation='AXHorizontalOrientation' ++AXSplitter AXOrientation='AXVerticalOrientation' @@ -37,4 +37,4 @@ ++AXTable AXOrientation='AXHorizontalOrientation' ++++AXGroup ++AXTable AXOrientation='AXVerticalOrientation' -++++AXGroup \ No newline at end of file +++++AXGroup
diff --git a/content/test/data/accessibility/aria/aria-posinset-expected-mac.txt b/content/test/data/accessibility/aria/aria-posinset-expected-mac.txt index eaf9a072..1f31786 100644 --- a/content/test/data/accessibility/aria/aria-posinset-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-posinset-expected-mac.txt
@@ -1,36 +1,36 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXRoleDescription='article' AXARIASetSize='0' AXARIAPosInSet='0' +++AXGroup AXARIAPosInSet='0' AXARIASetSize='0' AXRoleDescription='article' ++++AXStaticText AXRoleDescription='text' AXValue='This is an ARIA article 1.' -++AXGroup AXRoleDescription='article' AXARIASetSize='0' AXARIAPosInSet='0' +++AXGroup AXARIAPosInSet='0' AXARIASetSize='0' AXRoleDescription='article' ++++AXStaticText AXRoleDescription='text' AXValue='This is an ARIA article 2.' -++AXList AXRoleDescription='list' AXARIASetSize='2' -++++AXStaticText AXRoleDescription='text' AXValue='Item 1' AXARIASetSize='2' AXARIAPosInSet='1' -++++AXStaticText AXRoleDescription='text' AXValue='Item 2' AXARIASetSize='2' AXARIAPosInSet='2' -++AXList AXRoleDescription='list' AXARIASetSize='2' -++++AXStaticText AXRoleDescription='text' AXValue='Item 1' AXARIASetSize='2' AXARIAPosInSet='1' -++++AXStaticText AXRoleDescription='text' AXValue='Item 2' AXARIASetSize='2' AXARIAPosInSet='2' +++AXList AXARIASetSize='2' AXRoleDescription='list' +++++AXStaticText AXARIAPosInSet='1' AXARIASetSize='2' AXRoleDescription='text' AXValue='Item 1' +++++AXStaticText AXARIAPosInSet='2' AXARIASetSize='2' AXRoleDescription='text' AXValue='Item 2' +++AXList AXARIASetSize='2' AXRoleDescription='list' +++++AXStaticText AXARIAPosInSet='1' AXARIASetSize='2' AXRoleDescription='text' AXValue='Item 1' +++++AXStaticText AXARIAPosInSet='2' AXARIASetSize='2' AXRoleDescription='text' AXValue='Item 2' ++AXGroup AXRoleDescription='form' -++++AXRadioButton AXRoleDescription='radio button' AXValue='0' AXARIASetSize='4' AXARIAPosInSet='3' +++++AXRadioButton AXARIAPosInSet='3' AXARIASetSize='4' AXRoleDescription='radio button' AXValue='0' ++++AXStaticText AXRoleDescription='text' AXValue='1' ++++AXGroup AXRoleDescription='group' AXTitle='<newline>' -++++AXRadioButton AXRoleDescription='radio button' AXValue='0' AXARIASetSize='4' AXARIAPosInSet='4' +++++AXRadioButton AXARIAPosInSet='4' AXARIASetSize='4' AXRoleDescription='radio button' AXValue='0' ++++AXStaticText AXRoleDescription='text' AXValue='2' -++AXRadioButton AXRoleDescription='radio button' AXValue='0' AXARIASetSize='2' AXARIAPosInSet='1' +++AXRadioButton AXARIAPosInSet='1' AXARIASetSize='2' AXRoleDescription='radio button' AXValue='0' ++AXStaticText AXRoleDescription='text' AXValue='Apple' ++AXGroup AXRoleDescription='group' AXTitle='<newline>' -++AXRadioButton AXRoleDescription='radio button' AXValue='0' AXARIASetSize='2' AXARIAPosInSet='2' +++AXRadioButton AXARIAPosInSet='2' AXARIASetSize='2' AXRoleDescription='radio button' AXValue='0' ++AXStaticText AXRoleDescription='text' AXValue='Banana' -++AXGroup AXRoleDescription='group' AXDescription='Cake' AXARIASetSize='0' +++AXGroup AXARIASetSize='0' AXDescription='Cake' AXRoleDescription='group' ++++AXGroup AXRoleDescription='group' ++++++AXStaticText AXRoleDescription='text' AXValue='Cake' -++++AXRadioButton AXRoleDescription='radio button' AXTitle='Chiffon cakes' AXValue='1' AXARIASetSize='2' AXARIAPosInSet='1' +++++AXRadioButton AXARIAPosInSet='1' AXARIASetSize='2' AXRoleDescription='radio button' AXTitle='Chiffon cakes' AXValue='1' ++++AXGroup AXRoleDescription='group' AXTitle='<newline>' -++++AXRadioButton AXRoleDescription='radio button' AXTitle='Chocolate cakes' AXValue='0' AXARIASetSize='2' AXARIAPosInSet='2' +++++AXRadioButton AXARIAPosInSet='2' AXARIASetSize='2' AXRoleDescription='radio button' AXTitle='Chocolate cakes' AXValue='0' ++AXGroup AXRoleDescription='form' ++++AXGroup AXRoleDescription='group' ++++++AXButton AXRoleDescription='button' AXTitle='changedFromRadio' ++++++AXGroup AXRoleDescription='group' ++++++++AXStaticText AXRoleDescription='text' AXValue='red' ++++++AXGroup AXRoleDescription='group' AXTitle='<newline>' -++++++AXRadioButton AXRoleDescription='radio button' AXTitle='blue' AXValue='0' AXARIASetSize='1' AXARIAPosInSet='1' -++AXStaticText AXRoleDescription='text' AXValue='Done' \ No newline at end of file +++++++AXRadioButton AXARIAPosInSet='1' AXARIASetSize='1' AXRoleDescription='radio button' AXTitle='blue' AXValue='0' +++AXStaticText AXRoleDescription='text' AXValue='Done'
diff --git a/content/test/data/accessibility/aria/aria-progressbar-expected-mac.txt b/content/test/data/accessibility/aria/aria-progressbar-expected-mac.txt index 2b4dcf1..f3c5151 100644 --- a/content/test/data/accessibility/aria/aria-progressbar-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-progressbar-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' -++AXProgressIndicator AXRoleDescription='progress indicator' AXValue='3' AXMinValue='1' AXMaxValue='37' -++AXProgressIndicator AXRoleDescription='progress indicator' AXValue='3' AXMinValue='1' AXMaxValue='96' AXValueDescription='three' -++AXProgressIndicator AXRoleDescription='progress indicator' AXMinValue='0' AXMaxValue='10' +++AXProgressIndicator AXMaxValue='37' AXMinValue='1' AXRoleDescription='progress indicator' AXValue='3' +++AXProgressIndicator AXMaxValue='96' AXMinValue='1' AXRoleDescription='progress indicator' AXValue='3' AXValueDescription='three' +++AXProgressIndicator AXMaxValue='10' AXMinValue='0' AXRoleDescription='progress indicator'
diff --git a/content/test/data/accessibility/aria/aria-radiogroup-expected-mac.txt b/content/test/data/accessibility/aria/aria-radiogroup-expected-mac.txt index de05002..19fbf80 100644 --- a/content/test/data/accessibility/aria/aria-radiogroup-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-radiogroup-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' -++AXRadioGroup AXRoleDescription='radio group' AXDescription='My group' -++++AXRadioButton AXRoleDescription='radio' AXTitle='Radio 1' AXValue='0' AXLinkedUIElements=["AXRadioButton Radio 1","AXRadioButton Radio 2"] -++++AXRadioButton AXRoleDescription='radio' AXTitle='Radio 2' AXValue='0' AXLinkedUIElements=["AXRadioButton Radio 1","AXRadioButton Radio 2"] +++AXRadioGroup AXDescription='My group' AXRoleDescription='radio group' +++++AXRadioButton AXLinkedUIElements=["AXRadioButton Radio 1","AXRadioButton Radio 2"] AXRoleDescription='radio' AXTitle='Radio 1' AXValue='0' +++++AXRadioButton AXLinkedUIElements=["AXRadioButton Radio 1","AXRadioButton Radio 2"] AXRoleDescription='radio' AXTitle='Radio 2' AXValue='0'
diff --git a/content/test/data/accessibility/aria/aria-readonly-expected-mac.txt b/content/test/data/accessibility/aria/aria-readonly-expected-mac.txt index dd8ddfb..b3b38a3 100644 --- a/content/test/data/accessibility/aria/aria-readonly-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-readonly-expected-mac.txt
@@ -11,13 +11,13 @@ ++AXTextField AXDescription='Readonly-true role unimplemented textbox' ++AXTextField AXDescription='Readonly-false contenteditable textbox' ++AXTextField AXDescription='Readonly-true contenteditable textbox' -++AXCheckBox AXValue='0' AXDescription='Readonly checkbox' +++AXCheckBox AXDescription='Readonly checkbox' AXValue='0' ++AXComboBox AXDescription='Readonly combobox' ++AXList AXDescription='Readonly listbox' ++AXRadioGroup AXDescription='Readonly radiogroup' -++AXSlider AXValue='50' AXDescription='Readonly slider' -++AXIncrementor AXValue='0' AXDescription='Readonly spinbutton' -++AXMenuItem AXValue='0' AXDescription='Readonly menuitemcheckbox' -++AXMenuItem AXValue='0' AXDescription='Readonly menuitemradio' +++AXSlider AXDescription='Readonly slider' AXValue='50' +++AXIncrementor AXDescription='Readonly spinbutton' AXValue='0' +++AXMenuItem AXDescription='Readonly menuitemcheckbox' AXValue='0' +++AXMenuItem AXDescription='Readonly menuitemradio' AXValue='0' ++AXTextField AXDescription='Readonly searchbox' -++AXCheckBox AXValue='0' AXDescription='Readonly switch' \ No newline at end of file +++AXCheckBox AXDescription='Readonly switch' AXValue='0'
diff --git a/content/test/data/accessibility/aria/aria-required-expected-mac.txt b/content/test/data/accessibility/aria/aria-required-expected-mac.txt index 79dad931..ccdb29a 100644 --- a/content/test/data/accessibility/aria/aria-required-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-required-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRequired='0' ++AXRadioGroup ++++AXRadioButton AXValue='0' -++++AXRadioButton AXValue='0' \ No newline at end of file +++++AXRadioButton AXValue='0'
diff --git a/content/test/data/accessibility/aria/aria-selected-expected-mac.txt b/content/test/data/accessibility/aria/aria-selected-expected-mac.txt index 950b3cab..64b5730 100644 --- a/content/test/data/accessibility/aria/aria-selected-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-selected-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXSelected='0' ++AXList AXSelected='0' AXSelectedChildren=["AXStaticText 1"] -++++AXStaticText AXValue='1' AXSelected='1' -++++AXStaticText AXValue='2' AXSelected='0' \ No newline at end of file +++++AXStaticText AXSelected='1' AXValue='1' +++++AXStaticText AXSelected='0' AXValue='2'
diff --git a/content/test/data/accessibility/aria/aria-selected.html b/content/test/data/accessibility/aria/aria-selected.html index 291f352..67e3cda7 100644 --- a/content/test/data/accessibility/aria/aria-selected.html +++ b/content/test/data/accessibility/aria/aria-selected.html
@@ -1,7 +1,7 @@ <!-- -@MAC-ALLOW:AXSelected* +@MAC-ALLOW:AXSelected=* +@MAC-ALLOW:AXSelectedChildren=* @MAC-ALLOW:AXSubrole* -@MAC-ALLOW:AXSelected* @WIN-ALLOW:SELECTED @AURALINUX-ALLOW:select* -->
diff --git a/content/test/data/accessibility/aria/aria-separator-expected-mac.txt b/content/test/data/accessibility/aria/aria-separator-expected-mac.txt index bbcbe34..003f5680 100644 --- a/content/test/data/accessibility/aria/aria-separator-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-separator-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXStaticText AXRoleDescription='text' AXValue='Before' ++AXSplitter AXRoleDescription='splitter' ++AXSplitter AXRoleDescription='splitter' AXValue='1' -++AXStaticText AXRoleDescription='text' AXValue='After' \ No newline at end of file +++AXStaticText AXRoleDescription='text' AXValue='After'
diff --git a/content/test/data/accessibility/aria/aria-setsize-expected-mac.txt b/content/test/data/accessibility/aria/aria-setsize-expected-mac.txt index c150d808..a94f54d3 100644 --- a/content/test/data/accessibility/aria/aria-setsize-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-setsize-expected-mac.txt
@@ -1,12 +1,12 @@ AXWebArea AXRoleDescription='HTML content' -++AXList AXRoleDescription='list' AXARIASetSize='4' -++++AXStaticText AXRoleDescription='text' AXValue='Item 1' AXARIASetSize='4' AXARIAPosInSet='1' -++++AXStaticText AXRoleDescription='text' AXValue='Item 2' AXARIASetSize='4' AXARIAPosInSet='2' -++++AXStaticText AXRoleDescription='text' AXValue='Item 3' AXARIASetSize='4' AXARIAPosInSet='3' -++++AXStaticText AXRoleDescription='text' AXValue='Item 4' AXARIASetSize='4' AXARIAPosInSet='4' -++AXList AXRoleDescription='list' AXARIASetSize='5' -++++AXStaticText AXRoleDescription='text' AXValue='Item 1' AXARIASetSize='5' AXARIAPosInSet='1' -++++AXStaticText AXRoleDescription='text' AXValue='Item 2' AXARIASetSize='5' AXARIAPosInSet='2' -++++AXStaticText AXRoleDescription='text' AXValue='Item 3' AXARIASetSize='5' AXARIAPosInSet='3' -++++AXStaticText AXRoleDescription='text' AXValue='Item 4' AXARIASetSize='5' AXARIAPosInSet='4' -++++AXStaticText AXRoleDescription='text' AXValue='Item 5' AXARIASetSize='5' AXARIAPosInSet='5' \ No newline at end of file +++AXList AXARIASetSize='4' AXRoleDescription='list' +++++AXStaticText AXARIAPosInSet='1' AXARIASetSize='4' AXRoleDescription='text' AXValue='Item 1' +++++AXStaticText AXARIAPosInSet='2' AXARIASetSize='4' AXRoleDescription='text' AXValue='Item 2' +++++AXStaticText AXARIAPosInSet='3' AXARIASetSize='4' AXRoleDescription='text' AXValue='Item 3' +++++AXStaticText AXARIAPosInSet='4' AXARIASetSize='4' AXRoleDescription='text' AXValue='Item 4' +++AXList AXARIASetSize='5' AXRoleDescription='list' +++++AXStaticText AXARIAPosInSet='1' AXARIASetSize='5' AXRoleDescription='text' AXValue='Item 1' +++++AXStaticText AXARIAPosInSet='2' AXARIASetSize='5' AXRoleDescription='text' AXValue='Item 2' +++++AXStaticText AXARIAPosInSet='3' AXARIASetSize='5' AXRoleDescription='text' AXValue='Item 3' +++++AXStaticText AXARIAPosInSet='4' AXARIASetSize='5' AXRoleDescription='text' AXValue='Item 4' +++++AXStaticText AXARIAPosInSet='5' AXARIASetSize='5' AXRoleDescription='text' AXValue='Item 5'
diff --git a/content/test/data/accessibility/aria/aria-strong-expected-mac.txt b/content/test/data/accessibility/aria/aria-strong-expected-mac.txt index eaf5278..4d62eb3 100644 --- a/content/test/data/accessibility/aria/aria-strong-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-strong-expected-mac.txt
@@ -3,5 +3,5 @@ ++++AXStaticText AXRoleDescription='text' AXValue='role' ++AXStaticText AXRoleDescription='text' AXValue='element (no name)' ++AXStaticText AXRoleDescription='text' AXValue=' ' -++AXGroup AXSubrole=AXStrongStyleGroup AXRoleDescription='group' AXDescription='include me' +++AXGroup AXSubrole=AXStrongStyleGroup AXDescription='include me' AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'
diff --git a/content/test/data/accessibility/aria/aria-tab-nested-in-lists-expected-mac.txt b/content/test/data/accessibility/aria/aria-tab-nested-in-lists-expected-mac.txt index 5cec02c0..3fc0d376 100644 --- a/content/test/data/accessibility/aria/aria-tab-nested-in-lists-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-tab-nested-in-lists-expected-mac.txt
@@ -1,10 +1,10 @@ AXWebArea AXRoleDescription='HTML content' ++AXTabGroup AXRoleDescription='tab group' ++++AXGroup AXRoleDescription='group' -++++++AXRadioButton AXRoleDescription='tab' AXTitle='tab1' AXValue='0' AXARIASetSize='5' AXARIAPosInSet='2' +++++++AXRadioButton AXARIAPosInSet='2' AXARIASetSize='5' AXRoleDescription='tab' AXTitle='tab1' AXValue='0' ++++AXGroup AXRoleDescription='group' -++++++AXRadioButton AXRoleDescription='tab' AXTitle='tab2' AXValue='0' AXARIASetSize='5' AXARIAPosInSet='3' +++++++AXRadioButton AXARIAPosInSet='3' AXARIASetSize='5' AXRoleDescription='tab' AXTitle='tab2' AXValue='0' ++++AXGroup AXRoleDescription='group' -++++++AXRadioButton AXRoleDescription='tab' AXTitle='tab3' AXValue='0' AXARIASetSize='5' AXARIAPosInSet='4' +++++++AXRadioButton AXARIAPosInSet='4' AXARIASetSize='5' AXRoleDescription='tab' AXTitle='tab3' AXValue='0' ++++AXGroup AXRoleDescription='group' -++++++AXRadioButton AXRoleDescription='tab' AXTitle='tab4' AXValue='0' AXARIASetSize='5' AXARIAPosInSet='5' +++++++AXRadioButton AXARIAPosInSet='5' AXARIASetSize='5' AXRoleDescription='tab' AXTitle='tab4' AXValue='0'
diff --git a/content/test/data/accessibility/aria/aria-tabpanel-expected-mac.txt b/content/test/data/accessibility/aria/aria-tabpanel-expected-mac.txt index 0b2e9468..984afa87 100644 --- a/content/test/data/accessibility/aria/aria-tabpanel-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-tabpanel-expected-mac.txt
@@ -5,4 +5,4 @@ ++++++++AXStaticText AXRoleDescription='text' AXValue='Item' ++++AXRadioButton AXRoleDescription='tab' AXTitle='Prices' AXValue='0' ++++++AXHeading AXRoleDescription='heading' AXTitle='Prices' AXValue='3' -++++++++AXStaticText AXRoleDescription='text' AXValue='Prices' \ No newline at end of file +++++++++AXStaticText AXRoleDescription='text' AXValue='Prices'
diff --git a/content/test/data/accessibility/aria/aria-time-expected-mac.txt b/content/test/data/accessibility/aria/aria-time-expected-mac.txt index 8976e1dab..93c1224 100644 --- a/content/test/data/accessibility/aria/aria-time-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-time-expected-mac.txt
@@ -4,5 +4,5 @@ ++AXGroup AXSubrole=AXTimeGroup AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='element (no name)' ++AXStaticText AXRoleDescription='text' AXValue=' ' -++AXGroup AXSubrole=AXTimeGroup AXRoleDescription='group' AXDescription='include me' +++AXGroup AXSubrole=AXTimeGroup AXDescription='include me' AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'
diff --git a/content/test/data/accessibility/aria/aria-tooltip-expected-mac.txt b/content/test/data/accessibility/aria/aria-tooltip-expected-mac.txt index 9a2ba2b..8765222b 100644 --- a/content/test/data/accessibility/aria/aria-tooltip-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-tooltip-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' -++AXTextField AXRoleDescription='text field' AXHelp='Your username should be your email id' +++AXTextField AXHelp='Your username should be your email id' AXRoleDescription='text field' ++AXGroup AXSubrole=AXUserInterfaceTooltip AXRoleDescription='tooltip' AXTitle='Your username should be your email id' ++++AXStaticText AXRoleDescription='text' AXValue='Your username should be your email id'
diff --git a/content/test/data/accessibility/aria/aria-tree-discontinuous-expected-mac.txt b/content/test/data/accessibility/aria/aria-tree-discontinuous-expected-mac.txt index c4d1a17..551fba5 100644 --- a/content/test/data/accessibility/aria/aria-tree-discontinuous-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-tree-discontinuous-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea ++AXOutline AXARIASetSize='2' -++++AXRow AXTitle='card content' AXARIASetSize='2' AXARIAPosInSet='1' +++++AXRow AXARIAPosInSet='1' AXARIASetSize='2' AXTitle='card content' ++++++AXStaticText AXValue='card content' ++++AXGroup -++++AXRow AXTitle='card content' AXARIASetSize='2' AXARIAPosInSet='2' -++++++AXStaticText AXValue='card content' \ No newline at end of file +++++AXRow AXARIAPosInSet='2' AXARIASetSize='2' AXTitle='card content' +++++++AXStaticText AXValue='card content'
diff --git a/content/test/data/accessibility/aria/aria-tree-expected-mac.txt b/content/test/data/accessibility/aria/aria-tree-expected-mac.txt index c340b73c..a6059d0 100644 --- a/content/test/data/accessibility/aria/aria-tree-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-tree-expected-mac.txt
@@ -1,22 +1,22 @@ AXWebArea ++AXOutline AXARIASetSize='2' -++++AXRow AXTitle='Animals' AXValue='2' AXARIASetSize='2' AXARIAPosInSet='1' +++++AXRow AXARIAPosInSet='1' AXARIASetSize='2' AXTitle='Animals' AXValue='2' ++++++AXLink AXDescription='Animals' ++++++++AXStaticText AXValue='Animals' ++++++AXGroup AXARIASetSize='2' -++++++++AXRow AXTitle='Domesticated' AXARIASetSize='2' AXARIAPosInSet='1' +++++++++AXRow AXARIAPosInSet='1' AXARIASetSize='2' AXTitle='Domesticated' ++++++++++AXLink AXDescription='Domesticated' ++++++++++++AXStaticText AXValue='Domesticated' ++++++++++AXGroup AXARIASetSize='2' -++++++++++++AXRow AXTitle='Dog' AXValue='1' AXARIASetSize='2' AXARIAPosInSet='1' +++++++++++++AXRow AXARIAPosInSet='1' AXARIASetSize='2' AXTitle='Dog' AXValue='1' ++++++++++++++AXLink AXDescription='Dog' ++++++++++++++++AXStaticText AXValue='Dog' -++++++++++++AXRow AXTitle='Cat' AXValue='0' AXARIASetSize='2' AXARIAPosInSet='2' +++++++++++++AXRow AXARIAPosInSet='2' AXARIASetSize='2' AXTitle='Cat' AXValue='0' ++++++++++++++AXLink AXDescription='Cat' ++++++++++++++++AXStaticText AXValue='Cat' -++++++++AXRow AXTitle='Wild' AXARIASetSize='2' AXARIAPosInSet='2' +++++++++AXRow AXARIAPosInSet='2' AXARIASetSize='2' AXTitle='Wild' ++++++++++AXLink AXDescription='Wild' ++++++++++++AXStaticText AXValue='Wild' -++++AXRow AXTitle='Plants' AXARIASetSize='2' AXARIAPosInSet='2' +++++AXRow AXARIAPosInSet='2' AXARIASetSize='2' AXTitle='Plants' ++++++AXLink AXDescription='Plants' -++++++++AXStaticText AXValue='Plants' \ No newline at end of file +++++++++AXStaticText AXValue='Plants'
diff --git a/content/test/data/accessibility/aria/aria-treeitem-nested-in-lists-expected-mac.txt b/content/test/data/accessibility/aria/aria-treeitem-nested-in-lists-expected-mac.txt index 7b2361d..4f36b31a 100644 --- a/content/test/data/accessibility/aria/aria-treeitem-nested-in-lists-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-treeitem-nested-in-lists-expected-mac.txt
@@ -1,17 +1,17 @@ AXWebArea AXRoleDescription='HTML content' -++AXOutline AXRoleDescription='outline' AXARIASetSize='5' +++AXOutline AXARIASetSize='5' AXRoleDescription='outline' ++++AXGroup AXRoleDescription='group' -++++++AXRow AXRoleDescription='row' AXTitle='treeitem 2 of 5, level 1' AXARIASetSize='5' AXARIAPosInSet='2' +++++++AXRow AXARIAPosInSet='2' AXARIASetSize='5' AXRoleDescription='row' AXTitle='treeitem 2 of 5, level 1' ++++++++AXStaticText AXRoleDescription='text' AXValue='treeitem 2 of 5, level 1' ++++AXGroup AXRoleDescription='group' -++++++AXRow AXRoleDescription='row' AXTitle='treeitem 3 of 5, level 1' AXARIASetSize='5' AXARIAPosInSet='3' +++++++AXRow AXARIAPosInSet='3' AXARIASetSize='5' AXRoleDescription='row' AXTitle='treeitem 3 of 5, level 1' ++++++++AXStaticText AXRoleDescription='text' AXValue='treeitem 3 of 5, level 1' ++++AXGroup AXRoleDescription='group' -++++++AXRow AXRoleDescription='row' AXTitle='treeitem 1 of 2, level 2' AXARIASetSize='2' AXARIAPosInSet='1' +++++++AXRow AXARIAPosInSet='1' AXARIASetSize='2' AXRoleDescription='row' AXTitle='treeitem 1 of 2, level 2' ++++++++AXStaticText AXRoleDescription='text' AXValue='treeitem 1 of 2, level 2' ++++AXGroup AXRoleDescription='group' -++++++AXRow AXRoleDescription='row' AXTitle='treeitem 1 of 1, level 3' AXARIASetSize='1' AXARIAPosInSet='1' +++++++AXRow AXARIAPosInSet='1' AXARIASetSize='1' AXRoleDescription='row' AXTitle='treeitem 1 of 1, level 3' ++++++++AXStaticText AXRoleDescription='text' AXValue='treeitem 1 of 1, level 3' ++++AXGroup AXRoleDescription='group' -++++++AXRow AXRoleDescription='row' AXTitle='treeitem 2 of 2, level 2' AXARIASetSize='2' AXARIAPosInSet='2' +++++++AXRow AXARIAPosInSet='2' AXARIASetSize='2' AXRoleDescription='row' AXTitle='treeitem 2 of 2, level 2' ++++++++AXStaticText AXRoleDescription='text' AXValue='treeitem 2 of 2, level 2'
diff --git a/content/test/data/accessibility/aria/aria-valuemax-expected-mac.txt b/content/test/data/accessibility/aria/aria-valuemax-expected-mac.txt index bd8e38e..fe434d4 100644 --- a/content/test/data/accessibility/aria/aria-valuemax-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-valuemax-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea -++AXProgressIndicator AXValue='51' AXMaxValue='101' -++AXScrollBar AXValue='52' AXMaxValue='102' -++AXSlider AXValue='53' AXMaxValue='103' -++AXIncrementor AXValue='54' AXMaxValue='104' -++++AXStaticText AXValue='Spin' \ No newline at end of file +++AXProgressIndicator AXMaxValue='101' AXValue='51' +++AXScrollBar AXMaxValue='102' AXValue='52' +++AXSlider AXMaxValue='103' AXValue='53' +++AXIncrementor AXMaxValue='104' AXValue='54' +++++AXStaticText AXValue='Spin'
diff --git a/content/test/data/accessibility/aria/aria-valuemin-expected-mac.txt b/content/test/data/accessibility/aria/aria-valuemin-expected-mac.txt index d8563c3..9d1d695b 100644 --- a/content/test/data/accessibility/aria/aria-valuemin-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-valuemin-expected-mac.txt
@@ -3,4 +3,4 @@ ++AXScrollBar AXMinValue='2' ++AXSlider AXMinValue='3' ++AXIncrementor AXMinValue='4' -++++AXStaticText \ No newline at end of file +++++AXStaticText
diff --git a/content/test/data/accessibility/aria/aria-valuetext-expected-mac.txt b/content/test/data/accessibility/aria/aria-valuetext-expected-mac.txt index 0b7b5b6..4f30c6e 100644 --- a/content/test/data/accessibility/aria/aria-valuetext-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria-valuetext-expected-mac.txt
@@ -1,2 +1,2 @@ AXWebArea AXRoleDescription='HTML content' -++AXProgressIndicator AXRoleDescription='progress indicator' AXValue='3' AXMinValue='1' AXMaxValue='96' AXValueDescription='three' +++AXProgressIndicator AXMaxValue='96' AXMinValue='1' AXRoleDescription='progress indicator' AXValue='3' AXValueDescription='three'
diff --git a/content/test/data/accessibility/aria/aria1.1-combobox-expected-mac.txt b/content/test/data/accessibility/aria/aria1.1-combobox-expected-mac.txt index 31f99977..60a0029 100644 --- a/content/test/data/accessibility/aria/aria1.1-combobox-expected-mac.txt +++ b/content/test/data/accessibility/aria/aria1.1-combobox-expected-mac.txt
@@ -5,9 +5,9 @@ ++++AXTextField AXLinkedUIElements=["AXList"] ++AXList ++++AXStaticText AXValue='Alabama' -++++AXStaticText AXValue='Alaska' AXFocused='1' +++++AXStaticText AXFocused='1' AXValue='Alaska' ++AXGroup AXTitle='State' ++++AXTextField AXLinkedUIElements=["AXList"] ++AXList ++++AXStaticText AXValue='Alabama' -++++AXStaticText AXValue='Alaska' \ No newline at end of file +++++AXStaticText AXValue='Alaska'
diff --git a/content/test/data/accessibility/aria/dpub-roles-expected-mac.txt b/content/test/data/accessibility/aria/dpub-roles-expected-mac.txt index a1cb8a5..7a3e54d 100644 --- a/content/test/data/accessibility/aria/dpub-roles-expected-mac.txt +++ b/content/test/data/accessibility/aria/dpub-roles-expected-mac.txt
@@ -1,40 +1,40 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXRoleDescription='doc-abstract' AXDescription='doc-abstract' -++AXGroup AXRoleDescription='doc-acknowledgments' AXDescription='doc-acknowledgments' -++AXGroup AXRoleDescription='doc-afterword' AXDescription='doc-afterword' -++AXGroup AXRoleDescription='doc-appendix' AXDescription='doc-appendix' -++AXLink AXRoleDescription='link' AXDescription='doc-backlink' -++AXGroup AXRoleDescription='doc-biblioentry' AXDescription='doc-biblioentry' -++AXGroup AXRoleDescription='doc-bibliography' AXDescription='doc-bibliography' -++AXLink AXRoleDescription='link' AXDescription='doc-biblioref' -++AXGroup AXRoleDescription='doc-chapter' AXDescription='doc-chapter' -++AXGroup AXRoleDescription='doc-colophon' AXDescription='doc-colophon' -++AXGroup AXRoleDescription='doc-conclusion' AXDescription='doc-conclusion' -++AXImage AXRoleDescription='image' AXDescription='doc-cover' -++AXGroup AXRoleDescription='doc-credit' AXDescription='doc-credit' -++AXGroup AXRoleDescription='doc-credits' AXDescription='doc-credits' -++AXGroup AXRoleDescription='doc-dedication' AXDescription='doc-dedication' -++AXGroup AXRoleDescription='doc-endnote' AXDescription='doc-endnote' -++AXGroup AXRoleDescription='doc-endnotes' AXDescription='doc-endnotes' -++AXGroup AXRoleDescription='doc-epigraph' AXDescription='doc-epigraph' -++AXGroup AXRoleDescription='doc-epilogue' AXDescription='doc-epilogue' -++AXGroup AXRoleDescription='doc-errata' AXDescription='doc-errata' -++AXGroup AXRoleDescription='doc-example' AXDescription='doc-example' -++AXGroup AXRoleDescription='doc-footnote' AXDescription='doc-footnote' -++AXGroup AXRoleDescription='doc-foreword' AXDescription='doc-foreword' -++AXGroup AXRoleDescription='doc-glossary' AXDescription='doc-glossary' -++AXLink AXRoleDescription='link' AXDescription='doc-glossref' -++AXGroup AXRoleDescription='doc-index' AXDescription='doc-index' -++AXGroup AXRoleDescription='doc-introduction' AXDescription='doc-introduction' -++AXLink AXRoleDescription='link' AXDescription='doc-noteref' -++AXGroup AXRoleDescription='doc-notice' AXDescription='doc-notice' -++AXSplitter AXRoleDescription='splitter' AXDescription='doc-pagebreak' -++AXGroup AXRoleDescription='doc-pagelist' AXDescription='doc-pagelist' -++AXGroup AXRoleDescription='doc-part' AXDescription='doc-part' -++AXGroup AXRoleDescription='doc-preface' AXDescription='doc-preface' -++AXGroup AXRoleDescription='doc-prologue' AXDescription='doc-prologue' -++AXGroup AXRoleDescription='doc-pullquote' AXDescription='doc-pullquote' -++AXGroup AXRoleDescription='doc-qna' AXDescription='doc-qna' -++AXHeading AXRoleDescription='heading' AXDescription='doc-subtitle' -++AXGroup AXRoleDescription='doc-tip' AXDescription='doc-tip' -++AXGroup AXRoleDescription='doc-toc' AXDescription='doc-toc' +++AXGroup AXDescription='doc-abstract' AXRoleDescription='doc-abstract' +++AXGroup AXDescription='doc-acknowledgments' AXRoleDescription='doc-acknowledgments' +++AXGroup AXDescription='doc-afterword' AXRoleDescription='doc-afterword' +++AXGroup AXDescription='doc-appendix' AXRoleDescription='doc-appendix' +++AXLink AXDescription='doc-backlink' AXRoleDescription='link' +++AXGroup AXDescription='doc-biblioentry' AXRoleDescription='doc-biblioentry' +++AXGroup AXDescription='doc-bibliography' AXRoleDescription='doc-bibliography' +++AXLink AXDescription='doc-biblioref' AXRoleDescription='link' +++AXGroup AXDescription='doc-chapter' AXRoleDescription='doc-chapter' +++AXGroup AXDescription='doc-colophon' AXRoleDescription='doc-colophon' +++AXGroup AXDescription='doc-conclusion' AXRoleDescription='doc-conclusion' +++AXImage AXDescription='doc-cover' AXRoleDescription='image' +++AXGroup AXDescription='doc-credit' AXRoleDescription='doc-credit' +++AXGroup AXDescription='doc-credits' AXRoleDescription='doc-credits' +++AXGroup AXDescription='doc-dedication' AXRoleDescription='doc-dedication' +++AXGroup AXDescription='doc-endnote' AXRoleDescription='doc-endnote' +++AXGroup AXDescription='doc-endnotes' AXRoleDescription='doc-endnotes' +++AXGroup AXDescription='doc-epigraph' AXRoleDescription='doc-epigraph' +++AXGroup AXDescription='doc-epilogue' AXRoleDescription='doc-epilogue' +++AXGroup AXDescription='doc-errata' AXRoleDescription='doc-errata' +++AXGroup AXDescription='doc-example' AXRoleDescription='doc-example' +++AXGroup AXDescription='doc-footnote' AXRoleDescription='doc-footnote' +++AXGroup AXDescription='doc-foreword' AXRoleDescription='doc-foreword' +++AXGroup AXDescription='doc-glossary' AXRoleDescription='doc-glossary' +++AXLink AXDescription='doc-glossref' AXRoleDescription='link' +++AXGroup AXDescription='doc-index' AXRoleDescription='doc-index' +++AXGroup AXDescription='doc-introduction' AXRoleDescription='doc-introduction' +++AXLink AXDescription='doc-noteref' AXRoleDescription='link' +++AXGroup AXDescription='doc-notice' AXRoleDescription='doc-notice' +++AXSplitter AXDescription='doc-pagebreak' AXRoleDescription='splitter' +++AXGroup AXDescription='doc-pagelist' AXRoleDescription='doc-pagelist' +++AXGroup AXDescription='doc-part' AXRoleDescription='doc-part' +++AXGroup AXDescription='doc-preface' AXRoleDescription='doc-preface' +++AXGroup AXDescription='doc-prologue' AXRoleDescription='doc-prologue' +++AXGroup AXDescription='doc-pullquote' AXRoleDescription='doc-pullquote' +++AXGroup AXDescription='doc-qna' AXRoleDescription='doc-qna' +++AXHeading AXDescription='doc-subtitle' AXRoleDescription='heading' +++AXGroup AXDescription='doc-tip' AXRoleDescription='doc-tip' +++AXGroup AXDescription='doc-toc' AXRoleDescription='doc-toc'
diff --git a/content/test/data/accessibility/aria/graphics-roles-expected-mac.txt b/content/test/data/accessibility/aria/graphics-roles-expected-mac.txt index 4644224..df7d614 100644 --- a/content/test/data/accessibility/aria/graphics-roles-expected-mac.txt +++ b/content/test/data/accessibility/aria/graphics-roles-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' -++AXGroup AXSubrole=AXDocument AXRoleDescription='graphics-document' AXDescription='graphics-document' -++AXGroup AXRoleDescription='graphics-object' AXDescription='graphics-object' -++AXImage AXRoleDescription='image' AXDescription='graphics-symbol' +++AXGroup AXSubrole=AXDocument AXDescription='graphics-document' AXRoleDescription='graphics-document' +++AXGroup AXDescription='graphics-object' AXRoleDescription='graphics-object' +++AXImage AXDescription='graphics-symbol' AXRoleDescription='image'
diff --git a/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-mac.txt b/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-mac.txt index da6d502..8a75fec 100644 --- a/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-mac.txt +++ b/content/test/data/accessibility/aria/input-text-aria-placeholder-expected-mac.txt
@@ -1,9 +1,9 @@ AXWebArea AXRoleDescription='HTML content' -++AXTextField AXRoleDescription='text field' AXDescription='aria-placeholder1' AXPlaceholderValue='aria-placeholder1' -++AXTextField AXRoleDescription='text field' AXDescription='placeholder2' AXPlaceholderValue='placeholder2' -++AXTextField AXRoleDescription='text field' AXDescription='aria-label3' AXPlaceholderValue='placeholder3' -++AXTextField AXRoleDescription='text field' AXDescription='aria-label4' AXPlaceholderValue='aria-placeholder4' -++AXTextField AXRoleDescription='text field' AXDescription='aria-label5' AXHelp='aria-description5' AXPlaceholderValue='placeholder5' +++AXTextField AXDescription='aria-placeholder1' AXPlaceholderValue='aria-placeholder1' AXRoleDescription='text field' +++AXTextField AXDescription='placeholder2' AXPlaceholderValue='placeholder2' AXRoleDescription='text field' +++AXTextField AXDescription='aria-label3' AXPlaceholderValue='placeholder3' AXRoleDescription='text field' +++AXTextField AXDescription='aria-label4' AXPlaceholderValue='aria-placeholder4' AXRoleDescription='text field' +++AXTextField AXDescription='aria-label5' AXHelp='aria-description5' AXPlaceholderValue='placeholder5' AXRoleDescription='text field' ++AXGroup AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='aria-description5' -++AXTextField AXRoleDescription='text field' AXDescription='aria-placeholder6' AXHelp='title6' AXPlaceholderValue='aria-placeholder6' \ No newline at end of file +++AXTextField AXDescription='aria-placeholder6' AXHelp='title6' AXPlaceholderValue='aria-placeholder6' AXRoleDescription='text field'
diff --git a/content/test/data/accessibility/css/language-expected-mac.txt b/content/test/data/accessibility/css/language-expected-mac.txt index cfe4e21..0c3a2f1 100644 --- a/content/test/data/accessibility/css/language-expected-mac.txt +++ b/content/test/data/accessibility/css/language-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='es-ES' -++++AXStaticText AXValue='Espanyol' AXLanguage='es-ES' -++AXStaticText AXValue='Comment allez-vous?' AXLanguage='fr-FR' +++++AXStaticText AXLanguage='es-ES' AXValue='Espanyol' +++AXStaticText AXLanguage='fr-FR' AXValue='Comment allez-vous?'
diff --git a/content/test/data/accessibility/html/a-expected-mac.txt b/content/test/data/accessibility/html/a-expected-mac.txt index 52f5603..a9551d2 100644 --- a/content/test/data/accessibility/html/a-expected-mac.txt +++ b/content/test/data/accessibility/html/a-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea ++AXGroup ++++AXLink AXDescription='normal link' -++++++AXStaticText AXValue='normal link' \ No newline at end of file +++++++AXStaticText AXValue='normal link'
diff --git a/content/test/data/accessibility/html/a-name-expected-mac.txt b/content/test/data/accessibility/html/a-name-expected-mac.txt index 1bd8c46..0d05f4eb 100644 --- a/content/test/data/accessibility/html/a-name-expected-mac.txt +++ b/content/test/data/accessibility/html/a-name-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXGroup AXTitle='named anchor' ++++AXStaticText AXValue='named anchor' ++AXLink AXDescription='both a named anchor and a link' -++++AXStaticText AXValue='both a named anchor and a link' \ No newline at end of file +++++AXStaticText AXValue='both a named anchor and a link'
diff --git a/content/test/data/accessibility/html/a-with-img-expected-mac.txt b/content/test/data/accessibility/html/a-with-img-expected-mac.txt index 64e6d300..9cebe60 100644 --- a/content/test/data/accessibility/html/a-with-img-expected-mac.txt +++ b/content/test/data/accessibility/html/a-with-img-expected-mac.txt
@@ -16,4 +16,4 @@ ++++AXStaticText AXValue=' ' ++++AXLink AXDescription='Link with image at the end' ++++++AXStaticText AXValue='Link with image at the ' -++++++AXImage AXDescription='end' \ No newline at end of file +++++++AXImage AXDescription='end'
diff --git a/content/test/data/accessibility/html/abbr-expected-mac.txt b/content/test/data/accessibility/html/abbr-expected-mac.txt index a9d0506..4831a073 100644 --- a/content/test/data/accessibility/html/abbr-expected-mac.txt +++ b/content/test/data/accessibility/html/abbr-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='The ' -++++AXGroup AXRoleDescription='group' AXDescription='World Health Organization' +++++AXGroup AXDescription='World Health Organization' AXRoleDescription='group' ++++++AXStaticText AXRoleDescription='text' AXValue='WHO' -++++AXStaticText AXRoleDescription='text' AXValue=' was founded in 1948.' \ No newline at end of file +++++AXStaticText AXRoleDescription='text' AXValue=' was founded in 1948.'
diff --git a/content/test/data/accessibility/html/area-expected-mac.txt b/content/test/data/accessibility/html/area-expected-mac.txt index d5c833d..b778f4c 100644 --- a/content/test/data/accessibility/html/area-expected-mac.txt +++ b/content/test/data/accessibility/html/area-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXGroup AXRoleDescription='group' AXDescription='pipe' -++++++AXLink AXRoleDescription='link' AXDescription='pipe1' +++++AXGroup AXDescription='pipe' AXRoleDescription='group' +++++++AXLink AXDescription='pipe1' AXRoleDescription='link' ++++++AXStaticText AXRoleDescription='text' AXValue='pipe2'
diff --git a/content/test/data/accessibility/html/bdo-expected-mac.txt b/content/test/data/accessibility/html/bdo-expected-mac.txt index f5d7441..b9659cd2 100644 --- a/content/test/data/accessibility/html/bdo-expected-mac.txt +++ b/content/test/data/accessibility/html/bdo-expected-mac.txt
@@ -3,4 +3,4 @@ ++++AXStaticText AXValue='Some LTR text' ++++AXStaticText AXValue=' ' ++++AXStaticText AXValue='Some RTL text ' -++++AXStaticText AXValue='with some LTR text embedded' \ No newline at end of file +++++AXStaticText AXValue='with some LTR text embedded'
diff --git a/content/test/data/accessibility/html/blockquote-levels-expected-mac.txt b/content/test/data/accessibility/html/blockquote-levels-expected-mac.txt index e1260af..d9be6b1 100644 --- a/content/test/data/accessibility/html/blockquote-levels-expected-mac.txt +++ b/content/test/data/accessibility/html/blockquote-levels-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea AXBlockQuoteLevel='0' ++AXGroup AXBlockQuoteLevel='1' -++++AXStaticText AXValue='Top level' AXBlockQuoteLevel='1' +++++AXStaticText AXBlockQuoteLevel='1' AXValue='Top level' ++++AXGroup AXBlockQuoteLevel='2' -++++++AXStaticText AXValue='Sub' AXBlockQuoteLevel='2' +++++++AXStaticText AXBlockQuoteLevel='2' AXValue='Sub' ++++++AXGroup AXBlockQuoteLevel='3' -++++++++AXStaticText AXValue='Sub-sub' AXBlockQuoteLevel='3' +++++++++AXStaticText AXBlockQuoteLevel='3' AXValue='Sub-sub'
diff --git a/content/test/data/accessibility/html/button-name-calc-expected-mac.txt b/content/test/data/accessibility/html/button-name-calc-expected-mac.txt index feab8dcb..50726a6 100644 --- a/content/test/data/accessibility/html/button-name-calc-expected-mac.txt +++ b/content/test/data/accessibility/html/button-name-calc-expected-mac.txt
@@ -1,10 +1,10 @@ AXWebArea ++AXButton AXTitle='InnerText0' -++AXButton AXTitle='InnerText1' AXHelp='Title1' +++AXButton AXHelp='Title1' AXTitle='InnerText1' ++AXButton AXDescription='AriaLabel2' AXHelp='Title2' -++AXButton AXTitle='LabelledBy3' AXHelp='Title3' -++AXButton AXTitle='LabelledBy4' AXHelp='DescribedBy4' -++AXButton AXTitle='InnerText5' AXHelp='DescribedBy5' +++AXButton AXHelp='Title3' AXTitle='LabelledBy3' +++AXButton AXHelp='DescribedBy4' AXTitle='LabelledBy4' +++AXButton AXHelp='DescribedBy5' AXTitle='InnerText5' ++AXButton AXTitle='Outer inner' ++++AXStaticText ++++AXGroup
diff --git a/content/test/data/accessibility/html/button-with-listbox-popup-expected-mac.txt b/content/test/data/accessibility/html/button-with-listbox-popup-expected-mac.txt index 08024c0..734aa9b 100644 --- a/content/test/data/accessibility/html/button-with-listbox-popup-expected-mac.txt +++ b/content/test/data/accessibility/html/button-with-listbox-popup-expected-mac.txt
@@ -7,4 +7,4 @@ ++++AXList AXTitle='Choose one:' ++++++AXStaticText AXValue='Baz' ++++++AXStaticText AXValue='Bar' -++++++AXStaticText AXValue='Foo' \ No newline at end of file +++++++AXStaticText AXValue='Foo'
diff --git a/content/test/data/accessibility/html/canvas-expected-mac.txt b/content/test/data/accessibility/html/canvas-expected-mac.txt index 1e44372..831c3bcc 100644 --- a/content/test/data/accessibility/html/canvas-expected-mac.txt +++ b/content/test/data/accessibility/html/canvas-expected-mac.txt
@@ -4,4 +4,4 @@ ++++++AXStaticText AXValue='Static fallback' ++++AXGroup ++++++AXLink AXDescription='Interactive fallback' -++++++++AXStaticText AXValue='Interactive fallback' \ No newline at end of file +++++++++AXStaticText AXValue='Interactive fallback'
diff --git a/content/test/data/accessibility/html/checkbox-name-calc-expected-mac.txt b/content/test/data/accessibility/html/checkbox-name-calc-expected-mac.txt index c826ec1..1d197b2a 100644 --- a/content/test/data/accessibility/html/checkbox-name-calc-expected-mac.txt +++ b/content/test/data/accessibility/html/checkbox-name-calc-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea ++AXCheckBox AXDescription='Title0' -++AXCheckBox AXTitle='Label1' AXHelp='Title1' +++AXCheckBox AXHelp='Title1' AXTitle='Label1' ++AXCheckBox AXDescription='AriaLabel2' AXHelp='Title2' -++AXCheckBox AXTitle='LabelledBy3' AXHelp='Title3' -++AXCheckBox AXTitle='LabelledBy4' AXHelp='DescribedBy4' +++AXCheckBox AXHelp='Title3' AXTitle='LabelledBy3' +++AXCheckBox AXHelp='DescribedBy4' AXTitle='LabelledBy4' ++AXCheckBox AXHelp='DescribedBy5'
diff --git a/content/test/data/accessibility/html/details-expected-mac.txt b/content/test/data/accessibility/html/details-expected-mac.txt index eef1dc3..b8baa0f7 100644 --- a/content/test/data/accessibility/html/details-expected-mac.txt +++ b/content/test/data/accessibility/html/details-expected-mac.txt
@@ -1,9 +1,9 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXButton AXRoleDescription='disclosure triangle' AXTitle='details tag' AXExpanded='0' +++++AXButton AXExpanded='0' AXRoleDescription='disclosure triangle' AXTitle='details tag' ++++++AXStaticText AXRoleDescription='text' AXValue='details tag' ++AXGroup AXRoleDescription='group' -++++AXButton AXRoleDescription='disclosure triangle' AXTitle='details tag open' AXExpanded='1' +++++AXButton AXExpanded='1' AXRoleDescription='disclosure triangle' AXTitle='details tag open' ++++++AXStaticText AXRoleDescription='text' AXValue='details tag open' ++++AXGroup AXRoleDescription='group' ++++++AXStaticText AXRoleDescription='text' AXValue='The details tag with open specifies that the details should be visible (open) to the user.'
diff --git a/content/test/data/accessibility/html/figure-expected-mac.txt b/content/test/data/accessibility/html/figure-expected-mac.txt index b823c51..4dd4283 100644 --- a/content/test/data/accessibility/html/figure-expected-mac.txt +++ b/content/test/data/accessibility/html/figure-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='figure' -++++AXImage AXRoleDescription='image' AXDescription='Sunspots' +++++AXImage AXDescription='Sunspots' AXRoleDescription='image'
diff --git a/content/test/data/accessibility/html/frameset-expected-mac.txt b/content/test/data/accessibility/html/frameset-expected-mac.txt index 0f1d0aa4..4cccb8e 100644 --- a/content/test/data/accessibility/html/frameset-expected-mac.txt +++ b/content/test/data/accessibility/html/frameset-expected-mac.txt
@@ -15,4 +15,4 @@ ++++++++AXStaticText AXValue='This test is to check ' ++++++++AXGroup ++++++++++AXStaticText AXValue='mark tag' -++++++++AXStaticText AXValue='.' \ No newline at end of file +++++++++AXStaticText AXValue='.'
diff --git a/content/test/data/accessibility/html/head-expected-mac.txt b/content/test/data/accessibility/html/head-expected-mac.txt index 84c6683..3a9d66f 100644 --- a/content/test/data/accessibility/html/head-expected-mac.txt +++ b/content/test/data/accessibility/html/head-expected-mac.txt
@@ -1 +1 @@ -AXWebArea \ No newline at end of file +AXWebArea
diff --git a/content/test/data/accessibility/html/hr-expected-mac.txt b/content/test/data/accessibility/html/hr-expected-mac.txt index b5f84672..c0e35a4 100644 --- a/content/test/data/accessibility/html/hr-expected-mac.txt +++ b/content/test/data/accessibility/html/hr-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='Before.' -++AXSplitter AXRoleDescription='splitter' AXDescription='Dividing line' +++AXSplitter AXDescription='Dividing line' AXRoleDescription='splitter' ++AXGroup AXRoleDescription='group' ++++AXStaticText AXRoleDescription='text' AXValue='Middle.' ++AXSplitter AXRoleDescription='splitter'
diff --git a/content/test/data/accessibility/html/iframe-coordinates-expected-mac.txt b/content/test/data/accessibility/html/iframe-coordinates-expected-mac.txt index 5466623..6b37577 100644 --- a/content/test/data/accessibility/html/iframe-coordinates-expected-mac.txt +++ b/content/test/data/accessibility/html/iframe-coordinates-expected-mac.txt
@@ -12,4 +12,4 @@ ++++AXGroup position=(0, 450) size=(150, 50) ++++++AXWebArea position=(0, 450) size=(150, 50) ++++++++AXGroup position=(0, 450) size=(150, 50) -++++++++++AXButton position=(0, 450) size=(125, 25) \ No newline at end of file +++++++++++AXButton position=(0, 450) size=(125, 25)
diff --git a/content/test/data/accessibility/html/iframe-expected-mac.txt b/content/test/data/accessibility/html/iframe-expected-mac.txt index 91101ae..0c26def4 100644 --- a/content/test/data/accessibility/html/iframe-expected-mac.txt +++ b/content/test/data/accessibility/html/iframe-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXGroup AXRoleDescription='group' AXDescription='Empty iframe' +++++AXGroup AXDescription='Empty iframe' AXRoleDescription='group' ++++++AXWebArea AXRoleDescription='HTML content'
diff --git a/content/test/data/accessibility/html/ignored-selection-between-text-expected-mac.txt b/content/test/data/accessibility/html/ignored-selection-between-text-expected-mac.txt index b01f366..f6d376b 100644 --- a/content/test/data/accessibility/html/ignored-selection-between-text-expected-mac.txt +++ b/content/test/data/accessibility/html/ignored-selection-between-text-expected-mac.txt
@@ -5,4 +5,4 @@ ++++AXStaticText AXValue='this text is not ignored' ++AXGroup ++++AXStaticText AXValue='after selection' -++AXStaticText AXValue='Done' \ No newline at end of file +++AXStaticText AXValue='Done'
diff --git a/content/test/data/accessibility/html/ignored-selection-expected-mac.txt b/content/test/data/accessibility/html/ignored-selection-expected-mac.txt index 18b4fcf..13c56f1 100644 --- a/content/test/data/accessibility/html/ignored-selection-expected-mac.txt +++ b/content/test/data/accessibility/html/ignored-selection-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXStaticText AXValue='this text is not ignored' ++AXGroup ++++AXStaticText AXValue='after selection' -++AXStaticText AXValue='Done' \ No newline at end of file +++AXStaticText AXValue='Done'
diff --git a/content/test/data/accessibility/html/img-expected-mac.txt b/content/test/data/accessibility/html/img-expected-mac.txt index 3ba7d011..bb9aa663 100644 --- a/content/test/data/accessibility/html/img-expected-mac.txt +++ b/content/test/data/accessibility/html/img-expected-mac.txt
@@ -1,6 +1,6 @@ AXWebArea ++AXGroup -++++AXImage AXRoleDescription='image' AXDescription='pipe' +++++AXImage AXDescription='pipe' AXRoleDescription='image' ++++AXStaticText AXValue=' ' ++++AXStaticText AXValue=' ' -++++AXImage AXRoleDescription='image' AXDescription=' ' \ No newline at end of file +++++AXImage AXDescription=' ' AXRoleDescription='image'
diff --git a/content/test/data/accessibility/html/img-link-empty-alt-expected-mac.txt b/content/test/data/accessibility/html/img-link-empty-alt-expected-mac.txt index b09a5b8f..82ca4f1 100644 --- a/content/test/data/accessibility/html/img-link-empty-alt-expected-mac.txt +++ b/content/test/data/accessibility/html/img-link-empty-alt-expected-mac.txt
@@ -8,4 +8,4 @@ ++++++AXStaticText AXValue='read ' ++++AXLink AXDescription='read' ++++++AXImage AXDescription='/read.jpg' -++++++AXStaticText AXValue='read' \ No newline at end of file +++++++AXStaticText AXValue='read'
diff --git a/content/test/data/accessibility/html/in-page-links-expected-mac.txt b/content/test/data/accessibility/html/in-page-links-expected-mac.txt index d7b6825..c7ae3ac 100644 --- a/content/test/data/accessibility/html/in-page-links-expected-mac.txt +++ b/content/test/data/accessibility/html/in-page-links-expected-mac.txt
@@ -32,4 +32,4 @@ ++++AXGroup ++++++AXStaticText AXValue='Span with content' ++AXGroup -++++AXStaticText AXValue='Paragraph with content' \ No newline at end of file +++++AXStaticText AXValue='Paragraph with content'
diff --git a/content/test/data/accessibility/html/input-checkbox-in-menu-expected-mac.txt b/content/test/data/accessibility/html/input-checkbox-in-menu-expected-mac.txt index bcf94b4..15b20f5 100644 --- a/content/test/data/accessibility/html/input-checkbox-in-menu-expected-mac.txt +++ b/content/test/data/accessibility/html/input-checkbox-in-menu-expected-mac.txt
@@ -4,4 +4,4 @@ ++++AXCheckBox AXTitle='Checkbox2' AXValue='1' ++AXMenu ++++AXCheckBox AXTitle='Checkbox3' AXValue='1' -++++AXCheckBox AXTitle='Checkbox4' AXValue='2' \ No newline at end of file +++++AXCheckBox AXTitle='Checkbox4' AXValue='2'
diff --git a/content/test/data/accessibility/html/input-color-with-popup-open-expected-mac.txt b/content/test/data/accessibility/html/input-color-with-popup-open-expected-mac.txt index adbe959..9d74fc73 100644 --- a/content/test/data/accessibility/html/input-color-with-popup-open-expected-mac.txt +++ b/content/test/data/accessibility/html/input-color-with-popup-open-expected-mac.txt
@@ -1,17 +1,17 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXColorWell AXRoleDescription='color well' AXValue='rgb 1.00000 0.60000 0.00000 1' AXDescription='color picker' +++++AXColorWell AXDescription='color picker' AXRoleDescription='color well' AXValue='rgb 1.00000 0.60000 0.00000 1' ++++++AXWebArea AXRoleDescription='HTML content' ++++++++AXGroup AXRoleDescription='group' ++++++++++AXGroup AXRoleDescription='group' -++++++++++++AXSlider AXRoleDescription='Color well with two-dimensional slider for selecting saturation and lightness' AXValue='227' AXDescription='Color well' +++++++++++++AXSlider AXDescription='Color well' AXRoleDescription='Color well with two-dimensional slider for selecting saturation and lightness' AXValue='227' ++++++++++AXGroup AXRoleDescription='group' ++++++++++++AXGroup AXRoleDescription='group' -++++++++++++++AXSlider AXRoleDescription='slider' AXValue='116' AXDescription='Hue slider' -++++++++++AXTextField AXRoleDescription='text field' AXValue='255' AXDescription='Red channel' -++++++++++AXTextField AXRoleDescription='text field' AXValue='153' AXDescription='Green channel' -++++++++++AXTextField AXRoleDescription='text field' AXValue='0' AXDescription='Blue channel' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='1' AXDescription='Format toggler' +++++++++++++++AXSlider AXDescription='Hue slider' AXRoleDescription='slider' AXValue='116' +++++++++++AXTextField AXDescription='Red channel' AXRoleDescription='text field' AXValue='255' +++++++++++AXTextField AXDescription='Green channel' AXRoleDescription='text field' AXValue='153' +++++++++++AXTextField AXDescription='Blue channel' AXRoleDescription='text field' AXValue='0' +++++++++++AXIncrementor AXDescription='Format toggler' AXRoleDescription='stepper' AXValue='1' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='R' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='G' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='B'
diff --git a/content/test/data/accessibility/html/input-date-expected-mac.txt b/content/test/data/accessibility/html/input-date-expected-mac.txt index 747554b..2fc6382 100644 --- a/content/test/data/accessibility/html/input-date-expected-mac.txt +++ b/content/test/data/accessibility/html/input-date-expected-mac.txt
@@ -3,24 +3,24 @@ ++++AXDateField AXRoleDescription='date field' AXValue='2008-09-01' ++++++AXGroup AXRoleDescription='group' ++++++++AXGroup AXRoleDescription='group' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='9' AXDescription='Month' +++++++++++AXIncrementor AXDescription='Month' AXRoleDescription='stepper' AXValue='9' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='09' ++++++++++AXStaticText AXRoleDescription='text' AXValue='/' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='1' AXDescription='Day' +++++++++++AXIncrementor AXDescription='Day' AXRoleDescription='stepper' AXValue='1' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++AXStaticText AXRoleDescription='text' AXValue='/' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='2008' AXDescription='Year' +++++++++++AXIncrementor AXDescription='Year' AXRoleDescription='stepper' AXValue='2008' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='2008' -++++++AXPopUpButton AXRoleDescription='pop up button' AXDescription='Show date picker' -++++AXDateField AXRoleDescription='date field' AXValue='2008-09-01' AXDescription='When' +++++++AXPopUpButton AXDescription='Show date picker' AXRoleDescription='pop up button' +++++AXDateField AXDescription='When' AXRoleDescription='date field' AXValue='2008-09-01' ++++++AXGroup AXRoleDescription='group' ++++++++AXGroup AXRoleDescription='group' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='9' AXDescription='Month When' +++++++++++AXIncrementor AXDescription='Month When' AXRoleDescription='stepper' AXValue='9' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='09' ++++++++++AXStaticText AXRoleDescription='text' AXValue='/' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='1' AXDescription='Day When' +++++++++++AXIncrementor AXDescription='Day When' AXRoleDescription='stepper' AXValue='1' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++AXStaticText AXRoleDescription='text' AXValue='/' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='2008' AXDescription='Year When' +++++++++++AXIncrementor AXDescription='Year When' AXRoleDescription='stepper' AXValue='2008' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='2008' -++++++AXPopUpButton AXRoleDescription='pop up button' AXDescription='Show date picker' \ No newline at end of file +++++++AXPopUpButton AXDescription='Show date picker' AXRoleDescription='pop up button'
diff --git a/content/test/data/accessibility/html/input-date-with-popup-open-expected-mac.txt b/content/test/data/accessibility/html/input-date-with-popup-open-expected-mac.txt index dc74501..fa1c0b95 100644 --- a/content/test/data/accessibility/html/input-date-with-popup-open-expected-mac.txt +++ b/content/test/data/accessibility/html/input-date-with-popup-open-expected-mac.txt
@@ -3,28 +3,28 @@ ++++AXDateField AXRoleDescription='date field' AXValue='2008-09-01' ++++++AXGroup AXRoleDescription='group' ++++++++AXGroup AXRoleDescription='group' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='9' AXDescription='Month' +++++++++++AXIncrementor AXDescription='Month' AXRoleDescription='stepper' AXValue='9' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='09' ++++++++++AXStaticText AXRoleDescription='text' AXValue='/' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='1' AXDescription='Day' +++++++++++AXIncrementor AXDescription='Day' AXRoleDescription='stepper' AXValue='1' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++AXStaticText AXRoleDescription='text' AXValue='/' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='2008' AXDescription='Year' +++++++++++AXIncrementor AXDescription='Year' AXRoleDescription='stepper' AXValue='2008' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='2008' -++++++AXPopUpButton AXRoleDescription='pop up button' AXDescription='Show date picker' +++++++AXPopUpButton AXDescription='Show date picker' AXRoleDescription='pop up button' ++++++AXWebArea AXRoleDescription='HTML content' ++++++++AXGroup AXRoleDescription='group' ++++++++++AXGroup AXRoleDescription='group' ++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++AXGroup AXRoleDescription='group' -++++++++++++++++AXButton AXRoleDescription='button' AXDescription='Show month selection panel' +++++++++++++++++AXButton AXDescription='Show month selection panel' AXRoleDescription='button' ++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='September 2008' ++++++++++++++++++AXGroup AXRoleDescription='group' -++++++++++++++AXButton AXRoleDescription='button' AXDescription='Show previous month' +++++++++++++++AXButton AXDescription='Show previous month' AXRoleDescription='button' ++++++++++++++++AXGroup AXRoleDescription='group' -++++++++++++++AXButton AXRoleDescription='button' AXDescription='Show next month' +++++++++++++++AXButton AXDescription='Show next month' AXRoleDescription='button' ++++++++++++++++AXGroup AXRoleDescription='group' -++++++++++++++AXTable AXRoleDescription='table' AXDescription='S M T W T F S Sunday, August 31, 2008 Monday, September 1, 2008 Tuesday, September 2, 2008 Wednesday, September 3, 2008 Thursday, September 4, 2008 Friday, September 5, 2008 Saturday, September 6, 2008 Sunday, September 7, 2008 Monday, September 8, 2008 Tuesday, September 9, 2008 Wednesday, September 10, 2008 Thursday, September 11, 2008 Friday, September 12, 2008 Saturday, September 13, 2008 Sunday, September 14, 2008 Monday, September 15, 2008 Tuesday, September 16, 2008 Wednesday, September 17, 2008 Thursday, September 18, 2008 Friday, September 19, 2008 Saturday, September 20, 2008 Sunday, September 21, 2008 Monday, September 22, 2008 Tuesday, September 23, 2008 Wednesday, September 24, 2008 Thursday, September 25, 2008 Friday, September 26, 2008 Saturday, September 27, 2008 Sunday, September 28, 2008 Monday, September 29, 2008 Tuesday, September 30, 2008 Wednesday, October 1, 2008 Thursday, October 2, 2008 Friday, October 3, 2008 Saturday, October 4, 2008 Sunday, October 5, 2008 Monday, October 6, 2008 Tuesday, October 7, 2008 Wednesday, October 8, 2008 Thursday, October 9, 2008 Friday, October 10, 2008 Saturday, October 11, 2008 Today' +++++++++++++++AXTable AXDescription='S M T W T F S Sunday, August 31, 2008 Monday, September 1, 2008 Tuesday, September 2, 2008 Wednesday, September 3, 2008 Thursday, September 4, 2008 Friday, September 5, 2008 Saturday, September 6, 2008 Sunday, September 7, 2008 Monday, September 8, 2008 Tuesday, September 9, 2008 Wednesday, September 10, 2008 Thursday, September 11, 2008 Friday, September 12, 2008 Saturday, September 13, 2008 Sunday, September 14, 2008 Monday, September 15, 2008 Tuesday, September 16, 2008 Wednesday, September 17, 2008 Thursday, September 18, 2008 Friday, September 19, 2008 Saturday, September 20, 2008 Sunday, September 21, 2008 Monday, September 22, 2008 Tuesday, September 23, 2008 Wednesday, September 24, 2008 Thursday, September 25, 2008 Friday, September 26, 2008 Saturday, September 27, 2008 Sunday, September 28, 2008 Monday, September 29, 2008 Tuesday, September 30, 2008 Wednesday, October 1, 2008 Thursday, October 2, 2008 Friday, October 3, 2008 Saturday, October 4, 2008 Sunday, October 5, 2008 Monday, October 6, 2008 Tuesday, October 7, 2008 Wednesday, October 8, 2008 Thursday, October 9, 2008 Friday, October 10, 2008 Saturday, October 11, 2008 Today' AXRoleDescription='table' ++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='S' @@ -43,185 +43,185 @@ ++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++++AXGroup AXRoleDescription='group' ++++++++++++++++++++AXRow AXRoleDescription='row' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, August 31, 2008' +++++++++++++++++++++++AXCell AXDescription='Sunday, August 31, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='31' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 1, 2008' +++++++++++++++++++++++AXCell AXDescription='Monday, September 1, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='1' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 2, 2008' +++++++++++++++++++++++AXCell AXDescription='Tuesday, September 2, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='2' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 3, 2008' +++++++++++++++++++++++AXCell AXDescription='Wednesday, September 3, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='3' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 4, 2008' +++++++++++++++++++++++AXCell AXDescription='Thursday, September 4, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='4' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 5, 2008' +++++++++++++++++++++++AXCell AXDescription='Friday, September 5, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='5' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 6, 2008' +++++++++++++++++++++++AXCell AXDescription='Saturday, September 6, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='6' ++++++++++++++++++++AXRow AXRoleDescription='row' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 7, 2008' +++++++++++++++++++++++AXCell AXDescription='Sunday, September 7, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='7' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 8, 2008' +++++++++++++++++++++++AXCell AXDescription='Monday, September 8, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='8' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 9, 2008' +++++++++++++++++++++++AXCell AXDescription='Tuesday, September 9, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='9' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 10, 2008' +++++++++++++++++++++++AXCell AXDescription='Wednesday, September 10, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 11, 2008' +++++++++++++++++++++++AXCell AXDescription='Thursday, September 11, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 12, 2008' +++++++++++++++++++++++AXCell AXDescription='Friday, September 12, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='12' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 13, 2008' +++++++++++++++++++++++AXCell AXDescription='Saturday, September 13, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='13' ++++++++++++++++++++AXRow AXRoleDescription='row' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 14, 2008' +++++++++++++++++++++++AXCell AXDescription='Sunday, September 14, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='14' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 15, 2008' +++++++++++++++++++++++AXCell AXDescription='Monday, September 15, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='15' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 16, 2008' +++++++++++++++++++++++AXCell AXDescription='Tuesday, September 16, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='16' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 17, 2008' +++++++++++++++++++++++AXCell AXDescription='Wednesday, September 17, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='17' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 18, 2008' +++++++++++++++++++++++AXCell AXDescription='Thursday, September 18, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='18' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 19, 2008' +++++++++++++++++++++++AXCell AXDescription='Friday, September 19, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='19' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 20, 2008' +++++++++++++++++++++++AXCell AXDescription='Saturday, September 20, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='20' ++++++++++++++++++++AXRow AXRoleDescription='row' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 21, 2008' +++++++++++++++++++++++AXCell AXDescription='Sunday, September 21, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='21' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 22, 2008' +++++++++++++++++++++++AXCell AXDescription='Monday, September 22, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='22' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 23, 2008' +++++++++++++++++++++++AXCell AXDescription='Tuesday, September 23, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='23' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 24, 2008' +++++++++++++++++++++++AXCell AXDescription='Wednesday, September 24, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='24' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 25, 2008' +++++++++++++++++++++++AXCell AXDescription='Thursday, September 25, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='25' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 26, 2008' +++++++++++++++++++++++AXCell AXDescription='Friday, September 26, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='26' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 27, 2008' +++++++++++++++++++++++AXCell AXDescription='Saturday, September 27, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='27' ++++++++++++++++++++AXRow AXRoleDescription='row' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 28, 2008' +++++++++++++++++++++++AXCell AXDescription='Sunday, September 28, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='28' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 29, 2008' +++++++++++++++++++++++AXCell AXDescription='Monday, September 29, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='29' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 30, 2008' +++++++++++++++++++++++AXCell AXDescription='Tuesday, September 30, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='30' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, October 1, 2008' +++++++++++++++++++++++AXCell AXDescription='Wednesday, October 1, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='1' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, October 2, 2008' +++++++++++++++++++++++AXCell AXDescription='Thursday, October 2, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='2' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, October 3, 2008' +++++++++++++++++++++++AXCell AXDescription='Friday, October 3, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='3' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, October 4, 2008' +++++++++++++++++++++++AXCell AXDescription='Saturday, October 4, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='4' ++++++++++++++++++++AXRow AXRoleDescription='row' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, October 5, 2008' +++++++++++++++++++++++AXCell AXDescription='Sunday, October 5, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='5' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, October 6, 2008' +++++++++++++++++++++++AXCell AXDescription='Monday, October 6, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='6' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, October 7, 2008' +++++++++++++++++++++++AXCell AXDescription='Tuesday, October 7, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='7' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, October 8, 2008' +++++++++++++++++++++++AXCell AXDescription='Wednesday, October 8, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='8' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, October 9, 2008' +++++++++++++++++++++++AXCell AXDescription='Thursday, October 9, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='9' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, October 10, 2008' +++++++++++++++++++++++AXCell AXDescription='Friday, October 10, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10' -++++++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, October 11, 2008' +++++++++++++++++++++++AXCell AXDescription='Saturday, October 11, 2008' AXRoleDescription='cell' ++++++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11' -++++++++++++++++AXButton AXRoleDescription='button' AXDescription='Today' +++++++++++++++++AXButton AXDescription='Today' AXRoleDescription='button' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, August 31, 2008' +++++++++++++++++++AXCell AXDescription='Sunday, August 31, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='31' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 7, 2008' +++++++++++++++++++AXCell AXDescription='Sunday, September 7, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='7' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 14, 2008' +++++++++++++++++++AXCell AXDescription='Sunday, September 14, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='14' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 21, 2008' +++++++++++++++++++AXCell AXDescription='Sunday, September 21, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='21' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, September 28, 2008' +++++++++++++++++++AXCell AXDescription='Sunday, September 28, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='28' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Sunday, October 5, 2008' +++++++++++++++++++AXCell AXDescription='Sunday, October 5, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='5' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 1, 2008' +++++++++++++++++++AXCell AXDescription='Monday, September 1, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='1' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 8, 2008' +++++++++++++++++++AXCell AXDescription='Monday, September 8, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='8' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 15, 2008' +++++++++++++++++++AXCell AXDescription='Monday, September 15, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='15' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 22, 2008' +++++++++++++++++++AXCell AXDescription='Monday, September 22, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='22' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, September 29, 2008' +++++++++++++++++++AXCell AXDescription='Monday, September 29, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='29' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Monday, October 6, 2008' +++++++++++++++++++AXCell AXDescription='Monday, October 6, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='6' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 2, 2008' +++++++++++++++++++AXCell AXDescription='Tuesday, September 2, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='2' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 9, 2008' +++++++++++++++++++AXCell AXDescription='Tuesday, September 9, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='9' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 16, 2008' +++++++++++++++++++AXCell AXDescription='Tuesday, September 16, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='16' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 23, 2008' +++++++++++++++++++AXCell AXDescription='Tuesday, September 23, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='23' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, September 30, 2008' +++++++++++++++++++AXCell AXDescription='Tuesday, September 30, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='30' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Tuesday, October 7, 2008' +++++++++++++++++++AXCell AXDescription='Tuesday, October 7, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='7' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 3, 2008' +++++++++++++++++++AXCell AXDescription='Wednesday, September 3, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='3' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 10, 2008' +++++++++++++++++++AXCell AXDescription='Wednesday, September 10, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 17, 2008' +++++++++++++++++++AXCell AXDescription='Wednesday, September 17, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='17' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, September 24, 2008' +++++++++++++++++++AXCell AXDescription='Wednesday, September 24, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='24' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, October 1, 2008' +++++++++++++++++++AXCell AXDescription='Wednesday, October 1, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='1' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Wednesday, October 8, 2008' +++++++++++++++++++AXCell AXDescription='Wednesday, October 8, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='8' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 4, 2008' +++++++++++++++++++AXCell AXDescription='Thursday, September 4, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='4' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 11, 2008' +++++++++++++++++++AXCell AXDescription='Thursday, September 11, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 18, 2008' +++++++++++++++++++AXCell AXDescription='Thursday, September 18, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='18' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, September 25, 2008' +++++++++++++++++++AXCell AXDescription='Thursday, September 25, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='25' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, October 2, 2008' +++++++++++++++++++AXCell AXDescription='Thursday, October 2, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='2' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Thursday, October 9, 2008' +++++++++++++++++++AXCell AXDescription='Thursday, October 9, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='9' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 5, 2008' +++++++++++++++++++AXCell AXDescription='Friday, September 5, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='5' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 12, 2008' +++++++++++++++++++AXCell AXDescription='Friday, September 12, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='12' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 19, 2008' +++++++++++++++++++AXCell AXDescription='Friday, September 19, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='19' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, September 26, 2008' +++++++++++++++++++AXCell AXDescription='Friday, September 26, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='26' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, October 3, 2008' +++++++++++++++++++AXCell AXDescription='Friday, October 3, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='3' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Friday, October 10, 2008' +++++++++++++++++++AXCell AXDescription='Friday, October 10, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10' ++++++++++++++++AXColumn AXRoleDescription='column' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 6, 2008' +++++++++++++++++++AXCell AXDescription='Saturday, September 6, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='6' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 13, 2008' +++++++++++++++++++AXCell AXDescription='Saturday, September 13, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='13' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 20, 2008' +++++++++++++++++++AXCell AXDescription='Saturday, September 20, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='20' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, September 27, 2008' +++++++++++++++++++AXCell AXDescription='Saturday, September 27, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='27' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, October 4, 2008' +++++++++++++++++++AXCell AXDescription='Saturday, October 4, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='4' -++++++++++++++++++AXCell AXRoleDescription='cell' AXDescription='Saturday, October 11, 2008' +++++++++++++++++++AXCell AXDescription='Saturday, October 11, 2008' AXRoleDescription='cell' ++++++++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11' ++++++++++++++++AXGroup AXRoleDescription='group'
diff --git a/content/test/data/accessibility/html/input-datetime-expected-mac.txt b/content/test/data/accessibility/html/input-datetime-expected-mac.txt index 88f64f4b..f3aa910 100644 --- a/content/test/data/accessibility/html/input-datetime-expected-mac.txt +++ b/content/test/data/accessibility/html/input-datetime-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' ++++AXTextField AXRoleDescription='text field' AXValue='1/1/2015 1:00AM' -++++AXTextField AXRoleDescription='text field' AXValue='1/1/2015 1:00AM' AXDescription='Launch' \ No newline at end of file +++++AXTextField AXDescription='Launch' AXRoleDescription='text field' AXValue='1/1/2015 1:00AM'
diff --git a/content/test/data/accessibility/html/input-image-expected-mac.txt b/content/test/data/accessibility/html/input-image-expected-mac.txt index c438ea6..2b450075 100644 --- a/content/test/data/accessibility/html/input-image-expected-mac.txt +++ b/content/test/data/accessibility/html/input-image-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXButton AXRoleDescription='button' AXDescription='Submit' +++++AXButton AXDescription='Submit' AXRoleDescription='button'
diff --git a/content/test/data/accessibility/html/input-list-expected-mac.txt b/content/test/data/accessibility/html/input-list-expected-mac.txt index 4c02e92..fecd4f7 100644 --- a/content/test/data/accessibility/html/input-list-expected-mac.txt +++ b/content/test/data/accessibility/html/input-list-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXGroup ++++AXGroup ++++++AXStaticText AXValue='Choose a pokemon ' -++++++AXComboBox AXTitle='Choose a pokemon' AXAutocompleteValue='list' +++++++AXComboBox AXAutocompleteValue='list' AXTitle='Choose a pokemon'
diff --git a/content/test/data/accessibility/html/input-month-expected-mac.txt b/content/test/data/accessibility/html/input-month-expected-mac.txt index 0a35afbe..2fc13bc 100644 --- a/content/test/data/accessibility/html/input-month-expected-mac.txt +++ b/content/test/data/accessibility/html/input-month-expected-mac.txt
@@ -3,9 +3,9 @@ ++++AXDateField AXRoleDescription='date field' ++++++AXGroup AXRoleDescription='group' ++++++++AXGroup AXRoleDescription='group' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='0' AXDescription='Month' +++++++++++AXIncrementor AXDescription='Month' AXRoleDescription='stepper' AXValue='0' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='---------' ++++++++++AXStaticText AXRoleDescription='text' AXValue=' ' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='0' AXDescription='Year' +++++++++++AXIncrementor AXDescription='Year' AXRoleDescription='stepper' AXValue='0' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='----' -++++++AXPopUpButton AXRoleDescription='pop up button' AXDescription='Show month picker' \ No newline at end of file +++++++AXPopUpButton AXDescription='Show month picker' AXRoleDescription='pop up button'
diff --git a/content/test/data/accessibility/html/input-radio-checkbox-label-expected-mac.txt b/content/test/data/accessibility/html/input-radio-checkbox-label-expected-mac.txt index 29a34f8..18bfcee 100644 --- a/content/test/data/accessibility/html/input-radio-checkbox-label-expected-mac.txt +++ b/content/test/data/accessibility/html/input-radio-checkbox-label-expected-mac.txt
@@ -4,9 +4,9 @@ ++++AXCheckBox AXTitle='label ignored for checkbox' AXValue='0' ++++AXGroup AXTitle='label exposed for radio button ' ++++++AXStaticText AXValue='label exposed for radio button ' -++++++AXRadioButton AXValue='0' AXTitleUIElement='AXGroup label exposed for radio button ' +++++++AXRadioButton AXTitleUIElement='AXGroup label exposed for radio button ' AXValue='0' ++++++AXStaticText AXValue=' ' ++++AXGroup AXTitle='label exposed for checkbox ' ++++++AXStaticText AXValue='label exposed for checkbox ' -++++++AXCheckBox AXValue='0' AXTitleUIElement='AXGroup label exposed for checkbox ' +++++++AXCheckBox AXTitleUIElement='AXGroup label exposed for checkbox ' AXValue='0' ++++++AXStaticText AXValue=' '
diff --git a/content/test/data/accessibility/html/input-radio-expected-mac.txt b/content/test/data/accessibility/html/input-radio-expected-mac.txt index b23653f..1bbfb4c1 100644 --- a/content/test/data/accessibility/html/input-radio-expected-mac.txt +++ b/content/test/data/accessibility/html/input-radio-expected-mac.txt
@@ -1,13 +1,13 @@ AXWebArea ++AXGroup -++++AXRadioButton AXValue='0' AXLinkedUIElements=["AXRadioButton 0"] +++++AXRadioButton AXLinkedUIElements=["AXRadioButton 0"] AXValue='0' ++++AXStaticText AXValue='Radio1' ++++AXGroup AXTitle='<newline>' -++++AXRadioButton AXValue='0' AXLinkedUIElements=["AXRadioButton 0"] +++++AXRadioButton AXLinkedUIElements=["AXRadioButton 0"] AXValue='0' ++++AXStaticText AXValue='Radio2' ++AXGroup -++++AXRadioButton AXTitle='Radio3' AXValue='0' AXLinkedUIElements=["AXRadioButton Radio3","AXRadioButton Radio4"] -++++AXRadioButton AXTitle='Radio4' AXValue='1' AXLinkedUIElements=["AXRadioButton Radio3","AXRadioButton Radio4"] +++++AXRadioButton AXLinkedUIElements=["AXRadioButton Radio3","AXRadioButton Radio4"] AXTitle='Radio3' AXValue='0' +++++AXRadioButton AXLinkedUIElements=["AXRadioButton Radio3","AXRadioButton Radio4"] AXTitle='Radio4' AXValue='1' ++AXGroup -++++AXRadioButton AXTitle='Radio5' AXValue='0' AXLinkedUIElements=["AXRadioButton Radio5"] -++++AXRadioButton AXTitle='Radio6' AXValue='1' AXLinkedUIElements=["AXRadioButton Radio6"] +++++AXRadioButton AXLinkedUIElements=["AXRadioButton Radio5"] AXTitle='Radio5' AXValue='0' +++++AXRadioButton AXLinkedUIElements=["AXRadioButton Radio6"] AXTitle='Radio6' AXValue='1'
diff --git a/content/test/data/accessibility/html/input-submit-expected-mac.txt b/content/test/data/accessibility/html/input-submit-expected-mac.txt index c9429081..2486c5c 100644 --- a/content/test/data/accessibility/html/input-submit-expected-mac.txt +++ b/content/test/data/accessibility/html/input-submit-expected-mac.txt
@@ -5,10 +5,10 @@ ++++AXButton AXRoleDescription='button' AXTitle='Second submit in a form not a valid default button' ++AXGroup AXRoleDescription='form' ++++AXTextField AXRoleDescription='text field' -++++AXButton AXRoleDescription='button' AXDescription='First image button in a form is a valid default button' +++++AXButton AXDescription='First image button in a form is a valid default button' AXRoleDescription='button' ++++++AXImage AXRoleDescription='image' ++++++AXStaticText AXRoleDescription='text' AXValue='First image button in a form is a valid default button' -++++AXButton AXRoleDescription='button' AXDescription='Second image button in a form not a valid default button' +++++AXButton AXDescription='Second image button in a form not a valid default button' AXRoleDescription='button' ++++++AXImage AXRoleDescription='image' ++++++AXStaticText AXRoleDescription='text' AXValue='Second image button in a form not a valid default button' ++AXButton AXRoleDescription='button' AXTitle='Submit outside of form not a valid default button'
diff --git a/content/test/data/accessibility/html/input-suggestions-source-element-expected-mac.txt b/content/test/data/accessibility/html/input-suggestions-source-element-expected-mac.txt index 17aa8ab..350fc2c 100644 --- a/content/test/data/accessibility/html/input-suggestions-source-element-expected-mac.txt +++ b/content/test/data/accessibility/html/input-suggestions-source-element-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXComboBox AXRoleDescription='combo box' AXAutocompleteValue='list' AXHasPopup='1' AXHasPopupValue='listbox' +++++AXComboBox AXAutocompleteValue='list' AXHasPopup='1' AXHasPopupValue='listbox' AXRoleDescription='combo box'
diff --git a/content/test/data/accessibility/html/input-text-expected-mac.txt b/content/test/data/accessibility/html/input-text-expected-mac.txt index 38202e53..c1c39348 100644 --- a/content/test/data/accessibility/html/input-text-expected-mac.txt +++ b/content/test/data/accessibility/html/input-text-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXTextField AXRoleDescription='text field' AXDescription='Name' AXEditableAncestor='AXTextField Name' AXHighestEditableAncestor='AXTextField Name' AXPlaceholderValue='Name' \ No newline at end of file +++++AXTextField AXDescription='Name' AXEditableAncestor='AXTextField Name' AXHighestEditableAncestor='AXTextField Name' AXPlaceholderValue='Name' AXRoleDescription='text field'
diff --git a/content/test/data/accessibility/html/input-text-read-only-expected-mac.txt b/content/test/data/accessibility/html/input-text-read-only-expected-mac.txt index ceaf746f..31bf17d0 100644 --- a/content/test/data/accessibility/html/input-text-read-only-expected-mac.txt +++ b/content/test/data/accessibility/html/input-text-read-only-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXTextField AXRoleDescription='text field' AXDescription='Name' AXPlaceholderValue='Name' \ No newline at end of file +++++AXTextField AXDescription='Name' AXPlaceholderValue='Name' AXRoleDescription='text field'
diff --git a/content/test/data/accessibility/html/input-time-with-popup-open-expected-mac.txt b/content/test/data/accessibility/html/input-time-with-popup-open-expected-mac.txt index 625f0a5..ce84006 100644 --- a/content/test/data/accessibility/html/input-time-with-popup-open-expected-mac.txt +++ b/content/test/data/accessibility/html/input-time-with-popup-open-expected-mac.txt
@@ -3,25 +3,25 @@ ++++AXTimeField AXRoleDescription='time field' AXValue='13:50:02.922' ++++++AXGroup AXRoleDescription='group' ++++++++AXGroup AXRoleDescription='group' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='1' AXDescription='Hours' +++++++++++AXIncrementor AXDescription='Hours' AXRoleDescription='stepper' AXValue='1' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++AXStaticText AXRoleDescription='text' AXValue=':' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='50' AXDescription='Minutes' +++++++++++AXIncrementor AXDescription='Minutes' AXRoleDescription='stepper' AXValue='50' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='50' ++++++++++AXStaticText AXRoleDescription='text' AXValue=':' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='2' AXDescription='Seconds' +++++++++++AXIncrementor AXDescription='Seconds' AXRoleDescription='stepper' AXValue='2' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='02' ++++++++++AXStaticText AXRoleDescription='text' AXValue='.' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='922' AXDescription='Milliseconds' +++++++++++AXIncrementor AXDescription='Milliseconds' AXRoleDescription='stepper' AXValue='922' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='922' ++++++++++AXStaticText AXRoleDescription='text' AXValue=' ' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='2' AXDescription='AM/PM' +++++++++++AXIncrementor AXDescription='AM/PM' AXRoleDescription='stepper' AXValue='2' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='PM' -++++++AXPopUpButton AXRoleDescription='pop up button' AXDescription='Show time picker' +++++++AXPopUpButton AXDescription='Show time picker' AXRoleDescription='pop up button' ++++++AXWebArea AXRoleDescription='HTML content' ++++++++AXGroup AXRoleDescription='group' ++++++++++AXGroup AXRoleDescription='group' -++++++++++++AXList AXRoleDescription='list' AXDescription='Hours' +++++++++++++AXList AXDescription='Hours' AXRoleDescription='list' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='02' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='03' @@ -34,7 +34,7 @@ ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='10' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='11' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='12' -++++++++++++AXList AXRoleDescription='list' AXDescription='Minutes' +++++++++++++AXList AXDescription='Minutes' AXRoleDescription='list' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='02' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='03' @@ -95,7 +95,7 @@ ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='58' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='59' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='00' -++++++++++++AXList AXRoleDescription='list' AXDescription='Seconds' +++++++++++++AXList AXDescription='Seconds' AXRoleDescription='list' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='01' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='02' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='03' @@ -156,7 +156,7 @@ ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='58' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='59' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='00' -++++++++++++AXList AXRoleDescription='list' AXDescription='Milliseconds' +++++++++++++AXList AXDescription='Milliseconds' AXRoleDescription='list' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='100' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='200' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='300' @@ -167,6 +167,6 @@ ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='800' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='922' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='000' -++++++++++++AXList AXRoleDescription='list' AXDescription='AM/PM' +++++++++++++AXList AXDescription='AM/PM' AXRoleDescription='list' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='PM' ++++++++++++++AXStaticText AXRoleDescription='text' AXValue='AM'
diff --git a/content/test/data/accessibility/html/input-week-expected-mac.txt b/content/test/data/accessibility/html/input-week-expected-mac.txt index 95c99b1..b96ca83 100644 --- a/content/test/data/accessibility/html/input-week-expected-mac.txt +++ b/content/test/data/accessibility/html/input-week-expected-mac.txt
@@ -4,9 +4,9 @@ ++++++AXGroup AXRoleDescription='group' ++++++++AXGroup AXRoleDescription='group' ++++++++++AXStaticText AXRoleDescription='text' AXValue='Week ' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='0' AXDescription='Week' +++++++++++AXIncrementor AXDescription='Week' AXRoleDescription='stepper' AXValue='0' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='--' ++++++++++AXStaticText AXRoleDescription='text' AXValue=', ' -++++++++++AXIncrementor AXRoleDescription='stepper' AXValue='0' AXDescription='Year' +++++++++++AXIncrementor AXDescription='Year' AXRoleDescription='stepper' AXValue='0' ++++++++++++AXStaticText AXRoleDescription='text' AXValue='----' -++++++AXPopUpButton AXRoleDescription='pop up button' AXDescription='Show week picker' \ No newline at end of file +++++++AXPopUpButton AXDescription='Show week picker' AXRoleDescription='pop up button'
diff --git a/content/test/data/accessibility/html/landmark-expected-mac.txt b/content/test/data/accessibility/html/landmark-expected-mac.txt index b73d84d..947f021a 100644 --- a/content/test/data/accessibility/html/landmark-expected-mac.txt +++ b/content/test/data/accessibility/html/landmark-expected-mac.txt
@@ -146,4 +146,4 @@ ++++++AXStaticText AXRoleDescription='text' AXValue='This should NOT have footer role.' ++AXGroup AXSubrole=AXLandmarkMain AXRoleDescription='main' ++++AXGroup AXRoleDescription='group' -++++++AXStaticText AXRoleDescription='text' AXValue='This should NOT have footer role.' \ No newline at end of file +++++++AXStaticText AXRoleDescription='text' AXValue='This should NOT have footer role.'
diff --git a/content/test/data/accessibility/html/link-inside-heading-expected-mac.txt b/content/test/data/accessibility/html/link-inside-heading-expected-mac.txt index b34479c..1bb4aff 100644 --- a/content/test/data/accessibility/html/link-inside-heading-expected-mac.txt +++ b/content/test/data/accessibility/html/link-inside-heading-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea ++AXHeading AXTitle='Link In Heading' AXValue='1' ++++AXLink AXDescription='Link In Heading' -++++++AXStaticText AXValue='Link In Heading' \ No newline at end of file +++++++AXStaticText AXValue='Link In Heading'
diff --git a/content/test/data/accessibility/html/meter-expected-mac.txt b/content/test/data/accessibility/html/meter-expected-mac.txt index 388c0393..6b2dcc7 100644 --- a/content/test/data/accessibility/html/meter-expected-mac.txt +++ b/content/test/data/accessibility/html/meter-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXLevelIndicator AXRoleDescription='level indicator' AXValue='2' AXMinValue='1' AXMaxValue='10' +++++AXLevelIndicator AXMaxValue='10' AXMinValue='1' AXRoleDescription='level indicator' AXValue='2'
diff --git a/content/test/data/accessibility/html/modal-dialog-opened-expected-mac.txt b/content/test/data/accessibility/html/modal-dialog-opened-expected-mac.txt index 2d43fa2..e1f99da 100644 --- a/content/test/data/accessibility/html/modal-dialog-opened-expected-mac.txt +++ b/content/test/data/accessibility/html/modal-dialog-opened-expected-mac.txt
@@ -2,4 +2,4 @@ ++AXGroup AXSubrole=AXApplicationDialog ++++AXStaticText AXValue='The dialog subtree should be the only text content in the accessibility tree. ' ++++AXLink AXDescription='Link inside the dialog.' -++++++AXStaticText AXValue='Link inside the dialog.' \ No newline at end of file +++++++AXStaticText AXValue='Link inside the dialog.'
diff --git a/content/test/data/accessibility/html/modal-dialog-stack-expected-mac.txt b/content/test/data/accessibility/html/modal-dialog-stack-expected-mac.txt index 6a56857..8ce8fe3 100644 --- a/content/test/data/accessibility/html/modal-dialog-stack-expected-mac.txt +++ b/content/test/data/accessibility/html/modal-dialog-stack-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea ++AXGroup AXSubrole=AXApplicationDialog ++++AXStaticText AXValue='This is the now active dialog. Of course it should be in the tree. ' -++++AXButton AXTitle='This is in the active dialog and should be in the tree.' \ No newline at end of file +++++AXButton AXTitle='This is in the active dialog and should be in the tree.'
diff --git a/content/test/data/accessibility/html/navigation-expected-mac.txt b/content/test/data/accessibility/html/navigation-expected-mac.txt index 607a9f3..4d2f840 100644 --- a/content/test/data/accessibility/html/navigation-expected-mac.txt +++ b/content/test/data/accessibility/html/navigation-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXSubrole=AXLandmarkNavigation AXRoleDescription='navigation' -++++AXLink AXRoleDescription='link' AXDescription='Don't click on me' -++++++AXStaticText AXRoleDescription='text' AXValue='Don't click on me' \ No newline at end of file +++++AXLink AXDescription='Don't click on me' AXRoleDescription='link' +++++++AXStaticText AXRoleDescription='text' AXValue='Don't click on me'
diff --git a/content/test/data/accessibility/html/node-changed-crash-in-editable-text-expected-mac.txt b/content/test/data/accessibility/html/node-changed-crash-in-editable-text-expected-mac.txt index 1ad6552..dadf6f64 100644 --- a/content/test/data/accessibility/html/node-changed-crash-in-editable-text-expected-mac.txt +++ b/content/test/data/accessibility/html/node-changed-crash-in-editable-text-expected-mac.txt
@@ -1,4 +1,4 @@ AXWebArea ++AXTextArea AXDescription='Done' ++++AXGroup -++++AXGroup \ No newline at end of file +++++AXGroup
diff --git a/content/test/data/accessibility/html/optgroup-expected-mac.txt b/content/test/data/accessibility/html/optgroup-expected-mac.txt index 36b29ee..f3c420a 100644 --- a/content/test/data/accessibility/html/optgroup-expected-mac.txt +++ b/content/test/data/accessibility/html/optgroup-expected-mac.txt
@@ -1,15 +1,15 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' ++++AXList AXRoleDescription='list' -++++++AXGroup AXRoleDescription='group' AXDescription='Enabled' +++++++AXGroup AXDescription='Enabled' AXRoleDescription='group' ++++++++AXStaticText AXRoleDescription='text' AXValue='Enabled' ++++++AXStaticText AXRoleDescription='text' AXValue='One' ++++++AXStaticText AXRoleDescription='text' AXValue='Two' ++++++AXStaticText AXRoleDescription='text' AXValue='Three' ++++++AXStaticText AXRoleDescription='text' AXValue='Four' -++++++AXGroup AXRoleDescription='group' AXDescription='Disabled' +++++++AXGroup AXDescription='Disabled' AXRoleDescription='group' ++++++++AXStaticText AXRoleDescription='text' AXValue='Disabled' ++++++AXStaticText AXRoleDescription='text' AXValue='One' ++++++AXStaticText AXRoleDescription='text' AXValue='Two' ++++++AXStaticText AXRoleDescription='text' AXValue='Three' -++++++AXStaticText AXRoleDescription='text' AXValue='Four' \ No newline at end of file +++++++AXStaticText AXRoleDescription='text' AXValue='Four'
diff --git a/content/test/data/accessibility/html/output-expected-mac.txt b/content/test/data/accessibility/html/output-expected-mac.txt index 2df1066..a0c35404 100644 --- a/content/test/data/accessibility/html/output-expected-mac.txt +++ b/content/test/data/accessibility/html/output-expected-mac.txt
@@ -4,4 +4,4 @@ ++++AXStaticText AXValue=' + ' ++++AXIncrementor ++++AXStaticText AXValue=' =' -++++AXGroup \ No newline at end of file +++++AXGroup
diff --git a/content/test/data/accessibility/html/pre-expected-mac.txt b/content/test/data/accessibility/html/pre-expected-mac.txt index a41af8f3..a586fc20e 100644 --- a/content/test/data/accessibility/html/pre-expected-mac.txt +++ b/content/test/data/accessibility/html/pre-expected-mac.txt
@@ -6,4 +6,4 @@ ++AXGroup ++++AXStaticText AXValue='This test is to check pre<newline>formatting.' ++AXGroup -++++AXStaticText AXValue='This test is to check pre formatting.' \ No newline at end of file +++++AXStaticText AXValue='This test is to check pre formatting.'
diff --git a/content/test/data/accessibility/html/section-expected-mac.txt b/content/test/data/accessibility/html/section-expected-mac.txt index 73a18ba..6f4a175 100644 --- a/content/test/data/accessibility/html/section-expected-mac.txt +++ b/content/test/data/accessibility/html/section-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXSubrole=AXLandmarkRegion AXRoleDescription='region' ++++AXStaticText AXRoleDescription='text' AXValue='This is a section element.' -++AXGroup AXSubrole=AXLandmarkRegion AXRoleDescription='region' AXDescription='section' +++AXGroup AXSubrole=AXLandmarkRegion AXDescription='section' AXRoleDescription='region' ++++AXStaticText AXRoleDescription='text' AXValue='This is a named section element.'
diff --git a/content/test/data/accessibility/html/span-expected-mac.txt b/content/test/data/accessibility/html/span-expected-mac.txt index 9c67be56..791bd0f11 100644 --- a/content/test/data/accessibility/html/span-expected-mac.txt +++ b/content/test/data/accessibility/html/span-expected-mac.txt
@@ -67,4 +67,4 @@ ++AXGroup ++++AXStaticText AXValue='K8. Keep' ++++AXStaticText AXValue=' ' -++++AXStaticText AXValue='space' \ No newline at end of file +++++AXStaticText AXValue='space'
diff --git a/content/test/data/accessibility/html/textarea-expected-mac.txt b/content/test/data/accessibility/html/textarea-expected-mac.txt index a6d1876..c9a83b79 100644 --- a/content/test/data/accessibility/html/textarea-expected-mac.txt +++ b/content/test/data/accessibility/html/textarea-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXRoleDescription='HTML content' ++AXGroup AXRoleDescription='group' -++++AXTextArea AXRoleDescription='text entry area' AXValue='The <newline>textarea tag defines a multi-line text input control.<newline>' AXEditableAncestor='AXTextArea The <newline>textarea tag defines a multi-line text input control.<newline>' AXHighestEditableAncestor='AXTextArea The <newline>textarea tag defines a multi-line text input control.<newline>' \ No newline at end of file +++++AXTextArea AXEditableAncestor='AXTextArea The <newline>textarea tag defines a multi-line text input control.<newline>' AXHighestEditableAncestor='AXTextArea The <newline>textarea tag defines a multi-line text input control.<newline>' AXRoleDescription='text entry area' AXValue='The <newline>textarea tag defines a multi-line text input control.<newline>'
diff --git a/content/test/data/accessibility/html/time-expected-mac.txt b/content/test/data/accessibility/html/time-expected-mac.txt index f0e0e3d7..e3c32874 100644 --- a/content/test/data/accessibility/html/time-expected-mac.txt +++ b/content/test/data/accessibility/html/time-expected-mac.txt
@@ -4,4 +4,4 @@ ++++++AXStaticText AXRoleDescription='text' AXValue='10:00' ++++AXStaticText AXRoleDescription='text' AXValue=' ' ++++AXGroup AXRoleDescription='group' -++++++AXStaticText AXRoleDescription='text' AXValue='Valentines day' \ No newline at end of file +++++++AXStaticText AXRoleDescription='text' AXValue='Valentines day'
diff --git a/content/test/data/accessibility/html/title-expected-mac.txt b/content/test/data/accessibility/html/title-expected-mac.txt index c09466d..2ce9492 100644 --- a/content/test/data/accessibility/html/title-expected-mac.txt +++ b/content/test/data/accessibility/html/title-expected-mac.txt
@@ -1 +1 @@ -AXWebArea AXTitle='Title of the document' \ No newline at end of file +AXWebArea AXTitle='Title of the document'
diff --git a/content/test/data/accessibility/language-detection/dynamic-basic-expected-mac.txt b/content/test/data/accessibility/language-detection/dynamic-basic-expected-mac.txt index 4cf6052..37c0a420 100644 --- a/content/test/data/accessibility/language-detection/dynamic-basic-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/dynamic-basic-expected-mac.txt
@@ -1,3 +1,3 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='fr-FR' -++++AXStaticText AXValue='Ein Bild ist nicht zu verwechseln mit einer Sache, die man berühren kann. Können Sie meine Pfeife stopfen? Natürlich nicht! Sie ist nur eine Darstellung. Hätte ich auf mein Bild geschrieben, dies ist eine Pfeife, so hätte ich gelogen. Das Abbild einer Marmeladenschnitte ist ganz gewiss nichts Essbares.' AXLanguage='de' +++++AXStaticText AXLanguage='de' AXValue='Ein Bild ist nicht zu verwechseln mit einer Sache, die man berühren kann. Können Sie meine Pfeife stopfen? Natürlich nicht! Sie ist nur eine Darstellung. Hätte ich auf mein Bild geschrieben, dies ist eine Pfeife, so hätte ich gelogen. Das Abbild einer Marmeladenschnitte ist ganz gewiss nichts Essbares.'
diff --git a/content/test/data/accessibility/language-detection/dynamic-multiple-inserts-expected-mac.txt b/content/test/data/accessibility/language-detection/dynamic-multiple-inserts-expected-mac.txt index 080caff7..39fd8be4 100644 --- a/content/test/data/accessibility/language-detection/dynamic-multiple-inserts-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/dynamic-multiple-inserts-expected-mac.txt
@@ -1,8 +1,8 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='fr-FR' ++++AXGroup AXLanguage='fr-FR' -++++++AXStaticText AXValue='This is text created using Google Translate, it is unlikely to be idiomatic in the given target language. This text is only used to test language detection' AXLanguage='en' +++++++AXStaticText AXLanguage='en' AXValue='This is text created using Google Translate, it is unlikely to be idiomatic in the given target language. This text is only used to test language detection' ++++AXGroup AXLanguage='fr-FR' -++++++AXStaticText AXValue='Ce texte a été créé avec Google Translate, il est peu probable qu'il soit idiomatique dans la langue cible indiquée Ce texte est uniquement utilisé pour tester la détection de la langue.' AXLanguage='fr' +++++++AXStaticText AXLanguage='fr' AXValue='Ce texte a été créé avec Google Translate, il est peu probable qu'il soit idiomatique dans la langue cible indiquée Ce texte est uniquement utilisé pour tester la détection de la langue.' ++++AXGroup AXLanguage='fr-FR' -++++++AXStaticText AXValue='Dies ist ein mit Google Translate erstellter Text. Es ist unwahrscheinlich, dass er in der angegebenen Zielsprache idiomatisch ist. Dieser Text wird nur zum Testen der Spracherkennung verwendet.' AXLanguage='de' +++++++AXStaticText AXLanguage='de' AXValue='Dies ist ein mit Google Translate erstellter Text. Es ist unwahrscheinlich, dass er in der angegebenen Zielsprache idiomatisch ist. Dieser Text wird nur zum Testen der Spracherkennung verwendet.'
diff --git a/content/test/data/accessibility/language-detection/dynamic-reparenting-expected-mac.txt b/content/test/data/accessibility/language-detection/dynamic-reparenting-expected-mac.txt index 6e6a09e..1eeb3e5a 100644 --- a/content/test/data/accessibility/language-detection/dynamic-reparenting-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/dynamic-reparenting-expected-mac.txt
@@ -2,18 +2,18 @@ ++AXList AXLanguage='fr-FR' ++AXList AXLanguage='fr-FR' ++++AXGroup AXLanguage='fr-FR' -++++++AXListMarker AXValue='• ' AXLanguage='fr-FR' -++++++++AXStaticText AXValue='• ' AXLanguage='fr-FR' -++++++AXStaticText AXValue='Placeholder listitem' AXLanguage='fr-FR' +++++++AXListMarker AXLanguage='fr-FR' AXValue='• ' +++++++++AXStaticText AXLanguage='fr-FR' AXValue='• ' +++++++AXStaticText AXLanguage='fr-FR' AXValue='Placeholder listitem' ++++AXGroup AXLanguage='fr-FR' -++++++AXListMarker AXValue='• ' AXLanguage='fr-FR' -++++++++AXStaticText AXValue='• ' AXLanguage='fr-FR' -++++++AXStaticText AXValue='This is text created using Google Translate, it is unlikely to be idiomatic in the given target language. This text is only used to test language detection' AXLanguage='en' +++++++AXListMarker AXLanguage='fr-FR' AXValue='• ' +++++++++AXStaticText AXLanguage='fr-FR' AXValue='• ' +++++++AXStaticText AXLanguage='en' AXValue='This is text created using Google Translate, it is unlikely to be idiomatic in the given target language. This text is only used to test language detection' ++++AXGroup AXLanguage='fr-FR' -++++++AXListMarker AXValue='• ' AXLanguage='fr-FR' -++++++++AXStaticText AXValue='• ' AXLanguage='fr-FR' -++++++AXStaticText AXValue='Ce texte a été créé avec Google Translate, il est peu probable qu'il soit idiomatique dans la langue cible indiquée Ce texte est uniquement utilisé pour tester la détection de la langue.' AXLanguage='fr' +++++++AXListMarker AXLanguage='fr-FR' AXValue='• ' +++++++++AXStaticText AXLanguage='fr-FR' AXValue='• ' +++++++AXStaticText AXLanguage='fr' AXValue='Ce texte a été créé avec Google Translate, il est peu probable qu'il soit idiomatique dans la langue cible indiquée Ce texte est uniquement utilisé pour tester la détection de la langue.' ++++AXGroup AXLanguage='fr-FR' -++++++AXListMarker AXValue='• ' AXLanguage='fr-FR' -++++++++AXStaticText AXValue='• ' AXLanguage='fr-FR' -++++++AXStaticText AXValue='Dies ist ein mit Google Translate erstellter Text. Es ist unwahrscheinlich, dass er in der angegebenen Zielsprache idiomatisch ist. Dieser Text wird nur zum Testen der Spracherkennung verwendet.' AXLanguage='de' +++++++AXListMarker AXLanguage='fr-FR' AXValue='• ' +++++++++AXStaticText AXLanguage='fr-FR' AXValue='• ' +++++++AXStaticText AXLanguage='de' AXValue='Dies ist ein mit Google Translate erstellter Text. Es ist unwahrscheinlich, dass er in der angegebenen Zielsprache idiomatisch ist. Dieser Text wird nur zum Testen der Spracherkennung verwendet.'
diff --git a/content/test/data/accessibility/language-detection/lang-attribute-expected-mac.txt b/content/test/data/accessibility/language-detection/lang-attribute-expected-mac.txt index ae13e7a3..aa309f4 100644 --- a/content/test/data/accessibility/language-detection/lang-attribute-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/lang-attribute-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='en' -++++AXStaticText AXValue='Este documento es excelente. ' AXLanguage='es-ES' -++++AXStaticText AXValue='Ce document est excellent. ' AXLanguage='fr' -++++AXStaticText AXValue='This document is excellent.' AXLanguage='en' +++++AXStaticText AXLanguage='es-ES' AXValue='Este documento es excelente. ' +++++AXStaticText AXLanguage='fr' AXValue='Ce document est excellent. ' +++++AXStaticText AXLanguage='en' AXValue='This document is excellent.'
diff --git a/content/test/data/accessibility/language-detection/lang-attribute-nested-expected-mac.txt b/content/test/data/accessibility/language-detection/lang-attribute-nested-expected-mac.txt index 273c7c97..68e063d02 100644 --- a/content/test/data/accessibility/language-detection/lang-attribute-nested-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/lang-attribute-nested-expected-mac.txt
@@ -1,7 +1,7 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='en' -++++AXStaticText AXValue='This document is excellent.' AXLanguage='en' -++AXStaticText AXValue='Este documento es excelente.' AXLanguage='es-ES' +++++AXStaticText AXLanguage='en' AXValue='This document is excellent.' +++AXStaticText AXLanguage='es-ES' AXValue='Este documento es excelente.' ++AXGroup AXLanguage='fr' -++++AXStaticText AXValue='Ce document est excellent.' AXLanguage='fr' -++AXStaticText AXValue='This document is excellent.' AXLanguage='en' +++++AXStaticText AXLanguage='fr' AXValue='Ce document est excellent.' +++AXStaticText AXLanguage='en' AXValue='This document is excellent.'
diff --git a/content/test/data/accessibility/language-detection/lang-attribute-switching-expected-mac.txt b/content/test/data/accessibility/language-detection/lang-attribute-switching-expected-mac.txt index 28a09ae..420dbf24 100644 --- a/content/test/data/accessibility/language-detection/lang-attribute-switching-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/lang-attribute-switching-expected-mac.txt
@@ -1,8 +1,8 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='en' -++++AXStaticText AXValue='In the morning, I sometimes eat breakfast.' AXLanguage='en' +++++AXStaticText AXLanguage='en' AXValue='In the morning, I sometimes eat breakfast.' ++AXGroup AXLanguage='fr' -++++AXStaticText AXValue='Dans l'apres-midi, je dejeune.' AXLanguage='fr' +++++AXStaticText AXLanguage='fr' AXValue='Dans l'apres-midi, je dejeune.' ++AXGroup AXLanguage='en' -++++AXStaticText AXValue='Hello it's a pleasure to meet you. ' AXLanguage='en' -++++AXStaticText AXValue='Comment ca va?' AXLanguage='fr' +++++AXStaticText AXLanguage='en' AXValue='Hello it's a pleasure to meet you. ' +++++AXStaticText AXLanguage='fr' AXValue='Comment ca va?'
diff --git a/content/test/data/accessibility/language-detection/static-basic-expected-mac.txt b/content/test/data/accessibility/language-detection/static-basic-expected-mac.txt index c8cd63e..929423d 100644 --- a/content/test/data/accessibility/language-detection/static-basic-expected-mac.txt +++ b/content/test/data/accessibility/language-detection/static-basic-expected-mac.txt
@@ -1,5 +1,5 @@ AXWebArea AXLanguage='en-US' ++AXGroup AXLanguage='fr' -++++AXStaticText AXValue='“The famous pipe. How people reproached me for it! And yet, could you stuff my pipe? No, it’s just a representation, is it not? So if I had written on my picture ‘This is a pipe,’ I’d have been lying!"' AXLanguage='en' +++++AXStaticText AXLanguage='en' AXValue='“The famous pipe. How people reproached me for it! And yet, could you stuff my pipe? No, it’s just a representation, is it not? So if I had written on my picture ‘This is a pipe,’ I’d have been lying!"' ++AXGroup AXLanguage='en' -++++AXStaticText AXValue='« La fameuse pipe, me l’a-t-on assez reprochée ! Et pourtant, pouvez-vous la bourrer ma pipe ? Non, n’est-ce pas, elle n’est qu’une représentation. Donc si j’avais écrit sous mon tableau « ceci est une pipe », j’aurais menti ! »' AXLanguage='fr' +++++AXStaticText AXLanguage='fr' AXValue='« La fameuse pipe, me l’a-t-on assez reprochée ! Et pourtant, pouvez-vous la bourrer ma pipe ? Non, n’est-ce pas, elle n’est qu’une représentation. Donc si j’avais écrit sous mon tableau « ceci est une pipe », j’aurais menti ! »'
diff --git a/content/test/data/gpu/webgl-domain-not-blocked.html b/content/test/data/gpu/webgl-domain-not-blocked.html new file mode 100644 index 0000000..e470d80 --- /dev/null +++ b/content/test/data/gpu/webgl-domain-not-blocked.html
@@ -0,0 +1,64 @@ +<html> +<head> + <script type="text/javascript"> + var kSize = 16; + var contextLost = false; + + function onLoad() { + var canvas = createNewCanvas(); + var gl = canvas.getContext('webgl'); + if (!gl || !clearAndValidate(gl, 1, 0, 0)) + window.domAutomationController.send("FAILED"); + + canvas.addEventListener('webglcontextlost', (event) => { + event.preventDefault(); + contextLost = true; + }); + + canvas.addEventListener('webglcontextrestored', () => { + // Using the original WebGL context after restoring should succeed. + if (clearAndValidate(gl, 0, 1, 0)) + window.domAutomationController.send("SUCCESS"); + else + window.domAutomationController.send("FAILED"); + }); + + window.domAutomationController.send("LOADED"); + } + + function createNewCanvas() { + var canvas = document.createElement('canvas'); + canvas.width = kSize; + canvas.height = kSize; + document.body.appendChild(canvas); + + return canvas; + } + + function clearAndValidate(gl, r, g, b) { + gl.clearColor(r, g, b, 1); + gl.clear(gl.COLOR_BUFFER_BIT); + var pixels = new Uint8Array(kSize * kSize * 4); + gl.readPixels(0, 0, kSize, kSize, gl.RGBA, gl.UNSIGNED_BYTE, pixels); + + return pixels[0] == r * 255 && pixels[1] == g * 255 && + pixels[2] == b * 255 && pixels[3] == 255; + } + + function testNewWebGLContext() { + // Reset the success/failure code that onLoad() may have set. + window.domAutomationController.reset(); + + var canvas = createNewCanvas(); + var gl = canvas.getContext('webgl'); + if (gl != null && clearAndValidate(gl, 0, 0, 1)) + window.domAutomationController.send("SUCCESS"); + else + window.domAutomationController.send("FAILED"); + } + + </script> +</head> +<body onload="onLoad()"> +</body> +</html>
diff --git a/content/test/gpu/gpu_tests/context_lost_integration_test.py b/content/test/gpu/gpu_tests/context_lost_integration_test.py index 4ffe7f49..58944183 100644 --- a/content/test/gpu/gpu_tests/context_lost_integration_test.py +++ b/content/test/gpu/gpu_tests/context_lost_integration_test.py
@@ -101,6 +101,10 @@ 'webgl-domain-blocking-page1.html'), ('ContextLost_WebGLUnblockedAfterUserInitiatedReload', 'webgl-domain-unblocking.html'), + ('GpuNormalTermination_OriginalWebGLNotBlocked', + 'webgl-domain-not-blocked.html'), + ('GpuNormalTermination_NewWebGLNotBlocked', + 'webgl-domain-not-blocked.html'), ('ContextLost_WorkerRAFAfterGPUCrash', 'worker-raf-after-gpu-crash.html'), ('ContextLost_WorkerRAFAfterGPUCrash_OOPD', @@ -325,6 +329,32 @@ 'WebGL should have been unblocked after a user-initiated navigation') self._RestartBrowser('must restart after tests that kill the GPU process') + def _GpuNormalTermination_OriginalWebGLNotBlocked(self, test_path): + self.RestartBrowserIfNecessaryWithArgs(self._AddDefaultArgs([])) + self._NavigateAndWaitForLoad(test_path) + tab = self.tab + + tab.EvaluateJavaScript( + 'chrome.gpuBenchmarking.terminateGpuProcessNormally()') + + # The webglcontextrestored event on the original canvas should trigger and + # report success or failure. + self._WaitForTabAndCheckCompletion() + self._RestartBrowser('must restart after tests that kill the GPU process') + + def _GpuNormalTermination_NewWebGLNotBlocked(self, test_path): + self.RestartBrowserIfNecessaryWithArgs(self._AddDefaultArgs([])) + self._NavigateAndWaitForLoad(test_path) + tab = self.tab + + tab.EvaluateJavaScript( + 'chrome.gpuBenchmarking.terminateGpuProcessNormally()') + tab.WaitForJavaScriptCondition('window.contextLost', timeout=wait_timeout) + tab.EvaluateJavaScript('window.testNewWebGLContext()') + + self._WaitForTabAndCheckCompletion() + self._RestartBrowser('must restart after tests that kill the GPU process') + def _ContextLost_WorkerRAFAfterGPUCrash(self, test_path): self.RestartBrowserIfNecessaryWithArgs( self._AddDefaultArgs(['--enable-experimental-web-platform-features']))
diff --git a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt index a013a9f..7f24211 100644 --- a/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/context_lost_expectations.txt
@@ -50,3 +50,9 @@ # Linux Intel Flake crbug.com/1034008 [ linux intel ] ContextLost_WebGLContextLostInHiddenTab [ RetryOnFailure ] + +# These tests use base::Process::TerminateCurrentProcessImmediately(0) on the +# GPU process and expect a normal exit code reported to the browser process. +# On Android, this returns a process killed exit code. +crbug.com/1078566 [ android ] GpuNormalTermination_OriginalWebGLNotBlocked [ Skip ] +crbug.com/1078566 [ android ] GpuNormalTermination_NewWebGLNotBlocked [ Skip ]
diff --git a/content/test/trust_token_browsertest.cc b/content/test/trust_token_browsertest.cc index b627c83f..800aad2 100644 --- a/content/test/trust_token_browsertest.cc +++ b/content/test/trust_token_browsertest.cc
@@ -30,6 +30,10 @@ namespace content { +namespace { + +using network::test::TrustTokenRequestHandler; + // TrustTokenBrowsertest is a fixture containing boilerplate for initializing an // HTTPS test server and passing requests through to an embedded instance of // network::test::TrustTokenRequestHandler, which contains the guts of the @@ -61,11 +65,13 @@ base::test::ScopedFeatureList features_; // TODO(davidvc): Extend this to support more than one key set. - network::test::TrustTokenRequestHandler request_handler_{/*num_keys=*/1}; + TrustTokenRequestHandler request_handler_; net::EmbeddedTestServer server_{net::EmbeddedTestServer::TYPE_HTTPS}; }; +} // namespace + IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, FetchEndToEnd) { base::RunLoop run_loop; GetNetworkService()->SetTrustTokenKeyCommitments( @@ -225,4 +231,30 @@ EXPECT_EQ(true, EvalJs(shell(), cmd)); } +IN_PROC_BROWSER_TEST_F(TrustTokenBrowsertest, + SigningWithNoRedemptionRecordDoesntCancelRequest) { + TrustTokenRequestHandler::Options options; + options.client_signing_outcome = + TrustTokenRequestHandler::SigningOutcome::kFailure; + request_handler_.UpdateOptions(std::move(options)); + + GURL start_url(server_.GetURL("/title1.html")); + EXPECT_TRUE(NavigateToURL(shell(), start_url)); + + // This sign operation will fail, because we don't have a signed redemption + // record in storage, a prerequisite. However, the failure shouldn't be fatal. + std::string cmd = + JsReplace(R"((async () => { + await fetch("/sign", {trustToken: {type: 'send-srr', + signRequestData: 'include', + issuer: $1}}); } + )(); )", + url::Origin::Create(server_.base_url()).Serialize()); + + // We use EvalJs here, not ExecJs, because EvalJs waits for promises to + // resolve. + EXPECT_EQ(EvalJs(shell(), cmd).error, ""); + EXPECT_EQ(request_handler_.LastVerificationError(), base::nullopt); +} + } // namespace content
diff --git a/docs/wmax_tokens.md b/docs/wmax_tokens.md index f0cb125..5038e76b 100644 --- a/docs/wmax_tokens.md +++ b/docs/wmax_tokens.md
@@ -53,4 +53,5 @@ - System headers on Chrome OS differ between boards and are not covered by the commit queue. This means the token limits were not tailored to those builds, causing build problems downstream. To avoid this, the -Wmax-tokens warning - was disabled for Chrome OS (see [crbug.com/1079053](https://crbug.com/1079053). + was disabled for Chrome OS (see + [crbug.com/1079053](https://crbug.com/1079053)).
diff --git a/fuchsia/fidl/cast/application_controller.fidl b/fuchsia/fidl/cast/application_controller.fidl index c7a82f7..8e85c8f 100644 --- a/fuchsia/fidl/cast/application_controller.fidl +++ b/fuchsia/fidl/cast/application_controller.fidl
@@ -19,4 +19,7 @@ /// Connects to the application's media control & observation API. GetMediaPlayer(request<fuchsia.media.sessions2.Player> request); + + /// Gets the private memory footprint of the application's main frame. + GetPrivateMemorySize() -> (uint64 size_bytes); };
diff --git a/fuchsia/runners/cast/application_controller_impl.cc b/fuchsia/runners/cast/application_controller_impl.cc index 472c635..48d0327d 100644 --- a/fuchsia/runners/cast/application_controller_impl.cc +++ b/fuchsia/runners/cast/application_controller_impl.cc
@@ -4,6 +4,8 @@ #include "fuchsia/runners/cast/application_controller_impl.h" +#include <utility> + #include "base/fuchsia/fuchsia_logging.h" #include "base/logging.h" @@ -40,3 +42,8 @@ void ApplicationControllerImpl::SetBlockMediaLoading(bool blocked) { frame_->SetBlockMediaLoading(blocked); } + +void ApplicationControllerImpl::GetPrivateMemorySize( + GetPrivateMemorySizeCallback callback) { + frame_->GetPrivateMemorySize(std::move(callback)); +}
diff --git a/fuchsia/runners/cast/application_controller_impl.h b/fuchsia/runners/cast/application_controller_impl.h index 2898b28..ae77a875 100644 --- a/fuchsia/runners/cast/application_controller_impl.h +++ b/fuchsia/runners/cast/application_controller_impl.h
@@ -27,6 +27,7 @@ ::fidl::InterfaceRequest<fuchsia::media::sessions2::Player> request) final; void SetBlockMediaLoading(bool blocked) override; + void GetPrivateMemorySize(GetPrivateMemorySizeCallback callback) override; private: fidl::Binding<chromium::cast::ApplicationController> binding_;
diff --git a/fuchsia/runners/cast/application_controller_impl_unittest.cc b/fuchsia/runners/cast/application_controller_impl_unittest.cc index ae9ff9b..46d8577 100644 --- a/fuchsia/runners/cast/application_controller_impl_unittest.cc +++ b/fuchsia/runners/cast/application_controller_impl_unittest.cc
@@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/test/task_environment.h" #include "fuchsia/base/fit_adapter.h" +#include "fuchsia/base/result_receiver.h" #include "fuchsia/fidl/chromium/cast/cpp/fidl.h" #include "fuchsia/runners/cast/application_controller_impl.h" #include "testing/gmock/include/gmock/gmock.h" @@ -26,9 +27,14 @@ LOG(FATAL) << "No mock defined for " << name; } - MOCK_METHOD2(ConfigureInputTypes, - void(fuchsia::web::InputTypes types, - fuchsia::web::AllowInputState allow)); + MOCK_METHOD(void, + ConfigureInputTypes, + (fuchsia::web::InputTypes types, + fuchsia::web::AllowInputState allow)); + + MOCK_METHOD(void, + GetPrivateMemorySize, + (GetPrivateMemorySizeCallback callback)); }; class ApplicationControllerImplTest : public chromium::cast::ApplicationContext, @@ -93,4 +99,22 @@ run_loop.Run(); } +// Verifies that SetTouchInputEnabled() calls the Frame API correctly. +TEST_F(ApplicationControllerImplTest, GetPrivateMemorySize) { + constexpr uint64_t kMockSize = 12345; + + EXPECT_CALL(frame_, GetPrivateMemorySize(testing::_)) + .WillOnce( + [](chromium::cast::ApplicationController::GetPrivateMemorySizeCallback + callback) { callback(kMockSize); }); + + base::RunLoop run_loop; + cr_fuchsia::ResultReceiver<uint64_t> result(run_loop.QuitClosure()); + application_ptr_->GetPrivateMemorySize( + cr_fuchsia::CallbackToFitFunction(result.GetReceiveCallback())); + run_loop.Run(); + + EXPECT_EQ(*result, kMockSize); +} + } // namespace
diff --git a/gpu/ipc/client/gpu_channel_host.cc b/gpu/ipc/client/gpu_channel_host.cc index 6288951f..b1d3dc5 100644 --- a/gpu/ipc/client/gpu_channel_host.cc +++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -246,6 +246,10 @@ Send(new GpuChannelMsg_CrashForTesting()); } +void GpuChannelHost::TerminateGpuProcessForTesting() { + Send(new GpuChannelMsg_TerminateForTesting()); +} + std::unique_ptr<ClientSharedImageInterface> GpuChannelHost::CreateClientSharedImageInterface() { return std::make_unique<ClientSharedImageInterface>(&shared_image_interface_);
diff --git a/gpu/ipc/client/gpu_channel_host.h b/gpu/ipc/client/gpu_channel_host.h index 6c17de8..fb96db9 100644 --- a/gpu/ipc/client/gpu_channel_host.h +++ b/gpu/ipc/client/gpu_channel_host.h
@@ -136,6 +136,10 @@ // otherwise ignored. void CrashGpuProcessForTesting(); + // Termintes the GPU process with an exit code of 0. This only works when + // running tests and is otherwise ignored. + void TerminateGpuProcessForTesting(); + std::unique_ptr<ClientSharedImageInterface> CreateClientSharedImageInterface();
diff --git a/gpu/ipc/common/gpu_messages.h b/gpu/ipc/common/gpu_messages.h index 9a0bd73..ca20177 100644 --- a/gpu/ipc/common/gpu_messages.h +++ b/gpu/ipc/common/gpu_messages.h
@@ -210,6 +210,12 @@ // This is only supported in testing environments, and is otherwise ignored. IPC_MESSAGE_CONTROL0(GpuChannelMsg_CrashForTesting) +// Terminates the GPU process with an exit code of 0. This message is handled in +// in GpuChannelMessageFilter::OnMessageReceived and is only used in tests where +// the GPU benchmarking extension is enabled. The purpose of this API is to test +// scenarios where the GPU process is terminated on purpose with exit code of 0. +IPC_MESSAGE_CONTROL0(GpuChannelMsg_TerminateForTesting) + // Simple NOP message which can be used as fence to ensure all previous sent // messages have been received. IPC_SYNC_MESSAGE_CONTROL0_0(GpuChannelMsg_Nop)
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc index f57d754..f50e5aeb 100644 --- a/gpu/ipc/service/gpu_channel.cc +++ b/gpu/ipc/service/gpu_channel.cc
@@ -22,6 +22,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/numerics/safe_conversions.h" +#include "base/process/process.h" #include "base/single_thread_task_runner.h" #include "base/stl_util.h" #include "base/strings/string_util.h" @@ -138,7 +139,7 @@ scoped_refptr<ImageDecodeAcceleratorStub> image_decode_accelerator_stub_; base::ThreadChecker io_thread_checker_; - bool allow_crash_for_testing_ = false; + bool allow_process_kill_for_testing_ = false; DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageFilter); }; @@ -158,9 +159,9 @@ static_cast<int32_t>( GpuChannelReservedRoutes::kImageDecodeAccelerator))) { io_thread_checker_.DetachFromThread(); - allow_crash_for_testing_ = gpu_channel->gpu_channel_manager() - ->gpu_preferences() - .enable_gpu_benchmarking_extension; + allow_process_kill_for_testing_ = gpu_channel->gpu_channel_manager() + ->gpu_preferences() + .enable_gpu_benchmarking_extension; } GpuChannelMessageFilter::~GpuChannelMessageFilter() { @@ -264,11 +265,18 @@ // harness. Only pay attention to this message if Telemetry's GPU // benchmarking extension was enabled via the command line, which // exposes privileged APIs to JavaScript. - if (allow_crash_for_testing_) { + if (allow_process_kill_for_testing_) { gl::Crash(); } // Won't be reached if the extension is enabled. return MessageErrorHandler(message, "Crashes for testing are disabled"); + case GpuChannelMsg_TerminateForTesting::ID: + if (allow_process_kill_for_testing_) { + base::Process::TerminateCurrentProcessImmediately(0); + return true; + } + return MessageErrorHandler(message, + "Process termination for testing is disabled"); default: break; }
diff --git a/gpu/vulkan/vulkan_instance.cc b/gpu/vulkan/vulkan_instance.cc index 443b655..49d8709 100644 --- a/gpu/vulkan/vulkan_instance.cc +++ b/gpu/vulkan/vulkan_instance.cc
@@ -305,19 +305,19 @@ // API version instead of just testing to see if // vkGetPhysicalDeviceFeatures2 is non-null. if (info.properties.apiVersion >= VK_MAKE_VERSION(1, 1, 0)) { - VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcr_converson_features = + VkPhysicalDeviceSamplerYcbcrConversionFeatures ycbcr_conversion_features = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES}; VkPhysicalDeviceProtectedMemoryFeatures protected_memory_feature = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES}; VkPhysicalDeviceFeatures2 features_2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2}; - features_2.pNext = &ycbcr_converson_features; - ycbcr_converson_features.pNext = &protected_memory_feature; + features_2.pNext = &ycbcr_conversion_features; + ycbcr_conversion_features.pNext = &protected_memory_feature; vkGetPhysicalDeviceFeatures2(device, &features_2); info.features = features_2.features; info.feature_sampler_ycbcr_conversion = - ycbcr_converson_features.samplerYcbcrConversion; + ycbcr_conversion_features.samplerYcbcrConversion; info.feature_protected_memory = protected_memory_feature.protectedMemory; } else { vkGetPhysicalDeviceFeatures(device, &info.features);
diff --git a/media/audio/win/avrt_wrapper_win.cc b/media/audio/win/avrt_wrapper_win.cc index 48e1a84..6e3c1f7 100644 --- a/media/audio/win/avrt_wrapper_win.cc +++ b/media/audio/win/avrt_wrapper_win.cc
@@ -23,7 +23,7 @@ if (!g_set_mm_thread_priority) { // The avrt.dll is available on Windows Vista and later. wchar_t path[MAX_PATH] = {0}; - ExpandEnvironmentStrings(L"%WINDIR%\\system32\\avrt.dll", path, + ExpandEnvironmentStrings(L"%SystemRoot%\\system32\\avrt.dll", path, base::size(path)); g_avrt = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (!g_avrt)
diff --git a/mojo/public/cpp/bindings/receiver_set.h b/mojo/public/cpp/bindings/receiver_set.h index 71261fb..8d7d732 100644 --- a/mojo/public/cpp/bindings/receiver_set.h +++ b/mojo/public/cpp/bindings/receiver_set.h
@@ -160,6 +160,16 @@ return true; } + // Unbinds and takes all receivers in this set. + std::vector<PendingType> TakeReceivers() { + std::vector<PendingType> pending_receivers; + for (auto& it : receivers_) { + pending_receivers.push_back(it.second->Unbind()); + } + receivers_.clear(); + return pending_receivers; + } + // Removes all receivers from the set, effectively closing all of them. This // ReceiverSet will not schedule or execute any further method invocations or // disconnection notifications until a new receiver is added to the set. @@ -298,6 +308,8 @@ void FlushForTesting() { receiver_.FlushForTesting(); } + PendingType Unbind() { return receiver_.Unbind(); } + private: class DispatchFilter : public MessageFilter { public:
diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java index 7f51431..dc9b813 100644 --- a/net/android/java/src/org/chromium/net/X509Util.java +++ b/net/android/java/src/org/chromium/net/X509Util.java
@@ -12,10 +12,10 @@ import android.net.http.X509TrustManagerExtensions; import android.os.Build; import android.security.KeyChain; -import android.util.Log; import android.util.Pair; import org.chromium.base.ContextUtils; +import org.chromium.base.Log; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.MainDex; import org.chromium.base.annotations.NativeMethods; @@ -117,7 +117,14 @@ public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType, String host) throws CertificateException { - mTrustManager.checkServerTrusted(chain, authType); + try { + mTrustManager.checkServerTrusted(chain, authType); + } catch (RuntimeException e) { + // https://crbug.com/937354: X509TrustManager can unexpectedly throw runtime + // exceptions. + Log.e(TAG, "X509TrustManager unexpectedly threw: %s", e); + throw new CertificateException(e); + } return Collections.<X509Certificate>emptyList(); } } @@ -134,8 +141,15 @@ @SuppressLint("NewApi") public List<X509Certificate> checkServerTrusted( X509Certificate[] chain, String authType, String host) throws CertificateException { - // API Level 17: android.net.http.X509TrustManagerExtensions#checkServerTrusted - return mTrustManagerExtensions.checkServerTrusted(chain, authType, host); + try { + // API Level 17: android.net.http.X509TrustManagerExtensions#checkServerTrusted + return mTrustManagerExtensions.checkServerTrusted(chain, authType, host); + } catch (RuntimeException e) { + // https://crbug.com/937354: checkServerTrusted() can unexpectedly throw runtime + // exceptions, most often within conscrypt while parsing certificates. + Log.e(TAG, "checkServerTrusted() unexpectedly threw: %s", e); + throw new CertificateException(e); + } } } @@ -289,7 +303,17 @@ TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm); tmf.init(keyStore); - for (TrustManager tm : tmf.getTrustManagers()) { + TrustManager[] trustManagers = null; + try { + trustManagers = tmf.getTrustManagers(); + } catch (RuntimeException e) { + // https://crbug.com/937354: getTrustManagers() can unexpectedly throw runtime + // exceptions, most often while processing the network security config XML file. + Log.e(TAG, "TrustManagerFactory.getTrustManagers() unexpectedly threw: %s", e); + throw new KeyStoreException(e); + } + + for (TrustManager tm : trustManagers) { if (tm instanceof X509TrustManager) { try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
diff --git a/net/http/transport_security_persister.cc b/net/http/transport_security_persister.cc index 52c2d83b..5c5ef3a 100644 --- a/net/http/transport_security_persister.cc +++ b/net/http/transport_security_persister.cc
@@ -210,6 +210,12 @@ return true; } +void OnWriteFinishedTask(scoped_refptr<base::SequencedTaskRunner> task_runner, + base::OnceClosure callback, + bool result) { + task_runner->PostTask(FROM_HERE, base::BindOnce(std::move(callback))); +} + } // namespace TransportSecurityPersister::TransportSecurityPersister( @@ -252,16 +258,18 @@ writer_.RegisterOnNextWriteCallbacks( base::OnceClosure(), - base::BindOnce(&TransportSecurityPersister::OnWriteFinished, - weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + base::BindOnce( + &OnWriteFinishedTask, foreground_runner_, + base::BindOnce(&TransportSecurityPersister::OnWriteFinished, + weak_ptr_factory_.GetWeakPtr(), std::move(callback)))); auto data = std::make_unique<std::string>(); SerializeData(data.get()); writer_.WriteNow(std::move(data)); } -void TransportSecurityPersister::OnWriteFinished(base::OnceClosure callback, - bool result) { - foreground_runner_->PostTask(FROM_HERE, std::move(callback)); +void TransportSecurityPersister::OnWriteFinished(base::OnceClosure callback) { + DCHECK(foreground_runner_->RunsTasksInCurrentSequence()); + std::move(callback).Run(); } bool TransportSecurityPersister::SerializeData(std::string* output) {
diff --git a/net/http/transport_security_persister.h b/net/http/transport_security_persister.h index c8ba1d8..a7a9283 100644 --- a/net/http/transport_security_persister.h +++ b/net/http/transport_security_persister.h
@@ -67,6 +67,7 @@ // Called by the TransportSecurityState when it changes its state. void StateIsDirty(TransportSecurityState*) override; // Called when the TransportSecurityState should be written immediately. + // |callback| is called after data is persisted. void WriteNow(TransportSecurityState* state, base::OnceClosure callback) override; @@ -121,7 +122,7 @@ TransportSecurityState* state); void CompleteLoad(const std::string& state); - void OnWriteFinished(base::OnceClosure callback, bool result); + void OnWriteFinished(base::OnceClosure callback); TransportSecurityState* transport_security_state_;
diff --git a/net/http/transport_security_persister_unittest.cc b/net/http/transport_security_persister_unittest.cc index 1645ea0..db95259 100644 --- a/net/http/transport_security_persister_unittest.cc +++ b/net/http/transport_security_persister_unittest.cc
@@ -38,8 +38,12 @@ void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(base::MessageLoopCurrentForIO::IsSet()); + scoped_refptr<base::SequencedTaskRunner> background_runner( + base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN})); persister_ = std::make_unique<TransportSecurityPersister>( - &state_, temp_dir_.GetPath(), base::ThreadTaskRunnerHandle::Get()); + &state_, temp_dir_.GetPath(), std::move(background_runner)); } protected:
diff --git a/printing/printing_features.cc b/printing/printing_features.cc index d2892a2..be78d3a 100644 --- a/printing/printing_features.cc +++ b/printing/printing_features.cc
@@ -18,6 +18,9 @@ // calls the deprecated PPD API. const base::Feature kCupsIppPrintingBackend{"CupsIppPrintingBackend", base::FEATURE_DISABLED_BY_DEFAULT}; + +const base::Feature kEnableCustomMacPaperSizes{ + "EnableCustomMacPaperSizes", base::FEATURE_DISABLED_BY_DEFAULT}; #endif // defined(OS_MACOSX) #if defined(OS_WIN)
diff --git a/printing/printing_features.h b/printing/printing_features.h index 50feb3fe..8ce0975 100644 --- a/printing/printing_features.h +++ b/printing/printing_features.h
@@ -21,6 +21,7 @@ #if defined(OS_MACOSX) PRINTING_EXPORT extern const base::Feature kCupsIppPrintingBackend; +PRINTING_EXPORT extern const base::Feature kEnableCustomMacPaperSizes; #endif // defined(OS_MACOSX) #if defined(OS_WIN)
diff --git a/services/device/usb/usb_device_handle_win.cc b/services/device/usb/usb_device_handle_win.cc index c1aa8ec0..2cac1b0 100644 --- a/services/device/usb/usb_device_handle_win.cc +++ b/services/device/usb/usb_device_handle_win.cc
@@ -25,7 +25,8 @@ #include "base/memory/ref_counted_memory.h" #include "base/stl_util.h" #include "base/strings/string16.h" -#include "base/synchronization/lock.h" +#include "base/task/post_task.h" +#include "base/threading/scoped_blocking_call.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/win/object_watcher.h" #include "components/device_event_log/device_event_log.h" @@ -93,6 +94,30 @@ return flags; } +bool ResetPipeBlocking(WINUSB_INTERFACE_HANDLE handle, UCHAR pipeId) { + base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, + base::BlockingType::WILL_BLOCK); + if (!WinUsb_ResetPipe(handle, pipeId)) { + USB_PLOG(DEBUG) << "Failed to reset pipe " << static_cast<int>(pipeId); + return false; + } + + return true; +} + +bool SetCurrentAlternateSettingBlocking(WINUSB_INTERFACE_HANDLE handle, + UCHAR settingNumber) { + base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, + base::BlockingType::WILL_BLOCK); + if (!WinUsb_SetCurrentAlternateSetting(handle, settingNumber)) { + USB_PLOG(DEBUG) << "Failed to set alternate setting " + << static_cast<int>(settingNumber); + return false; + } + + return true; +} + } // namespace // Encapsulates waiting for the completion of an overlapped event. @@ -275,8 +300,47 @@ return; } - // TODO: Unimplemented. - task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(callback), false)); + auto interface_it = interfaces_.find(interface_number); + if (interface_it == interfaces_.end()) { + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false)); + return; + } + Interface& interface = interface_it->second; + + if (!interface.claimed) { + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false)); + return; + } + + bool found_alternate = false; + for (const auto& alternate : interface.info->alternates) { + if (alternate->alternate_setting == alternate_setting) { + found_alternate = true; + break; + } + } + + if (!found_alternate) { + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false)); + return; + } + + // Prevent |interface.handle| from being released while the blocking call + // is in progress. + DCHECK(interface.handle.IsValid()); + interface.reference_count++; + + // Use a strong reference to |this| rather than a weak pointer to prevent + // |interface.handle| from being freed because |this| was destroyed. + base::PostTaskAndReplyWithResult( + FROM_HERE, {base::ThreadPool(), base::MayBlock()}, + base::BindOnce(&SetCurrentAlternateSettingBlocking, + interface.handle.Get(), alternate_setting), + base::BindOnce(&UsbDeviceHandleWin::OnSetAlternateInterfaceSetting, this, + interface_number, alternate_setting, std::move(callback))); } void UsbDeviceHandleWin::ResetDevice(ResultCallback callback) { @@ -297,8 +361,39 @@ return; } - // TODO: Unimplemented. - task_runner_->PostTask(FROM_HERE, base::BindOnce(std::move(callback), false)); + uint8_t endpoint_address = + ConvertEndpointNumberToAddress(endpoint_number, direction); + + auto endpoint_it = endpoints_.find(endpoint_address); + if (endpoint_it == endpoints_.end()) { + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false)); + return; + } + + auto interface_it = + interfaces_.find(endpoint_it->second.interface->interface_number); + DCHECK(interface_it != interfaces_.end()); + Interface& interface = interface_it->second; + if (!interface.claimed) { + task_runner_->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), false)); + return; + } + + // Prevent |interface.handle| from being released while the blocking call + // is in progress. + DCHECK(interface.handle.IsValid()); + interface.reference_count++; + + // Use a strong reference to |this| rather than a weak pointer to prevent + // |interface.handle| from being freed because |this| was destroyed. + base::PostTaskAndReplyWithResult( + FROM_HERE, {base::ThreadPool(), base::MayBlock()}, + base::BindOnce(&ResetPipeBlocking, interface.handle.Get(), + endpoint_address), + base::BindOnce(&UsbDeviceHandleWin::OnClearHalt, this, + interface.info->interface_number, std::move(callback))); } void UsbDeviceHandleWin::ControlTransfer( @@ -488,10 +583,8 @@ continue; Interface& interface_info = interfaces_[interface->interface_number]; - interface_info.interface_number = interface->interface_number; - interface_info.first_interface = interface->first_interface; - RegisterEndpoints( - CombinedInterfaceInfo(interface.get(), alternate.get())); + interface_info.info = interface.get(); + RegisterEndpoints(interface.get(), *alternate); if (interface->interface_number == interface->first_interface) { auto it = device_->functions().find(interface->interface_number); @@ -566,16 +659,17 @@ return; } - if (interface->first_interface != interface->interface_number) { - auto first_interface_it = interfaces_.find(interface->first_interface); + if (interface->info->first_interface != interface->info->interface_number) { + auto first_interface_it = + interfaces_.find(interface->info->first_interface); DCHECK(first_interface_it != interfaces_.end()); Interface* first_interface = &first_interface_it->second; OpenInterfaceHandle( first_interface, base::BindOnce(&UsbDeviceHandleWin::OnFirstInterfaceOpened, - weak_factory_.GetWeakPtr(), interface->interface_number, - std::move(callback))); + weak_factory_.GetWeakPtr(), + interface->info->interface_number, std::move(callback))); return; } @@ -600,7 +694,7 @@ if (!base::EqualsCaseInsensitiveASCII(interface->function_driver, kWinUsbDriverName)) { USB_LOG(ERROR) << "Interface " - << static_cast<int>(interface->interface_number) + << static_cast<int>(interface->info->interface_number) << " uses driver \"" << interface->function_driver << "\" instead of WinUSB."; return; @@ -608,7 +702,7 @@ if (interface->function_path.empty()) { USB_LOG(ERROR) << "Interface " - << static_cast<int>(interface->interface_number) + << static_cast<int>(interface->info->interface_number) << " has no device path."; return; } @@ -637,8 +731,10 @@ auto interface_it = interfaces_.find(interface_number); DCHECK(interface_it != interfaces_.end()); Interface* interface = &interface_it->second; - DCHECK_NE(interface->first_interface, interface->interface_number); - DCHECK_EQ(interface->first_interface, first_interface->interface_number); + DCHECK_NE(interface->info->first_interface, + interface->info->interface_number); + DCHECK_EQ(interface->info->first_interface, + first_interface->info->interface_number); base::ScopedClosureRunner run_callback( base::BindOnce(std::move(callback), interface)); @@ -648,15 +744,16 @@ first_interface->reference_count++; - int index = interface->interface_number - interface->first_interface - 1; + int index = + interface->info->interface_number - interface->info->first_interface - 1; WINUSB_INTERFACE_HANDLE handle; - if (!WinUsb_GetAssociatedInterface(first_interface->handle.Get(), index, - &handle)) { + if (WinUsb_GetAssociatedInterface(first_interface->handle.Get(), index, + &handle)) { interface->handle.Set(handle); } else { USB_PLOG(ERROR) << "Failed to get associated interface " << index << " from interface " - << static_cast<int>(interface->first_interface); + << static_cast<int>(interface->info->first_interface); ReleaseInterfaceReference(first_interface); } } @@ -671,23 +768,69 @@ std::move(callback).Run(interface->claimed); } +void UsbDeviceHandleWin::OnSetAlternateInterfaceSetting(int interface_number, + int alternate_setting, + ResultCallback callback, + bool result) { + auto it = interfaces_.find(interface_number); + DCHECK(it != interfaces_.end()); + Interface& interface = it->second; + + if (!result) { + ReleaseInterfaceReference(&interface); + std::move(callback).Run(false); + return; + } + + // Unregister endpoints from the previously selected alternate setting. + for (const auto& alternate : interface.info->alternates) { + if (alternate->alternate_setting == interface.alternate_setting) { + UnregisterEndpoints(*alternate); + break; + } + } + + interface.alternate_setting = alternate_setting; + + // Unregister endpoints from the currently selected alternate setting. + for (const auto& alternate : interface.info->alternates) { + if (alternate->alternate_setting == interface.alternate_setting) { + RegisterEndpoints(interface.info, *alternate); + break; + } + } + + ReleaseInterfaceReference(&interface); + std::move(callback).Run(true); +} + void UsbDeviceHandleWin::RegisterEndpoints( - const CombinedInterfaceInfo& interface) { - DCHECK(interface.IsValid()); - for (const auto& endpoint : interface.alternate->endpoints) { + const mojom::UsbInterfaceInfo* interface, + const mojom::UsbAlternateInterfaceInfo& alternate) { + for (const auto& endpoint : alternate.endpoints) { Endpoint& endpoint_info = endpoints_[ConvertEndpointNumberToAddress(*endpoint)]; - endpoint_info.interface = interface.interface; + endpoint_info.interface = interface; endpoint_info.type = endpoint->type; } } void UsbDeviceHandleWin::UnregisterEndpoints( - const CombinedInterfaceInfo& interface) { - for (const auto& endpoint : interface.alternate->endpoints) + const mojom::UsbAlternateInterfaceInfo& alternate) { + for (const auto& endpoint : alternate.endpoints) endpoints_.erase(ConvertEndpointNumberToAddress(*endpoint)); } +void UsbDeviceHandleWin::OnClearHalt(int interface_number, + ResultCallback callback, + bool result) { + auto it = interfaces_.find(interface_number); + DCHECK(it != interfaces_.end()); + ReleaseInterfaceReference(&it->second); + + std::move(callback).Run(result); +} + void UsbDeviceHandleWin::OpenInterfaceForControlTransfer( UsbControlTransferRecipient recipient, uint16_t index, @@ -809,8 +952,8 @@ if (!interface) { handle = hub_handle_.Get(); } else { - if (interface->interface_number != interface->first_interface) { - auto it = interfaces_.find(interface->first_interface); + if (interface->info->interface_number != interface->info->first_interface) { + auto it = interfaces_.find(interface->info->first_interface); DCHECK(it != interfaces_.end()); interface = &it->second; } @@ -820,7 +963,7 @@ } auto request = std::make_unique<Request>( - handle, interface ? interface->interface_number : -1); + handle, interface ? interface->info->interface_number : -1); Request* request_ptr = request.get(); requests_[request_ptr] = std::move(request); return request_ptr; @@ -934,7 +1077,7 @@ const Interface& interface = map_entry.second; // Iterate over functions, rather than interfaces. - if (interface.first_interface != interface.interface_number) + if (interface.info->first_interface != interface.info->interface_number) continue; if (interface.function_driver.empty()) @@ -958,8 +1101,8 @@ if (interface->function_handle.IsValid()) interface->function_handle.Close(); - if (interface->interface_number != interface->first_interface) { - auto it = interfaces_.find(interface->first_interface); + if (interface->info->interface_number != interface->info->first_interface) { + auto it = interfaces_.find(interface->info->first_interface); DCHECK(it != interfaces_.end()); ReleaseInterfaceReference(&it->second); }
diff --git a/services/device/usb/usb_device_handle_win.h b/services/device/usb/usb_device_handle_win.h index 2a49b10..c0a736b6 100644 --- a/services/device/usb/usb_device_handle_win.h +++ b/services/device/usb/usb_device_handle_win.h
@@ -99,12 +99,7 @@ Interface(); ~Interface(); - uint8_t interface_number; - - // If this interface is part of a function then this will be the interface - // number of the first interface in that function. Otherwise it will be - // equal to |interface_number|. - uint8_t first_interface; + const mojom::UsbInterfaceInfo* info; // In a composite device each function has its own driver and path to open. base::string16 function_driver; @@ -113,6 +108,9 @@ ScopedWinUsbHandle handle; bool claimed = false; + + // The currently selected alternative interface setting. This is assumed to + // be the first alternate when the device is opened. uint8_t alternate_setting = 0; // The count of outstanding requests, including associated interfaces @@ -138,8 +136,14 @@ OpenInterfaceCallback callback, Interface* first_interface); void OnInterfaceClaimed(ResultCallback callback, Interface* interface); - void RegisterEndpoints(const CombinedInterfaceInfo& interface); - void UnregisterEndpoints(const CombinedInterfaceInfo& interface); + void OnSetAlternateInterfaceSetting(int interface_number, + int alternate_setting, + ResultCallback callback, + bool result); + void RegisterEndpoints(const mojom::UsbInterfaceInfo* interface, + const mojom::UsbAlternateInterfaceInfo& alternate); + void UnregisterEndpoints(const mojom::UsbAlternateInterfaceInfo& alternate); + void OnClearHalt(int interface_number, ResultCallback callback, bool result); void OpenInterfaceForControlTransfer( mojom::UsbControlTransferRecipient recipient, uint16_t index,
diff --git a/services/network/trust_tokens/test/trust_token_request_handler.cc b/services/network/trust_tokens/test/trust_token_request_handler.cc index 1b689ab1..7e25b38 100644 --- a/services/network/trust_tokens/test/trust_token_request_handler.cc +++ b/services/network/trust_tokens/test/trust_token_request_handler.cc
@@ -69,6 +69,10 @@ // Issue at most this many tokens per issuance. int batch_size; + // Expect that client-side signing operations succeeded or failed according to + // the value of this field. + SigningOutcome client_signing_outcome; + // Signed redemption record (SRR) signing and verification keys: std::vector<uint8_t> srr_signing; std::vector<uint8_t> srr_verification; @@ -194,19 +198,13 @@ return true; } -TrustTokenRequestHandler::TrustTokenRequestHandler(int num_keys, int batch_size) - : rep_(std::make_unique<Rep>()) { - rep_->batch_size = batch_size; - - rep_->srr_signing.resize(ED25519_PRIVATE_KEY_LEN); - rep_->srr_verification.resize(ED25519_PUBLIC_KEY_LEN); - ED25519_keypair(rep_->srr_verification.data(), rep_->srr_signing.data()); - - for (int i = 0; i < num_keys; ++i) { - rep_->issuance_keys.push_back(GenerateIssuanceKeyPair(i)); - } +TrustTokenRequestHandler::TrustTokenRequestHandler(Options options) { + UpdateOptions(std::move(options)); } +TrustTokenRequestHandler::TrustTokenRequestHandler() + : TrustTokenRequestHandler(Options()) {} + TrustTokenRequestHandler::~TrustTokenRequestHandler() = default; std::string TrustTokenRequestHandler::GetKeyCommitmentRecord() const { @@ -335,33 +333,38 @@ base::AutoLock lock(mutex_); - std::string verification_key; - - if (!ReconstructSigningDataAndVerifySignature(destination, headers, - /*verifier=*/{}, error_out, - &verification_key)) { - return false; - } - - if (!base::Contains(rep_->hashes_of_redemption_bound_key_pairs, - crypto::SHA256HashString(verification_key))) { - if (error_out) { - *error_out = - "Got a request signed with a verification key whose hash was not " - "previously bound to a redemption request."; - } - return false; - } - std::string sec_signed_redemption_record_header; if (!headers.GetHeader(kTrustTokensRequestHeaderSecSignedRedemptionRecord, &sec_signed_redemption_record_header)) { - if (error_out) - *error_out = "Request missing its SRR header"; + *error_out = "Request missing its SRR header"; return false; } + // If there was a client-side failure, expect an empty SRR header and no other + // Trust Tokens headers. + if (rep_->client_signing_outcome == SigningOutcome::kFailure) { + if (!sec_signed_redemption_record_header.empty()) { + *error_out = "Client-side failure but nonempty SRR header: " + + sec_signed_redemption_record_header; + return false; + } + if (headers.HasHeader(kTrustTokensRequestHeaderSecSignature)) { + *error_out = "Client-side failure but received Sec-Signature header"; + return false; + } + if (headers.HasHeader(kTrustTokensRequestHeaderSecTime)) { + *error_out = "Client-side failure but received Sec-Time header"; + return false; + } + if (headers.HasHeader(kTrustTokensRequestHeaderSignedHeaders)) { + *error_out = "Client-side failure but received Signed-Headers header"; + return false; + } + return true; + } + DCHECK_EQ(rep_->client_signing_outcome, SigningOutcome::kSuccess); + std::string srr_body; switch (VerifyTrustTokenSignedRedemptionRecord( sec_signed_redemption_record_header, @@ -386,6 +389,24 @@ if (!ConfirmSrrBodyIntegrity(srr_body, error_out)) return false; // On failure, |ConfirmSrrBodyIntegrity| has set the error. + std::string verification_key; + + if (!ReconstructSigningDataAndVerifySignature(destination, headers, + /*verifier=*/{}, error_out, + &verification_key)) { + return false; + } + + if (!base::Contains(rep_->hashes_of_redemption_bound_key_pairs, + crypto::SHA256HashString(verification_key))) { + if (error_out) { + *error_out = + "Got a request signed with a verification key whose hash was not " + "previously bound to a redemption request."; + } + return false; + } + return true; } @@ -394,5 +415,22 @@ return rep_->last_verification_error; } +void TrustTokenRequestHandler::UpdateOptions(Options options) { + base::AutoLock lock(mutex_); + + rep_ = std::make_unique<Rep>(); + + rep_->batch_size = options.batch_size; + rep_->client_signing_outcome = options.client_signing_outcome; + + rep_->srr_signing.resize(ED25519_PRIVATE_KEY_LEN); + rep_->srr_verification.resize(ED25519_PUBLIC_KEY_LEN); + ED25519_keypair(rep_->srr_verification.data(), rep_->srr_signing.data()); + + for (int i = 0; i < options.num_keys; ++i) { + rep_->issuance_keys.push_back(GenerateIssuanceKeyPair(i)); + } +} + } // namespace test } // namespace network
diff --git a/services/network/trust_tokens/test/trust_token_request_handler.h b/services/network/trust_tokens/test/trust_token_request_handler.h index c89edb5..92a42c49 100644 --- a/services/network/trust_tokens/test/trust_token_request_handler.h +++ b/services/network/trust_tokens/test/trust_token_request_handler.h
@@ -25,20 +25,43 @@ // by net::EmbeddedTestServer handlers. class TrustTokenRequestHandler { public: - // Initializes server-side Trust Tokens logic by generating |num_keys| many - // issuance key pairs and a Signed Redemption Record (SRR) - // signing-and-verification key pair. - // - // If |batch_size| is provided, the issuer will be willing to issue at most - // that many tokens per issuance operation. - static constexpr int kDefaultIssuerBatchSize = 10; - explicit TrustTokenRequestHandler(int num_keys, - int batch_size = kDefaultIssuerBatchSize); + struct Options; // Definition below. + explicit TrustTokenRequestHandler(Options options); + + // The default constructor uses reasonable default options. + TrustTokenRequestHandler(); ~TrustTokenRequestHandler(); // TODO(davidvc): Provide a way to specify when keys expire. + // See |Options::client_signing_outcome| below. + enum class SigningOutcome { + // Expect a well-formed SRR and possibly a Sec-Signature header. + kSuccess, + // Expect an empty Sec-Signed-Redemption-Record header and no Sec-Signature + // header. + kFailure, + }; + + struct Options { + // The number of issuance key pairs to provide via key commitment results. + int num_keys = 1; + + // Specifies whether the client-side signing operation is expected to + // succeed. Unlike issuance and redemption, clients send signed requests + // even when the operation failures, but the outcome affects the shape of + // the expected request. + SigningOutcome client_signing_outcome = SigningOutcome::kSuccess; + + // The number of tokens to sign per issuance operation; this value is also + // provided to the client as part of key commitment results. + int batch_size = 10; + }; + + // Updates the handler's options, resetting its internal state. + void UpdateOptions(Options options); + // Returns a key commitment record suitable for inserting into a {issuer: // commitment} dictionary passed to the network service via // NetworkService::SetTrustTokenKeyCommitments. This comprises |num_keys| @@ -64,9 +87,17 @@ static const base::TimeDelta kSrrLifetime; base::Optional<std::string> Redeem(base::StringPiece redemption_request); - // Inspects |request| and returns true exactly when: + // Inspects |request| to see if its contents are the expected the result of a + // client-side signing operation. + // + // If the configured signing outcome (see Options) is kFailure, returns true + // exactly when the request contains an empty Sec-Signed-Redemption-Record + // header and no Sec-Signature header. + // + // If the configured signing outcome (see Options) is kSuccess, returns true + // exactly when: // - the request bears a well-formed Sec-Signature header with a valid - // signature over the request's canonical signing data; + // signature over the request's canonical signing data; and // - the signature's public key's hash was bound to a previous redemption // request; and // - the request contains a well-formed signed redemption record whose
diff --git a/services/network/trust_tokens/trust_token_request_signing_helper.cc b/services/network/trust_tokens/trust_token_request_signing_helper.cc index fb4b900..682b698 100644 --- a/services/network/trust_tokens/trust_token_request_signing_helper.cc +++ b/services/network/trust_tokens/trust_token_request_signing_helper.cc
@@ -231,6 +231,26 @@ DCHECK(!request->initiator() || IsOriginPotentiallyTrustworthy(*request->initiator())) << *request->initiator(); +#if DCHECK_IS_ON() + // Add some postcondition checking on return. + done = base::BindOnce( + [](net::URLRequest* request, + base::OnceCallback<void(mojom::TrustTokenOperationStatus)> done, + mojom::TrustTokenOperationStatus result) { + const auto& headers = request->extra_request_headers(); + + std::string srr_header; + DCHECK(headers.GetHeader( + kTrustTokensRequestHeaderSecSignedRedemptionRecord, &srr_header)); + if (srr_header.empty()) { + DCHECK(!headers.HasHeader(kTrustTokensRequestHeaderSecTime)); + DCHECK(!headers.HasHeader(kTrustTokensRequestHeaderSecSignature)); + DCHECK(!headers.HasHeader(kTrustTokensRequestHeaderSignedHeaders)); + } + std::move(done).Run(result); + }, + request, std::move(done)); +#endif // DCHECK_IS_ON() // This class is responsible for adding these headers; callers should not add // them. @@ -244,6 +264,9 @@ net_log_.BeginEvent( net::NetLogEventType::TRUST_TOKEN_OPERATION_BEGIN_SIGNING); + // The comments below are the steps in the "Redemption record attachment and + // request signing" pseudocode in https://bit.ly/trust-token-dd + base::Optional<SignedTrustTokenRedemptionRecord> maybe_redemption_record = token_store_->RetrieveNonstaleRedemptionRecord(params_.issuer, params_.toplevel); @@ -252,7 +275,7 @@ AttachSignedRedemptionRecordHeader(request, std::string()); LogOutcome(net_log_, "No SRR for this (issuer, top-level context) pair"); - std::move(done).Run(mojom::TrustTokenOperationStatus::kResourceExhausted); + std::move(done).Run(mojom::TrustTokenOperationStatus::kOk); return; } @@ -266,7 +289,7 @@ LogOutcome(net_log_, "Unsignable header specified in Signed-Headers " "header or additionalSignedHeaders arg"); - std::move(done).Run(mojom::TrustTokenOperationStatus::kInvalidArgument); + std::move(done).Run(mojom::TrustTokenOperationStatus::kOk); return; } @@ -293,7 +316,7 @@ request->RemoveRequestHeaderByName(kTrustTokensRequestHeaderSignedHeaders); LogOutcome(net_log_, "Internal error generating signature"); - std::move(done).Run(mojom::TrustTokenOperationStatus::kInternalError); + std::move(done).Run(mojom::TrustTokenOperationStatus::kOk); return; } @@ -304,8 +327,12 @@ // Error serializing the header. Not expected. if (!maybe_signature_header) { + AttachSignedRedemptionRecordHeader(request, std::string()); + request->RemoveRequestHeaderByName(kTrustTokensRequestHeaderSecTime); + request->RemoveRequestHeaderByName(kTrustTokensRequestHeaderSignedHeaders); + LogOutcome(net_log_, "Internal error serializing signature header"); - std::move(done).Run(mojom::TrustTokenOperationStatus::kInternalError); + std::move(done).Run(mojom::TrustTokenOperationStatus::kOk); return; }
diff --git a/services/network/trust_tokens/trust_token_request_signing_helper.h b/services/network/trust_tokens/trust_token_request_signing_helper.h index d8319769..0520b20d 100644 --- a/services/network/trust_tokens/trust_token_request_signing_helper.h +++ b/services/network/trust_tokens/trust_token_request_signing_helper.h
@@ -106,7 +106,7 @@ // |additional_headers_to_sign| is a list of headers to sign, in addition to // those specified by the request's Signed-Headers header. If these are not // case-insensitive versions of headers in the |kSignableRequestHeaders| - // allowlist, signing will fail with error kInvalidArgument. + // allowlist, signing will fail. std::vector<std::string> additional_headers_to_sign; // If |should_add_timestamp| is true, successful signing operations will add @@ -163,23 +163,6 @@ // Attempts to attach a Signed Redemption Record (SRR) corresponding // to |request|'s initiating top-level origin and the provided issuer origin. // - // PRECONDITIONS: - // (0. |request|'s destination's origin and its initiator must satisfy the - // same conditions as the issuer origin in |params_|. This is DCHECKed, since - // it is not a protocol-level precondition.) - // - // 1. If the request already contains a Sec-Signed-Redemption-Record, - // Sec-Time, or Sec-Signature header, returns kInvalidArgument without - // touching the request. - // 2. If the caller specified headers for signing other than those in - // kSignableRequestHeaders (or if the request has a malformed or otherwise - // invalid signed issuers list in its Signed-Headers header), returns - // kInvalidArgument and attaches an empty Sec-Signed-Redemption-Record header - // to the request. - // 3. If |token_store_| contains no SRR for this issuer-toplevel pair, - // returns kResourceExhausted and attaches an empty - // Sec-Signed-Redemption-Record header. - // // ATTACHING THE REDEMPTION RECORD: // In the case that an SRR is found and the requested headers to sign are // well-formed, attaches a Sec-Signed-Redemption-Record header @@ -188,15 +171,23 @@ // adds a timestamp header; // 2. if the request is configured for signing, computes the request's // canonical request data and adds a signature header, following the algorithm - // in the explainer: - // https://github.com/WICG/trust-token-api#extension-trust-bound-keypair-and-request-signing + // in the Trust Tokens design doc's "Signing outgoing requests" section. // - // RETURNS: - // - On success, returns kOk. - // - On internal error during signing, returns kInternalError and attaches an - // empty SRR header, no signature header, and no timestamp header. - // - On precondition failure, returns an error code and possibly attaches an - // empty SRR header; see PRECONDITIONS section above. + // FAILS IF: + // 1. The caller specified headers for signing other than those in + // kSignableRequestHeaders (or if the request has a malformed or otherwise + // invalid signed issuers list in its Signed-Headers header); or + // 2. |token_store_| contains no SRR for this issuer-toplevel pair, + // returns kOk and attaches an empty Sec-Signed-Redemption-Record header; or + // 3. an internal error occurs during signing or header serialization. + // + // POSTCONDITIONS: + // - Always returns kOk. This is to avoid aborting a request entirely to a + // failure during signing; see the Trust Tokens design doc for more + // discussion. + // - On failure, the request will contain an empty + // Sec-Signed-Redemption-Record header and no Sec-Time, Sec-Signature, or + // Signed-Headers headers. void Begin( net::URLRequest* request, base::OnceCallback<void(mojom::TrustTokenOperationStatus)> done) override; @@ -209,10 +200,10 @@ private: // Given (unencoded) bytestrings |public_key| and |signature|, returns the - // Trust Tokens signature header, a serialized Structured Headers Draft 13 + // Trust Tokens signature header, a serialized Structured Headers Draft 15 // dictionary looking roughly like (order not guaranteed): - // public-key=<pk>, - // sig=<signature>, + // public-key=:<base64(pk)>:, + // sig=:<base64(signature)>:, // sign-request-data=include | headers-only // // Returns nullopt on serialization error. @@ -229,10 +220,6 @@ TrustTokenStore* token_store_; - // Temporary representation of the signing-related Fetch parameters until - // they're implemented. - // TODO(crbug.com/1043118): When integrating this with URLLoader/the signing - // helper factory, update Params's fields, or perhaps remove the struct. Params params_; std::unique_ptr<Signer> signer_;
diff --git a/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc b/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc index 62ee9f5..09f2b070 100644 --- a/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc +++ b/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc
@@ -198,7 +198,9 @@ mojom::TrustTokenOperationStatus result = ExecuteBeginOperationAndWaitForResult(&helper, my_request.get()); - EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kResourceExhausted); + // In failure cases, the signing helper should return kOk but attach an empty + // SRR header. + EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kOk); EXPECT_THAT(*my_request, Header("Sec-Signed-Redemption-Record", IsEmpty())); EXPECT_THAT(*my_request, Not(Header("Sec-Signature"))); } @@ -218,6 +220,7 @@ SignedTrustTokenRedemptionRecord my_record; my_record.set_public_key("key"); + my_record.set_body("SRR body"); store->SetRedemptionRecord(params.issuer, params.toplevel, my_record); TrustTokenRequestSigningHelper helper( @@ -281,7 +284,10 @@ mojom::TrustTokenOperationStatus result = ExecuteBeginOperationAndWaitForResult(&helper, my_request.get()); - EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kInvalidArgument); + // In failure cases, the signing helper should return kOk but attach an empty + // SRR header. + EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kOk); + EXPECT_THAT(*my_request, Header("Sec-Signed-Redemption-Record", IsEmpty())); EXPECT_THAT(*my_request, Not(Header("Signed-Headers"))); } @@ -316,7 +322,8 @@ mojom::TrustTokenOperationStatus result = ExecuteBeginOperationAndWaitForResult(&helper, my_request.get()); - EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kInvalidArgument); + EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kOk); + EXPECT_THAT(*my_request, Header("Sec-Signed-Redemption-Record", IsEmpty())); EXPECT_THAT(*my_request, Not(Header("Signed-Headers"))); } @@ -340,6 +347,7 @@ SignedTrustTokenRedemptionRecord my_record; my_record.set_public_key("key"); + my_record.set_body("look at me, I'm an SRR body"); store->SetRedemptionRecord(params.issuer, params.toplevel, my_record); TrustTokenRequestSigningHelper helper( @@ -400,6 +408,7 @@ SignedTrustTokenRedemptionRecord my_record; my_record.set_public_key("key"); + my_record.set_body("look at me, I'm an SRR body"); store->SetRedemptionRecord(params.issuer, params.toplevel, my_record); // Giving an IdentitySigner to |helper| will mean that |helper| should provide @@ -577,7 +586,7 @@ mojom::TrustTokenOperationStatus result = ExecuteBeginOperationAndWaitForResult(&helper, my_request.get()); - EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kInternalError); + EXPECT_EQ(result, mojom::TrustTokenOperationStatus::kOk); EXPECT_THAT(*my_request, Not(Header("Signed-Headers"))); EXPECT_THAT(*my_request, Not(Header("Sec-Time"))); EXPECT_THAT(*my_request, Not(Header("Sec-Signature")));
diff --git a/services/tracing/public/cpp/trace_event_args_whitelist.cc b/services/tracing/public/cpp/trace_event_args_whitelist.cc index 8ef4b633..7e5af23 100644 --- a/services/tracing/public/cpp/trace_event_args_whitelist.cc +++ b/services/tracing/public/cpp/trace_event_args_whitelist.cc
@@ -33,8 +33,8 @@ const char* const kGetFallbackFontsAllowedArgs[] = {"script", nullptr}; const char* const kGPUAllowedArgs[] = {nullptr}; const char* const kInputLatencyAllowedArgs[] = {"data", nullptr}; -const char* const kMemoryDumpAllowedArgs[] = {"dumps", "top_queued_message_tag", - "count", nullptr}; +const char* const kMemoryDumpAllowedArgs[] = { + "count", "dumps", "function", "top_queued_message_tag", nullptr}; const char* const kRendererHostAllowedArgs[] = { "class", "line", "should_background", "has_pending_views", "bytes_allocated", nullptr};
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc index 983a2bc3..08befd3 100644 --- a/skia/ext/benchmarking_canvas.cc +++ b/skia/ext/benchmarking_canvas.cc
@@ -290,7 +290,7 @@ "gPtOffsetPerVerb size mismatch"); std::unique_ptr<base::ListValue> verbs_val(new base::ListValue()); - SkPath::Iter iter(const_cast<SkPath&>(path), false); + SkPath::RawIter iter(const_cast<SkPath&>(path)); SkPoint points[4]; for (SkPath::Verb verb = iter.next(points); verb != SkPath::kDone_Verb;
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 6315163..1b70d9c 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -6471,6 +6471,27 @@ "enable_features": [ "WebAssemblyBaseline", "WebAssemblyTiering" + ], + "disable_features": [ + "WebAssemblyLazyCompilation" + ] + }, + { + "name": "LazyLiftoff", + "enable_features": [ + "WebAssemblyBaseline", + "WebAssemblyLazyCompilation" + ], + "disable_features": [ + "WebAssemblyTiering" + ] + }, + { + "name": "LazyTiering", + "enable_features": [ + "WebAssemblyBaseline", + "WebAssemblyLazyCompilation", + "WebAssemblyTiering" ] }, { @@ -6479,6 +6500,7 @@ "WebAssemblyBaseline" ], "disable_features": [ + "WebAssemblyLazyCompilation", "WebAssemblyTiering" ] }, @@ -6488,7 +6510,8 @@ "WebAssemblyTiering" ], "disable_features": [ - "WebAssemblyBaseline" + "WebAssemblyBaseline", + "WebAssemblyLazyCompilation" ] } ]
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn index 91950cb15..e5be52ba 100644 --- a/third_party/android_deps/BUILD.gn +++ b/third_party/android_deps/BUILD.gn
@@ -125,18 +125,17 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_appcompat_appcompat_java") { - aar_path = "libs/androidx_appcompat_appcompat/appcompat-1.0.0.aar" + aar_path = "libs/androidx_appcompat_appcompat/appcompat-1.2.0-beta01.aar" info_path = "libs/androidx_appcompat_appcompat/androidx_appcompat_appcompat.info" deps = [ ":androidx_annotation_annotation_java", + ":androidx_appcompat_appcompat_resources_java", ":androidx_collection_collection_java", ":androidx_core_core_java", ":androidx_cursoradapter_cursoradapter_java", + ":androidx_drawerlayout_drawerlayout_java", ":androidx_fragment_fragment_java", - ":androidx_legacy_legacy_support_core_utils_java", - ":androidx_vectordrawable_vectordrawable_animated_java", - ":androidx_vectordrawable_vectordrawable_java", ] skip_jetify = true } @@ -162,7 +161,7 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. java_prebuilt("androidx_collection_collection_java") { - jar_path = "libs/androidx_collection_collection/collection-1.0.0.jar" + jar_path = "libs/androidx_collection_collection/collection-1.1.0.jar" output_name = "androidx_collection_collection" supports_android = true deps = [ ":androidx_annotation_annotation_java" ] @@ -199,7 +198,7 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_core_core_java") { - aar_path = "libs/androidx_core_core/core-1.0.0.aar" + aar_path = "libs/androidx_core_core/core-1.3.0-beta01.aar" info_path = "libs/androidx_core_core/androidx_core_core.info" deps = [ ":androidx_annotation_annotation_java", @@ -247,15 +246,16 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_fragment_fragment_java") { - aar_path = "libs/androidx_fragment_fragment/fragment-1.0.0.aar" + aar_path = "libs/androidx_fragment_fragment/fragment-1.1.0.aar" info_path = "libs/androidx_fragment_fragment/androidx_fragment_fragment.info" deps = [ + ":androidx_activity_activity_java", ":androidx_annotation_annotation_java", + ":androidx_collection_collection_java", ":androidx_core_core_java", - ":androidx_legacy_legacy_support_core_ui_java", - ":androidx_legacy_legacy_support_core_utils_java", ":androidx_lifecycle_lifecycle_viewmodel_java", ":androidx_loader_loader_java", + ":androidx_viewpager_viewpager_java", ] skip_jetify = true } @@ -359,7 +359,7 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. java_prebuilt("androidx_lifecycle_lifecycle_common_java") { jar_path = - "libs/androidx_lifecycle_lifecycle_common/lifecycle-common-2.0.0.jar" + "libs/androidx_lifecycle_lifecycle_common/lifecycle-common-2.1.0.jar" output_name = "androidx_lifecycle_lifecycle_common" supports_android = true deps = [ ":androidx_annotation_annotation_java" ] @@ -381,7 +381,7 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_lifecycle_lifecycle_runtime_java") { aar_path = - "libs/androidx_lifecycle_lifecycle_runtime/lifecycle-runtime-2.0.0.aar" + "libs/androidx_lifecycle_lifecycle_runtime/lifecycle-runtime-2.1.0.aar" info_path = "libs/androidx_lifecycle_lifecycle_runtime/androidx_lifecycle_lifecycle_runtime.info" deps = [ ":androidx_annotation_annotation_java", @@ -396,7 +396,7 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_lifecycle_lifecycle_viewmodel_java") { - aar_path = "libs/androidx_lifecycle_lifecycle_viewmodel/lifecycle-viewmodel-2.0.0.aar" + aar_path = "libs/androidx_lifecycle_lifecycle_viewmodel/lifecycle-viewmodel-2.1.0.aar" info_path = "libs/androidx_lifecycle_lifecycle_viewmodel/androidx_lifecycle_lifecycle_viewmodel.info" deps = [ ":androidx_annotation_annotation_java" ] skip_jetify = true @@ -582,10 +582,11 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_vectordrawable_vectordrawable_java") { aar_path = - "libs/androidx_vectordrawable_vectordrawable/vectordrawable-1.0.0.aar" + "libs/androidx_vectordrawable_vectordrawable/vectordrawable-1.1.0.aar" info_path = "libs/androidx_vectordrawable_vectordrawable/androidx_vectordrawable_vectordrawable.info" deps = [ ":androidx_annotation_annotation_java", + ":androidx_collection_collection_java", ":androidx_core_core_java", ] skip_jetify = true @@ -594,10 +595,11 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_vectordrawable_vectordrawable_animated_java") { - aar_path = "libs/androidx_vectordrawable_vectordrawable_animated/vectordrawable-animated-1.0.0.aar" + aar_path = "libs/androidx_vectordrawable_vectordrawable_animated/vectordrawable-animated-1.1.0.aar" info_path = "libs/androidx_vectordrawable_vectordrawable_animated/androidx_vectordrawable_vectordrawable_animated.info" deps = [ - ":androidx_legacy_legacy_support_core_ui_java", + ":androidx_collection_collection_java", + ":androidx_interpolator_interpolator_java", ":androidx_vectordrawable_vectordrawable_java", ] skip_jetify = true @@ -1523,8 +1525,44 @@ } # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. +android_aar_prebuilt("androidx_activity_activity_java") { + aar_path = "libs/androidx_activity_activity/activity-1.0.0.aar" + info_path = "libs/androidx_activity_activity/androidx_activity_activity.info" + + # To remove visibility constraint, add this dependency to + # //third_party/android_deps/build.gradle. + visibility = [ ":*" ] + deps = [ + ":androidx_annotation_annotation_java", + ":androidx_core_core_java", + ":androidx_lifecycle_lifecycle_runtime_java", + ":androidx_lifecycle_lifecycle_viewmodel_java", + ":androidx_savedstate_savedstate_java", + ] + skip_jetify = true +} + +# This is generated, do not edit. Update BuildConfigGenerator.groovy instead. +android_aar_prebuilt("androidx_appcompat_appcompat_resources_java") { + aar_path = "libs/androidx_appcompat_appcompat_resources/appcompat-resources-1.2.0-beta01.aar" + info_path = "libs/androidx_appcompat_appcompat_resources/androidx_appcompat_appcompat_resources.info" + + # To remove visibility constraint, add this dependency to + # //third_party/android_deps/build.gradle. + visibility = [ ":*" ] + deps = [ + ":androidx_annotation_annotation_java", + ":androidx_collection_collection_java", + ":androidx_core_core_java", + ":androidx_vectordrawable_vectordrawable_animated_java", + ":androidx_vectordrawable_vectordrawable_java", + ] + skip_jetify = true +} + +# This is generated, do not edit. Update BuildConfigGenerator.groovy instead. java_prebuilt("androidx_arch_core_core_common_java") { - jar_path = "libs/androidx_arch_core_core_common/core-common-2.0.0.jar" + jar_path = "libs/androidx_arch_core_core_common/core-common-2.1.0.jar" output_name = "androidx_arch_core_core_common" supports_android = true @@ -1701,6 +1739,23 @@ } # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. +android_aar_prebuilt("androidx_savedstate_savedstate_java") { + aar_path = "libs/androidx_savedstate_savedstate/savedstate-1.0.0.aar" + info_path = + "libs/androidx_savedstate_savedstate/androidx_savedstate_savedstate.info" + + # To remove visibility constraint, add this dependency to + # //third_party/android_deps/build.gradle. + visibility = [ ":*" ] + deps = [ + ":androidx_annotation_annotation_java", + ":androidx_arch_core_core_common_java", + ":androidx_lifecycle_lifecycle_common_java", + ] + skip_jetify = true +} + +# This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_slidingpanelayout_slidingpanelayout_java") { aar_path = "libs/androidx_slidingpanelayout_slidingpanelayout/slidingpanelayout-1.0.0.aar" info_path = "libs/androidx_slidingpanelayout_slidingpanelayout/androidx_slidingpanelayout_slidingpanelayout.info" @@ -1747,7 +1802,7 @@ # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. android_aar_prebuilt("androidx_versionedparcelable_versionedparcelable_java") { - aar_path = "libs/androidx_versionedparcelable_versionedparcelable/versionedparcelable-1.0.0.aar" + aar_path = "libs/androidx_versionedparcelable_versionedparcelable/versionedparcelable-1.1.0.aar" info_path = "libs/androidx_versionedparcelable_versionedparcelable/androidx_versionedparcelable_versionedparcelable.info" # To remove visibility constraint, add this dependency to
diff --git a/third_party/android_deps/additional_readme_paths.json b/third_party/android_deps/additional_readme_paths.json index 01626aa3..206d3e8 100644 --- a/third_party/android_deps/additional_readme_paths.json +++ b/third_party/android_deps/additional_readme_paths.json
@@ -7,8 +7,10 @@ "libs/android_arch_lifecycle_livedata_core", "libs/android_arch_lifecycle_runtime", "libs/android_arch_lifecycle_viewmodel", + "libs/androidx_activity_activity", "libs/androidx_annotation_annotation", "libs/androidx_appcompat_appcompat", + "libs/androidx_appcompat_appcompat_resources", "libs/androidx_arch_core_core_common", "libs/androidx_arch_core_core_runtime", "libs/androidx_asynclayoutinflater_asynclayoutinflater", @@ -46,6 +48,7 @@ "libs/androidx_preference_preference", "libs/androidx_print_print", "libs/androidx_recyclerview_recyclerview", + "libs/androidx_savedstate_savedstate", "libs/androidx_slidingpanelayout_slidingpanelayout", "libs/androidx_swiperefreshlayout_swiperefreshlayout", "libs/androidx_test_core",
diff --git a/third_party/android_deps/build.gradle b/third_party/android_deps/build.gradle index 56ed678..d53e17d 100644 --- a/third_party/android_deps/build.gradle +++ b/third_party/android_deps/build.gradle
@@ -29,7 +29,7 @@ compile "androidx.legacy:legacy-support-v13:${androidXSupportLibVersion}" compile "androidx.annotation:annotation:${androidXSupportLibVersion}" - compile "androidx.appcompat:appcompat:${androidXSupportLibVersion}" + compile "androidx.appcompat:appcompat:1.2.0-beta01" compile "androidx.asynclayoutinflater:asynclayoutinflater:${androidXSupportLibVersion}" compile "androidx.cardview:cardview:${androidXSupportLibVersion}" compile "androidx.concurrent:concurrent-futures:${androidXSupportLibVersion}"
diff --git a/third_party/android_deps/libs/androidx_activity_activity/LICENSE b/third_party/android_deps/libs/androidx_activity_activity/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/third_party/android_deps/libs/androidx_activity_activity/LICENSE
@@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.
diff --git a/third_party/android_deps/libs/androidx_activity_activity/OWNERS b/third_party/android_deps/libs/androidx_activity_activity/OWNERS new file mode 100644 index 0000000..7b571d97 --- /dev/null +++ b/third_party/android_deps/libs/androidx_activity_activity/OWNERS
@@ -0,0 +1 @@ +file://third_party/android_deps/OWNERS \ No newline at end of file
diff --git a/third_party/android_deps/libs/androidx_activity_activity/README.chromium b/third_party/android_deps/libs/androidx_activity_activity/README.chromium new file mode 100644 index 0000000..6e443d5 --- /dev/null +++ b/third_party/android_deps/libs/androidx_activity_activity/README.chromium
@@ -0,0 +1,13 @@ +Name: Activity +Short Name: activity +URL: https://developer.android.com/jetpack/androidx +Version: 1.0.0 +License: Apache Version 2.0 +License File: LICENSE +Security Critical: yes + +Description: +Provides the base Activity subclass and the relevant hooks to build a composable structure on top. + +Local Modifications: +No modifications.
diff --git a/third_party/android_deps/libs/androidx_activity_activity/androidx_activity_activity.info b/third_party/android_deps/libs/androidx_activity_activity/androidx_activity_activity.info new file mode 100644 index 0000000..cd54060 --- /dev/null +++ b/third_party/android_deps/libs/androidx_activity_activity/androidx_activity_activity.info
@@ -0,0 +1,13 @@ +# Generated by //build/android/gyp/aar.py +# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". + +aidl = [ ] +assets = [ ] +has_classes_jar = true +has_native_libraries = false +has_proguard_flags = false +has_r_text_file = true +is_manifest_empty = true +resources = [ ] +subjar_tuples = [ ] +subjars = [ ]
diff --git a/third_party/android_deps/libs/androidx_activity_activity/cipd.yaml b/third_party/android_deps/libs/androidx_activity_activity/cipd.yaml new file mode 100644 index 0000000..60dd3d37 --- /dev/null +++ b/third_party/android_deps/libs/androidx_activity_activity/cipd.yaml
@@ -0,0 +1,10 @@ +# Copyright 2018 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. + +# To create CIPD package run the following command. +# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +package: chromium/third_party/android_deps/libs/androidx_activity_activity +description: "Activity" +data: +- file: activity-1.0.0.aar
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat/README.chromium b/third_party/android_deps/libs/androidx_appcompat_appcompat/README.chromium index aa3068a..e75aff78 100644 --- a/third_party/android_deps/libs/androidx_appcompat_appcompat/README.chromium +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat/README.chromium
@@ -1,7 +1,7 @@ Name: Android AppCompat Library v7 Short Name: appcompat -URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +URL: https://developer.android.com/jetpack/androidx +Version: 1.2.0-beta01 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat/androidx_appcompat_appcompat.info b/third_party/android_deps/libs/androidx_appcompat_appcompat/androidx_appcompat_appcompat.info index 6f5ede0..80c30c0c 100644 --- a/third_party/android_deps/libs/androidx_appcompat_appcompat/androidx_appcompat_appcompat.info +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat/androidx_appcompat_appcompat.info
@@ -8,6 +8,6 @@ has_proguard_flags = true has_r_text_file = true is_manifest_empty = true -resources = [ "res/anim/abc_fade_in.xml", "res/anim/abc_fade_out.xml", "res/anim/abc_grow_fade_in_from_bottom.xml", "res/anim/abc_popup_enter.xml", "res/anim/abc_popup_exit.xml", "res/anim/abc_shrink_fade_out_from_bottom.xml", "res/anim/abc_slide_in_bottom.xml", "res/anim/abc_slide_in_top.xml", "res/anim/abc_slide_out_bottom.xml", "res/anim/abc_slide_out_top.xml", "res/anim/abc_tooltip_enter.xml", "res/anim/abc_tooltip_exit.xml", "res/color/abc_background_cache_hint_selector_material_dark.xml", "res/color/abc_background_cache_hint_selector_material_light.xml", "res/color/abc_btn_colored_borderless_text_material.xml", "res/color/abc_btn_colored_text_material.xml", "res/color/abc_hint_foreground_material_dark.xml", "res/color/abc_hint_foreground_material_light.xml", "res/color/abc_primary_text_disable_only_material_dark.xml", "res/color/abc_primary_text_disable_only_material_light.xml", "res/color/abc_primary_text_material_dark.xml", "res/color/abc_primary_text_material_light.xml", "res/color/abc_search_url_text.xml", "res/color/abc_secondary_text_material_dark.xml", "res/color/abc_secondary_text_material_light.xml", "res/color/abc_tint_btn_checkable.xml", "res/color/abc_tint_default.xml", "res/color/abc_tint_edittext.xml", "res/color/abc_tint_seek_thumb.xml", "res/color/abc_tint_spinner.xml", "res/color/abc_tint_switch_track.xml", "res/color/switch_thumb_material_dark.xml", "res/color/switch_thumb_material_light.xml", "res/color-v21/abc_btn_colored_borderless_text_material.xml", "res/color-v23/abc_btn_colored_borderless_text_material.xml", "res/color-v23/abc_btn_colored_text_material.xml", "res/color-v23/abc_color_highlight_material.xml", "res/color-v23/abc_tint_btn_checkable.xml", "res/color-v23/abc_tint_default.xml", "res/color-v23/abc_tint_edittext.xml", "res/color-v23/abc_tint_seek_thumb.xml", "res/color-v23/abc_tint_spinner.xml", "res/color-v23/abc_tint_switch_track.xml", "res/drawable/abc_btn_borderless_material.xml", "res/drawable/abc_btn_check_material.xml", "res/drawable/abc_btn_colored_material.xml", "res/drawable/abc_btn_default_mtrl_shape.xml", "res/drawable/abc_btn_radio_material.xml", "res/drawable/abc_cab_background_internal_bg.xml", "res/drawable/abc_cab_background_top_material.xml", "res/drawable/abc_dialog_material_background.xml", "res/drawable/abc_edit_text_material.xml", "res/drawable/abc_ic_ab_back_material.xml", "res/drawable/abc_ic_arrow_drop_right_black_24dp.xml", "res/drawable/abc_ic_clear_material.xml", "res/drawable/abc_ic_go_search_api_material.xml", "res/drawable/abc_ic_menu_overflow_material.xml", "res/drawable/abc_ic_search_api_material.xml", "res/drawable/abc_ic_voice_search_api_material.xml", "res/drawable/abc_item_background_holo_dark.xml", "res/drawable/abc_item_background_holo_light.xml", "res/drawable/abc_list_divider_material.xml", "res/drawable/abc_list_selector_background_transition_holo_dark.xml", "res/drawable/abc_list_selector_background_transition_holo_light.xml", "res/drawable/abc_list_selector_holo_dark.xml", "res/drawable/abc_list_selector_holo_light.xml", "res/drawable/abc_ratingbar_indicator_material.xml", "res/drawable/abc_ratingbar_material.xml", "res/drawable/abc_ratingbar_small_material.xml", "res/drawable/abc_seekbar_thumb_material.xml", "res/drawable/abc_seekbar_tick_mark_material.xml", "res/drawable/abc_seekbar_track_material.xml", "res/drawable/abc_spinner_textfield_background_material.xml", "res/drawable/abc_switch_thumb_material.xml", "res/drawable/abc_tab_indicator_material.xml", "res/drawable/abc_text_cursor_material.xml", "res/drawable/abc_textfield_search_material.xml", "res/drawable/abc_vector_test.xml", "res/drawable/tooltip_frame_dark.xml", "res/drawable/tooltip_frame_light.xml", "res/drawable-hdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-hdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-hdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-hdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-hdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-hdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-hdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-hdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_list_focused_holo.9.png", "res/drawable-hdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-hdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-hdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-hdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-hdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-hdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-hdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-hdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-hdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-hdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-hdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-hdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-hdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-hdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-hdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-hdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-hdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-ldrtl-hdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-hdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-hdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-mdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-mdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-mdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xxhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xxhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-mdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-mdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-mdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-mdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-mdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-mdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_list_focused_holo.9.png", "res/drawable-mdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-mdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-mdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-mdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-mdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-mdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-mdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-mdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-mdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-mdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-mdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-mdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-mdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-mdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-mdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-mdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-mdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-v21/abc_action_bar_item_background_material.xml", "res/drawable-v21/abc_btn_colored_material.xml", "res/drawable-v21/abc_dialog_material_background.xml", "res/drawable-v21/abc_edit_text_material.xml", "res/drawable-v21/abc_list_divider_material.xml", "res/drawable-v23/abc_control_background_material.xml", "res/drawable-watch-v20/abc_dialog_material_background.xml", "res/drawable-xhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xhdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_list_focused_holo.9.png", "res/drawable-xhdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-xhdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-xhdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-xhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-xhdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-xhdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xhdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-xhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xxhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xxhdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_list_focused_holo.9.png", "res/drawable-xxhdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-xxhdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-xxhdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-xxhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-xxhdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xxhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xxhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xxxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/layout/abc_action_bar_title_item.xml", "res/layout/abc_action_bar_up_container.xml", "res/layout/abc_action_menu_item_layout.xml", "res/layout/abc_action_menu_layout.xml", "res/layout/abc_action_mode_bar.xml", "res/layout/abc_action_mode_close_item_material.xml", "res/layout/abc_activity_chooser_view.xml", "res/layout/abc_activity_chooser_view_list_item.xml", "res/layout/abc_alert_dialog_button_bar_material.xml", "res/layout/abc_alert_dialog_material.xml", "res/layout/abc_alert_dialog_title_material.xml", "res/layout/abc_cascading_menu_item_layout.xml", "res/layout/abc_dialog_title_material.xml", "res/layout/abc_expanded_menu_layout.xml", "res/layout/abc_list_menu_item_checkbox.xml", "res/layout/abc_list_menu_item_icon.xml", "res/layout/abc_list_menu_item_layout.xml", "res/layout/abc_list_menu_item_radio.xml", "res/layout/abc_popup_menu_header_item_layout.xml", "res/layout/abc_popup_menu_item_layout.xml", "res/layout/abc_screen_content_include.xml", "res/layout/abc_screen_simple.xml", "res/layout/abc_screen_simple_overlay_action_mode.xml", "res/layout/abc_screen_toolbar.xml", "res/layout/abc_search_dropdown_item_icons_2line.xml", "res/layout/abc_search_view.xml", "res/layout/abc_select_dialog_material.xml", "res/layout/abc_tooltip.xml", "res/layout/select_dialog_item_material.xml", "res/layout/select_dialog_multichoice_material.xml", "res/layout/select_dialog_singlechoice_material.xml", "res/layout/support_simple_spinner_dropdown_item.xml", "res/layout-v26/abc_screen_toolbar.xml", "res/layout-watch-v20/abc_alert_dialog_button_bar_material.xml", "res/layout-watch-v20/abc_alert_dialog_title_material.xml", "res/values/values.xml", "res/values-af/values-af.xml", "res/values-am/values-am.xml", "res/values-ar/values-ar.xml", "res/values-as/values-as.xml", "res/values-az/values-az.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-be/values-be.xml", "res/values-bg/values-bg.xml", "res/values-bn/values-bn.xml", "res/values-bs/values-bs.xml", "res/values-ca/values-ca.xml", "res/values-cs/values-cs.xml", "res/values-da/values-da.xml", "res/values-de/values-de.xml", "res/values-el/values-el.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-en-rCA/values-en-rCA.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-es/values-es.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-et/values-et.xml", "res/values-eu/values-eu.xml", "res/values-fa/values-fa.xml", "res/values-fi/values-fi.xml", "res/values-fr/values-fr.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gl/values-gl.xml", "res/values-gu/values-gu.xml", "res/values-h720dp-v13/values-h720dp-v13.xml", "res/values-hdpi-v4/values-hdpi-v4.xml", "res/values-hi/values-hi.xml", "res/values-hr/values-hr.xml", "res/values-hu/values-hu.xml", "res/values-hy/values-hy.xml", "res/values-in/values-in.xml", "res/values-is/values-is.xml", "res/values-it/values-it.xml", "res/values-iw/values-iw.xml", "res/values-ja/values-ja.xml", "res/values-ka/values-ka.xml", "res/values-kk/values-kk.xml", "res/values-km/values-km.xml", "res/values-kn/values-kn.xml", "res/values-ko/values-ko.xml", "res/values-ky/values-ky.xml", "res/values-land/values-land.xml", "res/values-large-v4/values-large-v4.xml", "res/values-ldltr-v21/values-ldltr-v21.xml", "res/values-lo/values-lo.xml", "res/values-lt/values-lt.xml", "res/values-lv/values-lv.xml", "res/values-mk/values-mk.xml", "res/values-ml/values-ml.xml", "res/values-mn/values-mn.xml", "res/values-mr/values-mr.xml", "res/values-ms/values-ms.xml", "res/values-my/values-my.xml", "res/values-nb/values-nb.xml", "res/values-ne/values-ne.xml", "res/values-night-v8/values-night-v8.xml", "res/values-nl/values-nl.xml", "res/values-or/values-or.xml", "res/values-pa/values-pa.xml", "res/values-pl/values-pl.xml", "res/values-port/values-port.xml", "res/values-pt/values-pt.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ro/values-ro.xml", "res/values-ru/values-ru.xml", "res/values-si/values-si.xml", "res/values-sk/values-sk.xml", "res/values-sl/values-sl.xml", "res/values-sq/values-sq.xml", "res/values-sr/values-sr.xml", "res/values-sv/values-sv.xml", "res/values-sw/values-sw.xml", "res/values-sw600dp-v13/values-sw600dp-v13.xml", "res/values-ta/values-ta.xml", "res/values-te/values-te.xml", "res/values-th/values-th.xml", "res/values-tl/values-tl.xml", "res/values-tr/values-tr.xml", "res/values-uk/values-uk.xml", "res/values-ur/values-ur.xml", "res/values-uz/values-uz.xml", "res/values-v16/values-v16.xml", "res/values-v17/values-v17.xml", "res/values-v18/values-v18.xml", "res/values-v21/values-v21.xml", "res/values-v22/values-v22.xml", "res/values-v23/values-v23.xml", "res/values-v24/values-v24.xml", "res/values-v25/values-v25.xml", "res/values-v26/values-v26.xml", "res/values-v28/values-v28.xml", "res/values-vi/values-vi.xml", "res/values-watch-v20/values-watch-v20.xml", "res/values-watch-v21/values-watch-v21.xml", "res/values-xlarge-v4/values-xlarge-v4.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-zu/values-zu.xml" ] +resources = [ "res/anim/abc_fade_in.xml", "res/anim/abc_fade_out.xml", "res/anim/abc_grow_fade_in_from_bottom.xml", "res/anim/abc_popup_enter.xml", "res/anim/abc_popup_exit.xml", "res/anim/abc_shrink_fade_out_from_bottom.xml", "res/anim/abc_slide_in_bottom.xml", "res/anim/abc_slide_in_top.xml", "res/anim/abc_slide_out_bottom.xml", "res/anim/abc_slide_out_top.xml", "res/anim/abc_tooltip_enter.xml", "res/anim/abc_tooltip_exit.xml", "res/anim/btn_checkbox_to_checked_box_inner_merged_animation.xml", "res/anim/btn_checkbox_to_checked_box_outer_merged_animation.xml", "res/anim/btn_checkbox_to_checked_icon_null_animation.xml", "res/anim/btn_checkbox_to_unchecked_box_inner_merged_animation.xml", "res/anim/btn_checkbox_to_unchecked_check_path_merged_animation.xml", "res/anim/btn_checkbox_to_unchecked_icon_null_animation.xml", "res/anim/btn_radio_to_off_mtrl_dot_group_animation.xml", "res/anim/btn_radio_to_off_mtrl_ring_outer_animation.xml", "res/anim/btn_radio_to_off_mtrl_ring_outer_path_animation.xml", "res/anim/btn_radio_to_on_mtrl_dot_group_animation.xml", "res/anim/btn_radio_to_on_mtrl_ring_outer_animation.xml", "res/anim/btn_radio_to_on_mtrl_ring_outer_path_animation.xml", "res/color/abc_background_cache_hint_selector_material_dark.xml", "res/color/abc_background_cache_hint_selector_material_light.xml", "res/color/abc_btn_colored_borderless_text_material.xml", "res/color/abc_btn_colored_text_material.xml", "res/color/abc_hint_foreground_material_dark.xml", "res/color/abc_hint_foreground_material_light.xml", "res/color/abc_primary_text_disable_only_material_dark.xml", "res/color/abc_primary_text_disable_only_material_light.xml", "res/color/abc_primary_text_material_dark.xml", "res/color/abc_primary_text_material_light.xml", "res/color/abc_search_url_text.xml", "res/color/abc_secondary_text_material_dark.xml", "res/color/abc_secondary_text_material_light.xml", "res/color/abc_tint_btn_checkable.xml", "res/color/abc_tint_default.xml", "res/color/abc_tint_edittext.xml", "res/color/abc_tint_seek_thumb.xml", "res/color/abc_tint_spinner.xml", "res/color/abc_tint_switch_track.xml", "res/color/switch_thumb_material_dark.xml", "res/color/switch_thumb_material_light.xml", "res/color-v21/abc_btn_colored_borderless_text_material.xml", "res/color-v23/abc_btn_colored_borderless_text_material.xml", "res/color-v23/abc_btn_colored_text_material.xml", "res/color-v23/abc_color_highlight_material.xml", "res/color-v23/abc_tint_btn_checkable.xml", "res/color-v23/abc_tint_default.xml", "res/color-v23/abc_tint_edittext.xml", "res/color-v23/abc_tint_seek_thumb.xml", "res/color-v23/abc_tint_spinner.xml", "res/color-v23/abc_tint_switch_track.xml", "res/drawable/abc_btn_borderless_material.xml", "res/drawable/abc_btn_check_material.xml", "res/drawable/abc_btn_check_material_anim.xml", "res/drawable/abc_btn_colored_material.xml", "res/drawable/abc_btn_default_mtrl_shape.xml", "res/drawable/abc_btn_radio_material.xml", "res/drawable/abc_btn_radio_material_anim.xml", "res/drawable/abc_cab_background_internal_bg.xml", "res/drawable/abc_cab_background_top_material.xml", "res/drawable/abc_dialog_material_background.xml", "res/drawable/abc_edit_text_material.xml", "res/drawable/abc_ic_ab_back_material.xml", "res/drawable/abc_ic_arrow_drop_right_black_24dp.xml", "res/drawable/abc_ic_clear_material.xml", "res/drawable/abc_ic_go_search_api_material.xml", "res/drawable/abc_ic_menu_overflow_material.xml", "res/drawable/abc_ic_search_api_material.xml", "res/drawable/abc_ic_voice_search_api_material.xml", "res/drawable/abc_item_background_holo_dark.xml", "res/drawable/abc_item_background_holo_light.xml", "res/drawable/abc_list_divider_material.xml", "res/drawable/abc_list_selector_background_transition_holo_dark.xml", "res/drawable/abc_list_selector_background_transition_holo_light.xml", "res/drawable/abc_list_selector_holo_dark.xml", "res/drawable/abc_list_selector_holo_light.xml", "res/drawable/abc_ratingbar_indicator_material.xml", "res/drawable/abc_ratingbar_material.xml", "res/drawable/abc_ratingbar_small_material.xml", "res/drawable/abc_seekbar_thumb_material.xml", "res/drawable/abc_seekbar_tick_mark_material.xml", "res/drawable/abc_seekbar_track_material.xml", "res/drawable/abc_spinner_textfield_background_material.xml", "res/drawable/abc_switch_thumb_material.xml", "res/drawable/abc_tab_indicator_material.xml", "res/drawable/abc_text_cursor_material.xml", "res/drawable/abc_textfield_search_material.xml", "res/drawable/btn_checkbox_checked_mtrl.xml", "res/drawable/btn_checkbox_checked_to_unchecked_mtrl_animation.xml", "res/drawable/btn_checkbox_unchecked_mtrl.xml", "res/drawable/btn_checkbox_unchecked_to_checked_mtrl_animation.xml", "res/drawable/btn_radio_off_mtrl.xml", "res/drawable/btn_radio_off_to_on_mtrl_animation.xml", "res/drawable/btn_radio_on_mtrl.xml", "res/drawable/btn_radio_on_to_off_mtrl_animation.xml", "res/drawable/tooltip_frame_dark.xml", "res/drawable/tooltip_frame_light.xml", "res/drawable-hdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-hdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-hdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-hdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-hdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-hdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-hdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-hdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-hdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_list_focused_holo.9.png", "res/drawable-hdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-hdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-hdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-hdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-hdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-hdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-hdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-hdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-hdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-hdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-hdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-hdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-hdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-hdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-hdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-hdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-hdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-hdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-hdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-ldrtl-hdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-hdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-hdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-mdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-mdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-mdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xxhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xxhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-ldrtl-xxxhdpi-v17/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-mdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-mdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-mdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-mdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-mdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-mdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-mdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-mdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-mdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_list_focused_holo.9.png", "res/drawable-mdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-mdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-mdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-mdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-mdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-mdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-mdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-mdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-mdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-mdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-mdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-mdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-mdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-mdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-mdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-mdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-mdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-mdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-mdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-v21/abc_action_bar_item_background_material.xml", "res/drawable-v21/abc_btn_colored_material.xml", "res/drawable-v21/abc_dialog_material_background.xml", "res/drawable-v21/abc_edit_text_material.xml", "res/drawable-v21/abc_list_divider_material.xml", "res/drawable-v23/abc_control_background_material.xml", "res/drawable-watch-v20/abc_dialog_material_background.xml", "res/drawable-xhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xhdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_list_focused_holo.9.png", "res/drawable-xhdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-xhdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-xhdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-xhdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-xhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-xhdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-xhdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-xhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xhdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-xhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-xhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xxhdpi-v4/abc_cab_background_top_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_ic_commit_search_api_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xxhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xxhdpi-v4/abc_list_divider_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_list_focused_holo.9.png", "res/drawable-xxhdpi-v4/abc_list_longpressed_holo.9.png", "res/drawable-xxhdpi-v4/abc_list_pressed_holo_dark.9.png", "res/drawable-xxhdpi-v4/abc_list_pressed_holo_light.9.png", "res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_dark.9.png", "res/drawable-xxhdpi-v4/abc_list_selector_disabled_holo_light.9.png", "res/drawable-xxhdpi-v4/abc_menu_hardkey_panel_mtrl_mult.9.png", "res/drawable-xxhdpi-v4/abc_popup_background_mtrl_mult.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_off_mtrl_alpha.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xxhdpi-v4/abc_scrubber_primary_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_scrubber_track_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xxhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_middle_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_middle_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xxhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/drawable-xxhdpi-v4/abc_textfield_activated_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_default_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_search_activated_mtrl_alpha.9.png", "res/drawable-xxhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_btn_check_to_on_mtrl_015.png", "res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_btn_radio_to_on_mtrl_015.png", "res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png", "res/drawable-xxxhdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_copy_mtrl_am_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_cut_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_paste_mtrl_am_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_selectall_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_menu_share_mtrl_alpha.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_16dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_36dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_black_48dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_16dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_36dp.png", "res/drawable-xxxhdpi-v4/abc_ic_star_half_black_48dp.png", "res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_000.png", "res/drawable-xxxhdpi-v4/abc_scrubber_control_to_pressed_mtrl_005.png", "res/drawable-xxxhdpi-v4/abc_spinner_mtrl_am_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_switch_track_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_tab_indicator_mtrl_alpha.9.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_left_mtrl_dark.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_left_mtrl_light.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl_dark.png", "res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl_light.png", "res/interpolator/btn_checkbox_checked_mtrl_animation_interpolator_0.xml", "res/interpolator/btn_checkbox_checked_mtrl_animation_interpolator_1.xml", "res/interpolator/btn_checkbox_unchecked_mtrl_animation_interpolator_0.xml", "res/interpolator/btn_checkbox_unchecked_mtrl_animation_interpolator_1.xml", "res/interpolator/btn_radio_to_off_mtrl_animation_interpolator_0.xml", "res/interpolator/btn_radio_to_on_mtrl_animation_interpolator_0.xml", "res/interpolator/fast_out_slow_in.xml", "res/layout/abc_action_bar_title_item.xml", "res/layout/abc_action_bar_up_container.xml", "res/layout/abc_action_menu_item_layout.xml", "res/layout/abc_action_menu_layout.xml", "res/layout/abc_action_mode_bar.xml", "res/layout/abc_action_mode_close_item_material.xml", "res/layout/abc_activity_chooser_view.xml", "res/layout/abc_activity_chooser_view_list_item.xml", "res/layout/abc_alert_dialog_button_bar_material.xml", "res/layout/abc_alert_dialog_material.xml", "res/layout/abc_alert_dialog_title_material.xml", "res/layout/abc_cascading_menu_item_layout.xml", "res/layout/abc_dialog_title_material.xml", "res/layout/abc_expanded_menu_layout.xml", "res/layout/abc_list_menu_item_checkbox.xml", "res/layout/abc_list_menu_item_icon.xml", "res/layout/abc_list_menu_item_layout.xml", "res/layout/abc_list_menu_item_radio.xml", "res/layout/abc_popup_menu_header_item_layout.xml", "res/layout/abc_popup_menu_item_layout.xml", "res/layout/abc_screen_content_include.xml", "res/layout/abc_screen_simple.xml", "res/layout/abc_screen_simple_overlay_action_mode.xml", "res/layout/abc_screen_toolbar.xml", "res/layout/abc_search_dropdown_item_icons_2line.xml", "res/layout/abc_search_view.xml", "res/layout/abc_select_dialog_material.xml", "res/layout/abc_tooltip.xml", "res/layout/select_dialog_item_material.xml", "res/layout/select_dialog_multichoice_material.xml", "res/layout/select_dialog_singlechoice_material.xml", "res/layout/support_simple_spinner_dropdown_item.xml", "res/layout-v26/abc_screen_toolbar.xml", "res/layout-watch-v20/abc_alert_dialog_button_bar_material.xml", "res/layout-watch-v20/abc_alert_dialog_title_material.xml", "res/values/values.xml", "res/values-af/values-af.xml", "res/values-am/values-am.xml", "res/values-ar/values-ar.xml", "res/values-as/values-as.xml", "res/values-az/values-az.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-be/values-be.xml", "res/values-bg/values-bg.xml", "res/values-bn/values-bn.xml", "res/values-bs/values-bs.xml", "res/values-ca/values-ca.xml", "res/values-cs/values-cs.xml", "res/values-da/values-da.xml", "res/values-de/values-de.xml", "res/values-el/values-el.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-en-rCA/values-en-rCA.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-es/values-es.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-et/values-et.xml", "res/values-eu/values-eu.xml", "res/values-fa/values-fa.xml", "res/values-fi/values-fi.xml", "res/values-fr/values-fr.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gl/values-gl.xml", "res/values-gu/values-gu.xml", "res/values-h720dp-v13/values-h720dp-v13.xml", "res/values-hdpi-v4/values-hdpi-v4.xml", "res/values-hi/values-hi.xml", "res/values-hr/values-hr.xml", "res/values-hu/values-hu.xml", "res/values-hy/values-hy.xml", "res/values-in/values-in.xml", "res/values-is/values-is.xml", "res/values-it/values-it.xml", "res/values-iw/values-iw.xml", "res/values-ja/values-ja.xml", "res/values-ka/values-ka.xml", "res/values-kk/values-kk.xml", "res/values-km/values-km.xml", "res/values-kn/values-kn.xml", "res/values-ko/values-ko.xml", "res/values-ky/values-ky.xml", "res/values-land/values-land.xml", "res/values-large-v4/values-large-v4.xml", "res/values-ldltr-v21/values-ldltr-v21.xml", "res/values-lo/values-lo.xml", "res/values-lt/values-lt.xml", "res/values-lv/values-lv.xml", "res/values-mk/values-mk.xml", "res/values-ml/values-ml.xml", "res/values-mn/values-mn.xml", "res/values-mr/values-mr.xml", "res/values-ms/values-ms.xml", "res/values-my/values-my.xml", "res/values-nb/values-nb.xml", "res/values-ne/values-ne.xml", "res/values-night-v8/values-night-v8.xml", "res/values-nl/values-nl.xml", "res/values-or/values-or.xml", "res/values-pa/values-pa.xml", "res/values-pl/values-pl.xml", "res/values-port/values-port.xml", "res/values-pt/values-pt.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ro/values-ro.xml", "res/values-ru/values-ru.xml", "res/values-si/values-si.xml", "res/values-sk/values-sk.xml", "res/values-sl/values-sl.xml", "res/values-sq/values-sq.xml", "res/values-sr/values-sr.xml", "res/values-sv/values-sv.xml", "res/values-sw/values-sw.xml", "res/values-sw600dp-v13/values-sw600dp-v13.xml", "res/values-ta/values-ta.xml", "res/values-te/values-te.xml", "res/values-th/values-th.xml", "res/values-tl/values-tl.xml", "res/values-tr/values-tr.xml", "res/values-uk/values-uk.xml", "res/values-ur/values-ur.xml", "res/values-uz/values-uz.xml", "res/values-v16/values-v16.xml", "res/values-v17/values-v17.xml", "res/values-v18/values-v18.xml", "res/values-v21/values-v21.xml", "res/values-v22/values-v22.xml", "res/values-v23/values-v23.xml", "res/values-v24/values-v24.xml", "res/values-v25/values-v25.xml", "res/values-v26/values-v26.xml", "res/values-v28/values-v28.xml", "res/values-vi/values-vi.xml", "res/values-watch-v20/values-watch-v20.xml", "res/values-watch-v21/values-watch-v21.xml", "res/values-xlarge-v4/values-xlarge-v4.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-zu/values-zu.xml" ] subjar_tuples = [ ] subjars = [ ]
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat/cipd.yaml b/third_party/android_deps/libs/androidx_appcompat_appcompat/cipd.yaml index 3efa71b9..f811b728 100644 --- a/third_party/android_deps/libs/androidx_appcompat_appcompat/cipd.yaml +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.2.0-beta01-cr0 package: chromium/third_party/android_deps/libs/androidx_appcompat_appcompat description: "Android AppCompat Library v7" data: -- file: appcompat-1.0.0.aar +- file: appcompat-1.2.0-beta01.aar
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/LICENSE b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/LICENSE
@@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/OWNERS b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/OWNERS new file mode 100644 index 0000000..7b571d97 --- /dev/null +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/OWNERS
@@ -0,0 +1 @@ +file://third_party/android_deps/OWNERS \ No newline at end of file
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/README.chromium b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/README.chromium new file mode 100644 index 0000000..31d9156 --- /dev/null +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/README.chromium
@@ -0,0 +1,13 @@ +Name: Android Resources Library +Short Name: appcompat-resources +URL: https://developer.android.com/jetpack/androidx +Version: 1.2.0-beta01 +License: Apache Version 2.0 +License File: LICENSE +Security Critical: yes + +Description: +The Resources Library is a static library that you can add to your Android application in order to use resource APIs that backport the latest APIs to older versions of the platform. Compatible on devices running API 14 or later. + +Local Modifications: +No modifications.
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/androidx_appcompat_appcompat_resources.info b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/androidx_appcompat_appcompat_resources.info new file mode 100644 index 0000000..e1bb856 --- /dev/null +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/androidx_appcompat_appcompat_resources.info
@@ -0,0 +1,13 @@ +# Generated by //build/android/gyp/aar.py +# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". + +aidl = [ ] +assets = [ ] +has_classes_jar = true +has_native_libraries = false +has_proguard_flags = false +has_r_text_file = true +is_manifest_empty = true +resources = [ "res/drawable/abc_vector_test.xml", "res/values/values.xml" ] +subjar_tuples = [ ] +subjars = [ ]
diff --git a/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/cipd.yaml b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/cipd.yaml new file mode 100644 index 0000000..5bc4af39 --- /dev/null +++ b/third_party/android_deps/libs/androidx_appcompat_appcompat_resources/cipd.yaml
@@ -0,0 +1,10 @@ +# Copyright 2018 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. + +# To create CIPD package run the following command. +# cipd create --pkg-def cipd.yaml -tag version:1.2.0-beta01-cr0 +package: chromium/third_party/android_deps/libs/androidx_appcompat_appcompat_resources +description: "Android Resources Library" +data: +- file: appcompat-resources-1.2.0-beta01.aar
diff --git a/third_party/android_deps/libs/androidx_arch_core_core_common/README.chromium b/third_party/android_deps/libs/androidx_arch_core_core_common/README.chromium index 847c275..1453c5e 100644 --- a/third_party/android_deps/libs/androidx_arch_core_core_common/README.chromium +++ b/third_party/android_deps/libs/androidx_arch_core_core_common/README.chromium
@@ -1,7 +1,7 @@ Name: Android Arch-Common Short Name: core-common URL: https://developer.android.com/topic/libraries/architecture/index.html -Version: 2.0.0 +Version: 2.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_arch_core_core_common/cipd.yaml b/third_party/android_deps/libs/androidx_arch_core_core_common/cipd.yaml index 8444919..ab9e418 100644 --- a/third_party/android_deps/libs/androidx_arch_core_core_common/cipd.yaml +++ b/third_party/android_deps/libs/androidx_arch_core_core_common/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:2.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:2.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_arch_core_core_common description: "Android Arch-Common" data: -- file: core-common-2.0.0.jar +- file: core-common-2.1.0.jar
diff --git a/third_party/android_deps/libs/androidx_collection_collection/README.chromium b/third_party/android_deps/libs/androidx_collection_collection/README.chromium index 5418dbe..9ba690c 100644 --- a/third_party/android_deps/libs/androidx_collection_collection/README.chromium +++ b/third_party/android_deps/libs/androidx_collection_collection/README.chromium
@@ -1,7 +1,7 @@ Name: Android Support Library collections Short Name: collection URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +Version: 1.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_collection_collection/cipd.yaml b/third_party/android_deps/libs/androidx_collection_collection/cipd.yaml index 514f58b..54de13a 100644 --- a/third_party/android_deps/libs/androidx_collection_collection/cipd.yaml +++ b/third_party/android_deps/libs/androidx_collection_collection/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_collection_collection description: "Android Support Library collections" data: -- file: collection-1.0.0.jar +- file: collection-1.1.0.jar
diff --git a/third_party/android_deps/libs/androidx_core_core/README.chromium b/third_party/android_deps/libs/androidx_core_core/README.chromium index 944e4b8b..ce59757 100644 --- a/third_party/android_deps/libs/androidx_core_core/README.chromium +++ b/third_party/android_deps/libs/androidx_core_core/README.chromium
@@ -1,7 +1,7 @@ Name: Android Support Library compat Short Name: core -URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +URL: https://developer.android.com/jetpack/androidx +Version: 1.3.0-beta01 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_core_core/androidx_core_core.info b/third_party/android_deps/libs/androidx_core_core/androidx_core_core.info index 1a74950..1ce756d 100644 --- a/third_party/android_deps/libs/androidx_core_core/androidx_core_core.info +++ b/third_party/android_deps/libs/androidx_core_core/androidx_core_core.info
@@ -8,6 +8,6 @@ has_proguard_flags = true has_r_text_file = true is_manifest_empty = true -resources = [ "res/drawable/notification_bg.xml", "res/drawable/notification_bg_low.xml", "res/drawable/notification_icon_background.xml", "res/drawable/notification_tile_bg.xml", "res/drawable-hdpi-v4/notification_bg_low_normal.9.png", "res/drawable-hdpi-v4/notification_bg_low_pressed.9.png", "res/drawable-hdpi-v4/notification_bg_normal.9.png", "res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-hdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-mdpi-v4/notification_bg_low_normal.9.png", "res/drawable-mdpi-v4/notification_bg_low_pressed.9.png", "res/drawable-mdpi-v4/notification_bg_normal.9.png", "res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-mdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-v21/notification_action_background.xml", "res/drawable-xhdpi-v4/notification_bg_low_normal.9.png", "res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png", "res/drawable-xhdpi-v4/notification_bg_normal.9.png", "res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-xhdpi-v4/notify_panel_notification_icon_bg.png", "res/layout/notification_action.xml", "res/layout/notification_action_tombstone.xml", "res/layout/notification_template_custom_big.xml", "res/layout/notification_template_icon_group.xml", "res/layout/notification_template_part_chronometer.xml", "res/layout/notification_template_part_time.xml", "res/layout-v16/notification_template_custom_big.xml", "res/layout-v21/notification_action.xml", "res/layout-v21/notification_action_tombstone.xml", "res/layout-v21/notification_template_custom_big.xml", "res/layout-v21/notification_template_icon_group.xml", "res/values/values.xml", "res/values-af/values-af.xml", "res/values-am/values-am.xml", "res/values-ar/values-ar.xml", "res/values-as/values-as.xml", "res/values-az/values-az.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-be/values-be.xml", "res/values-bg/values-bg.xml", "res/values-bn/values-bn.xml", "res/values-bs/values-bs.xml", "res/values-ca/values-ca.xml", "res/values-cs/values-cs.xml", "res/values-da/values-da.xml", "res/values-de/values-de.xml", "res/values-el/values-el.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-en-rCA/values-en-rCA.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-es/values-es.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-et/values-et.xml", "res/values-eu/values-eu.xml", "res/values-fa/values-fa.xml", "res/values-fi/values-fi.xml", "res/values-fr/values-fr.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gl/values-gl.xml", "res/values-gu/values-gu.xml", "res/values-hi/values-hi.xml", "res/values-hr/values-hr.xml", "res/values-hu/values-hu.xml", "res/values-hy/values-hy.xml", "res/values-in/values-in.xml", "res/values-is/values-is.xml", "res/values-it/values-it.xml", "res/values-iw/values-iw.xml", "res/values-ja/values-ja.xml", "res/values-ka/values-ka.xml", "res/values-kk/values-kk.xml", "res/values-km/values-km.xml", "res/values-kn/values-kn.xml", "res/values-ko/values-ko.xml", "res/values-ky/values-ky.xml", "res/values-lo/values-lo.xml", "res/values-lt/values-lt.xml", "res/values-lv/values-lv.xml", "res/values-mk/values-mk.xml", "res/values-ml/values-ml.xml", "res/values-mn/values-mn.xml", "res/values-mr/values-mr.xml", "res/values-ms/values-ms.xml", "res/values-my/values-my.xml", "res/values-nb/values-nb.xml", "res/values-ne/values-ne.xml", "res/values-nl/values-nl.xml", "res/values-or/values-or.xml", "res/values-pa/values-pa.xml", "res/values-pl/values-pl.xml", "res/values-pt/values-pt.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ro/values-ro.xml", "res/values-ru/values-ru.xml", "res/values-si/values-si.xml", "res/values-sk/values-sk.xml", "res/values-sl/values-sl.xml", "res/values-sq/values-sq.xml", "res/values-sr/values-sr.xml", "res/values-sv/values-sv.xml", "res/values-sw/values-sw.xml", "res/values-ta/values-ta.xml", "res/values-te/values-te.xml", "res/values-th/values-th.xml", "res/values-tl/values-tl.xml", "res/values-tr/values-tr.xml", "res/values-uk/values-uk.xml", "res/values-ur/values-ur.xml", "res/values-uz/values-uz.xml", "res/values-v16/values-v16.xml", "res/values-v21/values-v21.xml", "res/values-vi/values-vi.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-zu/values-zu.xml" ] +resources = [ "res/drawable/notification_bg.xml", "res/drawable/notification_bg_low.xml", "res/drawable/notification_icon_background.xml", "res/drawable/notification_tile_bg.xml", "res/drawable-hdpi-v4/notification_bg_low_normal.9.png", "res/drawable-hdpi-v4/notification_bg_low_pressed.9.png", "res/drawable-hdpi-v4/notification_bg_normal.9.png", "res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-hdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-mdpi-v4/notification_bg_low_normal.9.png", "res/drawable-mdpi-v4/notification_bg_low_pressed.9.png", "res/drawable-mdpi-v4/notification_bg_normal.9.png", "res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-mdpi-v4/notify_panel_notification_icon_bg.png", "res/drawable-v21/notification_action_background.xml", "res/drawable-xhdpi-v4/notification_bg_low_normal.9.png", "res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png", "res/drawable-xhdpi-v4/notification_bg_normal.9.png", "res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png", "res/drawable-xhdpi-v4/notify_panel_notification_icon_bg.png", "res/layout/custom_dialog.xml", "res/layout/notification_action.xml", "res/layout/notification_action_tombstone.xml", "res/layout/notification_template_custom_big.xml", "res/layout/notification_template_icon_group.xml", "res/layout/notification_template_part_chronometer.xml", "res/layout/notification_template_part_time.xml", "res/layout-v16/notification_template_custom_big.xml", "res/layout-v21/notification_action.xml", "res/layout-v21/notification_action_tombstone.xml", "res/layout-v21/notification_template_custom_big.xml", "res/layout-v21/notification_template_icon_group.xml", "res/values/values.xml", "res/values-af/values-af.xml", "res/values-am/values-am.xml", "res/values-ar/values-ar.xml", "res/values-as/values-as.xml", "res/values-az/values-az.xml", "res/values-b+sr+Latn/values-b+sr+Latn.xml", "res/values-be/values-be.xml", "res/values-bg/values-bg.xml", "res/values-bn/values-bn.xml", "res/values-bs/values-bs.xml", "res/values-ca/values-ca.xml", "res/values-cs/values-cs.xml", "res/values-da/values-da.xml", "res/values-de/values-de.xml", "res/values-el/values-el.xml", "res/values-en-rAU/values-en-rAU.xml", "res/values-en-rCA/values-en-rCA.xml", "res/values-en-rGB/values-en-rGB.xml", "res/values-en-rIN/values-en-rIN.xml", "res/values-en-rXC/values-en-rXC.xml", "res/values-es/values-es.xml", "res/values-es-rUS/values-es-rUS.xml", "res/values-et/values-et.xml", "res/values-eu/values-eu.xml", "res/values-fa/values-fa.xml", "res/values-fi/values-fi.xml", "res/values-fr/values-fr.xml", "res/values-fr-rCA/values-fr-rCA.xml", "res/values-gl/values-gl.xml", "res/values-gu/values-gu.xml", "res/values-hi/values-hi.xml", "res/values-hr/values-hr.xml", "res/values-hu/values-hu.xml", "res/values-hy/values-hy.xml", "res/values-in/values-in.xml", "res/values-is/values-is.xml", "res/values-it/values-it.xml", "res/values-iw/values-iw.xml", "res/values-ja/values-ja.xml", "res/values-ka/values-ka.xml", "res/values-kk/values-kk.xml", "res/values-km/values-km.xml", "res/values-kn/values-kn.xml", "res/values-ko/values-ko.xml", "res/values-ky/values-ky.xml", "res/values-lo/values-lo.xml", "res/values-lt/values-lt.xml", "res/values-lv/values-lv.xml", "res/values-mk/values-mk.xml", "res/values-ml/values-ml.xml", "res/values-mn/values-mn.xml", "res/values-mr/values-mr.xml", "res/values-ms/values-ms.xml", "res/values-my/values-my.xml", "res/values-nb/values-nb.xml", "res/values-ne/values-ne.xml", "res/values-nl/values-nl.xml", "res/values-or/values-or.xml", "res/values-pa/values-pa.xml", "res/values-pl/values-pl.xml", "res/values-pt/values-pt.xml", "res/values-pt-rBR/values-pt-rBR.xml", "res/values-pt-rPT/values-pt-rPT.xml", "res/values-ro/values-ro.xml", "res/values-ru/values-ru.xml", "res/values-si/values-si.xml", "res/values-sk/values-sk.xml", "res/values-sl/values-sl.xml", "res/values-sq/values-sq.xml", "res/values-sr/values-sr.xml", "res/values-sv/values-sv.xml", "res/values-sw/values-sw.xml", "res/values-ta/values-ta.xml", "res/values-te/values-te.xml", "res/values-th/values-th.xml", "res/values-tl/values-tl.xml", "res/values-tr/values-tr.xml", "res/values-uk/values-uk.xml", "res/values-ur/values-ur.xml", "res/values-uz/values-uz.xml", "res/values-v16/values-v16.xml", "res/values-v21/values-v21.xml", "res/values-vi/values-vi.xml", "res/values-zh-rCN/values-zh-rCN.xml", "res/values-zh-rHK/values-zh-rHK.xml", "res/values-zh-rTW/values-zh-rTW.xml", "res/values-zu/values-zu.xml" ] subjar_tuples = [ ] subjars = [ ]
diff --git a/third_party/android_deps/libs/androidx_core_core/cipd.yaml b/third_party/android_deps/libs/androidx_core_core/cipd.yaml index 8446cf8..15b8a46c8 100644 --- a/third_party/android_deps/libs/androidx_core_core/cipd.yaml +++ b/third_party/android_deps/libs/androidx_core_core/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.3.0-beta01-cr0 package: chromium/third_party/android_deps/libs/androidx_core_core description: "Android Support Library compat" data: -- file: core-1.0.0.aar +- file: core-1.3.0-beta01.aar
diff --git a/third_party/android_deps/libs/androidx_fragment_fragment/README.chromium b/third_party/android_deps/libs/androidx_fragment_fragment/README.chromium index 694defa..09d93826 100644 --- a/third_party/android_deps/libs/androidx_fragment_fragment/README.chromium +++ b/third_party/android_deps/libs/androidx_fragment_fragment/README.chromium
@@ -1,7 +1,7 @@ Name: Android Support Library fragment Short Name: fragment -URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +URL: https://developer.android.com/jetpack/androidx +Version: 1.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_fragment_fragment/cipd.yaml b/third_party/android_deps/libs/androidx_fragment_fragment/cipd.yaml index 6460ad8..cc72f462cf 100644 --- a/third_party/android_deps/libs/androidx_fragment_fragment/cipd.yaml +++ b/third_party/android_deps/libs/androidx_fragment_fragment/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_fragment_fragment description: "Android Support Library fragment" data: -- file: fragment-1.0.0.aar +- file: fragment-1.1.0.aar
diff --git a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/README.chromium b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/README.chromium index 20e4969a..01e57fbd 100644 --- a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/README.chromium +++ b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/README.chromium
@@ -1,7 +1,7 @@ Name: Android Lifecycle-Common Short Name: lifecycle-common URL: https://developer.android.com/topic/libraries/architecture/index.html -Version: 2.0.0 +Version: 2.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/cipd.yaml b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/cipd.yaml index 3f2cc1fe..aac301a 100644 --- a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/cipd.yaml +++ b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:2.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:2.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_lifecycle_lifecycle_common description: "Android Lifecycle-Common" data: -- file: lifecycle-common-2.0.0.jar +- file: lifecycle-common-2.1.0.jar
diff --git a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/README.chromium b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/README.chromium index 8fc3b2e4..d17b7253 100644 --- a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/README.chromium +++ b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/README.chromium
@@ -1,7 +1,7 @@ Name: Android Lifecycle Runtime Short Name: lifecycle-runtime URL: https://developer.android.com/topic/libraries/architecture/index.html -Version: 2.0.0 +Version: 2.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/cipd.yaml b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/cipd.yaml index 1a76297..2c9be432 100644 --- a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/cipd.yaml +++ b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:2.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:2.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_lifecycle_lifecycle_runtime description: "Android Lifecycle Runtime" data: -- file: lifecycle-runtime-2.0.0.aar +- file: lifecycle-runtime-2.1.0.aar
diff --git a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/README.chromium b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/README.chromium index 47501d7..894b3ac 100644 --- a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/README.chromium +++ b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/README.chromium
@@ -1,7 +1,7 @@ Name: Android Lifecycle ViewModel Short Name: lifecycle-viewmodel URL: https://developer.android.com/topic/libraries/architecture/index.html -Version: 2.0.0 +Version: 2.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/cipd.yaml b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/cipd.yaml index 510df71..de25cb2 100644 --- a/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/cipd.yaml +++ b/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:2.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:2.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_lifecycle_lifecycle_viewmodel description: "Android Lifecycle ViewModel" data: -- file: lifecycle-viewmodel-2.0.0.aar +- file: lifecycle-viewmodel-2.1.0.aar
diff --git a/third_party/android_deps/libs/androidx_savedstate_savedstate/LICENSE b/third_party/android_deps/libs/androidx_savedstate_savedstate/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/third_party/android_deps/libs/androidx_savedstate_savedstate/LICENSE
@@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.
diff --git a/third_party/android_deps/libs/androidx_savedstate_savedstate/OWNERS b/third_party/android_deps/libs/androidx_savedstate_savedstate/OWNERS new file mode 100644 index 0000000..7b571d97 --- /dev/null +++ b/third_party/android_deps/libs/androidx_savedstate_savedstate/OWNERS
@@ -0,0 +1 @@ +file://third_party/android_deps/OWNERS \ No newline at end of file
diff --git a/third_party/android_deps/libs/androidx_savedstate_savedstate/README.chromium b/third_party/android_deps/libs/androidx_savedstate_savedstate/README.chromium new file mode 100644 index 0000000..4579bf3 --- /dev/null +++ b/third_party/android_deps/libs/androidx_savedstate_savedstate/README.chromium
@@ -0,0 +1,13 @@ +Name: Activity +Short Name: savedstate +URL: https://developer.android.com/jetpack/androidx +Version: 1.0.0 +License: Apache Version 2.0 +License File: LICENSE +Security Critical: yes + +Description: +Provides the base Activity subclass and the relevant hooks to build a composable structure on top. + +Local Modifications: +No modifications.
diff --git a/third_party/android_deps/libs/androidx_savedstate_savedstate/androidx_savedstate_savedstate.info b/third_party/android_deps/libs/androidx_savedstate_savedstate/androidx_savedstate_savedstate.info new file mode 100644 index 0000000..0dfcb237 --- /dev/null +++ b/third_party/android_deps/libs/androidx_savedstate_savedstate/androidx_savedstate_savedstate.info
@@ -0,0 +1,13 @@ +# Generated by //build/android/gyp/aar.py +# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". + +aidl = [ ] +assets = [ ] +has_classes_jar = true +has_native_libraries = false +has_proguard_flags = true +has_r_text_file = false +is_manifest_empty = true +resources = [ ] +subjar_tuples = [ ] +subjars = [ ]
diff --git a/third_party/android_deps/libs/androidx_savedstate_savedstate/cipd.yaml b/third_party/android_deps/libs/androidx_savedstate_savedstate/cipd.yaml new file mode 100644 index 0000000..114ef58c --- /dev/null +++ b/third_party/android_deps/libs/androidx_savedstate_savedstate/cipd.yaml
@@ -0,0 +1,10 @@ +# Copyright 2018 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. + +# To create CIPD package run the following command. +# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +package: chromium/third_party/android_deps/libs/androidx_savedstate_savedstate +description: "Activity" +data: +- file: savedstate-1.0.0.aar
diff --git a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/README.chromium b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/README.chromium index 08416fb..6e7b6a9 100644 --- a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/README.chromium +++ b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/README.chromium
@@ -1,7 +1,7 @@ Name: Android Support VectorDrawable Short Name: vectordrawable -URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +URL: https://developer.android.com/jetpack/androidx +Version: 1.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/cipd.yaml b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/cipd.yaml index b08c415..a966026 100644 --- a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/cipd.yaml +++ b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable description: "Android Support VectorDrawable" data: -- file: vectordrawable-1.0.0.aar +- file: vectordrawable-1.1.0.aar
diff --git a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/README.chromium b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/README.chromium index 08abc63..4c91ce0 100644 --- a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/README.chromium +++ b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/README.chromium
@@ -1,7 +1,7 @@ Name: Android Support AnimatedVectorDrawable Short Name: vectordrawable-animated -URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +URL: https://developer.android.com/jetpack/androidx +Version: 1.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/cipd.yaml b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/cipd.yaml index 552322a..eab22d4a 100644 --- a/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/cipd.yaml +++ b/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_vectordrawable_vectordrawable_animated description: "Android Support AnimatedVectorDrawable" data: -- file: vectordrawable-animated-1.0.0.aar +- file: vectordrawable-animated-1.1.0.aar
diff --git a/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/README.chromium b/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/README.chromium index b6887ba..84cb71638 100644 --- a/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/README.chromium +++ b/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/README.chromium
@@ -1,7 +1,7 @@ -Name: VersionedParcelable and friends +Name: VersionedParcelable Short Name: versionedparcelable URL: http://developer.android.com/tools/extras/support-library.html -Version: 1.0.0 +Version: 1.1.0 License: Apache Version 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/cipd.yaml b/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/cipd.yaml index 9ddd6d78..d19fa1a 100644 --- a/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/cipd.yaml +++ b/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable/cipd.yaml
@@ -3,8 +3,8 @@ # found in the LICENSE file. # To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.0.0-cr0 +# cipd create --pkg-def cipd.yaml -tag version:1.1.0-cr0 package: chromium/third_party/android_deps/libs/androidx_versionedparcelable_versionedparcelable -description: "VersionedParcelable and friends" +description: "VersionedParcelable" data: -- file: versionedparcelable-1.0.0.aar +- file: versionedparcelable-1.1.0.aar
diff --git a/third_party/blink/renderer/bindings/core/v8/isolated_world_csp.cc b/third_party/blink/renderer/bindings/core/v8/isolated_world_csp.cc index f03d6c7..e0218d34 100644 --- a/third_party/blink/renderer/bindings/core/v8/isolated_world_csp.cc +++ b/third_party/blink/renderer/bindings/core/v8/isolated_world_csp.cc
@@ -51,10 +51,6 @@ return security_origin_.get(); } - SecureContextMode GetSecureContextMode() override { - return SecureContextMode::kSecureContext; - } - const KURL& Url() const override { // This is used to populate violation data's violation url. See // https://w3c.github.io/webappsec-csp/#violation-url.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc b/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc index e4c80762..5f1ac75 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_embedder_graph_builder.cc
@@ -190,13 +190,6 @@ WeakCallback, const void*) final; - // Unused Visitor overrides. - void VisitWeak(const void* object, - const void* object_weak_ref, - TraceDescriptor desc, - WeakCallback callback) final {} - void RegisterWeakCallback(WeakCallback, const void*) final {} - private: class ParentScope { STACK_ALLOCATED();
diff --git a/third_party/blink/renderer/bindings/idl_in_modules.gni b/third_party/blink/renderer/bindings/idl_in_modules.gni index e0618d4..1bfa213 100644 --- a/third_party/blink/renderer/bindings/idl_in_modules.gni +++ b/third_party/blink/renderer/bindings/idl_in_modules.gni
@@ -979,6 +979,7 @@ "//third_party/blink/renderer/modules/xr/xr_view.idl", "//third_party/blink/renderer/modules/xr/xr_viewer_pose.idl", "//third_party/blink/renderer/modules/xr/xr_viewport.idl", + "//third_party/blink/renderer/modules/xr/xr_webgl_binding.idl", "//third_party/blink/renderer/modules/xr/xr_webgl_layer.idl", "//third_party/blink/renderer/modules/xr/xr_webgl_layer_init.idl", "//third_party/blink/renderer/modules/xr/xr_world_information.idl",
diff --git a/third_party/blink/renderer/core/events/event_type_names.json5 b/third_party/blink/renderer/core/events/event_type_names.json5 index fd5f76f..be9f2512 100644 --- a/third_party/blink/renderer/core/events/event_type_names.json5 +++ b/third_party/blink/renderer/core/events/event_type_names.json5
@@ -232,6 +232,7 @@ "ratechange", "reading", "readystatechange", + "reflectionchange", "rejectionhandled", "release", "remove",
diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.cc b/third_party/blink/renderer/core/frame/csp/content_security_policy.cc index e119d8a..5c8a945 100644 --- a/third_party/blink/renderer/core/frame/csp/content_security_policy.cc +++ b/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
@@ -207,13 +207,8 @@ } if (require_trusted_types_) { - if (delegate_->GetSecureContextMode() == - SecureContextMode::kSecureContext) { - delegate_->SetRequireTrustedTypes(); - Count(WebFeature::kTrustedTypesEnabled); - } else { - ReportNonsecureTrustedTypes(); - } + delegate_->SetRequireTrustedTypes(); + Count(WebFeature::kTrustedTypesEnabled); } delegate_->AddInsecureRequestPolicy(insecure_request_policy_); @@ -1270,13 +1265,6 @@ "'. The directive has been applied, and the value ignored."); } -void ContentSecurityPolicy::ReportNonsecureTrustedTypes() { - LogToConsole( - "The Content Security Policy directive " - "'require-trusted-types-for' only has an effect in a secure " - "context. The directive has been ignored."); -} - void ContentSecurityPolicy::ReportMixedContentReportURI( const String& endpoint) { LogToConsole("The Content Security Policy directive specifies as endpoint '" +
diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.h b/third_party/blink/renderer/core/frame/csp/content_security_policy.h index 0ad6b42..29fe4ba 100644 --- a/third_party/blink/renderer/core/frame/csp/content_security_policy.h +++ b/third_party/blink/renderer/core/frame/csp/content_security_policy.h
@@ -89,10 +89,6 @@ // See https://w3c.github.io/webappsec-csp/#policy-self-origin. virtual const SecurityOrigin* GetSecurityOrigin() = 0; - // Returns the SecureContextMode for the context to which the delegate is - // bound. - virtual SecureContextMode GetSecureContextMode() = 0; - // Returns the URL this content security policy is bound to. // Used for https://w3c.github.io/webappsec-csp/#violation-url and so. // Note: Url() is used for several purposes that are specced slightly @@ -396,7 +392,6 @@ void ReportMetaOutsideHead(const String&); void ReportValueForEmptyDirective(const String& directive_name, const String& value); - void ReportNonsecureTrustedTypes(); void ReportMixedContentReportURI(const String& endpoint); // If a frame is passed in, the report will be sent using it as a context. If
diff --git a/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc b/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc index bd72485..8e61fb6 100644 --- a/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc +++ b/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.cc
@@ -43,10 +43,6 @@ return execution_context_->GetSecurityOrigin(); } -SecureContextMode ExecutionContextCSPDelegate::GetSecureContextMode() { - return GetSecurityContext().GetSecureContextMode(); -} - const KURL& ExecutionContextCSPDelegate::Url() const { return execution_context_->Url(); }
diff --git a/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.h b/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.h index 03f8f58d..221dcd6 100644 --- a/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.h +++ b/third_party/blink/renderer/core/frame/csp/execution_context_csp_delegate.h
@@ -26,7 +26,6 @@ // ContentSecurityPolicyDelegate overrides: const SecurityOrigin* GetSecurityOrigin() override; - SecureContextMode GetSecureContextMode() override; const KURL& Url() const override; void SetSandboxFlags(network::mojom::blink::WebSandboxFlags) override; void SetRequireTrustedTypes() override;
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 0784e10c..13dde79 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -2236,7 +2236,8 @@ resize_controller->DeliverObservations(); } else { // Observation depth limit reached - if (resize_controller->SkippedObservations()) { + if (resize_controller->SkippedObservations() && + !resize_controller->IsLoopLimitErrorDispatched()) { resize_controller->ClearObservations(); ErrorEvent* error = ErrorEvent::Create( "ResizeObserver loop limit exceeded", @@ -2248,7 +2249,7 @@ error, SanitizeScriptErrors::kDoNotSanitize); // Ensure notifications will get delivered in next cycle. ScheduleAnimation(); - DCHECK(Lifecycle().GetState() >= DocumentLifecycle::kPrePaintClean); + resize_controller->SetLoopLimitErrorDispatched(true); } if (Lifecycle().GetState() >= DocumentLifecycle::kPrePaintClean) return false; @@ -2466,6 +2467,7 @@ ResizeObserverController* resize_controller = ResizeObserverController::From(*frame_view.frame_->DomWindow()); resize_controller->ClearMinDepth(); + resize_controller->SetLoopLimitErrorDispatched(false); }); } return re_run_lifecycles;
diff --git a/third_party/blink/renderer/core/frame/window.idl b/third_party/blink/renderer/core/frame/window.idl index ca14034e..b3d5a554 100644 --- a/third_party/blink/renderer/core/frame/window.idl +++ b/third_party/blink/renderer/core/frame/window.idl
@@ -209,7 +209,7 @@ [DisableInNewIDLCompiler] attribute DOMMatrixConstructor WebKitCSSMatrix; // TrustedTypes API: http://github.com/wicg/trusted-types - [RuntimeEnabled=TrustedDOMTypes, SecureContext] readonly attribute TrustedTypePolicyFactory trustedTypes; + [RuntimeEnabled=TrustedDOMTypes] readonly attribute TrustedTypePolicyFactory trustedTypes; }; Window includes GlobalEventHandlers;
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow.cc b/third_party/blink/renderer/core/layout/layout_block_flow.cc index 1caefbf8..6214dce 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow.cc +++ b/third_party/blink/renderer/core/layout/layout_block_flow.cc
@@ -64,6 +64,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" #include "third_party/blink/renderer/core/layout/shapes/shape_outside_info.h" #include "third_party/blink/renderer/core/layout/text_autosizer.h" +#include "third_party/blink/renderer/core/page/named_pages_mapper.h" #include "third_party/blink/renderer/core/paint/block_flow_paint_invalidator.h" #include "third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" @@ -879,8 +880,15 @@ LayoutUnit pagination_strut = new_logical_top - old_logical_top; child.SetPaginationStrut(pagination_strut); if (is_named_page_break) { - // This was a forced break because of named pages. + // This was a forced break because of named pages. We now need to store + // the page number where this happened, so that we can apply the right + // descriptors (size, margins, page-orientation, etc.) when printing the + // page. layout_info.SetChildPageName(child.StyleRef().Page()); + if (NamedPagesMapper* mapper = View()->GetNamedPagesMapper()) { + mapper->AddNamedPage(child.StyleRef().Page(), + CurrentPageNumber(new_logical_top)); + } } } }
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index 45a9f28..541a0a71 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -6476,6 +6476,11 @@ return remaining_height - footer_height; } +int LayoutBox::CurrentPageNumber(LayoutUnit child_logical_top) const { + LayoutUnit offset = OffsetFromLogicalTopOfFirstPage() + child_logical_top; + return (offset / View()->PageLogicalHeight()).Floor(); +} + bool LayoutBox::CrossesPageBoundary(LayoutUnit offset, LayoutUnit logical_height) const { if (!IsPageLogicalHeightKnown())
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index bdf09ced..7783d51 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -930,6 +930,8 @@ LayoutUnit PageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule) const; + int CurrentPageNumber(LayoutUnit child_logical_top) const; + bool CrossesPageBoundary(LayoutUnit offset, LayoutUnit logical_height) const; // Calculate the strut to insert in order fit content of size
diff --git a/third_party/blink/renderer/core/layout/layout_view.cc b/third_party/blink/renderer/core/layout/layout_view.cc index 65ecfe4..67af940 100644 --- a/third_party/blink/renderer/core/layout/layout_view.cc +++ b/third_party/blink/renderer/core/layout/layout_view.cc
@@ -45,6 +45,7 @@ #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h" #include "third_party/blink/renderer/core/layout/view_fragmentation_context.h" #include "third_party/blink/renderer/core/page/chrome_client.h" +#include "third_party/blink/renderer/core/page/named_pages_mapper.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/page/scrolling/root_scroller_controller.h" #include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator_context.h" @@ -306,10 +307,14 @@ } void LayoutView::UpdateLayout() { - if (!GetDocument().Printing()) + if (!GetDocument().Printing()) { SetPageLogicalHeight(LayoutUnit()); + named_pages_mapper_ = nullptr; + } if (PageLogicalHeight() && ShouldUsePrintingLayout()) { + if (RuntimeEnabledFeatures::NamedPagesEnabled()) + named_pages_mapper_ = std::make_unique<NamedPagesMapper>(); intrinsic_logical_widths_ = LogicalWidth(); if (!fragmentation_context_) { fragmentation_context_ =
diff --git a/third_party/blink/renderer/core/layout/layout_view.h b/third_party/blink/renderer/core/layout/layout_view.h index ba54c01..7a36102b 100644 --- a/third_party/blink/renderer/core/layout/layout_view.h +++ b/third_party/blink/renderer/core/layout/layout_view.h
@@ -38,6 +38,7 @@ class LayoutQuote; class LocalFrameView; +class NamedPagesMapper; class PaintLayerCompositor; class ViewFragmentationContext; @@ -192,6 +193,10 @@ page_logical_height_ = height; } + NamedPagesMapper* GetNamedPagesMapper() const { + return named_pages_mapper_.get(); + } + PaintLayerCompositor* Compositor(); bool UsesCompositing() const; @@ -325,6 +330,7 @@ LayoutState* layout_state_; std::unique_ptr<ViewFragmentationContext> fragmentation_context_; + std::unique_ptr<NamedPagesMapper> named_pages_mapper_; std::unique_ptr<PaintLayerCompositor> compositor_; scoped_refptr<IntervalArena> interval_arena_;
diff --git a/third_party/blink/renderer/core/layout/layout_view_test.cc b/third_party/blink/renderer/core/layout/layout_view_test.cc index 94dbb303..e41c964 100644 --- a/third_party/blink/renderer/core/layout/layout_view_test.cc +++ b/third_party/blink/renderer/core/layout/layout_view_test.cc
@@ -8,6 +8,8 @@ #include "third_party/blink/renderer/core/dom/node_computed_style.h" #include "third_party/blink/renderer/core/editing/text_affinity.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" +#include "third_party/blink/renderer/core/page/named_pages_mapper.h" +#include "third_party/blink/renderer/core/page/print_context.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" @@ -64,6 +66,59 @@ EXPECT_FALSE(frame_doc->NeedsLayoutTreeUpdate()); } +TEST_F(LayoutViewTest, NamedPages) { + ScopedNamedPagesForTest named_pages_enabler(true); + + SetBodyInnerHTML(R"HTML( + <!DOCTYPE html> + <style> + div:empty { height:10px; } + </style> + <!-- First page: --> + <div></div> + <!-- Second page: --> + <div style="break-before:page;"></div> + <!-- Third page: --> + <div style="page:yksi;"></div> + <!-- Fourth page: --> + <div style="page:yksi;"> + <div style="page:yksi; break-before:page;"></div> + <!-- Fifth page: --> + <div style="page:yksi; break-before:page;"></div> + </div> + <!-- Sixth page: --> + <div style="page:kaksi;"></div> + <!-- Seventh page: --> + <div style="page:maksitaksi;"></div> + <!-- Eighth page: --> + <div></div> + <!-- Ninth page: --> + <div style="page:yksi;"></div> + )HTML"); + + UpdateAllLifecyclePhasesForTest(); + const LayoutView* view = GetDocument().GetLayoutView(); + ASSERT_TRUE(view); + + ScopedPrintContext print_context(&GetDocument().View()->GetFrame()); + print_context->BeginPrintMode(500, 500); + const NamedPagesMapper* mapper = view->GetNamedPagesMapper(); + ASSERT_TRUE(mapper); + + EXPECT_EQ(mapper->NamedPageAtIndex(0), AtomicString()); + EXPECT_EQ(mapper->NamedPageAtIndex(1), AtomicString()); + EXPECT_EQ(mapper->NamedPageAtIndex(2), "yksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(3), "yksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(4), "yksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(5), "kaksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(6), "maksitaksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(7), AtomicString()); + EXPECT_EQ(mapper->NamedPageAtIndex(8), "yksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(9), "yksi"); + EXPECT_EQ(mapper->NamedPageAtIndex(100), "yksi"); + EXPECT_EQ(mapper->LastPageName(), "yksi"); +} + struct HitTestConfig { bool layout_ng; EditingBehaviorType editing_behavior;
diff --git a/third_party/blink/renderer/core/page/print_context.h b/third_party/blink/renderer/core/page/print_context.h index 9bcde62..c58518d 100644 --- a/third_party/blink/renderer/core/page/print_context.h +++ b/third_party/blink/renderer/core/page/print_context.h
@@ -132,7 +132,7 @@ bool linked_destinations_valid_; }; -class ScopedPrintContext { +class CORE_EXPORT ScopedPrintContext { STACK_ALLOCATED(); public:
diff --git a/third_party/blink/renderer/core/paint/object_painter_base.cc b/third_party/blink/renderer/core/paint/object_painter_base.cc index 79a331d9..63719e6 100644 --- a/third_party/blink/renderer/core/paint/object_painter_base.cc +++ b/third_party/blink/renderer/core/paint/object_painter_base.cc
@@ -111,13 +111,26 @@ Vector<OutlineEdgeInfo, 4> edges; - SkPath::Iter iter(path, false); - SkPoint points[4]; + SkPath::RawIter iter(path); + SkPoint points[4], first_point, last_point; wtf_size_t count = 0; for (SkPath::Verb verb = iter.next(points); verb != SkPath::kDone_Verb; verb = iter.next(points)) { + // Keep track of the first and last point of each contour (started with + // kMove_Verb) so we can add the closing-line on kClose_Verb. + if (verb == SkPath::kMove_Verb) { + first_point = points[0]; + last_point = first_point; // this gets reset after each line, but we + // initialize it here + } else if (verb == SkPath::kClose_Verb) { + // create an artificial line to close the contour + verb = SkPath::kLine_Verb; + points[0] = last_point; + points[1] = first_point; + } if (verb != SkPath::kLine_Verb) continue; + last_point = points[1]; edges.Grow(++count); OutlineEdgeInfo& edge = edges.back();
diff --git a/third_party/blink/renderer/core/resize_observer/resize_observer_controller.h b/third_party/blink/renderer/core/resize_observer/resize_observer_controller.h index 2d073f4c..5985219e 100644 --- a/third_party/blink/renderer/core/resize_observer/resize_observer_controller.h +++ b/third_party/blink/renderer/core/resize_observer/resize_observer_controller.h
@@ -48,6 +48,13 @@ void ClearMinDepth() { min_depth_ = 0; } + bool IsLoopLimitErrorDispatched() const { + return loop_limit_error_dispatched; + } + void SetLoopLimitErrorDispatched(bool is_dispatched) { + loop_limit_error_dispatched = is_dispatched; + } + void Trace(Visitor*) override; // For testing only. @@ -60,6 +67,9 @@ HeapLinkedHashSet<WeakMember<ResizeObserver>> observers_; // Minimum depth for observations to be active size_t min_depth_ = 0; + // Used to prevent loop limit errors from being dispatched twice for the + // same lifecycle update + bool loop_limit_error_dispatched = false; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index f85fe3b..a52eae20 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -733,7 +733,11 @@ void SetOutlineWidth(float v) { SetOutlineWidthInternal(LayoutUnit(v)); } // TODO(rego): This is a temporal method that will be removed once we start // using the float OutlineWidth() in the painting code. - uint16_t OutlineWidthInt() const { return OutlineWidth(); } + uint16_t OutlineWidthInt() const { + if (OutlineStyle() == EBorderStyle::kNone) + return 0; + return OutlineWidthInternal().ToUnsigned(); + } // -webkit-perspective-origin-x const Length& PerspectiveOriginX() const { return PerspectiveOrigin().X(); }
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_html.idl b/third_party/blink/renderer/core/trustedtypes/trusted_html.idl index 6db167e..7eabd4d 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_html.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_html.idl
@@ -8,8 +8,7 @@ [ Exposed=Window, - RuntimeEnabled=TrustedDOMTypes, - SecureContext + RuntimeEnabled=TrustedDOMTypes ] interface TrustedHTML { stringifier; };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_script.idl b/third_party/blink/renderer/core/trustedtypes/trusted_script.idl index 34f29af..081bb4b 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_script.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_script.idl
@@ -8,8 +8,7 @@ [ Exposed=Window, - RuntimeEnabled=TrustedDOMTypes, - SecureContext + RuntimeEnabled=TrustedDOMTypes ] interface TrustedScript { stringifier; };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl b/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl index 84695e2..711b491 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_script_url.idl
@@ -8,8 +8,7 @@ [ Exposed=Window, - RuntimeEnabled=TrustedDOMTypes, - SecureContext + RuntimeEnabled=TrustedDOMTypes ] interface TrustedScriptURL { stringifier; };
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl index 32798ed1..22b48f331 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy.idl
@@ -8,8 +8,7 @@ [ Exposed=Window, - RuntimeEnabled=TrustedDOMTypes, - SecureContext + RuntimeEnabled=TrustedDOMTypes ] interface TrustedTypePolicy { readonly attribute DOMString name; [CallWith=ScriptState, RaisesException] TrustedHTML createHTML(DOMString input, any... args);
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl index 02fbefc..5a9cdc3 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl +++ b/third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.idl
@@ -6,8 +6,7 @@ [ Exposed=(Window, Worker), - RuntimeEnabled=TrustedDOMTypes, - SecureContext + RuntimeEnabled=TrustedDOMTypes ] interface TrustedTypePolicyFactory { [RaisesException] TrustedTypePolicy createPolicy(DOMString policyName, TrustedTypePolicyOptions policyOptions); readonly attribute TrustedTypePolicy defaultPolicy;
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc b/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc index 5a48ceb7..030078e 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc +++ b/third_party/blink/renderer/core/trustedtypes/trusted_types_util_test.cc
@@ -17,18 +17,11 @@ #include "third_party/blink/renderer/core/trustedtypes/trusted_script_url.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/heap/heap.h" -#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" namespace blink { void TrustedTypesCheckForHTMLThrows(const String& string) { auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); - KURL url("https://example.site"); - dummy_page_holder->GetFrame().Loader().CommitNavigation( - WebNavigationParams::CreateWithHTMLBuffer(SharedBuffer::Create(), url), - nullptr /* extra_data */); - blink::test::RunPendingTasks(); - LocalDOMWindow* window = dummy_page_holder->GetFrame().DomWindow(); V8TestingScope scope; DummyExceptionStateForTesting exception_state; @@ -49,12 +42,6 @@ void TrustedTypesCheckForScriptThrows(const String& string) { auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); - KURL url("https://example.site"); - dummy_page_holder->GetFrame().Loader().CommitNavigation( - WebNavigationParams::CreateWithHTMLBuffer(SharedBuffer::Create(), url), - nullptr /* extra_data */); - blink::test::RunPendingTasks(); - LocalDOMWindow* window = dummy_page_holder->GetFrame().DomWindow(); V8TestingScope scope; DummyExceptionStateForTesting exception_state; @@ -75,12 +62,6 @@ void TrustedTypesCheckForScriptURLThrows(const String& string) { auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); - KURL url("https://example.site"); - dummy_page_holder->GetFrame().Loader().CommitNavigation( - WebNavigationParams::CreateWithHTMLBuffer(SharedBuffer::Create(), url), - nullptr /* extra_data */); - blink::test::RunPendingTasks(); - LocalDOMWindow* window = dummy_page_holder->GetFrame().DomWindow(); V8TestingScope scope; DummyExceptionStateForTesting exception_state;
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 b3f8bc24..d39a0d26 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
@@ -81,19 +81,6 @@ return outside_settings_object_->GetSecurityOrigin(); } - SecureContextMode GetSecureContextMode() override { - DCHECK(global_scope_for_logging_->IsContextThread()); - // TODO(mkwst): This doesn't handle nested workers correctly; we ought to - // be reading the SecureContextMode from the relevant SecurityContext, but - // we don't have it here. This code simply checks the worker's origin, which - // generally works, but would incorrectly consider a secure worker nested in - // a non-secure worker as a "secure context". - return outside_settings_object_->GetSecurityOrigin() - ->IsPotentiallyTrustworthy() - ? SecureContextMode::kSecureContext - : SecureContextMode::kInsecureContext; - } - // We don't have to do anything here, as we don't want to update // SecurityContext of either parent context or WorkerOrWorkletGlobalScope. // TODO(hiroshige): Revisit the relationship of ContentSecurityPolicy,
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.cc b/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.cc index 8c6badf..3dc0b53c 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.cc +++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.cc
@@ -33,9 +33,9 @@ InspectorBaseAgent::Trace(visitor); } -DeviceOrientationController* DeviceOrientationInspectorAgent::Controller() { - LocalDOMWindow* window = inspected_frames_->Root()->DomWindow(); - return window ? &DeviceOrientationController::From(*window) : nullptr; +DeviceOrientationController& DeviceOrientationInspectorAgent::Controller() { + return DeviceOrientationController::From( + *inspected_frames_->Root()->DomWindow()); } Response DeviceOrientationInspectorAgent::setDeviceOrientationOverride( @@ -46,10 +46,8 @@ alpha_.Set(alpha); beta_.Set(beta); gamma_.Set(gamma); - if (Controller()) { - Controller()->SetOverride( - DeviceOrientationData::Create(alpha, beta, gamma, false)); - } + Controller().SetOverride( + DeviceOrientationData::Create(alpha, beta, gamma, false)); sensor_agent_->SetOrientationSensorOverride(alpha, beta, gamma); return Response::Success(); } @@ -60,16 +58,16 @@ Response DeviceOrientationInspectorAgent::disable() { agent_state_.ClearAllFields(); - if (Controller()) - Controller()->ClearOverride(); + if (!inspected_frames_->Root()->DomWindow()->IsContextDestroyed()) + Controller().ClearOverride(); sensor_agent_->Disable(); return Response::Success(); } void DeviceOrientationInspectorAgent::Restore() { - if (!Controller() || !enabled_.Get()) + if (!enabled_.Get()) return; - Controller()->SetOverride(DeviceOrientationData::Create( + Controller().SetOverride(DeviceOrientationData::Create( alpha_.Get(), beta_.Get(), gamma_.Get(), false)); sensor_agent_->SetOrientationSensorOverride(alpha_.Get(), beta_.Get(), gamma_.Get());
diff --git a/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h b/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h index 94c9436b2b..a762711f 100644 --- a/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h +++ b/third_party/blink/renderer/modules/device_orientation/device_orientation_inspector_agent.h
@@ -34,7 +34,7 @@ void DidCommitLoadForLocalFrame(LocalFrame*) override; private: - DeviceOrientationController* Controller(); + DeviceOrientationController& Controller(); Member<InspectedFrames> inspected_frames_; Member<SensorInspectorAgent> sensor_agent_;
diff --git a/third_party/blink/renderer/modules/event_target_modules_names.json5 b/third_party/blink/renderer/modules/event_target_modules_names.json5 index 2524a92..373b645 100644 --- a/third_party/blink/renderer/modules/event_target_modules_names.json5 +++ b/third_party/blink/renderer/modules/event_target_modules_names.json5
@@ -71,6 +71,7 @@ "MIDIPort", "VirtualKeyboard", "XR", + "XRLightProbe", "XRSession", "XRSpace", {
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc index 129935f..9d3aa72 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc
@@ -109,13 +109,14 @@ for (const auto& param_name : param_value_map_.Keys()) { auto* const param_handler = param_handler_map_.at(param_name); AudioFloatArray* param_values = param_value_map_.at(param_name); - if (param_handler->HasSampleAccurateValues()) { + if (param_handler->HasSampleAccurateValuesTimeline() && + param_handler->IsAudioRate()) { param_handler->CalculateSampleAccurateValues( param_values->Data(), static_cast<uint32_t>(frames_to_process)); } else { std::fill(param_values->Data(), param_values->Data() + frames_to_process, - param_handler->Value()); + param_handler->FinalValue()); } }
diff --git a/third_party/blink/renderer/modules/xr/BUILD.gn b/third_party/blink/renderer/modules/xr/BUILD.gn index 7808df4..34249e8c 100644 --- a/third_party/blink/renderer/modules/xr/BUILD.gn +++ b/third_party/blink/renderer/modules/xr/BUILD.gn
@@ -92,6 +92,8 @@ "xr_viewer_pose.cc", "xr_viewer_pose.h", "xr_viewport.h", + "xr_webgl_binding.cc", + "xr_webgl_binding.h", "xr_webgl_layer.cc", "xr_webgl_layer.h", "xr_world_information.cc",
diff --git a/third_party/blink/renderer/modules/xr/idls.gni b/third_party/blink/renderer/modules/xr/idls.gni index c8e94dd..3d1876b4 100644 --- a/third_party/blink/renderer/modules/xr/idls.gni +++ b/third_party/blink/renderer/modules/xr/idls.gni
@@ -35,6 +35,7 @@ "xr_view.idl", "xr_viewer_pose.idl", "xr_viewport.idl", + "xr_webgl_binding.idl", "xr_webgl_layer.idl", "xr_world_information.idl", "xr_world_tracking_state.idl",
diff --git a/third_party/blink/renderer/modules/xr/xr_cube_map.cc b/third_party/blink/renderer/modules/xr/xr_cube_map.cc index b2973a0..2f096b3 100644 --- a/third_party/blink/renderer/modules/xr/xr_cube_map.cc +++ b/third_party/blink/renderer/modules/xr/xr_cube_map.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/modules/xr/xr_cube_map.h" #include "device/vr/public/mojom/vr_service.mojom-blink.h" -#include "third_party/blink/renderer/modules/webgl/webgl2_rendering_context_base.h" +#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h" #include "third_party/blink/renderer/modules/webgl/webgl_texture.h" #include "third_party/blink/renderer/modules/xr/xr_cube_map.h" #include "third_party/blink/renderer/platform/bindings/exception_code.h" @@ -14,11 +14,6 @@ bool IsPowerOfTwo(uint32_t value) { return value && (value & (value - 1)) == 0; } - -static constexpr char const* kErrorNonCubemapTexture = - "Cannot pass non-cubemap texture"; -static constexpr char const* kErrorContextMismatch = "Context mismatch"; - } // namespace namespace blink { @@ -51,20 +46,14 @@ } WebGLTexture* XRCubeMap::updateWebGLEnvironmentCube( - WebGL2RenderingContextBase* context, - WebGLTexture* texture, - ExceptionState& exception_state) const { - // If they haven't supplied us with a texture, Create a new one. - if (!texture) { - texture = MakeGarbageCollected<WebGLTexture>(context); - } else if (texture->HasEverBeenBound() && - texture->GetTarget() != GL_TEXTURE_CUBE_MAP) { - exception_state.ThrowTypeError(kErrorNonCubemapTexture); - return nullptr; - } else if (texture->ContextGroup() != context->ContextGroup()) { - exception_state.ThrowTypeError(kErrorContextMismatch); - return nullptr; - } + WebGLRenderingContextBase* context, + WebGLTexture* texture) const { + // Ensure a texture was supplied from the passed context and with an + // appropriate bound target. + DCHECK(texture); + DCHECK(!texture->HasEverBeenBound() || + texture->GetTarget() == GL_TEXTURE_CUBE_MAP); + DCHECK(texture->ContextGroup() == context->ContextGroup()); auto* gl = context->ContextGL(); texture->SetTarget(GL_TEXTURE_CUBE_MAP); @@ -94,6 +83,7 @@ 0, GL_RGBA, GL_HALF_FLOAT, image); } + // TODO(https://crbug.com/1079007): Restore the texture binding gl->BindTexture(GL_TEXTURE_CUBE_MAP, 0); // Debug check for success
diff --git a/third_party/blink/renderer/modules/xr/xr_cube_map.h b/third_party/blink/renderer/modules/xr/xr_cube_map.h index 7243346..d31d42f 100644 --- a/third_party/blink/renderer/modules/xr/xr_cube_map.h +++ b/third_party/blink/renderer/modules/xr/xr_cube_map.h
@@ -11,18 +11,16 @@ namespace blink { -class WebGL2RenderingContextBase; +class WebGLRenderingContextBase; class WebGLTexture; -class ExceptionState; +// Internal-only helper class for storing and managing cube map data; class XRCubeMap { public: explicit XRCubeMap(const device::mojom::blink::XRCubeMap& cube_map); - WebGLTexture* updateWebGLEnvironmentCube( - WebGL2RenderingContextBase* context, - WebGLTexture* texture, - ExceptionState& exception_state) const; + WebGLTexture* updateWebGLEnvironmentCube(WebGLRenderingContextBase* context, + WebGLTexture* texture) const; private: uint32_t width_and_height_ = 0;
diff --git a/third_party/blink/renderer/modules/xr/xr_light_probe.cc b/third_party/blink/renderer/modules/xr/xr_light_probe.cc index f9edbfa..a243287b 100644 --- a/third_party/blink/renderer/modules/xr/xr_light_probe.cc +++ b/third_party/blink/renderer/modules/xr/xr_light_probe.cc
@@ -6,21 +6,65 @@ #include "device/vr/public/mojom/vr_service.mojom-blink.h" #include "third_party/blink/renderer/core/geometry/dom_point_read_only.h" +#include "third_party/blink/renderer/modules/event_modules.h" +#include "third_party/blink/renderer/modules/event_target_modules.h" +#include "third_party/blink/renderer/modules/xr/xr_cube_map.h" #include "third_party/blink/renderer/modules/xr/xr_light_estimate.h" #include "third_party/blink/renderer/modules/xr/xr_session.h" namespace blink { +namespace { + +// Milliseconds to wait between reflection change events. +const double kReflectionChangeDelta = 1000.0; + +} // namespace + XRLightProbe::XRLightProbe(XRSession* session) : session_(session) {} void XRLightProbe::ProcessLightEstimationData( const device::mojom::blink::XRLightEstimationData* data, double timestamp) { + bool reflection_changed = false; + if (data) { light_estimate_ = MakeGarbageCollected<XRLightEstimate>(*data->light_probe); + + if (data->reflection_probe) { + if (!cube_map_) { + reflection_changed = true; + } + + const device::mojom::blink::XRReflectionProbe& reflection_probe = + *data->reflection_probe; + cube_map_ = std::make_unique<XRCubeMap>(*reflection_probe.cube_map); + } } else { + if (cube_map_) { + reflection_changed = true; + } + light_estimate_ = nullptr; + cube_map_ = nullptr; } + + // Until we get proper notification of updated reflection data from the + // runtime we'll limit reflection change events to once per second. + if (reflection_changed || + (cube_map_ && + timestamp > last_reflection_change_ + kReflectionChangeDelta)) { + last_reflection_change_ = timestamp; + DispatchEvent(*blink::Event::Create(event_type_names::kReflectionchange)); + } +} + +ExecutionContext* XRLightProbe::GetExecutionContext() const { + return session_->GetExecutionContext(); +} + +const AtomicString& XRLightProbe::InterfaceName() const { + return event_target_names::kXRLightProbe; } void XRLightProbe::Trace(Visitor* visitor) {
diff --git a/third_party/blink/renderer/modules/xr/xr_light_probe.h b/third_party/blink/renderer/modules/xr/xr_light_probe.h index 60c43eb..b754421 100644 --- a/third_party/blink/renderer/modules/xr/xr_light_probe.h +++ b/third_party/blink/renderer/modules/xr/xr_light_probe.h
@@ -17,10 +17,11 @@ namespace blink { +class XRCubeMap; class XRLightEstimate; class XRSession; -class XRLightProbe : public ScriptWrappable { +class XRLightProbe : public EventTargetWithInlineData { DEFINE_WRAPPERTYPEINFO(); public: @@ -28,17 +29,27 @@ XRSession* session() const { return session_; } + DEFINE_ATTRIBUTE_EVENT_LISTENER(reflectionchange, kReflectionchange) + void ProcessLightEstimationData( const device::mojom::blink::XRLightEstimationData* data, double timestamp); XRLightEstimate* getLightEstimate() { return light_estimate_; } + XRCubeMap* getReflectionCubeMap() { return cube_map_.get(); } + + // EventTarget overrides. + ExecutionContext* GetExecutionContext() const override; + const AtomicString& InterfaceName() const override; void Trace(Visitor* visitor) override; private: Member<XRSession> session_; Member<XRLightEstimate> light_estimate_; + + double last_reflection_change_ = 0.0; + std::unique_ptr<XRCubeMap> cube_map_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_light_probe.idl b/third_party/blink/renderer/modules/xr/xr_light_probe.idl index 07be6933..462db1a 100644 --- a/third_party/blink/renderer/modules/xr/xr_light_probe.idl +++ b/third_party/blink/renderer/modules/xr/xr_light_probe.idl
@@ -6,6 +6,7 @@ SecureContext, Exposed=Window, RuntimeEnabled=WebXRLightEstimation -] interface XRLightProbe { +] interface XRLightProbe : EventTarget { + attribute EventHandler onreflectionchange; };
diff --git a/third_party/blink/renderer/modules/xr/xr_utils.cc b/third_party/blink/renderer/modules/xr/xr_utils.cc index 7e4d5f7b..1faec9e 100644 --- a/third_party/blink/renderer/modules/xr/xr_utils.cc +++ b/third_party/blink/renderer/modules/xr/xr_utils.cc
@@ -6,7 +6,10 @@ #include <cmath> +#include "third_party/blink/renderer/bindings/modules/v8/webgl_rendering_context_or_webgl2_rendering_context.h" #include "third_party/blink/renderer/core/geometry/dom_point_read_only.h" +#include "third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h" +#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context.h" #include "third_party/blink/renderer/platform/transforms/transformation_matrix.h" namespace blink { @@ -63,4 +66,13 @@ w / length); } +WebGLRenderingContextBase* webglRenderingContextBaseFromUnion( + const WebGLRenderingContextOrWebGL2RenderingContext& context) { + if (context.IsWebGL2RenderingContext()) { + return context.GetAsWebGL2RenderingContext(); + } else { + return context.GetAsWebGLRenderingContext(); + } +} + } // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_utils.h b/third_party/blink/renderer/modules/xr/xr_utils.h index 69b5ec0..1a496d372 100644 --- a/third_party/blink/renderer/modules/xr/xr_utils.h +++ b/third_party/blink/renderer/modules/xr/xr_utils.h
@@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_XR_XR_UTILS_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_XR_XR_UTILS_H_ +#include "third_party/blink/renderer/bindings/modules/v8/webgl_rendering_context_or_webgl2_rendering_context.h" #include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h" #include "third_party/blink/renderer/platform/wtf/forward.h" @@ -12,6 +13,7 @@ class DOMPointReadOnly; class TransformationMatrix; +class WebGLRenderingContextBase; DOMFloat32Array* transformationMatrixToDOMFloat32Array( const TransformationMatrix&); @@ -25,6 +27,9 @@ double z, double w); +WebGLRenderingContextBase* webglRenderingContextBaseFromUnion( + const WebGLRenderingContextOrWebGL2RenderingContext&); + constexpr char kUnableToNormalizeZeroLength[] = "Unable to normalize vector of length 0.";
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc b/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc new file mode 100644 index 0000000..aef94e3 --- /dev/null +++ b/third_party/blink/renderer/modules/xr/xr_webgl_binding.cc
@@ -0,0 +1,86 @@ +// Copyright 2020 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/modules/xr/xr_webgl_binding.h" + +#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h" +#include "third_party/blink/renderer/modules/webgl/webgl_texture.h" +#include "third_party/blink/renderer/modules/xr/xr_cube_map.h" +#include "third_party/blink/renderer/modules/xr/xr_light_probe.h" +#include "third_party/blink/renderer/modules/xr/xr_session.h" +#include "third_party/blink/renderer/modules/xr/xr_utils.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/graphics/gpu/extensions_3d_util.h" + +namespace blink { + +XRWebGLBinding* XRWebGLBinding::Create( + XRSession* session, + const WebGLRenderingContextOrWebGL2RenderingContext& context, + ExceptionState& exception_state) { + if (session->ended()) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + "Cannot create an XRWebGLBinding for an " + "XRSession which has already ended."); + return nullptr; + } + + WebGLRenderingContextBase* webgl_context = + webglRenderingContextBaseFromUnion(context); + + if (webgl_context->isContextLost()) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + "Cannot create an XRWebGLBinding with a " + "lost WebGL context."); + return nullptr; + } + + if (session->immersive() && !webgl_context->IsXRCompatible()) { + exception_state.ThrowDOMException( + DOMExceptionCode::kInvalidStateError, + "WebGL context must be marked as XR compatible in order to " + "use with an immersive XRSession"); + return nullptr; + } + + return MakeGarbageCollected<XRWebGLBinding>( + session, webgl_context, context.IsWebGL2RenderingContext()); +} + +XRWebGLBinding::XRWebGLBinding(XRSession* session, + WebGLRenderingContextBase* webgl_context, + bool webgl2) + : session_(session), webgl_context_(webgl_context), webgl2_(webgl2) {} + +WebGLTexture* XRWebGLBinding::getReflectionCubeMap( + XRLightProbe* light_probe, + ExceptionState& exception_state) { + if (!webgl2_ && !webgl_context_->ExtensionsUtil()->IsExtensionEnabled( + "OES_texture_half_float")) { + exception_state.ThrowDOMException( + DOMExceptionCode::kInvalidStateError, + "WebGL contexts must have the OES_texture_half_float extension enabled " + "prior to calling getReflectionCubeMap. This restriction does not " + "apply to WebGL 2.0 contexts."); + return nullptr; + } + + XRCubeMap* cube_map = light_probe->getReflectionCubeMap(); + if (!cube_map) { + return nullptr; + } + + WebGLTexture* texture = MakeGarbageCollected<WebGLTexture>(webgl_context_); + cube_map->updateWebGLEnvironmentCube(webgl_context_, texture); + + return texture; +} + +void XRWebGLBinding::Trace(Visitor* visitor) { + visitor->Trace(session_); + visitor->Trace(webgl_context_); + ScriptWrappable::Trace(visitor); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_binding.h b/third_party/blink/renderer/modules/xr/xr_webgl_binding.h new file mode 100644 index 0000000..c44d89c --- /dev/null +++ b/third_party/blink/renderer/modules/xr/xr_webgl_binding.h
@@ -0,0 +1,47 @@ +// Copyright 2020 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_MODULES_XR_XR_WEBGL_BINDING_H_ +#define THIRD_PARTY_BLINK_RENDERER_MODULES_XR_XR_WEBGL_BINDING_H_ + +#include "third_party/blink/renderer/bindings/modules/v8/webgl_rendering_context_or_webgl2_rendering_context.h" +#include "third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h" +#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context.h" +#include "third_party/blink/renderer/platform/bindings/script_wrappable.h" + +namespace blink { + +class ExceptionState; +class WebGLRenderingContextBase; +class WebGLTexture; +class XRLightProbe; +class XRSession; + +class XRWebGLBinding final : public ScriptWrappable { + DEFINE_WRAPPERTYPEINFO(); + + public: + XRWebGLBinding(XRSession*, WebGLRenderingContextBase*, bool webgl2); + ~XRWebGLBinding() override = default; + + static XRWebGLBinding* Create( + XRSession*, + const WebGLRenderingContextOrWebGL2RenderingContext&, + ExceptionState&); + + XRSession* session() const { return session_; } + + WebGLTexture* getReflectionCubeMap(XRLightProbe*, ExceptionState&); + + void Trace(Visitor*) override; + + private: + const Member<XRSession> session_; + Member<WebGLRenderingContextBase> webgl_context_; + bool webgl2_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_XR_XR_WEBGL_BINDING_H_
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_binding.idl b/third_party/blink/renderer/modules/xr/xr_webgl_binding.idl new file mode 100644 index 0000000..66b790d --- /dev/null +++ b/third_party/blink/renderer/modules/xr/xr_webgl_binding.idl
@@ -0,0 +1,16 @@ +// Copyright 2020 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://immersive-web.github.io/layers/#XRWebGLBindingtype +[ + SecureContext, + Exposed=Window, + RuntimeEnabled=WebXRLightEstimation +] interface XRWebGLBinding { + [RaisesException] constructor(XRSession session, XRWebGLRenderingContext context); + + // Lighting Estimation API + [RaisesException] + WebGLTexture? getReflectionCubeMap(XRLightProbe lightProbe); +}; \ No newline at end of file
diff --git a/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc b/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc index 8857d7d..1a251ce 100644 --- a/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc +++ b/third_party/blink/renderer/modules/xr/xr_webgl_layer.cc
@@ -8,12 +8,12 @@ #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h" #include "third_party/blink/renderer/core/inspector/console_message.h" -#include "third_party/blink/renderer/modules/webgl/webgl2_rendering_context.h" #include "third_party/blink/renderer/modules/webgl/webgl_framebuffer.h" -#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context.h" +#include "third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h" #include "third_party/blink/renderer/modules/xr/xr_frame_provider.h" #include "third_party/blink/renderer/modules/xr/xr_session.h" #include "third_party/blink/renderer/modules/xr/xr_system.h" +#include "third_party/blink/renderer/modules/xr/xr_utils.h" #include "third_party/blink/renderer/modules/xr/xr_view.h" #include "third_party/blink/renderer/modules/xr/xr_viewport.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" @@ -47,12 +47,8 @@ return nullptr; } - WebGLRenderingContextBase* webgl_context; - if (context.IsWebGL2RenderingContext()) { - webgl_context = context.GetAsWebGL2RenderingContext(); - } else { - webgl_context = context.GetAsWebGLRenderingContext(); - } + WebGLRenderingContextBase* webgl_context = + webglRenderingContextBaseFromUnion(context); if (webgl_context->isContextLost()) { exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
diff --git a/third_party/blink/renderer/platform/graphics/bitmap_image.cc b/third_party/blink/renderer/platform/graphics/bitmap_image.cc index a4dd2d3..882aa8c 100644 --- a/third_party/blink/renderer/platform/graphics/bitmap_image.cc +++ b/third_party/blink/renderer/platform/graphics/bitmap_image.cc
@@ -336,6 +336,10 @@ if (decoder_->FilenameExtension() == "jpg") { BitmapImageMetrics::CountImageOrientation( decoder_->OrientationAtIndex(0).Orientation()); + + IntSize correctedSize = decoder_->DensityCorrectedSizeAtIndex(0); + BitmapImageMetrics::CountImageDensityCorrection( + !correctedSize.IsEmpty() && correctedSize != decoder_->Size()); } }
diff --git a/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.cc b/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.cc index 0ebbe0c..d970b9e 100644 --- a/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.cc +++ b/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.cc
@@ -44,6 +44,13 @@ orientation_histogram.Count(orientation); } +void BitmapImageMetrics::CountImageDensityCorrection(bool density_correction_present) { + DEFINE_THREAD_SAFE_STATIC_LOCAL( + BooleanHistogram, density_correction_histogram, + ("Blink.DecodedImage.DensitySizeCorrectionDetected")); + density_correction_histogram.Count(density_correction_present); +} + void BitmapImageMetrics::CountImageJpegDensity(int image_min_side, uint64_t density_centi_bpp, size_t image_size_bytes) {
diff --git a/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h b/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h index 2d4fb112..84cbfdce 100644 --- a/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h +++ b/third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h
@@ -72,6 +72,7 @@ static void CountDecodedImageType(const String& type); static void CountImageOrientation(const ImageOrientationEnum); + static void CountImageDensityCorrection(bool densityCorrectionPresent); // Report the JPEG compression density in 0.01 bits per pixel for an image // with a smallest side (width or length) of |image_min_side| and total size // in bytes |image_size_bytes|.
diff --git a/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc b/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc index 78b4cbb0..12b46c0 100644 --- a/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc +++ b/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc
@@ -869,6 +869,29 @@ DecodedImageOrientationHistogramTest, testing::ValuesIn(kDecodedImageOrientationHistogramTestParams)); +using DecodedImageDensitySizeCorrectionDetectedHistogramTest = + BitmapHistogramTest<bool>; + +TEST_P(DecodedImageDensitySizeCorrectionDetectedHistogramTest, bool) { + RunTest("Blink.DecodedImage.DensitySizeCorrectionDetected"); +} + +const DecodedImageDensitySizeCorrectionDetectedHistogramTest::ParamType + kDecodedImageDensitySizeCorrectionHistogramTestParams[] = { + {"exif-resolution-none.jpg", false}, + {"exif-resolution-invalid-cm.jpg", false}, + {"exif-resolution-invalid-no-match.jpg", false}, + {"exif-resolution-invalid-partial.jpg", false}, + {"exif-resolution-no-change.jpg", false}, + {"exif-resolution-valid-hires.jpg", true}, + {"exif-resolution-valid-lores.jpg", true}, + {"exif-resolution-valid-non-uniform.jpg", true}}; + +INSTANTIATE_TEST_SUITE_P( + DecodedImageDensitySizeCorrectionDetectedHistogramTest, + DecodedImageDensitySizeCorrectionDetectedHistogramTest, + testing::ValuesIn(kDecodedImageDensitySizeCorrectionHistogramTestParams)); + using DecodedImageDensityHistogramTestKiBWeighted = BitmapHistogramTest<int>; TEST_P(DecodedImageDensityHistogramTestKiBWeighted, JpegDensity) {
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 4c4c0d1de..4daecb6 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -342,7 +342,7 @@ // We don't need to do copy-on-write for the resource here since writes to // the GMB are deferred until it needs to be dispatched to the display // compositor via ProduceCanvasResource. - if (is_accelerated_ && DoCopyOnWrite()) { + if (is_accelerated_ && ShouldReplaceTargetBuffer()) { DCHECK(!current_resource_has_write_access_) << "Write access must be released before sharing the resource"; @@ -352,21 +352,45 @@ resource_ = NewOrRecycledResource(); DCHECK(resource_); - EnsureWriteAccess(); - if (surface_) { - // Take read access to the outgoing resource for the skia copy below. - if (!old_resource_shared_image->HasReadAccess()) { - old_resource_shared_image->BeginReadAccess(); + auto* raster_interface = RasterInterface(); + if (raster_interface) { + if (!use_oop_rasterization_) + TearDownSkSurface(); + + if (mode_ == SkSurface::kRetain_ContentChangeMode) { + auto old_mailbox = old_resource_shared_image->GetOrCreateGpuMailbox( + kOrderingBarrier); + auto mailbox = resource()->GetOrCreateGpuMailbox(kOrderingBarrier); + + raster_interface->CopySubTexture( + old_mailbox, mailbox, GetBackingTextureTarget(), 0, 0, 0, 0, + Size().Width(), Size().Height(), false /* unpack_flip_y */, + false /* unpack_premultiply_alpha */); } - UMA_HISTOGRAM_BOOLEAN("Blink.Canvas.ContentChangeMode", - mode_ == SkSurface::kRetain_ContentChangeMode); - surface_->replaceBackendTexture(CreateGrTextureForResource(), - GetGrSurfaceOrigin(), mode_); - mode_ = SkSurface::kRetain_ContentChangeMode; - if (!old_resource_shared_image->HasReadAccess()) { - old_resource_shared_image->EndReadAccess(); + + // In non-OOPR mode we need to update the client side SkSurface with the + // copied texture. Recreating SkSurface here matches the GPU process + // behaviour that will happen in OOPR mode. + if (!use_oop_rasterization_) { + GetSkSurface(); + } + } else { + EnsureWriteAccess(); + if (surface_) { + // Take read access to the outgoing resource for the skia copy below. + if (!old_resource_shared_image->HasReadAccess()) { + old_resource_shared_image->BeginReadAccess(); + } + surface_->replaceBackendTexture(CreateGrTextureForResource(), + GetGrSurfaceOrigin(), mode_); + if (!old_resource_shared_image->HasReadAccess()) { + old_resource_shared_image->EndReadAccess(); + } } } + UMA_HISTOGRAM_BOOLEAN("Blink.Canvas.ContentChangeMode", + mode_ == SkSurface::kRetain_ContentChangeMode); + mode_ = SkSurface::kRetain_ContentChangeMode; } if (write_to_local_texture) @@ -418,7 +442,7 @@ ri->EndRasterCHROMIUM(); } - bool DoCopyOnWrite() { + bool ShouldReplaceTargetBuffer() { // If the canvas is single buffered, concurrent read/writes to the resource // are allowed. Note that we ignore the resource lost case as well since // that only indicates that we did not get a sync token for read/write @@ -526,7 +550,7 @@ FlushGrContext(); resource()->EndWriteAccess(); } else { - if (DoCopyOnWrite()) + if (ShouldReplaceTargetBuffer()) resource_ = NewOrRecycledResource(); resource()->CopyRenderingResultsToGpuMemoryBuffer( surface_->makeImageSnapshot()); @@ -1483,4 +1507,9 @@ return recorder_ && recorder_->ListHasDrawOps(); } +void CanvasResourceProvider::TearDownSkSurface() { + skia_canvas_ = nullptr; + surface_ = nullptr; +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h index 838c9d0..05edaca 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h
@@ -281,6 +281,7 @@ cc::PaintImage MakeImageSnapshot(); virtual void RasterRecord(sk_sp<cc::PaintRecord>); CanvasImageProvider* GetOrCreateCanvasImageProvider(); + void TearDownSkSurface(); ResourceProviderType type_; mutable sk_sp<SkSurface> surface_; // mutable for lazy init
diff --git a/third_party/blink/renderer/platform/graphics/deferred_image_decoder.cc b/third_party/blink/renderer/platform/graphics/deferred_image_decoder.cc index 4365f40..8ff386303 100644 --- a/third_party/blink/renderer/platform/graphics/deferred_image_decoder.cc +++ b/third_party/blink/renderer/platform/graphics/deferred_image_decoder.cc
@@ -123,6 +123,7 @@ : orientation_(kDefaultImageOrientation), is_received_(false) {} ImageOrientation orientation_; + IntSize density_corrected_size_; base::TimeDelta duration_; bool is_received_; @@ -363,6 +364,15 @@ return kDefaultImageOrientation; } +IntSize DeferredImageDecoder::DensityCorrectedSizeAtIndex(size_t index) const { + if (metadata_decoder_) + return metadata_decoder_->DensityCorrectedSize(); + if (index < frame_data_.size()) + return frame_data_[index].density_corrected_size_; + return Size(); +} + + size_t DeferredImageDecoder::ByteSize() const { return rw_buffer_ ? rw_buffer_->size() : 0u; } @@ -427,6 +437,7 @@ for (size_t i = previous_size; i < frame_data_.size(); ++i) { frame_data_[i].duration_ = metadata_decoder_->FrameDurationAtIndex(i); frame_data_[i].orientation_ = metadata_decoder_->Orientation(); + frame_data_[i].density_corrected_size_ = metadata_decoder_->DensityCorrectedSize(); frame_data_[i].is_received_ = metadata_decoder_->FrameIsReceivedAtIndex(i); }
diff --git a/third_party/blink/renderer/platform/graphics/deferred_image_decoder.h b/third_party/blink/renderer/platform/graphics/deferred_image_decoder.h index 43baddf..86d3237 100644 --- a/third_party/blink/renderer/platform/graphics/deferred_image_decoder.h +++ b/third_party/blink/renderer/platform/graphics/deferred_image_decoder.h
@@ -77,6 +77,7 @@ bool FrameIsReceivedAtIndex(size_t index) const; base::TimeDelta FrameDurationAtIndex(size_t index) const; ImageOrientation OrientationAtIndex(size_t index) const; + IntSize DensityCorrectedSizeAtIndex(size_t index) const; bool HotSpot(IntPoint&) const; SkAlphaType AlphaType() const;
diff --git a/third_party/blink/renderer/platform/graphics/logging_canvas.cc b/third_party/blink/renderer/platform/graphics/logging_canvas.cc index 6549038..2559f26 100644 --- a/third_party/blink/renderer/platform/graphics/logging_canvas.cc +++ b/third_party/blink/renderer/platform/graphics/logging_canvas.cc
@@ -217,7 +217,7 @@ path_item->SetString("fillType", FillTypeName(path.getFillType())); path_item->SetString("convexity", ConvexityName(path.getConvexityType())); path_item->SetBoolean("isRect", path.isRect(nullptr)); - SkPath::Iter iter(path, false); + SkPath::RawIter iter(path); SkPoint points[4]; auto path_points_array = std::make_unique<JSONArray>(); for (SkPath::Verb verb = iter.next(points); verb != SkPath::kDone_Verb;
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h index a6c73f5..31e7888 100644 --- a/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_hash_table_backing.h
@@ -111,7 +111,7 @@ template <WTF::WeakHandlingFlag WeakHandling = WTF::kNoWeakHandling> static void Trace(Visitor* visitor, const void* self) { if (!Traits::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut({self, &Trace})) + if (visitor->DeferredTraceIfConcurrent({self, &Trace})) return; }
diff --git a/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h b/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h index f83040e4..0c66678a 100644 --- a/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h +++ b/third_party/blink/renderer/platform/heap/collection_support/heap_vector_backing.h
@@ -110,7 +110,7 @@ static void Trace(Visitor* visitor, const void* self) { if (!Traits::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut({self, &Trace})) + if (visitor->DeferredTraceIfConcurrent({self, &Trace})) return; }
diff --git a/third_party/blink/renderer/platform/heap/incremental_marking_test.cc b/third_party/blink/renderer/platform/heap/incremental_marking_test.cc index b59e372..dcd27e6 100644 --- a/third_party/blink/renderer/platform/heap/incremental_marking_test.cc +++ b/third_party/blink/renderer/platform/heap/incremental_marking_test.cc
@@ -63,14 +63,6 @@ value_trace_callback(this, value); } - // Unused overrides. - void VisitWeak(const void* object, - const void* object_weak_ref, - TraceDescriptor desc, - WeakCallback callback) final {} - void RegisterWeakCallback(WeakCallback, const void*) final {} - void Visit(const TraceWrapperV8Reference<v8::Value>&) final {} - private: Vector<void*>* objects_; };
diff --git a/third_party/blink/renderer/platform/heap/marking_verifier.h b/third_party/blink/renderer/platform/heap/marking_verifier.h index 0113d6a..f7ce363b 100644 --- a/third_party/blink/renderer/platform/heap/marking_verifier.h +++ b/third_party/blink/renderer/platform/heap/marking_verifier.h
@@ -32,10 +32,6 @@ WeakCallback, const void*) final; - // Unused overrides. - void RegisterWeakCallback(WeakCallback, const void*) final {} - void Visit(const TraceWrapperV8Reference<v8::Value>&) final {} - private: void VerifyChild(const void* object, const void* base_object_payload);
diff --git a/third_party/blink/renderer/platform/heap/marking_visitor.h b/third_party/blink/renderer/platform/heap/marking_visitor.h index af99c8f..60f312e4 100644 --- a/third_party/blink/renderer/platform/heap/marking_visitor.h +++ b/third_party/blink/renderer/platform/heap/marking_visitor.h
@@ -111,17 +111,13 @@ // Base visitor used to mark Oilpan objects on any thread. template <class Specialized> class PLATFORM_EXPORT MarkingVisitorBase : public MarkingVisitorCommon { - public: - void Visit(const void* object, TraceDescriptor desc) final; - - // Unused cross-component visit methods. - void Visit(const TraceWrapperV8Reference<v8::Value>&) override {} - protected: MarkingVisitorBase(ThreadState* state, MarkingMode marking_mode, int task_id) : MarkingVisitorCommon(state, marking_mode, task_id) {} ~MarkingVisitorBase() override = default; + void Visit(const void* object, TraceDescriptor desc) final; + // Marks an object and adds a tracing callback for processing of the object. void MarkHeader(HeapObjectHeader*, const TraceDescriptor&); }; @@ -273,7 +269,7 @@ bool IsConcurrent() const override { return true; } - bool ConcurrentTracingBailOut(TraceDescriptor desc) override { + bool DeferredTraceIfConcurrent(TraceDescriptor desc) override { not_safe_to_concurrently_trace_worklist_.Push(desc); return true; }
diff --git a/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.h b/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.h index d2e6631..6ff6cb6a 100644 --- a/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.h +++ b/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.h
@@ -24,12 +24,12 @@ public: virtual ~UnifiedHeapMarkingVisitorBase() = default; - // Visitation methods that announce reachable wrappers to V8. - void VisitImpl(const TraceWrapperV8Reference<v8::Value>&); - protected: UnifiedHeapMarkingVisitorBase(ThreadState*, v8::Isolate*, int); + // Visitation methods that announce reachable wrappers to V8. + void VisitImpl(const TraceWrapperV8Reference<v8::Value>&); + v8::Isolate* const isolate_; v8::EmbedderHeapTracer* const controller_; V8ReferencesWorklist::View v8_references_worklist_; @@ -54,6 +54,8 @@ UnifiedHeapMarkingVisitor(ThreadState*, MarkingMode, v8::Isolate*); ~UnifiedHeapMarkingVisitor() override = default; + protected: + using Visitor::Visit; void Visit(const TraceWrapperV8Reference<v8::Value>&) final; private: @@ -72,10 +74,13 @@ int task_id); ~ConcurrentUnifiedHeapMarkingVisitor() override = default; - void Visit(const TraceWrapperV8Reference<v8::Value>&) final; void FlushWorklists() override; + protected: + using Visitor::Visit; + void Visit(const TraceWrapperV8Reference<v8::Value>&) final; + private: DISALLOW_COPY_AND_ASSIGN(ConcurrentUnifiedHeapMarkingVisitor); };
diff --git a/third_party/blink/renderer/platform/heap/visitor.h b/third_party/blink/renderer/platform/heap/visitor.h index b5db7048..b2880df 100644 --- a/third_party/blink/renderer/platform/heap/visitor.h +++ b/third_party/blink/renderer/platform/heap/visitor.h
@@ -203,8 +203,8 @@ T* t = key.Get(); if (!t) return; - VisitEphemeron(TraceTrait<T>::GetTraceDescriptor(t).base_object_payload, - value, value_trace_callback); + VisitEphemeron(TraceDescriptorFor(t).base_object_payload, value, + value_trace_callback); } template <typename T> @@ -227,6 +227,34 @@ RegisterMovableSlot(reinterpret_cast<const void* const*>(slot)); } + // Cross-component tracing interface. + template <typename V8Type> + void Trace(const TraceWrapperV8Reference<V8Type>& v8reference) { + Visit(v8reference.template Cast<v8::Value>()); + } + + // Dynamic visitor interface. + + // Registers backing store pointers so that they can be moved and properly + // updated. + virtual void RegisterBackingStoreCallback(const void* backing, + MovingObjectCallback) {} + + // Adds a |callback| that is invoked with |parameter| after liveness has been + // computed on the whole object graph. The |callback| may use the provided + // |LivenessBroker| to determine whether an object is considered alive or + // dead. + // + // - Upon returning from the callback all references to dead objects must have + // been cleared. + // - Any operation that extends the object graph, including allocation + // or reviving objects, is prohibited. + // - Clearing out pointers is allowed. + // - Removing elements from heap collections is allowed as these collections + // are aware of custom weakness and won't resize their backings. + virtual void RegisterWeakCallback(WeakCallback callback, + const void* parameter) {} + // Registers an instance method using |RegisterWeakCallback|. See description // below. template <typename T, void (T::*method)(const LivenessBroker&)> @@ -235,14 +263,29 @@ obj); } - // Cross-component tracing interface. + // Returns whether the visitor is used in a concurrent setting. + virtual bool IsConcurrent() const { return false; } - template <typename V8Type> - void Trace(const TraceWrapperV8Reference<V8Type>& v8reference) { - Visit(v8reference.template Cast<v8::Value>()); - } + // Defers invoking |desc| to the main thread when running concurrently. + // Returns true if |desc| has been queued for later processing and false if + // running in a non-concurrent setting. + // + // This can be used to defer processing data structures to the main thread + // when support for concurrent processing is missing. + virtual bool DeferredTraceIfConcurrent(TraceDescriptor desc) { return false; } - // Dynamic visitor interface. + protected: + // Visits an object through a strong reference. + virtual void Visit(const void*, TraceDescriptor) {} + + // Visits an object through a weak reference. + virtual void VisitWeak(const void*, + const void*, + TraceDescriptor, + WeakCallback) {} + + // Visits cross-component references to V8. + virtual void Visit(const TraceWrapperV8Reference<v8::Value>&) {} virtual void VisitRoot(const void* t, TraceDescriptor desc, @@ -250,15 +293,6 @@ Visit(t, desc); } - // Visits an object through a strong reference. - virtual void Visit(const void*, TraceDescriptor) = 0; - - // Visits an object through a weak reference. - virtual void VisitWeak(const void*, - const void*, - TraceDescriptor, - WeakCallback) = 0; - // Visits ephemeron pairs which are a combination of weak and strong keys and // values. virtual void VisitEphemeron(const void*, const void*, TraceCallback) {} @@ -278,44 +312,10 @@ WeakCallback weak_callback, const void* weak_callback_parameter) {} - // Visits cross-component references to V8. - - virtual void Visit(const TraceWrapperV8Reference<v8::Value>&) = 0; - - // Registers backing store pointers so that they can be moved and properly - // updated. - virtual void RegisterBackingStoreCallback(const void* backing, - MovingObjectCallback) {} - virtual void RegisterMovableSlot(const void* const* slot) {} - // Adds a |callback| that is invoked with |parameter| after liveness has been - // computed on the whole object graph. The |callback| may use the provided - // |LivenessBroker| to determine whether an object is considered alive or - // dead. - // - // - Upon returning from the callback all references to dead objects must have - // been cleared. - // - Any operation that extends the object graph, including allocation - // or reviving objects, is prohibited. - // - Clearing out pointers is allowed. - // - Removing elements from heap collections is allowed as these collections - // are aware of custom weakness and won't resize their backings. - virtual void RegisterWeakCallback(WeakCallback callback, - const void* parameter) = 0; - - virtual bool IsConcurrent() const { return false; } - - // TODO(crbug/986235): ConcurrentTracingBailOut is part of a temporary - // bailout mechanism to avoid tracing collections on concurrent threads. - // This method and any usage of it will be removed as soon as making all - // collections cuncurrent-safe is finished. - // The same also applies to NotSafeToConcurrentlyTraceWorklist in heap.h. - virtual bool ConcurrentTracingBailOut(TraceDescriptor desc) { return false; } - - protected: template <typename T> - static inline TraceDescriptor TraceDescriptorFor(const T* traceable) { + static TraceDescriptor TraceDescriptorFor(const T* traceable) { return TraceTrait<T>::GetTraceDescriptor(traceable); }
diff --git a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc index 181e473..d76dc22 100644 --- a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc +++ b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
@@ -450,7 +450,9 @@ return false; auto size = gfx::Size(image->width, image->height); if (image->alphaPlane) { - if (pixel_format == media::PIXEL_FORMAT_I420) { + if (pixel_format == media::PIXEL_FORMAT_I420 && image->yuvPlanes[1] && + image->yuvPlanes[2]) { + // Genuine YUV 4:2:0, not monochrome 4:0:0. pixel_format = media::PIXEL_FORMAT_I420A; } else { NOTIMPLEMENTED(); @@ -467,9 +469,10 @@ image->yuvRowBytes[1], image->yuvRowBytes[2], image->yuvPlanes[0], image->yuvPlanes[1], image->yuvPlanes[2], base::TimeDelta()); } + frame->set_color_space(frame_cs); - // Really only handles 709, 601, JPEG 8-bit conversions and uses libyuv - // under the hood, so is much faster than our manual path. + // Really only handles 709, 601, 2020, JPEG 8-bit conversions and uses + // libyuv under the hood, so is much faster than our manual path. // // Technically has support for 10-bit 4:2:0 and 4:2:2, but not to // half-float and only has support for 4:4:4 and 12-bit by down-shifted
diff --git a/third_party/blink/renderer/platform/image-decoders/image_decoder.h b/third_party/blink/renderer/platform/image-decoders/image_decoder.h index 022f17a..8e2ece9 100644 --- a/third_party/blink/renderer/platform/image-decoders/image_decoder.h +++ b/third_party/blink/renderer/platform/image-decoders/image_decoder.h
@@ -315,6 +315,7 @@ virtual size_t FrameBytesAtIndex(size_t) const; ImageOrientation Orientation() const { return orientation_; } + IntSize DensityCorrectedSize() const { return density_corrected_size_; } bool IgnoresColorSpace() const { return color_behavior_.IsIgnore(); } const ColorBehavior& GetColorBehavior() const { return color_behavior_; } @@ -474,6 +475,7 @@ const HighBitDepthDecodingOption high_bit_depth_decoding_option_; const ColorBehavior color_behavior_; ImageOrientation orientation_; + IntSize density_corrected_size_; // The maximum amount of memory a decoded image should require. Ideally, // image decoders should downsample large images to fit under this limit
diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc index 1a7ed7d..eaf5c7d 100644 --- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc +++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
@@ -42,6 +42,7 @@ #include "base/numerics/checked_math.h" #include "build/build_config.h" +#include "third_party/blink/renderer/platform/geometry/float_size.h" #include "third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h" #include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" @@ -223,6 +224,14 @@ (GETJOCTET(data[1]) << 8) | GETJOCTET(data[0]); } +static float ReadUnsignedRational(JOCTET* data, bool is_big_endian) { + unsigned nom = ReadUint32(data, is_big_endian); + unsigned denom = ReadUint32(data + 4, is_big_endian); + if (!denom) + return 0; + return float(nom) / float(denom); +} + static bool CheckExifHeader(jpeg_saved_marker_ptr marker, bool& is_big_endian, unsigned& ifd_offset) { @@ -251,11 +260,118 @@ return true; } -static ImageOrientation ReadImageOrientation(jpeg_decompress_struct* info) { +struct DecodedImageMetaData { + ImageOrientation orientation; + FloatSize resolution; + IntSize size; + unsigned resolution_unit { 0 }; +}; + +static IntSize ExtractDensityCorrectedSize(const DecodedImageMetaData& metadata, const IntSize& physical_size) { + const unsigned kDefaultResolution = 72; + const unsigned kresolution_unitDPI = 2; + + if (metadata.resolution_unit != kresolution_unitDPI || metadata.resolution.IsEmpty() || metadata.size.IsEmpty()) + return physical_size; + + CHECK(metadata.resolution.Width()); + CHECK(metadata.resolution.Height()); + + // Division by zero is not possible since we check for empty resolution earlier. + IntSize size_from_resolution( + physical_size.Width() * kDefaultResolution / metadata.resolution.Width(), + physical_size.Height() * kDefaultResolution / metadata.resolution.Height()); + + if (size_from_resolution == metadata.size) + return metadata.size; + + return physical_size; +} + +static void ReadExifDirectory(JOCTET* dir_start, JOCTET* tiff_start, JOCTET* root_dir_start, JOCTET* data_end, bool is_big_endian, DecodedImageMetaData& metadata) { + const unsigned kUnsignedShortType = 3; + const unsigned kUnsignedLongType = 4; + const unsigned kUnsignedRationalType = 5; + + enum ExifTags { + kOrientationTag = 0x112, + kResolutionXTag = 0x11a, + kResolutionYTag = 0x11b, + kresolution_unitTag = 0x128, + kPixelXDimensionTag = 0xa002, + kPixelYDimensionTag = 0xa003, + kExifOffsetTag = 0x8769 + }; + + if (data_end - dir_start < 2) + return; + + unsigned tag_count = ReadUint16(dir_start, is_big_endian); + JOCTET* ifd = dir_start + 2; // Skip over the uint16 that was just read. + + // Every ifd entry is 2 bytes of tag, 2 bytes of contents datatype, + // 4 bytes of number-of-elements, and 4 bytes of either offset to the + // tag data, or if the data is small enough, the inlined data itself. + const int kIfdEntrySize = 12; + for (unsigned i = 0; i < tag_count && data_end - ifd >= kIfdEntrySize; + ++i, ifd += kIfdEntrySize) { + unsigned tag = ReadUint16(ifd, is_big_endian); + unsigned type = ReadUint16(ifd + 2, is_big_endian); + unsigned count = ReadUint32(ifd + 4, is_big_endian); + JOCTET* value_ptr = ifd + 8; + + // EXIF stores the value with an offset if it's bigger than 4 bytes, e.g. for rational values. + if (type == kUnsignedRationalType) { + value_ptr = tiff_start + ReadUint32(value_ptr, is_big_endian); + // Make sure offset points to a valid location. + if (value_ptr < ifd || value_ptr > data_end - 16) + continue; + } + + switch (tag) { + case ExifTags::kOrientationTag: + if (type == kUnsignedShortType && count == 1) + metadata.orientation = ImageOrientation::FromEXIFValue(ReadUint16(value_ptr, is_big_endian)); + break; + + case ExifTags::kresolution_unitTag: + if (type == kUnsignedShortType && count == 1) + metadata.resolution_unit = ReadUint16(value_ptr, is_big_endian); + break; + + case ExifTags::kResolutionXTag: + if (type == kUnsignedRationalType && count == 1) + metadata.resolution.SetWidth(ReadUnsignedRational(value_ptr, is_big_endian)); + break; + + case ExifTags::kResolutionYTag: + if (type == kUnsignedRationalType && count == 1) + metadata.resolution.SetHeight(ReadUnsignedRational(value_ptr, is_big_endian)); + break; + + case ExifTags::kPixelXDimensionTag: + if (type == kUnsignedShortType && count == 1) + metadata.size.SetWidth(ReadUint16(value_ptr, is_big_endian)); + break; + + case ExifTags::kPixelYDimensionTag: + if (type == kUnsignedShortType && count == 1) + metadata.size.SetHeight(ReadUint16(value_ptr, is_big_endian)); + break; + + case ExifTags::kExifOffsetTag: + if (type == kUnsignedLongType && count == 1) { + auto subdir_offset = ReadUint32(value_ptr, is_big_endian); + ReadExifDirectory(root_dir_start + subdir_offset, tiff_start, root_dir_start, data_end, is_big_endian, metadata); + } + break; + } + } +} + +static void ReadImageMetaData(jpeg_decompress_struct* info, DecodedImageMetaData& metadata) { // The JPEG decoder looks at EXIF metadata. // FIXME: Possibly implement XMP and IPTC support. - const unsigned kOrientationTag = 0x112; - const unsigned kShortType = 3; for (jpeg_saved_marker_ptr marker = info->marker_list; marker; marker = marker->next) { bool is_big_endian; @@ -267,36 +383,19 @@ if (marker->data_length < kOffsetToTiffData || ifd_offset >= marker->data_length - kOffsetToTiffData) continue; - ifd_offset += kOffsetToTiffData; // The jpeg exif container format contains a tiff block for metadata. // A tiff image file directory (ifd) consists of a uint16_t describing // the number of ifd entries, followed by that many entries. // When touching this code, it's useful to look at the tiff spec: // http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf - JOCTET* ifd = marker->data + ifd_offset; - JOCTET* end = marker->data + marker->data_length; - if (end - ifd < 2) - continue; - unsigned tag_count = ReadUint16(ifd, is_big_endian); - ifd += 2; // Skip over the uint16 that was just read. + JOCTET* data_end = marker->data + marker->data_length; + JOCTET* root_start = marker->data + kOffsetToTiffData; + JOCTET* tiff_start = marker->data + ifd_offset; + JOCTET* ifd0 = root_start + ifd_offset; - // Every ifd entry is 2 bytes of tag, 2 bytes of contents datatype, - // 4 bytes of number-of-elements, and 4 bytes of either offset to the - // tag data, or if the data is small enough, the inlined data itself. - const int kIfdEntrySize = 12; - for (unsigned i = 0; i < tag_count && end - ifd >= kIfdEntrySize; - ++i, ifd += kIfdEntrySize) { - unsigned tag = ReadUint16(ifd, is_big_endian); - unsigned type = ReadUint16(ifd + 2, is_big_endian); - unsigned count = ReadUint32(ifd + 4, is_big_endian); - if (tag == kOrientationTag && type == kShortType && count == 1) - return ImageOrientation::FromEXIFValue( - ReadUint16(ifd + 8, is_big_endian)); - } + ReadExifDirectory(ifd0, tiff_start, root_start, data_end, is_big_endian, metadata); } - - return ImageOrientation(); } static IntSize ComputeYUVSize(const jpeg_decompress_struct* info, @@ -565,7 +664,10 @@ jpeg_calc_output_dimensions(&info_); decoder_->SetDecodedSize(info_.output_width, info_.output_height); - decoder_->SetOrientation(ReadImageOrientation(Info())); + DecodedImageMetaData metadata; + ReadImageMetaData(Info(), metadata); + decoder_->SetOrientation(metadata.orientation); + decoder_->SetDensityCorrectedSize(ExtractDensityCorrectedSize(metadata, IntSize(info_.output_width, info_.output_height))); // Allow color management of the decoded RGBA pixels if possible. if (!decoder_->IgnoresColorSpace()) {
diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h index c2e6078e..203afe9 100644 --- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h +++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.h
@@ -47,6 +47,7 @@ String FilenameExtension() const override { return "jpg"; } void OnSetData(SegmentReader* data) override; IntSize DecodedSize() const override { return decoded_size_; } + IntSize DensityCorrectedSize() const { return density_corrected_size_.IsEmpty() ? DecodedSize() : density_corrected_size_; } bool SetSize(unsigned width, unsigned height) override; IntSize DecodedYUVSize(int component) const override; size_t DecodedYUVWidthBytes(int component) const override; @@ -63,6 +64,10 @@ void SetOrientation(ImageOrientation orientation) { orientation_ = orientation; } + + void SetDensityCorrectedSize(const IntSize& size) { + density_corrected_size_ = size; + } void SetDecodedSize(unsigned width, unsigned height); void SetSupportedDecodeSizes(Vector<SkISize> sizes);
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-cm.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-cm.jpg new file mode 100644 index 0000000..26fb10f --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-cm.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-no-match.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-no-match.jpg new file mode 100644 index 0000000..59a14e0a --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-no-match.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-partial.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-partial.jpg new file mode 100644 index 0000000..18ff3ae --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-invalid-partial.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-no-change.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-no-change.jpg new file mode 100644 index 0000000..04f9202c --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-no-change.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-none.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-none.jpg new file mode 100644 index 0000000..04f9202c --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-none.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-hires.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-hires.jpg new file mode 100644 index 0000000..757ce2d --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-hires.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-lores.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-lores.jpg new file mode 100644 index 0000000..11a5d8b12 --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-lores.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-non-uniform.jpg b/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-non-uniform.jpg new file mode 100644 index 0000000..a028bde --- /dev/null +++ b/third_party/blink/renderer/platform/testing/data/exif-resolution-valid-non-uniform.jpg Binary files differ
diff --git a/third_party/blink/renderer/platform/wtf/deque.h b/third_party/blink/renderer/platform/wtf/deque.h index 9b31485..3a3c59e0 100644 --- a/third_party/blink/renderer/platform/wtf/deque.h +++ b/third_party/blink/renderer/platform/wtf/deque.h
@@ -688,7 +688,7 @@ Deque<T, inlineCapacity, Allocator>::Trace(VisitorDispatcher visitor) const { // Bail out for concurrent marking. if (!VectorTraits<T>::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut( + if (visitor->DeferredTraceIfConcurrent( {this, [](blink::Visitor* visitor, const void* object) { reinterpret_cast<const Deque<T, inlineCapacity, Allocator>*>( object)
diff --git a/third_party/blink/renderer/platform/wtf/hash_table.h b/third_party/blink/renderer/platform/wtf/hash_table.h index 2ad6f20b..9e29ea7 100644 --- a/third_party/blink/renderer/platform/wtf/hash_table.h +++ b/third_party/blink/renderer/platform/wtf/hash_table.h
@@ -2151,7 +2151,7 @@ Trace(VisitorDispatcher visitor) const { // bail out for concurrent marking if (!Traits::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut( + if (visitor->DeferredTraceIfConcurrent( {this, [](blink::Visitor* visitor, const void* object) { reinterpret_cast< const HashTable<Key, Value, Extractor, HashFunctions, Traits,
diff --git a/third_party/blink/renderer/platform/wtf/linked_hash_set.h b/third_party/blink/renderer/platform/wtf/linked_hash_set.h index 3fa5088..87f30a5 100644 --- a/third_party/blink/renderer/platform/wtf/linked_hash_set.h +++ b/third_party/blink/renderer/platform/wtf/linked_hash_set.h
@@ -339,7 +339,7 @@ template <typename VisitorDispatcher> void Trace(VisitorDispatcher visitor) const { if (!NodeHashTraits::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut( + if (visitor->DeferredTraceIfConcurrent( {this, [](blink::Visitor* visitor, const void* object) { reinterpret_cast<const LinkedHashSet<ValueArg, HashFunctions, TraitsArg, Allocator>*>(
diff --git a/third_party/blink/renderer/platform/wtf/list_hash_set.h b/third_party/blink/renderer/platform/wtf/list_hash_set.h index b247f2f4..f928794 100644 --- a/third_party/blink/renderer/platform/wtf/list_hash_set.h +++ b/third_party/blink/renderer/platform/wtf/list_hash_set.h
@@ -522,7 +522,7 @@ std::enable_if_t<A::kIsGarbageCollected> Trace( VisitorDispatcher visitor) const { if (!ListHashSetTraits<Value, NodeAllocator>::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut( + if (visitor->DeferredTraceIfConcurrent( {this, [](blink::Visitor* visitor, const void* object) { reinterpret_cast< const ListHashSetNode<ValueArg, AllocatorArg>*>(object) @@ -1209,7 +1209,7 @@ std::enable_if_t<A::kIsGarbageCollected> ListHashSet<T, inlineCapacity, U, V>::Trace(VisitorDispatcher visitor) const { if (!NodeTraits::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut( + if (visitor->DeferredTraceIfConcurrent( {this, [](blink::Visitor* visitor, const void* object) { reinterpret_cast<const ListHashSet<T, inlineCapacity, U, V>*>( object)
diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h index 479ab1c..267eb90 100644 --- a/third_party/blink/renderer/platform/wtf/vector.h +++ b/third_party/blink/renderer/platform/wtf/vector.h
@@ -2092,7 +2092,7 @@ Vector<T, inlineCapacity, Allocator>::Trace(VisitorDispatcher visitor) const { // Bail out for concurrent marking. if (!VectorTraits<T>::kCanTraceConcurrently) { - if (visitor->ConcurrentTracingBailOut( + if (visitor->DeferredTraceIfConcurrent( {this, [](blink::Visitor* visitor, const void* object) { reinterpret_cast<const Vector<T, inlineCapacity, Allocator>*>( object)
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/outline-with-001-crash.html b/third_party/blink/web_tests/external/wpt/css/css-ui/outline-with-001-crash.html new file mode 100644 index 0000000..d46ba80 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/outline-with-001-crash.html
@@ -0,0 +1,5 @@ +<!DOCTYPE html> +<title>CSS Basic User Interface Test: outline-width very big value</title> +<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> +<link rel="help" href="https://drafts.csswg.org/css-ui/#outline-width"> +<div style="outline: solid black 100000000000000000px;"></div>
diff --git a/third_party/blink/web_tests/external/wpt/lint.ignore b/third_party/blink/web_tests/external/wpt/lint.ignore index 49f88dd..8cfef1e 100644 --- a/third_party/blink/web_tests/external/wpt/lint.ignore +++ b/third_party/blink/web_tests/external/wpt/lint.ignore
@@ -201,8 +201,8 @@ SET TIMEOUT: shadow-dom/Document-prototype-currentScript.html SET TIMEOUT: shadow-dom/scroll-to-the-fragment-in-shadow-tree.html SET TIMEOUT: shadow-dom/slotchange-event.html -SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.https.html -SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.https.html +SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html +SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html SET TIMEOUT: user-timing/* SET TIMEOUT: web-animations/timing-model/animations/* SET TIMEOUT: webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
diff --git a/third_party/blink/web_tests/external/wpt/orientation-event/resources/orientation-event-helpers.js b/third_party/blink/web_tests/external/wpt/orientation-event/resources/orientation-event-helpers.js index 84bfc51..307c52f0 100644 --- a/third_party/blink/web_tests/external/wpt/orientation-event/resources/orientation-event-helpers.js +++ b/third_party/blink/web_tests/external/wpt/orientation-event/resources/orientation-event-helpers.js
@@ -181,10 +181,14 @@ } function waitForEvent(expected_event) { - return new Promise(resolve => { + return new Promise((resolve, reject) => { window.addEventListener(expected_event.type, (event) => { - assertEventEquals(event, expected_event); - resolve(); + try { + assertEventEquals(event, expected_event); + resolve(); + } catch (e) { + reject(e); + } }, { once: true }); }); }
diff --git a/third_party/blink/web_tests/external/wpt/portals/OWNERS b/third_party/blink/web_tests/external/wpt/portals/OWNERS new file mode 100644 index 0000000..13d38116 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/portals/OWNERS
@@ -0,0 +1,3 @@ +# COMPONENT: Blink>HTML>Portal +# WPT-NOTIFY: true +file://third_party/blink/renderer/core/html/portal/OWNERS
diff --git a/third_party/blink/web_tests/external/wpt/resize-observer/change-layout-in-error.html b/third_party/blink/web_tests/external/wpt/resize-observer/change-layout-in-error.html new file mode 100644 index 0000000..9083fb4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/resize-observer/change-layout-in-error.html
@@ -0,0 +1,33 @@ +<!doctype HTML> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> + div { + width: 100px; + height: 100px; + } +</style> +<div id="observeme"></div> + +<script> +setup({allow_uncaught_exception: true}); + +async_test(a => { + let t = document.querySelector("#observeme"); + let i = 0; + window.onerror = function (err) { + t.style.height = "112px"; + i++; + requestAnimationFrame(a.step_func_done(() => { + assert_equals(i, 1); + }), 0); + }; + + new ResizeObserver(function() { + t.style.height = "111px"; + }).observe(observeme); + observeme.style.height = "110px"; + +}, "Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached."); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString-regression.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString-regression.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString-regression.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString-regression.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/DOMParser-parseFromString.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Document-write.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Document-write.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Document-write.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Document-write.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentHTML.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentHTML.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentHTML.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentHTML.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentText.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentText.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentText.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Element-insertAdjacentText.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Element-outerHTML.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Element-outerHTML.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Element-outerHTML.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Element-outerHTML.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttribute.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttribute.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttribute.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttribute.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttributeNS.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttributeNS.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttributeNS.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Element-setAttributeNS.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/GlobalEventHandlers-onclick.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/GlobalEventHandlers-onclick.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/GlobalEventHandlers-onclick.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/GlobalEventHandlers-onclick.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/HTMLElement-generic.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/HTMLElement-generic.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/HTMLElement-generic.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/HTMLElement-generic.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/HTMLScriptElement-internal-slot.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/HTMLScriptElement-internal-slot.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/HTMLScriptElement-internal-slot.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/HTMLScriptElement-internal-slot.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Node-multiple-arguments.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Node-multiple-arguments.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Node-multiple-arguments.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Node-multiple-arguments.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Range-createContextualFragment.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Range-createContextualFragment.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Range-createContextualFragment.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Range-createContextualFragment.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedType-AttributeNodes.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedType-AttributeNodes.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedType-AttributeNodes.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedType-AttributeNodes.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-no-name.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-no-name.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-no-name.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-no-name.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-wildcard.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-wildcard.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-wildcard.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-CSP-wildcard.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-createXXX.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-createXXX.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-createXXX.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicy-createXXX.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-constants.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-constants.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-constants.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-constants.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-defaultPolicy.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-defaultPolicy.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-defaultPolicy.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-defaultPolicy.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-getPropertyType.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-getPropertyType.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-getPropertyType.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-getPropertyType.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-isXXX.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-isXXX.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-isXXX.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-isXXX.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-metadata.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-metadata.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-metadata.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/TrustedTypePolicyFactory-metadata.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/Window-TrustedTypes.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/Window-TrustedTypes.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/Window-TrustedTypes.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/Window-TrustedTypes.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/WorkerGlobalScope-importScripts.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-Node-multiple-arguments.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-Node-multiple-arguments.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-Node-multiple-arguments.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-Node-multiple-arguments.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMParser-parseFromString.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMParser-parseFromString.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMParser-parseFromString.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMParser-parseFromString.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Document-write.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Document-write.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Document-write.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Document-write.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-outerHTML.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-outerHTML.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-outerHTML.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-outerHTML.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttribute.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttribute.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttribute.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttribute.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttributeNS.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttributeNS.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttributeNS.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Element-setAttributeNS.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-HTMLElement-generic.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-HTMLElement-generic.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-HTMLElement-generic.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-HTMLElement-generic.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Range-createContextualFragment.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Range-createContextualFragment.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Range-createContextualFragment.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-string-assignment-to-Range-createContextualFragment.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/block-text-node-insertion-into-script-element.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/block-text-node-insertion-into-script-element.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/block-text-node-insertion-into-script-element.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/block-text-node-insertion-into-script-element.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/csp-block-eval.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/csp-block-eval.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/csp-block-eval.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/csp-block-eval.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.html.headers similarity index 100% copy from third_party/blink/web_tests/external/wpt/trusted-types/default-policy-report-only.tentative.https.html.headers copy to third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.https.html.headers deleted file mode 100644 index 4c1ff15..0000000 --- a/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy-report-only.tentative.https.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Content-Security-Policy-Report-Only: require-trusted-types-for 'script';
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.html.headers similarity index 100% copy from third_party/blink/web_tests/external/wpt/trusted-types/default-policy.tentative.https.html.headers copy to third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.https.html.headers deleted file mode 100644 index 604e765..0000000 --- a/third_party/blink/web_tests/external/wpt/trusted-types/empty-default-policy.tentative.https.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Content-Security-Policy: require-trusted-types-for 'script';
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-no-tt.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-no-tt.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-no-tt.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-no-tt.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-default-policy.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-default-policy.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-default-policy.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-default-policy.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-no-default-policy.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-no-default-policy.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-no-default-policy.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/eval-csp-tt-no-default-policy.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt-default-policy.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt-default-policy.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt-default-policy.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt-default-policy.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/eval-no-csp-no-tt.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/eval-with-permissive-csp.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/eval-with-permissive-csp.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/eval-with-permissive-csp.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/eval-with-permissive-csp.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.https.window-expected.txt b/third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.window-expected.txt similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.https.window-expected.txt rename to third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.window-expected.txt
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.https.window.js b/third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.window.js similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.https.window.js rename to third_party/blink/web_tests/external/wpt/trusted-types/idlharness.tentative.window.js
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/no-require-trusted-types-for.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/nonsecure-require-trusted-types-for.tentative.html b/third_party/blink/web_tests/external/wpt/trusted-types/nonsecure-require-trusted-types-for.tentative.html deleted file mode 100644 index 46dae7a..0000000 --- a/third_party/blink/web_tests/external/wpt/trusted-types/nonsecure-require-trusted-types-for.tentative.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<head> - <script src="/resources/testharness.js"></script> - <script src="/resources/testharnessreport.js"></script> - <meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'"> -</head> -<body> -<script> - const testCases = [ - ["script", "src"], - ["div", "innerHTML"], - ["script", "text"], - ]; - - testCases.forEach(c => { - const name = `${c[0]}.${c[1]} `; - test(t => { - s = document.createElement(c[0]); - s[c[1]] = "https://example.com/"; - assert_equals("https://example.com/", s[c[1]].toString()); - }, name + "without trusted types is not blocked by require-trusted-types-for on non-secure pages"); - }); -</script> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/nonsecure-require-trusted-types-for.tentative.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/nonsecure-require-trusted-types-for.tentative.html.headers deleted file mode 100644 index af6596b..0000000 --- a/third_party/blink/web_tests/external/wpt/trusted-types/nonsecure-require-trusted-types-for.tentative.html.headers +++ /dev/null
@@ -1 +0,0 @@ -Content-Security-Policy: require-trusted-types-for 'script'
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/require-trusted-types-for.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-createHTMLDocument.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-createHTMLDocument.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-createHTMLDocument.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-createHTMLDocument.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names-list.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-duplicate-names.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-eval-reporting.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-navigation.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-navigation.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-navigation.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-navigation.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-report-only.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.https.html.sub.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.html.sub.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.https.html.sub.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting-check-report.html.sub.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.https.html.headers b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.html.headers similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.https.html.headers rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-reporting.tentative.html.headers
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative.https-expected.txt b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative-expected.txt similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative.https-expected.txt rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative-expected.txt
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/trusted-types-svg-script.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/tt-block-eval.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/tt-block-eval.tentative.html similarity index 100% rename from third_party/blink/web_tests/external/wpt/trusted-types/tt-block-eval.tentative.https.html rename to third_party/blink/web_tests/external/wpt/trusted-types/tt-block-eval.tentative.html
diff --git a/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioparam-interface/k-rate-audioworklet-connections.https.html b/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioparam-interface/k-rate-audioworklet-connections.https.html new file mode 100644 index 0000000..4d2eb40 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioparam-interface/k-rate-audioworklet-connections.https.html
@@ -0,0 +1,77 @@ +<!doctype html> +<html> + <head> + <title>Test k-rate AudioParams with inputs for AudioWorkletNode</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/webaudio/resources/audit-util.js"></script> + <script src="/webaudio/resources/audit.js"></script> + </head> + + <body> + <script> + const audit = Audit.createTaskRunner(); + + // Use the worklet gain node to test k-rate parameters. + const filePath = + '../the-audioworklet-interface/processors/gain-processor.js'; + + // Context for testing + let context; + + audit.define('Create Test Worklet', (task, should) => { + // Arbitrary sample rate and duration. + const sampleRate = 8000; + + // Only new a few render quanta to verify things are working. + const testDuration = 4 * 128 / sampleRate; + + context = new OfflineAudioContext({ + numberOfChannels: 3, + sampleRate: sampleRate, + length: testDuration * sampleRate + }); + + should( + context.audioWorklet.addModule(filePath), + 'Construction of AudioWorklet') + .beResolved() + .then(() => task.done()); + }); + + audit.define('AudioWorklet k-rate AudioParam', async (task, should) => { + let src = new ConstantSourceNode(context); + let kRateNode = new AudioWorkletNode(context, 'gain'); + src.connect(kRateNode).connect(context.destination); + + let kRateParam = kRateNode.parameters.get('gain'); + kRateParam.automationRate = 'k-rate'; + kRateParam.value = 0; + + let mod = new ConstantSourceNode(context); + mod.offset.setValueAtTime(0, 0); + mod.offset.linearRampToValueAtTime( + 10, context.length / context.sampleRate); + mod.connect(kRateParam); + + mod.start(); + src.start(); + + const audioBuffer = await context.startRendering(); + let output = audioBuffer.getChannelData(0); + + // Verify that the output isn't constantly zero. + should(output, 'output').notBeConstantValueOf(0); + // Verify that the output from the worklet is step-wise + // constant. + for (let k = 0; k < output.length; k += 128) { + should(output.slice(k, k + 128), ` k-rate output [${k}: ${k + 127}]`) + .beConstantValueOf(output[k]); + } + task.done(); + }); + + audit.run(); + </script> + </body> +</html>
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt index ed99456..11b49e69 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -193,6 +193,7 @@ PASS childWindow.statusbar.visible is false PASS childWindow.styleMedia.type is '' PASS childWindow.toolbar.visible is false +PASS childWindow.trustedTypes.defaultPolicy is null PASS childWindow.visualViewport.height is 0 PASS childWindow.visualViewport.offsetLeft is 0 PASS childWindow.visualViewport.offsetTop is 0
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt index 66ee316..17aaf2fc 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -193,6 +193,7 @@ PASS childWindow.statusbar.visible is false PASS childWindow.styleMedia.type is '' PASS childWindow.toolbar.visible is false +PASS childWindow.trustedTypes.defaultPolicy is null PASS childWindow.visualViewport.height is 0 PASS childWindow.visualViewport.offsetLeft is 0 PASS childWindow.visualViewport.offsetTop is 0
diff --git a/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-fetch.tentative.https.html b/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-fetch.tentative.https.html index a011915..af096c8 100644 --- a/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-fetch.tentative.https.html +++ b/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-fetch.tentative.https.html
@@ -8,25 +8,44 @@ <script> 'use strict'; - promise_test((t) => promise_rejects_dom(t, 'InvalidStateError', - fetch('https://trusttoken.test', { - trustToken: { - type: 'token-request' - } - }), 'Trust Token issuance should error.'), 'No keys for the issuer -> expect issuance to fail'); + promise_test((t) => promise_rejects_dom(t, 'InvalidStateError', (() => { + t.add_cleanup(async () => { + if (window.testRunner) + await new Promise(res => window.testRunner.clearTrustTokenState(res)); + }); + return fetch('https://trusttoken.test', { + trustToken: { + type: 'token-request' + } + }); + })(), 'Trust Token issuance should error.'), + 'No keys for the issuer -> expect issuance to fail'); - promise_test((t) => promise_rejects_dom(t, 'InvalidStateError', - fetch('https://trusttoken.test', { - trustToken: { - type: 'srr-token-redemption' - } - }), 'Trust Token redemption should error.'), 'No token for the issuer -> expect redemption to fail'); + promise_test((t) => promise_rejects_dom(t, 'InvalidStateError', (() => { + t.add_cleanup(async () => { + if (window.testRunner) + await new Promise(res => window.testRunner.clearTrustTokenState(res)); + }); + return fetch('https://trusttoken.test', { + trustToken: { + type: 'srr-token-redemption' + } + }); + })(), 'Trust Token redemption should error.'), + 'No token for the issuer -> expect redemption to fail'); - promise_test((t) => promise_rejects_dom(t, 'OperationError', - fetch('https://destination.test', { - trustToken: { - type: 'send-srr', - issuer: 'https://issuer.test' - } - }), 'Trust Token signing should error.'), 'No SRR for the issuer -> expect signing to fail'); + promise_test((t) => promise_rejects_js(t, TypeError, (() => { + t.add_cleanup(async () => { + if (window.testRunner) + await new Promise(res => window.testRunner.clearTrustTokenState(res)); + }); + return fetch('https://destination.test', { + trustToken: { + type: 'send-srr', + issuer: 'https://issuer.test' + } + }); + })(), 'Trust Token signing should not fail a request.'), + 'No SRR for the issuer -> expect signing to fail, but an error while' + + ' signing shouldn\'t result in the request being aborted'); </script>
diff --git a/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-xhr.tentative.https.html b/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-xhr.tentative.https.html index 3ca550f..f39383da 100644 --- a/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-xhr.tentative.https.html +++ b/third_party/blink/web_tests/http/tests/loading/trust-tokens/trust-token-xhr.tentative.https.html
@@ -14,8 +14,11 @@ request.setTrustToken({ type: 'token-request' }); - request.onerror = t.step_func_done(() => { + request.onerror = t.step_func(() => { assert_equals(request.trustTokenOperationError.name, "InvalidStateError"); + + if (window.testRunner) + window.testRunner.clearTrustTokenState(t.step_func_done(() => {})); }); request.send(); }, 'No keys for the issuer -> expect issuance to fail'); @@ -26,22 +29,32 @@ request.setTrustToken({ type: 'srr-token-redemption' }); - request.onerror = t.step_func_done(() => { + request.onerror = t.step_func(() => { assert_equals(request.trustTokenOperationError.name, "InvalidStateError"); + + if (window.testRunner) + window.testRunner.clearTrustTokenState(t.step_func_done(() => {})); }); request.send(); }, 'No keys for the issuer -> expect redemption to fail'); async_test((t) => { - let request = new XMLHttpRequest(); - request.open('GET', 'https://destination.test'); - request.setTrustToken({ - type: 'send-srr', - issuer: 'https://issuer.test' - }); - request.onerror = t.step_func_done(() => { - assert_equals(request.trustTokenOperationError.name, "OperationError"); - }); - request.send(); - }, 'No SRR for the issuer -> expect signing to fail'); + let request = new XMLHttpRequest(); + request.open('GET', 'https://destination.test'); + request.setTrustToken({ + type: 'send-srr', + issuer: 'https://issuer.test' + }); + request.onerror = t.step_func(() => { + assert_equals(request.trustTokenOperationError, null, + 'The request should fail for a reason unrelated to its Trust Tokens ' + + ' operation (namely that its destination doesn\'t exist)'); + + if (window.testRunner) + window.testRunner.clearTrustTokenState(t.step_func_done(() => {})); + }); + request.send(); + }, + 'No SRR for the issuer -> expect signing to fail, but an error while' + + ' signing shouldn\'t result in the request being aborted'); </script>
diff --git a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt index 555194fb..fb61626c 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -173,6 +173,7 @@ PASS childWindow.statusbar.visible is false PASS childWindow.styleMedia.type is '' PASS childWindow.toolbar.visible is false +PASS childWindow.trustedTypes.defaultPolicy is null PASS childWindow.visualViewport.height is 0 PASS childWindow.visualViewport.offsetLeft is 0 PASS childWindow.visualViewport.offsetTop is 0
diff --git a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt index 3edfc30..0b718e8 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -173,6 +173,7 @@ PASS childWindow.statusbar.visible is false PASS childWindow.styleMedia.type is '' PASS childWindow.toolbar.visible is false +PASS childWindow.trustedTypes.defaultPolicy is null PASS childWindow.visualViewport.height is 0 PASS childWindow.visualViewport.offsetLeft is 0 PASS childWindow.visualViewport.offsetTop is 0
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 737a8227..9fb965f2 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
@@ -11369,9 +11369,11 @@ getter primaryLightIntensity getter sphericalHarmonicsCoefficients method constructor -interface XRLightProbe +interface XRLightProbe : EventTarget attribute @@toStringTag + getter onreflectionchange method constructor + setter onreflectionchange interface XRPlane attribute @@toStringTag getter lastChangedTime @@ -11508,6 +11510,10 @@ getter x getter y method constructor +interface XRWebGLBinding + attribute @@toStringTag + method constructor + method getReflectionCubeMap interface XRWebGLLayer : XRLayer static method getNativeFramebufferScaleFactor attribute @@toStringTag
diff --git a/tools/clang/scripts/build.py b/tools/clang/scripts/build.py index 3c340c6..2425e0b7 100755 --- a/tools/clang/scripts/build.py +++ b/tools/clang/scripts/build.py
@@ -508,6 +508,7 @@ '-DLLVM_ENABLE_PIC=OFF', '-DLLVM_ENABLE_UNWIND_TABLES=OFF', '-DLLVM_ENABLE_TERMINFO=OFF', + '-DLLVM_ENABLE_Z3_SOLVER=OFF', '-DCLANG_PLUGIN_SUPPORT=OFF', '-DCLANG_ENABLE_STATIC_ANALYZER=OFF', '-DCLANG_ENABLE_ARCMT=OFF',
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index f22306a..83e0ede5 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -37,9 +37,9 @@ # Do NOT CHANGE this if you don't know what you're doing -- see # https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md # Reverting problematic clang rolls is safe, though. -CLANG_REVISION = '4e0d9925d6a3561449bdd8def27fd3f3f1b3fb9f' -CLANG_SVN_REVISION = 'n346557' -CLANG_SUB_REVISION = 3 +CLANG_REVISION = '99ac9ce7016d701b43b8f0c308dc3463da57d983' +CLANG_SVN_REVISION = 'n353803' +CLANG_SUB_REVISION = 1 PACKAGE_VERSION = '%s-%s-%s' % (CLANG_SVN_REVISION, CLANG_REVISION[:8], CLANG_SUB_REVISION)
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 8671fef..a79af40 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -12270,6 +12270,7 @@ <int value="31" label="RESULT_CODE_INVALID_SANDBOX_STATE"/> <int value="32" label="RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED"/> <int value="33" label="RESULT_CODE_DOWNGRADE_AND_RELAUNCH"/> + <int value="34" label="RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST"/> <int value="131" label="SIGQUIT"/> <int value="132" label="SIGILL"/> <int value="133" label="SIGTRAP"/> @@ -50377,6 +50378,25 @@ <int value="2" label="Chrome on Mac"/> </enum> +<enum name="OSXOtherChromeInstancesResult"> + <int value="0" label="Failure: didn't find data on last usage"/> + <int value="1" label="Failure: couldn't read plist"/> + <int value="2" label="No other copies of Chrome"/> + <int value="3" label="One other copy of Chrome, used within the last week"/> + <int value="4" label="One other copy of Chrome, used within the last month"/> + <int value="5" + label="One other copy of Chrome, not used within the last month"/> + <int value="6" + label="More than one other copy of Chrome, at least one of which was + used within the last week"/> + <int value="7" + label="More than one other copy of Chrome, at least one of which was + used within the last month"/> + <int value="8" + label="More than one other copy of Chrome, none of which were used + within the last month"/> +</enum> + <enum name="OSXOtherInstancesCheckResult"> <obsolete> Removed 2020 January. @@ -71531,6 +71551,8 @@ <int value="30" label="chrome::RESULT_CODE_ACTION_DISALLOWED_BY_POLICY"/> <int value="31" label="chrome::RESULT_CODE_INVALID_SANDBOX_STATE"/> <int value="32" label="chrome::RESULT_CODE_CLOUD_POLICY_ENROLLMENT_FAILED"/> + <int value="33" label="chrome::RESULT_CODE_DOWNGRADE_AND_RELAUNCH"/> + <int value="34" label="chrome::RESULT_CODE_GPU_EXIT_ON_CONTEXT_LOST"/> <int value="259" label="0x103 - STILL_ACTIVE."/> <int value="1285" label="ERROR_DELAY_LOAD_FAILED"/> <int value="1717" label="RPC_S_UNKNOWN_IF"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 581cb78..8da9b20c 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -2908,14 +2908,14 @@ </histogram> <histogram name="Android.DownloadManager.OpenSource.Audio" - enum="AndroidDownloadOpenSource" expires_after="2020-08-31"> + enum="AndroidDownloadOpenSource" expires_after="2020-11-08"> <owner>xingliu@chromium.org</owner> <owner>clank-downloads@google.com</owner> <summary>Records how users open audio download files on Android.</summary> </histogram> <histogram name="Android.DownloadManager.OpenSource.Other" - enum="AndroidDownloadOpenSource" expires_after="2020-08-31"> + enum="AndroidDownloadOpenSource" expires_after="2020-11-08"> <owner>xingliu@chromium.org</owner> <owner>clank-downloads@google.com</owner> <summary> @@ -3371,7 +3371,7 @@ </histogram> <histogram name="Android.IntentHeaders" enum="IntentHeadersResult" - expires_after="2020-08-30"> + expires_after="2020-11-08"> <owner>peconn@chromium.org</owner> <summary> Records the usage of the Browser.EXTRA_HEADERS field for Intents that Chrome @@ -3403,7 +3403,7 @@ </histogram> <histogram name="Android.KernelVersion" enum="AndroidKernelVersion" - expires_after="2020-08-30"> + expires_after="2020-11-08"> <owner>rsesek@chromium.org</owner> <summary> Reports the kernel major and minor version from the utsname.release field. @@ -3437,7 +3437,7 @@ <histogram name="Android.MainActivity.ExplicitMainViewIntentDispatched.OnCreate" - enum="BooleanDispatched" expires_after="2020-08-23"> + enum="BooleanDispatched" expires_after="2020-11-08"> <owner>wnwen@chromium.org</owner> <summary> Whether VIEW intent sent explicitly to .Main activity was dispatched by @@ -3912,7 +3912,7 @@ </histogram> <histogram name="Android.OmniboxFocusReason" enum="OmniboxFocusReason" - expires_after="2020-08-31"> + expires_after="2020-11-08"> <owner>mdjones@chromium.org</owner> <owner>twellington@chromium.org</owner> <owner>amaralp@chromium.org</owner> @@ -4320,7 +4320,7 @@ </histogram> <histogram name="Android.SeccompStatus.RendererSandbox" - enum="AndroidSeccompSandboxStatus" expires_after="2020-09-06"> + enum="AndroidSeccompSandboxStatus" expires_after="2020-11-08"> <owner>rsesek@chromium.org</owner> <summary> Reports the status of the seccomp-bpf sandbox in renderer processes. @@ -4461,7 +4461,7 @@ </histogram> <histogram name="Android.StrictMode.TabPersistentStore" units="ms" - expires_after="2020-06-28"> + expires_after="2020-11-08"> <owner>wnwen@chromium.org</owner> <owner>yfriedman@chromium.org</owner> <summary> @@ -6877,7 +6877,7 @@ </histogram> <histogram name="Apps.AppListShowSource" enum="AppListShowSource" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>newcomer@chromium.org</owner> <summary> The number of times the different sources for showing the app list are used. @@ -7767,7 +7767,7 @@ </histogram> <histogram name="Arc.ContainerLifetimeEvent" enum="ArcContainerLifetimeEvent" - expires_after="2020-08-30"> + expires_after="2020-11-08"> <owner>elijahtaylor@google.com</owner> <owner>yusukes@google.com</owner> <summary> @@ -7788,7 +7788,7 @@ </histogram> <histogram base="true" name="Arc.CpuRestrictionDisabled" units="ms" - expires_after="2020-09-09"> + expires_after="2020-11-08"> <owner>wvk@google.com</owner> <owner>khmel@google.com</owner> <summary> @@ -8507,7 +8507,7 @@ </histogram> <histogram name="Arc.StateByUserType" enum="ArcEnableState" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="ArcUserTypes" --> <owner>elijahtaylor@google.com</owner> @@ -10223,7 +10223,7 @@ </histogram> <histogram name="Ash.TouchView.TouchViewInactive" units="ms" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>girard@chromium.org</owner> <summary>The length of time between TouchView activations.</summary> </histogram> @@ -10949,7 +10949,7 @@ </histogram> <histogram name="Assistant.ProactiveSuggestions.ReshowAttempt" - enum="ProactiveSuggestionsShowAttempt" expires_after="2020-11-01"> + enum="ProactiveSuggestionsShowAttempt" expires_after="2020-11-08"> <owner>xiaohuic@chromium.org</owner> <owner>dmblack@google.com</owner> <owner>croissant-eng@chromium.org</owner> @@ -12385,7 +12385,7 @@ </histogram> <histogram name="AuthPolicy.TimeToRunKpasswd" units="ms" - expires_after="2020-08-23"> + expires_after="2020-11-08"> <owner>fsandrade@chromium.org</owner> <owner>tomdobro@chromium.org</owner> <summary> @@ -17097,7 +17097,7 @@ </histogram> <histogram name="Blink.Animate.UpdateTime" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePreFCPSuffixes" --> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePostFCPSuffixes" --> @@ -18074,6 +18074,16 @@ </summary> </histogram> +<histogram name="Blink.DecodedImage.DensitySizeCorrectionDetected" + enum="BooleanPresent" expires_after="2020-11-01"> + <owner>noam.j.rosenthal@gmail.com</owner> + <owner>paint-dev@chromium.org</owner> + <summary> + Indicates whether a decoded image contains density correction metadata, i.e. + when its resolution and dimension EXIF values match. + </summary> +</histogram> + <histogram name="Blink.DecodedImage.EffectiveDimensionsLocation" units="bytes" expires_after="2016-11-30"> <obsolete> @@ -18443,7 +18453,7 @@ </histogram> <histogram name="Blink.ForcedStyleAndLayout.UpdateTime" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeAggregatedSuffixes" --> <owner>schenney@chromium.org</owner> @@ -18708,7 +18718,7 @@ </histogram> <histogram name="Blink.IntersectionObservation.UpdateTime" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimeAggregatedSuffixes" --> <owner>schenney@chromium.org</owner> @@ -18813,7 +18823,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.AnimateRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18825,7 +18835,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.CompositingCommitRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18837,7 +18847,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.CompositingRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18849,7 +18859,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.ForcedStyleAndLayoutRatio" - units="%" expires_after="2020-09-06"> + units="%" expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18862,7 +18872,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.HandleInputEventsRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18874,7 +18884,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.HitTestDocumentUpdateRatio" - units="%" expires_after="2020-09-06"> + units="%" expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18886,7 +18896,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.ImplCompositorCommitRatio" - units="%" expires_after="2020-09-06"> + units="%" expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18899,7 +18909,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.IntersectionObservationRatio" - units="%" expires_after="2020-09-06"> + units="%" expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18911,7 +18921,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.LayoutRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18923,7 +18933,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.PaintRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18935,7 +18945,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.PrePaintRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18947,7 +18957,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.ProxyCommitRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18961,7 +18971,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.ScrollingCoordinatorRatio" - units="%" expires_after="2020-09-06"> + units="%" expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -18989,7 +18999,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.StyleRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -19001,7 +19011,7 @@ </histogram> <histogram base="true" name="Blink.MainFrame.UpdateLayersRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -19031,7 +19041,7 @@ </histogram> <histogram name="Blink.MainFrame.WaitForCommitRatio" units="%" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>schenney@chromium.org</owner> <owner>paint-dev@chromium.org</owner> <!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> @@ -19284,7 +19294,7 @@ </histogram> <histogram name="Blink.ProxyCommit.UpdateTime" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePreFCPSuffixes" --> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePostFCPSuffixes" --> @@ -19600,7 +19610,7 @@ </histogram> <histogram name="Blink.ScrollingCoordinator.UpdateTime" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePreFCPSuffixes" --> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePostFCPSuffixes" --> @@ -19795,7 +19805,7 @@ </histogram> <histogram name="Blink.Style.UpdateTime" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePreFCPSuffixes" --> <!-- Name completed by histogram_suffixes name="BlinkUpdateTimePostFCPSuffixes" --> @@ -20016,7 +20026,7 @@ </histogram> <histogram name="Blink.UseCounter.FeaturePolicy.Header" - enum="FeaturePolicyFeature" expires_after="2020-09-06"> + enum="FeaturePolicyFeature" expires_after="2020-11-08"> <owner>iclelland@chromium.org</owner> <summary> Counts the use of a specific feature policy via the @@ -20211,7 +20221,7 @@ </histogram> <histogram name="Blink.UseCounter.File.Features" enum="FeatureObserver" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>yhirano@chromium.org</owner> <owner>mkwst@chromium.org</owner> <summary> @@ -21081,7 +21091,7 @@ </histogram> <histogram name="Bluetooth.ConnectedDeviceCount" units="devices" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>adlr@chromium.org</owner> <summary> Counts the number of simulataneously connected Bluetooth devices. Used to @@ -21144,7 +21154,7 @@ </histogram> <histogram name="Bluetooth.PairingMethod" enum="BluetoothPairingMethod" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>adlr@chromium.org</owner> <summary> Records the method used to pair each Bluetooth Device. Used to direct our @@ -21271,7 +21281,7 @@ </histogram> <histogram name="Bluetooth.Web.ConnectGATT.Outcome" - enum="WebBluetoothConnectGATTOutcome" expires_after="2020-09-06"> + enum="WebBluetoothConnectGATTOutcome" expires_after="2020-11-08"> <owner>odejesush@chromium.org</owner> <owner>ortuno@chromium.org</owner> <owner>reillyg@chromium.org</owner> @@ -21647,7 +21657,7 @@ </summary> </histogram> -<histogram name="BlueZ.AdapterLost" units="seconds" expires_after="2020-09-06"> +<histogram name="BlueZ.AdapterLost" units="seconds" expires_after="2020-11-08"> <owner>mcchou@chromium.org</owner> <summary> This is specific to Chrome OS. Records a duration of a Bluetooth adapter @@ -21690,7 +21700,7 @@ </histogram> <histogram name="BlueZ.ReasonOfDisconnection" enum="BlueZReasonOfDisconnection" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>mcchou@chromium.org</owner> <summary> This is specific to Chrome OS. Records the reason of Bluetooth disconnection @@ -21710,7 +21720,7 @@ </histogram> <histogram name="BlueZ.ResultOfConnection" enum="BlueZResultOfConnection" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>mcchou@chromium.org</owner> <summary> This is specific to Chrome OS. Records the outcomes of connection requests @@ -22334,7 +22344,7 @@ </histogram> <histogram base="true" name="Browser.Tabs.TotalIncompleteSwitchDuration" - units="ms" expires_after="2020-09-06"> + units="ms" expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="TabSwitchingType" --> <owner>fdoray@chromium.org</owner> @@ -22454,7 +22464,7 @@ </histogram> <histogram name="BrowserRenderProcessHost.ChildCrashes" enum="RendererType" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>wfh@chromium.org</owner> <summary>Count of renderer process crashes grouped by type.</summary> </histogram> @@ -23312,7 +23322,7 @@ </histogram> <histogram name="CaptivePortal.DetectResult" enum="CaptivePortalDetectResult" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>meacer@chromium.org</owner> <summary>Records the result of a captive portal probe.</summary> </histogram> @@ -23657,7 +23667,7 @@ </histogram> <histogram name="Cast.Sender.VideoEncodeAcceleratorInitializeSuccess" - enum="BooleanSuccess" expires_after="2020-09-06"> + enum="BooleanSuccess" expires_after="2020-11-08"> <owner>posciak@chromium.org</owner> <summary> Indicates whether initialization of a video encode accelerator for Cast @@ -24062,7 +24072,7 @@ </histogram> <histogram name="ChildProcess.Killed2.OOM" enum="ProcessType2" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>oshima@chromium.org</owner> <summary> Out of ChildProcess.Killled, number of kills due to SIGKILL, which is a @@ -24453,7 +24463,7 @@ </histogram> <histogram name="ChromeColors.ColorOnLoad" enum="ChromeColorsInfo" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>gayane@chromium.org</owner> <owner>yyushkina@chromium.org</owner> <summary> @@ -26437,7 +26447,7 @@ </histogram> <histogram name="Compositing.DirectRenderer.Software.DrawFrameUs" - units="microseconds" expires_after="2020-09-06"> + units="microseconds" expires_after="2020-11-08"> <owner>weiliangc@chromium.org</owner> <summary> Time spent drawing of composited layers by SoftwareRenderer, in @@ -26544,7 +26554,7 @@ </histogram> <histogram name="Compositing.Display.DrawToSwapUs" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>backer@chromium.org</owner> <owner>rjkroege@chromium.org</owner> <summary> @@ -26580,7 +26590,7 @@ </histogram> <histogram name="Compositing.Display.FlattenedRenderPassCount" units="units" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>backer@chromium.org</owner> <owner>rjkroege@chromium.org</owner> <summary> @@ -26593,7 +26603,7 @@ <histogram name="Compositing.Display.OverlayProcessorOzone.IsCandidateSharedImage" - enum="Boolean" expires_after="2020-09-01"> + enum="Boolean" expires_after="2020-11-08"> <owner>samans@chromium.org</owner> <owner>rjkroege@chromium.org</owner> <summary> @@ -26605,7 +26615,7 @@ </histogram> <histogram name="Compositing.Display.OverlayProcessorOzone.SharedImageExists" - enum="Boolean" expires_after="2020-09-01"> + enum="Boolean" expires_after="2020-11-08"> <owner>samans@chromium.org</owner> <owner>rjkroege@chromium.org</owner> <summary> @@ -29426,7 +29436,7 @@ </histogram> <histogram name="ContextMenu.LensSupportStatus" - enum="ContextMenuLensSupportStatus" expires_after="2020-08-30"> + enum="ContextMenuLensSupportStatus" expires_after="2020-11-08"> <owner>benwgold@google.com</owner> <owner>lens-chrome@google.com</owner> <summary> @@ -30106,7 +30116,7 @@ </histogram> <histogram name="Cookie.KillDatabaseResult" enum="BooleanSuccess" - expires_after="2020-09-09"> + expires_after="2020-11-08"> <owner>morlovich@chromium.org</owner> <owner>chlily@chromium.org</owner> <summary> @@ -31650,7 +31660,7 @@ </histogram> <histogram name="CrosDisksClient.MountCompletedError" - enum="CrosDisksClientMountError" expires_after="2020-09-06"> + enum="CrosDisksClientMountError" expires_after="2020-11-08"> <owner>amistry@chromium.org</owner> <summary> The error code of disk mount signals received from the Chrome OS cros-disks @@ -31668,7 +31678,7 @@ </histogram> <histogram name="CrosDisksClient.MountTime" units="ms" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>amistry@chromium.org</owner> <summary> Time taken by the Chrome OS cros-disks daemon to perform a Mount operation. @@ -31685,7 +31695,7 @@ </histogram> <histogram name="CrosDisksClient.UnmountTime" units="ms" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>amistry@chromium.org</owner> <summary> Time taken by the Chrome OS cros-disks daemon to perform an Unmount @@ -43536,7 +43546,7 @@ </histogram> <histogram name="Download.Resume.AutoResumeLimitReached" enum="Boolean" - expires_after="2020-08-31"> + expires_after="2020-11-08"> <owner>shaktisahu@chromium.org</owner> <owner>clank-downloads@google.com</owner> <summary> @@ -43545,7 +43555,7 @@ </histogram> <histogram name="Download.Resume.AutoResumeLimitReached.LastReason" - enum="InterruptReason" expires_after="2020-08-31"> + enum="InterruptReason" expires_after="2020-11-08"> <owner>shaktisahu@chromium.org</owner> <owner>clank-downloads@google.com</owner> <summary> @@ -43868,7 +43878,7 @@ </histogram> <histogram name="Download.Service.Finish.Type" - enum="Download.Service.CompletionType" expires_after="2020-09-06"> + enum="Download.Service.CompletionType" expires_after="2020-11-08"> <owner>xingliu@chromium.org</owner> <summary>The completion type for downloads in download service.</summary> </histogram> @@ -47200,7 +47210,7 @@ </histogram> <histogram name="EnterpriseCheck.IsManaged" enum="BooleanEnabled" - expires_after="2020-09-07"> + expires_after="2020-11-08"> <owner>rogerta@chromium.org</owner> <owner>pastarmovj@chromium.org</owner> <summary> @@ -48017,7 +48027,7 @@ </histogram> <histogram name="Event.Latency.BlockingTime.TouchMoveDefaultPrevented" - units="ms" expires_after="2020-06-28"> + units="ms" expires_after="2020-11-08"> <owner>tdresser@chromium.org</owner> <summary> Time between the renderer main thread receiving a touchmove event and acking @@ -48028,7 +48038,7 @@ </histogram> <histogram name="Event.Latency.BlockingTime.TouchStartDefaultAllowed" - units="ms" expires_after="2020-09-06"> + units="ms" expires_after="2020-11-08"> <owner>tdresser@chromium.org</owner> <summary> Time between the renderer main thread receiving a touchstart event and @@ -48637,7 +48647,7 @@ </histogram> <histogram name="Event.Latency.EndToEnd.Mouse" units="microseconds" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>input-dev@chromium.org</owner> <summary> Time between the OS receiving a mouse event and the resulting GPU frame @@ -48832,7 +48842,7 @@ </histogram> <histogram name="Event.Latency.QueueingTime.TouchStartDefaultAllowed" - units="ms" expires_after="2020-08-02"> + units="ms" expires_after="2020-11-08"> <owner>tdresser@chromium.org</owner> <summary> Time between sending a touchstart event to the renderer main thread and when @@ -62376,7 +62386,7 @@ </histogram> <histogram name="GPU.GPUProcessExitCode" enum="GPUProcessExitCode" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>jbauman@chromium.org</owner> <summary> Counts for the exit codes returned by the GPU process when it terminated. @@ -63261,7 +63271,7 @@ </histogram> <histogram name="GPU.WatchdogThread.Timeout" enum="GpuWatchdogTimeoutEvent" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="GPU.WatchdogStage" --> <owner>magchen@chromium.org</owner> @@ -63282,7 +63292,7 @@ </histogram> <histogram name="GPU.WatchdogThread.V1.Timeout" enum="GpuWatchdogTimeoutEvent" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>magchen@chromium.org</owner> <owner>zmo@chromium.org</owner> <summary> @@ -63301,7 +63311,7 @@ </histogram> <histogram name="GPU.WatchdogThread.WaitTime" units="ms" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <!-- Name completed by histogram_suffixes name="GPU.WatchdogStage" --> <owner>magchen@chromium.org</owner> @@ -65442,7 +65452,7 @@ </summary> </histogram> -<histogram name="HttpCache.BeforeSend" units="ms" expires_after="2020-09-06"> +<histogram name="HttpCache.BeforeSend" units="ms" expires_after="2020-11-08"> <owner>morlovich@chromium.org</owner> <summary> For http cache transactions in which a network request was sent, the time @@ -70053,7 +70063,7 @@ </histogram> <histogram name="KeyboardAccessory.AccessorySheetSuggestionsSelected" - enum="AccessorySuggestionType" expires_after="2020-08-30"> + enum="AccessorySuggestionType" expires_after="2020-11-08"> <owner>fhorschig@chromium.org</owner> <summary> Android only. Records which type of suggestion was selected from an open @@ -70062,7 +70072,7 @@ </histogram> <histogram name="KeyboardAccessory.AccessorySheetTriggered" - enum="AccessorySheetTrigger" expires_after="2020-08-30"> + enum="AccessorySheetTrigger" expires_after="2020-11-08"> <owner>fhorschig@chromium.org</owner> <summary> Android only. Records how often the bottom sheet was opened or closed by a @@ -70212,7 +70222,7 @@ </histogram> <histogram name="LanguageSettings.PageImpression" - enum="LanguageSettingsPageType" expires_after="2020-06-28"> + enum="LanguageSettingsPageType" expires_after="2020-11-08"> <owner>googleo@chromium.org</owner> <summary>The type of panes which language settings loads.</summary> </histogram> @@ -71393,7 +71403,8 @@ </summary> </histogram> -<histogram name="Login.BrowserShutdownTime" units="ms" expires_after="2020-9-9"> +<histogram name="Login.BrowserShutdownTime" units="ms" + expires_after="2020-11-08"> <owner>xiyuan@chromium.org</owner> <summary> Tracks the browser process shutdown time from when SIGTERM is sent to the @@ -112146,6 +112157,17 @@ </summary> </histogram> +<histogram name="OSX.Installation.OtherChromeInstances" + enum="OSXOtherChromeInstancesResult" expires_after="2020-12-12"> + <owner>avi@chromium.org</owner> + <owner>mark@chromium.org</owner> + <summary> + The instances of other copies of Google Chrome on the user's Mac. Logged + once on startup, and only for Chrome Beta and Chrome Dev. Will be used to + determine if/how home directory migration will be done for side-by-side. + </summary> +</histogram> + <histogram name="OSX.InstallationFilesystem" enum="OSXFilesystem" expires_after="2019-12-31"> <obsolete> @@ -112459,7 +112481,7 @@ </histogram> <histogram name="Overscroll.Navigated3" enum="OverscrollNavigationType" - expires_after="2020-08-31"> + expires_after="2020-11-08"> <owner>nzolghadr@chromium.org</owner> <summary> Navigations that were triggered due to completed overscroll gesture. Note @@ -112496,7 +112518,7 @@ </histogram> <histogram name="Overscroll.Started3" enum="OverscrollNavigationType" - expires_after="2020-08-17"> + expires_after="2020-11-08"> <owner>nzolghadr@chromium.org</owner> <summary> Overscroll gestures initiated by the user. Note that not all overscroll @@ -117827,6 +117849,21 @@ </summary> </histogram> +<histogram base="true" name="PasswordManager.AccountStore.TimesPasswordUsed" + units="PasswordUses" expires_after="M87"> + <owner>battre@chromium.org</owner> + <owner>jdoerrie@chromium.org</owner> + <owner>mamir@chromium.org</owner> + <owner>treib@chromium.org</owner> + <summary> + The number of times each saved password from the account-scoped storage has + been used to log in. Split by whether created by the user or generated by + Chrome, and further by whether the user used sync with custom passphrase or + not. Recorded by iterating over stored passwords once per browser run, soon + after startup. + </summary> +</histogram> + <histogram base="true" name="PasswordManager.AccountStore.TotalAccountsHiRes.ByType" units="units" expires_after="M87"> @@ -120403,15 +120440,16 @@ </summary> </histogram> -<histogram base="true" name="PasswordManager.TimesPasswordUsed" units="units" - expires_after="2021-01-30"> +<histogram base="true" name="PasswordManager.TimesPasswordUsed" + units="PasswordUses" expires_after="2021-01-30"> <owner>battre@chromium.org</owner> <owner>jdoerrie@chromium.org</owner> <summary> - The number of times each saved password has been used to log in. Split by - whether created by the user or generated by Chrome, and further by whether - the user used sync with custom passphrase or not. Recorded by iterating over - stored passwords once per run. This information is persisted and synced. + The number of times each saved password from the profile-scoped storage has + been used to log in. Split by whether created by the user or generated by + Chrome, and further by whether the user used sync with custom passphrase or + not. Recorded by iterating over stored passwords once per run. This + information is persisted and synced. </summary> </histogram> @@ -131364,7 +131402,7 @@ </histogram> <histogram name="Privacy.DoNotTrackSetting" enum="BooleanEnabled" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>mkwst@chromium.org</owner> <owner>msramek@chromium.org</owner> <summary> @@ -131493,7 +131531,7 @@ </histogram> <histogram name="Profile.AddNewUser" enum="ProfileAddNewUser" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>rogerta@chromium.org</owner> <summary>The frequency of ways that new user profiles are added.</summary> </histogram> @@ -142146,7 +142184,7 @@ </histogram> <histogram name="SB2.RemoteCall.CheckDelta" units="microseconds" - expires_after="2020-09-04"> + expires_after="2020-11-08"> <owner>vakh@chromium.org</owner> <owner>csharrison@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> @@ -142298,7 +142336,7 @@ </histogram> <histogram name="SB2.RemoteCall.Result" enum="SB2RemoteCallResult" - expires_after="2020-08-31"> + expires_after="2020-11-08"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -143417,7 +143455,7 @@ </histogram> <histogram name="SBClientPhishing.ClassificationStart" enum="BooleanHit" - expires_after="2020-09-04"> + expires_after="2020-11-08"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -143463,7 +143501,7 @@ </histogram> <histogram name="SBClientPhishing.ClientModelStatus" - enum="SBClientPhishingClientModelStatus" expires_after="2020-09-04"> + enum="SBClientPhishingClientModelStatus" expires_after="2020-11-08"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -143600,7 +143638,7 @@ <histogram name="SBClientPhishing.PreClassificationCheckFail" enum="SBClientDetectionPreClassificationCheckFail" - expires_after="2020-09-04"> + expires_after="2020-11-08"> <owner>vakh@chromium.org</owner> <owner>chrome-safebrowsing-alerts@google.com</owner> <summary> @@ -160536,7 +160574,7 @@ </histogram> <histogram name="Startup.AfterStartupTaskDelayedUntilTime" units="ms" - expires_after="2020-07-13"> + expires_after="2020-11-08"> <owner>michaeln@chromium.org</owner> <summary> Time from the process creation until deferred after-startup tasks began @@ -160625,7 +160663,7 @@ </histogram> <histogram name="Startup.Android.StartupTabPreloader.TabLoaded" units="Boolean" - expires_after="2020-08-30"> + expires_after="2020-11-08"> <owner>skyostil@chromium.org</owner> <summary> Android: Whether or not creation of a profile lead to the @@ -160636,7 +160674,7 @@ </histogram> <histogram name="Startup.Android.StartupTabPreloader.TabTaken" units="Boolean" - expires_after="2020-08-30"> + expires_after="2020-11-08"> <owner>skyostil@chromium.org</owner> <summary> Android: Whether or not a tab speculatively created by the @@ -160989,7 +161027,7 @@ </histogram> <histogram name="Startup.BrowserWindow.FirstPaint" units="ms" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>mblsha@yandex-team.ru</owner> <summary> Time from application start to the time the first Browser window has @@ -165341,7 +165379,7 @@ </histogram> <histogram name="Sync.LocalSyncTransportDataStartupState" - enum="LocalSyncTransportDataStartupState" expires_after="2020-09-05"> + enum="LocalSyncTransportDataStartupState" expires_after="2020-11-08"> <owner>rushans@google.com</owner> <owner>mastiz@chromium.org</owner> <summary> @@ -171637,7 +171675,7 @@ </histogram> <histogram name="Translate.CompactInfobar.Language.AlwaysTranslate" - enum="CLD3LanguageCode" expires_after="2020-08-30"> + enum="CLD3LanguageCode" expires_after="2020-11-08"> <owner>anthonyvd@chromium.org</owner> <summary> Records the hashcode of the source language when always translate this @@ -173999,7 +174037,7 @@ </histogram> <histogram name="UMA.TruncatedEvents.UserAction" units="events" - expires_after="2020-11-01"> + expires_after="2020-11-08"> <owner>rkaplow@chromium.org</owner> <owner>src/base/metrics/OWNERS</owner> <summary> @@ -178584,7 +178622,7 @@ </summary> </histogram> -<histogram name="VRSessionTime" units="ms" expires_after="2020-08-30"> +<histogram name="VRSessionTime" units="ms" expires_after="2020-11-08"> <owner>alcooper@chromium.org</owner> <owner>cassew@chromium.org</owner> <owner>xr-dev@chromium.org</owner> @@ -178606,7 +178644,7 @@ </summary> </histogram> -<histogram name="VRSessionVideoCount" units="units" expires_after="2020-08-30"> +<histogram name="VRSessionVideoCount" units="units" expires_after="2020-11-08"> <owner>alcooper@chromium.org</owner> <owner>cassew@chromium.org</owner> <owner>xr-dev@chromium.org</owner> @@ -178616,7 +178654,7 @@ </summary> </histogram> -<histogram name="VRSessionVideoTime" units="ms" expires_after="2020-08-30"> +<histogram name="VRSessionVideoTime" units="ms" expires_after="2020-11-08"> <owner>alcooper@chromium.org</owner> <owner>cassew@chromium.org</owner> <owner>xr-dev@chromium.org</owner> @@ -178627,7 +178665,7 @@ </summary> </histogram> -<histogram name="VRViewerType" enum="VRViewerType" expires_after="2020-08-30"> +<histogram name="VRViewerType" enum="VRViewerType" expires_after="2020-11-08"> <owner>alcooper@chromium.org</owner> <owner>cassew@chromium.org</owner> <owner>xr-dev@chromium.org</owner> @@ -179231,7 +179269,7 @@ </histogram> <histogram name="WebApk.Session.TotalDuration2" units="ms" - expires_after="2020-08-31"> + expires_after="2020-11-08"> <owner>hanxi@chromium.org</owner> <owner>pkotwicz@chromium.org</owner> <owner>yfriedman@chromium.org</owner> @@ -180293,7 +180331,7 @@ </histogram> <histogram name="WebController.ExternalURLRequestBlocking" - enum="IOSExternalURLRequestStatus" expires_after="2020-09-06"> + enum="IOSExternalURLRequestStatus" expires_after="2020-11-08"> <owner>mrefaat@chromium.org</owner> <summary> [iOS] Measures the proportion of external URL requests that originate from a @@ -182139,7 +182177,7 @@ </histogram> <histogram base="true" name="WebFont.HttpCacheStatus" enum="HttpCachePattern" - expires_after="2020-09-06"> + expires_after="2020-11-08"> <owner>yaoxia@chromium.org</owner> <owner>shivanisha@chromium.org</owner> <summary> @@ -184696,7 +184734,7 @@ </histogram> <histogram name="WebRTC.Video.EndToEndDelayMaxInMs" units="ms" - expires_after="2020-06-28"> + expires_after="2020-11-08"> <owner>ilnik@chromium.org</owner> <owner>webrtc-video@google.com</owner> <summary> @@ -186287,7 +186325,7 @@ </summary> </histogram> -<histogram name="WebUITabStrip.TabActivation" units="ms" expires_after="M84"> +<histogram name="WebUITabStrip.TabActivation" units="ms" expires_after="M86"> <owner>robliao@chromium.org</owner> <owner>johntlee@chromium.org</owner> <summary> @@ -186296,7 +186334,7 @@ </summary> </histogram> -<histogram name="WebUITabStrip.TabCreation" units="ms" expires_after="M84"> +<histogram name="WebUITabStrip.TabCreation" units="ms" expires_after="M86"> <owner>robliao@chromium.org</owner> <owner>johntlee@chromium.org</owner> <summary> @@ -186304,7 +186342,7 @@ </summary> </histogram> -<histogram name="WebUITabStrip.TabDataReceived" units="ms" expires_after="M84"> +<histogram name="WebUITabStrip.TabDataReceived" units="ms" expires_after="M86"> <owner>robliao@chromium.org</owner> <owner>johntlee@chromium.org</owner> <summary> @@ -187439,7 +187477,7 @@ </histogram> <histogram name="XR.WebXR.ReferenceSpace.Succeeded" enum="XRReferenceSpaceType" - expires_after="2020-08-30"> + expires_after="2020-11-08"> <owner>alcooper@chromium.org</owner> <owner>cassew@chromium.org</owner> <owner>xr-dev@chromium.org</owner> @@ -199938,6 +199976,12 @@ <affected-histogram name="PasswordManager.AccountStore.BlacklistedSitesHiRes"/> <affected-histogram + name="PasswordManager.AccountStore.TimesPasswordUsed.AutoGenerated"/> + <affected-histogram + name="PasswordManager.AccountStore.TimesPasswordUsed.Overall"/> + <affected-histogram + name="PasswordManager.AccountStore.TimesPasswordUsed.UserCreated"/> + <affected-histogram name="PasswordManager.AccountStore.TotalAccountsHiRes.ByType.AutoGenerated"/> <affected-histogram name="PasswordManager.AccountStore.TotalAccountsHiRes.ByType.Overall"/> @@ -199965,6 +200009,7 @@ <affected-histogram name="PasswordManager.AccountsPerSite"/> <affected-histogram name="PasswordManager.AccountsPerSiteHiRes"/> <affected-histogram name="PasswordManager.AccountStore.AccountsPerSiteHiRes"/> + <affected-histogram name="PasswordManager.AccountStore.TimesPasswordUsed"/> <affected-histogram name="PasswordManager.AccountStore.TotalAccountsHiRes.ByType"/> <affected-histogram name="PasswordManager.TimesPasswordUsed"/> @@ -202471,6 +202516,13 @@ <affected-histogram name="Security.TimeOnPage2"/> </histogram_suffixes> +<histogram_suffixes name="SameOrOtherChannel" separator="."> + <suffix name="DifferentChannel" + label="Instance(s) of Chrome of a different channel"/> + <suffix name="SameChannel" label="Instance(s) of Chrome of the same channel"/> + <affected-histogram name="OSX.Installation.OtherChromeInstances"/> +</histogram_suffixes> + <histogram_suffixes name="SameVersionStartupCounts" separator="."> <obsolete> Removed 8/2019. Was used to better understand DLL prefetching.
diff --git a/tools/perf/benchmarks/startup_mobile.py b/tools/perf/benchmarks/startup_mobile.py index 69e0c47..574b00f 100644 --- a/tools/perf/benchmarks/startup_mobile.py +++ b/tools/perf/benchmarks/startup_mobile.py
@@ -155,12 +155,12 @@ # constructor. Upon launch, Chrome extracts the icon and the URL from the # APK. self.platform.WaitForBatteryTemperature(_MAX_BATTERY_TEMP) - self.platform.StartActivity( - intent.Intent(package='org.chromium.maps_go_webapk', - activity='org.chromium.webapk.shell_apk.MainActivity', - category='android.intent.category.LAUNCHER', - action='android.intent.action.MAIN'), - blocking=True) + self.platform.StartActivity(intent.Intent( + package='org.chromium.maps_go_webapk', + activity='org.chromium.webapk.shell_apk.h2o.H2OMainActivity', + category='android.intent.category.LAUNCHER', + action='android.intent.action.MAIN'), + blocking=True) @contextlib.contextmanager def FindBrowser(self):
diff --git a/tools/perf/core/tbmv3/metrics/janky_time_per_scroll_processing_time.sql b/tools/perf/core/tbmv3/metrics/janky_time_per_scroll_processing_time.sql index daa2d91..370d07d 100644 --- a/tools/perf/core/tbmv3/metrics/janky_time_per_scroll_processing_time.sql +++ b/tools/perf/core/tbmv3/metrics/janky_time_per_scroll_processing_time.sql
@@ -139,11 +139,8 @@ -- and can't reasonably determine what it should be. We have separate tracking -- to ensure this only happens at the end of the trace. -- --- TODO(nuskos): Currently removing updates with dur < 1.5e+7 (15 ms i.e. less --- then a vsync interval at 60 fps) is a hack to work around the --- fact we don't have typed async events yet. Once we can tell if --- an update is coalesced or not we should remove this and instead --- check that directly. +-- TODO(nuskos): Replace 1.6e.7 with a sub query that computes the vsync +-- interval for this scrol DROP TABLE IF EXISTS GestureScrollUpdates; @@ -167,13 +164,10 @@ dur, track_id, traceId, - isCoalesced, dur/1.6e+7 AS scrollFramesExact FROM JoinedScrollBeginsAndEnds beginAndEnd JOIN ( SELECT EXTRACT_ARG(arg_set_id, "chrome_latency_info.trace_id") AS traceId, - EXTRACT_ARG(arg_set_id, "chrome_latency_info.is_coalesced") - AS isCoalesced, EXTRACT_ARG(arg_set_id, 'chrome_latency_info.gesture_scroll_id') AS scrollGestureScrollId, * @@ -182,7 +176,7 @@ WHERE slice.name = 'InputLatency::GestureScrollUpdate' AND slice.dur != -1 AND - slice.dur >= 1.5e+7 + NOT EXTRACT_ARG(arg_set_id, "chrome_latency_info.is_coalesced") ) scrollUpdate ON scrollUpdate.ts <= beginAndEnd.scrollEndTs AND scrollUpdate.ts >= beginAndEnd.scrollBegin AND
diff --git a/tools/perf/core/tbmv3/metrics/num_excessive_touch_moves_blocking_gesture_scroll_updates.sql b/tools/perf/core/tbmv3/metrics/num_excessive_touch_moves_blocking_gesture_scroll_updates.sql index c53ce89..cb6b0945 100644 --- a/tools/perf/core/tbmv3/metrics/num_excessive_touch_moves_blocking_gesture_scroll_updates.sql +++ b/tools/perf/core/tbmv3/metrics/num_excessive_touch_moves_blocking_gesture_scroll_updates.sql
@@ -141,17 +141,18 @@ -- Name the metric and output the result (recall that booleans are 1 if true so -- SUM(boolean) is just the number of occurrences). -- --- We select the sum inside a sub-query because if there is no rows SUM() --- returns null which results in an error in the chrometto pipeline. - -CREATE VIEW num_excessive_touch_moves_blocking_gesture_scroll_updates_output AS - SELECT NumExcessiveTouchMovesBlockingGestureScrollUpdates( - "num_touch_moves_blocking_gesture_scrolls", sumExcessiveOverlaps) -FROM ( - SELECT - COALESCE(SUM(hasFirstExcessiveOverlap), 0) AS sumExcessiveOverlaps - FROM OnlyFirstExcessiveTouchAndGestureOverlap -) +-- We select the sum inside a separate query because the output function should +-- be called at least once (even if we don't want the metric value to be output, +-- we still have to call the function with the NULL value). +-- So when the trace has a scroll, the SumExcessiveOverlaps table will +-- contain a value (possibly 0). When the trace doesn't have a scroll, +-- the SumExcessiveOverlaps table will be empty. +-- The NumExcessiveTouchMovesBlockingGestureScrollUpdates function +-- will be called either way, with either total value or NULL. +CREATE VIEW SumExcessiveOverlaps AS +SELECT + COALESCE(SUM(hasFirstExcessiveOverlap), 0) AS total +FROM OnlyFirstExcessiveTouchAndGestureOverlap WHERE ( SELECT @@ -160,3 +161,9 @@ 0 END FROM TraceHasScroll ) > 0; + +CREATE VIEW num_excessive_touch_moves_blocking_gesture_scroll_updates_output AS + SELECT NumExcessiveTouchMovesBlockingGestureScrollUpdates( + "num_touch_moves_blocking_gesture_scrolls", + (SELECT total FROM SumExcessiveOverlaps) + );
diff --git a/tools/perf/core/tbmv3/metrics/power_rails_metric.proto b/tools/perf/core/tbmv3/metrics/power_rails_metric.proto index 25d9c37..7f74375 100644 --- a/tools/perf/core/tbmv3/metrics/power_rails_metric.proto +++ b/tools/perf/core/tbmv3/metrics/power_rails_metric.proto
@@ -5,21 +5,36 @@ import "protos/perfetto/metrics/metrics.proto"; import "protos/perfetto/metrics/custom_options.proto"; -// A metric that collects on-device power rails measurement for the -// duration of the story run. Power drain breakdown is device-specific -// since different devices have different sensors. -// See go/power-mobile-benchmark for the list of supported devices. +// A metric that collects on-device power rails measurements. +// The power drain breakdown is device-specific since different devices have +// different sensors. See go/power-mobile-benchmark for the list of +// supported devices. // Output values are in Joules (Watt-seconds). message PowerRailsMetric { - optional float total_j = 1 [(unit) = "J_smallerIsBetter"]; - optional float cpu_big_core_cluster_j = 2 [(unit) = "J_smallerIsBetter"]; - optional float cpu_little_core_cluster_j = 3 [(unit) = "J_smallerIsBetter"]; - optional float soc_j = 4 [(unit) = "J_smallerIsBetter"]; - optional float display_j = 5 [(unit) = "J_smallerIsBetter"]; - optional float duration_ms = 6 [(unit) = "ms"]; + // story_* values - power consumption over the duration of the story run. + // This doesn't include Chrome starting and loading a page. + optional float story_total_j = 1 [(unit) = "J_smallerIsBetter"]; + optional float story_cpu_big_core_cluster_j = 2 + [(unit) = "J_smallerIsBetter"]; + optional float story_cpu_little_core_cluster_j = 3 + [(unit) = "J_smallerIsBetter"]; + optional float story_soc_j = 4 [(unit) = "J_smallerIsBetter"]; + optional float story_display_j = 5 [(unit) = "J_smallerIsBetter"]; + optional float story_duration_ms = 6 [(unit) = "ms"]; + + // interaction_* values - power consumption over the combined duration + // of Interaction.* events, e.g. Interaction.Gesture_ScrollAction. + optional float interaction_total_j = 11 [(unit) = "J_smallerIsBetter"]; + optional float interaction_cpu_big_core_cluster_j = 12 + [(unit) = "J_smallerIsBetter"]; + optional float interaction_cpu_little_core_cluster_j = 13 + [(unit) = "J_smallerIsBetter"]; + optional float interaction_soc_j = 14 [(unit) = "J_smallerIsBetter"]; + optional float interaction_display_j = 15 [(unit) = "J_smallerIsBetter"]; + optional float interaction_duration_ms = 16 [(unit) = "ms"]; } extend TraceMetrics { - optional PowerRailsMetric power_rails_metric = 455; + optional PowerRailsMetric power_rails_metric = 457; }
diff --git a/tools/perf/core/tbmv3/metrics/power_rails_metric.sql b/tools/perf/core/tbmv3/metrics/power_rails_metric.sql index 85aba299..9114db4 100644 --- a/tools/perf/core/tbmv3/metrics/power_rails_metric.sql +++ b/tools/perf/core/tbmv3/metrics/power_rails_metric.sql
@@ -4,37 +4,105 @@ -- See go/power-mobile-benchmark for the list of supported devices. -- Output values are in Joules (Watt-seconds). -CREATE VIEW RunStory AS -SELECT - MIN(ts) AS begin, - MAX(ts + dur) AS end -FROM slice -WHERE name LIKE '%.RunStory'; +-- This is a mapping from counter names on different devices +-- to what subsystems they are measuring. +CREATE TABLE power_counters (name TEXT, subsystem TEXT); -CREATE VIEW drains AS +INSERT INTO power_counters VALUES + ('power.VPH_PWR_S5C_S6C_uws', 'cpu_big'), + ('power.VPH_PWR_S4C_uws', 'cpu_little'), + ('power.VPH_PWR_S2C_S3C_uws', 'soc'), + ('power.VPH_PWR_OLED_uws', 'display'), + ('power.PPVAR_VPH_PWR_S1A_S9A_S10A_uws', 'soc'), + ('power.PPVAR_VPH_PWR_S2A_S3A_uws', 'cpu_big'), + ('power.PPVAR_VPH_PWR_S1C_uws', 'cpu_little'), + ('power.WCN3998_VDD13 [from PP1304_L2C]_uws', 'wifi'), + ('power.PPVAR_VPH_PWR_WLAN_uws', 'wifi'), + ('power.PPVAR_VPH_PWR_OLED_uws', 'display'), + ('power.PPVAR_VPH_PWR_QTM525_uws', 'cellular'), + ('power.PPVAR_VPH_PWR_RF_uws', 'cellular'); + +-- Convert power counter data into table of events, where each event has +-- start timestamp, duration and the average power drain during its duration +-- in Watts. +CREATE VIEW drain_in_watts AS SELECT - counter_track.name as name, - (MAX(counter.value) - MIN(counter.value)) / 1e6 as drain_j + name, + ts, + LEAD(ts) OVER (PARTITION BY track_id ORDER BY ts) - ts as dur, + (LEAD(value) OVER (PARTITION BY track_id ORDER BY ts) - value) / + (LEAD(ts) OVER (PARTITION BY track_id ORDER BY ts) - ts) * 1e3 as drain_w FROM counter JOIN counter_track ON (counter.track_id = counter_track.id) WHERE - counter_track.type = 'counter_track' - AND counter.ts >= (SELECT begin FROM RunStory) - AND counter.ts <= (SELECT end FROM RunStory) -GROUP BY counter_track.name; + counter_track.type = 'counter_track' AND name LIKE "power.%"; +CREATE VIEW run_story_event AS +SELECT ts, dur +FROM slice +WHERE name LIKE '%.RunStory'; + +CREATE VIRTUAL TABLE run_story_span_join_drain +USING SPAN_JOIN(run_story_event, drain_in_watts); + +-- Compute cumulative power drain over the duration of the run_story event. +CREATE VIEW story_drain AS +SELECT + subsystem, + sum(dur * drain_w / 1e9) as drain_j, + sum(dur / 1e6) as dur_ms +FROM run_story_span_join_drain +JOIN power_counters USING (name) +GROUP BY subsystem; + +CREATE VIEW interaction_events AS +SELECT ts, dur +FROM slice +WHERE name LIKE 'Interaction.%'; + +CREATE VIRTUAL TABLE interactions_span_join_drain +USING SPAN_JOIN(interaction_events, drain_in_watts); + +-- Compute cumulative power drain over the total duration of interaction events. +CREATE VIEW interaction_drain AS +SELECT + subsystem, + sum(dur * drain_w / 1e9) as drain_j, + sum(dur / 1e6) as dur_ms +FROM interactions_span_join_drain +JOIN power_counters USING (name) +GROUP BY subsystem; + +-- Output power consumption as measured by several ODPMs, over the following +-- time frames: +-- story_* values - over the duration of the story run. This doesn't include +-- Chrome starting and loading a page. +-- interaction_* values - over the combined duration of Interaction.* events, +-- e.g. Interaction.Gesture_ScrollAction. CREATE VIEW power_rails_metric_output AS SELECT PowerRailsMetric( - 'total_j', - (SELECT sum(drain_j) FROM drains WHERE name LIKE 'power.%'), - 'cpu_big_core_cluster_j', - (SELECT drain_j FROM drains WHERE name = 'power.VPH_PWR_S5C_S6C_uws'), - 'cpu_little_core_cluster_j', - (SELECT drain_j FROM drains WHERE name = 'power.VPH_PWR_S4C_uws'), - 'soc_j', - (SELECT drain_j FROM drains WHERE name = 'power.VPH_PWR_S2C_S3C_uws'), - 'display_j', - (SELECT drain_j FROM drains WHERE name = 'power.VPH_PWR_OLED_uws'), - 'duration_ms', - (SELECT (end - begin) / 1e6 from RunStory) + 'story_total_j', + (SELECT sum(drain_j) FROM story_drain), + 'story_cpu_big_core_cluster_j', + (SELECT drain_j FROM story_drain WHERE subsystem = 'cpu_big'), + 'story_cpu_little_core_cluster_j', + (SELECT drain_j FROM story_drain WHERE subsystem = 'cpu_little'), + 'story_soc_j', + (SELECT drain_j FROM story_drain WHERE subsystem = 'soc'), + 'story_display_j', + (SELECT drain_j FROM story_drain WHERE subsystem = 'display'), + 'story_duration_ms', + (SELECT dur_ms FROM story_drain WHERE subsystem = 'display'), + 'interaction_total_j', + (SELECT sum(drain_j) FROM interaction_drain), + 'interaction_cpu_big_core_cluster_j', + (SELECT drain_j FROM interaction_drain WHERE subsystem = 'cpu_big'), + 'interaction_cpu_little_core_cluster_j', + (SELECT drain_j FROM interaction_drain WHERE subsystem = 'cpu_little'), + 'interaction_soc_j', + (SELECT drain_j FROM interaction_drain WHERE subsystem = 'soc'), + 'interaction_display_j', + (SELECT drain_j FROM interaction_drain WHERE subsystem = 'display'), + 'interaction_duration_ms', + (SELECT dur_ms FROM interaction_drain WHERE subsystem = 'display') );
diff --git a/tools/perf/core/tbmv3/run_tbmv3_metric_unittest.py b/tools/perf/core/tbmv3/run_tbmv3_metric_unittest.py index c732dbb..210c236 100644 --- a/tools/perf/core/tbmv3/run_tbmv3_metric_unittest.py +++ b/tools/perf/core/tbmv3/run_tbmv3_metric_unittest.py
@@ -14,6 +14,7 @@ import unittest from core.tbmv3 import run_tbmv3_metric +from core.tbmv3 import trace_processor from tracing.value import histogram_set @@ -59,3 +60,17 @@ self.assertEqual(hist.unit, DUMMY_HISTOGRAM_UNIT) self.assertEqual(hist.num_values, 1) self.assertEqual(hist.average, 42) + + def testRunAllTbmv3Metrics(self): + """Run all existing TBMv3 metrics on an empty trace. + + This test checks for syntax errors in SQL and proto files. + """ + for filename in os.listdir(trace_processor.METRICS_PATH): + name, ext = os.path.splitext(filename) + if ext == '.sql': + run_tbmv3_metric.Main([ + '--trace', self.trace_path, + '--metric', name, + '--outfile', self.outfile_path, + ])
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index c3aaebd..fce433a0 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -412,6 +412,9 @@ crbug.com/954229 [ mac ] v8.runtime_stats.top_25/* [ Skip ] # Benchmark: webrtc +crbug.com/1081349 [ linux ] webrtc/multiple_peerconnections [ Skip ] +crbug.com/1081349 [ win10 ] webrtc/multiple_peerconnections [ Skip ] +crbug.com/1081349 [ linux ] webrtc/pause_play_peerconnections [ Skip ] crbug.com/1051644 [ win ] webrtc/pause_play_peerconnections [ Skip ] ##### Perf FYI benchmarks go after here #####
diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc index 7050729..0f80ccb 100644 --- a/ui/base/ui_base_features.cc +++ b/ui/base/ui_base_features.cc
@@ -188,10 +188,6 @@ return base::FeatureList::IsEnabled(features::kUseCommonSelectPopup); } -// Enable WebUI accessibility enhancements for review and testing. -const base::Feature kWebUIA11yEnhancements{"WebUIA11yEnhancements", - base::FEATURE_DISABLED_BY_DEFAULT}; - #if defined(OS_CHROMEOS) const base::Feature kHandwritingGesture = {"HandwritingGesture", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ui/base/ui_base_features.h b/ui/base/ui_base_features.h index 83d7157..ad5bc74 100644 --- a/ui/base/ui_base_features.h +++ b/ui/base/ui_base_features.h
@@ -94,9 +94,6 @@ bool IsNewShortcutMappingEnabled(); #endif -COMPONENT_EXPORT(UI_BASE_FEATURES) -extern const base::Feature kWebUIA11yEnhancements; - // Indicates whether DrmOverlayManager should used the synchronous API to // perform pageflip tests. COMPONENT_EXPORT(UI_BASE_FEATURES)
diff --git a/ui/base/webui/web_ui_util.cc b/ui/base/webui/web_ui_util.cc index 6b6ea2d9..ffc30f6 100644 --- a/ui/base/webui/web_ui_util.cc +++ b/ui/base/webui/web_ui_util.cc
@@ -189,7 +189,6 @@ void SetLoadTimeDataDefaults(const std::string& app_locale, base::DictionaryValue* localized_strings) { - localized_strings->SetString("a11yenhanced", GetA11yEnhanced()); localized_strings->SetString("fontfamily", GetFontFamily()); localized_strings->SetString("fontsize", GetFontSize()); localized_strings->SetString("language", l10n_util::GetLanguage(app_locale)); @@ -198,7 +197,6 @@ void SetLoadTimeDataDefaults(const std::string& app_locale, ui::TemplateReplacements* replacements) { - (*replacements)["a11yenhanced"] = GetA11yEnhanced(); (*replacements)["fontfamily"] = GetFontFamily(); (*replacements)["fontsize"] = GetFontSize(); (*replacements)["language"] = l10n_util::GetLanguage(app_locale); @@ -225,12 +223,6 @@ html->append("</style>"); } -std::string GetA11yEnhanced() { - return base::FeatureList::IsEnabled(features::kWebUIA11yEnhancements) - ? "a11y-enhanced" - : ""; -} - std::string GetFontFamily() { std::string font_family = l10n_util::GetStringUTF8(IDS_WEB_FONT_FAMILY);
diff --git a/ui/base/webui/web_ui_util.h b/ui/base/webui/web_ui_util.h index 77e20e2..3822b48 100644 --- a/ui/base/webui/web_ui_util.h +++ b/ui/base/webui/web_ui_util.h
@@ -88,7 +88,6 @@ // inline stylesheet. UI_BASE_EXPORT void AppendWebUiCssTextDefaults(std::string* html); -UI_BASE_EXPORT std::string GetA11yEnhanced(); // Get some common font styles for all of WebUI. UI_BASE_EXPORT std::string GetFontFamily(); UI_BASE_EXPORT std::string GetFontSize();
diff --git a/ui/chromeos/ime/candidate_window_view.cc b/ui/chromeos/ime/candidate_window_view.cc index c12f4c9..39f13e7 100644 --- a/ui/chromeos/ime/candidate_window_view.cc +++ b/ui/chromeos/ime/candidate_window_view.cc
@@ -397,9 +397,17 @@ // Update the cursor indexes in the model. candidate_window_.set_cursor_position(cursor_absolute_index); // Set position data. - candidate_views_[index_in_page]->SetPositionData( - candidate_window_.current_candidate_index(), - candidate_window_.total_candidates()); + int position_index = candidate_window_.current_candidate_index(); + int total_candidates = candidate_window_.total_candidates(); + if (position_index < 0 || total_candidates < 1 || + position_index >= total_candidates) { + // Sometimes we don't get valid data from |candidate_window_|. In this case, + // make a best guess about the position and total candidates. + position_index = index_in_page; + total_candidates = candidate_window_.candidates().size(); + } + candidate_views_[index_in_page]->SetPositionData(position_index, + total_candidates); } const char* CandidateWindowView::GetClassName() const { @@ -417,9 +425,5 @@ } } -void CandidateWindowView::GetAccessibleNodeData(ui::AXNodeData* node_data) { - node_data->role = ax::mojom::Role::kMenu; -} - } // namespace ime } // namespace ui
diff --git a/ui/chromeos/ime/candidate_window_view.h b/ui/chromeos/ime/candidate_window_view.h index 663b4e8..0e414ac15 100644 --- a/ui/chromeos/ime/candidate_window_view.h +++ b/ui/chromeos/ime/candidate_window_view.h
@@ -83,9 +83,6 @@ // Overridden from views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override; - // Overridden from View: - void GetAccessibleNodeData(ui::AXNodeData* node_data) override; - void SelectCandidateAt(int index_in_page); void UpdateVisibility();
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc index 882b723b..b9905fc 100644 --- a/ui/views/controls/button/md_text_button.cc +++ b/ui/views/controls/button/md_text_button.cc
@@ -31,23 +31,6 @@ namespace views { // static -std::unique_ptr<LabelButton> MdTextButton::CreateSecondaryUiButton( - ButtonListener* listener, - const base::string16& text) { - return MdTextButton::Create(listener, text, style::CONTEXT_BUTTON_MD); -} - -// static -std::unique_ptr<LabelButton> MdTextButton::CreateSecondaryUiProminentButton( - ButtonListener* listener, - const base::string16& text) { - auto md_button = - MdTextButton::Create(listener, text, style::CONTEXT_BUTTON_MD); - md_button->SetProminent(true); - return md_button; -} - -// static std::unique_ptr<MdTextButton> MdTextButton::Create(ButtonListener* listener, const base::string16& text, int button_context) {
diff --git a/ui/views/controls/button/md_text_button.h b/ui/views/controls/button/md_text_button.h index 458e031..760ab2a8 100644 --- a/ui/views/controls/button/md_text_button.h +++ b/ui/views/controls/button/md_text_button.h
@@ -19,14 +19,6 @@ public: METADATA_HEADER(MdTextButton); - // As above, but only creates an MdTextButton if MD is enabled in the - // secondary UI (as opposed to just "top chrome"/"primary" UI). - static std::unique_ptr<LabelButton> CreateSecondaryUiButton( - ButtonListener* listener, - const base::string16& text); - static std::unique_ptr<LabelButton> CreateSecondaryUiProminentButton( - ButtonListener* listener, - const base::string16& text); static std::unique_ptr<MdTextButton> Create( ButtonListener* listener, const base::string16& text,
diff --git a/ui/views/examples/dialog_example.cc b/ui/views/examples/dialog_example.cc index 9d42249..70e7fd4 100644 --- a/ui/views/examples/dialog_example.cc +++ b/ui/views/examples/dialog_example.cc
@@ -55,7 +55,7 @@ this->AddChildView(body); if (parent_->has_extra_button_->GetChecked()) { - DialogDelegate::SetExtraView(MdTextButton::CreateSecondaryUiButton( + DialogDelegate::SetExtraView(MdTextButton::Create( nullptr, parent_->extra_button_label_->GetText())); } @@ -174,8 +174,8 @@ kFixed, kButtonsColumnId, kFixed, provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL)); - show_ = layout->AddView( - MdTextButton::CreateSecondaryUiButton(this, base::ASCIIToUTF16("Show"))); + show_ = + layout->AddView(MdTextButton::Create(this, base::ASCIIToUTF16("Show"))); } void DialogExample::StartRowWithLabel(GridLayout* layout, const char* label) {
diff --git a/ui/views/examples/layout_example_base.cc b/ui/views/examples/layout_example_base.cc index 8f5ca09..a2e85e2 100644 --- a/ui/views/examples/layout_example_base.cc +++ b/ui/views/examples/layout_example_base.cc
@@ -239,7 +239,7 @@ int vertical_pos = kLayoutExampleVerticalSpacing; int horizontal_pos = kLayoutExampleLeftPadding; - auto add_button = MdTextButton::CreateSecondaryUiButton( + auto add_button = MdTextButton::Create( this, l10n_util::GetStringUTF16(IDS_LAYOUT_BASE_ADD_LABEL)); add_button->SetPosition(gfx::Point(horizontal_pos, vertical_pos)); add_button->SizeToPreferredSize();
diff --git a/ui/views/examples/login_bubble_dialog.cc b/ui/views/examples/login_bubble_dialog.cc index 5045bef6..a83e00b9 100644 --- a/ui/views/examples/login_bubble_dialog.cc +++ b/ui/views/examples/login_bubble_dialog.cc
@@ -132,8 +132,8 @@ GridLayout::ColumnSize::kUsePreferred, 0, 0); layout->StartRowWithPadding(0, 0, 0, related_control_padding); - button_ = layout->AddView(MdTextButton::CreateSecondaryUiButton( - this, GetStringUTF16(IDS_LOGIN_SHOW_BUTTON_LABEL))); + button_ = layout->AddView( + MdTextButton::Create(this, GetStringUTF16(IDS_LOGIN_SHOW_BUTTON_LABEL))); layout->StartRowWithPadding(0, 0, 0, related_control_padding); layout->AddView(std::make_unique<Label>(
diff --git a/ui/views/examples/widget_example.cc b/ui/views/examples/widget_example.cc index bbeebce982..7a410618 100644 --- a/ui/views/examples/widget_example.cc +++ b/ui/views/examples/widget_example.cc
@@ -51,8 +51,8 @@ SetBackground(CreateSolidBackground(SK_ColorGRAY)); SetLayoutManager(std::make_unique<BoxLayout>( BoxLayout::Orientation::kVertical, gfx::Insets(10), 10)); - SetExtraView(MdTextButton::CreateSecondaryUiButton( - nullptr, GetStringUTF16(IDS_WIDGET_EXTRA_BUTTON))); + SetExtraView( + MdTextButton::Create(nullptr, GetStringUTF16(IDS_WIDGET_EXTRA_BUTTON))); SetFootnoteView( std::make_unique<Label>(GetStringUTF16(IDS_WIDGET_FOOTNOTE_LABEL))); AddChildView(new Label(GetStringUTF16(IDS_WIDGET_DIALOG_CONTENTS_LABEL)));
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc index 3aec610..64e7e52 100644 --- a/ui/views/window/dialog_client_view.cc +++ b/ui/views/window/dialog_client_view.cc
@@ -266,10 +266,8 @@ return; } - std::unique_ptr<LabelButton> button = - is_default ? MdTextButton::CreateSecondaryUiProminentButton(this, title) - : MdTextButton::CreateSecondaryUiButton(this, title); - + auto button = MdTextButton::Create(this, title); + button->SetProminent(is_default); button->SetIsDefault(is_default); button->SetEnabled(delegate->IsDialogButtonEnabled(type));
diff --git a/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_camera.html b/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_camera.html index 2dd7bde..92c78ed1 100644 --- a/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_camera.html +++ b/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_camera.html
@@ -117,20 +117,16 @@ } #takePhoto { - --cr-icon-button-fill-color-focus: #ededed; --cr-icon-button-fill-color: #ededed; - --cr-icon-button-stroke-color-focus: var(--google-blue-500); --cr-icon-button-stroke-color: white; } :host([videomode]) #takePhoto { --cr-icon-button-fill-color: red; - --cr-icon-button-fill-color-focus: red; } #switchMode { --cr-icon-button-fill-color: white; - --cr-icon-button-fill-color-focus: var(--google-blue-500); } :host-context([dir=rtl]) #switchMode {
diff --git a/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html b/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html index 1c65e1d..67ad649b 100644 --- a/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html +++ b/ui/webui/resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html
@@ -58,7 +58,6 @@ cr-icon-button { --cr-icon-button-fill-color: white; - --cr-icon-button-fill-color-focus: var(--google-blue-500); --cr-icon-button-icon-size: 24px; --cr-icon-button-size: 28px; margin: 0;
diff --git a/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.html b/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.html index c4b47e81..b83538b 100644 --- a/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.html +++ b/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.html
@@ -9,7 +9,6 @@ <style> :host { --cr-icon-button-fill-color: var(--google-grey-refresh-700); - --cr-icon-button-fill-color-focus: white; --cr-icon-button-icon-start-offset: 0; --cr-icon-button-icon-size: 20px; --cr-icon-button-size: 36px; @@ -61,10 +60,6 @@ z-index: 1; } - :host-context([a11y-enhanced]):host([ripple-showing_]) #maskedImage { - background-color: var(--cr-icon-button-fill-color-focus); - } - #icon { align-items: center; border-radius: 4px; @@ -87,12 +82,6 @@ z-index: 1; } - :host-context([a11y-enhanced]):host([ripple-showing_]) iron-icon { - --iron-icon-fill-color: var(--cr-icon-button-fill-color-focus); - --iron-icon-stroke-color: var(--cr-icon-button-stroke-color-focus, - none); - } - paper-ripple { /* GG900 .15 is about GG700 .21 */ --paper-ripple-opacity: var(--cr-icon-button-ripple-opacity, .21); @@ -102,23 +91,12 @@ @media (prefers-color-scheme: dark) { :host { --cr-icon-button-fill-color: var(--google-grey-refresh-500); - --cr-icon-button-fill-color-focus: var(--google-grey-900); } paper-ripple { --paper-ripple-opacity: var(--cr-icon-button-ripple-opacity, .4); } } - - :host-context([a11y-enhanced]) paper-ripple { - --paper-ripple-opacity: 1; - opacity: 0; - transition: opacity var(--cr-icon-button-transition); - } - - :host-context([a11y-enhanced]):host([ripple-showing_]) paper-ripple { - opacity: 1; - } </style> <div id="icon"> <div id="maskedImage"></div>
diff --git a/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.js b/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.js index 6913401d..934132d8 100644 --- a/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.js +++ b/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.js
@@ -32,16 +32,11 @@ * The color of the icon can be overridden using CSS variables. When using * iron-icon both the fill and stroke can be overridden the variables: * --cr-icon-button-fill-color - * --cr-icon-button-fill-color-focus * --cr-icon-button-stroke-color - * --cr-icon-button-stroke-color-focus * * When not using iron-icon (ie. specifying --cr-icon-image), the icons support * one color and the 'stroke' variables are ignored. * - * The '-focus' variables are used for opaque ripple support. This is enabled - * when the 'a11y-enhanced' attribute on <html> is present. - * * When using iron-icon's, more than one icon can be specified by setting * the |ironIcon| property to a comma-delimited list of keys. */
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html index 13520fa..cda249d 100644 --- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar.html
@@ -58,7 +58,6 @@ } cr-icon-button { - --cr-icon-button-fill-color-focus: var(--cr-toolbar-background-color); --cr-icon-button-size: 32px; min-width: 32px; }
diff --git a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html index 5fdf281..60a5fbf 100644 --- a/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html +++ b/ui/webui/resources/cr_elements/cr_toolbar/cr_toolbar_search_field.html
@@ -25,9 +25,6 @@ } cr-icon-button { - --cr-icon-button-fill-color-focus: var( - --cr-toolbar-search-field-input-bg-color, - var(--cr-toolbar-background-color)); --cr-icon-button-size: var(--cr-toolbar-icon-container-size, 32px); margin: var(--cr-toolbar-icon-margin, 6px); }
diff --git a/url/gurl.cc b/url/gurl.cc index 27b470a..f23ed1c2 100644 --- a/url/gurl.cc +++ b/url/gurl.cc
@@ -519,7 +519,9 @@ } bool operator==(const GURL& x, const base::StringPiece& spec) { - DCHECK_EQ(GURL(spec).possibly_invalid_spec(), spec); + DCHECK_EQ(GURL(spec).possibly_invalid_spec(), spec) + << "Comparisons of GURLs and strings must ensure as a precondition that " + "the string is fully canonicalized."; return x.possibly_invalid_spec() == spec; }
diff --git a/weblayer/browser/android/javatests/skew/expectations.txt b/weblayer/browser/android/javatests/skew/expectations.txt index 6f1c3db..5e4c7abe 100644 --- a/weblayer/browser/android/javatests/skew/expectations.txt +++ b/weblayer/browser/android/javatests/skew/expectations.txt
@@ -11,6 +11,16 @@ # Tests against older WebLayer implementations. # --------------------------------------------- +# Cookie manager was added in M83. +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testCookieChanged [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testCookieChangedRemoveCallback [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testCookieChangedRemoveCallbackAfterProfileDestroyed [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testGetCookie [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testSetCookie [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testSetCookieInvalid [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testSetCookieNotSet [ Skip ] +[ impl_lte_82 ] org.chromium.weblayer.test.CookieManagerTest#testSetCookieNullCallback [ Skip ] + # ExternalNavigationTests are testing intent launching that changed after M83. [ impl_lte_83 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentInNewTabLaunchedOnLinkClick [ Skip ] [ impl_lte_83 ] org.chromium.weblayer.test.ExternalNavigationTest#testExternalIntentViaOnLoadBlocked [ Skip ]
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java b/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java index 4f776eff..37779e5f 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/ExternalNavigationDelegateImpl.java
@@ -39,7 +39,7 @@ } @Override - public boolean willChromeHandleIntent(Intent intent) { + public boolean willAppHandleIntent(Intent intent) { return false; } @@ -94,7 +94,7 @@ } @Override - public boolean isChromeAppInForeground() { + public boolean isApplicationInForeground() { return mTab.getBrowser().isResumed(); }