diff --git a/DEPS b/DEPS index 495b5e4..dcde31c 100644 --- a/DEPS +++ b/DEPS
@@ -105,10 +105,10 @@ # be overridden by gclient variables. 'checkout_google_benchmark': False, - # By default, do not checkout JavaScript coverage node modules. These packages + # By default, checkout JavaScript coverage node modules. These packages # are used to post-process raw v8 coverage reports into IstanbulJS compliant # output. - 'checkout_js_coverage_modules': False, + 'checkout_js_coverage_modules': True, # Check out and download nacl by default, unless on an arm mac. # This can be disabled e.g. with custom_vars. @@ -253,19 +253,19 @@ # 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': '3965dd41f45619e96398baa6127edc8dbf33fa43', + 'skia_revision': 'b3275e1fd64cbbf57a1e9a2ecb2db0812cfba4dc', # 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': 'b003970395b7efcc309eb30b4ca06dd8385acd55', + 'v8_revision': '06d67ad82724fb505603adf15d1645eccf54ebdf', # 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': 'e74d0e81fff77f5bf5151114481fb820fc7bbc92', + 'angle_revision': '7c616871c76f4341d64ec8ade98b028dfc879e95', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': 'd01dca1d18d03f055d0dabd99a210b5f666715ed', + 'swiftshader_revision': '2f3af2452783943f7d6994030a9fffa9ba3b3cec', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. @@ -320,7 +320,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '389f33bb40a3345b73a68613178c789476ceaecf', + 'catapult_revision': '54219055fcf8c7ace26e9095715dd1587ea3fbe6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -368,11 +368,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '7ed38d58fc792435504aba576fc97f9604e8b3cc', + 'dawn_revision': '39c2029063eda9984db96c763eb6c2deea23ea2b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': '41a1bdecabbd03b35702bacb51f6b14775a07e4d', + 'quiche_revision': 'e1e95c317128c4859cab9dc1bc69a0a4d86aa2bc', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -396,7 +396,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling nearby # and whatever else without interference from each other. - 'nearby_revision': '517d77f5aa4fea8f4437125830cfc55f84705e3d', + 'nearby_revision': '6d24d4213292b6911e0ed980e249c4ef6303a12c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling securemessage # and whatever else without interference from each other. @@ -711,7 +711,7 @@ Var('chromium_git') + '/external/github.com/toji/webvr.info.git' + '@' + 'c58ae99b9ff9e2aa4c524633519570bf33536248', 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + '9f939dcab5c4c8fc5be67578d2da6236349cbd49', + 'url': Var('chromium_git') + '/website.git' + '@' + '101a9895bd5a372341c191d638e07dc6cd219696', }, 'src/ios/third_party/earl_grey2/src': { @@ -1127,7 +1127,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'bc93924b3b2b84515d91ba49bb60ac0b89d928e1', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'fbb927599f97cd1636493c40f0a87a18c8d335c4', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1179,7 +1179,7 @@ Var('chromium_git') + '/external/github.com/google/gemmlowp.git' + '@' + '13d57703abca3005d97b19df1f2db731607a7dc2', 'src/third_party/grpc/src': { - 'url': Var('chromium_git') + '/external/github.com/grpc/grpc.git' + '@' + '2a0d6234cb2ccebb265c035ffd09ecc9a347b4bf', + 'url': Var('chromium_git') + '/external/github.com/grpc/grpc.git' + '@' + '208619cdce3b7cdc681cb50c29db619e46dd5af6', }, 'src/third_party/freetype/src': @@ -1510,7 +1510,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '6dadd2c3b267bd4776762dc5c0a4acb391abbc5e', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '5f95e723334de734243833fd44456be8951ff0a0', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1588,7 +1588,7 @@ 'packages': [ { 'package': 'fuchsia/third_party/android/aemu/release/linux-amd64', - 'version': 'npFnPpRDsfR65dWNWK7Bd-sNnXyASiLIUQB_fWalsiYC' + 'version': '1iaJuWjDsq9qEhJ9SniWtWXgKiBNBI854ufznwmUb5wC' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -1728,10 +1728,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'cf04aebdf9b53bb2853f22a81465688daf879ec6', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'a630866d89f74aa95cf3aecd78987637ee195b68', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '660020142c911b2b6e71d5098f2d55366ed64a61', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '0d5ce62d015cdb69a21d11171e9f01f2d32bfce7', + Var('webrtc_git') + '/src.git' + '@' + 'e0e91a624aecba25909bed63878f8caf0ad010ae', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1801,7 +1801,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@f0483037ea0223f52aa2c584eef845ab8199b2cd', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@b680906da8ae6af51981a32a27fd392ab77cb60d', 'condition': 'checkout_src_internal', },
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java index 7359931..631d66d 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
@@ -20,6 +20,7 @@ import org.junit.runner.RunWith; import org.chromium.android_webview.AwContents; +import org.chromium.android_webview.AwContentsStatics; import org.chromium.android_webview.AwScrollOffsetManager; import org.chromium.android_webview.test.AwActivityTestRule.PopupInfo; import org.chromium.android_webview.test.util.AwTestTouchUtils; @@ -218,14 +219,21 @@ && scrollYPix == testContainerView.getScrollY()); } + private int[] getScrollOnMainSync(final ScrollTestContainerView testContainerView) { + final int scroll[] = new int[2]; + InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { + scroll[0] = testContainerView.getScrollX(); + scroll[1] = testContainerView.getScrollY(); + }); + return scroll; + } + private void assertScrollOnMainSync(final ScrollTestContainerView testContainerView, final int scrollXPix, final int scrollYPix) { - final AtomicInteger scrolledXPix = new AtomicInteger(); - final AtomicInteger scrolledYPix = new AtomicInteger(); - InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { - scrolledXPix.set(testContainerView.getScrollX()); - scrolledYPix.set(testContainerView.getScrollY()); - }); + int scrolled[] = getScrollOnMainSync(testContainerView); + int scrolledXPix = scrolled[0]; + int scrolledYPix = scrolled[1]; + // Actual scrolling is done using this formula: // floor (scroll_offset_dip * max_offset) / max_scroll_offset_dip // where max_offset is calculated using a ceil operation. @@ -251,11 +259,11 @@ // // For more information, see crbug.com/537343 Assert.assertTrue("Actual and expected x-scroll offsets do not match. Expected " - + scrollXPix + ", actual " + scrolledXPix.get(), - scrollXPix == scrolledXPix.get() || scrollXPix == scrolledXPix.get() - 1); + + scrollXPix + ", actual " + scrolledXPix, + scrollXPix == scrolledXPix || scrollXPix == scrolledXPix - 1); Assert.assertTrue("Actual and expected y-scroll offsets do not match. Expected " - + scrollYPix + ", actual " + scrolledYPix.get(), - scrollYPix == scrolledYPix.get() || scrollYPix == scrolledYPix.get() - 1); + + scrollYPix + ", actual " + scrolledYPix, + scrollYPix == scrolledYPix || scrollYPix == scrolledYPix - 1); } private void assertScrollInJs(final AwContents awContents, @@ -871,4 +879,43 @@ InstrumentationRegistry.getInstrumentation().runOnMainSync( () -> Assert.assertEquals(testContainerView.getScrollY(), scrolledYPix)); } + + // Regression test for crbug.com/1299753. + @Test + @SmallTest + @Feature("AndroidWebView") + public void testCanTouchScrollYWithRecordFullDocument() throws Throwable { + InstrumentationRegistry.getInstrumentation().runOnMainSync( + () -> { AwContentsStatics.setRecordFullDocument(true); }); + + final TestAwContentsClient contentsClient = new TestAwContentsClient(); + final ScrollTestContainerView testContainerView = + (ScrollTestContainerView) mActivityTestRule.createAwTestContainerViewOnMainSync( + contentsClient); + AwActivityTestRule.enableJavaScriptOnUiThread(testContainerView.getAwContents()); + + // Load page. + loadTestPageAndWaitForFirstFrame(testContainerView, contentsClient, null, ""); + + // Check page loaded at scroll offset 0. + { + int scroll[] = getScrollOnMainSync(testContainerView); + Assert.assertEquals(0, scroll[1]); + } + + // Drag scroll. + final CallbackHelper onScrollToCallbackHelper = + testContainerView.getOnScrollToCallbackHelper(); + final int scrollToCallCount = onScrollToCallbackHelper.getCallCount(); + final int dragSteps = 10; + final int dragStepSize = 24; + final int targetScrollYPix = dragStepSize * dragSteps; + AwTestTouchUtils.dragCompleteView(testContainerView, 0, 0, 0, -targetScrollYPix, dragSteps); + + // Poll until scroll on UI is bigger than 0. + AwActivityTestRule.pollInstrumentationThread(() -> { + int scroll[] = getScrollOnMainSync(testContainerView); + return scroll[1] > 0; + }); + } }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java index 754055f..2823c67 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java
@@ -15,7 +15,6 @@ import org.chromium.android_webview.AwContents; import org.chromium.android_webview.AwContentsClient.AwWebResourceRequest; -import org.chromium.base.test.util.DisabledTest; import org.chromium.content_public.browser.test.util.TestCallbackHelperContainer; import org.chromium.net.test.util.TestWebServer; @@ -92,7 +91,6 @@ // in ServiceWorker fetches. @Test @SmallTest - @DisabledTest(message = "Disable for flakyness http://crbug.com/676422") public void testFetchHttpError() throws Throwable { final String fullIndexUrl = mWebServer.setResponse("/index.html", INDEX_HTML, null); final String fullSwUrl = mWebServer.setResponse("/sw.js", SW_HTML, null);
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 76c2f85..d500ac4e 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -719,7 +719,6 @@ "metrics/task_switch_source.h", "metrics/task_switch_time_tracker.cc", "metrics/task_switch_time_tracker.h", - "metrics/user_metrics_action.h", "metrics/user_metrics_recorder.cc", "metrics/user_metrics_recorder.h", "multi_device_setup/multi_device_notification_presenter.cc", @@ -776,6 +775,8 @@ "public/cpp/style/scoped_light_mode_as_default.h", "public/cpp/window_finder.h", "public/cpp/window_tree_host_lookup.h", + "rgb_keyboard/rgb_keyboard_manager.cc", + "rgb_keyboard/rgb_keyboard_manager.h", "root_window_controller.cc", "root_window_controller.h", "root_window_settings.cc", @@ -2506,6 +2507,7 @@ "projector/projector_metadata_model_unittest.cc", "projector/projector_ui_controller_unittest.cc", "public/mojom/accelerator_keys_mojom_traits_unittest.cc", + "rgb_keyboard/rgb_keyboard_manager_unittest.cc", "root_window_controller_unittest.cc", "rotator/screen_rotation_animation_unittest.cc", "rotator/screen_rotation_animator_unittest.cc",
diff --git a/ash/accessibility/accessibility_controller_impl.cc b/ash/accessibility/accessibility_controller_impl.cc index 871ee60..d17f813 100644 --- a/ash/accessibility/accessibility_controller_impl.cc +++ b/ash/accessibility/accessibility_controller_impl.cc
@@ -52,6 +52,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/metrics/histogram_functions.h" +#include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/strings/string_number_conversions.h" #include "components/live_caption/pref_names.h" @@ -1511,7 +1512,8 @@ void AccessibilityControllerImpl::ToggleDictationFromSource( DictationToggleSource source) { base::RecordAction(base::UserMetricsAction("Accel_Toggle_Dictation")); - UserMetricsRecorder::RecordUserToggleDictation(source); + UMA_HISTOGRAM_ENUMERATION("Accessibility.CrosDictation.ToggleDictationMethod", + source); dictation().SetEnabled(true); ToggleDictation();
diff --git a/ash/app_list/views/app_list_item_view.cc b/ash/app_list/views/app_list_item_view.cc index 5e2dcab..ff4b7b43 100644 --- a/ash/app_list/views/app_list_item_view.cc +++ b/ash/app_list/views/app_list_item_view.cc
@@ -377,19 +377,23 @@ SetAnimationDuration(base::TimeDelta()); preview_circle_radius_ = 0; +} +void AppListItemView::InitializeIconLoader() { + DCHECK(item_weak_); // Creates app icon load helper. base::Unretained is safe because `this` owns // `icon_load_helper_` and `view_delegate_` outlives `this`. if (is_folder_) { - AppListFolderItem* folder_item = static_cast<AppListFolderItem*>(item); + AppListFolderItem* folder_item = + static_cast<AppListFolderItem*>(item_weak_); icon_load_helper_.emplace( folder_item->item_list(), base::BindRepeating(&AppListViewDelegate::LoadIcon, base::Unretained(view_delegate_))); } else { icon_load_helper_.emplace( - item, base::BindRepeating(&AppListViewDelegate::LoadIcon, - base::Unretained(view_delegate_))); + item_weak_, base::BindRepeating(&AppListViewDelegate::LoadIcon, + base::Unretained(view_delegate_))); } }
diff --git a/ash/app_list/views/app_list_item_view.h b/ash/app_list/views/app_list_item_view.h index 915c88bf..624541e 100644 --- a/ash/app_list/views/app_list_item_view.h +++ b/ash/app_list/views/app_list_item_view.h
@@ -119,6 +119,13 @@ AppListItemView& operator=(const AppListItemView&) = delete; ~AppListItemView() override; + // Initializes icon loader. Should be called after the view has been added to + // the apps grid view model - otherwise, if icon gets updated synchronously, + // it may update the item metadata before the view gets added to the view + // model. If the metadata update causes a position change, attempts to move + // the item in the view model could crash. + void InitializeIconLoader(); + // Sets the app list config that should be used to size the app list icon, and // margins within the app list item view. The owner should ensure the // `AppListItemView` does not outlive the object referenced by
diff --git a/ash/app_list/views/apps_container_view.cc b/ash/app_list/views/apps_container_view.cc index a4c22b7..178dfb8 100644 --- a/ash/app_list/views/apps_container_view.cc +++ b/ash/app_list/views/apps_container_view.cc
@@ -642,9 +642,7 @@ const int kBottomDragBufferMin = scrollable_container_->bounds().bottom() - apps_grid_view_->GetInsets().bottom() - page_flip_zone_size; - // TODO(crbug.com/1234064): In ProductivityLauncher, with a variable row size, - // the size of the bottom drag buffer can visually change. Figure out how we - // want to handle this and update this code to reflect that. + return point_in_parent.y() > kBottomDragBufferMin && point_in_parent.y() < kBottomDragBufferMax; }
diff --git a/ash/app_list/views/apps_grid_view.cc b/ash/app_list/views/apps_grid_view.cc index 68b54772..0d484d9d 100644 --- a/ash/app_list/views/apps_grid_view.cc +++ b/ash/app_list/views/apps_grid_view.cc
@@ -1143,6 +1143,7 @@ DCHECK(!selected_view_); DCHECK(!drag_view_); + std::vector<AppListItemView*> item_views; if (item_list_ && item_list_->item_count()) { for (size_t i = 0; i < item_list_->item_count(); ++i) { // Skip "page break" items. @@ -1150,7 +1151,7 @@ continue; std::unique_ptr<AppListItemView> view = CreateViewForItemAtIndex(i); view_model_.Add(view.get(), view_model_.view_size()); - items_container_->AddChildView(std::move(view)); + item_views.push_back(items_container_->AddChildView(std::move(view))); } } view_structure_.LoadFromMetadata(); @@ -1159,6 +1160,11 @@ UpdatePulsingBlockViews(); InvalidateLayout(); + // Icon load can change the item position in the view model, so don't iterate + // over view model to get items to update. + for (auto* item_view : item_views) + item_view->InitializeIconLoader(); + if (!folder_delegate_) RecordPageMetrics(); } @@ -2500,6 +2506,7 @@ drag_view_hider_ = std::make_unique<DragViewHider>(drag_view_); drag_view_->RequestFocus(); } + view->InitializeIconLoader(); } view_structure_.LoadFromMetadata();
diff --git a/ash/app_list/views/paged_apps_grid_view.cc b/ash/app_list/views/paged_apps_grid_view.cc index 9091a9f..bc13604 100644 --- a/ash/app_list/views/paged_apps_grid_view.cc +++ b/ash/app_list/views/paged_apps_grid_view.cc
@@ -1040,12 +1040,32 @@ // Drag zones are at the edges of the scroll axis. if (IsScrollAxisVertical()) { - if (drag_point.y() < kPageFlipZoneSize + GetInsets().top()) { - new_page_flip_target = pagination_model_.selected_page() - 1; - } else if (container_delegate_->IsPointWithinBottomDragBuffer( - drag_point, kPageFlipZoneSize)) { - // If the drag point is within the drag buffer, but not over the shelf. - new_page_flip_target = pagination_model_.selected_page() + 1; + if (features::IsProductivityLauncherEnabled()) { + if (background_cards_.empty() || + !container_delegate_->IsPointWithinPageFlipBuffer(drag_point)) { + return new_page_flip_target; + } + + gfx::RectF background_card_rect_in_grid( + background_cards_[GetSelectedPage()]->bounds()); + View::ConvertRectToTarget(items_container(), this, + &background_card_rect_in_grid); + + // Set page flip target when the drag is above or below the background + // card of the currently selected page. + if (drag_point.y() < background_card_rect_in_grid.y()) { + new_page_flip_target = pagination_model_.selected_page() - 1; + } else if (drag_point.y() > background_card_rect_in_grid.bottom()) { + new_page_flip_target = pagination_model_.selected_page() + 1; + } + } else { + if (drag_point.y() < kPageFlipZoneSize + GetInsets().top()) { + new_page_flip_target = pagination_model_.selected_page() - 1; + } else if (container_delegate_->IsPointWithinBottomDragBuffer( + drag_point, kPageFlipZoneSize)) { + // If the drag point is within the drag buffer, but not over the shelf. + new_page_flip_target = pagination_model_.selected_page() + 1; + } } } else { // TODO(xiyuan): Fix this for RTL.
diff --git a/ash/app_list/views/paged_apps_grid_view_unittest.cc b/ash/app_list/views/paged_apps_grid_view_unittest.cc index 6a4df39..ea41a43 100644 --- a/ash/app_list/views/paged_apps_grid_view_unittest.cc +++ b/ash/app_list/views/paged_apps_grid_view_unittest.cc
@@ -267,6 +267,113 @@ EXPECT_EQ(1, pagination_model->selected_page()); } +// Test that dragging an app item just above or just below the background card +// of the selected page will trigger a page flip. +TEST_F(PagedAppsGridViewTest, PageFlipBufferSizedByBackgroundCard) { + PaginationModel* pagination_model = + GetAppListTestHelper()->GetRootPagedAppsGridView()->pagination_model(); + + // Populate with enough apps to fill 2 pages. + GetAppListTestHelper()->AddAppItems(30); + EXPECT_EQ(2, pagination_model->total_pages()); + GetPagedAppsGridView()->GetWidget()->LayoutRootViewIfNecessary(); + auto page_flip_waiter = std::make_unique<PageFlipWaiter>(pagination_model); + + // Drag down to the next page. + StartDragOnItemViewAtVisualIndex(0, 0); + GetEventGenerator()->MoveMouseBy(10, 10); + + // Test that dragging an item to just past the bottom of the background card + // causes a page flip. + gfx::Point bottom_of_card = GetPagedAppsGridView() + ->GetBackgroundCardBoundsForTesting(0) + .bottom_left(); + bottom_of_card.Offset(0, 1); + views::View::ConvertPointToScreen(GetPagedAppsGridView(), &bottom_of_card); + GetEventGenerator()->MoveMouseTo(bottom_of_card); + page_flip_waiter->Wait(); + GetEventGenerator()->ReleaseLeftButton(); + + EXPECT_EQ(1, pagination_model->selected_page()); + + // Drag up to the previous page. + StartDragOnItemViewAtVisualIndex(1, 0); + GetEventGenerator()->MoveMouseBy(10, 10); + + // Test that dragging an item to just past the top of the background card + // causes a page flip. + gfx::Point top_of_card = + GetPagedAppsGridView()->GetBackgroundCardBoundsForTesting(1).origin(); + top_of_card.Offset(0, -1); + views::View::ConvertPointToScreen(GetPagedAppsGridView(), &top_of_card); + GetEventGenerator()->MoveMouseTo(top_of_card); + page_flip_waiter->Wait(); + GetEventGenerator()->ReleaseLeftButton(); + + EXPECT_EQ(0, pagination_model->selected_page()); +} + +// Test that dragging an item to just past the top of the first page +// background card does not cause a page flip. +TEST_F(PagedAppsGridViewTest, NoPageFlipUpOnFirstPage) { + PaginationModel* pagination_model = + GetAppListTestHelper()->GetRootPagedAppsGridView()->pagination_model(); + + // Populate with enough apps to fill 2 pages. + GetAppListTestHelper()->AddAppItems(30); + EXPECT_EQ(2, pagination_model->total_pages()); + GetPagedAppsGridView()->GetWidget()->LayoutRootViewIfNecessary(); + + StartDragOnItemViewAtVisualIndex(0, 0); + GetEventGenerator()->MoveMouseBy(10, 10); + + // Drag an item to just past the top of the first page background card. + gfx::Point top_of_first_card = + GetPagedAppsGridView()->GetBackgroundCardBoundsForTesting(0).origin(); + top_of_first_card.Offset(0, -1); + + views::View::ConvertPointToScreen(GetPagedAppsGridView(), &top_of_first_card); + GetEventGenerator()->MoveMouseTo(top_of_first_card); + task_environment()->FastForwardBy(base::Seconds(2)); + GetEventGenerator()->ReleaseLeftButton(); + + // Selected page should still be at the first page. + EXPECT_EQ(0, pagination_model->selected_page()); +} + +// Test that dragging an item to just past the bottom of the last background +// card does not cause a page flip. +TEST_F(PagedAppsGridViewTest, NoPageFlipDownOnLastPage) { + PaginationModel* pagination_model = + GetAppListTestHelper()->GetRootPagedAppsGridView()->pagination_model(); + + // Populate with enough apps to fill 2 pages. + GetAppListTestHelper()->AddAppItems(30); + EXPECT_EQ(2, pagination_model->total_pages()); + GetPagedAppsGridView()->GetWidget()->LayoutRootViewIfNecessary(); + + // Select the last page. + pagination_model->SelectPage(pagination_model->total_pages() - 1, false); + EXPECT_EQ(1, pagination_model->selected_page()); + + StartDragOnItemViewAtVisualIndex(1, 0); + GetEventGenerator()->MoveMouseBy(10, 10); + + // Drag an item to just past the bottom of the last background card. + gfx::Point bottom_of_last_card = GetPagedAppsGridView() + ->GetBackgroundCardBoundsForTesting(1) + .bottom_left(); + bottom_of_last_card.Offset(0, 1); + views::View::ConvertPointToScreen(GetPagedAppsGridView(), + &bottom_of_last_card); + GetEventGenerator()->MoveMouseTo(bottom_of_last_card); + task_environment()->FastForwardBy(base::Seconds(2)); + GetEventGenerator()->ReleaseLeftButton(); + + // Selected page should not have changed and should still be the last page. + EXPECT_EQ(1, pagination_model->selected_page()); +} + // Test that the first page of the root level paged apps grid holds less apps to // accommodate the recent apps, which are shown at the top of the first page, // and the app list nudge, which is shown right above the apps grid view. Then
diff --git a/ash/app_list/views/recent_apps_view.cc b/ash/app_list/views/recent_apps_view.cc index 50416fd..4d805f6 100644 --- a/ash/app_list/views/recent_apps_view.cc +++ b/ash/app_list/views/recent_apps_view.cc
@@ -228,6 +228,7 @@ AppListItemView::Context::kRecentAppsView)); item_view->UpdateAppListConfig(app_list_config_); item_views_.push_back(item_view); + item_view->InitializeIconLoader(); } }
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index df8184d6..7d2e5d6e 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -1102,126 +1102,6 @@ Start selecting </message> - <!-- This block of strings is for an experimental Switch Access feature hidden behind a flag --> - <message name="IDS_ASH_SWITCH_ACCESS_SHORTCUTS" desc="The label for the Switch Access menu option to open the shortcutss menu." translateable="false"> - Shortcuts - </message> - <message name="IDS_ASH_SWITCH_ACCESS_LEAVE_GROUP" desc="The label for the Switch Access menu option to leave the current group." translateable="false"> - Leave group - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_MENU" desc="Switch access sub menu option for web." translateable="false"> - Web - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_BOOKMARK" desc="Switch access sub menu option to bookmark a page." translateable="false"> - Bookmark - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_BOTTOM_OF_PAGE" desc="Switch access sub menu option to jump to bottom of page." translateable="false"> - Bottom of page - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_TOP_OF_PAGE" desc="Switch access sub menu option to jump to top of page." translateable="false"> - Top of page - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_FIND_IN_PAGE" desc="Switch access sub menu option to find in page." translateable="false"> - Find in page - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_DOWNLOADS" desc="Switch access sub menu option to open downloads." translateable="false"> - Downloads - </message> - <message name="IDS_ASH_SWITCH_ACCESS_WEB_CLEAR_HISTORY" desc="Switch access sub menu option to clear history." translateable="false"> - Clear history - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_MENU" desc="Switch access sub menu option for system." translateable="false"> - System - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_STATUS_BAR" desc="Switch access sub menu option to open status bar." translateable="false"> - Status bar - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_LAUNCHER" desc="Switch access sub menu option to open the launcher." translateable="false"> - Launcher - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_TASK_MANAGER" desc="Switch access sub menu option to open task manager." translateable="false"> - Task manager - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_DIAGNOSTICS" desc="Switch access sub menu option to open diagnostics." translateable="false"> - Diagnostics - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_SCREENSHOT" desc="Switch access sub menu option to take a screenshot." translateable="false"> - Take screenshot - </message> - <message name="IDS_ASH_SWITCH_ACCESS_SYSTEM_HELP" desc="Switch access sub menu option to open help." translateable="false"> - Help - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_MENU" desc="Switch access sub menu option for media." translateable="false"> - Media - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_MUTE" desc="Switch access sub menu option to mute." translateable="false"> - Mute - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_VOLUME_DOWN" desc="Switch access sub menu option to turn volume down." translateable="false"> - Volume down - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_VOLUME_UP" desc="Switch access sub menu option to turn volume up." translateable="false"> - Volume up - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_REWIND" desc="Switch access sub menu option to rewind." translateable="false"> - Rewind - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_PLAY_PAUSE" desc="Switch access sub menu option to play or pause." translateable="false"> - Play - </message> - <message name="IDS_ASH_SWITCH_ACCESS_MEDIA_FASTFORWARD" desc="Switch access sub menu option to fastforward." translateable="false"> - Fast-forward - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_MENU" desc="Switch access sub menu option for display." translateable="false"> - Display - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_MIRROR" desc="Switch access sub menu option to mirror display." translateable="false"> - Mirror - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_BRIGHTNESS_DOWN" desc="Switch access sub menu option to turn down brightness." translateable="false"> - Brightness down - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_BRIGHTNESS_UP" desc="Switch access sub menu option to turn up brightness." translateable="false"> - Brightness up - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_ROTATE" desc="Switch access sub menu option to rotate screen." translateable="false"> - Rotate - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_ZOOM_OUT" desc="Switch access sub menu option to zoom out." translateable="false"> - Zoom out - </message> - <message name="IDS_ASH_SWITCH_ACCESS_DISPLAY_ZOOM_IN" desc="Switch access sub menu option to zoom in." translateable="false"> - Zoom in - </message> - <message name="IDS_ASH_SWITCH_ACCESS_USER_MENU" desc="Switch access sub menu option for user." translateable="false"> - User - </message> - <message name="IDS_ASH_SWITCH_ACCESS_USER_LOCK" desc="Switch access sub menu option to lock." translateable="false"> - Lock - </message> - <message name="IDS_ASH_SWITCH_ACCESS_USER_PREVIOUS_USER" desc="Switch access sub menu option to go to previous user." translateable="false"> - Previous user - </message> - <message name="IDS_ASH_SWITCH_ACCESS_USER_NEXT_USER" desc="Switch access sub menu option to go to next user." translateable="false"> - Next user - </message> - <message name="IDS_ASH_SWITCH_ACCESS_USER_SIGN_OUT" desc="Switch access sub menu option to sign out." translateable="false"> - Sign out - </message> - <message name="IDS_ASH_SWITCH_ACCESS_ACTION_RECORDER" desc="The label for the Switch Access menu option to open the action recorder menu." translateable="false"> - Action recorder - </message> - <message name="IDS_ASH_SWITCH_ACCESS_START_RECORDING" desc="The label for the Switch Access menu option to start recording a macro." translateable="false"> - Start recording - </message> - <message name="IDS_ASH_SWITCH_ACCESS_STOP_RECORDING" desc="The label for the Switch Access menu option to stop recording a macro." translateable="false"> - Stop recording - </message> - <message name="IDS_ASH_SWITCH_ACCESS_EXECUTE_MACRO" desc="The label for the Switch Access menu option to execute the recorded macro." translateable="false"> - Execute macro - </message> - <!-- End of experimental Switch Access feature block --> - <!-- Dictation UI hint strings --> <message name="IDS_ASH_DICTATION_HINT_TRY_SAYING" desc="A label shown in the Dictation bubble UI telling users what they can say."> Try saying: @@ -4075,6 +3955,12 @@ <message name="IDS_ASH_SCREEN_CAPTURE_SHOW_CAMERA_USER_NUDGE" desc="The message shown in a toast widget to nudge the user and alert them to check out the new settings that allow them to show camera during video recording."> You can now record yourself and your screen at the same time </message> + <message name="IDS_ASH_SCREEN_CAPTURE_TOOLTIP_COLLAPSE_SELFIE_CAMERA" desc="Tooltip of the collapse resize button for screen capture selfie camera."> + Collapse camera + </message> + <message name="IDS_ASH_SCREEN_CAPTURE_TOOLTIP_EXPAND_SELFIE_CAMERA" desc="Tooltip of the expand resize button for screen capture selfie camera."> + Expand camera + </message> <message name="IDS_ASH_SCREEN_CAPTURE_TOOLTIP_FULLSCREEN_SCREENSHOT" desc="Tooltip of the fullscreen toggle button when in image capture mode."> Take full screen screenshot </message>
diff --git a/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_TOOLTIP_COLLAPSE_SELFIE_CAMERA.png.sha1 b/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_TOOLTIP_COLLAPSE_SELFIE_CAMERA.png.sha1 new file mode 100644 index 0000000..bc7ed7468d --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_TOOLTIP_COLLAPSE_SELFIE_CAMERA.png.sha1
@@ -0,0 +1 @@ +dafe48f9caedb12a8fa7683c6f335a8f4514962b \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_TOOLTIP_EXPAND_SELFIE_CAMERA.png.sha1 b/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_TOOLTIP_EXPAND_SELFIE_CAMERA.png.sha1 new file mode 100644 index 0000000..d36f391f --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_TOOLTIP_EXPAND_SELFIE_CAMERA.png.sha1
@@ -0,0 +1 @@ +4ebfcb38af98285a8d1c75b6e5f0cad004f2ed74 \ No newline at end of file
diff --git a/ash/capture_mode/capture_mode_camera_controller.cc b/ash/capture_mode/capture_mode_camera_controller.cc index 571a37e..4848684 100644 --- a/ash/capture_mode/capture_mode_camera_controller.cc +++ b/ash/capture_mode/capture_mode_camera_controller.cc
@@ -24,6 +24,8 @@ #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point_conversions.h" +#include "ui/gfx/geometry/rounded_corners_f.h" +#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/transform.h" #include "ui/views/animation/animation_builder.h" #include "ui/views/widget/widget.h" @@ -153,6 +155,11 @@ } } +gfx::Size GetInitialPreviewSize(bool is_camera_preview_collapsed) { + return is_camera_preview_collapsed ? capture_mode::kCollapsedPreviewSize + : capture_mode::kCameraPreviewSize; +} + } // namespace // ----------------------------------------------------------------------------- @@ -289,7 +296,11 @@ return; } - camera_preview_widget_->SetBounds(GetPreviewWidgetBounds()); + const gfx::Rect target_bounds = GetPreviewWidgetBounds(); + camera_preview_widget_->SetBounds(target_bounds); + ui::Layer* layer = camera_preview_widget_->GetLayer(); + layer->SetRoundedCornerRadius( + gfx::RoundedCornersF(target_bounds.height() / 2.f)); } void CaptureModeCameraController::StartDraggingPreview( @@ -348,6 +359,21 @@ } } +void CaptureModeCameraController::ToggleCameraPreviewSize() { + DCHECK(camera_preview_view_); + is_camera_preview_collapsed_ = !is_camera_preview_collapsed_; + // The order here matters, the preferred size for `camera_preview_view_` + // should always be set before `MaybeUpdatePreviewWidgetBounds`, since + // `GetPreviewWidgetBounds` called by `MaybeUpdatePreviewWidgetBounds` has + // dependency on the preferred size of the `camera_preview_view_`. + auto preferred_size = camera_preview_view_->GetPreferredSize(); + const float scale_factor = is_camera_preview_collapsed_ ? 0.5f : 2.f; + preferred_size = gfx::ScaleToFlooredSize(preferred_size, scale_factor); + camera_preview_view_->SetPreferredSize(preferred_size); + + MaybeUpdatePreviewWidgetBounds(); +} + void CaptureModeCameraController::OnDevicesChanged( base::SystemMonitor::DeviceType device_type) { if (device_type == base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE) @@ -443,10 +469,14 @@ } if (!camera_preview_widget_) { - camera_preview_widget_ = - CreateCameraPreviewWidget(GetPreviewWidgetBounds()); + const gfx::Rect preview_bounds = GetPreviewWidgetBounds(); + camera_preview_widget_ = CreateCameraPreviewWidget(preview_bounds); camera_preview_view_ = camera_preview_widget_->SetContentsView( - std::make_unique<CameraPreviewView>(this)); + std::make_unique<CameraPreviewView>(this, preview_bounds.size())); + ui::Layer* layer = camera_preview_widget_->GetLayer(); + layer->SetFillsBoundsOpaquely(false); + layer->SetRoundedCornerRadius( + gfx::RoundedCornersF(preview_bounds.height() / 2.f)); } camera_preview_widget_->Show(); } @@ -464,9 +494,15 @@ auto* controller = CaptureModeController::Get(); DCHECK(controller->IsActive() || controller->is_recording_in_progress()); const gfx::Rect confine_bounds = controller->GetCameraPreviewConfineBounds(); - const gfx::Size preview_size = camera_preview_view_ - ? camera_preview_view_->GetPreferredSize() - : capture_mode::kCameraPreviewSize; + + // If `camera_preview_view_` is available, the preferred size of the + // `camera_preview_view_` should be used otherwise the initial preview size + // inferred from the `is_camera_preview_collapsed_` will be used. + const gfx::Size preview_size = + camera_preview_view_ + ? camera_preview_view_->GetPreferredSize() + : GetInitialPreviewSize(is_camera_preview_collapsed_); + if (confine_bounds.IsEmpty()) return gfx::Rect(preview_size);
diff --git a/ash/capture_mode/capture_mode_camera_controller.h b/ash/capture_mode/capture_mode_camera_controller.h index 2efe303..fd01863 100644 --- a/ash/capture_mode/capture_mode_camera_controller.h +++ b/ash/capture_mode/capture_mode_camera_controller.h
@@ -141,6 +141,9 @@ return camera_preview_snap_position_; } bool is_drag_in_progress() const { return is_drag_in_progress_; } + bool is_camera_preview_collapsed() const { + return is_camera_preview_collapsed_; + } void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -175,6 +178,10 @@ void ContinueDraggingPreview(const gfx::PointF& screen_location); void EndDraggingPreview(const gfx::PointF& screen_location, bool is_touch); + // Updates the bounds of the preview widget and the value of + // `is_camera_preview_collapsed_` when the resize button is pressed. + void ToggleCameraPreviewSize(); + // base::SystemMonitor::DevicesChangedObserver: void OnDevicesChanged(base::SystemMonitor::DeviceType device_type) override; @@ -185,6 +192,9 @@ base::OneShotTimer* camera_reconnect_timer_for_test() { return &camera_reconnect_timer_; } + CameraPreviewView* camera_preview_view_for_test() const { + return camera_preview_view_; + } private: // Called to connect to the video capture services's video source provider for @@ -287,6 +297,11 @@ // True when the dragging for `camera_preview_view_` is in progress. bool is_drag_in_progress_ = false; + // True if the camera preview is collapsed. Its value will be updated when + // the resize button is clicked. The size of the preview widget and the icon + // of the resize button will be updated based on it. + bool is_camera_preview_collapsed_ = false; + base::WeakPtrFactory<CaptureModeCameraController> weak_ptr_factory_{this}; };
diff --git a/ash/capture_mode/capture_mode_camera_preview_view.cc b/ash/capture_mode/capture_mode_camera_preview_view.cc index 86d4670..65fff45 100644 --- a/ash/capture_mode/capture_mode_camera_preview_view.cc +++ b/ash/capture_mode/capture_mode_camera_preview_view.cc
@@ -4,13 +4,20 @@ #include "ash/capture_mode/capture_mode_camera_preview_view.h" +#include "ash/capture_mode/capture_mode_button.h" #include "ash/capture_mode/capture_mode_camera_controller.h" #include "ash/capture_mode/capture_mode_constants.h" +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "base/bind.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/rounded_corners_f.h" +#include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" namespace ash { @@ -21,22 +28,37 @@ return event.target()->GetScreenLocationF(event); } +const gfx::VectorIcon& GetIconOfResizeButton( + const bool is_camera_preview_collapsed) { + return is_camera_preview_collapsed ? kCaptureModeCameraPreviewExpandIcon + : kCaptureModeCameraPreviewCollapseIcon; +} + } // namespace CameraPreviewView::CameraPreviewView( - CaptureModeCameraController* camera_controller) - : camera_controller_(camera_controller) { + CaptureModeCameraController* camera_controller, + const gfx::Size& preview_view_preferred_size) + : camera_controller_(camera_controller), + resize_button_(AddChildView(std::make_unique<CaptureModeButton>( + base::BindRepeating(&CameraPreviewView::OnResizeButtonPressed, + base::Unretained(this)), + GetIconOfResizeButton( + camera_controller_->is_camera_preview_collapsed())))) { SetPaintToLayer(); // TODO: The solid color contents view will be replaced later by the view that // will render the video frams. SetBackground(views::CreateSolidBackground(gfx::kGoogleGrey700)); - layer()->SetFillsBoundsOpaquely(false); - layer()->SetRoundedCornerRadius( - gfx::RoundedCornersF(capture_mode::kCameraPreviewSize.height() / 2.f)); // TODO(crbug.com/1295325): Update this when implementing video frames // rendering. - SetPreferredSize(capture_mode::kCameraPreviewSize); + SetPreferredSize(preview_view_preferred_size); + + resize_button_->SetBackground(views::CreateRoundedRectBackground( + AshColorProvider::Get()->GetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparent80), + resize_button_->GetPreferredSize().height() / 2.f)); + UpdateResizeButtonTooltip(); } CameraPreviewView::~CameraPreviewView() = default; @@ -88,6 +110,39 @@ event->SetHandled(); } +void CameraPreviewView::Layout() { + const gfx::Size resize_button_size = resize_button_->GetPreferredSize(); + const gfx::Rect bounds( + (width() - resize_button_size.width()) / 2.f, + height() - resize_button_size.height() - + capture_mode::kSpaceBetweenResizeButtonAndCameraPreview, + resize_button_size.width(), resize_button_size.height()); + resize_button_->SetBoundsRect(bounds); +} + +void CameraPreviewView::OnResizeButtonPressed() { + camera_controller_->ToggleCameraPreviewSize(); + UpdateResizeButton(); +} + +void CameraPreviewView::UpdateResizeButton() { + resize_button_->SetImage( + views::Button::STATE_NORMAL, + gfx::CreateVectorIcon( + GetIconOfResizeButton( + camera_controller_->is_camera_preview_collapsed()), + AshColorProvider::Get()->GetContentLayerColor( + AshColorProvider::ContentLayerType::kIconColorPrimary))); + UpdateResizeButtonTooltip(); +} + +void CameraPreviewView::UpdateResizeButtonTooltip() { + resize_button_->SetTooltipText(l10n_util::GetStringUTF16( + camera_controller_->is_camera_preview_collapsed() + ? IDS_ASH_SCREEN_CAPTURE_TOOLTIP_EXPAND_SELFIE_CAMERA + : IDS_ASH_SCREEN_CAPTURE_TOOLTIP_COLLAPSE_SELFIE_CAMERA)); +} + BEGIN_METADATA(CameraPreviewView, views::View) END_METADATA
diff --git a/ash/capture_mode/capture_mode_camera_preview_view.h b/ash/capture_mode/capture_mode_camera_preview_view.h index b6ab22a..b6f8909d 100644 --- a/ash/capture_mode/capture_mode_camera_preview_view.h +++ b/ash/capture_mode/capture_mode_camera_preview_view.h
@@ -6,11 +6,13 @@ #define ASH_CAPTURE_MODE_CAPTURE_MODE_CAMERA_PREVIEW_VIEW_H_ #include "ui/base/metadata/metadata_header_macros.h" +#include "ui/gfx/geometry/size.h" #include "ui/views/view.h" namespace ash { class CaptureModeCameraController; +class CaptureModeButton; // A view that acts as the contents view of the camera preview widget. It will // be responsible for painting the latest camera video frame inside its bounds. @@ -18,20 +20,36 @@ public: METADATA_HEADER(CameraPreviewView); - explicit CameraPreviewView(CaptureModeCameraController* camera_controller); + CameraPreviewView(CaptureModeCameraController* camera_controller, + const gfx::Size& preview_view_preferred_size); CameraPreviewView(const CameraPreviewView&) = delete; CameraPreviewView& operator=(const CameraPreviewView&) = delete; ~CameraPreviewView() override; + CaptureModeButton* resize_button_for_test() const { return resize_button_; } + protected: // views::View: bool OnMousePressed(const ui::MouseEvent& event) override; bool OnMouseDragged(const ui::MouseEvent& event) override; void OnMouseReleased(const ui::MouseEvent& event) override; void OnGestureEvent(ui::GestureEvent* event) override; + void Layout() override; private: + // Called when the resize button is clicked or touched. + void OnResizeButtonPressed(); + + // Updates the icon of the `resize_button_` based on value of + // `is_camera_preview_collapsed()` inferred from the `camera_controller`. + void UpdateResizeButton(); + + // Updates the tooltip of the `resize_button_`. The `resize_button_` can be an + // expand button or collapse button. + void UpdateResizeButtonTooltip(); + CaptureModeCameraController* const camera_controller_; + CaptureModeButton* const resize_button_; }; } // namespace ash
diff --git a/ash/capture_mode/capture_mode_camera_unittests.cc b/ash/capture_mode/capture_mode_camera_unittests.cc index 1a03935..58e52cfe 100644 --- a/ash/capture_mode/capture_mode_camera_unittests.cc +++ b/ash/capture_mode/capture_mode_camera_unittests.cc
@@ -3,7 +3,9 @@ // found in the LICENSE file. #include "ash/capture_mode/capture_mode_bar_view.h" +#include "ash/capture_mode/capture_mode_button.h" #include "ash/capture_mode/capture_mode_camera_controller.h" +#include "ash/capture_mode/capture_mode_camera_preview_view.h" #include "ash/capture_mode/capture_mode_constants.h" #include "ash/capture_mode/capture_mode_controller.h" #include "ash/capture_mode/capture_mode_menu_group.h" @@ -19,7 +21,10 @@ #include "ash/constants/ash_features.h" #include "ash/display/window_tree_host_manager.h" #include "ash/public/cpp/capture_mode/capture_mode_test_api.h" +#include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" +#include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" #include "ash/test/ash_test_base.h" #include "base/files/file_path.h" #include "base/run_loop.h" @@ -27,7 +32,12 @@ #include "base/system/system_monitor.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" +#include "ui/gfx/image/image_unittest_util.h" +#include "ui/gfx/paint_vector_icon.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/coordinate_conversion.h" @@ -117,7 +127,7 @@ scoped_feature_list_.InitAndEnableFeature( features::kCaptureModeSelfieCamera); AshTestBase::SetUp(); - window_ = CreateTestWindow(gfx::Rect(30, 40, 300, 200)); + window_ = CreateTestWindow(gfx::Rect(30, 40, 600, 500)); } void TearDown() override { @@ -212,6 +222,12 @@ } } + CaptureModeButton* GetPreviewResizeButton() const { + return GetCameraController() + ->camera_preview_view_for_test() + ->resize_button_for_test(); + } + // Verifies that the camera preview is placed on the correct position based on // current preview snap position and the given `confine_bounds_in_screen`. void VerifyPreviewAlignment(const gfx::Rect& confine_bounds_in_screen) { @@ -259,6 +275,29 @@ } } + // Verifies that the icon image and the tooltip of the resize button gets + // updated correctly when pressed. + void VerifyResizeButton(bool is_collapsed, CaptureModeButton* resize_button) { + SkColor color = AshColorProvider::Get()->GetContentLayerColor( + AshColorProvider::ContentLayerType::kIconColorPrimary); + const gfx::ImageSkia collapse_icon_image = + gfx::CreateVectorIcon(kCaptureModeCameraPreviewCollapseIcon, color); + const gfx::ImageSkia expand_icon_image = + gfx::CreateVectorIcon(kCaptureModeCameraPreviewExpandIcon, color); + + const SkBitmap* expected_icon = is_collapsed ? expand_icon_image.bitmap() + : collapse_icon_image.bitmap(); + const SkBitmap* actual_icon = + resize_button->GetImage(views::ImageButton::ButtonState::STATE_NORMAL) + .bitmap(); + EXPECT_TRUE(gfx::test::AreBitmapsEqual(*actual_icon, *expected_icon)); + + const auto expected_tooltip_text = l10n_util::GetStringUTF16( + is_collapsed ? IDS_ASH_SCREEN_CAPTURE_TOOLTIP_EXPAND_SELFIE_CAMERA + : IDS_ASH_SCREEN_CAPTURE_TOOLTIP_COLLAPSE_SELFIE_CAMERA); + EXPECT_EQ(resize_button->GetTooltipText(), expected_tooltip_text); + } + private: base::test::ScopedFeatureList scoped_feature_list_; base::SystemMonitor system_monitor_; @@ -695,6 +734,75 @@ EXPECT_EQ(overlay_container->children().back(), preview_window); } +// Tests that camera preview widget is shown, hidden and parented correctly +// while moving, dragging and updating the user selection region. +TEST_F(CaptureModeCameraTest, CameraPreviewWhileUpdatingCaptureRegion) { + auto* controller = + StartCaptureSession(CaptureModeSource::kRegion, CaptureModeType::kVideo); + auto* camera_controller = GetCameraController(); + auto* capture_session = controller->capture_mode_session(); + AddDefaultCamera(); + camera_controller->SetSelectedCamera(CameraId(kDefaultCameraModelId, 1)); + const auto* camera_preview_widget = + camera_controller->camera_preview_widget(); + EXPECT_TRUE(camera_preview_widget); + auto* preview_window = camera_preview_widget->GetNativeWindow(); + const auto* unparented_container = + preview_window->GetRootWindow()->GetChildById( + kShellWindowId_UnparentedContainer); + + const gfx::Rect capture_region(10, 20, 80, 60); + controller->SetUserCaptureRegion(capture_region, /*by_user=*/true); + + // After user capture region is set, parent of the preview should be the + // OverlayContainer. + const auto* overlay_container = preview_window->GetRootWindow()->GetChildById( + kShellWindowId_OverlayContainer); + ASSERT_EQ(preview_window->parent(), overlay_container); + + // Press the bottom right of selection region. Verify preview is hidden and + // parent of the preview should be UnparentedContainer. + auto* event_generator = GetEventGenerator(); + event_generator->set_current_screen_location(capture_region.bottom_right()); + event_generator->PressLeftButton(); + EXPECT_FALSE(camera_preview_widget->IsVisible()); + EXPECT_EQ(preview_window->parent(), unparented_container); + + // Move mouse to update the selection region. Verify preview is still + // hidden. + const gfx::Vector2d delta(15, 20); + event_generator->MoveMouseTo(capture_region.bottom_right() + delta); + EXPECT_TRUE(capture_session->is_drag_in_progress()); + EXPECT_FALSE(camera_preview_widget->IsVisible()); + EXPECT_EQ(preview_window->parent(), unparented_container); + + // Now release the drag to end selection region update. Verify preview is + // shown and parent of the preview should be OverlayContainer. + event_generator->ReleaseLeftButton(); + EXPECT_FALSE(capture_session->is_drag_in_progress()); + EXPECT_TRUE(camera_preview_widget->IsVisible()); + EXPECT_EQ(preview_window->parent(), overlay_container); + + // Press in the selection region to move it around. Since in the + // use case, selection region is not updated, preview should not be hidden. + const gfx::Point current_position(capture_region.origin() + delta); + event_generator->set_current_screen_location(current_position); + event_generator->PressLeftButton(); + EXPECT_TRUE(camera_preview_widget->IsVisible()); + EXPECT_EQ(preview_window->parent(), overlay_container); + + // Move mouse to move selection region around. Verify preview is shown. + event_generator->MoveMouseTo(current_position + delta); + EXPECT_TRUE(camera_preview_widget->IsVisible()); + EXPECT_EQ(preview_window->parent(), overlay_container); + + // Now release the move to end moving selection region. Verify preview is + // shown. + event_generator->ReleaseLeftButton(); + EXPECT_TRUE(camera_preview_widget->IsVisible()); + EXPECT_EQ(preview_window->parent(), overlay_container); +} + TEST_F(CaptureModeCameraTest, CameraPreviewWidgetStackingInWindow) { auto* controller = StartCaptureSession(CaptureModeSource::kWindow, CaptureModeType::kVideo); @@ -861,9 +969,9 @@ MoveMouseToAndUpdateCursorDisplay(point_in_second_display, event_generator); controller->SetSource(CaptureModeSource::kRegion); // The capture region set through `controller` is in root coordinate. - const gfx::Rect capture_region(100, 0, 200, 150); + const gfx::Rect capture_region(100, 0, 400, 550); controller->SetUserCaptureRegion(capture_region, /*by_user=*/true); - const gfx::Rect capture_region_in_screen(901, 0, 200, 150); + const gfx::Rect capture_region_in_screen(901, 0, 400, 550); const gfx::Rect preview_bounds = preview_widget->GetWindowBoundsInScreen(); EXPECT_TRUE(second_display_bounds.Contains(preview_bounds)); EXPECT_TRUE(capture_region_in_screen.Contains(preview_bounds)); @@ -872,7 +980,7 @@ // should be inside the window that is being recorded inside the second // display. window()->SetBoundsInScreen( - gfx::Rect(900, 0, 400, 300), + gfx::Rect(900, 0, 600, 500), display::Screen::GetScreen()->GetDisplayNearestWindow( Shell::GetAllRootWindows()[1])); StartRecordingFromSource(CaptureModeSource::kWindow); @@ -1377,6 +1485,70 @@ EXPECT_EQ(cursor_manager->GetCursor(), GetCursorTypeOnCaptureSurface()); } +// Tests the functionality of resize button on changing the size of the camera +// preview widget, updating the icon image and tooltip text after clicking on +// it. It also tests the ability to restore to previous resize button settings +// if any when initiating a new capture mode session. +TEST_P(CaptureModeCameraPreviewTest, ResizePreviewWidget) { + StartCaptureSessionWithParam(); + auto* controller = CaptureModeController::Get(); + auto* camera_controller = GetCameraController(); + AddDefaultCamera(); + camera_controller->SetSelectedCamera(CameraId(kDefaultCameraModelId, 1)); + + views::Widget* preview_widget = camera_controller->camera_preview_widget(); + DCHECK(preview_widget); + const auto default_preview_bounds = preview_widget->GetWindowBoundsInScreen(); + EXPECT_EQ(default_preview_bounds.size(), capture_mode::kCameraPreviewSize); + + auto* resize_button = GetPreviewResizeButton(); + auto* event_generator = GetEventGenerator(); + + // Tests the default settings of the resize button. + VerifyResizeButton(camera_controller->is_camera_preview_collapsed(), + resize_button); + + // First time click on resize button will make the preview widget collapse + // to half of the default size with tooltip text and resize button icon + // changed to expanded related contents accordingly. + ClickOnView(resize_button, event_generator); + EXPECT_EQ(preview_widget->GetWindowBoundsInScreen().size(), + capture_mode::kCollapsedPreviewSize); + VerifyResizeButton(camera_controller->is_camera_preview_collapsed(), + resize_button); + + // Second time click on resize button will make the preview widget expand + // back to the default size with tooltip text and resize button icon changed + // to the collapsed related contents accordingly. + ClickOnView(resize_button, event_generator); + EXPECT_EQ(preview_widget->GetWindowBoundsInScreen(), default_preview_bounds); + VerifyResizeButton(camera_controller->is_camera_preview_collapsed(), + resize_button); + + // Click on the resize button again will collapse the preview widget. Exit the + // session and start a new session, the settings for preview widget bounds and + // resize button will be restored. + ClickOnView(resize_button, event_generator); + EXPECT_EQ(preview_widget->GetWindowBoundsInScreen().size(), + capture_mode::kCollapsedPreviewSize); + VerifyResizeButton(camera_controller->is_camera_preview_collapsed(), + resize_button); + const auto collapsed_preview_bounds = + preview_widget->GetWindowBoundsInScreen(); + controller->Stop(); + + StartCaptureSessionWithParam(); + preview_widget = camera_controller->camera_preview_widget(); + EXPECT_TRUE(preview_widget); + EXPECT_EQ(preview_widget->GetWindowBoundsInScreen(), + collapsed_preview_bounds); + + resize_button = GetPreviewResizeButton(); + EXPECT_TRUE(resize_button); + VerifyResizeButton(camera_controller->is_camera_preview_collapsed(), + resize_button); +} + INSTANTIATE_TEST_SUITE_P(All, CaptureModeCameraPreviewTest, testing::Values(CaptureModeSource::kFullscreen,
diff --git a/ash/capture_mode/capture_mode_constants.h b/ash/capture_mode/capture_mode_constants.h index a1fa2e5..9a8e0fd6 100644 --- a/ash/capture_mode/capture_mode_constants.h +++ b/ash/capture_mode/capture_mode_constants.h
@@ -35,12 +35,18 @@ // The space between the `image_toggle_button_` and `video_toggle_button_`. constexpr int kSpaceBetweenCaptureModeTypeButtons = 2; -constexpr gfx::Size kCameraPreviewSize{96, 96}; +constexpr gfx::Size kCameraPreviewSize{192, 192}; + +constexpr gfx::Size kCollapsedPreviewSize{96, 96}; // The space between the camera preview and edges of the bounds that will be // recorded. constexpr int kSpaceBetweenCameraPreviewAndEdges = 16; +// The space between the bottom of camera preview resize button and the bottom +// of the camera preview. +constexpr int kSpaceBetweenResizeButtonAndCameraPreview = 12; + } // namespace capture_mode } // namespace ash
diff --git a/ash/capture_mode/capture_mode_session.cc b/ash/capture_mode/capture_mode_session.cc index 2db044c..8ea5ef5 100644 --- a/ash/capture_mode/capture_mode_session.cc +++ b/ash/capture_mode/capture_mode_session.cc
@@ -370,7 +370,7 @@ auto* camera_controller = controller->camera_controller(); if (camera_controller && !controller->is_recording_in_progress()) { auto* camera_preview_widget = camera_controller->camera_preview_widget(); - if ((camera_preview_widget && + if ((camera_preview_widget && camera_preview_widget->IsVisible() && camera_preview_widget->GetWindowBoundsInScreen().Contains( screen_location)) || camera_controller->is_drag_in_progress()) { @@ -701,9 +701,7 @@ capture_mode_util::TriggerAccessibilityAlert( GetMessageIdForCaptureSource(new_source, /*for_toggle_alert=*/true)); - auto* camera_controller = controller_->camera_controller(); - if (camera_controller && !controller_->is_recording_in_progress()) - camera_controller->MaybeReparentPreviewWidget(); + MaybeReparentCameraPreviewWidget(); } void CaptureModeSession::OnCaptureTypeChanged(CaptureModeType new_type) { @@ -880,8 +878,11 @@ case CaptureModeSource::kFullscreen: return overlay_container; case CaptureModeSource::kRegion: - return controller_->user_capture_region().IsEmpty() ? unparented_container - : overlay_container; + return controller_->user_capture_region().IsEmpty() || + (is_drag_in_progress_ && + fine_tune_position_ != FineTunePosition::kCenter) + ? unparented_container + : overlay_container; case CaptureModeSource::kWindow: aura::Window* selected_window = GetSelectedWindow(); return selected_window ? selected_window : unparented_container; @@ -1728,8 +1729,20 @@ if (user_nudge_controller_) user_nudge_controller_->SetVisible(false); - if (!is_event_on_capture_bar_or_menu) + base::ScopedClosureRunner deferred_runner; + if (!is_event_on_capture_bar_or_menu) { UpdateCaptureBarWidgetOpacity(0.f, /*on_release=*/false); + // Run `MaybeReparentCameraPreviewWidget` at the exit of this function's + // scope if the user presses anywhere outside of the capture bar or menu, + // since the camera preview should be hidden if user is dragging to update + // the capture region. The reason we want to run it at the exit of this + // function is if `is_selecting_region_` is false, we want + // `fine_tune_position_` to be updated first since it can affect whether we + // should hide camera preview or not. + deferred_runner.ReplaceClosure( + base::BindOnce(&CaptureModeSession::MaybeReparentCameraPreviewWidget, + weak_ptr_factory_.GetWeakPtr())); + } if (is_selecting_region_) return; @@ -1828,6 +1841,11 @@ // Do a repaint to show the affordance circles. RepaintRegion(); + // Show the camera which may have been hidden in `OnLocatedEventPressed` + // regardless of whether we're selecting a region for the first time, or just + // dragging to fine tune it. + MaybeReparentCameraPreviewWidget(); + if (!is_selecting_region_) return; @@ -2262,9 +2280,7 @@ UpdateRootWindowDimmers(); - auto* camera_controller = controller_->camera_controller(); - if (camera_controller && !controller_->is_recording_in_progress()) - camera_controller->MaybeReparentPreviewWidget(); + MaybeReparentCameraPreviewWidget(); } void CaptureModeSession::UpdateRootWindowDimmers() { @@ -2446,4 +2462,10 @@ return settings_menu_bounds.Contains(location_in_screen); } +void CaptureModeSession::MaybeReparentCameraPreviewWidget() { + auto* camera_controller = controller_->camera_controller(); + if (camera_controller && !controller_->is_recording_in_progress()) + camera_controller->MaybeReparentPreviewWidget(); +} + } // namespace ash
diff --git a/ash/capture_mode/capture_mode_session.h b/ash/capture_mode/capture_mode_session.h index 88542aae..699b61a61 100644 --- a/ash/capture_mode/capture_mode_session.h +++ b/ash/capture_mode/capture_mode_session.h
@@ -371,6 +371,9 @@ // space between the capture bar and the menu. bool IsEventInSettingsMenuBounds(const gfx::Point& location_in_screen); + // Called when the parent container of camera preview may need to be updated. + void MaybeReparentCameraPreviewWidget(); + CaptureModeController* const controller_; // The current root window on which the capture session is active, which may
diff --git a/ash/capture_mode/capture_mode_unittests.cc b/ash/capture_mode/capture_mode_unittests.cc index f1ae24f6..9b3b623c 100644 --- a/ash/capture_mode/capture_mode_unittests.cc +++ b/ash/capture_mode/capture_mode_unittests.cc
@@ -5127,10 +5127,11 @@ // Now move the mouse over the projector shelf pod, the overlay should not // consume the event, and it should instead go through to that pod. auto* root_window = Shell::GetPrimaryRootWindow(); + auto* status_area_widget = + RootWindowController::ForWindow(root_window)->GetStatusAreaWidget(); ProjectorAnnotationTray* annotations_tray = - RootWindowController::ForWindow(root_window) - ->GetStatusAreaWidget() - ->projector_annotation_tray(); + status_area_widget->projector_annotation_tray(); + EXPECT_TRUE(annotations_tray->visible_preferred()); event_generator->MoveMouseTo( annotations_tray->GetBoundsInScreen().CenterPoint()); @@ -5139,6 +5140,16 @@ // The overlay status hasn't changed. VerifyOverlayEnabledState(overlay_window, /*overlay_enabled_state=*/true); + + // Now move the mouse and then click on the stop recording button, the overlay + // should not consume the event. The video recording should be ended. + StopRecordingButtonTray* stop_recording_button = + status_area_widget->stop_recording_button_tray(); + const gfx::Point stop_button_center_point = + stop_recording_button->GetBoundsInScreen().CenterPoint(); + event_generator->MoveMouseTo(stop_button_center_point); + event_generator->ClickLeftButton(); + EXPECT_FALSE(controller->is_recording_in_progress()); } // Tests that neither preview notification nor recording in tote is shown if in
diff --git a/ash/capture_mode/recording_overlay_controller.cc b/ash/capture_mode/recording_overlay_controller.cc index 7732957d4..48edc182 100644 --- a/ash/capture_mode/recording_overlay_controller.cc +++ b/ash/capture_mode/recording_overlay_controller.cc
@@ -5,6 +5,7 @@ #include "ash/capture_mode/recording_overlay_controller.h" #include "ash/capture_mode/capture_mode_controller.h" +#include "ash/capture_mode/stop_recording_button_tray.h" #include "ash/projector/projector_annotation_tray.h" #include "ash/public/cpp/capture_mode/recording_overlay_view.h" #include "ash/public/cpp/shell_window_ids.h" @@ -76,15 +77,24 @@ ui::Event* event) override { if (event->IsLocatedEvent()) { auto* root_window = overlay_window_->GetRootWindow(); - ProjectorAnnotationTray* annotations = - RootWindowController::ForWindow(root_window) - ->GetStatusAreaWidget() - ->projector_annotation_tray(); - if (annotations && annotations->visible_preferred()) { - auto* located_event = event->AsLocatedEvent(); - auto screen_location = located_event->root_location(); - wm::ConvertPointToScreen(root_window, &screen_location); + auto* status_area_widget = + RootWindowController::ForWindow(root_window)->GetStatusAreaWidget(); + StopRecordingButtonTray* stop_recording_button = + status_area_widget->stop_recording_button_tray(); + auto screen_location = event->AsLocatedEvent()->root_location(); + wm::ConvertPointToScreen(root_window, &screen_location); + // To be able to end video recording even while annotation is active, + // let events over the stop recording button to go through + if (stop_recording_button && stop_recording_button->visible_preferred() && + stop_recording_button->GetBoundsInScreen().Contains( + screen_location)) { + return nullptr; + } + + ProjectorAnnotationTray* annotations = + status_area_widget->projector_annotation_tray(); + if (annotations && annotations->visible_preferred()) { // Let events over the projector shelf pod to go through. if (annotations->GetBoundsInScreen().Contains(screen_location)) return nullptr;
diff --git a/ash/components/BUILD.gn b/ash/components/BUILD.gn index f008060..ba0dd97 100644 --- a/ash/components/BUILD.gn +++ b/ash/components/BUILD.gn
@@ -44,6 +44,7 @@ "//ash/components/smbfs:unit_tests", "//ash/components/tether:unit_tests", "//ash/components/timezone:unit_tests", + "//ash/components/tpm:unit_tests", "//ash/components/trial_group:unit_tests", "//ash/strings", "//base/test:test_support",
diff --git a/ash/components/arc/video_accelerator/BUILD.gn b/ash/components/arc/video_accelerator/BUILD.gn index 7c55bfb..7935cd6 100644 --- a/ash/components/arc/video_accelerator/BUILD.gn +++ b/ash/components/arc/video_accelerator/BUILD.gn
@@ -32,6 +32,7 @@ "//ash/components/arc/mojom:media", "//gpu/ipc/common:common", "//media", + "//media/gpu:buffer_validation", "//media/gpu/chromeos:common", ] } @@ -48,6 +49,7 @@ deps = [ "//media", + "//media/gpu:buffer_validation", "//media/gpu:gpu", "//mojo/public/cpp/system:system", "//ui/gfx:memory_buffer",
diff --git a/ash/components/audio/cras_audio_handler.cc b/ash/components/audio/cras_audio_handler.cc index 113a30c7..8d97fcb 100644 --- a/ash/components/audio/cras_audio_handler.cc +++ b/ash/components/audio/cras_audio_handler.cc
@@ -449,6 +449,23 @@ return audio_pref_handler_->GetNoiseCancellationState(); } +void CrasAudioHandler::RefreshNoiseCancellationState() { + if (!noise_cancellation_supported()) { + return; + } + + const AudioDevice* internal_mic = + GetDeviceByType(AudioDeviceType::kInternalMic); + + if (!internal_mic) { + return; + } + + SetNoiseCancellationState( + GetNoiseCancellationState() && + (internal_mic->audio_effect & cras::EFFECT_TYPE_NOISE_CANCELLATION)); +} + void CrasAudioHandler::SetNoiseCancellationState(bool state) { CrasAudioClient::Get()->SetNoiseCancellationEnabled(state); } @@ -1708,15 +1725,7 @@ UpdateDevicesAndSwitchActive(node_list.value()); // Always set the input noise cancellation state on NodesChange event. - if (noise_cancellation_supported()) { - const AudioDevice* internal_mic = - GetDeviceByType(AudioDeviceType::kInternalMic); - if (internal_mic) { - SetNoiseCancellationState( - GetNoiseCancellationState() && - (internal_mic->audio_effect & cras::EFFECT_TYPE_NOISE_CANCELLATION)); - } - } + RefreshNoiseCancellationState(); for (auto& observer : observers_) observer.OnAudioNodesChanged();
diff --git a/ash/components/audio/cras_audio_handler.h b/ash/components/audio/cras_audio_handler.h index fe5fd4fa..c879353 100644 --- a/ash/components/audio/cras_audio_handler.h +++ b/ash/components/audio/cras_audio_handler.h
@@ -272,6 +272,9 @@ // Gets the state of input noise cancellation. bool GetNoiseCancellationState() const; + // Refreshes the input device noise cancellation state. + void RefreshNoiseCancellationState(); + // Sends a DBus signal to set the state of input noise cancellation. void SetNoiseCancellationState(bool state);
diff --git a/ash/components/audio/cras_audio_handler_unittest.cc b/ash/components/audio/cras_audio_handler_unittest.cc index 44b7830c..0724fe7a 100644 --- a/ash/components/audio/cras_audio_handler_unittest.cc +++ b/ash/components/audio/cras_audio_handler_unittest.cc
@@ -419,6 +419,25 @@ base::RunLoop().RunUntilIdle(); } + void SetUpCrasAudioHandlerWithPrimaryActiveNodeAndNoiseCancellationState( + const AudioNodeList& audio_nodes, + const AudioNode& primary_active_node, + bool noise_cancellation_enabled) { + CrasAudioClient::InitializeFake(); + fake_cras_audio_client()->SetAudioNodesForTesting(audio_nodes); + fake_cras_audio_client()->SetActiveOutputNode(primary_active_node.id); + fake_cras_audio_client()->SetNoiseCancellationSupported( + /*noise_cancellation_supported=*/true); + audio_pref_handler_ = new AudioDevicesPrefHandlerStub(); + audio_pref_handler_->SetNoiseCancellationState(noise_cancellation_enabled); + CrasAudioHandler::Initialize(fake_manager_->MakeRemote(), + audio_pref_handler_); + cras_audio_handler_ = CrasAudioHandler::Get(); + test_observer_ = std::make_unique<TestObserver>(); + cras_audio_handler_->AddAudioObserver(test_observer_.get()); + base::RunLoop().RunUntilIdle(); + } + void ChangeAudioNodes(const AudioNodeList& audio_nodes) { fake_cras_audio_client()->SetAudioNodesAndNotifyObserversForTesting( audio_nodes); @@ -1360,6 +1379,67 @@ } } +TEST_P(CrasAudioHandlerTest, NoiseCancellationRefreshPrefEnabledNoNC) { + AudioNodeList audio_nodes = GenerateAudioNodeList({}); + // Set up initial audio devices, only with internal mic. + AudioNode internalMic = GenerateAudioNode(kInternalMic); + // Clear the audio effect, no Noise Cancellation supported. + internalMic.audio_effect = 0u; + audio_nodes.push_back(internalMic); + // Simulate enable pref for noise cancellation. + SetUpCrasAudioHandlerWithPrimaryActiveNodeAndNoiseCancellationState( + audio_nodes, internalMic, /*noise_cancellation_enabled=*/true); + + // Noise cancellation should still be disabled despite the pref being enabled + // since the audio_effect of the internal mic is unavailable. + EXPECT_FALSE(fake_cras_audio_client()->noise_cancellation_enabled()); +} + +TEST_P(CrasAudioHandlerTest, NoiseCancellationRefreshPrefEnabledWithNC) { + AudioNodeList audio_nodes = GenerateAudioNodeList({}); + // Set up initial audio devices, only with internal mic. + AudioNode internalMic = GenerateAudioNode(kInternalMic); + // Enable noise cancellation effect. + internalMic.audio_effect = cras::EFFECT_TYPE_NOISE_CANCELLATION; + audio_nodes.push_back(internalMic); + // Simulate enable pref for noise cancellation. + SetUpCrasAudioHandlerWithPrimaryActiveNodeAndNoiseCancellationState( + audio_nodes, internalMic, /*noise_cancellation_enabled=*/true); + + // Noise Cancellation is enabled. + EXPECT_TRUE(fake_cras_audio_client()->noise_cancellation_enabled()); +} + +TEST_P(CrasAudioHandlerTest, NoiseCancellationRefreshPrefDisableNoNC) { + AudioNodeList audio_nodes = GenerateAudioNodeList({}); + // Set up initial audio devices, only with internal mic. + AudioNode internalMic = GenerateAudioNode(kInternalMic); + // Clear audio effect, no noise cancellation. + internalMic.audio_effect = 0u; + audio_nodes.push_back(internalMic); + // Simulate enable pref for noise cancellation. + SetUpCrasAudioHandlerWithPrimaryActiveNodeAndNoiseCancellationState( + audio_nodes, internalMic, /*noise_cancellation_enabled=*/false); + + // Noise cancellation should still be disabled since the pref is disabled. + EXPECT_FALSE(fake_cras_audio_client()->noise_cancellation_enabled()); +} + +TEST_P(CrasAudioHandlerTest, NoiseCancellationRefreshPrefDisableWithNC) { + AudioNodeList audio_nodes = GenerateAudioNodeList({}); + // Set up initial audio devices, only with internal mic. + AudioNode internalMic = GenerateAudioNode(kInternalMic); + // Enable noise cancellation effect. + internalMic.audio_effect = cras::EFFECT_TYPE_NOISE_CANCELLATION; + audio_nodes.push_back(internalMic); + // Simulate enable pref for noise cancellation. + SetUpCrasAudioHandlerWithPrimaryActiveNodeAndNoiseCancellationState( + audio_nodes, internalMic, /*noise_cancellation_enabled=*/false); + + // Noise cancellation should still be disabled since the pref is disabled. + EXPECT_FALSE(fake_cras_audio_client()->noise_cancellation_enabled()); +} + TEST_P(CrasAudioHandlerTest, BluetoothSpeakerIdChangedOnFly) { // Initialize with internal speaker and bluetooth headset. AudioNodeList audio_nodes =
diff --git a/ash/components/login/auth/BUILD.gn b/ash/components/login/auth/BUILD.gn index ef39efe..e1ae665 100644 --- a/ash/components/login/auth/BUILD.gn +++ b/ash/components/login/auth/BUILD.gn
@@ -26,7 +26,6 @@ "//chromeos/dbus/userdataauth:userdataauth_proto", "//chromeos/login/login_state", "//chromeos/metrics", - "//chromeos/tpm", "//components/account_id", "//components/device_event_log", "//components/password_manager/core/browser:password_hash_data", @@ -128,7 +127,6 @@ "//chromeos/dbus/authpolicy", "//chromeos/dbus/authpolicy:authpolicy_proto", "//chromeos/dbus/cryptohome", - "//chromeos/tpm:test_support", "//components/prefs", "//components/prefs:test_support", "//net",
diff --git a/ash/components/login/auth/DEPS b/ash/components/login/auth/DEPS index f55e144e6..bb4f5c5 100644 --- a/ash/components/login/auth/DEPS +++ b/ash/components/login/auth/DEPS
@@ -12,7 +12,6 @@ "+chromeos/dbus", "+chromeos/metrics", "+chromeos/login/login_state", - "+chromeos/tpm", "+components/account_id", "+components/device_event_log", "+components/password_manager",
diff --git a/chromeos/tpm/BUILD.gn b/ash/components/tpm/BUILD.gn similarity index 89% rename from chromeos/tpm/BUILD.gn rename to ash/components/tpm/BUILD.gn index c3471055..4a20489 100644 --- a/chromeos/tpm/BUILD.gn +++ b/ash/components/tpm/BUILD.gn
@@ -2,11 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//ash/components/tpm/buildflags.gni") import("//build/buildflag_header.gni") -import("//chromeos/tpm/buildflags.gni") +import("//build/config/chromeos/ui_mode.gni") import("//testing/test.gni") -assert(is_chromeos, "Non-Chrome-OS builds must not depend on //chromeos") +assert(is_chromeos_ash) buildflag_header("buildflags") { header = "buildflags.h" @@ -14,12 +15,9 @@ } component("tpm") { - defines = [ "IS_CHROMEOS_TPM_IMPL" ] + defines = [ "IS_ASH_COMPONENTS_TPM_IMPL" ] deps = [ ":buildflags", - - # TODO(https://crbug.com/1164001): temporary dependency until chromeos/tpm - # is moved to ash/. "//ash/components/cryptohome", "//base", "//chromeos/dbus/constants",
diff --git a/chromeos/tpm/DEPS b/ash/components/tpm/DEPS similarity index 100% rename from chromeos/tpm/DEPS rename to ash/components/tpm/DEPS
diff --git a/chromeos/tpm/buildflags.gni b/ash/components/tpm/buildflags.gni similarity index 100% rename from chromeos/tpm/buildflags.gni rename to ash/components/tpm/buildflags.gni
diff --git a/chromeos/tpm/install_attributes.cc b/ash/components/tpm/install_attributes.cc similarity index 99% rename from chromeos/tpm/install_attributes.cc rename to ash/components/tpm/install_attributes.cc index 63985d741..59d9c4d 100644 --- a/chromeos/tpm/install_attributes.cc +++ b/ash/components/tpm/install_attributes.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/install_attributes.h" +#include "ash/components/tpm/install_attributes.h" #include <stddef.h>
diff --git a/chromeos/tpm/install_attributes.h b/ash/components/tpm/install_attributes.h similarity index 97% rename from chromeos/tpm/install_attributes.h rename to ash/components/tpm/install_attributes.h index 5cf7c3df..ddf099b 100644 --- a/chromeos/tpm/install_attributes.h +++ b/ash/components/tpm/install_attributes.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_TPM_INSTALL_ATTRIBUTES_H_ -#define CHROMEOS_TPM_INSTALL_ATTRIBUTES_H_ +#ifndef ASH_COMPONENTS_TPM_INSTALL_ATTRIBUTES_H_ +#define ASH_COMPONENTS_TPM_INSTALL_ATTRIBUTES_H_ #include <map> #include <string> @@ -24,7 +24,7 @@ // Brokers access to the installation-time attributes on Chrome OS. When // initialized with kInstallAttributesFileName, the attributes are fully trusted // (signature has been verified by lockbox-cache). -class COMPONENT_EXPORT(CHROMEOS_TPM) InstallAttributes { +class COMPONENT_EXPORT(ASH_COMPONENTS_TPM) InstallAttributes { public: // InstallAttributes status codes. Do not change the numeric ids or the // meaning of the existing codes to preserve the interpretability of old @@ -244,4 +244,4 @@ using ::chromeos::InstallAttributes; } -#endif // CHROMEOS_TPM_INSTALL_ATTRIBUTES_H_ +#endif // ASH_COMPONENTS_TPM_INSTALL_ATTRIBUTES_H_
diff --git a/chromeos/tpm/install_attributes_unittest.cc b/ash/components/tpm/install_attributes_unittest.cc similarity index 99% rename from chromeos/tpm/install_attributes_unittest.cc rename to ash/components/tpm/install_attributes_unittest.cc index 74e80162..70e6a95 100644 --- a/chromeos/tpm/install_attributes_unittest.cc +++ b/ash/components/tpm/install_attributes_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/install_attributes.h" +#include "ash/components/tpm/install_attributes.h" #include <memory>
diff --git a/chromeos/tpm/prepare_tpm.cc b/ash/components/tpm/prepare_tpm.cc similarity index 97% rename from chromeos/tpm/prepare_tpm.cc rename to ash/components/tpm/prepare_tpm.cc index f55a39f..87d86fa 100644 --- a/chromeos/tpm/prepare_tpm.cc +++ b/ash/components/tpm/prepare_tpm.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/prepare_tpm.h" +#include "ash/components/tpm/prepare_tpm.h" #include <utility>
diff --git a/chromeos/tpm/prepare_tpm.h b/ash/components/tpm/prepare_tpm.h similarity index 81% rename from chromeos/tpm/prepare_tpm.h rename to ash/components/tpm/prepare_tpm.h index a82cb42..09fc692f 100644 --- a/chromeos/tpm/prepare_tpm.h +++ b/ash/components/tpm/prepare_tpm.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_TPM_PREPARE_TPM_H_ -#define CHROMEOS_TPM_PREPARE_TPM_H_ +#ifndef ASH_COMPONENTS_TPM_PREPARE_TPM_H_ +#define ASH_COMPONENTS_TPM_PREPARE_TPM_H_ #include "base/callback.h" #include "base/component_export.h" @@ -16,9 +16,9 @@ // interrupted TPM initialization triggered upon showing EULA screen, triggers // TPM initialization process. When the preparation process is done, invoke // `preparation_finished_callback`. -void COMPONENT_EXPORT(CHROMEOS_TPM) +void COMPONENT_EXPORT(ASH_COMPONENTS_TPM) PrepareTpm(base::OnceClosure preparation_finished_callback); } // namespace chromeos -#endif // CHROMEOS_TPM_PREPARE_TPM_H_ +#endif // ASH_COMPONENTS_TPM_PREPARE_TPM_H_
diff --git a/chromeos/tpm/prepare_tpm_unittest.cc b/ash/components/tpm/prepare_tpm_unittest.cc similarity index 97% rename from chromeos/tpm/prepare_tpm_unittest.cc rename to ash/components/tpm/prepare_tpm_unittest.cc index 4115e0f..1286bfcc 100644 --- a/chromeos/tpm/prepare_tpm_unittest.cc +++ b/ash/components/tpm/prepare_tpm_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/prepare_tpm.h" +#include "ash/components/tpm/prepare_tpm.h" #include "base/run_loop.h" #include "base/test/task_environment.h"
diff --git a/chromeos/tpm/stub_install_attributes.cc b/ash/components/tpm/stub_install_attributes.cc similarity index 98% rename from chromeos/tpm/stub_install_attributes.cc rename to ash/components/tpm/stub_install_attributes.cc index bdb1023..07a3d9a2 100644 --- a/chromeos/tpm/stub_install_attributes.cc +++ b/ash/components/tpm/stub_install_attributes.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/stub_install_attributes.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h"
diff --git a/chromeos/tpm/stub_install_attributes.h b/ash/components/tpm/stub_install_attributes.h similarity index 93% rename from chromeos/tpm/stub_install_attributes.h rename to ash/components/tpm/stub_install_attributes.h index f7413d6..8c1eb27d 100644 --- a/chromeos/tpm/stub_install_attributes.h +++ b/ash/components/tpm/stub_install_attributes.h
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_TPM_STUB_INSTALL_ATTRIBUTES_H_ -#define CHROMEOS_TPM_STUB_INSTALL_ATTRIBUTES_H_ +#ifndef ASH_COMPONENTS_TPM_STUB_INSTALL_ATTRIBUTES_H_ +#define ASH_COMPONENTS_TPM_STUB_INSTALL_ATTRIBUTES_H_ #include <string> -#include "chromeos/tpm/install_attributes.h" +#include "ash/components/tpm/install_attributes.h" namespace chromeos { @@ -90,4 +90,4 @@ using ::chromeos::StubInstallAttributes; } // namespace ash -#endif // CHROMEOS_TPM_STUB_INSTALL_ATTRIBUTES_H_ +#endif // ASH_COMPONENTS_TPM_STUB_INSTALL_ATTRIBUTES_H_
diff --git a/chromeos/tpm/tpm_token_info_getter.cc b/ash/components/tpm/tpm_token_info_getter.cc similarity index 95% rename from chromeos/tpm/tpm_token_info_getter.cc rename to ash/components/tpm/tpm_token_info_getter.cc index b7f8b00..faf47824 100644 --- a/chromeos/tpm/tpm_token_info_getter.cc +++ b/ash/components/tpm/tpm_token_info_getter.cc
@@ -2,21 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/tpm_token_info_getter.h" +#include "ash/components/tpm/tpm_token_info_getter.h" #include <stdint.h> #include <utility> #include "ash/components/cryptohome/cryptohome_parameters.h" +#include "ash/components/tpm/buildflags.h" #include "base/bind.h" #include "base/location.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/task/task_runner.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/tpm/buildflags.h" namespace { @@ -53,7 +54,7 @@ CryptohomePkcs11Client* userdataauth_client, const scoped_refptr<base::TaskRunner>& delayed_task_runner) { CHECK(account_id.is_valid()); - return std::unique_ptr<TPMTokenInfoGetter>(new TPMTokenInfoGetter( + return base::WrapUnique(new TPMTokenInfoGetter( TYPE_USER, account_id, userdataauth_client, delayed_task_runner)); } @@ -61,7 +62,7 @@ std::unique_ptr<TPMTokenInfoGetter> TPMTokenInfoGetter::CreateForSystemToken( CryptohomePkcs11Client* userdataauth_client, const scoped_refptr<base::TaskRunner>& delayed_task_runner) { - return std::unique_ptr<TPMTokenInfoGetter>(new TPMTokenInfoGetter( + return base::WrapUnique(new TPMTokenInfoGetter( TYPE_SYSTEM, EmptyAccountId(), userdataauth_client, delayed_task_runner)); }
diff --git a/chromeos/tpm/tpm_token_info_getter.h b/ash/components/tpm/tpm_token_info_getter.h similarity index 94% rename from chromeos/tpm/tpm_token_info_getter.h rename to ash/components/tpm/tpm_token_info_getter.h index 5fabe43..0ca692c 100644 --- a/chromeos/tpm/tpm_token_info_getter.h +++ b/ash/components/tpm/tpm_token_info_getter.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_TPM_TPM_TOKEN_INFO_GETTER_H_ -#define CHROMEOS_TPM_TPM_TOKEN_INFO_GETTER_H_ +#ifndef ASH_COMPONENTS_TPM_TPM_TOKEN_INFO_GETTER_H_ +#define ASH_COMPONENTS_TPM_TPM_TOKEN_INFO_GETTER_H_ #include <memory> #include <string> @@ -27,7 +27,7 @@ // Class for getting a user or the system TPM token info from cryptohome during // TPM token loading. -class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenInfoGetter { +class COMPONENT_EXPORT(ASH_COMPONENTS_TPM) TPMTokenInfoGetter { public: using TpmTokenInfoCallback = base::OnceCallback<void( absl::optional<user_data_auth::TpmTokenInfo> token_info)>; @@ -126,4 +126,4 @@ } // namespace chromeos -#endif // CHROMEOS_TPM_TPM_TOKEN_INFO_GETTER_H_ +#endif // ASH_COMPONENTS_TPM_TPM_TOKEN_INFO_GETTER_H_
diff --git a/chromeos/tpm/tpm_token_info_getter_unittest.cc b/ash/components/tpm/tpm_token_info_getter_unittest.cc similarity index 99% rename from chromeos/tpm/tpm_token_info_getter_unittest.cc rename to ash/components/tpm/tpm_token_info_getter_unittest.cc index 167611c..f633665 100644 --- a/chromeos/tpm/tpm_token_info_getter_unittest.cc +++ b/ash/components/tpm/tpm_token_info_getter_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/tpm_token_info_getter.h" +#include "ash/components/tpm/tpm_token_info_getter.h" #include <stdint.h>
diff --git a/chromeos/tpm/tpm_token_loader.cc b/ash/components/tpm/tpm_token_loader.cc similarity index 97% rename from chromeos/tpm/tpm_token_loader.cc rename to ash/components/tpm/tpm_token_loader.cc index 8f49021..402a91e 100644 --- a/chromeos/tpm/tpm_token_loader.cc +++ b/ash/components/tpm/tpm_token_loader.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/tpm/tpm_token_loader.h" +#include "ash/components/tpm/tpm_token_loader.h" #include <algorithm> +#include "ash/components/tpm/tpm_token_info_getter.h" #include "base/bind.h" #include "base/location.h" #include "base/logging.h" @@ -15,7 +16,6 @@ #include "base/task/single_thread_task_runner.h" #include "base/task/task_runner_util.h" #include "base/threading/thread_task_runner_handle.h" -#include "chromeos/tpm/tpm_token_info_getter.h" #include "crypto/nss_util.h" namespace chromeos {
diff --git a/chromeos/tpm/tpm_token_loader.h b/ash/components/tpm/tpm_token_loader.h similarity index 94% rename from chromeos/tpm/tpm_token_loader.h rename to ash/components/tpm/tpm_token_loader.h index 17882b5b..3b5ae250a 100644 --- a/chromeos/tpm/tpm_token_loader.h +++ b/ash/components/tpm/tpm_token_loader.h
@@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_TPM_TPM_TOKEN_LOADER_H_ -#define CHROMEOS_TPM_TPM_TOKEN_LOADER_H_ +#ifndef ASH_COMPONENTS_TPM_TPM_TOKEN_LOADER_H_ +#define ASH_COMPONENTS_TPM_TPM_TOKEN_LOADER_H_ #include <memory> #include <string> #include <vector> +#include "ash/components/tpm/tpm_token_info_getter.h" #include "base/callback_forward.h" #include "base/component_export.h" #include "base/memory/ref_counted.h" @@ -16,7 +17,6 @@ #include "base/threading/thread_checker.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/tpm/tpm_token_info_getter.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace base { @@ -31,7 +31,7 @@ // When the TPM token is loaded, or if the TPM should stay disabled for the // session, the observers are notified using |OnTPMTokenReady|. // Note: This currently initializes the token with the hard coded default id 0. -class COMPONENT_EXPORT(CHROMEOS_TPM) TPMTokenLoader +class COMPONENT_EXPORT(ASH_COMPONENTS_TPM) TPMTokenLoader : public LoginState::Observer { public: enum TPMTokenStatus { @@ -143,4 +143,4 @@ using ::chromeos::TPMTokenLoader; } -#endif // CHROMEOS_TPM_TPM_TOKEN_LOADER_H_ +#endif // ASH_COMPONENTS_TPM_TPM_TOKEN_LOADER_H_
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index b559c2e..b265080c 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -33,6 +33,7 @@ #include "ash/login/ui/system_label_button.h" #include "ash/login/ui/views_utils.h" #include "ash/media/media_controller_impl.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/child_accounts/parent_access_controller.h" #include "ash/public/cpp/login_accelerators.h" #include "ash/public/cpp/smartlock_state.h"
diff --git a/ash/login/ui/note_action_launch_button.cc b/ash/login/ui/note_action_launch_button.cc index 2498ad15..faabc47 100644 --- a/ash/login/ui/note_action_launch_button.cc +++ b/ash/login/ui/note_action_launch_button.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/shelf_config.h" #include "ash/public/mojom/tray_action.mojom.h" #include "ash/resources/vector_icons/vector_icons.h"
diff --git a/ash/metrics/desktop_task_switch_metric_recorder.cc b/ash/metrics/desktop_task_switch_metric_recorder.cc index efe259a..0da6d0d 100644 --- a/ash/metrics/desktop_task_switch_metric_recorder.cc +++ b/ash/metrics/desktop_task_switch_metric_recorder.cc
@@ -7,6 +7,7 @@ #include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/wm/window_util.h" +#include "base/metrics/user_metrics.h" #include "ui/wm/public/activation_client.h" namespace ash { @@ -28,7 +29,9 @@ if (last_active_task_window_ != gained_active && reason == ::wm::ActivationChangeObserver::ActivationReason::INPUT_EVENT) { - Shell::Get()->metrics()->RecordUserMetricsAction(UMA_DESKTOP_SWITCH_TASK); + base::RecordAction(base::UserMetricsAction("Desktop_SwitchTask")); + Shell::Get()->metrics()->task_switch_metrics_recorder().OnTaskSwitch( + TaskSwitchSource::DESKTOP); } last_active_task_window_ = gained_active; }
diff --git a/ash/metrics/login_metrics_recorder_unittest.cc b/ash/metrics/login_metrics_recorder_unittest.cc index 3c64088c..c67353e5 100644 --- a/ash/metrics/login_metrics_recorder_unittest.cc +++ b/ash/metrics/login_metrics_recorder_unittest.cc
@@ -16,6 +16,7 @@ #include "ash/login/ui/login_big_user_view.h" #include "ash/login/ui/login_test_base.h" #include "ash/login/ui/login_test_utils.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h"
diff --git a/ash/metrics/user_metrics_action.h b/ash/metrics/user_metrics_action.h deleted file mode 100644 index d936127..0000000 --- a/ash/metrics/user_metrics_action.h +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2016 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_METRICS_USER_METRICS_ACTION_H_ -#define ASH_METRICS_USER_METRICS_ACTION_H_ - -namespace ash { - -// Ash-owned user metrics. -// DEPRECATED: Use base::RecordAction(base::UserMetricsAction("my_action")) -// instead of adding things here. -enum UserMetricsAction { - UMA_DESKTOP_SWITCH_TASK, - UMA_LAUNCHER_LAUNCH_TASK, - UMA_LAUNCHER_MINIMIZE_TASK, - UMA_LAUNCHER_SWITCH_TASK, - UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK, - UMA_STATUS_AREA_CONNECT_TO_UNCONFIGURED_NETWORK, - UMA_STATUS_AREA_CONNECT_TO_VPN, - UMA_STATUS_AREA_CHANGED_VOLUME_MENU, - UMA_STATUS_AREA_CHANGED_VOLUME_POPUP, - UMA_STATUS_AREA_DISABLE_WIFI, - UMA_STATUS_AREA_DISPLAY_DEFAULT_SELECTED, - UMA_STATUS_AREA_DISPLAY_DEFAULT_SHOW_SETTINGS, - UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CREATED, - UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED, - UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SHOW_SETTINGS, - UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION, - UMA_STATUS_AREA_DRIVE_SETTINGS, - UMA_STATUS_AREA_ENABLE_WIFI, - UMA_STATUS_AREA_MENU_OPENED, - UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED, - UMA_STATUS_AREA_NETWORK_SETTINGS_OPENED, - UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED, - UMA_STATUS_AREA_SCREEN_CAPTURE_CHANGE_SOURCE, - UMA_STATUS_AREA_SCREEN_CAPTURE_DEFAULT_STOP, - UMA_STATUS_AREA_SCREEN_CAPTURE_NOTIFICATION_STOP, - UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS, - UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS, - UMA_STATUS_AREA_SMS_DETAILED_DISMISS_MSG, - UMA_STATUS_AREA_SMS_NOTIFICATION_DISMISS_MSG, - UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED, - UMA_STATUS_AREA_VPN_ADD_BUILT_IN_CLICKED, - UMA_STATUS_AREA_VPN_ADD_THIRD_PARTY_CLICKED, - UMA_STATUS_AREA_VPN_DISCONNECT_CLICKED, - UMA_STATUS_AREA_VPN_SETTINGS_OPENED, - - // DEPRECATED: Do not add new values. See top of file. -}; - -} // namespace ash - -#endif // ASH_METRICS_USER_METRICS_ACTION_H_
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc index d2c08d5..1f87f3a 100644 --- a/ash/metrics/user_metrics_recorder.cc +++ b/ash/metrics/user_metrics_recorder.cc
@@ -147,131 +147,6 @@ recorder->RecordUserShelfButtonClick(target); } -// static -void UserMetricsRecorder::RecordUserToggleDictation( - DictationToggleSource source) { - UMA_HISTOGRAM_ENUMERATION("Accessibility.CrosDictation.ToggleDictationMethod", - source); -} - -void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) { - using base::RecordAction; - using base::UserMetricsAction; - - switch (action) { - case UMA_DESKTOP_SWITCH_TASK: - RecordAction(UserMetricsAction("Desktop_SwitchTask")); - task_switch_metrics_recorder_.OnTaskSwitch(TaskSwitchSource::DESKTOP); - break; - case UMA_LAUNCHER_LAUNCH_TASK: - RecordAction(UserMetricsAction("Launcher_LaunchTask")); - task_switch_metrics_recorder_.OnTaskSwitch(TaskSwitchSource::SHELF); - break; - case UMA_LAUNCHER_MINIMIZE_TASK: - RecordAction(UserMetricsAction("Launcher_MinimizeTask")); - break; - case UMA_LAUNCHER_SWITCH_TASK: - RecordAction(UserMetricsAction("Launcher_SwitchTask")); - task_switch_metrics_recorder_.OnTaskSwitch(TaskSwitchSource::SHELF); - break; - case UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK: - RecordAction(UserMetricsAction("StatusArea_Network_ConnectConfigured")); - break; - case UMA_STATUS_AREA_CONNECT_TO_UNCONFIGURED_NETWORK: - RecordAction(UserMetricsAction("StatusArea_Network_ConnectUnconfigured")); - break; - case UMA_STATUS_AREA_CONNECT_TO_VPN: - RecordAction(UserMetricsAction("StatusArea_VPN_ConnectToNetwork")); - break; - case UMA_STATUS_AREA_CHANGED_VOLUME_MENU: - RecordAction(UserMetricsAction("StatusArea_Volume_ChangedMenu")); - break; - case UMA_STATUS_AREA_CHANGED_VOLUME_POPUP: - RecordAction(UserMetricsAction("StatusArea_Volume_ChangedPopup")); - break; - case UMA_STATUS_AREA_DISPLAY_DEFAULT_SELECTED: - RecordAction(UserMetricsAction("StatusArea_Display_Default_Selected")); - break; - case UMA_STATUS_AREA_DISPLAY_DEFAULT_SHOW_SETTINGS: - RecordAction( - UserMetricsAction("StatusArea_Display_Default_ShowSettings")); - break; - case UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CREATED: - RecordAction( - UserMetricsAction("StatusArea_Display_Notification_Created")); - break; - case UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED: - RecordAction( - UserMetricsAction("StatusArea_Display_Notification_Selected")); - break; - case UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SHOW_SETTINGS: - RecordAction( - UserMetricsAction("StatusArea_Display_Notification_Show_Settings")); - break; - case UMA_STATUS_AREA_DISABLE_WIFI: - RecordAction(UserMetricsAction("StatusArea_Network_WifiDisabled")); - break; - case UMA_STATUS_AREA_DRIVE_CANCEL_OPERATION: - RecordAction(UserMetricsAction("StatusArea_Drive_CancelOperation")); - break; - case UMA_STATUS_AREA_DRIVE_SETTINGS: - RecordAction(UserMetricsAction("StatusArea_Drive_Settings")); - break; - case UMA_STATUS_AREA_ENABLE_WIFI: - RecordAction(UserMetricsAction("StatusArea_Network_WifiEnabled")); - break; - case UMA_STATUS_AREA_MENU_OPENED: - RecordAction(UserMetricsAction("StatusArea_MenuOpened")); - break; - case UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED: - RecordAction(UserMetricsAction("StatusArea_Network_JoinOther")); - break; - case UMA_STATUS_AREA_NETWORK_SETTINGS_OPENED: - RecordAction(UserMetricsAction("StatusArea_Network_Settings")); - break; - case UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED: - RecordAction(UserMetricsAction("StatusArea_OS_Update_Default_Selected")); - break; - case UMA_STATUS_AREA_SCREEN_CAPTURE_CHANGE_SOURCE: - RecordAction(UserMetricsAction("StatusArea_ScreenCapture_Change_Source")); - break; - case UMA_STATUS_AREA_SCREEN_CAPTURE_DEFAULT_STOP: - RecordAction(UserMetricsAction("StatusArea_ScreenCapture_Default_Stop")); - break; - case UMA_STATUS_AREA_SCREEN_CAPTURE_NOTIFICATION_STOP: - RecordAction( - UserMetricsAction("StatusArea_ScreenCapture_Notification_Stop")); - break; - case UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS: - RecordAction(UserMetricsAction("StatusArea_Network_ConnectionDetails")); - break; - case UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS: - RecordAction(UserMetricsAction("StatusArea_VPN_ConnectionDetails")); - break; - case UMA_STATUS_AREA_SMS_DETAILED_DISMISS_MSG: - RecordAction(UserMetricsAction("StatusArea_SMS_Detailed_DismissMsg")); - break; - case UMA_STATUS_AREA_SMS_NOTIFICATION_DISMISS_MSG: - RecordAction(UserMetricsAction("StatusArea_SMS_Notification_DismissMsg")); - break; - case UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED: - RecordAction(UserMetricsAction("StatusArea_Tracing_Default_Selected")); - break; - case UMA_STATUS_AREA_VPN_ADD_BUILT_IN_CLICKED: - RecordAction(UserMetricsAction("StatusArea_VPN_AddBuiltIn")); - break; - case UMA_STATUS_AREA_VPN_ADD_THIRD_PARTY_CLICKED: - RecordAction(UserMetricsAction("StatusArea_VPN_AddThirdParty")); - break; - case UMA_STATUS_AREA_VPN_DISCONNECT_CLICKED: - RecordAction(UserMetricsAction("StatusArea_VPN_Disconnect")); - break; - case UMA_STATUS_AREA_VPN_SETTINGS_OPENED: - RecordAction(UserMetricsAction("StatusArea_VPN_Settings")); - break; - } -} - void UserMetricsRecorder::StartDemoSessionMetricsRecording() { demo_session_metrics_recorder_ = std::make_unique<DemoSessionMetricsRecorder>();
diff --git a/ash/metrics/user_metrics_recorder.h b/ash/metrics/user_metrics_recorder.h index 2f1b0bd..2187e25 100644 --- a/ash/metrics/user_metrics_recorder.h +++ b/ash/metrics/user_metrics_recorder.h
@@ -10,7 +10,6 @@ #include "ash/ash_export.h" #include "ash/metrics/login_metrics_recorder.h" #include "ash/metrics/task_switch_metrics_recorder.h" -#include "ash/metrics/user_metrics_action.h" #include "base/timer/timer.h" namespace ash { @@ -24,8 +23,7 @@ // User Metrics Recorder provides a repeating callback (RecordPeriodicMetrics) // on a timer to allow recording of state data over time to the UMA records. // Any additional states (in ash) that require monitoring can be added to -// this class. As well calls to record on action metrics -// (RecordUserMetricsAction) are passed through the UserMetricsRecorder. +// this class. class ASH_EXPORT UserMetricsRecorder { public: // Creates a UserMetricsRecorder that records metrics periodically. Equivalent @@ -45,12 +43,6 @@ static void RecordUserClickOnShelfButton( LoginMetricsRecorder::ShelfButtonClickTarget target); - // Record the method used to activate dictation. - static void RecordUserToggleDictation(DictationToggleSource source); - - // Records an Ash owned user action. - void RecordUserMetricsAction(UserMetricsAction action); - // Starts recording demo session metrics. Used in Demo Mode. void StartDemoSessionMetricsRecording();
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index 285e2c0..d02db7b 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -38,6 +38,8 @@ "cancel_circle_outline.icon", "capture_mode.icon", "capture_mode_camera.icon", + "capture_mode_camera_preview_collapse.icon", + "capture_mode_camera_preview_expand.icon", "capture_mode_circle_stop.icon", "capture_mode_close.icon", "capture_mode_copied_to_clipboard.icon", @@ -469,49 +471,6 @@ "system_menu_cast_meeting.icon", ] } - - # Vector icons used for an experimental Switch Access feature. - sources += [ - "switch_access_action_recorder.icon", - "switch_access_display_brightness_down.icon", - "switch_access_display_brightness_up.icon", - "switch_access_display_menu.icon", - "switch_access_display_mirror.icon", - "switch_access_display_rotate.icon", - "switch_access_display_zoom_in.icon", - "switch_access_display_zoom_out.icon", - "switch_access_execute_macro.icon", - "switch_access_leave_group.icon", - "switch_access_media_fastforward.icon", - "switch_access_media_menu.icon", - "switch_access_media_mute.icon", - "switch_access_media_play_pause.icon", - "switch_access_media_rewind.icon", - "switch_access_media_volume_down.icon", - "switch_access_media_volume_up.icon", - "switch_access_quick_commands.icon", - "switch_access_start_recording.icon", - "switch_access_stop_recording.icon", - "switch_access_system_diagnostics.icon", - "switch_access_system_help.icon", - "switch_access_system_launcher.icon", - "switch_access_system_menu.icon", - "switch_access_system_screenshot.icon", - "switch_access_system_status_bar.icon", - "switch_access_system_task_manager.icon", - "switch_access_user_lock.icon", - "switch_access_user_menu.icon", - "switch_access_user_next_user.icon", - "switch_access_user_previous_user.icon", - "switch_access_user_sign_out.icon", - "switch_access_web_bookmark.icon", - "switch_access_web_bottom_of_page.icon", - "switch_access_web_clear_history.icon", - "switch_access_web_downloads.icon", - "switch_access_web_find_in_page.icon", - "switch_access_web_menu.icon", - "switch_access_web_top_of_page.icon", - ] } source_set("vector_icons") {
diff --git a/ash/resources/vector_icons/capture_mode_camera_preview_collapse.icon b/ash/resources/vector_icons/capture_mode_camera_preview_collapse.icon new file mode 100644 index 0000000..dce7ebe --- /dev/null +++ b/ash/resources/vector_icons/capture_mode_camera_preview_collapse.icon
@@ -0,0 +1,32 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 20, +MOVE_TO, 4, 10, +H_LINE_TO, 8, +H_LINE_TO, 10, +V_LINE_TO, 12, +V_LINE_TO, 16, +H_LINE_TO, 8, +V_LINE_TO, 13.41f, +LINE_TO, 4.41f, 17, +LINE_TO, 3, 15.59f, +LINE_TO, 6.59f, 12, +H_LINE_TO, 4, +V_LINE_TO, 10, +CLOSE, +NEW_PATH, +MOVE_TO, 12, 6.59f, +LINE_TO, 15.59f, 3, +LINE_TO, 17, 4.41f, +LINE_TO, 13.41f, 8, +H_LINE_TO, 16, +V_LINE_TO, 10, +H_LINE_TO, 12, +LINE_TO, 10, 10, +LINE_TO, 10, 8, +V_LINE_TO, 4, +H_LINE_TO, 12, +V_LINE_TO, 6.59f, +CLOSE
diff --git a/ash/resources/vector_icons/capture_mode_camera_preview_expand.icon b/ash/resources/vector_icons/capture_mode_camera_preview_expand.icon new file mode 100644 index 0000000..4968fc2 --- /dev/null +++ b/ash/resources/vector_icons/capture_mode_camera_preview_expand.icon
@@ -0,0 +1,31 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 20, +MOVE_TO, 11, 3, +H_LINE_TO, 15, +H_LINE_TO, 17, +V_LINE_TO, 5, +V_LINE_TO, 9, +H_LINE_TO, 15, +V_LINE_TO, 6.41f, +LINE_TO, 11.41f, 10, +LINE_TO, 10, 8.59f, +LINE_TO, 13.59f, 5, +H_LINE_TO, 11, +V_LINE_TO, 3, +CLOSE, +MOVE_TO, 8.59f, 10, +LINE_TO, 5, 13.59f, +V_LINE_TO, 11, +H_LINE_TO, 3, +V_LINE_TO, 15, +V_LINE_TO, 17, +H_LINE_TO, 5, +H_LINE_TO, 9, +V_LINE_TO, 15, +H_LINE_TO, 6.41f, +LINE_TO, 10, 11.41f, +LINE_TO, 8.59f, 10, +CLOSE
diff --git a/ash/resources/vector_icons/switch_access_action_recorder.icon b/ash/resources/vector_icons/switch_access_action_recorder.icon deleted file mode 100644 index 4becfdfd..0000000 --- a/ash/resources/vector_icons/switch_access_action_recorder.icon +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 12, 2, -CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12, -R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10, -R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10, -CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2, -CLOSE, -R_MOVE_TO, 0, 18, -R_CUBIC_TO, -4.42f, 0, -8, -3.58f, -8, -8, -R_CUBIC_TO, 0, -4.42f, 3.58f, -8, 8, -8, -R_CUBIC_TO, 4.42f, 0, 8, 3.58f, 8, 8, -R_CUBIC_TO, 0, 4.42f, -3.58f, 8, -8, 8, -CLOSE, -NEW_PATH, -NEW_PATH, -CIRCLE, 12, 12, 5
diff --git a/ash/resources/vector_icons/switch_access_display_brightness_down.icon b/ash/resources/vector_icons/switch_access_display_brightness_down.icon deleted file mode 100644 index 5df80f6..0000000 --- a/ash/resources/vector_icons/switch_access_display_brightness_down.icon +++ /dev/null
@@ -1,53 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 20, 8.69f, -V_LINE_TO, 4, -R_H_LINE_TO, -4.69f, -LINE_TO, 12, 0.69f, -LINE_TO, 8.69f, 4, -H_LINE_TO, 4, -R_V_LINE_TO, 4.69f, -LINE_TO, 0.69f, 12, -LINE_TO, 4, 15.31f, -V_LINE_TO, 20, -R_H_LINE_TO, 4.69f, -LINE_TO, 12, 23.31f, -LINE_TO, 15.31f, 20, -H_LINE_TO, 20, -R_V_LINE_TO, -4.69f, -LINE_TO, 23.31f, 12, -LINE_TO, 20, 8.69f, -CLOSE, -R_MOVE_TO, -2, 5.79f, -V_LINE_TO, 18, -R_H_LINE_TO, -3.52f, -LINE_TO, 12, 20.48f, -LINE_TO, 9.52f, 18, -H_LINE_TO, 6, -R_V_LINE_TO, -3.52f, -LINE_TO, 3.52f, 12, -LINE_TO, 6, 9.52f, -V_LINE_TO, 6, -R_H_LINE_TO, 3.52f, -LINE_TO, 12, 3.52f, -LINE_TO, 14.48f, 6, -H_LINE_TO, 18, -R_V_LINE_TO, 3.52f, -LINE_TO, 20.48f, 12, -LINE_TO, 18, 14.48f, -CLOSE, -MOVE_TO, 12, 6, -R_CUBIC_TO, -3.31f, 0, -6, 2.69f, -6, 6, -R_CUBIC_TO, 0, 3.31f, 2.69f, 6, 6, 6, -R_CUBIC_TO, 3.31f, 0, 6, -2.69f, 6, -6, -R_CUBIC_TO, 0, -3.31f, -2.69f, -6, -6, -6, -CLOSE, -R_MOVE_TO, 0, 10, -R_CUBIC_TO, -2.21f, 0, -4, -1.79f, -4, -4, -R_CUBIC_TO, 0, -2.21f, 1.79f, -4, 4, -4, -R_CUBIC_TO, 2.21f, 0, 4, 1.79f, 4, 4, -R_CUBIC_TO, 0, 2.21f, -1.79f, 4, -4, 4, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_display_brightness_up.icon b/ash/resources/vector_icons/switch_access_display_brightness_up.icon deleted file mode 100644 index 717619e..0000000 --- a/ash/resources/vector_icons/switch_access_display_brightness_up.icon +++ /dev/null
@@ -1,56 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 20, 8.69f, -V_LINE_TO, 4, -R_H_LINE_TO, -4.69f, -LINE_TO, 12, 0.69f, -LINE_TO, 8.69f, 4, -H_LINE_TO, 4, -R_V_LINE_TO, 4.69f, -LINE_TO, 0.69f, 12, -LINE_TO, 4, 15.31f, -V_LINE_TO, 20, -R_H_LINE_TO, 4.69f, -LINE_TO, 12, 23.31f, -LINE_TO, 15.31f, 20, -H_LINE_TO, 20, -R_V_LINE_TO, -4.69f, -LINE_TO, 23.31f, 12, -LINE_TO, 20, 8.69f, -CLOSE, -R_MOVE_TO, -2, 5.79f, -V_LINE_TO, 18, -R_H_LINE_TO, -3.52f, -LINE_TO, 12, 20.48f, -LINE_TO, 9.52f, 18, -H_LINE_TO, 6, -R_V_LINE_TO, -3.52f, -LINE_TO, 3.52f, 12, -LINE_TO, 6, 9.52f, -V_LINE_TO, 6, -R_H_LINE_TO, 3.52f, -LINE_TO, 12, 3.52f, -LINE_TO, 14.48f, 6, -H_LINE_TO, 18, -R_V_LINE_TO, 3.52f, -LINE_TO, 20.48f, 12, -LINE_TO, 18, 14.48f, -CLOSE, -MOVE_TO, 12, 6, -R_CUBIC_TO, -3.31f, 0, -6, 2.69f, -6, 6, -R_CUBIC_TO, 0, 3.31f, 2.69f, 6, 6, 6, -R_CUBIC_TO, 3.31f, 0, 6, -2.69f, 6, -6, -R_CUBIC_TO, 0, -3.31f, -2.69f, -6, -6, -6, -CLOSE, -R_MOVE_TO, 0, 10, -R_CUBIC_TO, -2.21f, 0, -4, -1.79f, -4, -4, -R_CUBIC_TO, 0, -2.21f, 1.79f, -4, 4, -4, -R_CUBIC_TO, 2.21f, 0, 4, 1.79f, 4, 4, -R_CUBIC_TO, 0, 2.21f, -1.79f, 4, -4, 4, -CLOSE, -NEW_PATH, -NEW_PATH, -CIRCLE, 12, 12, 2.5 \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_display_menu.icon b/ash/resources/vector_icons/switch_access_display_menu.icon deleted file mode 100644 index c757086..0000000 --- a/ash/resources/vector_icons/switch_access_display_menu.icon +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 20, 18, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 6, -R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, -H_LINE_TO, 4, -CUBIC_TO, 2.9f, 4, 2, 4.9f, 2, 6, -R_V_LINE_TO, 10, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -H_LINE_TO, 0, -R_V_LINE_TO, 2, -R_H_LINE_TO, 24, -R_V_LINE_TO, -2, -H_LINE_TO, 20, -CLOSE, -MOVE_TO, 4, 6, -R_H_LINE_TO, 16, -R_V_LINE_TO, 10, -H_LINE_TO, 4, -V_LINE_TO, 6, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_display_mirror.icon b/ash/resources/vector_icons/switch_access_display_mirror.icon deleted file mode 100644 index 66a5dc6..0000000 --- a/ash/resources/vector_icons/switch_access_display_mirror.icon +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 7, 14, -H_LINE_TO, 5, -R_V_LINE_TO, 5, -R_H_LINE_TO, 5, -R_V_LINE_TO, -2, -H_LINE_TO, 7, -R_V_LINE_TO, -3, -CLOSE, -R_MOVE_TO, -2, -4, -R_H_LINE_TO, 2, -V_LINE_TO, 7, -R_H_LINE_TO, 3, -V_LINE_TO, 5, -H_LINE_TO, 5, -R_V_LINE_TO, 5, -CLOSE, -R_MOVE_TO, 12, 7, -R_H_LINE_TO, -3, -R_V_LINE_TO, 2, -R_H_LINE_TO, 5, -R_V_LINE_TO, -5, -R_H_LINE_TO, -2, -R_V_LINE_TO, 3, -CLOSE, -MOVE_TO, 14, 5, -R_V_LINE_TO, 2, -R_H_LINE_TO, 3, -R_V_LINE_TO, 3, -R_H_LINE_TO, 2, -V_LINE_TO, 5, -R_H_LINE_TO, -5, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_display_rotate.icon b/ash/resources/vector_icons/switch_access_display_rotate.icon deleted file mode 100644 index b245886..0000000 --- a/ash/resources/vector_icons/switch_access_display_rotate.icon +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 16.48f, 2.52f, -R_CUBIC_TO, 3.27f, 1.55f, 5.61f, 4.72f, 5.97f, 8.48f, -R_H_LINE_TO, 1.5f, -CUBIC_TO, 23.44f, 4.84f, 18.29f, 0, 12, 0, -R_LINE_TO, -0.66f, 0.03f, -R_LINE_TO, 3.81f, 3.81f, -R_LINE_TO, 1.33f, -1.32f, -CLOSE, -R_MOVE_TO, -6.25f, -0.77f, -R_CUBIC_TO, -0.59f, -0.59f, -1.54f, -0.59f, -2.12f, 0, -LINE_TO, 1.75f, 8.11f, -R_CUBIC_TO, -0.59f, 0.59f, -0.59f, 1.54f, 0, 2.12f, -R_LINE_TO, 12.02f, 12.02f, -R_CUBIC_TO, 0.59f, 0.59f, 1.54f, 0.59f, 2.12f, 0, -R_LINE_TO, 6.36f, -6.36f, -R_CUBIC_TO, 0.59f, -0.59f, 0.59f, -1.54f, 0, -2.12f, -LINE_TO, 10.23f, 1.75f, -CLOSE, -R_MOVE_TO, 4.6f, 19.44f, -LINE_TO, 2.81f, 9.17f, -R_LINE_TO, 6.36f, -6.36f, -R_LINE_TO, 12.02f, 12.02f, -R_LINE_TO, -6.36f, 6.36f, -CLOSE, -R_MOVE_TO, -7.31f, 0.29f, -CUBIC_TO, 4.25f, 19.94f, 1.91f, 16.76f, 1.55f, 13, -H_LINE_TO, 0.05f, -CUBIC_TO, 0.56f, 19.16f, 5.71f, 24, 12, 24, -R_LINE_TO, 0.66f, -0.03f, -R_LINE_TO, -3.81f, -3.81f, -R_LINE_TO, -1.33f, 1.32f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_display_zoom_in.icon b/ash/resources/vector_icons/switch_access_display_zoom_in.icon deleted file mode 100644 index 6037b878..0000000 --- a/ash/resources/vector_icons/switch_access_display_zoom_in.icon +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 15.5f, 14, -R_H_LINE_TO, -0.79f, -R_LINE_TO, -0.28f, -0.27f, -CUBIC_TO, 15.41f, 12.59f, 16, 11.11f, 16, 9.5f, -CUBIC_TO, 16, 5.91f, 13.09f, 3, 9.5f, 3, -CUBIC_TO_SHORTHAND, 3, 5.91f, 3, 9.5f, -CUBIC_TO_SHORTHAND, 5.91f, 16, 9.5f, 16, -R_CUBIC_TO, 1.61f, 0, 3.09f, -0.59f, 4.23f, -1.57f, -R_LINE_TO, 0.27f, 0.28f, -R_V_LINE_TO, 0.79f, -R_LINE_TO, 5, 4.99f, -LINE_TO, 20.49f, 19, -R_LINE_TO, -4.99f, -5, -CLOSE, -R_MOVE_TO, -6, 0, -CUBIC_TO, 7.01f, 14, 5, 11.99f, 5, 9.5f, -CUBIC_TO_SHORTHAND, 7.01f, 5, 9.5f, 5, -CUBIC_TO_SHORTHAND, 14, 7.01f, 14, 9.5f, -CUBIC_TO_SHORTHAND, 11.99f, 14, 9.5f, 14, -CLOSE, -R_MOVE_TO, 0.5f, -7, -H_LINE_TO, 9, -R_V_LINE_TO, 2, -H_LINE_TO, 7, -R_V_LINE_TO, 1, -R_H_LINE_TO, 2, -R_V_LINE_TO, 2, -R_H_LINE_TO, 1, -R_V_LINE_TO, -2, -R_H_LINE_TO, 2, -V_LINE_TO, 9, -R_H_LINE_TO, -2, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_display_zoom_out.icon b/ash/resources/vector_icons/switch_access_display_zoom_out.icon deleted file mode 100644 index 8c411c2..0000000 --- a/ash/resources/vector_icons/switch_access_display_zoom_out.icon +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 15.5f, 14, -R_H_LINE_TO, -0.79f, -R_LINE_TO, -0.28f, -0.27f, -CUBIC_TO, 15.41f, 12.59f, 16, 11.11f, 16, 9.5f, -CUBIC_TO, 16, 5.91f, 13.09f, 3, 9.5f, 3, -CUBIC_TO_SHORTHAND, 3, 5.91f, 3, 9.5f, -CUBIC_TO_SHORTHAND, 5.91f, 16, 9.5f, 16, -R_CUBIC_TO, 1.61f, 0, 3.09f, -0.59f, 4.23f, -1.57f, -R_LINE_TO, 0.27f, 0.28f, -R_V_LINE_TO, 0.79f, -R_LINE_TO, 5, 4.99f, -LINE_TO, 20.49f, 19, -R_LINE_TO, -4.99f, -5, -CLOSE, -R_MOVE_TO, -6, 0, -CUBIC_TO, 7.01f, 14, 5, 11.99f, 5, 9.5f, -CUBIC_TO_SHORTHAND, 7.01f, 5, 9.5f, 5, -CUBIC_TO_SHORTHAND, 14, 7.01f, 14, 9.5f, -CUBIC_TO_SHORTHAND, 11.99f, 14, 9.5f, 14, -CLOSE, -MOVE_TO, 7, 9, -R_H_LINE_TO, 5, -R_V_LINE_TO, 1, -H_LINE_TO, 7, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_execute_macro.icon b/ash/resources/vector_icons/switch_access_execute_macro.icon deleted file mode 100644 index 0cfd500..0000000 --- a/ash/resources/vector_icons/switch_access_execute_macro.icon +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 19.77f, 4.93f, -R_LINE_TO, 1.4f, 1.4f, -LINE_TO, 8.43f, 19.07f, -R_LINE_TO, -5.6f, -5.6f, -R_LINE_TO, 1.4f, -1.4f, -R_LINE_TO, 4.2f, 4.2f, -LINE_TO, 19.77f, 4.93f, -R_MOVE_TO, 0, -2.83f, -LINE_TO, 8.43f, 13.44f, -R_LINE_TO, -4.2f, -4.2f, -LINE_TO, 0, 13.47f, -R_LINE_TO, 8.43f, 8.43f, -LINE_TO, 24, 6.33f, -LINE_TO, 19.77f, 2.1f, -CLOSE
diff --git a/ash/resources/vector_icons/switch_access_leave_group.icon b/ash/resources/vector_icons/switch_access_leave_group.icon deleted file mode 100644 index 953ad32..0000000 --- a/ash/resources/vector_icons/switch_access_leave_group.icon +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 22, 3, -H_LINE_TO, 7, -R_CUBIC_TO, -0.69f, 0, -1.23f, 0.35f, -1.59f, 0.88f, -LINE_TO, 0, 12, -R_LINE_TO, 5.41f, 8.11f, -R_CUBIC_TO, 0.36f, 0.53f, 0.9f, 0.89f, 1.59f, 0.89f, -R_H_LINE_TO, 15, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 5, -R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, -CLOSE, -R_MOVE_TO, 0, 16, -H_LINE_TO, 7.07f, -LINE_TO, 2.4f, 12, -R_LINE_TO, 4.66f, -7, -H_LINE_TO, 22, -R_V_LINE_TO, 14, -CLOSE, -R_MOVE_TO, -11.59f, -2, -LINE_TO, 14, 13.41f, -LINE_TO, 17.59f, 17, -LINE_TO, 19, 15.59f, -LINE_TO, 15.41f, 12, -LINE_TO, 19, 8.41f, -LINE_TO, 17.59f, 7, -LINE_TO, 14, 10.59f, -LINE_TO, 10.41f, 7, -LINE_TO, 9, 8.41f, -LINE_TO, 12.59f, 12, -LINE_TO, 9, 15.59f, -CLOSE
diff --git a/ash/resources/vector_icons/switch_access_media_fastforward.icon b/ash/resources/vector_icons/switch_access_media_fastforward.icon deleted file mode 100644 index 2169e7d..0000000 --- a/ash/resources/vector_icons/switch_access_media_fastforward.icon +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 15, 9.86f, -LINE_TO, 18.03f, 12, -LINE_TO, 15, 14.14f, -V_LINE_TO, 9.86f, -MOVE_TO, 6, 9.86f, -LINE_TO, 9.03f, 12, -LINE_TO, 6, 14.14f, -V_LINE_TO, 9.86f, -MOVE_TO, 13, 6, -R_V_LINE_TO, 12, -R_LINE_TO, 8.5f, -6, -LINE_TO, 13, 6, -LINE_TO, 13, 6, -CLOSE, -MOVE_TO, 4, 6, -R_V_LINE_TO, 12, -R_LINE_TO, 8.5f, -6, -LINE_TO, 4, 6, -LINE_TO, 4, 6, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_media_menu.icon b/ash/resources/vector_icons/switch_access_media_menu.icon deleted file mode 100644 index b71a3d8..0000000 --- a/ash/resources/vector_icons/switch_access_media_menu.icon +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 10, 16.5f, -R_LINE_TO, 6, -4.5f, -R_LINE_TO, -6, -4.5f, -CLOSE, -MOVE_TO, 12, 2, -CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12, -R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10, -R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10, -CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2, -CLOSE, -R_MOVE_TO, 0, 18, -R_CUBIC_TO, -4.41f, 0, -8, -3.59f, -8, -8, -R_CUBIC_TO, 0, -4.41f, 3.59f, -8, 8, -8, -R_CUBIC_TO, 4.41f, 0, 8, 3.59f, 8, 8, -R_CUBIC_TO, 0, 4.41f, -3.59f, 8, -8, 8, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_media_mute.icon b/ash/resources/vector_icons/switch_access_media_mute.icon deleted file mode 100644 index 5bf9277..0000000 --- a/ash/resources/vector_icons/switch_access_media_mute.icon +++ /dev/null
@@ -1,49 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 4.34f, 2.93f, -LINE_TO, 2.93f, 4.34f, -LINE_TO, 7.29f, 8.7f, -LINE_TO, 7, 9, -H_LINE_TO, 3, -R_V_LINE_TO, 6, -R_H_LINE_TO, 4, -R_LINE_TO, 5, 5, -R_V_LINE_TO, -6.59f, -R_LINE_TO, 4.18f, 4.18f, -R_CUBIC_TO, -0.65f, 0.49f, -1.38f, 0.88f, -2.18f, 1.11f, -R_V_LINE_TO, 2.06f, -R_CUBIC_TO, 1.34f, -0.3f, 2.57f, -0.92f, 3.61f, -1.75f, -R_LINE_TO, 2.05f, 2.05f, -R_LINE_TO, 1.41f, -1.41f, -LINE_TO, 4.34f, 2.93f, -CLOSE, -MOVE_TO, 10, 15.17f, -LINE_TO, 7.83f, 13, -H_LINE_TO, 5, -R_V_LINE_TO, -2, -R_H_LINE_TO, 2.83f, -R_LINE_TO, 0.88f, -0.88f, -LINE_TO, 10, 11.41f, -R_V_LINE_TO, 3.76f, -CLOSE, -MOVE_TO, 19, 12, -R_CUBIC_TO, 0, 0.82f, -0.15f, 1.61f, -0.41f, 2.34f, -R_LINE_TO, 1.53f, 1.53f, -R_CUBIC_TO, 0.56f, -1.17f, 0.88f, -2.48f, 0.88f, -3.87f, -R_CUBIC_TO, 0, -4.28f, -2.99f, -7.86f, -7, -8.77f, -R_V_LINE_TO, 2.06f, -R_CUBIC_TO, 2.89f, 0.86f, 5, 3.54f, 5, 6.71f, -CLOSE, -R_MOVE_TO, -7, -8, -R_LINE_TO, -1.88f, 1.88f, -LINE_TO, 12, 7.76f, -CLOSE, -R_MOVE_TO, 4.5f, 8, -R_CUBIC_TO, 0, -1.77f, -1.02f, -3.29f, -2.5f, -4.03f, -R_V_LINE_TO, 1.79f, -R_LINE_TO, 2.48f, 2.48f, -R_CUBIC_TO, 0.01f, -0.08f, 0.02f, -0.16f, 0.02f, -0.24f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_media_play_pause.icon b/ash/resources/vector_icons/switch_access_media_play_pause.icon deleted file mode 100644 index 1d0e89b64..0000000 --- a/ash/resources/vector_icons/switch_access_media_play_pause.icon +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 10, 8.64f, -LINE_TO, 15.27f, 12, -LINE_TO, 10, 15.36f, -V_LINE_TO, 8.64f, -MOVE_TO, 8, 5, -R_V_LINE_TO, 14, -R_LINE_TO, 11, -7, -LINE_TO, 8, 5, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_media_rewind.icon b/ash/resources/vector_icons/switch_access_media_rewind.icon deleted file mode 100644 index b83e329e..0000000 --- a/ash/resources/vector_icons/switch_access_media_rewind.icon +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 18, 9.86f, -R_V_LINE_TO, 4.28f, -LINE_TO, 14.97f, 12, -LINE_TO, 18, 9.86f, -R_MOVE_TO, -9, 0, -R_V_LINE_TO, 4.28f, -LINE_TO, 5.97f, 12, -LINE_TO, 9, 9.86f, -MOVE_TO, 20, 6, -R_LINE_TO, -8.5f, 6, -R_LINE_TO, 8.5f, 6, -V_LINE_TO, 6, -CLOSE, -R_MOVE_TO, -9, 0, -R_LINE_TO, -8.5f, 6, -R_LINE_TO, 8.5f, 6, -V_LINE_TO, 6, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_media_volume_down.icon b/ash/resources/vector_icons/switch_access_media_volume_down.icon deleted file mode 100644 index 5f4ca4a..0000000 --- a/ash/resources/vector_icons/switch_access_media_volume_down.icon +++ /dev/null
@@ -1,26 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 16, 7.97f, -R_V_LINE_TO, 8.05f, -R_CUBIC_TO, 1.48f, -0.73f, 2.5f, -2.25f, 2.5f, -4.02f, -R_CUBIC_TO, 0, -1.77f, -1.02f, -3.29f, -2.5f, -4.03f, -CLOSE, -MOVE_TO, 5, 9, -R_V_LINE_TO, 6, -R_H_LINE_TO, 4, -R_LINE_TO, 5, 5, -V_LINE_TO, 4, -LINE_TO, 9, 9, -H_LINE_TO, 5, -CLOSE, -R_MOVE_TO, 7, -0.17f, -R_V_LINE_TO, 6.34f, -LINE_TO, 9.83f, 13, -H_LINE_TO, 7, -R_V_LINE_TO, -2, -R_H_LINE_TO, 2.83f, -LINE_TO, 12, 8.83f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_media_volume_up.icon b/ash/resources/vector_icons/switch_access_media_volume_up.icon deleted file mode 100644 index 6ae98e5..0000000 --- a/ash/resources/vector_icons/switch_access_media_volume_up.icon +++ /dev/null
@@ -1,34 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 3, 9, -R_V_LINE_TO, 6, -R_H_LINE_TO, 4, -R_LINE_TO, 5, 5, -V_LINE_TO, 4, -LINE_TO, 7, 9, -H_LINE_TO, 3, -CLOSE, -R_MOVE_TO, 7, -0.17f, -R_V_LINE_TO, 6.34f, -LINE_TO, 7.83f, 13, -H_LINE_TO, 5, -R_V_LINE_TO, -2, -R_H_LINE_TO, 2.83f, -LINE_TO, 10, 8.83f, -CLOSE, -MOVE_TO, 16.5f, 12, -R_CUBIC_TO, 0, -1.77f, -1.02f, -3.29f, -2.5f, -4.03f, -R_V_LINE_TO, 8.05f, -R_CUBIC_TO, 1.48f, -0.73f, 2.5f, -2.25f, 2.5f, -4.02f, -CLOSE, -MOVE_TO, 14, 3.23f, -R_V_LINE_TO, 2.06f, -R_CUBIC_TO, 2.89f, 0.86f, 5, 3.54f, 5, 6.71f, -R_CUBIC_TO, 0, 3.17f, -2.11f, 5.85f, -5, 6.71f, -R_V_LINE_TO, 2.06f, -R_CUBIC_TO, 4.01f, -0.91f, 7, -4.49f, 7, -8.77f, -R_CUBIC_TO, 0, -4.28f, -2.99f, -7.86f, -7, -8.77f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_quick_commands.icon b/ash/resources/vector_icons/switch_access_quick_commands.icon deleted file mode 100644 index c80c6d7..0000000 --- a/ash/resources/vector_icons/switch_access_quick_commands.icon +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 20, -MOVE_TO, 4.56f, 6.94f, -LINE_TO, 2.5f, 6, -LINE_TO, 4.56f, 5.06f, -LINE_TO, 5.5f, 3, -LINE_TO, 6.44f, 5.06f, -LINE_TO, 8.5f, 6, -LINE_TO, 6.44f, 6.94f, -LINE_TO, 5.5f, 9, -LINE_TO, 4.56f, 6.94f, -CLOSE, -MOVE_TO, 5.5f, 19, -LINE_TO, 6.44f, 16.94f, -LINE_TO, 8.5f, 16, -LINE_TO, 6.44f, 15.06f, -LINE_TO, 5.5f, 13, -LINE_TO, 4.56f, 15.06f, -LINE_TO, 2.5f, 16, -LINE_TO, 4.56f, 16.94f, -LINE_TO, 5.5f, 19, -CLOSE, -MOVE_TO, 1.87f, 10.37f, -LINE_TO, 0.5f, 11, -LINE_TO, 1.87f, 11.63f, -LINE_TO, 2.5f, 13, -LINE_TO, 3.13f, 11.63f, -LINE_TO, 4.5f, 11, -LINE_TO, 3.13f, 10.37f, -LINE_TO, 2.5f, 9, -LINE_TO, 1.87f, 10.37f, -CLOSE, -MOVE_TO, 9.5f, 10, -CUBIC_TO, 9.5f, 6.91f, 10.88f, 4.06f, 12.94f, 2, -H_LINE_TO, 9.5f, -V_LINE_TO, 0, -H_LINE_TO, 16.5f, -V_LINE_TO, 7, -H_LINE_TO, 14.5f, -V_LINE_TO, 3.28f, -CUBIC_TO, 12.7f, 5.02f, 11.5f, 7.48f, 11.5f, 10, -CUBIC_TO, 11.5f, 13.32f, 13.6f, 16.36f, 16.5f, 17.82f, -V_LINE_TO, 20, -CUBIC_TO, 12.41f, 18.41f, 9.5f, 14.35f, 9.5f, 10, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_start_recording.icon b/ash/resources/vector_icons/switch_access_start_recording.icon deleted file mode 100644 index cab31b29..0000000 --- a/ash/resources/vector_icons/switch_access_start_recording.icon +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 10, 8.64f, -LINE_TO, 15.27f, 12, -LINE_TO, 10, 15.36f, -V_LINE_TO, 8.64f, -MOVE_TO, 8, 5, -R_V_LINE_TO, 14, -R_LINE_TO, 11, -7, -LINE_TO, 8, 5, -CLOSE
diff --git a/ash/resources/vector_icons/switch_access_stop_recording.icon b/ash/resources/vector_icons/switch_access_stop_recording.icon deleted file mode 100644 index 4e316fd4..0000000 --- a/ash/resources/vector_icons/switch_access_stop_recording.icon +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 16, 8, -R_V_LINE_TO, 8, -H_LINE_TO, 8, -V_LINE_TO, 8, -R_H_LINE_TO, 8, -R_MOVE_TO, 2, -2, -H_LINE_TO, 6, -R_V_LINE_TO, 12, -R_H_LINE_TO, 12, -V_LINE_TO, 6, -CLOSE
diff --git a/ash/resources/vector_icons/switch_access_system_diagnostics.icon b/ash/resources/vector_icons/switch_access_system_diagnostics.icon deleted file mode 100644 index 63fa074..0000000 --- a/ash/resources/vector_icons/switch_access_system_diagnostics.icon +++ /dev/null
@@ -1,39 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 5, 16, -R_CUBIC_TO, 0, 3.87f, 3.13f, 7, 7, 7, -R_CUBIC_TO, 3.87f, 0, 7, -3.13f, 7, -7, -R_V_LINE_TO, -4, -H_LINE_TO, 5, -R_V_LINE_TO, 4, -CLOSE, -MOVE_TO, 16.12f, 4.37f, -R_LINE_TO, 2.1f, -2.1f, -R_LINE_TO, -0.82f, -0.83f, -R_LINE_TO, -2.3f, 2.31f, -CUBIC_TO, 14.16f, 3.28f, 13.12f, 3, 12, 3, -R_CUBIC_TO, -1.12f, 0, -2.16f, 0.28f, -3.09f, 0.75f, -LINE_TO, 6.6f, 1.44f, -R_LINE_TO, -0.82f, 0.83f, -R_LINE_TO, 2.1f, 2.1f, -CUBIC_TO, 6.14f, 5.64f, 5, 7.68f, 5, 10, -R_V_LINE_TO, 1, -R_H_LINE_TO, 14, -R_V_LINE_TO, -1, -R_CUBIC_TO, 0, -2.32f, -1.14f, -4.36f, -2.88f, -5.63f, -CLOSE, -MOVE_TO, 9, 9, -R_CUBIC_TO, -0.55f, 0, -1, -0.45f, -1, -1, -R_CUBIC_TO, 0, -0.55f, 0.45f, -1, 1, -1, -R_CUBIC_TO, 0.55f, 0, 1, 0.45f, 1, 1, -R_CUBIC_TO, 0, 0.55f, -0.45f, 1, -1, 1, -CLOSE, -R_MOVE_TO, 6, 0, -R_CUBIC_TO, -0.55f, 0, -1, -0.45f, -1, -1, -R_CUBIC_TO, 0, -0.55f, 0.45f, -1, 1, -1, -R_CUBIC_TO, 0.55f, 0, 1, 0.45f, 1, 1, -R_CUBIC_TO, 0, 0.55f, -0.45f, 1, -1, 1, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_system_help.icon b/ash/resources/vector_icons/switch_access_system_help.icon deleted file mode 100644 index 13558f7..0000000 --- a/ash/resources/vector_icons/switch_access_system_help.icon +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 11, 18, -R_H_LINE_TO, 2, -R_V_LINE_TO, -2, -R_H_LINE_TO, -2, -R_V_LINE_TO, 2, -CLOSE, -R_MOVE_TO, 1, -16, -CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12, -R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10, -R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10, -CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2, -CLOSE, -R_MOVE_TO, 0, 18, -R_CUBIC_TO, -4.41f, 0, -8, -3.59f, -8, -8, -R_CUBIC_TO, 0, -4.41f, 3.59f, -8, 8, -8, -R_CUBIC_TO, 4.41f, 0, 8, 3.59f, 8, 8, -R_CUBIC_TO, 0, 4.41f, -3.59f, 8, -8, 8, -CLOSE, -R_MOVE_TO, 0, -14, -R_CUBIC_TO, -2.21f, 0, -4, 1.79f, -4, 4, -R_H_LINE_TO, 2, -R_CUBIC_TO, 0, -1.1f, 0.9f, -2, 2, -2, -R_CUBIC_TO, 1.1f, 0, 2, 0.9f, 2, 2, -R_CUBIC_TO, 0, 2, -3, 1.75f, -3, 5, -R_H_LINE_TO, 2, -R_CUBIC_TO, 0, -2.25f, 3, -2.5f, 3, -5, -R_CUBIC_TO, 0, -2.21f, -1.79f, -4, -4, -4, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_system_launcher.icon b/ash/resources/vector_icons/switch_access_system_launcher.icon deleted file mode 100644 index 9920216..0000000 --- a/ash/resources/vector_icons/switch_access_system_launcher.icon +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 12, 2, -CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12, -R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10, -R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10, -CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2, -CLOSE, -R_MOVE_TO, 0, 18, -R_CUBIC_TO, -4.42f, 0, -8, -3.58f, -8, -8, -R_CUBIC_TO, 0, -4.42f, 3.58f, -8, 8, -8, -R_CUBIC_TO, 4.42f, 0, 8, 3.58f, 8, 8, -R_CUBIC_TO, 0, 4.42f, -3.58f, 8, -8, 8, -CLOSE, -CIRCLE, 12, 12, 5 \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_system_menu.icon b/ash/resources/vector_icons/switch_access_system_menu.icon deleted file mode 100644 index af587c3a..0000000 --- a/ash/resources/vector_icons/switch_access_system_menu.icon +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 19, 15, -R_V_LINE_TO, 4, -H_LINE_TO, 5, -R_V_LINE_TO, -4, -R_H_LINE_TO, 14, -R_MOVE_TO, 1, -2, -H_LINE_TO, 4, -R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, -R_V_LINE_TO, 6, -R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, -R_H_LINE_TO, 16, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -R_V_LINE_TO, -6, -R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, -CLOSE, -MOVE_TO, 7, 18.5f, -R_CUBIC_TO, -0.82f, 0, -1.5f, -0.67f, -1.5f, -1.5f, -R_CUBIC_TO, 0, -0.83f, 0.68f, -1.5f, 1.5f, -1.5f, -R_CUBIC_TO, 0.82f, 0, 1.5f, 0.67f, 1.5f, 1.5f, -R_CUBIC_TO, 0, 0.83f, -0.67f, 1.5f, -1.5f, 1.5f, -CLOSE, -MOVE_TO, 19, 5, -R_V_LINE_TO, 4, -H_LINE_TO, 5, -V_LINE_TO, 5, -R_H_LINE_TO, 14, -R_MOVE_TO, 1, -2, -H_LINE_TO, 4, -R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, -R_V_LINE_TO, 6, -R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, -R_H_LINE_TO, 16, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -V_LINE_TO, 4, -R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, -CLOSE, -MOVE_TO, 7, 8.5f, -R_CUBIC_TO, -0.82f, 0, -1.5f, -0.67f, -1.5f, -1.5f, -CUBIC_TO_SHORTHAND, 6.18f, 5.5f, 7, 5.5f, -R_CUBIC_TO, 0.82f, 0, 1.5f, 0.68f, 1.5f, 1.5f, -CUBIC_TO_SHORTHAND, 7.83f, 8.5f, 7, 8.5f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_system_screenshot.icon b/ash/resources/vector_icons/switch_access_system_screenshot.icon deleted file mode 100644 index b35ba2a..0000000 --- a/ash/resources/vector_icons/switch_access_system_screenshot.icon +++ /dev/null
@@ -1,49 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 17, 1.01f, -LINE_TO, 7, 1, -CUBIC_TO, 5.9f, 1, 5, 1.9f, 5, 3, -R_V_LINE_TO, 18, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -R_H_LINE_TO, 10, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 3, -CUBIC_TO, 19, 1.9f, 18.1f, 1.01f, 17, 1.01f, -CLOSE, -MOVE_TO, 17, 21, -H_LINE_TO, 7, -R_V_LINE_TO, -1, -R_H_LINE_TO, 10, -V_LINE_TO, 21, -CLOSE, -MOVE_TO, 17, 18, -H_LINE_TO, 7, -V_LINE_TO, 6, -R_H_LINE_TO, 10, -V_LINE_TO, 18, -CLOSE, -MOVE_TO, 17, 4, -H_LINE_TO, 7, -V_LINE_TO, 3, -R_H_LINE_TO, 10, -V_LINE_TO, 4, -CLOSE, -MOVE_TO, 9.5f, 8.5f, -H_LINE_TO, 12, -V_LINE_TO, 7, -H_LINE_TO, 8, -R_V_LINE_TO, 4, -R_H_LINE_TO, 1.5f, -V_LINE_TO, 8.5f, -CLOSE, -MOVE_TO, 12, 17, -R_H_LINE_TO, 4, -R_V_LINE_TO, -4, -R_H_LINE_TO, -1.5f, -R_V_LINE_TO, 2.5f, -H_LINE_TO, 12, -V_LINE_TO, 17, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_system_status_bar.icon b/ash/resources/vector_icons/switch_access_system_status_bar.icon deleted file mode 100644 index cbd35b2..0000000 --- a/ash/resources/vector_icons/switch_access_system_status_bar.icon +++ /dev/null
@@ -1,28 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 19, 15, -R_V_LINE_TO, 2, -H_LINE_TO, 5, -R_V_LINE_TO, -2, -R_H_LINE_TO, 14, -R_MOVE_TO, 2, -10, -H_LINE_TO, 3, -R_V_LINE_TO, 2, -R_H_LINE_TO, 18, -V_LINE_TO, 5, -CLOSE, -R_MOVE_TO, 0, 4, -H_LINE_TO, 3, -R_V_LINE_TO, 2, -R_H_LINE_TO, 18, -V_LINE_TO, 9, -CLOSE, -R_MOVE_TO, 0, 4, -H_LINE_TO, 3, -R_V_LINE_TO, 6, -R_H_LINE_TO, 18, -R_V_LINE_TO, -6, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_system_task_manager.icon b/ash/resources/vector_icons/switch_access_system_task_manager.icon deleted file mode 100644 index 6616ee7..0000000 --- a/ash/resources/vector_icons/switch_access_system_task_manager.icon +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 18, 4, -R_V_LINE_TO, 5, -H_LINE_TO, 6, -V_LINE_TO, 4, -H_LINE_TO, 18, -MOVE_TO, 18, 2, -H_LINE_TO, 6, -CUBIC_TO, 4.9f, 2, 4, 2.9f, 4, 4, -R_V_LINE_TO, 5, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -R_H_LINE_TO, 12, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 4, -CUBIC_TO, 20, 2.9f, 19.1f, 2, 18, 2, -CLOSE, -MOVE_TO, 18, 15, -R_V_LINE_TO, 5, -H_LINE_TO, 6, -R_V_LINE_TO, -5, -H_LINE_TO, 18, -MOVE_TO, 18, 13, -H_LINE_TO, 6, -R_CUBIC_TO, -1.1f, 0, -2, 0.9f, -2, 2, -R_V_LINE_TO, 5, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -R_H_LINE_TO, 12, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -R_V_LINE_TO, -5, -CUBIC_TO, 20, 13.9f, 19.1f, 13, 18, 13, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_user_lock.icon b/ash/resources/vector_icons/switch_access_user_lock.icon deleted file mode 100644 index 6bf0351..0000000 --- a/ash/resources/vector_icons/switch_access_user_lock.icon +++ /dev/null
@@ -1,39 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 18, 8, -R_H_LINE_TO, -1, -V_LINE_TO, 6, -R_CUBIC_TO, 0, -2.76f, -2.24f, -5, -5, -5, -CUBIC_TO_SHORTHAND, 7, 3.24f, 7, 6, -R_V_LINE_TO, 2, -H_LINE_TO, 6, -R_CUBIC_TO, -1.1f, 0, -2, 0.9f, -2, 2, -R_V_LINE_TO, 10, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -R_H_LINE_TO, 12, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 10, -R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, -CLOSE, -MOVE_TO, 9, 6, -R_CUBIC_TO, 0, -1.66f, 1.34f, -3, 3, -3, -R_CUBIC_TO, 1.66f, 0, 3, 1.34f, 3, 3, -R_V_LINE_TO, 2, -H_LINE_TO, 9, -V_LINE_TO, 6, -CLOSE, -R_MOVE_TO, 9, 14, -H_LINE_TO, 6, -V_LINE_TO, 10, -R_H_LINE_TO, 12, -R_V_LINE_TO, 10, -CLOSE, -R_MOVE_TO, -6, -3, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, -R_CUBIC_TO, -1.1f, 0, -2, 0.9f, -2, 2, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_user_menu.icon b/ash/resources/vector_icons/switch_access_user_menu.icon deleted file mode 100644 index 233f3235a..0000000 --- a/ash/resources/vector_icons/switch_access_user_menu.icon +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 12, 2, -CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12, -R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10, -R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10, -CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2, -CLOSE, -MOVE_TO, 7.07f, 18.28f, -R_CUBIC_TO, 0.43f, -0.9f, 3.05f, -1.78f, 4.93f, -1.78f, -R_CUBIC_TO, 1.88f, 0, 4.51f, 0.88f, 4.93f, 1.78f, -CUBIC_TO, 15.57f, 19.36f, 13.86f, 20, 12, 20, -R_CUBIC_TO, -1.86f, 0, -3.57f, -0.64f, -4.93f, -1.72f, -CLOSE, -R_MOVE_TO, 11.29f, -1.45f, -R_CUBIC_TO, -1.43f, -1.74f, -4.9f, -2.33f, -6.36f, -2.33f, -R_CUBIC_TO, -1.46f, 0, -4.93f, 0.59f, -6.36f, 2.33f, -CUBIC_TO, 4.62f, 15.49f, 4, 13.82f, 4, 12, -R_CUBIC_TO, 0, -4.41f, 3.59f, -8, 8, -8, -R_CUBIC_TO, 4.41f, 0, 8, 3.59f, 8, 8, -R_CUBIC_TO, 0, 1.82f, -0.62f, 3.49f, -1.64f, 4.83f, -CLOSE, -MOVE_TO, 12, 6, -R_CUBIC_TO, -1.94f, 0, -3.5f, 1.56f, -3.5f, 3.5f, -CUBIC_TO_SHORTHAND, 10.06f, 13, 12, 13, -R_CUBIC_TO, 1.94f, 0, 3.5f, -1.56f, 3.5f, -3.5f, -CUBIC_TO_SHORTHAND, 13.94f, 6, 12, 6, -CLOSE, -R_MOVE_TO, 0, 5, -R_CUBIC_TO, -0.83f, 0, -1.5f, -0.67f, -1.5f, -1.5f, -CUBIC_TO_SHORTHAND, 11.17f, 8, 12, 8, -R_CUBIC_TO, 0.83f, 0, 1.5f, 0.67f, 1.5f, 1.5f, -CUBIC_TO_SHORTHAND, 12.83f, 11, 12, 11, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_user_next_user.icon b/ash/resources/vector_icons/switch_access_user_next_user.icon deleted file mode 100644 index 6d4c41c..0000000 --- a/ash/resources/vector_icons/switch_access_user_next_user.icon +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 11, 15, -R_H_LINE_TO, 2, -R_V_LINE_TO, -3, -R_H_LINE_TO, 3, -R_V_LINE_TO, -2, -R_H_LINE_TO, -3, -V_LINE_TO, 7, -R_H_LINE_TO, -2, -R_V_LINE_TO, 3, -H_LINE_TO, 8, -R_V_LINE_TO, 2, -R_H_LINE_TO, 3, -CLOSE, -MOVE_TO, 21, 3, -H_LINE_TO, 3, -R_CUBIC_TO, -1.11f, 0, -2, 0.89f, -2, 2, -R_V_LINE_TO, 12, -R_CUBIC_TO, 0, 1.1f, 0.89f, 2, 2, 2, -R_H_LINE_TO, 5, -R_V_LINE_TO, 2, -R_H_LINE_TO, 8, -R_V_LINE_TO, -2, -R_H_LINE_TO, 5, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 5, -R_CUBIC_TO, 0, -1.11f, -0.9f, -2, -2, -2, -CLOSE, -R_MOVE_TO, 0, 14, -H_LINE_TO, 3, -V_LINE_TO, 5, -R_H_LINE_TO, 18, -R_V_LINE_TO, 12, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_user_previous_user.icon b/ash/resources/vector_icons/switch_access_user_previous_user.icon deleted file mode 100644 index e160fcf..0000000 --- a/ash/resources/vector_icons/switch_access_user_previous_user.icon +++ /dev/null
@@ -1,31 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 21, 3, -H_LINE_TO, 3, -R_CUBIC_TO, -1.11f, 0, -2, 0.89f, -2, 2, -R_V_LINE_TO, 12, -R_CUBIC_TO, 0, 1.1f, 0.89f, 2, 2, 2, -R_H_LINE_TO, 5, -R_V_LINE_TO, 2, -R_H_LINE_TO, 8, -R_V_LINE_TO, -2, -R_H_LINE_TO, 5, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 5, -R_CUBIC_TO, 0, -1.11f, -0.9f, -2, -2, -2, -CLOSE, -R_MOVE_TO, 0, 14, -H_LINE_TO, 3, -V_LINE_TO, 5, -R_H_LINE_TO, 18, -R_V_LINE_TO, 12, -CLOSE, -R_MOVE_TO, -5, -7, -R_V_LINE_TO, 2, -H_LINE_TO, 8, -R_V_LINE_TO, -2, -R_H_LINE_TO, 8, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_user_sign_out.icon b/ash/resources/vector_icons/switch_access_user_sign_out.icon deleted file mode 100644 index 3d201b2..0000000 --- a/ash/resources/vector_icons/switch_access_user_sign_out.icon +++ /dev/null
@@ -1,28 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 17, 8, -R_LINE_TO, -1.41f, 1.41f, -LINE_TO, 17.17f, 11, -H_LINE_TO, 9, -R_V_LINE_TO, 2, -R_H_LINE_TO, 8.17f, -R_LINE_TO, -1.58f, 1.58f, -LINE_TO, 17, 16, -R_LINE_TO, 4, -4, -LINE_TO, 17, 8, -CLOSE, -MOVE_TO, 5, 5, -R_H_LINE_TO, 7, -V_LINE_TO, 3, -H_LINE_TO, 5, -CUBIC_TO, 3.9f, 3, 3, 3.9f, 3, 5, -R_V_LINE_TO, 14, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -R_H_LINE_TO, 7, -R_V_LINE_TO, -2, -H_LINE_TO, 5, -V_LINE_TO, 5, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_bookmark.icon b/ash/resources/vector_icons/switch_access_web_bookmark.icon deleted file mode 100644 index 553affe5..0000000 --- a/ash/resources/vector_icons/switch_access_web_bookmark.icon +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 22, 9.24f, -R_LINE_TO, -7.19f, -0.62f, -LINE_TO, 12, 2, -LINE_TO, 9.19f, 8.63f, -LINE_TO, 2, 9.24f, -R_LINE_TO, 5.46f, 4.73f, -LINE_TO, 5.82f, 21, -LINE_TO, 12, 17.27f, -LINE_TO, 18.18f, 21, -R_LINE_TO, -1.63f, -7.03f, -LINE_TO, 22, 9.24f, -CLOSE, -MOVE_TO, 12, 15.4f, -R_LINE_TO, -3.76f, 2.27f, -R_LINE_TO, 1, -4.28f, -R_LINE_TO, -3.32f, -2.88f, -R_LINE_TO, 4.38f, -0.38f, -LINE_TO, 12, 6.1f, -R_LINE_TO, 1.71f, 4.04f, -R_LINE_TO, 4.38f, 0.38f, -R_LINE_TO, -3.32f, 2.88f, -R_LINE_TO, 1, 4.28f, -LINE_TO, 12, 15.4f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_bottom_of_page.icon b/ash/resources/vector_icons/switch_access_web_bottom_of_page.icon deleted file mode 100644 index 890f21c0..0000000 --- a/ash/resources/vector_icons/switch_access_web_bottom_of_page.icon +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 16, 13, -R_H_LINE_TO, -3, -V_LINE_TO, 3, -R_H_LINE_TO, -2, -R_V_LINE_TO, 10, -H_LINE_TO, 8, -R_LINE_TO, 4, 4, -R_LINE_TO, 4, -4, -CLOSE, -MOVE_TO, 4, 19, -R_V_LINE_TO, 2, -R_H_LINE_TO, 16, -R_V_LINE_TO, -2, -H_LINE_TO, 4, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_clear_history.icon b/ash/resources/vector_icons/switch_access_web_clear_history.icon deleted file mode 100644 index 4689aed..0000000 --- a/ash/resources/vector_icons/switch_access_web_clear_history.icon +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 21, -MOVE_TO, 2.5f, 4.01f, -V_LINE_TO, 2, -H_LINE_TO, 0.5f, -V_LINE_TO, 8, -H_LINE_TO, 6.5f, -V_LINE_TO, 6, -H_LINE_TO, 3.59f, -CUBIC_TO, 4.97f, 3.61f, 7.54f, 2, 10.5f, 2, -CUBIC_TO, 14.92f, 2, 18.5f, 5.58f, 18.5f, 10, -CUBIC_TO, 18.5f, 14.42f, 14.92f, 18, 10.5f, 18, -CUBIC_TO, 6.08f, 18, 2.5f, 14.42f, 2.5f, 10, -H_LINE_TO, 0.5f, -CUBIC_TO, 0.5f, 15.52f, 4.98f, 20, 10.51f, 20, -CUBIC_TO, 16.03f, 20, 20.5f, 15.52f, 20.5f, 10, -CUBIC_TO, 20.5f, 4.48f, 16.03f, 0, 10.51f, 0, -CUBIC_TO, 7.23f, 0, 4.33f, 1.58f, 2.5f, 4.01f, -CLOSE, -MOVE_TO, 11.5f, 4, -V_LINE_TO, 10, -LINE_TO, 15.73f, 12.94f, -LINE_TO, 14.47f, 14.49f, -LINE_TO, 9.5f, 11, -V_LINE_TO, 4, -H_LINE_TO, 11.5f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_downloads.icon b/ash/resources/vector_icons/switch_access_web_downloads.icon deleted file mode 100644 index 15a040e..0000000 --- a/ash/resources/vector_icons/switch_access_web_downloads.icon +++ /dev/null
@@ -1,28 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 19, 9, -R_H_LINE_TO, -4, -V_LINE_TO, 3, -H_LINE_TO, 9, -R_V_LINE_TO, 6, -H_LINE_TO, 5, -R_LINE_TO, 7, 7, -R_LINE_TO, 7, -7, -CLOSE, -R_MOVE_TO, -8, 2, -V_LINE_TO, 5, -R_H_LINE_TO, 2, -R_V_LINE_TO, 6, -R_H_LINE_TO, 1.17f, -LINE_TO, 12, 13.17f, -LINE_TO, 9.83f, 11, -H_LINE_TO, 11, -CLOSE, -R_MOVE_TO, -6, 7, -R_H_LINE_TO, 14, -R_V_LINE_TO, 2, -H_LINE_TO, 5, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_find_in_page.icon b/ash/resources/vector_icons/switch_access_web_find_in_page.icon deleted file mode 100644 index ac8495739..0000000 --- a/ash/resources/vector_icons/switch_access_web_find_in_page.icon +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 14, 2, -H_LINE_TO, 6, -R_CUBIC_TO, -1.1f, 0, -1.99f, 0.9f, -1.99f, 2, -LINE_TO, 4, 20, -R_CUBIC_TO, 0, 1.1f, 0.89f, 2, 1.99f, 2, -H_LINE_TO, 18, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -V_LINE_TO, 8, -R_LINE_TO, -6, -6, -CLOSE, -MOVE_TO, 6, 4, -R_H_LINE_TO, 7, -R_LINE_TO, 5, 5, -R_V_LINE_TO, 8.58f, -R_LINE_TO, -1.84f, -1.84f, -R_CUBIC_TO, 1.28f, -1.94f, 1.07f, -4.57f, -0.64f, -6.28f, -CUBIC_TO, 14.55f, 8.49f, 13.28f, 8, 12, 8, -R_CUBIC_TO, -1.28f, 0, -2.55f, 0.49f, -3.53f, 1.46f, -R_CUBIC_TO, -1.95f, 1.95f, -1.95f, 5.11f, 0, 7.05f, -R_CUBIC_TO, 0.97f, 0.97f, 2.25f, 1.46f, 3.53f, 1.46f, -R_CUBIC_TO, 0.96f, 0, 1.92f, -0.28f, 2.75f, -0.83f, -LINE_TO, 17.6f, 20, -H_LINE_TO, 6, -V_LINE_TO, 4, -CLOSE, -R_MOVE_TO, 8.11f, 11.1f, -R_CUBIC_TO, -0.56f, 0.56f, -1.31f, 0.88f, -2.11f, 0.88f, -R_CUBIC_TO, -0.8f, 0, -1.55f, -0.31f, -2.11f, -0.88f, -R_CUBIC_TO, -0.56f, -0.56f, -0.88f, -1.31f, -0.88f, -2.11f, -R_CUBIC_TO, 0, -0.8f, 0.31f, -1.55f, 0.88f, -2.11f, -R_CUBIC_TO, 0.56f, -0.57f, 1.31f, -0.88f, 2.11f, -0.88f, -R_CUBIC_TO, 0.8f, 0, 1.55f, 0.31f, 2.11f, 0.88f, -R_CUBIC_TO, 0.56f, 0.56f, 0.88f, 1.31f, 0.88f, 2.11f, -R_CUBIC_TO, 0, 0.8f, -0.31f, 1.55f, -0.88f, 2.11f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_menu.icon b/ash/resources/vector_icons/switch_access_web_menu.icon deleted file mode 100644 index 9dc9063..0000000 --- a/ash/resources/vector_icons/switch_access_web_menu.icon +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 12, 2, -CUBIC_TO, 6.48f, 2, 2, 6.48f, 2, 12, -R_CUBIC_TO, 0, 5.52f, 4.48f, 10, 10, 10, -R_CUBIC_TO, 5.52f, 0, 10, -4.48f, 10, -10, -CUBIC_TO_SHORTHAND, 17.52f, 2, 12, 2, -CLOSE, -MOVE_TO, 4, 12, -R_CUBIC_TO, 0, -0.61f, 0.08f, -1.21f, 0.21f, -1.78f, -LINE_TO, 8.99f, 15, -R_V_LINE_TO, 1, -R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, -R_V_LINE_TO, 1.93f, -CUBIC_TO, 7.06f, 19.43f, 4, 16.07f, 4, 12, -CLOSE, -R_MOVE_TO, 13.89f, 5.4f, -R_CUBIC_TO, -0.26f, -0.81f, -1, -1.4f, -1.9f, -1.4f, -R_H_LINE_TO, -1, -R_V_LINE_TO, -3, -R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, -R_H_LINE_TO, -6, -R_V_LINE_TO, -2, -R_H_LINE_TO, 2, -R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, -V_LINE_TO, 7, -R_H_LINE_TO, 2, -R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, -R_V_LINE_TO, -0.41f, -CUBIC_TO, 17.92f, 5.77f, 20, 8.65f, 20, 12, -R_CUBIC_TO, 0, 2.08f, -0.81f, 3.98f, -2.11f, 5.4f, -CLOSE \ No newline at end of file
diff --git a/ash/resources/vector_icons/switch_access_web_top_of_page.icon b/ash/resources/vector_icons/switch_access_web_top_of_page.icon deleted file mode 100644 index 8b27a683..0000000 --- a/ash/resources/vector_icons/switch_access_web_top_of_page.icon +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 24, -MOVE_TO, 8, 11, -R_H_LINE_TO, 3, -R_V_LINE_TO, 10, -R_H_LINE_TO, 2, -V_LINE_TO, 11, -R_H_LINE_TO, 3, -R_LINE_TO, -4, -4, -R_LINE_TO, -4, 4, -CLOSE, -MOVE_TO, 4, 3, -R_V_LINE_TO, 2, -R_H_LINE_TO, 16, -V_LINE_TO, 3, -H_LINE_TO, 4, -CLOSE \ No newline at end of file
diff --git a/ash/rgb_keyboard/OWNERS b/ash/rgb_keyboard/OWNERS new file mode 100644 index 0000000..3ee2c4df --- /dev/null +++ b/ash/rgb_keyboard/OWNERS
@@ -0,0 +1,3 @@ +jimmyxgong@chromium.org +michaelcheco@google.com +zentaro@chromium.org \ No newline at end of file
diff --git a/ash/rgb_keyboard/rgb_keyboard_manager.cc b/ash/rgb_keyboard/rgb_keyboard_manager.cc new file mode 100644 index 0000000..d77e902 --- /dev/null +++ b/ash/rgb_keyboard/rgb_keyboard_manager.cc
@@ -0,0 +1,38 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/rgb_keyboard/rgb_keyboard_manager.h" + +#include "base/check.h" +#include "base/check_op.h" + +namespace ash { + +namespace { + +RgbKeyboardManager* g_instance = nullptr; + +} // namespace + +RgbKeyboardManager::RgbKeyboardManager() { + DCHECK(!g_instance); + g_instance = this; +} + +RgbKeyboardManager::~RgbKeyboardManager() { + DCHECK_EQ(g_instance, this); + g_instance = nullptr; +} + +// TODO(jimmyxgong): This is a stub implementation, replace with real impl. +RgbKeyboardCapabilities RgbKeyboardManager::GetRgbKeyboardCapabilities() const { + return RgbKeyboardCapabilities::kNone; +} + +// static +RgbKeyboardManager* RgbKeyboardManager::Get() { + return g_instance; +} + +} // namespace ash
diff --git a/ash/rgb_keyboard/rgb_keyboard_manager.h b/ash/rgb_keyboard/rgb_keyboard_manager.h new file mode 100644 index 0000000..fbdf9ff --- /dev/null +++ b/ash/rgb_keyboard/rgb_keyboard_manager.h
@@ -0,0 +1,39 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_RGB_KEYBOARD_RGB_KEYBOARD_MANAGER_H_ +#define ASH_RGB_KEYBOARD_RGB_KEYBOARD_MANAGER_H_ + +#include "ash/ash_export.h" + +namespace ash { + +// TODO(jimmyxgong): Determine if this enum can be rolled from Dbus constants. +enum class RgbKeyboardCapabilities { + kNone, + kFiveZone, + kIndividualKey, +}; + +// RgbKeyboardManager is singleton class that provides clients access to +// RGB keyboard-related API's. Clients should interact with this class instead +// of the rgbkbd DBus client. +// This class is owned by ash/shell and should NOT be created by any other +// means. +class ASH_EXPORT RgbKeyboardManager { + public: + RgbKeyboardManager(); + RgbKeyboardManager(const RgbKeyboardManager&) = delete; + RgbKeyboardManager& operator=(const RgbKeyboardManager&) = delete; + ~RgbKeyboardManager(); + + RgbKeyboardCapabilities GetRgbKeyboardCapabilities() const; + + // Returns the global instance if initialized. May return null. + static RgbKeyboardManager* Get(); +}; + +} // namespace ash + +#endif // ASH_RGB_KEYBOARD_RGB_KEYBOARD_MANAGER_H_ \ No newline at end of file
diff --git a/ash/rgb_keyboard/rgb_keyboard_manager_unittest.cc b/ash/rgb_keyboard/rgb_keyboard_manager_unittest.cc new file mode 100644 index 0000000..b099954 --- /dev/null +++ b/ash/rgb_keyboard/rgb_keyboard_manager_unittest.cc
@@ -0,0 +1,39 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/rgb_keyboard/rgb_keyboard_manager.h" + +#include <memory> + +#include "base/test/scoped_feature_list.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/ui_base_features.h" + +namespace ash { + +class RgbKeyboardManagerTest : public testing::Test { + public: + RgbKeyboardManagerTest() { + scoped_feature_list_.InitAndEnableFeature(::features::kRgbKeyboard); + + manager_ = std::make_unique<RgbKeyboardManager>(); + } + + RgbKeyboardManagerTest(const RgbKeyboardManagerTest&) = delete; + RgbKeyboardManagerTest& operator=(const RgbKeyboardManagerTest&) = delete; + ~RgbKeyboardManagerTest() override = default; + + protected: + std::unique_ptr<RgbKeyboardManager> manager_; + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +TEST_F(RgbKeyboardManagerTest, GetKeyboardCapabilities) { + EXPECT_EQ(manager_->GetRgbKeyboardCapabilities(), + RgbKeyboardCapabilities::kNone); +} + +} // namespace ash \ No newline at end of file
diff --git a/ash/session/fullscreen_notification_bubble.cc b/ash/session/fullscreen_notification_bubble.cc index c072c2e1..3809c8ff 100644 --- a/ash/session/fullscreen_notification_bubble.cc +++ b/ash/session/fullscreen_notification_bubble.cc
@@ -13,6 +13,7 @@ #include "base/location.h" #include "base/scoped_observation.h" #include "base/time/time.h" +#include "base/timer/timer.h" #include "components/fullscreen_control/subtle_notification_view.h" #include "components/strings/grit/components_strings.h" #include "ui/aura/window.h"
diff --git a/ash/shelf/login_shelf_view.cc b/ash/shelf/login_shelf_view.cc index b401b41..c5570708 100644 --- a/ash/shelf/login_shelf_view.cc +++ b/ash/shelf/login_shelf_view.cc
@@ -16,6 +16,8 @@ #include "ash/lock_screen_action/lock_screen_action_background_state.h" #include "ash/login/login_screen_controller.h" #include "ash/login/ui/lock_screen.h" +#include "ash/metrics/login_metrics_recorder.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/login_accelerators.h" #include "ash/public/cpp/shelf_config.h" #include "ash/resources/vector_icons/vector_icons.h"
diff --git a/ash/shelf/shelf_button_pressed_metric_tracker.cc b/ash/shelf/shelf_button_pressed_metric_tracker.cc index 56c1afc..f74fcd94 100644 --- a/ash/shelf/shelf_button_pressed_metric_tracker.cc +++ b/ash/shelf/shelf_button_pressed_metric_tracker.cc
@@ -65,16 +65,17 @@ case SHELF_ACTION_APP_LIST_BACK: break; case SHELF_ACTION_NEW_WINDOW_CREATED: - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_LAUNCHER_LAUNCH_TASK); + base::RecordAction(base::UserMetricsAction("Launcher_LaunchTask")); + Shell::Get()->metrics()->task_switch_metrics_recorder().OnTaskSwitch( + TaskSwitchSource::SHELF); break; case SHELF_ACTION_WINDOW_ACTIVATED: - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_LAUNCHER_SWITCH_TASK); + base::RecordAction(base::UserMetricsAction("Launcher_SwitchTask")); + Shell::Get()->metrics()->task_switch_metrics_recorder().OnTaskSwitch( + TaskSwitchSource::SHELF); break; case SHELF_ACTION_WINDOW_MINIMIZED: - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_LAUNCHER_MINIMIZE_TASK); + base::RecordAction(base::UserMetricsAction("Launcher_MinimizeTask")); break; } }
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc index 7748591..9f491d7 100644 --- a/ash/shelf/shelf_widget.cc +++ b/ash/shelf/shelf_widget.cc
@@ -104,11 +104,15 @@ void SetBackgroundColor(SkColor color) { background_color_ = color; - layer_->SchedulePaint(layer_->bounds()); + layer_->SchedulePaint(gfx::Rect(layer_->size())); } void SetBorderType(HighlightBorder::Type type) { highlight_border_type_ = type; - layer_->SchedulePaint(layer_->bounds()); + layer_->SchedulePaint(gfx::Rect(layer_->size())); + } + void SetRoundedCornerRadius(int corner_radius) { + corner_radius_ = corner_radius; + layer_->SchedulePaint(gfx::Rect(layer_->size())); } void SetLoginShelfView(LoginShelfView* view) { login_shelf_view_ = view; } @@ -118,23 +122,19 @@ ui::PaintRecorder recorder(context, layer_->size()); gfx::Canvas* canvas = recorder.canvas(); - // Refer to the upper left corner radius of the shelf background layer to - // draw the border. - const int corner_radius = layer_->rounded_corner_radii().upper_left(); - // cc::PaintFlags flags for the background. cc::PaintFlags flags; flags.setColor(background_color_); flags.setAntiAlias(true); flags.setStyle(cc::PaintFlags::kFill_Style); - canvas->DrawRoundRect(gfx::Rect(layer_->size()), corner_radius, flags); + canvas->DrawRoundRect(gfx::Rect(layer_->size()), corner_radius_, flags); // Don't draw highlight border in login screen. if (login_shelf_view_ && login_shelf_view_->GetVisible()) return; HighlightBorder::PaintBorderToCanvas(canvas, gfx::Rect(layer_->size()), - corner_radius, highlight_border_type_, + corner_radius_, highlight_border_type_, false); } @@ -146,6 +146,7 @@ ui::Layer* const layer_; LoginShelfView* login_shelf_view_ = nullptr; SkColor background_color_; + int corner_radius_ = 0; HighlightBorder::Type highlight_border_type_ = HighlightBorder::Type::kHighlightBorder1; }; @@ -426,6 +427,8 @@ background_type == ShelfBackgroundType::kInApp || (tablet_mode && in_app)) { opaque_background()->SetRoundedCornerRadius({0, 0, 0, 0}); + if (background_delegate_) + background_delegate_->SetRoundedCornerRadius(0); } else { opaque_background()->SetRoundedCornerRadius({ shelf->SelectValueForShelfAlignment(radius, 0.0f, radius), @@ -433,6 +436,8 @@ shelf->SelectValueForShelfAlignment(0.0f, radius, 0.0f), shelf->SelectValueForShelfAlignment(0.0f, 0.0f, radius), }); + if (background_delegate_) + background_delegate_->SetRoundedCornerRadius(radius); } opaque_background()->SetBounds(opaque_background_bounds);
diff --git a/ash/shell.cc b/ash/shell.cc index 7ebc967..3eec302f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -77,6 +77,7 @@ #include "ash/marker/marker_controller.h" #include "ash/media/media_controller_impl.h" #include "ash/metrics/login_unlock_throughput_recorder.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/multi_device_setup/multi_device_notification_presenter.h" #include "ash/policy/policy_recommendation_restorer.h" #include "ash/projector/projector_controller_impl.h" @@ -90,6 +91,7 @@ #include "ash/public/cpp/tab_cluster/tab_cluster_ui_controller.h" #include "ash/public/cpp/views_text_services_context_menu_impl.h" #include "ash/quick_pair/keyed_service/quick_pair_mediator.h" +#include "ash/rgb_keyboard/rgb_keyboard_manager.h" #include "ash/root_window_controller.h" #include "ash/session/session_controller_impl.h" #include "ash/shelf/contextual_tooltip.h" @@ -919,6 +921,8 @@ usb_peripheral_notification_controller_.reset(); + rgb_keyboard_manager_.reset(); + message_center_ash_impl_.reset(); // Destroys the MessageCenter singleton, so must happen late. @@ -996,6 +1000,10 @@ tablet_mode_controller_ = std::make_unique<TabletModeController>(); + if (::features::IsRgbKeyboardEnabled()) { + rgb_keyboard_manager_ = std::make_unique<RgbKeyboardManager>(); + } + // Observes the tablet mode controller and adds a notification to the message // center, so must be constructed after both. if (features::IsSnoopingProtectionEnabled()) {
diff --git a/ash/shell.h b/ash/shell.h index 4fa6c2d..bfad360 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -11,7 +11,6 @@ #include "ash/ash_export.h" #include "ash/constants/ash_features.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/session/session_observer.h" #include "ash/public/cpp/shelf_types.h" #include "ash/wm/system_modal_container_event_filter_delegate.h" @@ -178,6 +177,7 @@ class PrivacyScreenController; class ProjectingObserver; class ProjectorControllerImpl; +class RgbKeyboardManager; class ResizeShadowController; class ResolutionNotificationController; class RootWindowController; @@ -207,6 +207,7 @@ class TouchDevicesController; class TrayAction; class TrayBluetoothHelper; +class UserMetricsRecorder; class VideoActivityNotifier; class VideoDetector; class WallpaperControllerImpl; @@ -796,6 +797,7 @@ usb_peripheral_notification_controller_; std::unique_ptr<PersistentDesksBarController> persistent_desks_bar_controller_; + std::unique_ptr<RgbKeyboardManager> rgb_keyboard_manager_; std::unique_ptr<ResizeShadowController> resize_shadow_controller_; std::unique_ptr<SessionControllerImpl> session_controller_; std::unique_ptr<AshColorProvider> ash_color_provider_;
diff --git a/ash/system/accessibility/switch_access/switch_access_menu_view.cc b/ash/system/accessibility/switch_access/switch_access_menu_view.cc index 16b934c..5c053180 100644 --- a/ash/system/accessibility/switch_access/switch_access_menu_view.cc +++ b/ash/system/accessibility/switch_access/switch_access_menu_view.cc
@@ -14,7 +14,6 @@ #include "base/containers/flat_map.h" #include "base/no_destructor.h" #include "ui/accessibility/accessibility_features.h" -#include "ui/accessibility/accessibility_switches.h" #include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/mojom/ax_node_data.mojom-shared.h" #include "ui/events/event.h" @@ -37,7 +36,7 @@ menu_button_details({}); if (menu_button_details->empty()) { - base::flat_map<std::string, ButtonInfo> base_menu_button_details( + base::flat_map<std::string, ButtonInfo> kBaseMenuButtonDetails( {{"copy", {&kSwitchAccessCopyIcon, IDS_ASH_SWITCH_ACCESS_COPY}}, {"cut", {&kSwitchAccessCutIcon, IDS_ASH_SWITCH_ACCESS_CUT}}, {"decrement", @@ -101,129 +100,7 @@ {"rightClick", {&kSwitchAccessRightClickIcon, IDS_ASH_SWITCH_ACCESS_RIGHT_CLICK}}}); - if (switches::IsSwitchAccessMultistepAutomationEnabled()) { - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "shortcuts", - {&kSwitchAccessQuickCommandsIcon, IDS_ASH_SWITCH_ACCESS_SHORTCUTS})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "leaveGroup", - {&kSwitchAccessLeaveGroupIcon, IDS_ASH_SWITCH_ACCESS_LEAVE_GROUP})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webMenu", - {&kSwitchAccessWebMenuIcon, IDS_ASH_SWITCH_ACCESS_WEB_MENU})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webBookmark", - {&kSwitchAccessWebBookmarkIcon, IDS_ASH_SWITCH_ACCESS_WEB_BOOKMARK})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webBottomOfPage", {&kSwitchAccessWebBottomOfPageIcon, - IDS_ASH_SWITCH_ACCESS_WEB_BOTTOM_OF_PAGE})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webTopOfPage", {&kSwitchAccessWebTopOfPageIcon, - IDS_ASH_SWITCH_ACCESS_WEB_TOP_OF_PAGE})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webFindInPage", {&kSwitchAccessWebFindInPageIcon, - IDS_ASH_SWITCH_ACCESS_WEB_FIND_IN_PAGE})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webDownloads", {&kSwitchAccessWebDownloadsIcon, - IDS_ASH_SWITCH_ACCESS_WEB_DOWNLOADS})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "webClearHistory", {&kSwitchAccessWebClearHistoryIcon, - IDS_ASH_SWITCH_ACCESS_WEB_CLEAR_HISTORY})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemMenu", - {&kSwitchAccessSystemMenuIcon, IDS_ASH_SWITCH_ACCESS_SYSTEM_MENU})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemStatusBar", {&kSwitchAccessSystemStatusBarIcon, - IDS_ASH_SWITCH_ACCESS_SYSTEM_STATUS_BAR})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemLauncher", {&kSwitchAccessSystemLauncherIcon, - IDS_ASH_SWITCH_ACCESS_SYSTEM_LAUNCHER})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemTaskManager", {&kSwitchAccessSystemTaskManagerIcon, - IDS_ASH_SWITCH_ACCESS_SYSTEM_TASK_MANAGER})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemDiagnostics", {&kSwitchAccessSystemDiagnosticsIcon, - IDS_ASH_SWITCH_ACCESS_SYSTEM_DIAGNOSTICS})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemScreenshot", {&kSwitchAccessSystemScreenshotIcon, - IDS_ASH_SWITCH_ACCESS_SYSTEM_SCREENSHOT})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "systemHelp", - {&kSwitchAccessSystemHelpIcon, IDS_ASH_SWITCH_ACCESS_SYSTEM_HELP})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaMenu", - {&kSwitchAccessMediaMenuIcon, IDS_ASH_SWITCH_ACCESS_MEDIA_MENU})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaMute", - {&kSwitchAccessMediaMuteIcon, IDS_ASH_SWITCH_ACCESS_MEDIA_MUTE})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaVolumeDown", {&kSwitchAccessMediaVolumeDownIcon, - IDS_ASH_SWITCH_ACCESS_MEDIA_VOLUME_DOWN})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaVolumeUp", {&kSwitchAccessMediaVolumeUpIcon, - IDS_ASH_SWITCH_ACCESS_MEDIA_VOLUME_UP})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaRewind", - {&kSwitchAccessMediaRewindIcon, IDS_ASH_SWITCH_ACCESS_MEDIA_REWIND})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaPlayPause", {&kSwitchAccessMediaPlayPauseIcon, - IDS_ASH_SWITCH_ACCESS_MEDIA_PLAY_PAUSE})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "mediaFastforward", {&kSwitchAccessMediaFastforwardIcon, - IDS_ASH_SWITCH_ACCESS_MEDIA_FASTFORWARD})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayMenu", - {&kSwitchAccessDisplayMenuIcon, IDS_ASH_SWITCH_ACCESS_DISPLAY_MENU})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayMirror", {&kSwitchAccessDisplayMirrorIcon, - IDS_ASH_SWITCH_ACCESS_DISPLAY_MIRROR})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayBrightnessDown", - {&kSwitchAccessDisplayBrightnessDownIcon, - IDS_ASH_SWITCH_ACCESS_DISPLAY_BRIGHTNESS_DOWN})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayBrightnessUp", - {&kSwitchAccessDisplayBrightnessUpIcon, - IDS_ASH_SWITCH_ACCESS_DISPLAY_BRIGHTNESS_UP})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayRotate", {&kSwitchAccessDisplayRotateIcon, - IDS_ASH_SWITCH_ACCESS_DISPLAY_ROTATE})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayZoomOut", {&kSwitchAccessDisplayZoomOutIcon, - IDS_ASH_SWITCH_ACCESS_DISPLAY_ZOOM_OUT})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "displayZoomIn", {&kSwitchAccessDisplayZoomInIcon, - IDS_ASH_SWITCH_ACCESS_DISPLAY_ZOOM_IN})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "userMenu", - {&kSwitchAccessUserMenuIcon, IDS_ASH_SWITCH_ACCESS_USER_MENU})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "userLock", - {&kSwitchAccessUserLockIcon, IDS_ASH_SWITCH_ACCESS_USER_LOCK})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "userPreviousUser", {&kSwitchAccessUserPreviousUserIcon, - IDS_ASH_SWITCH_ACCESS_USER_PREVIOUS_USER})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "userNextUser", {&kSwitchAccessUserNextUserIcon, - IDS_ASH_SWITCH_ACCESS_USER_NEXT_USER})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "userSignOut", {&kSwitchAccessUserSignOutIcon, - IDS_ASH_SWITCH_ACCESS_USER_SIGN_OUT})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "actionRecorder", {&kSwitchAccessActionRecorderIcon, - IDS_ASH_SWITCH_ACCESS_ACTION_RECORDER})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "startRecording", {&kSwitchAccessStartRecordingIcon, - IDS_ASH_SWITCH_ACCESS_START_RECORDING})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "stopRecording", {&kSwitchAccessStopRecordingIcon, - IDS_ASH_SWITCH_ACCESS_STOP_RECORDING})); - base_menu_button_details.insert(std::pair<std::string, ButtonInfo>( - "executeMacro", {&kSwitchAccessExecuteMacroIcon, - IDS_ASH_SWITCH_ACCESS_EXECUTE_MACRO})); - } - - menu_button_details->swap(base_menu_button_details); + menu_button_details->swap(kBaseMenuButtonDetails); } return *menu_button_details; }
diff --git a/ash/system/audio/unified_volume_slider_controller.cc b/ash/system/audio/unified_volume_slider_controller.cc index 9bc27d21..674cc7d 100644 --- a/ash/system/audio/unified_volume_slider_controller.cc +++ b/ash/system/audio/unified_volume_slider_controller.cc
@@ -4,8 +4,6 @@ #include "ash/system/audio/unified_volume_slider_controller.h" -#include "ash/metrics/user_metrics_action.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/shell.h" #include "ash/system/audio/unified_volume_view.h" #include "ash/system/machine_learning/user_settings_event_logger.h" @@ -37,8 +35,8 @@ const int level = value * 100; if (level != CrasAudioHandler::Get()->GetOutputVolumePercent()) { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_CHANGED_VOLUME_MENU); + base::RecordAction( + base::UserMetricsAction("StatusArea_Volume_ChangedMenu")); } CrasAudioHandler::Get()->SetOutputVolumePercent(level);
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc index 7bd653a..91e2055 100644 --- a/ash/system/ime_menu/ime_menu_tray.cc +++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -9,6 +9,7 @@ #include "ash/keyboard/keyboard_controller_impl.h" #include "ash/keyboard/ui/keyboard_ui_controller.h" #include "ash/keyboard/virtual_keyboard_controller.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/system_tray_client.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/root_window_controller.h"
diff --git a/ash/system/network/network_section_header_view.cc b/ash/system/network/network_section_header_view.cc index b5bd53eb..ba88713d 100644 --- a/ash/system/network/network_section_header_view.cc +++ b/ash/system/network/network_section_header_view.cc
@@ -5,7 +5,6 @@ #include "ash/system/network/network_section_header_view.h" #include "ash/constants/ash_features.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/bluetooth_config_service.h" #include "ash/public/cpp/system_tray_client.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -18,6 +17,7 @@ #include "ash/system/network/tray_network_state_model.h" #include "ash/system/tray/tray_toggle_button.h" #include "base/bind.h" +#include "base/metrics/user_metrics.h" #include "chromeos/dbus/hermes/hermes_manager_client.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_util.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" @@ -504,8 +504,7 @@ } void WifiSectionHeaderView::JoinButtonPressed() { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED); + base::RecordAction(base::UserMetricsAction("StatusArea_Network_JoinOther")); Shell::Get()->system_tray_model()->client()->ShowNetworkCreate( ::onc::network_type::kWiFi); }
diff --git a/ash/system/network/network_state_list_detailed_view.cc b/ash/system/network/network_state_list_detailed_view.cc index 3a1075fe..bccf554 100644 --- a/ash/system/network/network_state_list_detailed_view.cc +++ b/ash/system/network/network_state_list_detailed_view.cc
@@ -6,7 +6,6 @@ #include <algorithm> -#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/system_tray_client.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" @@ -17,6 +16,7 @@ #include "ash/system/tray/system_menu_button.h" #include "ash/system/tray/tri_view.h" #include "base/bind.h" +#include "base/metrics/user_metrics.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" @@ -33,6 +33,11 @@ #include "ui/views/layout/layout_manager.h" #include "ui/views/widget/widget.h" +namespace ash { +namespace tray { +namespace { + +using base::UserMetricsAction; using chromeos::network_config::mojom::ActivationStateType; using chromeos::network_config::mojom::ConnectionStateType; using chromeos::network_config::mojom::DeviceStateProperties; @@ -41,10 +46,6 @@ using chromeos::network_config::mojom::NetworkStatePropertiesPtr; using chromeos::network_config::mojom::NetworkType; -namespace ash { -namespace tray { -namespace { - // Delay between scan requests. constexpr int kRequestScanDelaySeconds = 10; @@ -328,10 +329,10 @@ network->type == NetworkType::kCellular ? network->type_state->get_cellular()->eid : "")) { - Shell::Get()->metrics()->RecordUserMetricsAction( + base::RecordAction( list_type_ == LIST_TYPE_VPN - ? UMA_STATUS_AREA_CONNECT_TO_VPN - : UMA_STATUS_AREA_CONNECT_TO_CONFIGURED_NETWORK); + ? UserMetricsAction("StatusArea_VPN_ConnectToNetwork") + : UserMetricsAction("StatusArea_Network_ConnectConfigured")); LogUserNetworkEvent(*network.get()); chromeos::NetworkConnect::Get()->ConnectToNetworkId(network->guid); return; @@ -339,10 +340,10 @@ } // If the network is no longer available or not connectable or configurable, // show the Settings UI. - Shell::Get()->metrics()->RecordUserMetricsAction( + base::RecordAction( list_type_ == LIST_TYPE_VPN - ? UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS - : UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS); + ? UserMetricsAction("StatusArea_VPN_ConnectionDetails") + : UserMetricsAction("StatusArea_Network_ConnectionDetails")); Shell::Get()->system_tray_model()->client()->ShowNetworkSettings( network ? network->guid : std::string()); } @@ -369,10 +370,9 @@ } void NetworkStateListDetailedView::ShowSettings() { - Shell::Get()->metrics()->RecordUserMetricsAction( - list_type_ == LIST_TYPE_VPN ? UMA_STATUS_AREA_VPN_SETTINGS_OPENED - : UMA_STATUS_AREA_NETWORK_SETTINGS_OPENED); - + base::RecordAction(list_type_ == LIST_TYPE_VPN + ? UserMetricsAction("StatusArea_VPN_Settings") + : UserMetricsAction("StatusArea_Network_Settings")); const std::string guid = model_->default_network() ? model_->default_network()->guid : std::string();
diff --git a/ash/system/network/vpn_list_view.cc b/ash/system/network/vpn_list_view.cc index c5379d5..04bade76 100644 --- a/ash/system/network/vpn_list_view.cc +++ b/ash/system/network/vpn_list_view.cc
@@ -8,7 +8,6 @@ #include <vector> #include "ash/constants/ash_pref_names.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/system_tray_client.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" @@ -29,6 +28,7 @@ #include "ash/system/tray/view_click_listener.h" #include "ash/system/unified/unified_system_tray_view.h" #include "base/bind.h" +#include "base/metrics/user_metrics.h" #include "base/strings/utf_string_conversions.h" #include "chromeos/network/network_connect.h" #include "chromeos/services/network_config/public/cpp/cros_network_config_util.h" @@ -186,8 +186,8 @@ // If the user clicks on a provider entry, request that the "add network" // dialog for this provider be shown. if (vpn_provider_->type == VpnType::kExtension) { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_VPN_ADD_THIRD_PARTY_CLICKED); + base::RecordAction( + base::UserMetricsAction("StatusArea_VPN_AddThirdParty")); Shell::Get()->system_tray_model()->client()->ShowThirdPartyVpnCreate( vpn_provider_->app_id); } else if (vpn_provider_->type == VpnType::kArc) { @@ -195,8 +195,7 @@ Shell::Get()->system_tray_model()->client()->ShowArcVpnCreate( vpn_provider_->app_id); } else { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_VPN_ADD_BUILT_IN_CLICKED); + base::RecordAction(base::UserMetricsAction("StatusArea_VPN_AddBuiltIn")); Shell::Get()->system_tray_model()->client()->ShowNetworkCreate( ::onc::network_type::kVPN); }
diff --git a/ash/system/network/wifi_toggle_notification_controller.cc b/ash/system/network/wifi_toggle_notification_controller.cc index d6c89da..34ddb0c1 100644 --- a/ash/system/network/wifi_toggle_notification_controller.cc +++ b/ash/system/network/wifi_toggle_notification_controller.cc
@@ -10,6 +10,7 @@ #include "ash/system/network/network_icon.h" #include "ash/system/network/tray_network_state_model.h" #include "ash/system/tray/system_tray_notifier.h" +#include "base/metrics/user_metrics.h" #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" @@ -68,8 +69,9 @@ if (!wifi) return; bool enabled = wifi->device_state == DeviceStateType::kEnabled; - Shell::Get()->metrics()->RecordUserMetricsAction( - enabled ? UMA_STATUS_AREA_DISABLE_WIFI : UMA_STATUS_AREA_ENABLE_WIFI); + base::RecordAction( + enabled ? base::UserMetricsAction("StatusArea_Network_WifiDisabled") + : base::UserMetricsAction("StatusArea_Network_WifiEnabled")); model->SetNetworkTypeEnabledState(NetworkType::kWiFi, !enabled); // Create a new notification with the new state.
diff --git a/ash/system/screen_layout_observer.cc b/ash/system/screen_layout_observer.cc index e5bb4e1..a37c610b 100644 --- a/ash/system/screen_layout_observer.cc +++ b/ash/system/screen_layout_observer.cc
@@ -10,8 +10,6 @@ #include "ash/constants/ash_features.h" #include "ash/display/screen_orientation_controller.h" -#include "ash/metrics/user_metrics_action.h" -#include "ash/metrics/user_metrics_recorder.h" #include "ash/public/cpp/notification_utils.h" #include "ash/public/cpp/system_tray_client.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -22,6 +20,7 @@ #include "ash/system/tray/tray_constants.h" #include "base/bind.h" #include "base/containers/contains.h" +#include "base/metrics/user_metrics.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "ui/base/l10n/l10n_util.h" @@ -74,14 +73,14 @@ void OnNotificationClicked(absl::optional<int> button_index) { DCHECK(!button_index); - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SELECTED); + base::RecordAction( + base::UserMetricsAction("StatusArea_Display_Notification_Selected")); // Settings may be blocked, e.g. at the lock screen. if (Shell::Get()->session_controller()->ShouldEnableSettings() && Shell::Get()->system_tray_model()->client()) { Shell::Get()->system_tray_model()->client()->ShowDisplaySettings(); - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_DISPLAY_NOTIFICATION_SHOW_SETTINGS); + base::RecordAction(base::UserMetricsAction( + "StatusArea_Display_Notification_Show_Settings")); } message_center::MessageCenter::Get()->RemoveNotification( ScreenLayoutObserver::kNotificationId, /*by_user=*/true); @@ -375,8 +374,8 @@ message_center::SystemNotificationWarningLevel::NORMAL); notification->set_priority(message_center::SYSTEM_PRIORITY); - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CREATED); + base::RecordAction( + base::UserMetricsAction("StatusArea_Display_Notification_Created")); message_center::MessageCenter::Get()->AddNotification( std::move(notification)); }
diff --git a/ash/system/screen_security/screen_security_notification_controller.cc b/ash/system/screen_security/screen_security_notification_controller.cc index 2686d6e..07faf48 100644 --- a/ash/system/screen_security/screen_security_notification_controller.cc +++ b/ash/system/screen_security/screen_security_notification_controller.cc
@@ -10,6 +10,7 @@ #include "ash/strings/grit/ash_strings.h" #include "ash/system/tray/system_tray_notifier.h" #include "base/bind.h" +#include "base/metrics/user_metrics.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" @@ -65,14 +66,14 @@ if (*button_index == 0) { controller->StopAllSessions(is_capture); if (is_capture) { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_SCREEN_CAPTURE_NOTIFICATION_STOP); + base::RecordAction(base::UserMetricsAction( + "StatusArea_ScreenCapture_Notification_Stop")); } } else if (*button_index == 1) { controller->ChangeSource(); if (is_capture) { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_SCREEN_CAPTURE_CHANGE_SOURCE); + base::RecordAction(base::UserMetricsAction( + "StatusArea_ScreenCapture_Change_Source")); } } else { NOTREACHED();
diff --git a/ash/system/tracing_notification_controller.cc b/ash/system/tracing_notification_controller.cc index 5a5bfb3..ef15466 100644 --- a/ash/system/tracing_notification_controller.cc +++ b/ash/system/tracing_notification_controller.cc
@@ -11,6 +11,7 @@ #include "ash/strings/grit/ash_strings.h" #include "ash/system/model/system_tray_model.h" #include "base/bind.h" +#include "base/metrics/user_metrics.h" #include "ui/base/l10n/l10n_util.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" @@ -25,8 +26,8 @@ const char kNotifierId[] = "ash.tracing"; void HandleNotificationClick() { - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_TRACING_DEFAULT_SELECTED); + base::RecordAction( + base::UserMetricsAction("StatusArea_Tracing_Default_Selected")); Shell::Get()->system_tray_model()->client()->ShowChromeSlow(); }
diff --git a/ash/system/update/update_notification_controller.cc b/ash/system/update/update_notification_controller.cc index 9b95dc6e3..6e7963a 100644 --- a/ash/system/update/update_notification_controller.cc +++ b/ash/system/update/update_notification_controller.cc
@@ -17,6 +17,7 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/files/file_util.h" +#include "base/metrics/user_metrics.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "base/task/thread_pool.h" @@ -274,8 +275,8 @@ } // System updates require restarting the device. Shell::Get()->system_tray_model()->client()->RequestRestartForUpdate(); - Shell::Get()->metrics()->RecordUserMetricsAction( - UMA_STATUS_AREA_OS_UPDATE_DEFAULT_SELECTED); + base::RecordAction( + base::UserMetricsAction("StatusArea_OS_Update_Default_Selected")); } void UpdateNotificationController::RestartCancelled() {
diff --git a/ash/system/virtual_keyboard/virtual_keyboard_tray.cc b/ash/system/virtual_keyboard/virtual_keyboard_tray.cc index 34b4986..b278bf7 100644 --- a/ash/system/virtual_keyboard/virtual_keyboard_tray.cc +++ b/ash/system/virtual_keyboard/virtual_keyboard_tray.cc
@@ -8,6 +8,7 @@ #include "ash/accessibility/accessibility_controller_impl.h" #include "ash/keyboard/ui/keyboard_ui_controller.h" +#include "ash/metrics/user_metrics_recorder.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" #include "ash/shelf/shelf.h"
diff --git a/ash/webui/personalization_app/README.md b/ash/webui/personalization_app/README.md new file mode 100644 index 0000000..ea79185 --- /dev/null +++ b/ash/webui/personalization_app/README.md
@@ -0,0 +1,119 @@ +# ChromeOS Personalization Hub + +## Environment Setup +### VSCode + +- Follow https://chromium.googlesource.com/chromium/src/+/HEAD/docs/vscode.md +- Config `tsconfig.json`: + - Create or update `${PATH_TO_CHROMIUM}/src/ash/webui/personalization_app/resources/tsconfig.json` + ``` + { + "__comment__": [ + "This file is used by local typescript language server. It is manually", + "maintained to be close to the corresponding ts_library() target in BUILD.gn. ", + "Be sure to replace locally 'out/Debug' with your out dir if it", + "is different. Or change your out dir to 'out/Debug'." + ], + "extends": "./tsconfig_base.json", + "compilerOptions": { + "composite": true, + "rootDirs": [ + ".", + "../../../../out/Debug/gen/ash/webui/personalization_app/resources/preprocessed" + ], + "moduleResolution": "node", + "noEmit": true, + "paths": { + "/*": [ + "./*" + ], + "chrome://resources/*": [ + "../../../../out/Debug/gen/ui/webui/resources/preprocessed/*" + ], + "//resources/*": [ + "../../../../out/Debug/gen/ui/webui/resources/preprocessed/*" + ], + "chrome://resources/polymer/v3_0/*": [ + "../../../../third_party/polymer/v3_0/components-chromium/*" + ], + "//resources/polymer/v3_0/*": [ + "../../../../third_party/polymer/v3_0/components-chromium/*" + ], + "chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js": [ + "../../../../third_party/polymer/v3_0/components-chromium/polymer/polymer.d.ts" + ], + "//resources/polymer/v3_0/polymer/polymer_bundled.min.js": [ + "../../../../third_party/polymer/v3_0/components-chromium/polymer/polymer.d.ts" + ], + "/tools/typescript/definitions/*": [ + "../../../../tools/typescript/definitions/*" + ] + } + }, + "references": [ + { + "path": "../../../../out/${YOUR_BUILD}/gen/third_party/polymer/v3_0/tsconfig.json" + }, + { + "path": "../../../../out/${YOUR_BUILD}/gen/ui/webui/resources/tsconfig.json" + }, + { + "path": "../../../../out/${YOUR_BUILD}/gen/ui/webui/resources/mojo/tsconfig.json" + } + ] + } + ``` + - Create or update `${PATH_TO_CHROMIUM}/src/chrome/test/data/webui/chromeos/personalization_app/tsconfig.json` + ``` + { + "extends": "./tsconfig_base.json", + "compilerOptions": { + "rootDirs": [ + ".", + "../../../../../../out/Debug/gen/chrome/test/data/webui/chromeos/personalization_app" + ], + "paths": { + "chrome://resources/*": [ + "../../../../../../out/Debug/gen/ui/webui/resources/preprocessed/*" + ], + "//resources/*": [ + "../../../../../../out/Debug/gen/ui/webui/resources/preprocessed/*" + ], + "chrome://resources/polymer/v3_0/*": [ + "../../../../../../third_party/polymer/v3_0/components-chromium/*" + ], + "//resources/polymer/v3_0/*": [ + "../../../../../../third_party/polymer/v3_0/components-chromium/*" + ], + "chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js": [ + "../../../../../../third_party/polymer/v3_0/components-chromium/polymer/polymer.d.ts" + ], + "//resources/polymer/v3_0/polymer/polymer_bundled.min.js": [ + "../../../../../../third_party/polymer/v3_0/components-chromium/polymer/polymer.d.ts" + ], + "/tools/typescript/definitions/*": [ + "../../../../../../tools/typescript/definitions/*" + ], + "chrome://personalization/*": [ + "../../../../../../out/Debug/gen/ash/webui/personalization_app/resources/tsc/*" + ], + "chrome://webui-test/*": [ + "../../../../../../out/Debug/gen/chrome/test/data/webui/tsc/*" + ] + } + }, + "include": [ + "*.ts" + ], + "references": [ + { + "path": "../../../../../../ash/webui/personalization_app/resources/tsconfig.json" + } + ] + } + ``` + - Edit `${PATH_TO_CHROMIUM}/src/.git/info/exclude` and add these lines + ``` + /ash/webui/personalization_app/resources/tsconfig.json + /chrome/test/data/webui/chromeos/personalization_app/tsconfig.json + ```
diff --git a/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.html b/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.html index d0ad231..e20adc44 100644 --- a/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.html +++ b/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.html
@@ -31,9 +31,12 @@ } :host([main-page]) #imageContainer { + display: flex; + height: 100%; justify-self: center; max-width: 360px; min-width: 252px; + width: 100%; } ::slotted(div[id='ambientLabel']) { @@ -84,6 +87,13 @@ #collageContainer { grid-template-columns: repeat(2, minmax(0,1fr)); + grid-template-rows: repeat(2, minmax(0,1fr)); + } + + #collageContainer.collage-1 .collage-item:first-child, + #collageContainer.collage-2 .collage-item:first-child, + #collageContainer.collage-2 .collage-item:nth-child(2) { + grid-row: 1 / 3; } #collageContainer.collage-1 .collage-item:first-child, @@ -96,22 +106,6 @@ object-fit: cover; width: 100%; } - - .collage-item:first-child { - border-top-left-radius: 12px; - } - - .collage-item:nth-child(2) { - border-top-right-radius: 12px; - } - - .collage-item:nth-child(3) { - border-bottom-left-radius: 12px; - } - - .collage-item:nth-child(4) { - border-bottom-right-radius: 12px; - } </style> <div class="preview-container" id="container"> <slot></slot>
diff --git a/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.ts b/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.ts index 3dfb531..4e214842 100644 --- a/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.ts +++ b/ash/webui/personalization_app/resources/trusted/ambient/ambient_preview_element.ts
@@ -16,7 +16,7 @@ import {isNonEmptyArray} from '../../common/utils.js'; import {AmbientModeAlbum, TopicSource} from '../personalization_app.mojom-webui.js'; import {WithPersonalizationStore} from '../personalization_store.js'; -import {getPhotoCount, getTopicSourceName} from '../utils.js'; +import {getPhotoCount, getTopicSourceName, replaceResolutionSuffix} from '../utils.js'; import {AmbientObserver} from './ambient_observer.js'; @@ -94,7 +94,12 @@ } private getPreviewImage_(album: AmbientModeAlbum|null): string { - return album && album.url ? album.url.url : ''; + // Replace the resolution suffix appended at the end of the images + // with a new resolution suffix of 512px. This won't impact images + // with no resolution suffix. + return album && album.url ? + replaceResolutionSuffix(album.url.url, '=s512') : + ''; } private getAlbumTitle_(): string { @@ -127,7 +132,7 @@ default: // For more than 3 selected albums, album description includes the title // of the second album and the number of remaining albums. - // For example: Sweden 2020, +2 more. + // For example: Sweden 2020, +2 more albums. return this.i18n( 'ambientModeMultipleAlbumsDesc', this.previewAlbums_[1].title, this.previewAlbums_.length - 2);
diff --git a/ash/webui/personalization_app/resources/trusted/utils.ts b/ash/webui/personalization_app/resources/trusted/utils.ts index a528416..76acff19 100644 --- a/ash/webui/personalization_app/resources/trusted/utils.ts +++ b/ash/webui/personalization_app/resources/trusted/utils.ts
@@ -75,6 +75,15 @@ } /** + * Removes the resolution suffix at the end of an image (from character '=' to + * the end) and replace it with a new resolution suffix. + */ +export function replaceResolutionSuffix( + url: string, resolution: string): string { + return url.replace(/=w[\w-]+$/, resolution); +} + +/** * Returns whether the given URL starts with http:// or https://. */ export function hasHttpScheme(url: string): boolean {
diff --git a/base/test/android/javatests/src/org/chromium/base/test/util/Manual.java b/base/test/android/javatests/src/org/chromium/base/test/util/Manual.java index 31f3977..42fd7b6 100644 --- a/base/test/android/javatests/src/org/chromium/base/test/util/Manual.java +++ b/base/test/android/javatests/src/org/chromium/base/test/util/Manual.java
@@ -18,4 +18,5 @@ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Manual { + String message() default ""; }
diff --git a/build/android/gyp/compile_resources.py b/build/android/gyp/compile_resources.py index 28595bf7..0171b7e9 100755 --- a/build/android/gyp/compile_resources.py +++ b/build/android/gyp/compile_resources.py
@@ -18,6 +18,7 @@ import hashlib import logging import os +import pathlib import re import shutil import subprocess @@ -796,7 +797,7 @@ if options.package_id: link_command += [ '--package-id', - hex(options.package_id), + '0x%02x' % options.package_id, '--allow-reserved-package-id', ] @@ -810,12 +811,15 @@ desired_manifest_package_name ] - # Creates a .zip with AndroidManifest.xml, resources.arsc, res/* - # Also creates R.txt - if options.use_resource_ids_path: - _CreateStableIdsFile(options.use_resource_ids_path, build.stable_ids_path, - fixed_manifest_package) - link_command += ['--stable-ids', build.stable_ids_path] + if options.package_id is not None: + package_id = options.package_id + elif options.shared_resources: + package_id = 0 + else: + package_id = 0x7f + _CreateStableIdsFile(options.use_resource_ids_path, build.stable_ids_path, + fixed_manifest_package, package_id) + link_command += ['--stable-ids', build.stable_ids_path] link_command += partials @@ -876,29 +880,38 @@ build.arsc_path, build.proto_path ]) + # Sanity check that the created resources have the expected package ID. + logging.debug('Performing sanity check') + _, actual_package_id = resource_utils.ExtractArscPackage( + options.aapt2_path, + build.arsc_path if options.arsc_path else build.proto_path) + # When there are no resources, ExtractArscPackage returns (None, None), in + # this case there is no need to check for matching package ID. + if actual_package_id is not None and actual_package_id != package_id: + raise Exception('Invalid package ID 0x%x (expected 0x%x)' % + (actual_package_id, package_id)) + return desired_manifest_package_name -@contextlib.contextmanager -def _CreateStableIdsFile(in_path, out_path, package_name): +def _CreateStableIdsFile(in_path, out_path, package_name, package_id): """Transforms a file generated by --emit-ids from another package. --stable-ids is generally meant to be used by different versions of the same package. To make it work for other packages, we need to transform the package name references to match the package that resources are being generated for. - - Note: This will fail if the package ID of the resources in - |options.use_resource_ids_path| does not match the package ID of the - resources being linked. """ - with open(in_path) as stable_ids_file: - with open(out_path, 'w') as output_ids_file: - output_stable_ids = re.sub( - r'^.*?:', - package_name + ':', - stable_ids_file.read(), - flags=re.MULTILINE) - output_ids_file.write(output_stable_ids) + if in_path: + data = pathlib.Path(in_path).read_text() + else: + # Force IDs to use 0x01 for the type byte in order to ensure they are + # different from IDs generated by other apps. https://crbug.com/1293336 + data = 'pkg:id/fake_resource_id = 0x7f010000\n' + # Replace "pkg:" with correct package name. + data = re.sub(r'^.*?:', package_name + ':', data, flags=re.MULTILINE) + # Replace "0x7f" with correct package id. + data = re.sub(r'0x..', '0x%02x' % package_id, data) + pathlib.Path(out_path).write_text(data) def _WriteOutputs(options, build): @@ -1006,23 +1019,6 @@ options.extra_main_r_text_files) build_utils.ZipDir(build.srcjar_path, build.srcjar_dir) - # Sanity check that the created resources have the expected package ID. - logging.debug('Performing sanity check') - if options.package_id: - expected_id = options.package_id - elif options.shared_resources: - expected_id = 0 - else: - expected_id = 127 # == '0x7f'. - _, package_id = resource_utils.ExtractArscPackage( - options.aapt2_path, - build.arsc_path if options.arsc_path else build.proto_path) - # When there are no resources, ExtractArscPackage returns (None, None), in - # this case there is no need to check for matching package ID. - if package_id is not None and package_id != expected_id: - raise Exception( - 'Invalid package ID 0x%x (expected 0x%x)' % (package_id, expected_id)) - logging.debug('Copying outputs') _WriteOutputs(options, build)
diff --git a/build/check_gn_headers_whitelist.txt b/build/check_gn_headers_whitelist.txt index d145a283a..747df59 100644 --- a/build/check_gn_headers_whitelist.txt +++ b/build/check_gn_headers_whitelist.txt
@@ -6,7 +6,6 @@ ash/constants/ash_switches.h ash/metrics/task_switch_metrics_recorder.h ash/metrics/task_switch_source.h -ash/metrics/user_metrics_action.h ash/metrics/user_metrics_recorder.h ash/public/cpp/ash_public_export.h ash/public/cpp/shelf_types.h
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index ae4ad6b..bb77201 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -7.20220318.1.1 +7.20220318.3.1
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index ae4ad6b..bb77201 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -7.20220318.1.1 +7.20220318.3.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index ae4ad6b..bb77201 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -7.20220318.1.1 +7.20220318.3.1
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py index 93b79a3..9b8c09f 100755 --- a/build/vs_toolchain.py +++ b/build/vs_toolchain.py
@@ -33,7 +33,7 @@ # Affects the availability of APIs in the toolchain headers. # * //docs/windows_build_instructions.md mentions of VS or Windows SDK. # Keeps the document consistent with the toolchain version. -TOOLCHAIN_HASH = '3bda71a11e' +TOOLCHAIN_HASH = 'e41785f09f' script_dir = os.path.dirname(os.path.realpath(__file__)) json_data_file = os.path.join(script_dir, 'win_toolchain.json')
diff --git a/chrome/VERSION b/chrome/VERSION index e1efff5..ab8839fc 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=102 MINOR=0 -BUILD=4952 +BUILD=4953 PATCH=0
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java index 9ab590a..fd519f6c 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTabSwitcherTest.java
@@ -113,7 +113,10 @@ @Rule public ChromeRenderTestRule mRenderTestRule = - ChromeRenderTestRule.Builder.withPublicCorpus().setRevision(1).build(); + ChromeRenderTestRule.Builder.withPublicCorpus() + .setRevision(1) + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_START) + .build(); /** * {@link ParameterProvider} used for parameterized test that provides whether it's single tab
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTest.java index 5a04e15..d680adf 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartTest.java
@@ -117,7 +117,10 @@ @Rule public ChromeRenderTestRule mRenderTestRule = - ChromeRenderTestRule.Builder.withPublicCorpus().setRevision(1).build(); + ChromeRenderTestRule.Builder.withPublicCorpus() + .setRevision(1) + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_START) + .build(); @Rule public ErrorCollector collector = new ErrorCollector();
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartToolbarTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartToolbarTest.java index c47829b1..5272b993 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartToolbarTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/InstantStartToolbarTest.java
@@ -74,7 +74,10 @@ @Rule public ChromeRenderTestRule mRenderTestRule = - ChromeRenderTestRule.Builder.withPublicCorpus().setRevision(1).build(); + ChromeRenderTestRule.Builder.withPublicCorpus() + .setRevision(1) + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_START) + .build(); @After public void tearDown() {
diff --git a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java index 6d0d25e..5b3f204 100644 --- a/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java +++ b/chrome/android/features/start_surface/internal/javatests/src/org/chromium/chrome/features/start_surface/StartSurfaceLayoutTest.java
@@ -186,7 +186,10 @@ @Rule public ChromeRenderTestRule mRenderTestRule = - ChromeRenderTestRule.Builder.withPublicCorpus().setRevision(1).build(); + ChromeRenderTestRule.Builder.withPublicCorpus() + .setRevision(1) + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_START) + .build(); @SuppressWarnings("FieldCanBeLocal") private EmbeddedTestServer mTestServer;
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java index f0fda7c46..2a8e849 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediator.java
@@ -1315,13 +1315,11 @@ private int getSpanCount(int orientation, int screenWidthDp) { if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mContext) && TabUiFeatureUtilities.isGridTabSwitcherEnabled(mContext)) { - int spanCount = screenWidthDp < TabListCoordinator.MAX_SCREEN_WIDTH_COMPACT_DP + return screenWidthDp < TabListCoordinator.MAX_SCREEN_WIDTH_COMPACT_DP ? TabListCoordinator.GRID_LAYOUT_SPAN_COUNT_COMPACT : screenWidthDp < TabListCoordinator.MAX_SCREEN_WIDTH_MEDIUM_DP ? TabListCoordinator.GRID_LAYOUT_SPAN_COUNT_MEDIUM : TabListCoordinator.GRID_LAYOUT_SPAN_COUNT_LARGE; - if (orientation == Configuration.ORIENTATION_PORTRAIT || mModel.size() == 0) return spanCount; - return mModel.size() == 1 ? 2 : Math.min(spanCount, mModel.size()); } return orientation == Configuration.ORIENTATION_PORTRAIT || MultiWindowUtils.getInstance().isInMultiWindowMode((Activity) mContext)
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java index 5f17395..3961ed6 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogTest.java
@@ -106,6 +106,7 @@ import org.chromium.chrome.test.util.ChromeRenderTestRule; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.Features.EnableFeatures; +import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.ui.KeyboardVisibilityDelegate; import org.chromium.ui.test.util.NightModeTestUtils; @@ -1073,7 +1074,7 @@ return; } final @ColorInt int scrimDefaultColor = cta.getColor(R.color.default_scrim_color); - final @ColorInt int navigationBarColor = cta.getColor(R.color.bottom_system_nav_color); + final @ColorInt int navigationBarColor = SemanticColorUtils.getBottomSystemNavColor(cta); float scrimColorAlpha = (scrimDefaultColor >>> 24) / 255f; int scrimColorOpaque = scrimDefaultColor & 0xFF000000; int navigationBarColorWithScrimOverlay = ColorUtils.getColorWithOverlay(
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java index fe4a332..59d16ca 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/TabListMediatorUnitTest.java
@@ -1555,40 +1555,6 @@ } @Test - @Features.EnableFeatures(GRID_TAB_SWITCHER_FOR_TABLETS) - public void updateSpanCount_onLargeTabletWithThreeTabs_landscape() { - // Init 3 tabs - initAndAssertAllProperties(1); - // Mock large tablet - when(mResources.getInteger(R.integer.min_screen_width_bucket)) - .thenReturn(TabListCoordinator.MAX_SCREEN_WIDTH_MEDIUM_DP + 1); - - Configuration portraitConfiguration = new Configuration(); - portraitConfiguration.orientation = Configuration.ORIENTATION_LANDSCAPE; - portraitConfiguration.screenWidthDp = TabListCoordinator.MAX_SCREEN_WIDTH_MEDIUM_DP + 1; - mComponentCallbacksCaptor.getValue().onConfigurationChanged(portraitConfiguration); - - verify(mGridLayoutManager).setSpanCount(mTabModel.getCount()); - } - - @Test - @Features.EnableFeatures(GRID_TAB_SWITCHER_FOR_TABLETS) - public void updateSpanCount_onLargeTabletWithThreeTabs_portrait() { - // Init 3 tabs - initAndAssertAllProperties(1); - // Mock large tablet - when(mResources.getInteger(R.integer.min_screen_width_bucket)) - .thenReturn(TabListCoordinator.MAX_SCREEN_WIDTH_MEDIUM_DP + 1); - - Configuration portraitConfiguration = new Configuration(); - portraitConfiguration.orientation = Configuration.ORIENTATION_PORTRAIT; - portraitConfiguration.screenWidthDp = TabListCoordinator.MAX_SCREEN_WIDTH_MEDIUM_DP + 1; - mComponentCallbacksCaptor.getValue().onConfigurationChanged(portraitConfiguration); - - verify(mGridLayoutManager).setSpanCount(TabListCoordinator.GRID_LAYOUT_SPAN_COUNT_LARGE); - } - - @Test public void resetWithListOfTabs_MruOrder() { List<Tab> tabs = new ArrayList<>(); for (int i = 0; i < mTabModel.getCount(); i++) {
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java index ee66625..bbcd70a 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSurfaceCoordinator.java
@@ -27,8 +27,6 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.material.color.MaterialColors; - import org.chromium.base.CommandLine; import org.chromium.base.ObserverList; import org.chromium.base.supplier.Supplier; @@ -61,6 +59,7 @@ import org.chromium.chrome.browser.xsurface.SurfaceScope; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.browser_ui.settings.SettingsLauncher; +import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.displaystyle.UiConfig; import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker; @@ -552,8 +551,7 @@ view = (RecyclerView) mHybridListRenderer.bind(mContentManager, mViewportView); view.setId(R.id.feed_stream_recycler_view); view.setClipToPadding(false); - view.setBackgroundColor( - MaterialColors.getColor(context, R.attr.default_bg_color_dynamic, TAG)); + view.setBackgroundColor(SemanticColorUtils.getDefaultBgColor(context)); // Work around https://crbug.com/943873 where default focus highlight shows up after // toggling dark mode.
diff --git a/chrome/android/java/res/values-v26/styles.xml b/chrome/android/java/res/values-v26/styles.xml index 63d5cea7..0c70e36 100644 --- a/chrome/android/java/res/values-v26/styles.xml +++ b/chrome/android/java/res/values-v26/styles.xml
@@ -5,7 +5,7 @@ <resources> <style name="Theme.Chromium.TabbedMode" parent="Base.Theme.Chromium.TabbedMode"> - <item name="android:statusBarColor">@color/default_bg_color</item> + <item name="android:statusBarColor">@macro/default_bg_color</item> <item name="android:windowLightStatusBar">@bool/window_light_status_bar</item> </style> </resources>
diff --git a/chrome/android/java/res/values-v27/styles.xml b/chrome/android/java/res/values-v27/styles.xml index df47ceb..59d8a42 100644 --- a/chrome/android/java/res/values-v27/styles.xml +++ b/chrome/android/java/res/values-v27/styles.xml
@@ -5,23 +5,23 @@ <resources> <style name="Theme.Chromium.WithWindowAnimation" parent="Base.Theme.Chromium.WithWindowAnimation"> - <item name="android:navigationBarColor">@color/bottom_system_nav_color</item> + <item name="android:navigationBarColor">@macro/bottom_system_nav_color</item> <item name="android:navigationBarDividerColor">@macro/bottom_system_nav_divider_color</item> <item name="android:windowLightNavigationBar">@bool/window_light_navigation_bar</item> </style> <style name="Base.V27.Theme.Chromium.Settings" parent="Base.Theme.Chromium.Settings"> - <item name="android:navigationBarColor">@color/bottom_system_nav_color</item> + <item name="android:navigationBarColor">@macro/bottom_system_nav_color</item> <item name="android:navigationBarDividerColor">@macro/bottom_system_nav_divider_color</item> <item name="android:windowLightNavigationBar">@bool/window_light_navigation_bar</item> </style> <style name="Theme.Chromium.DialogWhenLarge" parent="Base.Theme.Chromium.DialogWhenLarge"> - <item name="android:navigationBarColor">@color/bottom_system_nav_color</item> + <item name="android:navigationBarColor">@macro/bottom_system_nav_color</item> <item name="android:navigationBarDividerColor">@macro/bottom_system_nav_divider_color</item> <item name="android:windowLightNavigationBar">@bool/window_light_navigation_bar</item> </style> <style name="Theme.Chromium.Activity.Fullscreen" parent="Base.Theme.Chromium.Activity.Fullscreen"> - <item name="android:navigationBarColor">@color/bottom_system_nav_color</item> + <item name="android:navigationBarColor">@macro/bottom_system_nav_color</item> <item name="android:navigationBarDividerColor">@macro/bottom_system_nav_divider_color</item> <item name="android:windowLightNavigationBar">@bool/window_light_navigation_bar</item> </style>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java index 0b10007..cc54a8a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -20,8 +20,6 @@ import androidx.core.view.ViewCompat; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.material.color.MaterialColors; - import org.chromium.base.Log; import org.chromium.base.ObserverList; import org.chromium.base.TimeUtils; @@ -84,6 +82,7 @@ import org.chromium.chrome.browser.xsurface.FeedLaunchReliabilityLogger.SurfaceType; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.browser_ui.styles.ChromeColors; +import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.components.feature_engagement.EventConstants; @@ -349,7 +348,7 @@ mContext = activity; mTitle = activity.getResources().getString(R.string.new_tab_title); - mBackgroundColor = MaterialColors.getColor(mContext, R.attr.default_bg_color_dynamic, TAG); + mBackgroundColor = SemanticColorUtils.getDefaultBgColor(mContext); mIsTablet = isTablet; TemplateUrlServiceFactory.get().addObserver(this);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java index f67ea27..fa31506 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController.java
@@ -236,9 +236,10 @@ } private @ColorInt int getNavigationBarColor(boolean forceDarkNavigationBar) { - return ApiCompatibilityUtils.getColor(mResources, - forceDarkNavigationBar ? R.color.toolbar_background_primary_dark - : R.color.bottom_system_nav_color); + return forceDarkNavigationBar + ? ApiCompatibilityUtils.getColor( + mResources, R.color.toolbar_background_primary_dark) + : SemanticColorUtils.getBottomSystemNavColor(mWindow.getContext()); } private @ColorInt int getNavigationBarDividerColor(boolean forceDarkNavigationBar) {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuRenderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuRenderTest.java index c7e07d1f..6ce5fd7 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuRenderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuRenderTest.java
@@ -52,7 +52,9 @@ @Rule public ChromeRenderTestRule mRenderTestRule = - ChromeRenderTestRule.Builder.withPublicCorpus().build(); + ChromeRenderTestRule.Builder.withPublicCorpus() + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_CONTEXT_MENU) + .build(); private ModelListAdapter mAdapter; private ModelList mListItems;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java index 889ffd5..71515dc 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/TosAndUmaFirstRunFragmentWithEnterpriseSupportTest.java
@@ -105,6 +105,7 @@ ChromeRenderTestRule.Builder.withPublicCorpus() .setRevision(RENDER_TEST_REVISION) .setDescription(RENDER_TEST_REVISION_DESCRIPTION) + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_FIRST_RUN) .build(); @Rule public final AccountManagerTestRule mAccountManagerTestRule = new AccountManagerTestRule();
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 7a66254..a8ee025a 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -846,6 +846,9 @@ <message name="IDS_BLUETOOTH_PAIRING_LEARN_MORE" desc="Bluetooth pairing dialog: Message informing the user on what actions to take in order to see a device in the list of available devices."> Make sure your Bluetooth device is in pairing mode and nearby. Only pair with devices you trust. <ph name="BEGIN_LINK_LEARN_MORE"><a target="_blank" href="$1"></ph>Learn more<ph name="END_LINK_LEARN_MORE"></a></ph> </message> + <message name="IDS_BLUETOOTH_PAIRING_DESCRIPTION" desc="Bluetooth pairing dialog: Message informing the user on what actions to take in order to see a device in the list of available devices."> + Make sure your Bluetooth device is in pairing mode and nearby. Only pair with devices you trust. + </message> <message name="IDS_BLUETOOTH_PAIRING_ENTER_PIN" desc="Bluetooth pairing dialog: Message displayed informing the user to enter a PIN in other to complete device pairing."> Enter PIN to pair with <ph name="DEVICE_NAME">$1<ex>Nexus S</ex></ph> </message>
diff --git a/chrome/app/chromeos_strings_grdp/IDS_BLUETOOTH_PAIRING_DESCRIPTION.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_BLUETOOTH_PAIRING_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..be3b71c6 --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_BLUETOOTH_PAIRING_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +1c47797501546f585d61a6c5cfb7e69abe31feeb \ No newline at end of file
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 1b2e2f6..c869d4e6 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -6534,8 +6534,11 @@ <message name="IDS_SIDE_PANEL_TITLE" desc="Title of the Side Panel"> Side Panel </message> - <message name="IDS_READER_MODE_TITLE" desc="Title of the Reader Mode feature, which gives users an accessible reading experience."> - Reader Mode + + <!-- Read Anything strings --> + <!-- TODO(crbug.com/1266555): Add final strings and make them translateable. --> + <message name="IDS_READ_ANYTHING_TITLE" desc="Title of the Read Anything feature, which gives users an accessible reading experience." translateable="false"> + Read anything </message> <!--Tooltip strings --> @@ -12614,6 +12617,15 @@ <message name="IDS_INPUT_OVERLAY_EDIT_MENU_RESET" desc="Entry point to reset the action binding to original binding."> Reset </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MODE_RESET" desc="Restore key-bindings to a preset status."> + Reset to defaults + </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MODE_SAVE" desc="Apply and store the newly set key-bindings."> + Save + </message> + <message name="IDS_INPUT_OVERLAY_EDIT_MODE_CANCEL" desc="Discard all the newly assigned key-bindings in this session."> + Cancel + </message> </if> <!-- Privacy Sandbox Dialog strings -->
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_CANCEL.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_CANCEL.png.sha1 new file mode 100644 index 0000000..18da017 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_CANCEL.png.sha1
@@ -0,0 +1 @@ +7f023168a2b19b31df544b133945e47b4f324c9b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_RESET.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_RESET.png.sha1 new file mode 100644 index 0000000..18da017 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_RESET.png.sha1
@@ -0,0 +1 @@ +7f023168a2b19b31df544b133945e47b4f324c9b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_SAVE.png.sha1 b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_SAVE.png.sha1 new file mode 100644 index 0000000..18da017 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_INPUT_OVERLAY_EDIT_MODE_SAVE.png.sha1
@@ -0,0 +1 @@ +7f023168a2b19b31df544b133945e47b4f324c9b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_READER_MODE_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_READER_MODE_TITLE.png.sha1 deleted file mode 100644 index ed79841f..0000000 --- a/chrome/app/generated_resources_grd/IDS_READER_MODE_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -f4dc7410f7cd0bbc8b33775882292c8205898c7d \ No newline at end of file
diff --git a/chrome/app/nearby_share_strings.grdp b/chrome/app/nearby_share_strings.grdp index 8fba23e..b5083d0 100644 --- a/chrome/app/nearby_share_strings.grdp +++ b/chrome/app/nearby_share_strings.grdp
@@ -303,6 +303,9 @@ <message name="IDS_NEARBY_NOTIFICATION_ACTION_OPEN_FOLDER" desc="Notification action button text that opens the folder to the received files."> Open folder </message> + <message name="IDS_NEARBY_NOTIFICATION_ACTION_OPEN_NETWORK_LIST" desc="Notification action button text that opens the known Wi-Fi networks list in Settings."> + Open in Wi-Fi networks + </message> <message name="IDS_NEARBY_NOTIFICATION_ACTION_OPEN_URL" desc="Notification action button text that opens the received URL."> Open </message> @@ -314,6 +317,9 @@ =1 {<ph name="DEVICE_NAME">$1<ex>Ted's Pixel 2</ex></ph> is sharing <ph name="ATTACHMENTS">$2<ex>1 item</ex></ph> with you.} other {<ph name="DEVICE_NAME">$1<ex>Ted's Pixel 2</ex></ph> is sharing <ph name="ATTACHMENTS">$2<ex>3 items</ex></ph> with you.}} </message> + <message name="IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE_WIFI_CREDENTIALS" desc="Text shown as the message of a notfication when a nearby device requests a connection via Nearby Share to send Wi-Fi network credentials."> + <ph name="DEVICE_NAME">$1<ex>Ted's Pixel 2</ex></ph> is sharing a Wi-Fi network with you. + </message> <message name="IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_TITLE" desc="Text shown as the title of a notfication when a nearby device requests a connection via Nearby Share."> Receive with Nearby Share? </message> @@ -352,16 +358,25 @@ =1 {Failed to receive <ph name="ATTACHMENTS">$1<ex>1 item</ex></ph> from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>} other {Failed to receive <ph name="ATTACHMENTS">$1<ex>3 items</ex></ph> from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>}} </message> + <message name="IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE_WIFI_CREDENTIALS" desc="Text shown as the title of a notfication when receiving Wi-Fi credentials via Nearby Share failed."> + Failed to receive network configuration for '<ph name="NETWORK_NAME">$1<ex>My Home Wi-Fi</ex></ph>' from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph> + </message> <message name="IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE" desc="Text shown as the title of a notfication when receiving data via Nearby Share."> {COUNT, plural, =1 {Receiving <ph name="ATTACHMENTS">$1<ex>1 item</ex></ph> from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>} other {Receiving <ph name="ATTACHMENTS">$1<ex>3 items</ex></ph> from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>}} </message> + <message name="IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE_WIFI_CREDENTIALS" desc="Text shown as the title of a notfication when receiving Wi-Fi credentials via Nearby Share."> + Receiving network configuration for '<ph name="NETWORK_NAME">$1<ex>My Home Wi-Fi</ex></ph>' from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph> + </message> <message name="IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE" desc="Text shown as the title of a notfication when data was sucessfully received via Nearby Share."> {COUNT, plural, =1 {<ph name="ATTACHMENTS">$1<ex>1 item</ex></ph> received from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>} other {<ph name="ATTACHMENTS">$1<ex>3 items</ex></ph> received from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>}} </message> + <message name="IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE_WIFI_CREDENTIALS" desc="Text shown as the title of a notfication when Wi-Fi credentials were sucessfully received via Nearby Share."> + Received network configuration for '<ph name="NETWORK_NAME">$1<ex>My Home Wi-Fi</ex></ph>' from <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph> + </message> <message name="IDS_NEARBY_NOTIFICATION_SEND_FAILURE_TITLE" desc="Text shown as the title of a notfication when sending data via Nearby Share failed."> {COUNT, plural, =1 {Failed to send <ph name="ATTACHMENTS">$1<ex>1 item</ex></ph> to <ph name="DEVICE_NAME">$2<ex>Ted's Pixel 2</ex></ph>}
diff --git a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_ACTION_OPEN_NETWORK_LIST.png.sha1 b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_ACTION_OPEN_NETWORK_LIST.png.sha1 new file mode 100644 index 0000000..0b615e5 --- /dev/null +++ b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_ACTION_OPEN_NETWORK_LIST.png.sha1
@@ -0,0 +1 @@ +23f0c76d7d3113d1f5f1e6ca3f1a4c0c55b7a94b \ No newline at end of file
diff --git a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE_WIFI_CREDENTIALS.png.sha1 b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE_WIFI_CREDENTIALS.png.sha1 new file mode 100644 index 0000000..f029be6 --- /dev/null +++ b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE_WIFI_CREDENTIALS.png.sha1
@@ -0,0 +1 @@ +252446754b1dfd18f34ec63763abc3c068fa08e7 \ No newline at end of file
diff --git a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE_WIFI_CREDENTIALS.png.sha1 b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE_WIFI_CREDENTIALS.png.sha1 new file mode 100644 index 0000000..f7d875e --- /dev/null +++ b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE_WIFI_CREDENTIALS.png.sha1
@@ -0,0 +1 @@ +95ed62106905cb873330d1a25501f17a798a58f3 \ No newline at end of file
diff --git a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE_WIFI_CREDENTIALS.png.sha1 b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE_WIFI_CREDENTIALS.png.sha1 new file mode 100644 index 0000000..8ad54fb5 --- /dev/null +++ b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE_WIFI_CREDENTIALS.png.sha1
@@ -0,0 +1 @@ +3b30821d6d181923dd8da6da0a6a2983acfe7520 \ No newline at end of file
diff --git a/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE_WIFI_CREDENTIALS.png.sha1 b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE_WIFI_CREDENTIALS.png.sha1 new file mode 100644 index 0000000..0b615e5 --- /dev/null +++ b/chrome/app/nearby_share_strings_grdp/IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE_WIFI_CREDENTIALS.png.sha1
@@ -0,0 +1 @@ +23f0c76d7d3113d1f5f1e6ca3f1a4c0c55b7a94b \ No newline at end of file
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index aa43428..a0ffde56 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -391,6 +391,12 @@ <message name="IDS_SETTINGS_PASSWORDS" desc="Name for the password section and settings entry used for managing passwords."> Passwords </message> + <message name="IDS_SETTINGS_PASSWORD_MANAGER" desc="Name for the Password Manager section and settings entry used for managing passwords."> + Password Manager + </message> + <message name="IDS_SETTINGS_PASSWORD_MANAGER_DESCRIPTION" desc="Description for the password section and settings entry used for managing passwords."> + Create, save, and manage your passwords so you can easily sign in to sites and apps. + </message> <message name="IDS_SETTINGS_DEVICE_PASSWORDS" desc="Name for the passwords section used for managing passwords/exceptions stored on the device."> Passwords </message>
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PASSWORD_MANAGER.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PASSWORD_MANAGER.png.sha1 new file mode 100644 index 0000000..3829445 --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PASSWORD_MANAGER.png.sha1
@@ -0,0 +1 @@ +e7ebefaa3cb39aa5840c43b828ecc0afb77b4d0e \ No newline at end of file
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_PASSWORD_MANAGER_DESCRIPTION.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PASSWORD_MANAGER_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..1ec3758d --- /dev/null +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_PASSWORD_MANAGER_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +59697b082fd3520a119f79a660d70cab6346c829 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index ae4b615..4d100b34 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2415,6 +2415,7 @@ "//ash/components/audio", "//ash/components/device_activity:device_activity", "//ash/components/timezone", + "//ash/components/tpm", "//ash/constants", "//ash/services/device_sync/public/cpp:prefs", "//ash/services/multidevice_setup/public/cpp", @@ -2485,7 +2486,6 @@ "//chromeos/dbus/util", "//chromeos/services/network_health/public/mojom:mojom", "//chromeos/system", - "//chromeos/tpm", "//components/certificate_transparency", "//components/drive", "//components/quirks",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 3d751abd..9abdcbc 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -4474,15 +4474,6 @@ kOsCrOS, SINGLE_VALUE_TYPE( ::switches::kEnableExperimentalAccessibilitySwitchAccessText)}, - {"enable-experimental-accessibility-switch-access-multistep-automation", - flag_descriptions:: - kExperimentalAccessibilitySwitchAccessMultistepAutomationName, - flag_descriptions:: - kExperimentalAccessibilitySwitchAccessMultistepAutomationDescription, - kOsCrOS, - SINGLE_VALUE_TYPE( - ::switches:: - kEnableExperimentalAccessibilitySwitchAccessMultistepAutomation)}, {"enable-experimental-kernel-vm-support", flag_descriptions::kKernelnextVMsName, flag_descriptions::kKernelnextVMsDescription, kOsCrOS, @@ -4760,17 +4751,6 @@ FEATURE_VALUE_TYPE(omnibox::kOmniboxPedalsBatch3NonEnglish)}, #endif // BUILDFLAG(IS_ANDROID) - {"omnibox-clobber-triggers-contextual-web-zero-suggest", - flag_descriptions::kOmniboxClobberTriggersContextualWebZeroSuggestName, - flag_descriptions:: - kOmniboxClobberTriggersContextualWebZeroSuggestDescription, - kOsDesktop, - FEATURE_WITH_PARAMS_VALUE_TYPE( - omnibox::kClobberTriggersContextualWebZeroSuggest, - // On-clobber has the same variations and forcing IDs as on-focus. - kOmniboxOnFocusSuggestionsContextualWebVariations, - "OmniboxGoogleOnContent")}, - {"omnibox-on-focus-suggestions-contextual-web", flag_descriptions::kOmniboxOnFocusSuggestionsContextualWebName, flag_descriptions::kOmniboxOnFocusSuggestionsContextualWebDescription,
diff --git a/chrome/browser/app_controller_mac.h b/chrome/browser/app_controller_mac.h index 964793a..2ac5fec7 100644 --- a/chrome/browser/app_controller_mac.h +++ b/chrome/browser/app_controller_mac.h
@@ -24,9 +24,9 @@ class BookmarkMenuBridge; class CommandUpdater; class GURL; -class HandoffActiveURLObserverBridge; @class HandoffManager; class HistoryMenuBridge; +class HandoffObserver; class Profile; @class ProfileMenuController; class QuitWithAppsController; @@ -107,9 +107,8 @@ // Responsible for maintaining all state related to the Handoff feature. base::scoped_nsobject<HandoffManager> _handoffManager; - // Observes changes to the active URL. - std::unique_ptr<HandoffActiveURLObserverBridge> - _handoff_active_url_observer_bridge; + // Observes changes to the active web contents. + std::unique_ptr<HandoffObserver> _handoff_observer; // This will be true after receiving a NSWorkspaceWillPowerOffNotification. BOOL _isPoweringOff;
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index a567889d..953e9637 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm
@@ -76,7 +76,7 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h" #import "chrome/browser/ui/cocoa/confirm_quit.h" #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h" -#include "chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h" +#include "chrome/browser/ui/cocoa/handoff_observer.h" #import "chrome/browser/ui/cocoa/history_menu_bridge.h" #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h" #import "chrome/browser/ui/cocoa/profiles/profile_menu_controller.h" @@ -371,7 +371,7 @@ return profile_manager->GetProfile(profile_path); } -@interface AppController () <HandoffActiveURLObserverBridgeDelegate> +@interface AppController () <HandoffObserverDelegate> - (void)initMenuState; - (void)initProfileMenu; - (void)updateConfirmToQuitPrefMenuItem:(NSMenuItem*)item; @@ -396,8 +396,14 @@ // NTP after all the |urls| have been opened. - (void)openUrlsReplacingNTP:(const std::vector<GURL>&)urls; -// This method passes |handoffURL| to |handoffManager_|. -- (void)passURLToHandoffManager:(const GURL&)handoffURL; +// Returns |YES| if |webContents| can be sent to another device via Handoff. +- (BOOL)isHandoffEligible:(content::WebContents*)webContents; + +// This method passes |handoffURL| and |handoffTitle| to |handoffManager_|. +// This is a separate method (vs. being inlined into `updateHandoffManager` +// below) so that it can be swizzled in tests. +- (void)updateHandoffManagerWithURL:(const GURL&)handoffURL + title:(const std::u16string&)handoffTitle; // Lazily creates the Handoff Manager. Updates the state of the Handoff // Manager. This method is idempotent. This should be called: @@ -408,10 +414,6 @@ // |webContents| should be the new, active WebContents. - (void)updateHandoffManager:(content::WebContents*)webContents; -// Given |webContents|, extracts a GURL to be used for Handoff. This may return -// the empty GURL. -- (GURL)handoffURLFromWebContents:(content::WebContents*)webContents; - // Return false if Chrome startup is paused by dialog and AppController is // called without any initialized Profile. - (BOOL)isProfileReady; @@ -983,8 +985,7 @@ _menuState.get())); } - _handoff_active_url_observer_bridge = - std::make_unique<HandoffActiveURLObserverBridge>(self); + _handoff_observer = std::make_unique<HandoffObserver>(self); if (@available(macOS 10.15, *)) { ASWebAuthenticationSessionWebBrowserSessionManager.sharedManager @@ -1918,36 +1919,36 @@ #pragma mark - Handoff Manager -- (void)passURLToHandoffManager:(const GURL&)handoffURL { +- (void)updateHandoffManagerWithURL:(const GURL&)handoffURL + title:(const std::u16string&)handoffTitle { [_handoffManager updateActiveURL:handoffURL]; + [_handoffManager updateActiveTitle:handoffTitle]; } - (void)updateHandoffManager:(content::WebContents*)webContents { if (!_handoffManager) _handoffManager.reset([[HandoffManager alloc] init]); - GURL handoffURL = [self handoffURLFromWebContents:webContents]; - [self passURLToHandoffManager:handoffURL]; + if ([self isHandoffEligible:webContents]) { + [self updateHandoffManagerWithURL:webContents->GetVisibleURL() + title:webContents->GetTitle()]; + } else { + [self updateHandoffManagerWithURL:GURL() title:std::u16string()]; + } } -- (GURL)handoffURLFromWebContents:(content::WebContents*)webContents { +- (BOOL)isHandoffEligible:(content::WebContents*)webContents { if (!webContents) - return GURL(); + return NO; Profile* profile = Profile::FromBrowserContext(webContents->GetBrowserContext()); if (!profile) - return GURL(); + return NO; // Handoff is not allowed from an incognito profile. To err on the safe side, // also disallow Handoff from a guest profile. - if (!profile->IsRegularProfile()) - return GURL(); - - if (!webContents) - return GURL(); - - return webContents->GetVisibleURL(); + return profile->IsRegularProfile(); } - (BOOL)isProfileReady { @@ -1956,9 +1957,9 @@ ->IsEnterpriseStartupDialogShowing(); } -#pragma mark - HandoffActiveURLObserverBridgeDelegate +#pragma mark - HandoffObserverDelegate -- (void)handoffActiveURLChanged:(content::WebContents*)webContents { +- (void)handoffContentsChanged:(content::WebContents*)webContents { [self updateHandoffManager:webContents]; }
diff --git a/chrome/browser/app_controller_mac_browsertest.mm b/chrome/browser/app_controller_mac_browsertest.mm index d42a2dbf..6e702379 100644 --- a/chrome/browser/app_controller_mac_browsertest.mm +++ b/chrome/browser/app_controller_mac_browsertest.mm
@@ -17,9 +17,11 @@ #include "base/command_line.h" #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" +#include "base/mac/scoped_objc_class_swizzler.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/scoped_observation.h" +#include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" @@ -1089,14 +1091,18 @@ //--------------------------AppControllerHandoffBrowserTest--------------------- static GURL g_handoff_url; +static std::u16string g_handoff_title; @interface AppController (BrowserTest) -- (void)new_passURLToHandoffManager:(const GURL&)handoffURL; +- (void)new_updateHandoffManagerWithURL:(const GURL&)handoffURL + title:(const std::u16string&)handoffTitle; @end @implementation AppController (BrowserTest) -- (void)new_passURLToHandoffManager:(const GURL&)handoffURL { +- (void)new_updateHandoffManagerWithURL:(const GURL&)handoffURL + title:(const std::u16string&)handoffTitle { g_handoff_url = handoffURL; + g_handoff_title = handoffTitle; } @end @@ -1104,34 +1110,16 @@ class AppControllerHandoffBrowserTest : public InProcessBrowserTest { protected: - AppControllerHandoffBrowserTest() {} - - // Exchanges the implementations of the two selectors on the class - // AppController. - void ExchangeSelectors(SEL originalMethod, SEL newMethod) { - Class appControllerClass = NSClassFromString(@"AppController"); - - ASSERT_TRUE(appControllerClass != nil); - - Method original = - class_getInstanceMethod(appControllerClass, originalMethod); - Method destination = class_getInstanceMethod(appControllerClass, newMethod); - - ASSERT_TRUE(original != NULL); - ASSERT_TRUE(destination != NULL); - - method_exchangeImplementations(original, destination); - } - // Swizzle Handoff related implementations. void SetUpInProcessBrowserTestFixture() override { // This swizzle intercepts the URL that would be sent to the Handoff // Manager, and instead puts it into a variable accessible to this test. - SEL originalMethod = @selector(passURLToHandoffManager:); - SEL newMethod = @selector(new_passURLToHandoffManager:); - ExchangeSelectors(originalMethod, newMethod); + swizzler_ = std::make_unique<base::mac::ScopedObjCClassSwizzler>( + [AppController class], @selector(updateHandoffManagerWithURL:title:), + @selector(new_updateHandoffManagerWithURL:title:)); } + void TearDownInProcessBrowserTestFixture() override { swizzler_.reset(); } // Closes the tab, and waits for the close to finish. void CloseTab(Browser* browser, int index) { content::WebContentsDestroyedWatcher destroyed_watcher( @@ -1140,6 +1128,9 @@ index, TabStripModel::CLOSE_CREATE_HISTORICAL_TAB); destroyed_watcher.Wait(); } + + private: + std::unique_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_; }; // Tests that as a user switches between tabs, navigates within a tab, and @@ -1148,11 +1139,13 @@ IN_PROC_BROWSER_TEST_F(AppControllerHandoffBrowserTest, TestHandoffURLs) { ASSERT_TRUE(embedded_test_server()->Start()); EXPECT_EQ(g_handoff_url, GURL(url::kAboutBlankURL)); + EXPECT_EQ(g_handoff_title, u"about:blank"); - // Test that navigating to a URL updates the handoff URL. + // Test that navigating to a URL updates the handoff manager. GURL test_url1 = embedded_test_server()->GetURL("/title1.html"); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), test_url1)); EXPECT_EQ(g_handoff_url, test_url1); + EXPECT_TRUE(base::EndsWith(g_handoff_title, u"title1.html")); // Test that opening a new tab updates the handoff URL. GURL test_url2 = embedded_test_server()->GetURL("/title2.html"); @@ -1165,17 +1158,20 @@ browser()->tab_strip_model()->ActivateTabAt( 0, {TabStripModel::GestureType::kOther}); EXPECT_EQ(g_handoff_url, test_url1); + EXPECT_TRUE(base::EndsWith(g_handoff_title, u"title1.html")); // Test that closing the current tab updates the handoff URL. CloseTab(browser(), 0); EXPECT_EQ(g_handoff_url, test_url2); + EXPECT_EQ(g_handoff_title, u"Title Of Awesomeness"); // Test that opening a new browser window updates the handoff URL. GURL test_url3 = embedded_test_server()->GetURL("/title3.html"); ui_test_utils::NavigateToURLWithDisposition( browser(), GURL(test_url3), WindowOpenDisposition::NEW_WINDOW, - ui_test_utils::BROWSER_TEST_WAIT_FOR_BROWSER); + ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP); EXPECT_EQ(g_handoff_url, test_url3); + EXPECT_EQ(g_handoff_title, u"Title Of More Awesomeness"); // Check that there are exactly 2 browsers. BrowserList* active_browser_list = BrowserList::GetInstance(); @@ -1185,6 +1181,7 @@ Browser* browser2 = active_browser_list->get(1); CloseBrowserSynchronously(browser2); EXPECT_EQ(g_handoff_url, test_url2); + EXPECT_EQ(g_handoff_title, u"Title Of Awesomeness"); // The URLs of incognito windows should not be passed to Handoff. GURL test_url4 = embedded_test_server()->GetURL("/simple.html"); @@ -1192,6 +1189,7 @@ browser(), GURL(test_url4), WindowOpenDisposition::OFF_THE_RECORD, ui_test_utils::BROWSER_TEST_WAIT_FOR_BROWSER); EXPECT_EQ(g_handoff_url, GURL()); + EXPECT_EQ(g_handoff_title, u""); // Open a new tab in the incognito window. EXPECT_EQ(2u, active_browser_list->size()); @@ -1200,15 +1198,18 @@ browser3, test_url4, WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); EXPECT_EQ(g_handoff_url, GURL()); + EXPECT_EQ(g_handoff_title, u""); // Navigate the current tab in the incognito window. ASSERT_TRUE(ui_test_utils::NavigateToURL(browser3, test_url1)); EXPECT_EQ(g_handoff_url, GURL()); + EXPECT_EQ(g_handoff_title, u""); // Activate the original browser window. Browser* browser1 = active_browser_list->get(0); browser1->window()->Show(); EXPECT_EQ(g_handoff_url, test_url2); + EXPECT_EQ(g_handoff_title, u"Title Of Awesomeness"); } class AppControllerHandoffPrerenderBrowserTest
diff --git a/chrome/browser/ash/app_mode/kiosk_app_manager.h b/chrome/browser/ash/app_mode/kiosk_app_manager.h index d348d019..faf73b5 100644 --- a/chrome/browser/ash/app_mode/kiosk_app_manager.h +++ b/chrome/browser/ash/app_mode/kiosk_app_manager.h
@@ -10,6 +10,7 @@ #include <string> #include <vector> +#include "ash/components/tpm/install_attributes.h" #include "base/callback_forward.h" #include "base/no_destructor.h" #include "base/time/time.h" @@ -19,7 +20,6 @@ #include "chrome/browser/chromeos/app_mode/chrome_kiosk_external_loader_broker.h" #include "chrome/browser/chromeos/extensions/external_cache.h" #include "chrome/browser/chromeos/extensions/external_cache_delegate.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "extensions/common/extension_id.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/arc/arc_util_unittest.cc b/chrome/browser/ash/arc/arc_util_unittest.cc index 96fa0a8..492726c 100644 --- a/chrome/browser/ash/arc/arc_util_unittest.cc +++ b/chrome/browser/ash/arc/arc_util_unittest.cc
@@ -8,6 +8,7 @@ #include "ash/components/arc/arc_features.h" #include "ash/components/arc/arc_prefs.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/command_line.h" #include "base/system/sys_info.h" @@ -33,7 +34,6 @@ #include "chrome/test/base/testing_profile_manager.h" #include "chromeos/dbus/concierge/concierge_client.h" #include "chromeos/dbus/oobe_config/fake_oobe_configuration_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/arc/auth/arc_active_directory_enrollment_token_fetcher.cc b/chrome/browser/ash/arc/auth/arc_active_directory_enrollment_token_fetcher.cc index 2b1a36b..1b748ba 100644 --- a/chrome/browser/ash/arc/auth/arc_active_directory_enrollment_token_fetcher.cc +++ b/chrome/browser/ash/arc/auth/arc_active_directory_enrollment_token_fetcher.cc
@@ -7,6 +7,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/logging.h" #include "chrome/browser/ash/arc/arc_optin_uma.h" @@ -15,7 +16,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/net/system_network_context_manager.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/cloud/dm_auth.h" #include "components/policy/core/common/cloud/dmserver_job_configurations.h"
diff --git a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc index ae0e12c..0cc742f 100644 --- a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc +++ b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.cc
@@ -8,6 +8,7 @@ #include "ash/frame/non_client_frame_view_ash.h" #include "base/bind.h" +#include "chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.h" #include "chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h" #include "chrome/grit/generated_resources.h" #include "components/exo/shell_surface_base.h" @@ -27,6 +28,8 @@ // UI specs. constexpr int kMenuEntrySize = 56; constexpr int kMenuEntrySideMargin = 24; +constexpr int kEditModeExitWidth = 140; +constexpr int kEditModeExitHeight = 184; constexpr SkColor kMenuEntryBgColor = SkColorSetA(SK_ColorWHITE, 0x99); constexpr int kCornerRadius = 8; @@ -126,6 +129,18 @@ menu_entry_ = parent_view->AddChildView(std::move(menu_entry)); } +void DisplayOverlayController::AddEditModeExitView( + views::Widget* overlay_widget) { + DCHECK(overlay_widget); + auto* parent_view = overlay_widget->GetContentsView(); + DCHECK(parent_view); + + // TODO(djacobo): Undefined vertical position, reusing whatever |entry_menu_| + // uses for now. + edit_mode_view_ = parent_view->AddChildView( + EditModeExitView::BuildView(this, CalculateEditModeExitPosition())); +} + void DisplayOverlayController::OnMenuEntryPressed() { auto* overlay_widget = GetOverlayWidget(); DCHECK(overlay_widget); @@ -159,6 +174,13 @@ menu_entry_ = nullptr; } +void DisplayOverlayController::RemoveEditModeExitView() { + if (!edit_mode_view_) + return; + edit_mode_view_->parent()->RemoveChildViewT(edit_mode_view_); + edit_mode_view_ = nullptr; +} + views::Widget* DisplayOverlayController::GetOverlayWidget() { auto* shell_surface_base = exo::GetShellSurfaceBaseForWindow(touch_injector_->target_window()); @@ -182,6 +204,19 @@ std::max(0, view->height() / 2 - kMenuEntrySize / 2)); } +gfx::Point DisplayOverlayController::CalculateEditModeExitPosition() { + auto* overlay_widget = GetOverlayWidget(); + if (!overlay_widget) + return gfx::Point(); + auto* view = overlay_widget->GetContentsView(); + if (!view || view->bounds().IsEmpty()) + return gfx::Point(); + + return gfx::Point( + std::max(0, view->width() - kEditModeExitWidth - kMenuEntrySideMargin), + std::max(0, view->height() / 2 - kEditModeExitHeight / 2)); +} + void DisplayOverlayController::SetDisplayMode(DisplayMode mode) { if (display_mode_ == mode) return; @@ -195,6 +230,7 @@ case DisplayMode::kNone: RemoveMenuEntryView(); RemoveInputMappingView(); + RemoveEditModeExitView(); break; case DisplayMode::kEducation: // TODO(cuicuiruan): Add educational dialog. @@ -211,6 +247,7 @@ case DisplayMode::kEdit: RemoveInputMenuView(); RemoveMenuEntryView(); + AddEditModeExitView(overlay_widget); overlay_widget->GetNativeWindow()->SetEventTargetingPolicy( aura::EventTargetingPolicy::kTargetAndDescendants); break;
diff --git a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h index 89c4986..70f44a8 100644 --- a/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h +++ b/chrome/browser/ash/arc/input_overlay/display_overlay_controller.h
@@ -25,6 +25,7 @@ class InputMappingView; class InputMenuView; class ActionEditMenu; +class EditModeExitView; // DisplayOverlayController manages the input mapping view, view and edit mode, // menu, and educational dialog. @@ -53,14 +54,17 @@ void AddInputMappingView(views::Widget* overlay_widget); void AddMenuEntryView(views::Widget* overlay_widget); + void AddEditModeExitView(views::Widget* overlay_widget); void OnMenuEntryPressed(); void RemoveInputMenuView(); void RemoveInputMappingView(); void RemoveMenuEntryView(); + void RemoveEditModeExitView(); views::Widget* GetOverlayWidget(); gfx::Point CalculateMenuEntryPosition(); + gfx::Point CalculateEditModeExitPosition(); bool HasMenuView() const; void SetInputMappingVisible(bool visible); bool GetInputMappingViewVisible() const; @@ -81,6 +85,7 @@ InputMenuView* input_menu_view_ = nullptr; views::ImageButton* menu_entry_ = nullptr; ActionEditMenu* action_edit_menu_ = nullptr; + EditModeExitView* edit_mode_view_ = nullptr; }; } // namespace input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.cc b/chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.cc new file mode 100644 index 0000000..d8d90b0 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.cc
@@ -0,0 +1,103 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.h" + +#include "ash/style/pill_button.h" +#include "base/bind.h" +#include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" +#include "chrome/grit/generated_resources.h" +#include "third_party/skia/include/core/SkColor.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/geometry/size.h" +#include "ui/views/background.h" +#include "ui/views/layout/flex_layout.h" +#include "ui/views/view_class_properties.h" + +namespace arc { +namespace input_overlay { + +namespace { +// General sizes. +constexpr int kMenuWidth = 140; +constexpr int kMenuHeight = 184; + +// Individual entry size. +constexpr int kButtonHeight = 56; + +// Spaces in between and misc. +constexpr int kSpaceRow = 8; +} // namespace + +// static +std::unique_ptr<EditModeExitView> EditModeExitView::BuildView( + DisplayOverlayController* display_overlay_controller, + gfx::Point position) { + auto menu_view_ptr = + std::make_unique<EditModeExitView>(display_overlay_controller); + menu_view_ptr->Init(position); + + return menu_view_ptr; +} + +EditModeExitView::EditModeExitView( + DisplayOverlayController* display_overlay_controller) + : display_overlay_controller_(display_overlay_controller) {} + +EditModeExitView::~EditModeExitView() {} + +void EditModeExitView::Init(gfx::Point position) { + // TODO(djacobo): Set proper fonts, also check if states needs to be manually + // tuned or if whatever its done by default works fine. + DCHECK(display_overlay_controller_); + SetLayoutManager(std::make_unique<views::FlexLayout>()) + ->SetOrientation(views::LayoutOrientation::kVertical) + .SetDefault(views::kMarginsKey, gfx::Insets( + /*vertical=*/kSpaceRow, + /*horizontal=*/0)); + SetBackground(views::CreateSolidBackground(SK_ColorTRANSPARENT)); + SetSize(gfx::Size(kMenuWidth, kMenuHeight)); + + reset_button_ = AddChildView(std::make_unique<ash::PillButton>( + base::BindRepeating(&EditModeExitView::OnResetButtonPressed, + base::Unretained(this)), + l10n_util::GetStringUTF16(IDS_INPUT_OVERLAY_EDIT_MODE_RESET), + ash::PillButton::Type::kIconless, + /*icon=*/nullptr)); + reset_button_->SetSize(gfx::Size(kMenuWidth, kButtonHeight)); + reset_button_->SetButtonTextColor(gfx::kGoogleGrey200); + + save_button_ = AddChildView(std::make_unique<ash::PillButton>( + base::BindRepeating(&EditModeExitView::OnSaveButtonPressed, + base::Unretained(this)), + l10n_util::GetStringUTF16(IDS_INPUT_OVERLAY_EDIT_MODE_SAVE), + ash::PillButton::Type::kIconless, + /*icon=*/nullptr)); + save_button_->SetSize(gfx::Size(kMenuWidth, kButtonHeight)); + save_button_->SetBackgroundColor(gfx::kGoogleBlue300); + save_button_->SetButtonTextColor(gfx::kGoogleGrey900); + + cancel_button_ = AddChildView(std::make_unique<ash::PillButton>( + base::BindRepeating(&EditModeExitView::OnCancelButtonPressed, + base::Unretained(this)), + l10n_util::GetStringUTF16(IDS_INPUT_OVERLAY_EDIT_MODE_CANCEL), + ash::PillButton::Type::kIconless, + /*icon=*/nullptr)); + cancel_button_->SetSize(gfx::Size(kMenuWidth, kButtonHeight)); + cancel_button_->SetButtonTextColor(gfx::kGoogleGrey200); + + SetPosition(position); +} + +// TODO(cuicuiruan|djacobo): Reload default key bindings. +void EditModeExitView::OnResetButtonPressed() {} + +// TODO(cuicuiruan|djacobo): Apply/store new key bindings. +void EditModeExitView::OnSaveButtonPressed() {} + +// TODO(cuicuiruan|djacobo): Undo current modifications to key bindings. +void EditModeExitView::OnCancelButtonPressed() {} + +} // namespace input_overlay +} // namespace arc
diff --git a/chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.h b/chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.h new file mode 100644 index 0000000..3e221b69 --- /dev/null +++ b/chrome/browser/ash/arc/input_overlay/ui/edit_mode_exit_view.h
@@ -0,0 +1,68 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_EDIT_MODE_EXIT_VIEW_H_ +#define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_EDIT_MODE_EXIT_VIEW_H_ + +#include <memory> + +#include "ui/gfx/geometry/point.h" +#include "ui/views/view.h" + +namespace ash { +class PillButton; +} // namespace ash + +// View displaying the 3 possible options to exit edit mode. +// +// These actions refer to what the user can do wrt customized key-bindings, they +// can either reset to a set of default key-bindings or just accept/cancel the +// ongoing changes. +// +// View looks like this: +// +----------------------+ +// | Reset to defaults | +// | | +// | Save | +// | | +// | Cancel | +// +----------------------+ + +namespace arc { +namespace input_overlay { + +class DisplayOverlayController; + +class EditModeExitView : public views::View { + public: + static std::unique_ptr<EditModeExitView> BuildView( + DisplayOverlayController* display_overlay_controller, + gfx::Point position); + + explicit EditModeExitView( + DisplayOverlayController* display_overlay_controller); + + EditModeExitView(const EditModeExitView&) = delete; + EditModeExitView& operator=(const EditModeExitView&) = delete; + ~EditModeExitView() override; + + private: + void Init(gfx::Point position); + + void OnResetButtonPressed(); + void OnSaveButtonPressed(); + void OnCancelButtonPressed(); + + ash::PillButton* reset_button_ = nullptr; + ash::PillButton* save_button_ = nullptr; + ash::PillButton* cancel_button_ = nullptr; + + // DisplayOverlayController owns |this| class, no need to deallocate. + DisplayOverlayController* const display_overlay_controller_ = nullptr; +}; + +} // namespace input_overlay +} // namespace arc + +#endif // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_EDIT_MODE_EXIT_VIEW_H_
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc index d911d39..5c58822 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc
@@ -8,8 +8,6 @@ #include "ash/style/ash_color_provider.h" #include "ash/style/pill_button.h" #include "base/bind.h" -// TODO(djacobo): Callbacks seem like an overkill provided how tightly -// integrated these classes are, but may be worthy to write it that way. #include "chrome/browser/ash/arc/input_overlay/constants.h" #include "chrome/browser/ash/arc/input_overlay/display_overlay_controller.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" @@ -58,13 +56,13 @@ // static std::unique_ptr<InputMenuView> InputMenuView::BuildMenuView( DisplayOverlayController* display_overlay_controller, - views::View* anchor_view) { + views::View* entry_view) { // Ensure there is only one menu at any time. if (display_overlay_controller->HasMenuView()) display_overlay_controller->RemoveInputMenuView(); auto menu_view_ptr = - std::make_unique<InputMenuView>(display_overlay_controller, anchor_view); + std::make_unique<InputMenuView>(display_overlay_controller, entry_view); menu_view_ptr->Init(); return menu_view_ptr; @@ -267,10 +265,10 @@ void InputMenuView::OnButtonCustomizedPressed() { DCHECK(display_overlay_controller_); - if (display_overlay_controller_) { - display_overlay_controller_->SetDisplayMode(DisplayMode::kEdit); - } - // TODO(djacobo|cuicuiruan): Show the save/cancel dialog. + if (!display_overlay_controller_) + return; + // Change display mode, load edit UI per action and overall edit buttons. + display_overlay_controller_->SetDisplayMode(DisplayMode::kEdit); } } // namespace input_overlay
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h index dc8ca0e1..890029b 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h +++ b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h
@@ -5,10 +5,10 @@ #ifndef CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_INPUT_MENU_VIEW_H_ #define CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_UI_INPUT_MENU_VIEW_H_ -#include "ui/views/view.h" - #include <memory> +#include "ui/views/view.h" + namespace ash { class PillButton; } // namespace ash @@ -40,11 +40,10 @@ public: static std::unique_ptr<InputMenuView> BuildMenuView( DisplayOverlayController* display_overlay_controller, - views::View* anchor_view); + views::View* entry_view); - // TODO(djacobo): Pass a callback to return responses to owner. InputMenuView(DisplayOverlayController* display_overlay_controller, - views::View* anchor_view); + views::View* entry_view); InputMenuView(const InputMenuView&) = delete; InputMenuView& operator=(const InputMenuView&) = delete;
diff --git a/chrome/browser/ash/attestation/tpm_challenge_key_subtle.cc b/chrome/browser/ash/attestation/tpm_challenge_key_subtle.cc index a21e3dd8..30a529e2 100644 --- a/chrome/browser/ash/attestation/tpm_challenge_key_subtle.cc +++ b/chrome/browser/ash/attestation/tpm_challenge_key_subtle.cc
@@ -7,6 +7,7 @@ #include "ash/components/attestation/attestation_flow_adaptive.h" #include "ash/components/cryptohome/cryptohome_parameters.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "base/base64.h" #include "base/bind.h" #include "base/check_op.h" @@ -31,7 +32,6 @@ #include "chromeos/dbus/constants/attestation_constants.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/authpolicy/authpolicy_helper.cc b/chrome/browser/ash/authpolicy/authpolicy_helper.cc index af30285..d507521 100644 --- a/chrome/browser/ash/authpolicy/authpolicy_helper.cc +++ b/chrome/browser/ash/authpolicy/authpolicy_helper.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/authpolicy/authpolicy_helper.h" +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/logging.h" @@ -15,7 +16,6 @@ #include "chromeos/dbus/authpolicy/authpolicy_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/upstart/upstart_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "crypto/encryptor.h" #include "crypto/hmac.h"
diff --git a/chrome/browser/ash/authpolicy/authpolicy_helper_unittest.cc b/chrome/browser/ash/authpolicy/authpolicy_helper_unittest.cc index 859b603..c104a78 100644 --- a/chrome/browser/ash/authpolicy/authpolicy_helper_unittest.cc +++ b/chrome/browser/ash/authpolicy/authpolicy_helper_unittest.cc
@@ -4,11 +4,11 @@ #include "chrome/browser/ash/authpolicy/authpolicy_helper.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "chromeos/dbus/authpolicy/fake_authpolicy_client.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/userdataauth/fake_install_attributes_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "testing/gtest/include/gtest/gtest.h" namespace ash {
diff --git a/chrome/browser/ash/borealis/borealis_features.cc b/chrome/browser/ash/borealis/borealis_features.cc index 8c49b48..3638b26 100644 --- a/chrome/browser/ash/borealis/borealis_features.cc +++ b/chrome/browser/ash/borealis/borealis_features.cc
@@ -3,10 +3,12 @@ // found in the LICENSE file. #include "chrome/browser/ash/borealis/borealis_features.h" + #include <memory> #include <string> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "base/base64.h" #include "base/callback.h" @@ -30,7 +32,6 @@ #include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" #include "components/version_info/channel.h" #include "crypto/sha2.h"
diff --git a/chrome/browser/ash/chrome_browser_main_parts_ash.cc b/chrome/browser/ash/chrome_browser_main_parts_ash.cc index 2fb79574..609b531 100644 --- a/chrome/browser/ash/chrome_browser_main_parts_ash.cc +++ b/chrome/browser/ash/chrome_browser_main_parts_ash.cc
@@ -25,6 +25,8 @@ #include "ash/components/peripheral_notification/peripheral_notification_manager.h" #include "ash/components/power/dark_resume_controller.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" +#include "ash/components/tpm/tpm_token_loader.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/keyboard/ui/resources/keyboard_resource_util.h" @@ -213,8 +215,6 @@ #include "chromeos/services/cros_healthd/public/cpp/service_connection.h" #include "chromeos/services/machine_learning/public/cpp/service_connection.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" -#include "chromeos/tpm/tpm_token_loader.h" #include "components/account_id/account_id.h" #include "components/device_event_log/device_event_log.h" #include "components/language/core/browser/pref_names.h" @@ -257,7 +257,7 @@ #include "ui/events/event_utils.h" #if BUILDFLAG(PLATFORM_CFM) -#include "chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.h" +#include "chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.h" #endif #if BUILDFLAG(ENABLE_RLZ) @@ -763,7 +763,7 @@ } #if BUILDFLAG(PLATFORM_CFM) - chromeos::cfm::InitializeCfmServices(); + cfm::InitializeCfmServices(); #endif // BUILDFLAG(PLATFORM_CFM) SystemProxyManager::Initialize(g_browser_process->local_state()); @@ -1512,7 +1512,7 @@ #if BUILDFLAG(PLATFORM_CFM) // Cleanly shutdown all Chromebox For Meetings services before DBus and other // critical services are destroyed - chromeos::cfm::ShutdownCfmServices(); + cfm::ShutdownCfmServices(); #endif // BUILDFLAG(PLATFORM_CFM) // Cleans up dbus services depending on ash.
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/OWNERS b/chrome/browser/ash/chromebox_for_meetings/OWNERS similarity index 100% rename from chrome/browser/chromeos/chromebox_for_meetings/OWNERS rename to chrome/browser/ash/chromebox_for_meetings/OWNERS
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.cc b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.cc similarity index 89% rename from chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.cc rename to chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.cc index 74c129c..3e95c57 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.cc +++ b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.cc
@@ -2,22 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h" #include "base/bind.h" #include "base/feature_list.h" +#include "chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.h" #include "chrome/browser/memory_details.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h" #include "components/variations/field_trial_config/field_trial_util.h" #include "mojo/public/cpp/bindings/receiver_set.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.h" - -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { + +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + static CfmBrowserService* g_browser_service = nullptr; + } // namespace // static @@ -105,5 +108,4 @@ CfmHotlineClient::Get()->RemoveObserver(this); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.h b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h similarity index 77% rename from chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.h rename to chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h index 581119c..87b8352 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.h +++ b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h
@@ -2,24 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_BROWSER_SERVICE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_BROWSER_SERVICE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_BROWSER_SERVICE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_BROWSER_SERVICE_H_ #include "base/memory/weak_ptr.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_observer.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/cfm_browser.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Implementation of the CfmBrowser Service. // The lifespan of this service is indicative of the lifespan of chrome browser // process, allowing |CfmServiceContext| to rebuild its IPC graph if required. class CfmBrowserService : public CfmObserver, public ServiceAdaptor::Delegate, - public mojom::CfmBrowser { + public chromeos::cfm::mojom::CfmBrowser { public: CfmBrowserService(const CfmBrowserService&) = delete; CfmBrowserService& operator=(const CfmBrowserService&) = delete; @@ -50,14 +49,13 @@ ~CfmBrowserService() override; ServiceAdaptor service_adaptor_; - mojo::ReceiverSet<mojom::CfmBrowser> receivers_; + mojo::ReceiverSet<chromeos::cfm::mojom::CfmBrowser> receivers_; // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory<CfmBrowserService> weak_ptr_factory_{this}; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_BROWSER_SERVICE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_BROWSER_SERVICE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc similarity index 95% rename from chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc rename to chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc index 6218633d..f877af8 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc +++ b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h" #include <memory> #include <utility> @@ -30,10 +30,12 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + class CfmBrowserServiceTest : public testing::Test { public: CfmBrowserServiceTest() = default; @@ -149,5 +151,4 @@ } } // namespace -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.cc similarity index 96% rename from chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc rename to chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.cc index a4a4d78..0f374a0 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.cc +++ b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.h" +#include "chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.h" #include "base/bind.h" #include "base/strings/utf_string_conversions.h" @@ -15,8 +15,10 @@ #include "extensions/buildflags/buildflags.h" #include "extensions/common/extension_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { + +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; // static void CfmMemoryDetails::Collect( @@ -176,5 +178,4 @@ Release(); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.h b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.h new file mode 100644 index 0000000..554103b --- /dev/null +++ b/chrome/browser/ash/chromebox_for_meetings/browser/cfm_memory_details.h
@@ -0,0 +1,46 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_MEMORY_DETAILS_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_MEMORY_DETAILS_H_ + +#include "chrome/browser/memory_details.h" +#include "chromeos/services/chromebox_for_meetings/public/mojom/cfm_browser.mojom.h" +#include "content/public/browser/render_process_host.h" + +namespace ash::cfm { + +// Log details about all Chrome processes. +class CfmMemoryDetails final : public MemoryDetails { + public: + // Collects the memory details asynchronously. + static void Collect( + chromeos::cfm::mojom::CfmBrowser::GetMemoryDetailsCallback callback); + + CfmMemoryDetails(const CfmMemoryDetails&) = delete; + CfmMemoryDetails& operator=(const CfmMemoryDetails&) = delete; + + private: + explicit CfmMemoryDetails( + chromeos::cfm::mojom::CfmBrowser::GetMemoryDetailsCallback callback); + ~CfmMemoryDetails() override; + + // MemoryDetails overrides: + void OnDetailsAvailable() override; + + void CollectProcessInformation(); + void CollectExtensionsInformation(); + void UpdateGpuInfo(); + void FinishFetch(); + + base::GraphicsMemoryInfoKB gpu_meminfo_; + std::vector<chromeos::cfm::mojom::ProcessDataPtr> proc_data_list_; + std::map<base::ProcessId, chromeos::cfm::mojom::ProcessMemoryInformationPtr*> + proc_mem_info_map_; + chromeos::cfm::mojom::CfmBrowser::GetMemoryDetailsCallback callback_; +}; + +} // namespace ash::cfm + +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_MEMORY_DETAILS_H_
diff --git a/chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.cc b/chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.cc new file mode 100644 index 0000000..13bf4cb7 --- /dev/null +++ b/chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.cc
@@ -0,0 +1,46 @@ +// 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/ash/chromebox_for_meetings/cfm_chrome_services.h" + +#include "chrome/browser/ash/chromebox_for_meetings/browser/cfm_browser_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.h" +#include "chromeos/components/chromebox_for_meetings/features/features.h" +#include "chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h" + +namespace ash::cfm { + +void InitializeCfmServices() { + if (!base::FeatureList::IsEnabled(features::kMojoServices) || + !CfmHotlineClient::Get()) { + return; + } + + CfmBrowserService::Initialize(); + CfmLoggerService::Initialize(); + DeviceInfoService::Initialize(); + DiagnosticsService::Initialize(); + NetworkSettingsService::Initialize(); + ExternalDisplayBrightnessService::Initialize(); +} + +void ShutdownCfmServices() { + if (!base::FeatureList::IsEnabled(features::kMojoServices) || + !CfmHotlineClient::Get()) { + return; + } + + ExternalDisplayBrightnessService::Shutdown(); + NetworkSettingsService::Shutdown(); + DiagnosticsService::Shutdown(); + DeviceInfoService::Shutdown(); + CfmLoggerService::Shutdown(); + CfmBrowserService::Shutdown(); +} + +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.h b/chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.h similarity index 61% rename from chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.h rename to chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.h index 6ec99ab..6f07090 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.h +++ b/chrome/browser/ash/chromebox_for_meetings/cfm_chrome_services.h
@@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_CFM_CHROME_SERVICES_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_CFM_CHROME_SERVICES_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_CFM_CHROME_SERVICES_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_CFM_CHROME_SERVICES_H_ #include "base/observer_list_types.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Registers the observers for service interface requests by the // |CfmServiceContext| granting hotline access to services. @@ -18,7 +17,6 @@ // |CfmServiceContext| removing hotline access to services. void ShutdownCfmServices(); -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_CFM_CHROME_SERVICES_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_CFM_CHROME_SERVICES_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.cc b/chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.cc similarity index 94% rename from chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.cc rename to chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.cc index 3b9b1c0..566b4b8 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.cc +++ b/chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h" #include <cstdint> @@ -19,10 +19,13 @@ #include "mojo/public/cpp/bindings/receiver_set.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { + +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + constexpr char kRootPartition[] = "/"; constexpr char kStatefulPartition[] = "/mnt/stateful_partition"; constexpr char kReleaseVersion[] = "CHROMEOS_RELEASE_VERSION"; @@ -83,8 +86,8 @@ } VLOG(3) << "mojom::DeviceInfo Service Adaptor is connected."; - CHECK(ash::DeviceSettingsService::IsInitialized()); - ash::DeviceSettingsService::Get()->AddObserver(this); + CHECK(DeviceSettingsService::IsInitialized()); + DeviceSettingsService::Get()->AddObserver(this); } void DeviceInfoService::OnAdaptorDisconnect() { @@ -135,7 +138,7 @@ void DeviceInfoService::PopulatePolicyInfoFromProto( mojom::PolicyInfoPtr& policy_info) { - auto* device_settings = ash::DeviceSettingsService::Get(); + auto* device_settings = DeviceSettingsService::Get(); if (!device_settings || !device_settings->policy_data()) { return; @@ -168,7 +171,7 @@ void DeviceInfoService::PopulateChromeDeviceSettingsFromProto( mojom::PolicyInfoPtr& policy_info) { - auto* device_settings = ash::DeviceSettingsService::Get(); + auto* device_settings = DeviceSettingsService::Get(); if (!device_settings || !device_settings->device_settings()) { return; @@ -288,8 +291,7 @@ void DeviceInfoService::Reset() { receivers_.Clear(); policy_remotes_.Clear(); - ash::DeviceSettingsService::Get()->RemoveObserver(this); + DeviceSettingsService::Get()->RemoveObserver(this); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.h b/chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h similarity index 73% rename from chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.h rename to chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h index 0112447..39dfc627 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.h +++ b/chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h
@@ -2,26 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ #include "base/memory/weak_ptr.h" #include "base/task/sequenced_task_runner.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chrome/browser/ash/settings/device_settings_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_observer.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/meet_devices_info.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Implementation of the DeviceInfo Service. // Allowing query to relevant device information class DeviceInfoService : public CfmObserver, public ServiceAdaptor::Delegate, - public mojom::MeetDevicesInfo, + public chromeos::cfm::mojom::MeetDevicesInfo, public DeviceSettingsService::Observer { public: DeviceInfoService(const DeviceInfoService&) = delete; @@ -46,9 +45,10 @@ void DeviceSettingsUpdated() override; void OnDeviceSettingsServiceShutdown() override; - // ::mojom::DeviceInfo implementation + // mojom::MeetDevicesInfo implementation void AddDeviceSettingsObserver( - ::mojo::PendingRemote<mojom::PolicyInfoObserver> observer) override; + ::mojo::PendingRemote<chromeos::cfm::mojom::PolicyInfoObserver> observer) + override; void GetPolicyInfo(GetPolicyInfoCallback callback) override; void GetSysInfo(GetSysInfoCallback callback) override; void GetMachineStatisticsInfo( @@ -62,10 +62,12 @@ ~DeviceInfoService() override; // Populate mojom with information from PolicyInfo - void PopulatePolicyInfoFromProto(mojom::PolicyInfoPtr& policy_info); + void PopulatePolicyInfoFromProto( + chromeos::cfm::mojom::PolicyInfoPtr& policy_info); // Populate mojom with information from ChromeDeviceSettingsProto - void PopulateChromeDeviceSettingsFromProto(mojom::PolicyInfoPtr& policy_info); + void PopulateChromeDeviceSettingsFromProto( + chromeos::cfm::mojom::PolicyInfoPtr& policy_info); // Update boolean indicating if Machine Statistics have loaded. void ScheduleOnMachineStatisticsLoaded(); @@ -77,10 +79,10 @@ void Reset(); ServiceAdaptor service_adaptor_; - mojo::ReceiverSet<mojom::MeetDevicesInfo> receivers_; - mojo::RemoteSet<mojom::PolicyInfoObserver> policy_remotes_; + mojo::ReceiverSet<chromeos::cfm::mojom::MeetDevicesInfo> receivers_; + mojo::RemoteSet<chromeos::cfm::mojom::PolicyInfoObserver> policy_remotes_; - mojom::PolicyInfoPtr current_policy_info_; + chromeos::cfm::mojom::PolicyInfoPtr current_policy_info_; scoped_refptr<base::SequencedTaskRunner> task_runner_; @@ -91,7 +93,6 @@ base::WeakPtrFactory<DeviceInfoService> weak_ptr_factory_{this}; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_DEVICE_INFO_DEVICE_INFO_SERVICE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service_unittest.cc b/chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service_unittest.cc similarity index 93% rename from chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service_unittest.cc rename to chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service_unittest.cc index d0ce345..e0aab15b 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service_unittest.cc +++ b/chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/device_info/device_info_service.h" #include <memory> #include <utility> @@ -35,10 +35,12 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + constexpr char kReleaseVersion[] = "13671.0.2020"; class CfmDeviceInfoServiceTest : public ::testing::Test { @@ -52,8 +54,8 @@ new ownership::MockOwnerKeyUtil()); owner_key_util_->SetPublicKeyFromPrivateKey( *device_policy_.GetSigningKey()); - ash::DeviceSettingsService::Get()->SetSessionManager( - &session_manager_client_, owner_key_util_); + DeviceSettingsService::Get()->SetSessionManager(&session_manager_client_, + owner_key_util_); CfmHotlineClient::InitializeFake(); ServiceConnection::UseFakeServiceConnectionForTesting( @@ -66,7 +68,7 @@ void TearDown() override { DeviceInfoService::Shutdown(); CfmHotlineClient::Shutdown(); - ash::DeviceSettingsService::Get()->UnsetSessionManager(); + DeviceSettingsService::Get()->UnsetSessionManager(); } FakeCfmHotlineClient* GetClient() { @@ -86,7 +88,7 @@ device_policy_.policy_data().set_device_id(cros_device_id); device_policy_.Build(); session_manager_client_.set_device_policy(device_policy_.GetBlob()); - ash::DeviceSettingsService::Get()->Load(); + DeviceSettingsService::Get()->Load(); content::RunAllTasksUntilIdle(); } @@ -135,7 +137,7 @@ protected: FakeCfmServiceContext context_; FakeServiceConnectionImpl fake_service_connection_; - ash::ScopedTestDeviceSettingsService scoped_device_settings_service_; + ScopedTestDeviceSettingsService scoped_device_settings_service_; chromeos::FakeSessionManagerClient session_manager_client_; chromeos::system::FakeStatisticsProvider fake_statistics_provider_; mojo::ReceiverSet<mojom::CfmServiceContext> context_receiver_set_; @@ -234,5 +236,4 @@ } } // namespace -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.cc b/chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.cc similarity index 90% rename from chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.cc rename to chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.cc index a8a3ceb..857d754 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.cc +++ b/chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h" #include <utility> @@ -11,11 +11,16 @@ #include "chromeos/services/cros_healthd/public/cpp/service_connection.h" #include "mojo/public/cpp/bindings/receiver_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { + +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace cros_healthd = ::chromeos::cros_healthd; +namespace mojom = ::chromeos::cfm::mojom; + static DiagnosticsService* g_info_service = nullptr; + } // namespace // static @@ -96,5 +101,4 @@ CfmHotlineClient::Get()->RemoveObserver(this); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.h b/chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h similarity index 73% rename from chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.h rename to chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h index 3c6ec94..995db3d 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.h +++ b/chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h
@@ -2,22 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_DIAGNOSTICS_DIAGNOSTICS_SERVICE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_DIAGNOSTICS_DIAGNOSTICS_SERVICE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_DIAGNOSTICS_DIAGNOSTICS_SERVICE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_DIAGNOSTICS_DIAGNOSTICS_SERVICE_H_ #include "base/memory/weak_ptr.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_observer.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/meet_devices_diagnostics.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Implementation of the MeetDevicesDiagnostics Service. class DiagnosticsService : public CfmObserver, public ServiceAdaptor::Delegate, - public mojom::MeetDevicesDiagnostics { + public chromeos::cfm::mojom::MeetDevicesDiagnostics { public: DiagnosticsService(const DiagnosticsService&) = delete; DiagnosticsService& operator=(const DiagnosticsService&) = delete; @@ -50,10 +49,9 @@ ~DiagnosticsService() override; ServiceAdaptor service_adaptor_; - mojo::ReceiverSet<mojom::MeetDevicesDiagnostics> receivers_; + mojo::ReceiverSet<chromeos::cfm::mojom::MeetDevicesDiagnostics> receivers_; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_DIAGNOSTICS_DIAGNOSTICS_SERVICE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_DIAGNOSTICS_DIAGNOSTICS_SERVICE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc b/chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc similarity index 95% rename from chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc rename to chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc index a316707..96a6a9c 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc +++ b/chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/diagnostics/diagnostics_service.h" #include <memory> #include <utility> @@ -30,10 +30,13 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace cros_healthd = ::chromeos::cros_healthd; +namespace mojom = ::chromeos::cfm::mojom; + class CfmDiagnosticsServiceTest : public ::testing::Test { public: CfmDiagnosticsServiceTest() = default; @@ -166,5 +169,4 @@ } } // namespace -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc b/chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc similarity index 93% rename from chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc rename to chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc index d9d928e..86423df5 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc +++ b/chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc
@@ -2,17 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/power_manager/backlight.pb.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + static ExternalDisplayBrightnessService* g_external_display_brightness_service = nullptr; @@ -129,5 +131,4 @@ CfmHotlineClient::Get()->RemoveObserver(this); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h b/chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h similarity index 78% rename from chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h rename to chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h index be0dfcce..374195b 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h +++ b/chrome/browser/ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h
@@ -2,23 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_EXTERNAL_DISPLAY_BRIGHTNESS_EXTERNAL_DISPLAY_BRIGHTNESS_SERVICE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_EXTERNAL_DISPLAY_BRIGHTNESS_EXTERNAL_DISPLAY_BRIGHTNESS_SERVICE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_EXTERNAL_DISPLAY_BRIGHTNESS_EXTERNAL_DISPLAY_BRIGHTNESS_SERVICE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_EXTERNAL_DISPLAY_BRIGHTNESS_EXTERNAL_DISPLAY_BRIGHTNESS_SERVICE_H_ -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_observer.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/external_display_brightness.mojom-shared.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/external_display_brightness.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { class ExternalDisplayBrightnessService : public CfmObserver, public ServiceAdaptor::Delegate, - public mojom::ExternalDisplayBrightness { + public chromeos::cfm::mojom::ExternalDisplayBrightness { public: ExternalDisplayBrightnessService(const ExternalDisplayBrightnessService&) = delete; @@ -63,10 +62,9 @@ absl::optional<double> percent); ServiceAdaptor service_adaptor_; - mojo::ReceiverSet<mojom::ExternalDisplayBrightness> receivers_; + mojo::ReceiverSet<chromeos::cfm::mojom::ExternalDisplayBrightness> receivers_; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_EXTERNAL_DISPLAY_BRIGHTNESS_EXTERNAL_DISPLAY_BRIGHTNESS_SERVICE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_EXTERNAL_DISPLAY_BRIGHTNESS_EXTERNAL_DISPLAY_BRIGHTNESS_SERVICE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.cc b/chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.cc similarity index 93% rename from chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.cc rename to chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.cc index c852e1f..18518fb 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.cc +++ b/chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.cc
@@ -2,20 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h" #include "base/bind.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.h" +#include "chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.h" #include "chromeos/components/chromebox_for_meetings/features/features.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/meet_devices_logger.mojom-shared.h" #include "mojo/public/cpp/bindings/receiver_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + // Implementation of the CfmLoggerService which uses the Chrome Encrypted // Reporting Pipeline APIs to define the delegate's functionality class CfmERPLoggerService : public CfmLoggerService { @@ -160,5 +162,4 @@ CfmHotlineClient::Get()->RemoveObserver(this); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h b/chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h similarity index 73% rename from chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h rename to chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h index 4ec35b5..4f68f3ca 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h +++ b/chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_LOGGER_CFM_LOGGER_SERVICE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_LOGGER_CFM_LOGGER_SERVICE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_LOGGER_CFM_LOGGER_SERVICE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_LOGGER_CFM_LOGGER_SERVICE_H_ #include "base/memory/weak_ptr.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_observer.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/meet_devices_logger.mojom-shared.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/meet_devices_logger.mojom.h" @@ -14,13 +14,12 @@ #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Implementation of the MeetDevicesLogger Service. class CfmLoggerService : public CfmObserver, public ServiceAdaptor::Delegate, - public mojom::MeetDevicesLogger { + public chromeos::cfm::mojom::MeetDevicesLogger { public: class Delegate { public: @@ -39,7 +38,7 @@ // Forwards a request to enqueue a serialised message to be processed. virtual void Enqueue(const std::string& record, - mojom::EnqueuePriority priority, + chromeos::cfm::mojom::EnqueuePriority priority, EnqueueCallback callback) = 0; protected: @@ -72,13 +71,14 @@ // mojom::MeetDevicesLogger implementation void Enqueue(const std::string& record, - mojom::EnqueuePriority priority, + chromeos::cfm::mojom::EnqueuePriority priority, EnqueueCallback callback) override; - void AddStateObserver(mojo::PendingRemote<mojom::LoggerStateObserver> - pending_observer) override; + void AddStateObserver( + mojo::PendingRemote<chromeos::cfm::mojom::LoggerStateObserver> + pending_observer) override; // Notifies registered observers of changes in the state of the service. - void NotifyStateObserver(mojom::LoggerState state); + void NotifyStateObserver(chromeos::cfm::mojom::LoggerState state); // Set the CfmLoggerService::Delegate void SetDelegate(Delegate* delegate); @@ -86,12 +86,11 @@ private: Delegate* delegate_; ServiceAdaptor service_adaptor_; - mojo::ReceiverSet<mojom::MeetDevicesLogger> receivers_; - mojom::LoggerState current_logger_state_; - mojo::RemoteSet<mojom::LoggerStateObserver> observer_list_; + mojo::ReceiverSet<chromeos::cfm::mojom::MeetDevicesLogger> receivers_; + chromeos::cfm::mojom::LoggerState current_logger_state_; + mojo::RemoteSet<chromeos::cfm::mojom::LoggerStateObserver> observer_list_; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_LOGGER_CFM_LOGGER_SERVICE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_LOGGER_CFM_LOGGER_SERVICE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc b/chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc similarity index 96% rename from chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc rename to chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc index a0f31d23..9da8d71f7 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc +++ b/chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h" #include <memory> #include <utility> @@ -29,10 +29,12 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/abseil-cpp/absl/types/optional.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + class FakeCfmLoggerServiceDelegate : public CfmLoggerService::Delegate { public: void Init() override { init_count_++; } @@ -242,5 +244,4 @@ } } // namespace -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.cc b/chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.cc similarity index 92% rename from chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.cc rename to chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.cc index d1cd494..e16e838c 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.cc +++ b/chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.h" +#include "chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.h" #include <cstdint> #include <memory> @@ -13,10 +13,13 @@ #include "components/reporting/client/report_queue_provider.h" #include "components/reporting/proto/synced/record_constants.pb.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { + +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + ::reporting::Priority ToReportingPriority(mojom::EnqueuePriority priority) { switch (priority) { case mojom::EnqueuePriority::kHigh: @@ -57,14 +60,14 @@ } void ReportingPipeline::Init() { - CHECK(ash::DeviceSettingsService::IsInitialized()); - ash::DeviceSettingsService::Get()->AddObserver(this); + CHECK(DeviceSettingsService::IsInitialized()); + DeviceSettingsService::Get()->AddObserver(this); // Device settings update may not be triggered in some cases DeviceSettingsUpdated(); } void ReportingPipeline::Reset() { - ash::DeviceSettingsService::Get()->RemoveObserver(this); + DeviceSettingsService::Get()->RemoveObserver(this); dm_token_.clear(); update_status_callback_.Run(mojom::LoggerState::kUninitialized); } @@ -97,7 +100,7 @@ } void ReportingPipeline::DeviceSettingsUpdated() { - auto* policy_data = ash::DeviceSettingsService::Get()->policy_data(); + auto* policy_data = DeviceSettingsService::Get()->policy_data(); if (!policy_data || !policy_data->has_request_token() || policy_data->request_token().empty()) { @@ -155,7 +158,7 @@ ::reporting::Status ReportingPipeline::CheckPolicy() const { auto* chrome_device_settings = - ash::DeviceSettingsService::Get()->device_settings(); + DeviceSettingsService::Get()->device_settings(); bool policy_enabled = false; if (chrome_device_settings && @@ -195,5 +198,4 @@ weak_ptr_factory_.GetWeakPtr())); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.h b/chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.h similarity index 73% rename from chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.h rename to chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.h index 605d58b..f8e5666b 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/logger/reporting_pipeline.h +++ b/chrome/browser/ash/chromebox_for_meetings/logger/reporting_pipeline.h
@@ -2,28 +2,28 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_LOGGER_REPORTING_PIPELINE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_LOGGER_REPORTING_PIPELINE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_LOGGER_REPORTING_PIPELINE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_LOGGER_REPORTING_PIPELINE_H_ #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/task/sequenced_task_runner.h" +#include "chrome/browser/ash/chromebox_for_meetings/logger/cfm_logger_service.h" #include "chrome/browser/ash/settings/device_settings_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h" +#include "chromeos/services/chromebox_for_meetings/public/mojom/meet_devices_logger.mojom-shared.h" #include "components/reporting/client/report_queue.h" #include "components/reporting/client/report_queue_provider.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Implementation of the CfmLoggerService::Delegate usign the chrome encrypted // reporting pipeline. class ReportingPipeline : public CfmLoggerService::Delegate, - public ash::DeviceSettingsService::Observer { + public DeviceSettingsService::Observer { public: // Args: mojom::MeetDevicesLogger: The current enabled state of the service. using UpdateStatusCallback = - base::RepeatingCallback<void(mojom::LoggerState)>; + base::RepeatingCallback<void(chromeos::cfm::mojom::LoggerState)>; explicit ReportingPipeline(UpdateStatusCallback update_status_callback); ReportingPipeline(const ReportingPipeline&) = delete; @@ -34,11 +34,11 @@ void Init() override; void Reset() override; void Enqueue(const std::string& record, - mojom::EnqueuePriority priority, + chromeos::cfm::mojom::EnqueuePriority priority, CfmLoggerService::EnqueueCallback callback) override; protected: - // ::ash::DeviceSettingsService::Observer impl + // DeviceSettingsService::Observer impl void DeviceSettingsUpdated() override; void OnDeviceSettingsServiceShutdown() override; @@ -61,7 +61,6 @@ base::WeakPtrFactory<ReportingPipeline> weak_ptr_factory_{this}; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_LOGGER_REPORTING_PIPELINE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_LOGGER_REPORTING_PIPELINE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.cc b/chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.cc similarity index 87% rename from chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.cc rename to chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.cc index f762109..0141f65 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.cc +++ b/chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.cc
@@ -2,18 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.h" +#include "chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.h" #include <utility> #include "chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { namespace { + +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; + NetworkSettingsService* g_network_settings_service = nullptr; + } // namespace NetworkSettingsService::NetworkSettingsService() @@ -69,5 +73,4 @@ receivers_.Clear(); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.h b/chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.h similarity index 69% rename from chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.h rename to chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.h index e5d151b..c099fd0 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.h +++ b/chrome/browser/ash/chromebox_for_meetings/network_settings/network_settings_service.h
@@ -2,23 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_NETWORK_SETTINGS_SERVICE_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_NETWORK_SETTINGS_SERVICE_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_NETWORK_SETTINGS_SERVICE_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_NETWORK_SETTINGS_SERVICE_H_ #include <string> -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chromeos/dbus/chromebox_for_meetings/cfm_observer.h" #include "chromeos/services/chromebox_for_meetings/public/mojom/cfm_network_settings.mojom.h" #include "mojo/public/cpp/bindings/receiver_set.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Hotline service allowing CFMs to open the network settings dialog from Meet. class NetworkSettingsService : public CfmObserver, public ServiceAdaptor::Delegate, - public mojom::CfmNetworkSettings { + public chromeos::cfm::mojom::CfmNetworkSettings { public: ~NetworkSettingsService() override; @@ -44,10 +43,9 @@ NetworkSettingsService(); ServiceAdaptor service_adaptor_; - mojo::ReceiverSet<mojom::CfmNetworkSettings> receivers_; + mojo::ReceiverSet<chromeos::cfm::mojom::CfmNetworkSettings> receivers_; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_NETWORK_SETTINGS_SERVICE_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_NETWORK_SETTINGS_SERVICE_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.cc b/chrome/browser/ash/chromebox_for_meetings/service_adaptor.cc similarity index 90% rename from chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.cc rename to chrome/browser/ash/chromebox_for_meetings/service_adaptor.cc index 6dba45a..665441c 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.cc +++ b/chrome/browser/ash/chromebox_for_meetings/service_adaptor.cc
@@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include "chromeos/services/chromebox_for_meetings/public/cpp/service_connection.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { void ServiceAdaptor::Delegate::OnAdaptorConnect(bool success) {} @@ -20,7 +19,7 @@ ServiceAdaptor::~ServiceAdaptor() = default; -mojom::CfmServiceContext* ServiceAdaptor::GetContext() { +chromeos::cfm::mojom::CfmServiceContext* ServiceAdaptor::GetContext() { if (!context_.is_bound()) { ServiceConnection::GetInstance()->BindServiceContext( context_.BindNewPipeAndPassReceiver()); @@ -73,5 +72,4 @@ delegate_->OnAdaptorDisconnect(); } -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h b/chrome/browser/ash/chromebox_for_meetings/service_adaptor.h similarity index 81% rename from chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h rename to chrome/browser/ash/chromebox_for_meetings/service_adaptor.h index 96722d0..b7e7134 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h +++ b/chrome/browser/ash/chromebox_for_meetings/service_adaptor.h
@@ -2,22 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_SERVICE_ADAPTOR_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_SERVICE_ADAPTOR_H_ +#ifndef CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_SERVICE_ADAPTOR_H_ +#define CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_SERVICE_ADAPTOR_H_ #include "chromeos/services/chromebox_for_meetings/public/mojom/cfm_service_manager.mojom.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" -namespace chromeos { -namespace cfm { +namespace ash::cfm { // Abstract class that provides convenience methods, allowing new CfM Services // to register with the |CfmServiceContext| through its mojo |Interface| -class ServiceAdaptor : public mojom::CfmServiceAdaptor { +class ServiceAdaptor : public chromeos::cfm::mojom::CfmServiceAdaptor { public: using GetServiceCallback = - mojom::CfmServiceContext::RequestBindServiceCallback; + chromeos::cfm::mojom::CfmServiceContext::RequestBindServiceCallback; class Delegate { public: @@ -47,7 +46,7 @@ ~ServiceAdaptor() override; // Returns the primary |mojom::CfmServiceContext| - virtual mojom::CfmServiceContext* GetContext(); + virtual chromeos::cfm::mojom::CfmServiceContext* GetContext(); // Binds a |mojo::Remote| to the primary |mojom::CfmServiceContext| virtual void BindServiceAdaptor(); @@ -83,13 +82,12 @@ Delegate* const delegate_; - mojo::Remote<mojom::CfmServiceContext> context_; - mojo::Receiver<mojom::CfmServiceAdaptor> adaptor_{this}; + mojo::Remote<chromeos::cfm::mojom::CfmServiceContext> context_; + mojo::Receiver<chromeos::cfm::mojom::CfmServiceAdaptor> adaptor_{this}; base::WeakPtrFactory<ServiceAdaptor> weak_ptr_factory_{this}; }; -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_SERVICE_ADAPTOR_H_ +#endif // CHROME_BROWSER_ASH_CHROMEBOX_FOR_MEETINGS_SERVICE_ADAPTOR_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/service_adaptor_unittest.cc b/chrome/browser/ash/chromebox_for_meetings/service_adaptor_unittest.cc similarity index 94% rename from chrome/browser/chromeos/chromebox_for_meetings/service_adaptor_unittest.cc rename to chrome/browser/ash/chromebox_for_meetings/service_adaptor_unittest.cc index 7a59102..e413ea6 100644 --- a/chrome/browser/chromeos/chromebox_for_meetings/service_adaptor_unittest.cc +++ b/chrome/browser/ash/chromebox_for_meetings/service_adaptor_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/chromeos/chromebox_for_meetings/service_adaptor.h" +#include "chrome/browser/ash/chromebox_for_meetings/service_adaptor.h" #include <utility> #include <vector> @@ -24,15 +24,17 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" +namespace ash::cfm { +namespace { + using ::testing::_; using ::testing::Invoke; using ::testing::Return; using ::testing::StrictMock; using ::testing::WithArgs; -namespace chromeos { -namespace cfm { -namespace { +// TODO(https://crbug.com/1164001): remove after the migration to namespace ash. +namespace mojom = ::chromeos::cfm::mojom; class FakeDelegate : public ServiceAdaptor::Delegate { public: @@ -125,5 +127,4 @@ } } // namespace -} // namespace cfm -} // namespace chromeos +} // namespace ash::cfm
diff --git a/chrome/browser/ash/crosapi/BUILD.gn b/chrome/browser/ash/crosapi/BUILD.gn index c78817b..1dac78d 100644 --- a/chrome/browser/ash/crosapi/BUILD.gn +++ b/chrome/browser/ash/crosapi/BUILD.gn
@@ -185,6 +185,7 @@ "//ash/components/cryptohome", "//ash/components/login/auth", "//ash/components/settings:settings", + "//ash/components/tpm", "//ash/constants", "//base", "//chrome/browser:browser_process", @@ -213,7 +214,6 @@ "//chromeos/services/machine_learning/public/cpp", "//chromeos/startup:constants", "//chromeos/system", - "//chromeos/tpm", "//components/arc", "//components/crash/core/app", "//components/exo",
diff --git a/chrome/browser/ash/crosapi/cert_database_ash.cc b/chrome/browser/ash/crosapi/cert_database_ash.cc index d9436b5..5d90a8f 100644 --- a/chrome/browser/ash/crosapi/cert_database_ash.cc +++ b/chrome/browser/ash/crosapi/cert_database_ash.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/crosapi/cert_database_ash.h" +#include "ash/components/tpm/tpm_token_info_getter.h" #include "base/bind.h" #include "base/system/sys_info.h" #include "chrome/browser/ash/profiles/profile_helper.h" @@ -12,7 +13,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chromeos/crosapi/mojom/cert_database.mojom.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/tpm/tpm_token_info_getter.h" #include "components/account_id/account_id.h" #include "components/user_manager/user.h" #include "content/public/browser/browser_task_traits.h"
diff --git a/chrome/browser/ash/crosapi/crosapi_util.cc b/chrome/browser/ash/crosapi/crosapi_util.cc index 3fca2c2a..ac5a389 100644 --- a/chrome/browser/ash/crosapi/crosapi_util.cc +++ b/chrome/browser/ash/crosapi/crosapi_util.cc
@@ -7,6 +7,7 @@ #include <sys/mman.h> #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" @@ -81,7 +82,6 @@ #include "chromeos/crosapi/mojom/web_app_service.mojom.h" #include "chromeos/crosapi/mojom/web_page_info.mojom.h" #include "chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_manager_core/account_manager_util.h" #include "components/metrics/metrics_pref_names.h" #include "components/metrics/metrics_service.h"
diff --git a/chrome/browser/ash/crosapi/environment_provider.cc b/chrome/browser/ash/crosapi/environment_provider.cc index ae20f105..fce0ba3 100644 --- a/chrome/browser/ash/crosapi/environment_provider.cc +++ b/chrome/browser/ash/crosapi/environment_provider.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/crosapi/environment_provider.h" +#include "ash/components/tpm/install_attributes.h" #include "base/files/file_util.h" #include "base/path_service.h" #include "base/system/sys_info.h" @@ -14,7 +15,6 @@ #include "chrome/browser/profiles/profiles_state.h" #include "chromeos/crosapi/mojom/crosapi.mojom.h" #include "chromeos/dbus/cros_disks/cros_disks_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "components/account_manager_core/account.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h"
diff --git a/chrome/browser/ash/dbus/ash_dbus_helper.cc b/chrome/browser/ash/dbus/ash_dbus_helper.cc index 9bd4f50..893902a 100644 --- a/chrome/browser/ash/dbus/ash_dbus_helper.cc +++ b/chrome/browser/ash/dbus/ash_dbus_helper.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/dbus/ash_dbus_helper.h" #include "ash/components/cryptohome/system_salt_getter.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_paths.h" #include "base/files/file_path.h" @@ -61,7 +62,6 @@ #include "chromeos/dbus/userdataauth/cryptohome_pkcs11_client.h" #include "chromeos/dbus/userdataauth/install_attributes_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/tpm/install_attributes.h" #include "device/bluetooth/dbus/bluez_dbus_manager.h" #include "device/bluetooth/floss/floss_dbus_manager.h" #include "device/bluetooth/floss/floss_features.h"
diff --git a/chrome/browser/ash/dbus/chrome_features_service_provider.cc b/chrome/browser/ash/dbus/chrome_features_service_provider.cc index 173d20b1..fa5a3c76 100644 --- a/chrome/browser/ash/dbus/chrome_features_service_provider.cc +++ b/chrome/browser/ash/dbus/chrome_features_service_provider.cc
@@ -12,6 +12,7 @@ #include "ash/components/arc/arc_features.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "base/bind.h" @@ -25,7 +26,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/chrome_features.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" #include "dbus/bus.h" #include "dbus/message.h"
diff --git a/chrome/browser/ash/dbus/proxy_resolution_service_provider_unittest.cc b/chrome/browser/ash/dbus/proxy_resolution_service_provider_unittest.cc index 2e35f14e..82c061f 100644 --- a/chrome/browser/ash/dbus/proxy_resolution_service_provider_unittest.cc +++ b/chrome/browser/ash/dbus/proxy_resolution_service_provider_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" @@ -15,7 +16,6 @@ #include "chromeos/dbus/services/service_provider_test_helper.h" #include "chromeos/dbus/system_proxy/system_proxy_client.h" #include "chromeos/network/network_handler_test_helper.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "dbus/message.h" #include "dbus/object_path.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/chrome/browser/ash/login/app_mode/auto_launched_kiosk_browsertest.cc b/chrome/browser/ash/login/app_mode/auto_launched_kiosk_browsertest.cc index c8d8613..3778cc6 100644 --- a/chrome/browser/ash/login/app_mode/auto_launched_kiosk_browsertest.cc +++ b/chrome/browser/ash/login/app_mode/auto_launched_kiosk_browsertest.cc
@@ -7,6 +7,7 @@ #include <vector> #include "apps/test/app_window_waiter.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/command_line.h" #include "base/files/file_path.h" @@ -33,7 +34,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/shill/shill_manager_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/crx_file/crx_verifier.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h"
diff --git a/chrome/browser/ash/login/app_mode/kiosk_browsertest.cc b/chrome/browser/ash/login/app_mode/kiosk_browsertest.cc index ae4ca5f..00e910d5 100644 --- a/chrome/browser/ash/login/app_mode/kiosk_browsertest.cc +++ b/chrome/browser/ash/login/app_mode/kiosk_browsertest.cc
@@ -8,6 +8,7 @@ #include "apps/test/app_window_waiter.h" #include "ash/components/disks/disk_mount_manager.h" #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/keyboard/keyboard_controller.h" @@ -89,7 +90,6 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/crx_file/crx_verifier.h" #include "components/prefs/pref_service.h" #include "components/signin/public/identity_manager/identity_manager.h"
diff --git a/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc b/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc index c2db382e..f294cb6 100644 --- a/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc +++ b/chrome/browser/ash/login/configuration_based_oobe_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "ash/components/attestation/attestation_flow_utils.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/test/scoped_chromeos_version_info.h" #include "build/build_config.h" @@ -32,7 +33,6 @@ #include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/test/chromeos_test_utils.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/language/core/browser/pref_names.h" #include "components/prefs/pref_service.h" #include "content/public/browser/notification_registrar.h"
diff --git a/chrome/browser/ash/login/demo_mode/demo_mode_resources_remover_unittest.cc b/chrome/browser/ash/login/demo_mode/demo_mode_resources_remover_unittest.cc index f5eea391..fa990df0 100644 --- a/chrome/browser/ash/login/demo_mode/demo_mode_resources_remover_unittest.cc +++ b/chrome/browser/ash/login/demo_mode/demo_mode_resources_remover_unittest.cc
@@ -8,6 +8,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/files/file_util.h" #include "base/test/simple_test_tick_clock.h" @@ -15,7 +16,6 @@ #include "chrome/browser/ash/login/demo_mode/demo_mode_test_helper.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/testing_pref_service.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "components/user_manager/scoped_user_manager.h"
diff --git a/chrome/browser/ash/login/demo_mode/demo_session.cc b/chrome/browser/ash/login/demo_mode/demo_session.cc index 54f4e00..c88e4371 100644 --- a/chrome/browser/ash/login/demo_mode/demo_session.cc +++ b/chrome/browser/ash/login/demo_mode/demo_session.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/locale_update_controller.h" #include "base/bind.h" @@ -42,7 +43,6 @@ #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/language/core/browser/pref_names.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/demo_mode/demo_setup_controller.cc b/chrome/browser/ash/login/demo_mode/demo_setup_controller.cc index 07e507b..18f307f 100644 --- a/chrome/browser/ash/login/demo_mode/demo_setup_controller.cc +++ b/chrome/browser/ash/login/demo_mode/demo_setup_controller.cc
@@ -9,6 +9,7 @@ #include <utility> #include "ash/components/arc/arc_util.h" +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/callback.h" #include "base/command_line.h" @@ -37,7 +38,6 @@ #include "chrome/grit/generated_resources.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/demo_mode/demo_setup_controller_unittest.cc b/chrome/browser/ash/login/demo_mode/demo_setup_controller_unittest.cc index e6452a40..7d5786d 100644 --- a/chrome/browser/ash/login/demo_mode/demo_setup_controller_unittest.cc +++ b/chrome/browser/ash/login/demo_mode/demo_setup_controller_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/components/cryptohome/system_salt_getter.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/files/file_path.h" @@ -25,7 +26,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/login/demo_mode/demo_setup_test_utils.h b/chrome/browser/ash/login/demo_mode/demo_setup_test_utils.h index 6fbf8286..0b9dc36 100644 --- a/chrome/browser/ash/login/demo_mode/demo_setup_test_utils.h +++ b/chrome/browser/ash/login/demo_mode/demo_setup_test_utils.h
@@ -7,12 +7,12 @@ #include <string> +#include "ash/components/tpm/install_attributes.h" #include "base/files/scoped_temp_dir.h" #include "chrome/browser/ash/login/enrollment/enterprise_enrollment_helper.h" #include "chrome/browser/ash/login/enrollment/enterprise_enrollment_helper_mock.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h" #include "chrome/browser/policy/enrollment_status.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc index ba86f0f..6be0aab2 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc
@@ -16,6 +16,7 @@ #include "ash/components/multidevice/software_feature_state.h" #include "ash/components/proximity_auth/proximity_auth_local_state_pref_manager.h" #include "ash/components/proximity_auth/smart_lock_metrics_recorder.h" +#include "ash/components/tpm/tpm_token_loader.h" #include "ash/constants/ash_features.h" #include "ash/public/cpp/smartlock_state.h" #include "base/base64url.h" @@ -37,7 +38,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/common/pref_names.h" #include "chromeos/login/login_state/login_state.h" -#include "chromeos/tpm/tpm_token_loader.h" namespace ash { namespace {
diff --git a/chrome/browser/ash/login/enrollment/auto_enrollment_controller.cc b/chrome/browser/ash/login/enrollment/auto_enrollment_controller.cc index 0d5d570..515fa42 100644 --- a/chrome/browser/ash/login/enrollment/auto_enrollment_controller.cc +++ b/chrome/browser/ash/login/enrollment/auto_enrollment_controller.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/enrollment/auto_enrollment_controller.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -31,7 +32,6 @@ #include "chromeos/dbus/system_clock/system_clock_sync_observation.h" #include "chromeos/dbus/userdataauth/install_attributes_client.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/device_event_log/device_event_log.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
diff --git a/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc b/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc index f8e1bf3..df0eccb6 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_embedded_policy_server_browsertest.cc
@@ -6,6 +6,7 @@ #include "ash/components/attestation/attestation_flow_utils.h" #include "ash/components/attestation/mock_attestation_flow.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/bind.h" @@ -52,7 +53,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/policy_switches.h" #include "components/policy/proto/device_management_backend.pb.h"
diff --git a/chrome/browser/ash/login/enrollment/enrollment_screen_unittest.cc b/chrome/browser/ash/login/enrollment/enrollment_screen_unittest.cc index f6684799..fd846d94 100644 --- a/chrome/browser/ash/login/enrollment/enrollment_screen_unittest.cc +++ b/chrome/browser/ash/login/enrollment/enrollment_screen_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/enrollment/enrollment_screen.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/callback.h" @@ -22,7 +23,6 @@ #include "chrome/test/base/testing_browser_process.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc b/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc index 1be564c..71fd2e6 100644 --- a/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc +++ b/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc
@@ -7,12 +7,12 @@ #include <memory> #include "ash/components/login/auth/user_context.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/test/metrics/histogram_tester.h" #include "base/time/time.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/login/lock/screen_locker_unittest.cc b/chrome/browser/ash/login/lock/screen_locker_unittest.cc index aea737b..41e1eaf 100644 --- a/chrome/browser/ash/login/lock/screen_locker_unittest.cc +++ b/chrome/browser/ash/login/lock/screen_locker_unittest.cc
@@ -9,6 +9,7 @@ #include "ash/components/audio/cras_audio_handler.h" #include "ash/components/cryptohome/system_salt_getter.h" #include "ash/components/login/session/session_termination_manager.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/public/cpp/login_screen_model.h" #include "ash/public/cpp/login_types.h" #include "base/bind.h" @@ -43,7 +44,6 @@ #include "chromeos/dbus/userdataauth/userdataauth_client.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/keyed_service/core/keyed_service.h" #include "components/session_manager/core/session_manager.h"
diff --git a/chrome/browser/ash/login/saml/public_saml_url_fetcher.cc b/chrome/browser/ash/login/saml/public_saml_url_fetcher.cc index b0d8d36..e664844 100644 --- a/chrome/browser/ash/login/saml/public_saml_url_fetcher.cc +++ b/chrome/browser/ash/login/saml/public_saml_url_fetcher.cc
@@ -7,6 +7,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/logging.h" #include "chrome/browser/ash/arc/arc_optin_uma.h" @@ -17,7 +18,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/net/system_network_context_manager.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/cloud/dm_auth.h"
diff --git a/chrome/browser/ash/login/saml/saml_browsertest.cc b/chrome/browser/ash/login/saml/saml_browsertest.cc index e6f4e82..994b786 100644 --- a/chrome/browser/ash/login/saml/saml_browsertest.cc +++ b/chrome/browser/ash/login/saml/saml_browsertest.cc
@@ -12,6 +12,7 @@ #include "ash/components/login/auth/key.h" #include "ash/components/login/auth/saml_password_attributes.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" @@ -80,7 +81,6 @@ #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings_types.h"
diff --git a/chrome/browser/ash/login/screens/update_required_screen_unittest.cc b/chrome/browser/ash/login/screens/update_required_screen_unittest.cc index 8706f34..e63b1f9 100644 --- a/chrome/browser/ash/login/screens/update_required_screen_unittest.cc +++ b/chrome/browser/ash/login/screens/update_required_screen_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/callback_helpers.h" #include "base/command_line.h" @@ -25,7 +26,6 @@ #include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/portal_detector/mock_network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/session/chrome_session_manager.cc b/chrome/browser/ash/login/session/chrome_session_manager.cc index 236afde..f86516f0 100644 --- a/chrome/browser/ash/login/session/chrome_session_manager.cc +++ b/chrome/browser/ash/login/session/chrome_session_manager.cc
@@ -242,20 +242,17 @@ } if (ash::shimless_rma::IsShimlessRmaAllowed()) { - // If the RMA state is detected later, OnRmaIsRequiredResponse() is invoked - // to reboot the device in RMA mode. - const bool was_rma_state_detected_now = - chromeos::RmadClient::Get()->WasRmaStateDetectedForSessionManager( - base::BindOnce(&OnRmaIsRequiredResponse)); - const bool has_launch_rma_switch = - ash::shimless_rma::HasLaunchRmaSwitchAndIsAllowed(); - // If we should be in Shimless RMA, start it and skip the rest of // initialization. - if (has_launch_rma_switch || was_rma_state_detected_now) { + if (ash::shimless_rma::HasLaunchRmaSwitchAndIsAllowed()) { LaunchShimlessRma(); return; } + + // If the RMA state is detected later, OnRmaIsRequiredResponse() is invoked + // to append the kLaunchRma switch and restart Chrome in RMA mode. + chromeos::RmadClient::Get()->SetRmaRequiredCallbackForSessionManager( + base::BindOnce(&OnRmaIsRequiredResponse)); } // Tests should be able to tune login manager before showing it. Thus only
diff --git a/chrome/browser/ash/login/session/chrome_session_manager_browsertest.cc b/chrome/browser/ash/login/session/chrome_session_manager_browsertest.cc index 57a58be..97c7fb4 100644 --- a/chrome/browser/ash/login/session/chrome_session_manager_browsertest.cc +++ b/chrome/browser/ash/login/session/chrome_session_manager_browsertest.cc
@@ -4,6 +4,7 @@ #include <memory> +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/session/session_controller_impl.h" @@ -33,7 +34,6 @@ #include "chromeos/dbus/rmad/rmad_client.h" #include "chromeos/system/fake_statistics_provider.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/user_manager/user_names.h" #include "content/public/test/browser_test.h" #include "google_apis/gaia/fake_gaia.h" @@ -321,42 +321,6 @@ EXPECT_EQ(0u, manager->sessions().size()); } -class ChromeSessionManagerRmaStateDetectedTest - : public ChromeSessionManagerRmaTest { - public: - ChromeSessionManagerRmaStateDetectedTest() = default; - - // LoginManagerTest: - void SetUpCommandLine(base::CommandLine* command_line) override { - ChromeSessionManagerRmaTest::SetUpCommandLine(command_line); - // Remove switch so ChromeSessionManager depends on the RmadClient response. - command_line->RemoveSwitch(switches::kLaunchRma); - } - - private: - // LoginManagerTest: - void SetUpInProcessBrowserTestFixture() override { - chromeos::RmadClient::InitializeFake(); - chromeos::FakeRmadClient* fake_rmad_client = - chromeos::FakeRmadClient::Get(); - ASSERT_TRUE(fake_rmad_client); - // Set the fake states to make RMA detected. - fake_rmad_client->SetFakeStates(); - - ChromeSessionManagerTest::SetUpInProcessBrowserTestFixture(); - } -}; - -IN_PROC_BROWSER_TEST_F(ChromeSessionManagerRmaStateDetectedTest, - RmadResponseSetsRma) { - // Verify that session state is in RMA, even though kLaunchRma switch was not - // passed. - session_manager::SessionManager* manager = - session_manager::SessionManager::Get(); - EXPECT_EQ(session_manager::SessionState::RMA, manager->session_state()); - EXPECT_EQ(0u, manager->sessions().size()); -} - #if BUILDFLAG(ENABLE_RLZ) class ChromeSessionManagerRlzTest : public ChromeSessionManagerTest {
diff --git a/chrome/browser/ash/login/session/user_session_initializer.cc b/chrome/browser/ash/login/session/user_session_initializer.cc index ffc7127..0101628 100644 --- a/chrome/browser/ash/login/session/user_session_initializer.cc +++ b/chrome/browser/ash/login/session/user_session_initializer.cc
@@ -4,7 +4,9 @@ #include "chrome/browser/ash/login/session/user_session_initializer.h" +#include "ash/components/audio/cras_audio_handler.h" #include "ash/components/peripheral_notification/peripheral_notification_manager.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "base/files/file_util.h" @@ -47,7 +49,6 @@ #include "chrome/common/pref_names.h" #include "chromeos/dbus/pciguard/pciguard_client.h" #include "chromeos/network/network_cert_loader.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -111,18 +112,6 @@ NetworkCertLoader::Get()->SetUserNSSDB(database); } -void OnNoiseCancellationSupportedRetrieved( - absl::optional<bool> noise_cancellation_supported) { - if (noise_cancellation_supported.has_value() && - noise_cancellation_supported.value()) { - PrefService* local_state = g_browser_process->local_state(); - const bool noise_cancellation_enabled = - local_state->GetBoolean(prefs::kInputNoiseCancellationEnabled); - chromeos::CrasAudioClient::Get()->SetNoiseCancellationEnabled( - noise_cancellation_enabled); - } -} - } // namespace UserSessionInitializer::UserSessionInitializer() { @@ -290,8 +279,7 @@ PciguardClient::Get()->SendExternalPciDevicesPermissionState( chromeos::settings::PeripheralDataAccessHandler::GetPrefState()); - chromeos::CrasAudioClient::Get()->GetNoiseCancellationSupported( - base::BindOnce(&OnNoiseCancellationSupportedRetrieved)); + CrasAudioHandler::Get()->RefreshNoiseCancellationState(); } }
diff --git a/chrome/browser/ash/login/session/user_session_manager.cc b/chrome/browser/ash/login/session/user_session_manager.cc index 7dfc4f0..91e9ee6 100644 --- a/chrome/browser/ash/login/session/user_session_manager.cc +++ b/chrome/browser/ash/login/session/user_session_manager.cc
@@ -22,6 +22,7 @@ #include "ash/components/login/auth/stub_authenticator_builder.h" #include "ash/components/login/session/session_termination_manager.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/prepare_tpm.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "base/base_paths.h" @@ -130,7 +131,6 @@ #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" #include "chromeos/network/portal_detector/network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" -#include "chromeos/tpm/prepare_tpm.h" #include "chromeos/ui/vector_icons/vector_icons.h" #include "components/account_id/account_id.h" #include "components/account_manager_core/account.h"
diff --git a/chrome/browser/ash/login/webview_login_browsertest.cc b/chrome/browser/ash/login/webview_login_browsertest.cc index b8e88e0..77cfcc8d 100644 --- a/chrome/browser/ash/login/webview_login_browsertest.cc +++ b/chrome/browser/ash/login/webview_login_browsertest.cc
@@ -7,6 +7,7 @@ #include <string> #include "ash/components/login/auth/user_context.h" +#include "ash/components/tpm/tpm_token_loader.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" @@ -76,7 +77,6 @@ #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/tpm_manager/fake_tpm_manager_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/tpm/tpm_token_loader.h" #include "components/account_id/account_id.h" #include "components/content_settings/core/common/pref_names.h" #include "components/guest_view/browser/guest_view_manager.h"
diff --git a/chrome/browser/ash/login/wizard_controller_browsertest.cc b/chrome/browser/ash/login/wizard_controller_browsertest.cc index a2764653..d4731744 100644 --- a/chrome/browser/ash/login/wizard_controller_browsertest.cc +++ b/chrome/browser/ash/login/wizard_controller_browsertest.cc
@@ -8,6 +8,7 @@ #include "ash/components/geolocation/simple_geolocation_provider.h" #include "ash/components/settings/timezone_settings.h" #include "ash/components/timezone/timezone_request.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" @@ -98,7 +99,6 @@ #include "chromeos/system/fake_statistics_provider.h" #include "chromeos/system/statistics_provider.h" #include "chromeos/test/chromeos_test_utils.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/net/network_pref_state_observer.cc b/chrome/browser/ash/net/network_pref_state_observer.cc index 49362aa4..4c8fea8b 100644 --- a/chrome/browser/ash/net/network_pref_state_observer.cc +++ b/chrome/browser/ash/net/network_pref_state_observer.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/net/network_pref_state_observer.h" +#include "ash/components/tpm/install_attributes.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" @@ -12,7 +13,6 @@ #include "chromeos/components/sync_wifi/wifi_configuration_sync_service.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_metadata_store.h" -#include "chromeos/tpm/install_attributes.h" #include "content/public/browser/notification_service.h" namespace ash {
diff --git a/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc b/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc index 7268858..e37de292 100644 --- a/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc +++ b/chrome/browser/ash/net/rollback_network_config/rollback_network_config.cc
@@ -7,6 +7,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "base/barrier_closure.h" #include "base/callback.h" #include "base/callback_helpers.h" @@ -23,7 +24,6 @@ #include "chromeos/network/network_handler.h" #include "chromeos/network/network_profile_handler.h" #include "chromeos/network/network_state_handler.h" -#include "chromeos/tpm/install_attributes.h" #include "components/onc/onc_constants.h" #include "dbus/object_path.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc b/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc index 09d963b..ee1ea7d 100644 --- a/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc +++ b/chrome/browser/ash/net/rollback_network_config/rollback_network_config_unittest.cc
@@ -4,6 +4,7 @@ #include <string> +#include "ash/components/tpm/stub_install_attributes.h" #include "base/json/json_reader.h" #include "base/run_loop.h" #include "base/test/bind.h" @@ -25,7 +26,6 @@ #include "chromeos/network/network_handler_test_helper.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/onc/onc_constants.h" #include "components/onc/onc_pref_names.h" #include "components/ownership/mock_owner_key_util.h"
diff --git a/chrome/browser/ash/net/system_proxy_manager_browsertest.cc b/chrome/browser/ash/net/system_proxy_manager_browsertest.cc index 85548095..72c7bbb 100644 --- a/chrome/browser/ash/net/system_proxy_manager_browsertest.cc +++ b/chrome/browser/ash/net/system_proxy_manager_browsertest.cc
@@ -8,6 +8,7 @@ #include <string> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" @@ -39,7 +40,6 @@ #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/proxy/proxy_config_handler.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" #include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_types.h"
diff --git a/chrome/browser/ash/notifications/update_required_notification_unittest.cc b/chrome/browser/ash/notifications/update_required_notification_unittest.cc index 372cbbf6..17a4f2c 100644 --- a/chrome/browser/ash/notifications/update_required_notification_unittest.cc +++ b/chrome/browser/ash/notifications/update_required_notification_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" @@ -26,7 +27,6 @@ #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/network/network_handler_test_helper.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/ash/ownership/fake_owner_settings_service.cc b/chrome/browser/ash/ownership/fake_owner_settings_service.cc index 397114c5..8c5fabd 100644 --- a/chrome/browser/ash/ownership/fake_owner_settings_service.cc +++ b/chrome/browser/ash/ownership/fake_owner_settings_service.cc
@@ -4,10 +4,10 @@ #include "chrome/browser/ash/ownership/fake_owner_settings_service.h" +#include "ash/components/tpm/install_attributes.h" #include "base/check.h" #include "chrome/browser/ash/ownership/owner_settings_service_ash_factory.h" #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/ownership/mock_owner_key_util.h" namespace ash {
diff --git a/chrome/browser/ash/ownership/owner_settings_service_ash.cc b/chrome/browser/ash/ownership/owner_settings_service_ash.cc index b80cbcf1..0234580 100644 --- a/chrome/browser/ash/ownership/owner_settings_service_ash.cc +++ b/chrome/browser/ash/ownership/owner_settings_service_ash.cc
@@ -11,6 +11,8 @@ #include <string> #include <utility> +#include "ash/components/tpm/install_attributes.h" +#include "ash/components/tpm/tpm_token_loader.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/callback.h" @@ -32,8 +34,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chromeos/tpm/install_attributes.h" -#include "chromeos/tpm/tpm_token_loader.h" #include "components/ownership/owner_key_util.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/plugin_vm/plugin_vm_features.cc b/chrome/browser/ash/plugin_vm/plugin_vm_features.cc index 011c26e..05b122a 100644 --- a/chrome/browser/ash/plugin_vm/plugin_vm_features.cc +++ b/chrome/browser/ash/plugin_vm/plugin_vm_features.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/plugin_vm/plugin_vm_features.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "base/feature_list.h" #include "base/system/sys_info.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_pref_names.h" @@ -13,7 +14,6 @@ #include "chrome/browser/ash/settings/cros_settings.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_features.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/plugin_vm/plugin_vm_util_unittest.cc b/chrome/browser/ash/plugin_vm/plugin_vm_util_unittest.cc index ab4a3c0..eec5cd0 100644 --- a/chrome/browser/ash/plugin_vm/plugin_vm_util_unittest.cc +++ b/chrome/browser/ash/plugin_vm/plugin_vm_util_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/plugin_vm/plugin_vm_util.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_features.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_pref_names.h" #include "chrome/browser/ash/plugin_vm/plugin_vm_test_helper.h" @@ -12,7 +13,6 @@ #include "chrome/test/base/testing_profile.h" #include "chromeos/dbus/concierge/concierge_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/ash/policy/active_directory/active_directory_policy_manager_unittest.cc b/chrome/browser/ash/policy/active_directory/active_directory_policy_manager_unittest.cc index c734aef..43ab2023 100644 --- a/chrome/browser/ash/policy/active_directory/active_directory_policy_manager_unittest.cc +++ b/chrome/browser/ash/policy/active_directory/active_directory_policy_manager_unittest.cc
@@ -8,6 +8,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/check.h" #include "base/run_loop.h" @@ -17,7 +18,6 @@ #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chromeos/dbus/authpolicy/fake_authpolicy_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h" #include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
diff --git a/chrome/browser/ash/policy/active_directory/component_active_directory_policy_browsertest.cc b/chrome/browser/ash/policy/active_directory/component_active_directory_policy_browsertest.cc index e58d4ab5..94c6bbbd 100644 --- a/chrome/browser/ash/policy/active_directory/component_active_directory_policy_browsertest.cc +++ b/chrome/browser/ash/policy/active_directory/component_active_directory_policy_browsertest.cc
@@ -5,6 +5,7 @@ #include <string> #include "ash/components/cryptohome/cryptohome_parameters.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/command_line.h" @@ -16,7 +17,6 @@ #include "chrome/common/chrome_paths.h" #include "chromeos/dbus/login_manager/policy_descriptor.pb.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/test/policy_builder.h" #include "components/policy/core/common/policy_service.h"
diff --git a/chrome/browser/ash/policy/affiliation/user_affiliation_browsertest.cc b/chrome/browser/ash/policy/affiliation/user_affiliation_browsertest.cc index 788602e..b669f80 100644 --- a/chrome/browser/ash/policy/affiliation/user_affiliation_browsertest.cc +++ b/chrome/browser/ash/policy/affiliation/user_affiliation_browsertest.cc
@@ -6,6 +6,7 @@ #include <ostream> #include "ash/components/cryptohome/cryptohome_parameters.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -24,7 +25,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/upstart/upstart_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc index 90d1a776..c71c58b 100644 --- a/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc +++ b/chrome/browser/ash/policy/core/browser_policy_connector_ash.cc
@@ -13,6 +13,7 @@ #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" #include "ash/components/settings/timezone_settings.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_paths.h" #include "base/bind.h" #include "base/check.h" @@ -80,7 +81,6 @@ #include "chromeos/network/network_handler.h" #include "chromeos/network/onc/onc_certificate_importer_impl.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" #include "components/policy/core/common/cloud/resource_cache.h"
diff --git a/chrome/browser/ash/policy/core/device_attributes_browsertest.cc b/chrome/browser/ash/policy/core/device_attributes_browsertest.cc index 7513efd2..4693b726 100644 --- a/chrome/browser/ash/policy/core/device_attributes_browsertest.cc +++ b/chrome/browser/ash/policy/core/device_attributes_browsertest.cc
@@ -6,13 +6,13 @@ #include "base/run_loop.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part_chromeos.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" #include "components/policy/core/common/cloud/test/policy_builder.h"
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc index d365365..61f896e 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.cc
@@ -11,6 +11,7 @@ #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_paths.h" #include "ash/constants/ash_switches.h" @@ -46,7 +47,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/common/pref_names.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h" #include "components/policy/core/common/cloud/cloud_policy_core.h" #include "components/policy/core/common/cloud/cloud_policy_service.h"
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc index dac6a95..476fc64 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash_unittest.cc
@@ -13,6 +13,7 @@ #include "ash/components/attestation/fake_certificate.h" #include "ash/components/attestation/mock_attestation_flow.h" #include "ash/components/cryptohome/system_salt_getter.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -45,7 +46,6 @@ #include "chromeos/dbus/userdataauth/fake_install_attributes_client.h" #include "chromeos/system/fake_statistics_provider.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/cloud_policy_core.h"
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc b/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc index 63c7a881..f7abb6c 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/logging.h" #include "base/metrics/histogram_functions.h" @@ -16,7 +17,6 @@ #include "chrome/browser/ash/policy/core/device_policy_decoder.h" #include "chrome/browser/ash/policy/dev_mode/dev_mode_policy_util.h" #include "chrome/browser/ash/policy/value_validation/onc_device_policy_value_validator.h" -#include "chromeos/tpm/install_attributes.h" #include "components/ownership/owner_key_util.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h"
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_store_ash_unittest.cc b/chrome/browser/ash/policy/core/device_cloud_policy_store_ash_unittest.cc index 8e41242..3754e59 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_store_ash_unittest.cc +++ b/chrome/browser/ash/policy/core/device_cloud_policy_store_ash_unittest.cc
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/compiler_specific.h" @@ -20,7 +21,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/userdataauth/fake_install_attributes_client.h" #include "chromeos/dbus/userdataauth/install_attributes_util.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" #include "components/policy/core/common/cloud/test/policy_builder.h"
diff --git a/chrome/browser/ash/policy/core/device_policy_cros_browser_test.cc b/chrome/browser/ash/policy/core/device_policy_cros_browser_test.cc index b57b0c3..6630ddc 100644 --- a/chrome/browser/ash/policy/core/device_policy_cros_browser_test.cc +++ b/chrome/browser/ash/policy/core/device_policy_cros_browser_test.cc
@@ -9,6 +9,7 @@ #include <string> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_paths.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -21,7 +22,6 @@ #include "chrome/common/chrome_paths.h" #include "chromeos/dbus/constants/dbus_paths.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" #include "crypto/rsa_private_key.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash_unittest.cc b/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash_unittest.cc index 124f7fce..bf43905 100644 --- a/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash_unittest.cc +++ b/chrome/browser/ash/policy/core/user_cloud_policy_manager_ash_unittest.cc
@@ -8,6 +8,7 @@ #include <utility> #include <vector> +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/callback.h" #include "base/callback_helpers.h" @@ -38,7 +39,6 @@ #include "chrome/test/base/testing_profile_manager.h" #include "chromeos/dbus/concierge/concierge_client.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/enterprise/browser/reporting/common_pref_names.h" #include "components/enterprise/browser/reporting/report_scheduler.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
diff --git a/chrome/browser/ash/policy/core/user_policy_manager_builder_ash.cc b/chrome/browser/ash/policy/core/user_policy_manager_builder_ash.cc index f64eab93..7928146 100644 --- a/chrome/browser/ash/policy/core/user_policy_manager_builder_ash.cc +++ b/chrome/browser/ash/policy/core/user_policy_manager_builder_ash.cc
@@ -7,6 +7,7 @@ #include <utility> #include "ash/components/arc/arc_features.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/command_line.h" @@ -35,7 +36,6 @@ #include "chromeos/dbus/constants/dbus_paths.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/userdataauth/cryptohome_misc_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h" #include "components/policy/core/common/cloud/device_management_service.h"
diff --git a/chrome/browser/ash/policy/enrollment/account_status_check_fetcher.cc b/chrome/browser/ash/policy/enrollment/account_status_check_fetcher.cc index 75d695c8..fa55d7d1 100644 --- a/chrome/browser/ash/policy/enrollment/account_status_check_fetcher.cc +++ b/chrome/browser/ash/policy/enrollment/account_status_check_fetcher.cc
@@ -7,6 +7,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/guid.h" #include "base/logging.h" @@ -18,7 +19,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/net/system_network_context_manager.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/cloud/dm_auth.h"
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc index dd30013..41b96a8 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.cc
@@ -8,6 +8,7 @@ #include <utility> #include "ash/components/cryptohome/cryptohome_parameters.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/logging.h" @@ -24,7 +25,6 @@ #include "chrome/common/chrome_content_client.h" #include "chrome/common/pref_names.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_core.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc index 36f97a0..75971b3 100644 --- a/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc +++ b/chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/policy/enrollment/device_cloud_policy_initializer.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "base/test/task_environment.h" @@ -15,7 +16,6 @@ #include "chrome/common/pref_names.h" #include "chromeos/system/fake_statistics_provider.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/testing_pref_service.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_handler.h b/chrome/browser/ash/policy/enrollment/enrollment_handler.h index 2f174d1f..e4525cc1 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_handler.h +++ b/chrome/browser/ash/policy/enrollment/enrollment_handler.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "ash/components/tpm/install_attributes.h" #include "base/callback.h" #include "base/callback_forward.h" #include "base/memory/ref_counted.h" @@ -18,7 +19,6 @@ #include "chromeos/dbus/authpolicy/authpolicy_client.h" #include "chromeos/dbus/constants/attestation_constants.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/cloud_policy_store.h"
diff --git a/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc b/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc index c75f94b..ed02afa 100644 --- a/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc +++ b/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc
@@ -4,6 +4,7 @@ #include <string> +#include "ash/components/tpm/install_attributes.h" #include "base/at_exit.h" #include "base/check_op.h" #include "base/command_line.h" @@ -24,7 +25,6 @@ #include "chrome/browser/ash/settings/device_settings_service.h" #include "chrome/browser/policy/configuration_policy_handler_list_factory.h" #include "chrome/common/chrome_paths.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/browser/configuration_policy_handler_list.h" #include "components/policy/core/browser/policy_conversions_client.h" #include "components/policy/core/browser/policy_error_map.h"
diff --git a/chrome/browser/ash/policy/handlers/device_i18n_shortcuts_enabled_browsertest.cc b/chrome/browser/ash/policy/handlers/device_i18n_shortcuts_enabled_browsertest.cc index 1b9b2f36f..84c39097 100644 --- a/chrome/browser/ash/policy/handlers/device_i18n_shortcuts_enabled_browsertest.cc +++ b/chrome/browser/ash/policy/handlers/device_i18n_shortcuts_enabled_browsertest.cc
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_pref_names.h" #include "base/run_loop.h" #include "chrome/browser/ash/policy/core/device_policy_builder.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/browser_process.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/prefs/pref_observer.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl.cc b/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl.cc index 8be03cd7..de1bbcb 100644 --- a/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl.cc +++ b/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl.cc
@@ -6,6 +6,7 @@ #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "base/bind.h" #include "chrome/browser/ash/policy/core/browser_policy_connector_ash.h" @@ -13,7 +14,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chromeos/network/device_state.h" -#include "chromeos/tpm/install_attributes.h" namespace policy { namespace {
diff --git a/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl_unittest.cc b/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl_unittest.cc index 0c85637..ec13ea5 100644 --- a/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl_unittest.cc +++ b/chrome/browser/ash/policy/handlers/device_name_policy_handler_impl_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/policy/handlers/device_name_policy_handler_impl.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" @@ -11,7 +12,6 @@ #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" #include "chromeos/network/network_handler_test_helper.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/test/policy_builder.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/policy/handlers/device_system_wide_tracing_enabled_browsertest.cc b/chrome/browser/ash/policy/handlers/device_system_wide_tracing_enabled_browsertest.cc index a88702f..ca1f648b 100644 --- a/chrome/browser/ash/policy/handlers/device_system_wide_tracing_enabled_browsertest.cc +++ b/chrome/browser/ash/policy/handlers/device_system_wide_tracing_enabled_browsertest.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_pref_names.h" #include "base/run_loop.h" #include "chrome/browser/ash/policy/core/device_policy_builder.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/tracing/chrome_tracing_delegate.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/prefs/pref_observer.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc index eba6422..7f4824843 100644 --- a/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc +++ b/chrome/browser/ash/policy/handlers/minimum_version_policy_handler_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/run_loop.h" #include "base/test/bind.h" @@ -24,7 +25,6 @@ #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/dbus/update_engine/fake_update_engine_client.h" #include "chromeos/network/network_handler_test_helper.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/ash/policy/handlers/tpm_auto_update_mode_policy_handler_unittest.cc b/chrome/browser/ash/policy/handlers/tpm_auto_update_mode_policy_handler_unittest.cc index 4fa0e0fe..7d0688e 100644 --- a/chrome/browser/ash/policy/handlers/tpm_auto_update_mode_policy_handler_unittest.cc +++ b/chrome/browser/ash/policy/handlers/tpm_auto_update_mode_policy_handler_unittest.cc
@@ -7,6 +7,7 @@ #include <utility> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/callback_helpers.h" #include "base/memory/ptr_util.h" @@ -21,7 +22,6 @@ #include "chrome/test/base/testing_browser_process.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_service.h"
diff --git a/chrome/browser/ash/policy/login/blocking_login_browsertest.cc b/chrome/browser/ash/policy/login/blocking_login_browsertest.cc index 008ffeac..31d22b60 100644 --- a/chrome/browser/ash/policy/login/blocking_login_browsertest.cc +++ b/chrome/browser/ash/policy/login/blocking_login_browsertest.cc
@@ -5,6 +5,7 @@ #include <string> #include <vector> +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/command_line.h" @@ -20,7 +21,6 @@ #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/device_management_service.h" #include "components/policy/core/common/policy_switches.h" #include "components/policy/proto/device_management_backend.pb.h"
diff --git a/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc b/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc index e8f2f87..013a2ff7 100644 --- a/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc +++ b/chrome/browser/ash/policy/scheduled_task_handler/test/device_scheduled_update_checker_unittest.cc
@@ -11,6 +11,7 @@ #include <utility> #include "ash/components/settings/timezone_settings.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/callback_helpers.h" #include "base/json/json_reader.h" #include "base/logging.h" @@ -42,7 +43,6 @@ #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_test_helper.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/policy_service.h" #include "services/device/public/cpp/test/test_wake_lock_provider.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/policy/server_backed_state/active_directory_device_state_uploader.cc b/chrome/browser/ash/policy/server_backed_state/active_directory_device_state_uploader.cc index 913a9f59..36c09250 100644 --- a/chrome/browser/ash/policy/server_backed_state/active_directory_device_state_uploader.cc +++ b/chrome/browser/ash/policy/server_backed_state/active_directory_device_state_uploader.cc
@@ -7,6 +7,7 @@ #include <string> #include <utility> +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/logging.h" #include "chrome/browser/ash/attestation/enrollment_certificate_uploader_impl.h" @@ -18,7 +19,6 @@ #include "chrome/common/pref_names.h" #include "chromeos/dbus/login_manager/policy_descriptor.pb.h" #include "chromeos/dbus/session_manager/session_manager_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/dmserver_job_configurations.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc index ad03603..8d05aa8 100644 --- a/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/device_status_collector_browsertest.cc
@@ -18,6 +18,7 @@ #include "ash/components/disks/mock_disk_mount_manager.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/timezone_settings.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/bind.h" #include "base/environment.h" @@ -85,7 +86,6 @@ #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/ownership/mock_owner_key_util.h" #include "components/policy/proto/device_management_backend.pb.h"
diff --git a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc index 00b1364..9bd03a09 100644 --- a/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc +++ b/chrome/browser/ash/policy/status_collector/legacy_device_status_collector_browsertest.cc
@@ -18,6 +18,7 @@ #include "ash/components/disks/mock_disk_mount_manager.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/timezone_settings.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/environment.h" #include "base/files/file_path.h" @@ -81,7 +82,6 @@ #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/ownership/mock_owner_key_util.h" #include "components/policy/proto/device_management_backend.pb.h"
diff --git a/chrome/browser/ash/settings/cros_settings_unittest.cc b/chrome/browser/ash/settings/cros_settings_unittest.cc index f9f9adf..9632bd9b 100644 --- a/chrome/browser/ash/settings/cros_settings_unittest.cc +++ b/chrome/browser/ash/settings/cros_settings_unittest.cc
@@ -9,6 +9,7 @@ #include <string> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/bind.h" #include "base/memory/weak_ptr.h" @@ -25,7 +26,6 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/ownership/mock_owner_key_util.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/proto/chrome_device_policy.pb.h"
diff --git a/chrome/browser/ash/settings/device_settings_provider.cc b/chrome/browser/ash/settings/device_settings_provider.cc index eb91808..f43e303 100644 --- a/chrome/browser/ash/settings/device_settings_provider.cc +++ b/chrome/browser/ash/settings/device_settings_provider.cc
@@ -11,6 +11,7 @@ #include <utility> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "base/bind.h" #include "base/callback.h" @@ -33,7 +34,6 @@ #include "chrome/browser/ash/settings/stats_reporting_controller.h" #include "chrome/browser/ash/tpm_firmware_update.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/chrome_schema.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/schema.h"
diff --git a/chrome/browser/ash/settings/device_settings_provider_unittest.cc b/chrome/browser/ash/settings/device_settings_provider_unittest.cc index 4653102..bf19c0e 100644 --- a/chrome/browser/ash/settings/device_settings_provider_unittest.cc +++ b/chrome/browser/ash/settings/device_settings_provider_unittest.cc
@@ -9,6 +9,7 @@ #include <utility> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_features.h" #include "base/bind.h" #include "base/callback.h" @@ -26,7 +27,6 @@ #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/cloud/test/policy_builder.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/policy/proto/device_management_backend.pb.h"
diff --git a/chrome/browser/ash/settings/scoped_cros_settings_test_helper.h b/chrome/browser/ash/settings/scoped_cros_settings_test_helper.h index 0891115..70513eb 100644 --- a/chrome/browser/ash/settings/scoped_cros_settings_test_helper.h +++ b/chrome/browser/ash/settings/scoped_cros_settings_test_helper.h
@@ -9,9 +9,9 @@ #include <string> #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/settings/stub_cros_settings_provider.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/tpm/stub_install_attributes.h" class Profile;
diff --git a/chrome/browser/ash/shortcut_mapping_pref_service.cc b/chrome/browser/ash/shortcut_mapping_pref_service.cc index 0861671..a51260c 100644 --- a/chrome/browser/ash/shortcut_mapping_pref_service.cc +++ b/chrome/browser/ash/shortcut_mapping_pref_service.cc
@@ -4,9 +4,9 @@ #include "chrome/browser/ash/shortcut_mapping_pref_service.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_pref_names.h" #include "chrome/browser/browser_process.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" namespace ash {
diff --git a/chrome/browser/ash/system/device_disabling_manager.cc b/chrome/browser/ash/system/device_disabling_manager.cc index 331994d0..6d118e1 100644 --- a/chrome/browser/ash/system/device_disabling_manager.cc +++ b/chrome/browser/ash/system/device_disabling_manager.cc
@@ -6,6 +6,7 @@ #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/command_line.h" @@ -18,7 +19,6 @@ #include "chrome/browser/browser_process_platform_part.h" #include "chrome/common/pref_names.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/system/timezone_util.cc b/chrome/browser/ash/system/timezone_util.cc index a3939b2..5066932 100644 --- a/chrome/browser/ash/system/timezone_util.cc +++ b/chrome/browser/ash/system/timezone_util.cc
@@ -12,6 +12,7 @@ #include "ash/components/settings/timezone_settings.h" #include "ash/components/timezone/timezone_request.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "base/i18n/rtl.h" @@ -30,7 +31,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/system_token_cert_db_initializer.cc b/chrome/browser/ash/system_token_cert_db_initializer.cc index d809673a..36673b5 100644 --- a/chrome/browser/ash/system_token_cert_db_initializer.cc +++ b/chrome/browser/ash/system_token_cert_db_initializer.cc
@@ -9,6 +9,8 @@ #include <memory> #include <utility> +#include "ash/components/tpm/buildflags.h" +#include "ash/components/tpm/tpm_token_loader.h" #include "base/bind.h" #include "base/callback.h" #include "base/callback_helpers.h" @@ -29,8 +31,6 @@ #include "chromeos/dbus/userdataauth/userdataauth_client.h" #include "chromeos/network/network_cert_loader.h" #include "chromeos/network/system_token_cert_db_storage.h" -#include "chromeos/tpm/buildflags.h" -#include "chromeos/tpm/tpm_token_loader.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "crypto/nss_util_internal.h"
diff --git a/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc b/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc index ffbe85e..bb08dfd5 100644 --- a/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc +++ b/chrome/browser/ash/system_token_cert_db_initializer_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/tpm/tpm_token_loader.h" #include "base/bind.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" @@ -15,7 +16,6 @@ #include "chromeos/dbus/userdataauth/userdataauth_client.h" #include "chromeos/network/network_cert_loader.h" #include "chromeos/network/system_token_cert_db_storage_test_util.h" -#include "chromeos/tpm/tpm_token_loader.h" #include "content/public/test/browser_task_environment.h" #include "crypto/nss_util.h" #include "crypto/scoped_test_system_nss_key_slot.h"
diff --git a/chrome/browser/ash/tpm_firmware_update_unittest.cc b/chrome/browser/ash/tpm_firmware_update_unittest.cc index 7a51e83..660df525 100644 --- a/chrome/browser/ash/tpm_firmware_update_unittest.cc +++ b/chrome/browser/ash/tpm_firmware_update_unittest.cc
@@ -7,6 +7,7 @@ #include <utility> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/callback.h" #include "base/files/file_util.h" @@ -21,7 +22,6 @@ #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_paths.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "testing/gmock/include/gmock/gmock-matchers.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index f46d5260..1c88623 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -158,7 +158,7 @@ #include "chrome/browser/ui/webui/read_later/read_later.mojom.h" #include "chrome/browser/ui/webui/read_later/read_later_ui.h" #include "chrome/browser/ui/webui/read_later/side_panel/bookmarks_side_panel_ui.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h" #include "chrome/browser/ui/webui/settings/settings_ui.h" #include "chrome/browser/ui/webui/tab_search/tab_search.mojom.h" #include "chrome/browser/ui/webui/tab_search/tab_search_ui.h" @@ -876,13 +876,14 @@ } } - if (features::IsReaderModeSidePanelEnabled()) { + if (features::IsReadAnythingEnabled()) { if (base::FeatureList::IsEnabled(features::kUnifiedSidePanel)) { RegisterWebUIControllerInterfaceBinder< - reader_mode::mojom::PageHandlerFactory, ReaderModeSidePanelUI>(map); + read_anything::mojom::PageHandlerFactory, ReadAnythingSidePanelUI>( + map); } else { RegisterWebUIControllerInterfaceBinder< - reader_mode::mojom::PageHandlerFactory, ReadLaterUI>(map); + read_anything::mojom::PageHandlerFactory, ReadLaterUI>(map); } }
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 2d5a156..aaee7f1 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -114,6 +114,8 @@ "//ash/components/smbfs/mojom", "//ash/components/tether", "//ash/components/timezone", + "//ash/components/tpm", + "//ash/components/tpm:buildflags", "//ash/constants", "//ash/keyboard/ui", "//ash/public/cpp", @@ -342,8 +344,6 @@ "//chromeos/services/rollback_network_config/public/mojom", "//chromeos/startup:constants", "//chromeos/system", - "//chromeos/tpm", - "//chromeos/tpm:buildflags", "//chromeos/ui/base", "//chromeos/ui/frame", "//chromeos/ui/wm", @@ -908,6 +908,8 @@ "../ash/arc/input_overlay/ui/action_tag.h", "../ash/arc/input_overlay/ui/action_view.cc", "../ash/arc/input_overlay/ui/action_view.h", + "../ash/arc/input_overlay/ui/edit_mode_exit_view.cc", + "../ash/arc/input_overlay/ui/edit_mode_exit_view.h", "../ash/arc/input_overlay/ui/input_mapping_view.cc", "../ash/arc/input_overlay/ui/input_mapping_view.h", "../ash/arc/input_overlay/ui/input_menu_view.cc", @@ -3693,26 +3695,26 @@ if (is_cfm) { sources += [ - "chromebox_for_meetings/browser/cfm_browser_service.cc", - "chromebox_for_meetings/browser/cfm_browser_service.h", - "chromebox_for_meetings/browser/cfm_memory_details.cc", - "chromebox_for_meetings/browser/cfm_memory_details.h", - "chromebox_for_meetings/cfm_chrome_services.cc", - "chromebox_for_meetings/cfm_chrome_services.h", - "chromebox_for_meetings/device_info/device_info_service.cc", - "chromebox_for_meetings/device_info/device_info_service.h", - "chromebox_for_meetings/diagnostics/diagnostics_service.cc", - "chromebox_for_meetings/diagnostics/diagnostics_service.h", - "chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc", - "chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h", - "chromebox_for_meetings/logger/cfm_logger_service.cc", - "chromebox_for_meetings/logger/cfm_logger_service.h", - "chromebox_for_meetings/logger/reporting_pipeline.cc", - "chromebox_for_meetings/logger/reporting_pipeline.h", - "chromebox_for_meetings/network_settings/network_settings_service.cc", - "chromebox_for_meetings/network_settings/network_settings_service.h", - "chromebox_for_meetings/service_adaptor.cc", - "chromebox_for_meetings/service_adaptor.h", + "../ash/chromebox_for_meetings/browser/cfm_browser_service.cc", + "../ash/chromebox_for_meetings/browser/cfm_browser_service.h", + "../ash/chromebox_for_meetings/browser/cfm_memory_details.cc", + "../ash/chromebox_for_meetings/browser/cfm_memory_details.h", + "../ash/chromebox_for_meetings/cfm_chrome_services.cc", + "../ash/chromebox_for_meetings/cfm_chrome_services.h", + "../ash/chromebox_for_meetings/device_info/device_info_service.cc", + "../ash/chromebox_for_meetings/device_info/device_info_service.h", + "../ash/chromebox_for_meetings/diagnostics/diagnostics_service.cc", + "../ash/chromebox_for_meetings/diagnostics/diagnostics_service.h", + "../ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.cc", + "../ash/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h", + "../ash/chromebox_for_meetings/logger/cfm_logger_service.cc", + "../ash/chromebox_for_meetings/logger/cfm_logger_service.h", + "../ash/chromebox_for_meetings/logger/reporting_pipeline.cc", + "../ash/chromebox_for_meetings/logger/reporting_pipeline.h", + "../ash/chromebox_for_meetings/network_settings/network_settings_service.cc", + "../ash/chromebox_for_meetings/network_settings/network_settings_service.h", + "../ash/chromebox_for_meetings/service_adaptor.cc", + "../ash/chromebox_for_meetings/service_adaptor.h", ] deps += [ "//chromeos/components/chromebox_for_meetings/features", @@ -4881,6 +4883,8 @@ "//ash/components/proximity_auth:test_support", "//ash/components/settings", "//ash/components/tether:test_support", + "//ash/components/tpm", + "//ash/components/tpm:test_support", "//ash/constants", "//ash/public/cpp", "//ash/public/cpp:test_support", @@ -4941,8 +4945,6 @@ "//chromeos/network:test_support", "//chromeos/services/machine_learning/public/cpp:stub", "//chromeos/system", - "//chromeos/tpm", - "//chromeos/tpm:test_support", "//chromeos/ui/frame:test_support", "//components/account_manager_core:test_support", "//components/app_constants", @@ -5024,11 +5026,11 @@ if (is_cfm) { sources += [ - "chromebox_for_meetings/browser/cfm_browser_service_unittest.cc", - "chromebox_for_meetings/device_info/device_info_service_unittest.cc", - "chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc", - "chromebox_for_meetings/logger/cfm_logger_service_unittest.cc", - "chromebox_for_meetings/service_adaptor_unittest.cc", + "../ash/chromebox_for_meetings/browser/cfm_browser_service_unittest.cc", + "../ash/chromebox_for_meetings/device_info/device_info_service_unittest.cc", + "../ash/chromebox_for_meetings/diagnostics/diagnostics_service_unittest.cc", + "../ash/chromebox_for_meetings/logger/cfm_logger_service_unittest.cc", + "../ash/chromebox_for_meetings/service_adaptor_unittest.cc", ] deps += [ "//chromeos/services/chromebox_for_meetings/public/cpp:test_support" ] @@ -5179,11 +5181,11 @@ deps = [ ":policy_fuzzer_proto", + "//ash/components/tpm", "//base/test:test_support", "//chrome/browser", "//chrome/browser/chromeos", "//chromeos/dbus:dbus", - "//chromeos/tpm", "//components:components_tests_pak", "//components/exo/wayland:weston_test", "//components/policy/core/browser:internal",
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/DEPS b/chrome/browser/chromeos/chromebox_for_meetings/DEPS deleted file mode 100644 index 543a2c5..0000000 --- a/chrome/browser/chromeos/chromebox_for_meetings/DEPS +++ /dev/null
@@ -1,14 +0,0 @@ -include_rules = [ - "+chromeos/dbus/chromebox_for_meetings", - "+chromeos/components/chromebox_for_meetings/buildflags", - "+chromeos/components/chromebox_for_meetings/features", - "+chromeos/services/chromebox_for_meetings/public/cpp", - "+chromeos/services/cros_healthd/public/cpp", - "+components/variations", -] - -specific_include_rules = { - "diagnostics_service_unittest\.cc": [ - "+chromeos/dbus/cros_healthd", - ] -}
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.h b/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.h deleted file mode 100644 index 1bb7230c..0000000 --- a/chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_memory_details.h +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_MEMORY_DETAILS_H_ -#define CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_MEMORY_DETAILS_H_ - -#include "chrome/browser/memory_details.h" -#include "chromeos/services/chromebox_for_meetings/public/mojom/cfm_browser.mojom.h" -#include "content/public/browser/render_process_host.h" - -namespace chromeos { -namespace cfm { - -// Log details about all Chrome processes. -class CfmMemoryDetails final : public MemoryDetails { - public: - // Collects the memory details asynchronously. - static void Collect(mojom::CfmBrowser::GetMemoryDetailsCallback callback); - - CfmMemoryDetails(const CfmMemoryDetails&) = delete; - CfmMemoryDetails& operator=(const CfmMemoryDetails&) = delete; - - private: - explicit CfmMemoryDetails( - mojom::CfmBrowser::GetMemoryDetailsCallback callback); - ~CfmMemoryDetails() override; - - // MemoryDetails overrides: - void OnDetailsAvailable() override; - - void CollectProcessInformation(); - void CollectExtensionsInformation(); - void UpdateGpuInfo(); - void FinishFetch(); - - base::GraphicsMemoryInfoKB gpu_meminfo_; - std::vector<mojom::ProcessDataPtr> proc_data_list_; - std::map<base::ProcessId, mojom::ProcessMemoryInformationPtr*> - proc_mem_info_map_; - mojom::CfmBrowser::GetMemoryDetailsCallback callback_; -}; - -} // namespace cfm -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_CHROMEBOX_FOR_MEETINGS_BROWSER_CFM_MEMORY_DETAILS_H_
diff --git a/chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.cc b/chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.cc deleted file mode 100644 index 95c7bb3e..0000000 --- a/chrome/browser/chromeos/chromebox_for_meetings/cfm_chrome_services.cc +++ /dev/null
@@ -1,48 +0,0 @@ -// 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/chromeos/chromebox_for_meetings/cfm_chrome_services.h" - -#include "chrome/browser/chromeos/chromebox_for_meetings/browser/cfm_browser_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/device_info/device_info_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/diagnostics/diagnostics_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/external_display_brightness/external_display_brightness_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/logger/cfm_logger_service.h" -#include "chrome/browser/chromeos/chromebox_for_meetings/network_settings/network_settings_service.h" -#include "chromeos/components/chromebox_for_meetings/features/features.h" -#include "chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h" - -namespace chromeos { -namespace cfm { - -void InitializeCfmServices() { - if (!base::FeatureList::IsEnabled(features::kMojoServices) || - !CfmHotlineClient::Get()) { - return; - } - - CfmBrowserService::Initialize(); - CfmLoggerService::Initialize(); - DeviceInfoService::Initialize(); - DiagnosticsService::Initialize(); - NetworkSettingsService::Initialize(); - ExternalDisplayBrightnessService::Initialize(); -} - -void ShutdownCfmServices() { - if (!base::FeatureList::IsEnabled(features::kMojoServices) || - !CfmHotlineClient::Get()) { - return; - } - - ExternalDisplayBrightnessService::Shutdown(); - NetworkSettingsService::Shutdown(); - DiagnosticsService::Shutdown(); - DeviceInfoService::Shutdown(); - CfmLoggerService::Shutdown(); - CfmBrowserService::Shutdown(); -} - -} // namespace cfm -} // namespace chromeos
diff --git a/chrome/browser/chromeos/extensions/info_private_apitest.cc b/chrome/browser/chromeos/extensions/info_private_apitest.cc index 1eda91c5..92bffd0 100644 --- a/chrome/browser/chromeos/extensions/info_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/info_private_apitest.cc
@@ -4,6 +4,7 @@ #include "ash/components/arc/test/arc_util_test_support.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/stylus_utils.h" @@ -14,7 +15,6 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h" #include "ui/aura/window.h"
diff --git a/chrome/browser/chromeos/extensions/install_limiter_unittest.cc b/chrome/browser/chromeos/extensions/install_limiter_unittest.cc index b625910..d98e751f4 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_unittest.cc +++ b/chrome/browser/chromeos/extensions/install_limiter_unittest.cc
@@ -4,10 +4,10 @@ #include "chrome/browser/chromeos/extensions/install_limiter.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/login/demo_mode/demo_mode_test_helper.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/user_manager/scoped_user_manager.h" #include "content/public/test/browser_task_environment.h" #include "extensions/common/constants.h"
diff --git a/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler.cc b/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler.cc index 32fd0c1..e9445ea 100644 --- a/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler.cc +++ b/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <iterator> +#include "ash/components/tpm/install_attributes.h" #include "ash/public/cpp/login_screen.h" #include "ash/public/cpp/login_screen_model.h" #include "ash/public/cpp/login_types.h" @@ -14,7 +15,6 @@ #include "chrome/browser/ash/login/ui/login_screen_extension_ui/window.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/tpm/install_attributes.h" #include "components/session_manager/core/session_manager.h" #include "content/public/browser/browser_thread.h" #include "extensions/common/constants.h"
diff --git a/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler_unittest.cc b/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler_unittest.cc index 3768639..3483194 100644 --- a/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler_unittest.cc +++ b/chrome/browser/chromeos/extensions/login_screen/login_screen_ui/ui_handler_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/tpm/stub_install_attributes.h" #include "base/test/gtest_util.h" #include "base/test/mock_callback.h" #include "chrome/browser/ash/login/ui/login_screen_extension_ui/create_options.h" @@ -15,7 +16,6 @@ #include "chrome/common/chrome_constants.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/session_manager/core/session_manager.h" #include "components/version_info/version_info.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/chromeos/extensions/users_private/users_private_apitest.cc b/chrome/browser/chromeos/extensions/users_private/users_private_apitest.cc index 59858cf8..badbcad 100644 --- a/chrome/browser/chromeos/extensions/users_private/users_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/users_private/users_private_apitest.cc
@@ -6,6 +6,7 @@ #include <vector> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/command_line.h" #include "base/memory/ptr_util.h" @@ -23,7 +24,6 @@ #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/api/users_private.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/keyed_service/core/keyed_service.h" #include "components/ownership/mock_owner_key_util.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/device_identity/chromeos/device_oauth2_token_store_chromeos_unittest.cc b/chrome/browser/device_identity/chromeos/device_oauth2_token_store_chromeos_unittest.cc index 94b6aa9..c648b99 100644 --- a/chrome/browser/device_identity/chromeos/device_oauth2_token_store_chromeos_unittest.cc +++ b/chrome/browser/device_identity/chromeos/device_oauth2_token_store_chromeos_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/device_identity/chromeos/device_oauth2_token_store_chromeos.h" #include "ash/components/cryptohome/system_salt_getter.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/run_loop.h" #include "base/task/thread_pool/thread_pool_instance.h" #include "base/test/bind.h" @@ -18,7 +19,6 @@ #include "chrome/test/base/testing_browser_process.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/ownership/mock_owner_key_util.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/test_utils.h"
diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc index 948f768..2823f4e 100644 --- a/chrome/browser/download/download_file_picker.cc +++ b/chrome/browser/download/download_file_picker.cc
@@ -14,8 +14,8 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/web_contents.h" -#if BUILDFLAG(IS_LINUX) -#include "chrome/browser/ui/browser_finder.h" +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) +#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "ui/aura/window.h" #endif @@ -74,10 +74,13 @@ // dialog in Linux. See SelectFileImpl() in select_file_dialog_linux_gtk.cc. // Here we make owning_window host to browser current active window // if it is null. https://crbug.com/1301898 -#if BUILDFLAG(IS_LINUX) - if (!owning_window || !owning_window->GetHost()) - owning_window = - chrome::FindBrowserWithActiveWindow()->window()->GetNativeWindow(); +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) + if (!owning_window || !owning_window->GetHost()) { + owning_window = BrowserList::GetInstance() + ->GetLastActive() + ->window() + ->GetNativeWindow(); + } #endif select_file_dialog_->SelectFile(
diff --git a/chrome/browser/download/internal/android/java/res/layout/download_interstitial.xml b/chrome/browser/download/internal/android/java/res/layout/download_interstitial.xml index a31bccba..491c6e1 100644 --- a/chrome/browser/download/internal/android/java/res/layout/download_interstitial.xml +++ b/chrome/browser/download/internal/android/java/res/layout/download_interstitial.xml
@@ -7,7 +7,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" - android:background="@color/default_bg_color" + android:background="@macro/default_bg_color" android:fillViewport="true" android:layout_width="match_parent" android:layout_height="match_parent" @@ -66,7 +66,7 @@ android:paddingEnd="4dp" android:paddingTop="10dp" android:paddingBottom="10dp" - android:background="@color/default_bg_color" + android:background="@macro/default_bg_color" app:stackedMargin="24dp" app:buttonAlignment="end"/> </FrameLayout>
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 913ba82..f6d212d 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -1123,6 +1123,7 @@ "//ash/components/login/auth", "//ash/components/proximity_auth", "//ash/components/settings", + "//ash/components/tpm", "//ash/constants", "//ash/keyboard/ui:resources_grit_grit", "//ash/public/cpp", @@ -1156,7 +1157,6 @@ "//chromeos/services/media_perception/public/mojom", "//chromeos/services/tts/public/mojom", "//chromeos/system", - "//chromeos/tpm", "//chromeos/ui/base", "//components/constrained_window", "//components/crash/content/browser/error_reporting",
diff --git a/chrome/browser/extensions/api/force_installed_affiliated_extension_apitest.h b/chrome/browser/extensions/api/force_installed_affiliated_extension_apitest.h index 1629764c..5386fc43 100644 --- a/chrome/browser/extensions/api/force_installed_affiliated_extension_apitest.h +++ b/chrome/browser/extensions/api/force_installed_affiliated_extension_apitest.h
@@ -7,13 +7,13 @@ #include <string> +#include "ash/components/tpm/stub_install_attributes.h" #include "base/values.h" #include "chrome/browser/ash/policy/affiliation/affiliation_mixin.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/extensions/mixin_based_extension_apitest.h" #include "chrome/browser/policy/extension_force_install_mixin.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" #include "extensions/common/extension_id.h" #include "url/gurl.h"
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 708e6983c..30da6f9 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -84,12 +84,12 @@ #include "url/gurl.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/login/users/mock_user_manager.h" #include "chrome/browser/ash/net/network_portal_detector_test_impl.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/user_manager/scoped_user_manager.h" #endif
diff --git a/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.h b/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.h index 620d792..00c58e7 100644 --- a/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.h +++ b/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.h
@@ -7,9 +7,9 @@ #include <memory> +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/extensions/mixin_based_extension_apitest.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" #include "google_apis/gaia/fake_gaia.h"
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc index a6e9308..664027d6 100644 --- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc +++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_unittest.cc
@@ -44,11 +44,11 @@ #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/login/users/scoped_test_user_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 81245e1..a2141af 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1687,7 +1687,7 @@ { "name": "enable-critical-persisted-tab-data", "owners": [ "chrome-shopping@google.com" ], - "expiry_milestone": 100 + "expiry_milestone": 108 }, { "name": "enable-cros-action-recorder", @@ -2057,11 +2057,6 @@ "expiry_milestone": 106 }, { - "name": "enable-experimental-accessibility-switch-access-multistep-automation", - "owners": [ "akihiroota@google.com", "mschillaci@google.com" ], - "expiry_milestone": 102 - }, - { "name": "enable-experimental-accessibility-switch-access-text", "owners": [ "//ui/accessibility/OWNERS" ], "expiry_milestone": 95 @@ -2465,7 +2460,7 @@ { "name": "enable-notifications-revamp", "owners": [ "amehfooz", "newcomer" ], - "expiry_milestone": 100 + "expiry_milestone": 106 }, { "name": "enable-oauth-ipp", @@ -2475,7 +2470,7 @@ { "name": "enable-oop-print-drivers", "owners": [ "awscreen", "thestig" ], - "expiry_milestone": 100 + "expiry_milestone": 112 }, { "name": "enable-openscreen-cast-streaming-session", @@ -3352,7 +3347,7 @@ { "name": "focus-follows-cursor", "owners": [ "dandersson", "tclaiborne" ], - "expiry_milestone": 100 + "expiry_milestone": 110 }, { "name": "font-access", @@ -4370,8 +4365,8 @@ }, { "name": "omnibox-adaptive-suggestions-count", - "owners": [ "ender", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 97 + "owners": [ "ender", "stkhapugin", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 110 }, { "name": "omnibox-aggregate-shortcuts", @@ -4403,11 +4398,6 @@ "expiry_milestone": 95 }, { - "name": "omnibox-clobber-triggers-contextual-web-zero-suggest", - "owners": [ "tommycli", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 100 - }, - { "name": "omnibox-close-popup-with-escape", "owners": ["manukh", "chrome-omnibox-team@google.com"], "expiry_milestone": 110 @@ -4429,8 +4419,8 @@ }, { "name": "omnibox-dynamic-max-autocomplete", - "owners": [ "manukh", "ender", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 100 + "owners": [ "ender", "stkhapugin", "manukh", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 110 }, { "name": "omnibox-experimental-keyword-mode", @@ -4459,8 +4449,8 @@ }, { "name": "omnibox-most-visited-tiles", - "owners": [ "fgorski", "ender", "chrome-omnibox-team@google.com"], - "expiry_milestone": 97 + "owners": [ "fgorski", "ender", "stkhapugin", "chrome-omnibox-team@google.com"], + "expiry_milestone": 110 }, { "name": "omnibox-new-popup-ui", @@ -4484,13 +4474,13 @@ }, { "name": "omnibox-on-focus-suggestions-contextual-web", - "owners": [ "tommycli", "ender", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 100 + "owners": [ "ender", "stkhapugin", "tommycli", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 110 }, { "name": "omnibox-on-focus-suggestions-contextual-web-allow-srp", - "owners": [ "ender", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 100 + "owners": [ "ender", "stkhapugin", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 110 }, { "name": "omnibox-pedals-android-batch1", @@ -4574,8 +4564,8 @@ }, { "name": "omnibox-trending-zero-prefix-suggestions-on-ntp", - "owners": [ "mahmadi", "ender", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 104 + "owners": [ "ender", "stkhapugin", "mahmadi", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 110 }, { "name": "omnibox-trigger-for-prerender2", @@ -4800,7 +4790,7 @@ { "name": "performant-split-view-resizing", "owners": [ "dandersson", "riomat" ], - "expiry_milestone": 100 + "expiry_milestone": 110 }, { "name": "permission-chip", @@ -4870,12 +4860,12 @@ { "name": "print-with-postscript-type42-fonts", "owners": [ "thestig" ], - "expiry_milestone": 100 + "expiry_milestone": 112 }, { "name": "print-with-reduced-rasterization", "owners": [ "thestig" ], - "expiry_milestone": 96 + "expiry_milestone": 112 }, { "name": "privacy-advisor", @@ -5271,7 +5261,7 @@ { "name": "screentime", "owners": [ "lgrey", "chrome-mac-dev@google.com" ], - "expiry_milestone": 100 + "expiry_milestone": 110 }, { "name": "scroll-unification", @@ -5335,7 +5325,7 @@ }, { "name": "send-tab-to-self-v2", - "owners": ["kmilka", "chrome-sharing-eng@google.com"], + "owners": ["ellyjones", "chrome-sharing-eng@google.com"], "expiry_milestone": 100 }, { @@ -5372,12 +5362,12 @@ }, { "name": "shared-highlighting-v2", - "owners": ["kmilka", "cheickcisse@google.com"], + "owners": ["jeffreycohen", "kristipark", "cheickcisse@google.com"], "expiry_milestone": 99 }, { "name": "sharing-desktop-screenshots", - "owners": ["skare", "kmilka", "chrome-sharing-eng@google.com" ], + "owners": ["skare", "jeffreycohen", "chrome-sharing-eng@google.com" ], "expiry_milestone": 104 }, { @@ -6001,12 +5991,12 @@ { "name": "use-xps-for-printing", "owners": [ "awscreen", "thestig" ], - "expiry_milestone": 101 + "expiry_milestone": 112 }, { "name": "use-xps-for-printing-from-pdf", "owners": [ "awscreen", "thestig" ], - "expiry_milestone": 101 + "expiry_milestone": 112 }, { "name": "username-first-flow",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 8aa9ace..f192006 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1738,13 +1738,6 @@ "suggest a bookmark titled 'Jupiter' with URL " "'en.wikipedia.org/wiki/Jupiter' located in a path containing 'planet.'"; -const char kOmniboxClobberTriggersContextualWebZeroSuggestName[] = - "Omnibox Clobber Triggers Contextual Web ZeroSuggest"; -const char kOmniboxClobberTriggersContextualWebZeroSuggestDescription[] = - "If enabled, when the user clears the whole omnibox text (i.e. via " - "Backspace), Chrome will request ZeroSuggest suggestions for the OTHER " - "page classification (contextual web)."; - const char kOmniboxClosePopupWithEscapeName[] = "Omnibox Close Popup with Escape"; const char kOmniboxClosePopupWithEscapeDescription[] = @@ -4816,13 +4809,6 @@ "Enable experimental or in-progress Switch Access features for improved " "text input"; -const char kExperimentalAccessibilitySwitchAccessMultistepAutomationName[] = - "Enable multistep automation for Switch Access."; -const char - kExperimentalAccessibilitySwitchAccessMultistepAutomationDescription[] = - "Enable multistep automation for Switch Access, which is a project for " - "the 2021 accessibility sprint."; - const char kExtendedOpenVpnSettingsName[] = "Enable extended OpenVPN settings"; const char kExtendedOpenVpnSettingsDescription[] = "Enable displaying additional configuration properties of already "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 8bc6f0f3..3fec1c2 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -990,9 +990,6 @@ extern const char kOmniboxBookmarkPathsName[]; extern const char kOmniboxBookmarkPathsDescription[]; -extern const char kOmniboxClobberTriggersContextualWebZeroSuggestName[]; -extern const char kOmniboxClobberTriggersContextualWebZeroSuggestDescription[]; - extern const char kOmniboxClosePopupWithEscapeName[]; extern const char kOmniboxClosePopupWithEscapeDescription[]; @@ -2764,11 +2761,6 @@ extern const char kExperimentalAccessibilitySwitchAccessTextName[]; extern const char kExperimentalAccessibilitySwitchAccessTextDescription[]; -extern const char - kExperimentalAccessibilitySwitchAccessMultistepAutomationName[]; -extern const char - kExperimentalAccessibilitySwitchAccessMultistepAutomationDescription[]; - extern const char kExtendedOpenVpnSettingsName[]; extern const char kExtendedOpenVpnSettingsDescription[];
diff --git a/chrome/browser/metrics/variations/chrome_variations_service_client.cc b/chrome/browser/metrics/variations/chrome_variations_service_client.cc index 28df646..3d68c85b 100644 --- a/chrome/browser/metrics/variations/chrome_variations_service_client.cc +++ b/chrome/browser/metrics/variations/chrome_variations_service_client.cc
@@ -20,13 +20,12 @@ #endif #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/install_attributes.h" #include "chrome/browser/ash/settings/cros_settings.h" #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) #include "base/enterprise_util.h" -#elif BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/tpm/install_attributes.h" #endif ChromeVariationsServiceClient::ChromeVariationsServiceClient() = default;
diff --git a/chrome/browser/nearby_sharing/nearby_notification_manager.cc b/chrome/browser/nearby_sharing/nearby_notification_manager.cc index d352110..fb573e79 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_manager.cc +++ b/chrome/browser/nearby_sharing/nearby_notification_manager.cc
@@ -217,33 +217,71 @@ size_t attachment_count = share_target.file_attachments.size() + share_target.text_attachments.size(); - return base::ReplaceStringPlaceholders( - l10n_util::GetPluralStringFUTF16(resource_id, attachment_count), - {attachments, device_name}, /*offsets=*/nullptr); + if (!share_target.wifi_credentials_attachments.empty() && + base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + std::u16string network_name = + base::UTF8ToUTF16(share_target.wifi_credentials_attachments[0].ssid()); + return base::ReplaceStringPlaceholders( + l10n_util::GetStringUTF16(resource_id), {network_name, device_name}, + /*offsets=*/nullptr); + } else { + return base::ReplaceStringPlaceholders( + l10n_util::GetPluralStringFUTF16(resource_id, attachment_count), + {attachments, device_name}, /*offsets=*/nullptr); + } } std::u16string GetProgressNotificationTitle(const ShareTarget& share_target) { - return FormatNotificationTitle( - share_target, - share_target.is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE - : IDS_NEARBY_NOTIFICATION_SEND_PROGRESS_TITLE, - /*use_capitalized_attachments=*/false); + if (!share_target.wifi_credentials_attachments.empty() && + base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + return FormatNotificationTitle( + share_target, + IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE_WIFI_CREDENTIALS, + /*use_capitalized_attachments=*/false); + } else { + return FormatNotificationTitle( + share_target, + share_target.is_incoming + ? IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE + : IDS_NEARBY_NOTIFICATION_SEND_PROGRESS_TITLE, + /*use_capitalized_attachments=*/false); + } } std::u16string GetSuccessNotificationTitle(const ShareTarget& share_target) { - return FormatNotificationTitle( - share_target, - share_target.is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE - : IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE, - /*use_capitalized_attachments=*/true); + if (!share_target.wifi_credentials_attachments.empty() && + base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + return FormatNotificationTitle( + share_target, + IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE_WIFI_CREDENTIALS, + /*use_capitalized_attachments=*/false); + } else { + return FormatNotificationTitle( + share_target, + share_target.is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE + : IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE, + /*use_capitalized_attachments=*/true); + } } std::u16string GetFailureNotificationTitle(const ShareTarget& share_target) { - return FormatNotificationTitle( - share_target, - share_target.is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE - : IDS_NEARBY_NOTIFICATION_SEND_FAILURE_TITLE, - /*use_capitalized_attachments=*/false); + if (!share_target.wifi_credentials_attachments.empty() && + base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + return FormatNotificationTitle( + share_target, + IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE_WIFI_CREDENTIALS, + /*use_capitalized_attachments=*/false); + } else { + return FormatNotificationTitle( + share_target, + share_target.is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE + : IDS_NEARBY_NOTIFICATION_SEND_FAILURE_TITLE, + /*use_capitalized_attachments=*/false); + } } absl::optional<std::u16string> GetFailureNotificationMessage( @@ -269,10 +307,21 @@ size_t attachment_count = share_target.file_attachments.size() + share_target.text_attachments.size(); - std::u16string message = base::ReplaceStringPlaceholders( - l10n_util::GetPluralStringFUTF16( - IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE, attachment_count), - {device_name, attachments}, /*offsets=*/nullptr); + std::u16string message; + if (!share_target.wifi_credentials_attachments.empty() && + base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + message = base::ReplaceStringPlaceholders( + l10n_util::GetStringUTF16( + IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE_WIFI_CREDENTIALS), + device_name, /*offsets=*/nullptr); + } else { + message = base::ReplaceStringPlaceholders( + l10n_util::GetPluralStringFUTF16( + IDS_NEARBY_NOTIFICATION_CONNECTION_REQUEST_MESSAGE, + attachment_count), + {device_name, attachments}, /*offsets=*/nullptr); + } if (transfer_metadata.token()) { std::u16string token = l10n_util::GetStringFUTF16( @@ -291,6 +340,10 @@ NearbyNotificationManager::ReceivedContentType GetReceivedContentType( const ShareTarget& share_target) { + if (!share_target.wifi_credentials_attachments.empty()) { + return NearbyNotificationManager::ReceivedContentType::kWifiCredentials; + } + if (!share_target.text_attachments.empty()) { const TextAttachment& file = share_target.text_attachments[0]; if (share_target.text_attachments.size() == 1 && @@ -490,6 +543,9 @@ case NearbyNotificationManager::ReceivedContentType::kFiles: OpenDownloadsFolder(); break; + case NearbyNotificationManager::ReceivedContentType::kWifiCredentials: + OpenWifiNetworksList(); + break; } manager_->CloseSuccessNotification(notification_id); @@ -548,6 +604,16 @@ } } + void OpenWifiNetworksList() { + manager_->OpenWifiNetworksList(); + + if (testing_callback_) { + std::move(testing_callback_) + .Run(NearbyNotificationManager::SuccessNotificationAction:: + kOpenWifiNetworksList); + } + } + NearbyNotificationManager* manager_; Profile* profile_; ShareTarget share_target_; @@ -767,9 +833,16 @@ ShowProgress(share_target, transfer_metadata); break; case TransferMetadata::Status::kAwaitingLocalConfirmation: - // Only incoming transfers are handled via notifications. - if (share_target.is_incoming) - ShowConnectionRequest(share_target, transfer_metadata); + if (base::FeatureList::IsEnabled(features::kNearbySharingSelfShare)) { + // Only incoming transfers are handled via notifications. + // Don't show notification for self shares since we will auto-accept. + if (share_target.is_incoming && !share_target.for_self_share) + ShowConnectionRequest(share_target, transfer_metadata); + } else { + // Only incoming transfers are handled via notifications. + if (share_target.is_incoming) + ShowConnectionRequest(share_target, transfer_metadata); + } break; case TransferMetadata::Status::kComplete: ShowSuccess(share_target); @@ -1022,6 +1095,10 @@ notification_actions.emplace_back(l10n_util::GetStringUTF16( IDS_NEARBY_NOTIFICATION_ACTION_OPEN_FOLDER)); break; + case ReceivedContentType::kWifiCredentials: + notification_actions.emplace_back(l10n_util::GetStringUTF16( + IDS_NEARBY_NOTIFICATION_ACTION_OPEN_NETWORK_LIST)); + break; } notification.set_buttons(notification_actions); @@ -1148,6 +1225,11 @@ nearby_service_->OpenURL(url); } +void NearbyNotificationManager::OpenWifiNetworksList() { + settings_opener_->ShowSettingsPage( + profile_, chromeos::settings::mojom::kKnownNetworksSubpagePath); +} + void NearbyNotificationManager::CancelTransfer() { CloseTransfer(); nearby_service_->Cancel(*share_target_, base::DoNothing());
diff --git a/chrome/browser/nearby_sharing/nearby_notification_manager.h b/chrome/browser/nearby_sharing/nearby_notification_manager.h index 0d1b920..7680ace 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_manager.h +++ b/chrome/browser/nearby_sharing/nearby_notification_manager.h
@@ -38,14 +38,16 @@ kCopyImage, kOpenDownloads, kOpenUrl, + kOpenWifiNetworksList, }; // Type of content we received that determines the actions we provide. enum class ReceivedContentType { - kFiles, // One or more generic files - kSingleImage, // One image that will be shown as a preview - kSingleUrl, // One URL that will be opened on click. - kText, // Arbitrary text content + kFiles, // One or more generic files + kSingleImage, // One image that will be shown as a preview + kSingleUrl, // One URL that will be opened on click. + kText, // Arbitrary text content + kWifiCredentials, // Wi-Fi credentials for a network configuration }; class SettingsOpener { @@ -133,6 +135,9 @@ void OpenURL(GURL url); + // Opens Wi-Fi Networks subpage in Settings. + void OpenWifiNetworksList(); + // Cancels the currently in progress transfer. void CancelTransfer();
diff --git a/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc b/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc index 4a208b6..d113ac688 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc +++ b/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc
@@ -68,8 +68,12 @@ namespace { +const uint64_t kWifiCredentialsId = 111; const char kTextBody[] = "text body"; const char kTextUrl[] = "https://google.com"; +const char kWifiSsid[] = "test_ssid"; +const WifiCredentialsAttachment::SecurityType kSecurityType = + sharing::mojom::WifiCredentialsMetadata::SecurityType::kWpaPsk; MATCHER_P(MatchesTarget, target, "") { return arg.id == target.id; @@ -98,6 +102,11 @@ /*mime_type=*/"example", type); } +WifiCredentialsAttachment CreateWifiCredentialsAttachment( + WifiCredentialsAttachment::SecurityType securityType) { + return WifiCredentialsAttachment(kWifiCredentialsId, securityType, kWifiSsid); +} + std::unique_ptr<KeyedService> CreateMockNearbySharingService( content::BrowserContext* browser_context) { return std::make_unique<testing::NiceMock<MockNearbySharingService>>(); @@ -143,11 +152,12 @@ class NearbyNotificationManagerTestBase : public testing::Test { public: explicit NearbyNotificationManagerTestBase( - std::tuple<bool, bool> feature_list) { + std::tuple<bool, bool, bool> feature_list) { std::vector<base::Feature> enabled_features; std::vector<base::Feature> disabled_features; is_self_share_enabled_ = std::get<0>(feature_list); is_visibility_reminder_enabled_ = std::get<1>(feature_list); + is_receive_wifi_credentials_enabled_ = std::get<2>(feature_list); if (is_self_share_enabled_) { enabled_features.push_back(features::kNearbySharingSelfShare); } else { @@ -158,6 +168,13 @@ } else { disabled_features.push_back(features::kNearbySharingVisibilityReminder); } + if (is_receive_wifi_credentials_enabled_) { + enabled_features.push_back( + features::kNearbySharingReceiveWifiCredentials); + } else { + disabled_features.push_back( + features::kNearbySharingReceiveWifiCredentials); + } scoped_feature_list_.InitWithFeatures(enabled_features, disabled_features); RegisterNearbySharingPrefs(pref_service_.registry()); } @@ -219,7 +236,8 @@ ShareTarget CreateIncomingShareTarget(int text_attachments, int url_attachements, int image_attachments, - int other_file_attachments) { + int other_file_attachments, + bool wifi_credentials_attachments) { ShareTarget share_target; share_target.is_incoming = true; for (int i = 0; i < text_attachments; i++) { @@ -252,6 +270,12 @@ share_target.file_attachments.push_back( CreateFileAttachment(FileAttachment::Type::kVideo)); } + + if (wifi_credentials_attachments && is_receive_wifi_credentials_enabled_) { + share_target.wifi_credentials_attachments.push_back( + CreateWifiCredentialsAttachment( + WifiCredentialsAttachment::SecurityType::kWpaPsk)); + } return share_target; } @@ -276,13 +300,14 @@ MockSettingsOpener* settings_opener_; bool is_self_share_enabled_ = false; bool is_visibility_reminder_enabled_ = false; + bool is_receive_wifi_credentials_enabled_ = false; }; // We parameterize these tests to run them with Self Share and Nearby Share // Visibility Reminder enabled and disabled. class NearbyNotificationManagerTest : public NearbyNotificationManagerTestBase, - public testing::WithParamInterface<std::tuple<bool, bool>> { + public testing::WithParamInterface<std::tuple<bool, bool, bool>> { public: NearbyNotificationManagerTest() : NearbyNotificationManagerTestBase(/*feature_list=*/GetParam()) {} @@ -291,6 +316,8 @@ struct AttachmentsTestParamInternal { std::vector<TextAttachment::Type> text_attachments; std::vector<FileAttachment::Type> file_attachments; + std::vector<WifiCredentialsAttachment::SecurityType> + wifi_credentials_attachments; int expected_capitalized_resource_id; int expected_not_capitalized_resource_id; }; @@ -299,6 +326,7 @@ // No attachments. {{}, {}, + {}, IDS_NEARBY_CAPITALIZED_UNKNOWN_ATTACHMENTS, IDS_NEARBY_NOT_CAPITALIZED_UNKNOWN_ATTACHMENTS}, @@ -306,6 +334,7 @@ { {TextAttachment::Type::kText}, {FileAttachment::Type::kUnknown}, + {}, IDS_NEARBY_CAPITALIZED_UNKNOWN_ATTACHMENTS, IDS_NEARBY_NOT_CAPITALIZED_UNKNOWN_ATTACHMENTS, }, @@ -313,60 +342,80 @@ // Text attachments. {{TextAttachment::Type::kUrl}, {}, + {}, IDS_NEARBY_TEXT_ATTACHMENTS_CAPITALIZED_LINKS, IDS_NEARBY_TEXT_ATTACHMENTS_NOT_CAPITALIZED_LINKS}, {{TextAttachment::Type::kText}, {}, + {}, IDS_NEARBY_TEXT_ATTACHMENTS_CAPITALIZED_UNKNOWN, IDS_NEARBY_TEXT_ATTACHMENTS_NOT_CAPITALIZED_UNKNOWN}, {{TextAttachment::Type::kAddress}, {}, + {}, IDS_NEARBY_TEXT_ATTACHMENTS_CAPITALIZED_ADDRESSES, IDS_NEARBY_TEXT_ATTACHMENTS_NOT_CAPITALIZED_ADDRESSES}, {{TextAttachment::Type::kPhoneNumber}, {}, + {}, IDS_NEARBY_TEXT_ATTACHMENTS_CAPITALIZED_PHONE_NUMBERS, IDS_NEARBY_TEXT_ATTACHMENTS_NOT_CAPITALIZED_PHONE_NUMBERS}, {{TextAttachment::Type::kAddress, TextAttachment::Type::kAddress}, {}, + {}, IDS_NEARBY_TEXT_ATTACHMENTS_CAPITALIZED_ADDRESSES, IDS_NEARBY_TEXT_ATTACHMENTS_NOT_CAPITALIZED_ADDRESSES}, {{TextAttachment::Type::kAddress, TextAttachment::Type::kUrl}, {}, + {}, IDS_NEARBY_TEXT_ATTACHMENTS_CAPITALIZED_UNKNOWN, IDS_NEARBY_TEXT_ATTACHMENTS_NOT_CAPITALIZED_UNKNOWN}, // File attachments. {{}, {FileAttachment::Type::kApp}, + {}, IDS_NEARBY_FILE_ATTACHMENTS_CAPITALIZED_APPS, IDS_NEARBY_FILE_ATTACHMENTS_NOT_CAPITALIZED_APPS}, {{}, {FileAttachment::Type::kImage}, + {}, IDS_NEARBY_FILE_ATTACHMENTS_CAPITALIZED_IMAGES, IDS_NEARBY_FILE_ATTACHMENTS_NOT_CAPITALIZED_IMAGES}, {{}, {FileAttachment::Type::kUnknown}, + {}, IDS_NEARBY_FILE_ATTACHMENTS_CAPITALIZED_UNKNOWN, IDS_NEARBY_FILE_ATTACHMENTS_NOT_CAPITALIZED_UNKNOWN}, {{}, {FileAttachment::Type::kVideo}, + {}, IDS_NEARBY_FILE_ATTACHMENTS_CAPITALIZED_VIDEOS, IDS_NEARBY_FILE_ATTACHMENTS_NOT_CAPITALIZED_VIDEOS}, {{}, {FileAttachment::Type::kApp, FileAttachment::Type::kApp}, + {}, IDS_NEARBY_FILE_ATTACHMENTS_CAPITALIZED_APPS, IDS_NEARBY_FILE_ATTACHMENTS_NOT_CAPITALIZED_APPS}, {{}, {FileAttachment::Type::kApp, FileAttachment::Type::kImage}, + {}, IDS_NEARBY_FILE_ATTACHMENTS_CAPITALIZED_UNKNOWN, IDS_NEARBY_FILE_ATTACHMENTS_NOT_CAPITALIZED_UNKNOWN}, + + // Wi-Fi Credentials attachments. + {{}, + {}, + {WifiCredentialsAttachment::SecurityType::kWpaPsk}, + IDS_NEARBY_CAPITALIZED_UNKNOWN_ATTACHMENTS, + IDS_NEARBY_NOT_CAPITALIZED_UNKNOWN_ATTACHMENTS}, }; // Boolean parameter is |is_incoming| and the tuple parameter is featuree list -// contains |enable_self_share| and |enable_visibility_reminder|. -using AttachmentsTestParam = - std::tuple<AttachmentsTestParamInternal, bool, std::tuple<bool, bool>>; +// contains |enable_self_share|, |enable_visibility_reminder|, and +// |enable_receive_wifi_credentials|. +using AttachmentsTestParam = std:: + tuple<AttachmentsTestParamInternal, bool, std::tuple<bool, bool, bool>>; class NearbyNotificationManagerAttachmentsTest : public NearbyNotificationManagerTestBase, @@ -378,8 +427,10 @@ }; // Boolean parameter is |with_token| and the tuple parameter is featuree list -// contains |enable_self_share| and |enable_visibility_reminder|. -using ConnectionRequestTestParam = std::tuple<bool, std::tuple<bool, bool>>; +// contains |enable_self_share|, |enable_visibility_reminder|, +// |enable_receive_wifi_credentials|. +using ConnectionRequestTestParam = + std::tuple<bool, std::tuple<bool, bool, bool>>; class NearbyNotificationManagerConnectionRequestTest : public NearbyNotificationManagerTestBase, @@ -394,7 +445,17 @@ int resource_id, const AttachmentsTestParamInternal& param, const std::string& device_name, + const std::string& network_name, bool use_capitalized_resource) { + if (!param.wifi_credentials_attachments.empty() && + base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + return base::ReplaceStringPlaceholders( + l10n_util::GetStringUTF16(resource_id), + {base::ASCIIToUTF16(network_name), base::ASCIIToUTF16(device_name)}, + /*offsets=*/nullptr); + } + size_t total = param.text_attachments.size() + param.file_attachments.size(); int attachments_resource_id = use_capitalized_resource ? param.expected_capitalized_resource_id @@ -525,6 +586,9 @@ const AttachmentsTestParamInternal& param = std::get<0>(GetParam()); bool is_incoming = std::get<1>(GetParam()); + if (!param.wifi_credentials_attachments.empty()) + return; + std::string device_name = "device"; ShareTarget share_target; share_target.device_name = device_name; @@ -536,13 +600,31 @@ for (FileAttachment::Type type : param.file_attachments) share_target.file_attachments.push_back(CreateFileAttachment(type)); + if (is_incoming && is_receive_wifi_credentials_enabled_) { + for (WifiCredentialsAttachment::SecurityType securityType : + param.wifi_credentials_attachments) { + share_target.wifi_credentials_attachments.push_back( + CreateWifiCredentialsAttachment(securityType)); + } + } + TransferMetadata transfer_metadata = TransferMetadataBuilder().build(); manager()->ShowProgress(share_target, transfer_metadata); - std::u16string expected = FormatNotificationTitle( - is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE - : IDS_NEARBY_NOTIFICATION_SEND_PROGRESS_TITLE, - param, device_name, /*use_capitalized_resource=*/false); + std::u16string expected; + if (!param.wifi_credentials_attachments.empty() && + is_receive_wifi_credentials_enabled_ && is_incoming) { + expected = FormatNotificationTitle( + IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE_WIFI_CREDENTIALS, param, + device_name, share_target.wifi_credentials_attachments[0].ssid(), + /*use_capitalized_resource=*/false); + } else { + expected = FormatNotificationTitle( + is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_PROGRESS_TITLE + : IDS_NEARBY_NOTIFICATION_SEND_PROGRESS_TITLE, + param, device_name, /*network_name=*/kWifiSsid, + /*use_capitalized_resource=*/false); + } std::vector<message_center::Notification> notifications = GetDisplayedNotifications(); @@ -561,18 +643,40 @@ share_target.device_name = device_name; share_target.is_incoming = is_incoming; + // We currently do not support sending Wi-Fi credentials + if (!is_incoming && !param.wifi_credentials_attachments.empty()) + return; + for (TextAttachment::Type type : param.text_attachments) share_target.text_attachments.push_back(CreateTextAttachment(type)); for (FileAttachment::Type type : param.file_attachments) share_target.file_attachments.push_back(CreateFileAttachment(type)); + if (is_incoming && is_receive_wifi_credentials_enabled_) { + for (WifiCredentialsAttachment::SecurityType securityType : + param.wifi_credentials_attachments) { + share_target.wifi_credentials_attachments.push_back( + CreateWifiCredentialsAttachment(securityType)); + } + } + manager()->ShowSuccess(share_target); - std::u16string expected = FormatNotificationTitle( - is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE - : IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE, - param, device_name, /*use_capitalized_resource=*/true); + std::u16string expected; + if (!param.wifi_credentials_attachments.empty() && + is_receive_wifi_credentials_enabled_ && is_incoming) { + expected = FormatNotificationTitle( + IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE_WIFI_CREDENTIALS, param, + device_name, share_target.wifi_credentials_attachments[0].ssid(), + /*use_capitalized_resource=*/true); + } else { + expected = FormatNotificationTitle( + is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_SUCCESS_TITLE + : IDS_NEARBY_NOTIFICATION_SEND_SUCCESS_TITLE, + param, device_name, /*network_name=*/kWifiSsid, + /*use_capitalized_resource=*/true); + } std::vector<message_center::Notification> notifications = GetDisplayedNotifications(); @@ -591,12 +695,24 @@ share_target.device_name = device_name; share_target.is_incoming = is_incoming; + // We currently do not support sending Wi-Fi credentials + if (!is_incoming && !param.wifi_credentials_attachments.empty()) + return; + for (TextAttachment::Type type : param.text_attachments) share_target.text_attachments.push_back(CreateTextAttachment(type)); for (FileAttachment::Type type : param.file_attachments) share_target.file_attachments.push_back(CreateFileAttachment(type)); + if (is_incoming && is_receive_wifi_credentials_enabled_) { + for (WifiCredentialsAttachment::SecurityType securityType : + param.wifi_credentials_attachments) { + share_target.wifi_credentials_attachments.push_back( + CreateWifiCredentialsAttachment(securityType)); + } + } + for (absl::optional<std::pair<TransferMetadata::Status, int>> error : std::vector<absl::optional<std::pair<TransferMetadata::Status, int>>>{ std::make_pair(TransferMetadata::Status::kNotEnoughSpace, @@ -620,10 +736,21 @@ manager()->OnNearbyProcessStopped(); } - std::u16string expected_title = FormatNotificationTitle( - is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE - : IDS_NEARBY_NOTIFICATION_SEND_FAILURE_TITLE, - param, device_name, /*use_capitalized_resource=*/false); + std::u16string expected_title; + if (!param.wifi_credentials_attachments.empty() && + is_receive_wifi_credentials_enabled_ && is_incoming) { + expected_title = FormatNotificationTitle( + IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE_WIFI_CREDENTIALS, param, + device_name, share_target.wifi_credentials_attachments[0].ssid(), + /*use_capitalized_resource=*/false); + } else { + expected_title = FormatNotificationTitle( + is_incoming ? IDS_NEARBY_NOTIFICATION_RECEIVE_FAILURE_TITLE + : IDS_NEARBY_NOTIFICATION_SEND_FAILURE_TITLE, + param, device_name, /*network_name=*/kWifiSsid, + /*use_capitalized_resource=*/false); + } + std::u16string expected_message = error && error->second ? l10n_util::GetStringUTF16(error->second) : std::u16string(); @@ -645,9 +772,10 @@ INSTANTIATE_TEST_SUITE_P( NearbyNotificationManagerAttachmentsTest, NearbyNotificationManagerAttachmentsTest, - testing::Combine(testing::ValuesIn(kAttachmentsTestParams), - testing::Bool(), - testing::Combine(testing::Bool(), testing::Bool()))); + testing::Combine( + testing::ValuesIn(kAttachmentsTestParams), + testing::Bool(), + testing::Combine(testing::Bool(), testing::Bool(), testing::Bool()))); TEST_P(NearbyNotificationManagerConnectionRequestTest, ShowConnectionRequest_ShowsNotification) { @@ -724,6 +852,7 @@ NearbyNotificationManagerConnectionRequestTest, testing::Combine(testing::Bool(), testing::Combine(testing::Bool(), + testing::Bool(), testing::Bool()))); TEST_P(NearbyNotificationManagerTest, @@ -1244,7 +1373,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/0, /*url_attachments=*/0, /*image_attachments=*/1, - /*other_file_attachments=*/0); + /*other_file_attachments=*/0, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); // Image decoding happens asynchronously so wait for the notification to show. @@ -1291,7 +1420,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/0, /*url_attachments=*/0, /*image_attachments=*/1, - /*other_file_attachments=*/0); + /*other_file_attachments=*/0, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); // Image decoding happens asynchronously so wait for the notification to show. @@ -1342,7 +1471,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/0, /*url_attachments=*/0, /*image_attachments=*/2, - /*other_file_attachments=*/0); + /*other_file_attachments=*/0, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); std::vector<message_center::Notification> notifications = @@ -1379,7 +1508,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/1, /*url_attachments=*/0, /*image_attachments=*/0, - /*other_file_attachments=*/0); + /*other_file_attachments=*/0, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); std::vector<message_center::Notification> notifications = @@ -1415,7 +1544,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/0, /*url_attachments=*/1, /*image_attachments=*/0, - /*other_file_attachments=*/0); + /*other_file_attachments=*/0, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); std::vector<message_center::Notification> notifications = @@ -1451,7 +1580,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/0, /*url_attachments=*/0, /*image_attachments=*/0, - /*other_file_attachments=*/1); + /*other_file_attachments=*/1, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); std::vector<message_center::Notification> notifications = @@ -1487,7 +1616,7 @@ ShareTarget share_target = CreateIncomingShareTarget( /*text_attachments=*/0, /*url_attachments=*/0, /*image_attachments=*/1, - /*other_file_attachments=*/2); + /*other_file_attachments=*/2, /*wifi_credentials_attachments=*/false); manager()->ShowSuccess(share_target); std::vector<message_center::Notification> notifications = @@ -1510,6 +1639,45 @@ EXPECT_EQ(0u, GetDisplayedNotifications().size()); } +TEST_P(NearbyNotificationManagerTest, + SuccessNotificationClicked_WifiCredentialsReceived) { + if (!is_receive_wifi_credentials_enabled_) + return; + + base::RunLoop run_loop; + manager()->SetOnSuccessClickedForTesting(base::BindLambdaForTesting( + [&](NearbyNotificationManager::SuccessNotificationAction action) { + EXPECT_EQ(NearbyNotificationManager::SuccessNotificationAction:: + kOpenWifiNetworksList, + action); + run_loop.Quit(); + })); + + ShareTarget share_target = CreateIncomingShareTarget( + /*text_attachments=*/0, /*url_attachments=*/0, /*image_attachments=*/0, + /*other_file_attachments=*/0, /*wifi_credentials_attachments=*/true); + manager()->ShowSuccess(share_target); + + std::vector<message_center::Notification> notifications = + GetDisplayedNotifications(); + ASSERT_EQ(1u, notifications.size()); + const message_center::Notification& notification = notifications[0]; + ASSERT_EQ(1u, notification.buttons().size()); + EXPECT_EQ(l10n_util::GetStringUTF16( + IDS_NEARBY_NOTIFICATION_ACTION_OPEN_NETWORK_LIST), + notification.buttons()[0].title); + + notification_tester_->SimulateClick(NotificationHandler::Type::NEARBY_SHARE, + notification.id(), + /*action_index=*/0, + /*reply=*/absl::nullopt); + + run_loop.Run(); + + // Notification should be closed. + EXPECT_EQ(0u, GetDisplayedNotifications().size()); +} + class NearbyFilesHoldingSpaceTest : public testing::Test { public: NearbyFilesHoldingSpaceTest() @@ -1606,6 +1774,22 @@ EXPECT_TRUE(holding_space_model->items().empty()); } +TEST_F(NearbyFilesHoldingSpaceTest, ShowSuccess_WifiCredentials) { + ShareTarget share_target; + share_target.is_incoming = true; + + WifiCredentialsAttachment attachment(kWifiCredentialsId, kSecurityType, + kWifiSsid); + share_target.wifi_credentials_attachments.push_back(std::move(attachment)); + + manager()->ShowSuccess(share_target); + + ash::HoldingSpaceModel* holding_space_model = GetHoldingSpaceModel(); + ASSERT_TRUE(holding_space_model); + + EXPECT_TRUE(holding_space_model->items().empty()); +} + TEST_P(NearbyNotificationManagerTest, ShowMultipleNotifications) { if (!is_self_share_enabled_) return; @@ -1761,6 +1945,28 @@ } } +TEST_P(NearbyNotificationManagerTest, ConnectionRequest_SelfShare) { + ShareTarget share_target; + share_target.is_incoming = true; + share_target.for_self_share = true; + TransferMetadata transfer_metadata = + TransferMetadataBuilder() + .set_status(TransferMetadata::Status::kAwaitingLocalConfirmation) + .build(); + + // Simulate incoming connection request waiting for local confirmation. + manager()->OnTransferUpdate(share_target, transfer_metadata); + std::vector<message_center::Notification> notifications = + GetDisplayedNotifications(); + if (is_self_share_enabled_) { + ASSERT_EQ(0u, notifications.size()); + } else { + ASSERT_EQ(1u, notifications.size()); + } +} + INSTANTIATE_TEST_SUITE_P(NearbyNotificationManagerTest, NearbyNotificationManagerTest, - testing::Combine(testing::Bool(), testing::Bool())); + testing::Combine(testing::Bool(), + testing::Bool(), + testing::Bool()));
diff --git a/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc b/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc index 90bcb10..18a59e0c 100644 --- a/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc +++ b/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc
@@ -1934,12 +1934,13 @@ } // Do not advertise on lock screen unless Self Share is enabled. - if (is_screen_locked_ && - !base::FeatureList::IsEnabled(features::kNearbySharingSelfShare)) { - StopAdvertising(); - NS_LOG(VERBOSE) << __func__ - << ": Stopping advertising because the screen is locked."; - return; + if (!base::FeatureList::IsEnabled(features::kNearbySharingSelfShare)) { + if (is_screen_locked_) { + StopAdvertising(); + NS_LOG(VERBOSE) << __func__ + << ": Stopping advertising because the screen is locked."; + return; + } } if (!HasAvailableConnectionMediums()) { @@ -3664,6 +3665,14 @@ return; } + if (base::FeatureList::IsEnabled(features::kNearbySharingSelfShare)) { + // Auto-accept self shares when not in high-visibility mode. + if (share_target.for_self_share && !IsInHighVisibility()) { + NS_LOG(INFO) << __func__ << ": Auto-accepting self share."; + Accept(share_target, base::DoNothing()); + } + } + frames_reader->ReadFrame( base::BindOnce(&NearbySharingServiceImpl::OnFrameRead, weak_ptr_factory_.GetWeakPtr(), std::move(share_target)));
diff --git a/chrome/browser/nearby_sharing/nearby_sharing_service_impl_unittest.cc b/chrome/browser/nearby_sharing/nearby_sharing_service_impl_unittest.cc index c60487d..519d170 100644 --- a/chrome/browser/nearby_sharing/nearby_sharing_service_impl_unittest.cc +++ b/chrome/browser/nearby_sharing/nearby_sharing_service_impl_unittest.cc
@@ -747,7 +747,8 @@ } void ProcessLatestPublicCertificateDecryption(size_t expected_num_calls, - bool success) { + bool success, + bool for_self_share = false) { // Ensure that all pending mojo messages are processed and the certificate // manager state is as expected up to this point. base::RunLoop().RunUntilIdle(); @@ -763,11 +764,13 @@ calls.back().encrypted_metadata_key.encrypted_key()); if (success) { + nearbyshare::proto::PublicCertificate cert = + GetNearbyShareTestPublicCertificate( + nearby_share::mojom::Visibility::kAllContacts); + cert.set_for_self_share(for_self_share); std::move(calls.back().callback) .Run(NearbyShareDecryptedPublicCertificate::DecryptPublicCertificate( - GetNearbyShareTestPublicCertificate( - nearby_share::mojom::Visibility::kAllContacts), - GetNearbyShareTestEncryptedMetadataKey())); + cert, GetNearbyShareTestEncryptedMetadataKey())); } else { std::move(calls.back().callback).Run(absl::nullopt); } @@ -895,7 +898,8 @@ } ShareTarget SetUpIncomingConnection( - NiceMock<MockTransferUpdateCallback>& callback) { + NiceMock<MockTransferUpdateCallback>& callback, + bool for_self_share = false) { fake_nearby_connections_manager_->SetRawAuthenticationToken(kEndpointId, kToken); SetUpAdvertisementDecoder(kValidV1EndpointInfo, @@ -923,7 +927,7 @@ service_->OnIncomingConnection(kEndpointId, kValidV1EndpointInfo, &connection_); ProcessLatestPublicCertificateDecryption(/*expected_num_calls=*/1, - /*success=*/true); + /*success=*/true, for_self_share); run_loop.Run(); EXPECT_TRUE( @@ -1255,50 +1259,44 @@ base::FilePath file_path; base::RunLoop run_loop_success; EXPECT_CALL(callback, OnTransferUpdate(testing::_, testing::_)) - .WillOnce(testing::Invoke( - [&](const ShareTarget& share_target, TransferMetadata metadata) { - EXPECT_TRUE(metadata.is_final_status()); - EXPECT_EQ(TransferMetadata::Status::kComplete, metadata.status()); + .WillOnce(testing::Invoke([&](const ShareTarget& share_target, + TransferMetadata metadata) { + EXPECT_TRUE(metadata.is_final_status()); + EXPECT_EQ(TransferMetadata::Status::kComplete, metadata.status()); - ASSERT_TRUE(share_target.has_attachments()); - EXPECT_EQ(1u, share_target.file_attachments.size()); - for (const FileAttachment& file : share_target.file_attachments) { - EXPECT_TRUE(file.file_path()); - file_path = *file.file_path(); - } + ASSERT_TRUE(share_target.has_attachments()); + EXPECT_EQ(1u, share_target.file_attachments.size()); + for (const FileAttachment& file : share_target.file_attachments) { + EXPECT_TRUE(file.file_path()); + file_path = *file.file_path(); + } - EXPECT_EQ(3u, share_target.text_attachments.size()); - for (const TextAttachment& text : share_target.text_attachments) { - EXPECT_EQ(kTextPayload, text.text_body()); - } + EXPECT_EQ(3u, share_target.text_attachments.size()); + for (const TextAttachment& text : share_target.text_attachments) { + EXPECT_EQ(kTextPayload, text.text_body()); + } - if (base::FeatureList::IsEnabled( - features::kNearbySharingReceiveWifiCredentials)) { - EXPECT_EQ(1u, share_target.wifi_credentials_attachments.size()); - for (const WifiCredentialsAttachment& wifi_credentials : - share_target.wifi_credentials_attachments) { - EXPECT_EQ(kSsid, wifi_credentials.ssid()); - EXPECT_EQ(kWifiPassword, wifi_credentials.wifi_password()); - EXPECT_EQ(kWifiSecurityType, - wifi_credentials.security_type()); - } - EXPECT_EQ(1u, - wifi_network_handler_->num_configure_network_calls()); - EXPECT_EQ(kSsid, - wifi_network_handler_->last_attachment().ssid()); - EXPECT_EQ( - kWifiPassword, - wifi_network_handler_->last_attachment().wifi_password()); - EXPECT_EQ( - kWifiSecurityType, - wifi_network_handler_->last_attachment().security_type()); - } else { - EXPECT_EQ(0u, share_target.wifi_credentials_attachments.size()); - EXPECT_EQ(0u, - wifi_network_handler_->num_configure_network_calls()); - } - run_loop_success.Quit(); - })); + if (base::FeatureList::IsEnabled( + features::kNearbySharingReceiveWifiCredentials)) { + EXPECT_EQ(1u, share_target.wifi_credentials_attachments.size()); + for (const WifiCredentialsAttachment& wifi_credentials : + share_target.wifi_credentials_attachments) { + EXPECT_EQ(kSsid, wifi_credentials.ssid()); + EXPECT_EQ(kWifiPassword, wifi_credentials.wifi_password()); + EXPECT_EQ(kWifiSecurityType, wifi_credentials.security_type()); + } + EXPECT_EQ(1u, wifi_network_handler_->num_configure_network_calls()); + EXPECT_EQ(kSsid, wifi_network_handler_->last_attachment().ssid()); + EXPECT_EQ(kWifiPassword, + wifi_network_handler_->last_attachment().wifi_password()); + EXPECT_EQ(kWifiSecurityType, + wifi_network_handler_->last_attachment().security_type()); + } else { + EXPECT_EQ(0u, share_target.wifi_credentials_attachments.size()); + EXPECT_EQ(0u, wifi_network_handler_->num_configure_network_calls()); + } + run_loop_success.Quit(); + })); base::WeakPtr<NearbyConnectionsManager::PayloadStatusListener> listener = fake_nearby_connections_manager_->GetRegisteredPayloadStatusListener( @@ -5343,6 +5341,69 @@ EXPECT_FALSE(share_target->for_self_share); } +TEST_P(NearbySharingServiceImplTest, SelfShareAutoAccept) { + for (int64_t payload_id : kValidIntroductionFramePayloadIds) { + fake_nearby_connections_manager_->SetPayloadPathStatus( + payload_id, location::nearby::connections::mojom::Status::kSuccess); + } + + // We create an incoming connection corresponding to a certificate where the + // |for_self_share| field is set to 'true'. This value will be propagated to + // the ShareTarget, which will be used as a signal for the service to + // automatically accept the transfer when Self Share is enabled. This is + // similar to other tests (see "AcceptValidShareTarget") but without the + // explicit call to service_->Accept(). + NiceMock<MockTransferUpdateCallback> callback; + ShareTarget share_target = + SetUpIncomingConnection(callback, /*for_self_share=*/true); + + // If Self Share is not enabled, we should just time out. + if (!base::FeatureList::IsEnabled(features::kNearbySharingSelfShare)) { + base::RunLoop run_loop; + EXPECT_CALL(callback, OnTransferUpdate(testing::_, testing::_)) + .WillOnce(testing::Invoke( + [&](const ShareTarget& share_target, TransferMetadata metadata) { + EXPECT_TRUE(metadata.is_final_status()); + EXPECT_EQ(TransferMetadata::Status::kTimedOut, metadata.status()); + run_loop.Quit(); + })); + run_loop.Run(); + return; + } + + base::RunLoop run_loop; + EXPECT_CALL(callback, OnTransferUpdate(testing::_, testing::_)) + .WillOnce(testing::Invoke( + [&](const ShareTarget& share_target, TransferMetadata metadata) { + EXPECT_FALSE(metadata.is_final_status()); + EXPECT_EQ(TransferMetadata::Status::kAwaitingRemoteAcceptance, + metadata.status()); + run_loop.Quit(); + })); + run_loop.Run(); + + // Check data written to connection_. + ExpectPairedKeyEncryptionFrame(); + ExpectPairedKeyResultFrame(); + ExpectConnectionResponseFrame( + sharing::nearby::ConnectionResponseFrame::ACCEPT); + + EXPECT_FALSE(connection_.IsClosed()); + + // TODO(https://crbug.com/1122552) - Remove cleanups after bugfix + { + base::ScopedAllowBlockingForTesting allow_blocking; + absl::optional<base::FilePath> path = + fake_nearby_connections_manager_->GetRegisteredPayloadPath( + kFilePayloadId); + EXPECT_TRUE(path); + base::DeleteFile(*path); + } + + // To avoid UAF in OnIncomingTransferUpdate(). + service_->UnregisterReceiveSurface(&callback); +} + INSTANTIATE_TEST_SUITE_P(NearbySharingServiceImplTest, NearbySharingServiceImplTest, testing::Range<size_t>(0, 1 << kTestFeatures.size()));
diff --git a/chrome/browser/net/nss_service_chromeos.cc b/chrome/browser/net/nss_service_chromeos.cc index 3d323fab..92a8b444 100644 --- a/chrome/browser/net/nss_service_chromeos.cc +++ b/chrome/browser/net/nss_service_chromeos.cc
@@ -8,6 +8,7 @@ #include <utility> #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/tpm_token_info_getter.h" #include "base/bind.h" #include "base/callback.h" #include "base/callback_helpers.h" @@ -25,7 +26,6 @@ #include "chrome/browser/profiles/profile.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/userdataauth/cryptohome_pkcs11_client.h" -#include "chromeos/tpm/tpm_token_info_getter.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/browser_context.h"
diff --git a/chrome/browser/notifications/notification_display_service_impl.cc b/chrome/browser/notifications/notification_display_service_impl.cc index 3c92d9ce..7fc0e11 100644 --- a/chrome/browser/notifications/notification_display_service_impl.cc +++ b/chrome/browser/notifications/notification_display_service_impl.cc
@@ -66,7 +66,6 @@ void NotificationDisplayServiceImpl::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { #if BUILDFLAG(IS_LINUX) - registry->RegisterBooleanPref(prefs::kAllowNativeNotifications, true); registry->RegisterBooleanPref(prefs::kAllowSystemNotifications, true); #endif }
diff --git a/chrome/browser/notifications/notification_platform_bridge_delegator.cc b/chrome/browser/notifications/notification_platform_bridge_delegator.cc index 5803826..de7b7392 100644 --- a/chrome/browser/notifications/notification_platform_bridge_delegator.cc +++ b/chrome/browser/notifications/notification_platform_bridge_delegator.cc
@@ -61,8 +61,7 @@ if (profile) { // Prefs take precedence over flags. PrefService* prefs = profile->GetPrefs(); - if (!prefs->GetBoolean(prefs::kAllowNativeNotifications) || - !prefs->GetBoolean(prefs::kAllowSystemNotifications)) { + if (!prefs->GetBoolean(prefs::kAllowSystemNotifications)) { return false; } }
diff --git a/chrome/browser/policy/BUILD.gn b/chrome/browser/policy/BUILD.gn index 57d785b5..a98af128b 100644 --- a/chrome/browser/policy/BUILD.gn +++ b/chrome/browser/policy/BUILD.gn
@@ -87,11 +87,11 @@ if (is_chromeos_ash) { deps += [ "//ash/components/settings:settings", + "//ash/components/tpm", "//ash/constants:constants", "//base", "//chromeos/network:network", "//chromeos/system:system", - "//chromeos/tpm:tpm", "//components/policy/core/common:common_constants", "//components/user_manager:user_manager", "//dbus",
diff --git a/chrome/browser/policy/enrollment_status.h b/chrome/browser/policy/enrollment_status.h index 8da322b..6e0b84c4 100644 --- a/chrome/browser/policy/enrollment_status.h +++ b/chrome/browser/policy/enrollment_status.h
@@ -6,13 +6,14 @@ #define CHROME_BROWSER_POLICY_ENROLLMENT_STATUS_H_ #include "build/chromeos_buildflags.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/tpm/install_attributes.h" -#endif #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/cloud_policy_store.h" #include "components/policy/core/common/cloud/cloud_policy_validator.h" +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/install_attributes.h" +#endif + namespace policy { // Describes the result of an enrollment operation, including the relevant error
diff --git a/chrome/browser/policy/messaging_layer/public/report_client_unittest.cc b/chrome/browser/policy/messaging_layer/public/report_client_unittest.cc index d685071..5ea6f4c 100644 --- a/chrome/browser/policy/messaging_layer/public/report_client_unittest.cc +++ b/chrome/browser/policy/messaging_layer/public/report_client_unittest.cc
@@ -394,7 +394,8 @@ } // Uploader is available, let it set the key. - EXPECT_CALL(*client_, UploadEncryptedReport(_, _, _)) + EXPECT_CALL(*client_, UploadEncryptedReport( + IsEncryptionKeyRequestUploadRequestValid(), _, _)) .WillOnce(WithArgs<0, 2>(Invoke(GetEncryptionKeyInvocation()))) .RetiresOnSaturation(); } @@ -443,7 +444,9 @@ // Note: there does not seem to be another way to define the expectations // A+B for encrypted case and just B for non-encrypted. if (is_encryption_enabled()) { - EXPECT_CALL(*client_, UploadEncryptedReport(_, _, _)) + EXPECT_CALL(*client_, + UploadEncryptedReport( + IsEncryptionKeyRequestUploadRequestValid(), _, _)) .WillOnce(WithArgs<0, 2>(Invoke(GetEncryptionKeyInvocation()))); EXPECT_CALL(*client_, UploadEncryptedReport(IsDataUploadRequestValid(), _, _))
diff --git a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h index 32119f9..010ae623 100644 --- a/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h +++ b/chrome/browser/policy/messaging_layer/upload/record_upload_request_builder.h
@@ -12,15 +12,17 @@ namespace reporting { +// {{{Note}}} ERP Encrypted Record +// // Builds an upload request payload specific for -// EncryptedReportingJobConfiguration A JSON version of the payload looks like +// EncryptedReportingJobConfiguration. A JSON version of the payload looks like // this: // { // "encryptedRecord": [ // { // "encryptedWrappedRecord": "EncryptedMessage", // "encryptionInfo" : { -// "encryptionKey": "EncryptedMessage", +// "encryptionKey": "LocalPublicValue", // "publicKeyId": 1 // }, // "sequenceInformation": { @@ -32,7 +34,7 @@ // { // "encryptedWrappedRecord": "EncryptedMessage", // "encryptionInfo" : { -// "encryptionKey": "EncryptedMessage", +// "encryptionKey": "LocalPublicValue", // "publicKeyId": 2 // }, // "sequenceInformation": { @@ -47,16 +49,21 @@ // TODO(b/159361496): Periodically add memory and disk space usage. // // This payload is added to the common payload of all reporting jobs, which -// includes "device" and "browser" sub-fields: +// includes other sub-fields such as "device" and "browser" (See note "ERP +// Payload Overview"): // -// EncryptedReportingRequestBuilder builder; -// builder.AddRecord(record1); -// builder.AddRecord(record2); -// ... -// builder.AddRecord(recordN); -// auto payload_result = builder.Build(); -// DCHECK(payload_result.has_value()); -// job_payload_.Merge(payload_result.value()); +// EncryptedReportingRequestBuilder builder; +// builder.AddRecord(record1); +// builder.AddRecord(record2); +// ... +// builder.AddRecord(recordN); +// auto payload_result = builder.Build(); +// DCHECK(payload_result.has_value()); +// job_payload_.Merge(payload_result.value()); +// +// The value of an "encryptedRecord" must be a list, in which each element is a +// dictionary that represents a record. The details of each record is documented +// in record.proto. class UploadEncryptedReportingRequestBuilder { public:
diff --git a/chrome/browser/policy/messaging_layer/util/test.cc b/chrome/browser/policy/messaging_layer/util/test.cc index babb5a5e..7113978 100644 --- a/chrome/browser/policy/messaging_layer/util/test.cc +++ b/chrome/browser/policy/messaging_layer/util/test.cc
@@ -36,6 +36,36 @@ return record_list; } +bool AttachEncryptionSettingsMatcher::MatchAndExplain( + const base::Value::Dict& arg, + MatchResultListener* listener) const { + const auto attach_encryption_settings = + arg.FindBool("attachEncryptionSettings"); + if (!attach_encryption_settings) { + *listener << "No key named \"attachEncryptionSettings\" in the argument or " + "the value is not of bool type."; + return false; + } + if (!attach_encryption_settings.value()) { + *listener << "The value of \"attachEncryptionSettings\" is false."; + return false; + } + return true; +} + +void AttachEncryptionSettingsMatcher::DescribeTo(std::ostream* os) const { + *os << "has a valid attachEncryptionSettings field."; +} + +void AttachEncryptionSettingsMatcher::DescribeNegationTo( + std::ostream* os) const { + *os << "has an invalid attachEncryptionSettings field."; +} + +std::string AttachEncryptionSettingsMatcher::Name() const { + return "attach-encryption-settings-matcher"; +} + bool EncryptedRecordMatcher::MatchAndExplain( const base::Value::Dict& arg, MatchResultListener* listener) const {
diff --git a/chrome/browser/policy/messaging_layer/util/test.h b/chrome/browser/policy/messaging_layer/util/test.h index f47ad552..6dc1f3b7 100644 --- a/chrome/browser/policy/messaging_layer/util/test.h +++ b/chrome/browser/policy/messaging_layer/util/test.h
@@ -38,6 +38,16 @@ virtual std::string Name() const = 0; }; +// attachEncryptionSettings must be of bool type and true. +class AttachEncryptionSettingsMatcher : public RequestValidityMatcherInterface { + public: + bool MatchAndExplain(const base::Value::Dict& arg, + MatchResultListener* listener) const override; + void DescribeTo(std::ostream* os) const override; + void DescribeNegationTo(std::ostream* os) const override; + std::string Name() const override; +}; + // encryptedRecord must be a list. This matcher is recommended to be applies // before verifying the details of any record (e.g., via |RecordMatcher|) to // generate more readable error messages. @@ -143,6 +153,16 @@ } // Creates and returns a |RequestValidityMatcherBuilder| instance that + // contains a matcher that is suited for verifying an encryption key-request + // upload request. + static RequestValidityMatcherBuilder<T> CreateEncryptionKeyRequestUpload() { + // A gap upload is a data upload with no encryptedWrappedRecord. + return std::move(RequestValidityMatcherBuilder<T>::CreateEmpty() + .AppendMatcher(AttachEncryptionSettingsMatcher()) + .AppendMatcher(RequestIdMatcher())); + } + + // Creates and returns a |RequestValidityMatcherBuilder| instance that // contains a matcher that is suited for verifying a gap upload request. static RequestValidityMatcherBuilder<T> CreateGapUpload() { // A gap upload is a data upload with no encryptedWrappedRecord. @@ -234,6 +254,13 @@ return RequestValidityMatcherBuilder<T>::CreateDataUpload().Build(); } +// Match an encryption key-request upload request that is valid. +template <class T = base::Value::Dict> +Matcher<T> IsEncryptionKeyRequestUploadRequestValid() { + return RequestValidityMatcherBuilder<T>::CreateEncryptionKeyRequestUpload() + .Build(); +} + // Match a gap upload request that is valid. template <class T = base::Value::Dict> Matcher<T> IsGapUploadRequestValid() {
diff --git a/chrome/browser/policy/networking/device_network_configuration_updater_ash.cc b/chrome/browser/policy/networking/device_network_configuration_updater_ash.cc index 9546961..f5a90d5 100644 --- a/chrome/browser/policy/networking/device_network_configuration_updater_ash.cc +++ b/chrome/browser/policy/networking/device_network_configuration_updater_ash.cc
@@ -8,6 +8,7 @@ #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" @@ -24,7 +25,6 @@ #include "chromeos/network/managed_network_configuration_handler.h" #include "chromeos/network/network_device_handler.h" #include "chromeos/system/statistics_provider.h" -#include "chromeos/tpm/install_attributes.h" #include "components/policy/policy_constants.h" #include "content/public/browser/browser_thread.h" #include "net/cert/x509_certificate.h"
diff --git a/chrome/browser/policy/profile_policy_connector_unittest.cc b/chrome/browser/policy/profile_policy_connector_unittest.cc index cd94f6b5..d6f9aec 100644 --- a/chrome/browser/policy/profile_policy_connector_unittest.cc +++ b/chrome/browser/policy/profile_policy_connector_unittest.cc
@@ -36,8 +36,8 @@ #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/stub_install_attributes.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/user_manager/scoped_user_manager.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc index 4c49d847..7eac464 100644 --- a/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc +++ b/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_browsertest.cc
@@ -85,6 +85,7 @@ #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_base.h" #include "content/public/test/browser_test_utils.h" +#include "content/public/test/fenced_frame_test_util.h" #include "content/public/test/prerender_test_util.h" #include "content/public/test/test_utils.h" #include "google_apis/google_api_keys.h" @@ -4395,6 +4396,84 @@ EXPECT_NE(tab_helper->after_srp_metrics()->url_, prerender_render_frame_url); } +class PrefetchProxyFencedFrameBrowserTest : public PrefetchProxyBrowserTest { + public: + PrefetchProxyFencedFrameBrowserTest() = default; + ~PrefetchProxyFencedFrameBrowserTest() override = default; + + void SetUpOnMainThread() override { + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(embedded_test_server()->Start()); + PrefetchProxyBrowserTest::SetUpOnMainThread(); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + PrefetchProxyBrowserTest::SetUpCommandLine(command_line); + // |fenced_frame_helper_| has a ScopedFeatureList so we needed to delay + // its creation until now because PrefetchProxyBrowserTest also uses a + // ScopedFeatureList and initialization order matters. + fenced_frame_helper_ = + std::make_unique<content::test::FencedFrameTestHelper>(); + } + + content::WebContents* GetWebContents() { + return browser()->tab_strip_model()->GetActiveWebContents(); + } + + content::test::FencedFrameTestHelper& fenced_frame_test_helper() { + return *fenced_frame_helper_; + } + + private: + std::unique_ptr<content::test::FencedFrameTestHelper> fenced_frame_helper_; +}; + +IN_PROC_BROWSER_TEST_F(PrefetchProxyFencedFrameBrowserTest, + EnsureFencedFrameDoesNotAffectPrefetchProxyTabHelper) { + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), GURL("about:blank"))); + WaitForUpdatedCustomProxyConfig(); + + ASSERT_TRUE(content::SetCookie(browser()->profile(), GURL("https://foo.com"), + "type=PeanutButter")); + + GURL initial_url = embedded_test_server()->GetURL("/empty.html"); + ASSERT_NE(ui_test_utils::NavigateToURL(browser(), initial_url), nullptr); + + PrefetchProxyTabHelper* tab_helper = + PrefetchProxyTabHelper::FromWebContents(GetWebContents()); + + // Create a fenced frame to check if it affects on the prefetch proxy. + GURL fenced_frame_url( + embedded_test_server()->GetURL("/fenced_frames/title1.html")); + content::RenderFrameHost* fenced_frame_host = + fenced_frame_test_helper().CreateFencedFrame( + GetWebContents()->GetMainFrame(), fenced_frame_url); + ASSERT_TRUE(fenced_frame_host); + ASSERT_EQ(fenced_frame_url, fenced_frame_host->GetLastCommittedURL()); + + ASSERT_FALSE(tab_helper->after_srp_metrics()); + EXPECT_EQ(0U, tab_helper->srp_metrics().predicted_urls_count_); + + GURL prefetch_url("https://m.foo.com"); + GURL doc_url("https://www.google.com/search?q=test"); + MakeNavigationPrediction(doc_url, {prefetch_url}); + base::RunLoop().RunUntilIdle(); + + EXPECT_EQ(1U, tab_helper->srp_metrics().predicted_urls_count_); + EXPECT_EQ(0U, tab_helper->srp_metrics().prefetch_eligible_count_); + + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), prefetch_url)); + + ASSERT_TRUE(tab_helper->after_srp_metrics()); + EXPECT_EQ( + absl::make_optional( + PrefetchProxyPrefetchStatus::kPrefetchNotEligibleUserHasCookies), + tab_helper->after_srp_metrics()->prefetch_status_); + + // Check if the prefetched URL is different from the fenced frame. + EXPECT_NE(tab_helper->after_srp_metrics()->url_, fenced_frame_url); +} + class ZeroCacheTimePrefetchProxyBrowserTest : public PrefetchProxyBrowserTest { public: void SetUpCommandLine(base::CommandLine* cmd) override {
diff --git a/chrome/browser/prefs/proxy_policy_unittest.cc b/chrome/browser/prefs/proxy_policy_unittest.cc index 7a59eea..ae6bbdb 100644 --- a/chrome/browser/prefs/proxy_policy_unittest.cc +++ b/chrome/browser/prefs/proxy_policy_unittest.cc
@@ -31,7 +31,7 @@ #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/tpm/stub_install_attributes.h" +#include "ash/components/tpm/stub_install_attributes.h" #endif using ::testing::Return;
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc index 613a8d7..9ac8f2f 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
@@ -500,7 +500,7 @@ bool fast_shutdown_success = GetRenderProcessHost()->FastShutdownIfPossible(1u, false); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) if (!fast_shutdown_success && discard_reason == LifecycleUnitDiscardReason::URGENT) { content::RenderFrameHost* main_frame = old_contents->GetMainFrame();
diff --git a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc b/chrome/browser/resource_coordinator/tab_manager_browsertest.cc index 0976ec0..e6bd06d7 100644 --- a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
@@ -626,16 +626,16 @@ // one of them is current, and the other has an unload handler. An unsafe // attempt will be made on some platforms. base::HistogramTester tester; -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) // The unsafe attempt for ChromeOS should succeed as ChromeOS ignores unload // handlers when in critical condition. content::WindowedNotificationObserver observer( content::NOTIFICATION_RENDERER_PROCESS_CLOSED, content::NotificationService::AllSources()); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) EXPECT_TRUE( tab_manager()->DiscardTabImpl(LifecycleUnitDiscardReason::URGENT)); -#if BUILDFLAG(IS_CHROMEOS_ASH) +#if BUILDFLAG(IS_CHROMEOS) tester.ExpectUniqueSample( "TabManager.Discarding.DiscardedTabCouldUnsafeFastShutdown", true, 1); tester.ExpectUniqueSample( @@ -644,7 +644,7 @@ #else tester.ExpectUniqueSample( "TabManager.Discarding.DiscardedTabCouldFastShutdown", false, 1); -#endif // BUILDFLAG(IS_CHROMEOS_ASH) +#endif // BUILDFLAG(IS_CHROMEOS) } IN_PROC_BROWSER_TEST_F(TabManagerTest,
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/switch_access/BUILD.gn index c40fb46..3a2601b8 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/BUILD.gn
@@ -27,7 +27,6 @@ dest_dir = switch_access_dir sources = [ "action_manager.js", - "action_recorder.js", "auto_scan_manager.js", "background.html", "background.js", @@ -66,7 +65,6 @@ "metrics.js", "navigator.js", "navigator_interface.js", - "node_identifier.js", "nodes/back_button_node.js", "nodes/basic_node.js", "nodes/combo_box_node.js", @@ -144,7 +142,6 @@ js_type_check("closure_compile") { deps = [ ":action_manager", - ":action_recorder", ":auto_scan_manager", ":back_button_node", ":background", @@ -164,7 +161,6 @@ ":modal_dialog_node", ":navigator", ":navigator_interface", - ":node_identifier", ":point_scan_manager", ":preference_manager", ":slider_node", @@ -500,19 +496,3 @@ ] externs_list = [ "$externs_path/automation.js" ] } - -# Accessibility sprint: Classes that assist in multistep automation. -js_library("action_recorder") { - sources = [ "action_recorder.js" ] - deps = [ - ":focus_ring_manager", - ":node_identifier", - ":switch_access", - ] - externs_list = [ "$externs_path/automation.js" ] -} - -js_library("node_identifier") { - sources = [ "node_identifier.js" ] - externs_list = [ "$externs_path/automation.js" ] -}
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js b/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js index 9cfb071..2f8e841 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/action_manager.js
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {ActionRecorder} from './action_recorder.js'; import {FocusRingManager} from './focus_ring_manager.js'; import {MenuManager} from './menu_manager.js'; import {SwitchAccessMetrics} from './metrics.js'; @@ -72,10 +71,6 @@ */ static onSelect() { const node = Navigator.byItem.currentNode; - if (SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - ActionRecorder.instance.recordNode(node.automationNode); - } - if (MenuManager.isMenuOpen() || node.actions.length <= 1 || !node.location) { node.doDefaultAction(); @@ -101,13 +96,6 @@ static performAction(action) { SwitchAccessMetrics.recordMenuAction(action); - // If feature flag is enabled, perform action and escape if successful. - if (SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - if (ActionManager.performActionMultistep(action)) { - return; - } - } - switch (action) { // Global actions: case SwitchAccessMenuAction.SETTINGS: @@ -138,180 +126,6 @@ } } - /** - * Helper method to perform an action when the multistep automation - * feature flag is enabled. - * @param {!SwitchAccessMenuAction} action - * @return {boolean} - */ - static performActionMultistep(action) { - // Check feature flag is enabled or escape. - if (!SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - return false; - } - - switch (action) { - case SwitchAccessMenuAction.SHORTCUTS: - ActionManager.openMenu(SAConstants.MenuType.SHORTCUTS_MENU); - break; - case SwitchAccessMenuAction.LEAVE_GROUP: - ActionManager.exitAllMenus(); - Navigator.byItem.exitGroupUnconditionally(); - break; - case SwitchAccessMenuAction.WEB_MENU: - ActionManager.openMenu(SAConstants.MenuType.WEB_MENU); - break; - case SwitchAccessMenuAction.SYSTEM_MENU: - ActionManager.openMenu(SAConstants.MenuType.SYSTEM_MENU); - break; - case SwitchAccessMenuAction.MEDIA_MENU: - ActionManager.openMenu(SAConstants.MenuType.MEDIA_MENU); - break; - case SwitchAccessMenuAction.DISPLAY_MENU: - ActionManager.openMenu(SAConstants.MenuType.DISPLAY_MENU); - break; - case SwitchAccessMenuAction.USER_MENU: - ActionManager.openMenu(SAConstants.MenuType.USER_MENU); - break; - case SwitchAccessMenuAction.WEB_BOOKMARK: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.D, {ctrl: true}); - break; - case SwitchAccessMenuAction.WEB_BOTTOM_OF_PAGE: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.RIGHT, {search: true}); - break; - case SwitchAccessMenuAction.WEB_TOP_OF_PAGE: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.LEFT, {search: true}); - break; - case SwitchAccessMenuAction.WEB_FIND_IN_PAGE: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.F, {ctrl: true}); - break; - case SwitchAccessMenuAction.WEB_DOWNLOADS: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.J, {ctrl: true}); - break; - case SwitchAccessMenuAction.WEB_CLEAR_HISTORY: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.BACK, {ctrl: true, shift: true}); - break; - case SwitchAccessMenuAction.SYSTEM_STATUS_BAR: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.S, {alt: true, shift: true}); - break; - case SwitchAccessMenuAction.SYSTEM_LAUNCHER: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.SEARCH); - break; - case SwitchAccessMenuAction.SYSTEM_TASK_MANAGER: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.ESCAPE, {search: true}); - break; - case SwitchAccessMenuAction.SYSTEM_DIAGNOSTICS: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.ESCAPE, {ctrl: true, search: true}); - break; - case SwitchAccessMenuAction.SYSTEM_SCREENSHOT: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.MEDIA_LAUNCH_APP1, {ctrl: true}); - break; - case SwitchAccessMenuAction.SYSTEM_HELP: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.OEM_2, {ctrl: true}); - break; - case SwitchAccessMenuAction.MEDIA_MUTE: - EventGenerator.sendKeyPress(KeyCode.VOLUME_MUTE); - break; - case SwitchAccessMenuAction.MEDIA_VOLUME_DOWN: - EventGenerator.sendKeyPress(KeyCode.VOLUME_DOWN); - break; - case SwitchAccessMenuAction.MEDIA_VOLUME_UP: - EventGenerator.sendKeyPress(KeyCode.VOLUME_UP); - break; - case SwitchAccessMenuAction.MEDIA_REWIND: - // TODO(crbug.com/1258921): Fill in rewind or remove. - break; - case SwitchAccessMenuAction.MEDIA_PLAY_PAUSE: - EventGenerator.sendKeyPress(KeyCode.MEDIA_PLAY_PAUSE); - break; - case SwitchAccessMenuAction.MEDIA_FASTFORWARD: - // TODO(crbug.com/1258921): Fill in fastforward or remove. - break; - case SwitchAccessMenuAction.DISPLAY_MIRROR: - EventGenerator.sendKeyPress(KeyCode.ZOOM, {ctrl: true}); - break; - case SwitchAccessMenuAction.DISPLAY_BRIGHTNESS_DOWN: - EventGenerator.sendKeyPress(KeyCode.BRIGHTNESS_DOWN); - break; - case SwitchAccessMenuAction.DISPLAY_BRIGHTNESS_UP: - EventGenerator.sendKeyPress(KeyCode.BRIGHTNESS_UP); - break; - case SwitchAccessMenuAction.DISPLAY_ROTATE: - EventGenerator.sendKeyPress( - KeyCode.BROWSER_REFRESH, {ctrl: true, alt: true, shift: true}); - break; - case SwitchAccessMenuAction.DISPLAY_ZOOM_OUT: - EventGenerator.sendKeyPress(KeyCode.OEM_MINUS, {ctrl: true}); - break; - case SwitchAccessMenuAction.DISPLAY_ZOOM_IN: - EventGenerator.sendKeyPress(KeyCode.OEM_PLUS, {ctrl: true}); - break; - case SwitchAccessMenuAction.USER_LOCK: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.L, {search: true}); - break; - case SwitchAccessMenuAction.USER_PREVIOUS_USER: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.OEM_COMMA, {ctrl: true, alt: true}); - break; - case SwitchAccessMenuAction.USER_NEXT_USER: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress( - KeyCode.OEM_PERIOD, {ctrl: true, alt: true}); - break; - case SwitchAccessMenuAction.USER_SIGN_OUT: - FocusRingManager.clearAll(); - ActionManager.exitAllMenus(); - EventGenerator.sendKeyPress(KeyCode.Q, {ctrl: true, shift: true}); - EventGenerator.sendKeyPress(KeyCode.Q, {ctrl: true, shift: true}); - break; - case SwitchAccessMenuAction.ACTION_RECORDER: - ActionManager.openMenu(SAConstants.MenuType.ACTION_RECORDER_MENU); - break; - case SwitchAccessMenuAction.START_RECORDING: - ActionManager.exitAllMenus(); - ActionRecorder.instance.start(); - break; - case SwitchAccessMenuAction.STOP_RECORDING: - ActionRecorder.instance.stop(); - break; - case SwitchAccessMenuAction.EXECUTE_MACRO: - ActionRecorder.instance.executeMacro(); - break; - default: - return false; - } - - return true; - } - /** Refreshes the current menu, if needed. */ static refreshMenuUnconditionally() { if (!MenuManager.isMenuOpen()) { @@ -341,14 +155,6 @@ * @private */ actionsForType_(type) { - // If feature flag is enabled, fill submenus and escape if successful. - if (SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - const actions = this.actionsForTypeMultistep_(type); - if (actions.length) { - return actions; - } - } - switch (type) { case SAConstants.MenuType.MAIN_MENU: return [ @@ -385,81 +191,6 @@ SwitchAccessMenuAction.LEFT_CLICK, SwitchAccessMenuAction.RIGHT_CLICK, ]; - - default: - return []; - } - } - - /** - * Returns all possible actions for the provided menu type when the multistep - * automation feature flag is enabled. - * @param {!SAConstants.MenuType} type - * @return {!Array<!SwitchAccessMenuAction>} - * @private - */ - actionsForTypeMultistep_(type) { - // Check feature flag is enabled or escape. - if (!SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - return []; - } - - switch (type) { - case SAConstants.MenuType.SHORTCUTS_MENU: - return [ - SwitchAccessMenuAction.LEAVE_GROUP, SwitchAccessMenuAction.WEB_MENU, - SwitchAccessMenuAction.SYSTEM_MENU, SwitchAccessMenuAction.MEDIA_MENU, - SwitchAccessMenuAction.DISPLAY_MENU, SwitchAccessMenuAction.USER_MENU - ]; - case SAConstants.MenuType.WEB_MENU: - return [ - SwitchAccessMenuAction.WEB_BOOKMARK, - SwitchAccessMenuAction.WEB_BOTTOM_OF_PAGE, - SwitchAccessMenuAction.WEB_TOP_OF_PAGE, - SwitchAccessMenuAction.WEB_FIND_IN_PAGE, - SwitchAccessMenuAction.WEB_DOWNLOADS, - SwitchAccessMenuAction.WEB_CLEAR_HISTORY - ]; - case SAConstants.MenuType.SYSTEM_MENU: - return [ - SwitchAccessMenuAction.SYSTEM_STATUS_BAR, - SwitchAccessMenuAction.SYSTEM_LAUNCHER, - SwitchAccessMenuAction.SYSTEM_TASK_MANAGER, - SwitchAccessMenuAction.SYSTEM_DIAGNOSTICS, - SwitchAccessMenuAction.SYSTEM_SCREENSHOT, - SwitchAccessMenuAction.SYSTEM_HELP - ]; - case SAConstants.MenuType.MEDIA_MENU: - return [ - SwitchAccessMenuAction.MEDIA_MUTE, - SwitchAccessMenuAction.MEDIA_VOLUME_DOWN, - SwitchAccessMenuAction.MEDIA_VOLUME_UP, - SwitchAccessMenuAction.MEDIA_REWIND, - SwitchAccessMenuAction.MEDIA_PLAY_PAUSE, - SwitchAccessMenuAction.MEDIA_FASTFORWARD - ]; - case SAConstants.MenuType.DISPLAY_MENU: - return [ - SwitchAccessMenuAction.DISPLAY_MIRROR, - SwitchAccessMenuAction.DISPLAY_BRIGHTNESS_DOWN, - SwitchAccessMenuAction.DISPLAY_BRIGHTNESS_UP, - SwitchAccessMenuAction.DISPLAY_ROTATE, - SwitchAccessMenuAction.DISPLAY_ZOOM_OUT, - SwitchAccessMenuAction.DISPLAY_ZOOM_IN - ]; - case SAConstants.MenuType.USER_MENU: - return [ - SwitchAccessMenuAction.USER_LOCK, - SwitchAccessMenuAction.USER_PREVIOUS_USER, - SwitchAccessMenuAction.USER_NEXT_USER, - SwitchAccessMenuAction.USER_SIGN_OUT - ]; - case SAConstants.MenuType.ACTION_RECORDER_MENU: - return [ - SwitchAccessMenuAction.START_RECORDING, - SwitchAccessMenuAction.STOP_RECORDING, - SwitchAccessMenuAction.EXECUTE_MACRO, - ]; default: return []; } @@ -497,24 +228,8 @@ let actions = this.actionsForType_(SAConstants.MenuType.POINT_SCAN_MENU); actions = this.addGlobalActions_(actions); return actions; - } else if (this.currentMenuType_ === SAConstants.MenuType.SHORTCUTS_MENU) { - return this.actionsForType_(SAConstants.MenuType.SHORTCUTS_MENU); - } else if (this.currentMenuType_ === SAConstants.MenuType.WEB_MENU) { - return this.actionsForType_(SAConstants.MenuType.WEB_MENU); - } else if (this.currentMenuType_ === SAConstants.MenuType.SYSTEM_MENU) { - return this.actionsForType_(SAConstants.MenuType.SYSTEM_MENU); - } else if (this.currentMenuType_ === SAConstants.MenuType.MEDIA_MENU) { - return this.actionsForType_(SAConstants.MenuType.MEDIA_MENU); - } else if (this.currentMenuType_ === SAConstants.MenuType.DISPLAY_MENU) { - return this.actionsForType_(SAConstants.MenuType.DISPLAY_MENU); - } else if (this.currentMenuType_ === SAConstants.MenuType.USER_MENU) { - return this.actionsForType_(SAConstants.MenuType.USER_MENU); - } else if ( - this.currentMenuType_ === SAConstants.MenuType.ACTION_RECORDER_MENU) { - return this.actionsForType_(SAConstants.MenuType.ACTION_RECORDER_MENU); } - if (!this.actionNode_ || !this.actionNode_.isValidAndVisible()) { return []; } @@ -523,12 +238,6 @@ actions = actions.filter((a) => possibleActions.includes(a)); if (this.currentMenuType_ === SAConstants.MenuType.MAIN_MENU) { actions = this.addGlobalActions_(actions); - if (SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - // Ensure shortcuts and action recorder are the first items in the - // menu. - actions.unshift(SwitchAccessMenuAction.ACTION_RECORDER); - actions.unshift(SwitchAccessMenuAction.SHORTCUTS); - } } return actions; }
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/action_recorder.js b/chrome/browser/resources/chromeos/accessibility/switch_access/action_recorder.js deleted file mode 100644 index 317e9f8..0000000 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/action_recorder.js +++ /dev/null
@@ -1,113 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {FocusRingManager} from './focus_ring_manager.js'; -import {NodeIdentifier} from './node_identifier.js'; -import {SwitchAccess} from './switch_access.js'; - -/** A class used to record macros and play them back. */ -export class ActionRecorder { - /** @private */ - constructor() { - /** @private {boolean} */ - this.recording_ = false; - /** @private {!Array<!NodeIdentifier>} */ - this.macro_ = []; - } - - /** @return {!ActionRecorder} */ - static get instance() { - if (!SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - throw new Error( - 'Multistep automation flag must be enabled to access ActionRecorder'); - } - - if (!ActionRecorder.instance_) { - ActionRecorder.instance_ = new ActionRecorder(); - } - return ActionRecorder.instance_; - } - - /** Starts recording actions */ - start() { - this.recording_ = true; - this.macro_ = []; - FocusRingManager.setIsRecording(true); - } - - /** Stops recording actions */ - stop() { - this.recording_ = false; - FocusRingManager.setIsRecording(false); - } - - /** @param {!chrome.automation.AutomationNode} node */ - recordNode(node) { - if (!this.recording_) { - return; - } - - if (node.className === 'SwitchAccessBackButtonView' || - node.className === 'SwitchAccessMenuButton') { - // Do not record actions on the back button or menu buttons. - return; - } - - this.macro_.push(NodeIdentifier.fromNode(node)); - } - - /** Executes the saved macro */ - async executeMacro() { - const desktop = - await new Promise(resolve => chrome.automation.getDesktop(resolve)); - for (const identifier of this.macro_) { - // Wait for stable state. - // TODO: replace this with something more substantive e.g. a focus or - // page load listener. - await this.sleep(); - // Find node. - const node = this.find_(desktop, identifier); - if (!node) { - return; - } - - // Focus node with Switch Access. - node.focus(); - - // TODO: draw focus ring around node. - - // Perform 'Select' on the node. - node.doDefault(); - } - } - - sleep() { - return new Promise(resolve => setTimeout(resolve, 1000)); - } - - /** - * Searches through the tree for a node that matches `target`. - * @param {!chrome.automation.AutomationNode} root - * @param {!NodeIdentifier} target - * @return {chrome.automation.AutomationNode} - * @private - */ - find_(root, target) { - const nodes = []; - nodes.push(root); - while (nodes.length !== 0) { - const current = nodes.shift(); - // Goal test. - if (NodeIdentifier.fromNode(current).equals(target)) { - return current; - } - - for (const child of current.children) { - nodes.push(child); - } - } - - return null; - } -}
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/focus_ring_manager.js b/chrome/browser/resources/chromeos/accessibility/switch_access/focus_ring_manager.js index f64657b..525838f 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/focus_ring_manager.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/focus_ring_manager.js
@@ -59,43 +59,6 @@ } /** - * Set state of recording macro and switch colors of the focus rings. - * @param {boolean} isRecording - */ - static setIsRecording(isRecording) { - // If the feature flag is not enabled, escape. - if (!SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - return; - } - - const manager = FocusRingManager.instance; - - if (isRecording) { - manager.rings_.get(SAConstants.Focus.ID.PRIMARY).color = - SAConstants.Focus.PRIMARY_COLOR_RECORDING_MACRO; - manager.rings_.get(SAConstants.Focus.ID.PRIMARY).secondaryColor = - SAConstants.Focus.OUTER_COLOR_RECORDING_MACRO; - - manager.rings_.get(SAConstants.Focus.ID.PREVIEW).color = - SAConstants.Focus.PREVIEW_COLOR_RECORDING_MACRO; - manager.rings_.get(SAConstants.Focus.ID.PREVIEW).secondaryColor = - SAConstants.Focus.OUTER_COLOR_RECORDING_MACRO; - } else { - manager.rings_.get(SAConstants.Focus.ID.PRIMARY).color = - SAConstants.Focus.PRIMARY_COLOR; - manager.rings_.get(SAConstants.Focus.ID.PRIMARY).secondaryColor = - SAConstants.Focus.OUTER_COLOR; - - manager.rings_.get(SAConstants.Focus.ID.PREVIEW).color = - SAConstants.Focus.PREVIEW_COLOR; - manager.rings_.get(SAConstants.Focus.ID.PREVIEW).secondaryColor = - SAConstants.Focus.OUTER_COLOR; - } - - manager.updateFocusRings_(null, null); - } - - /** * Sets the primary and preview focus rings based on the current primary and * group nodes used for navigation. * @param {!SAChildNode} node
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/node_identifier.js b/chrome/browser/resources/chromeos/accessibility/switch_access/node_identifier.js deleted file mode 100644 index 217fc37..0000000 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/node_identifier.js +++ /dev/null
@@ -1,111 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {SwitchAccess} from './switch_access.js'; - -/** - * Stores all identifying attributes for an AutomationNode. - * A helper object for NodeIdentifier. - * @typedef {{ - * id: string, - * name: string, - * role: string, - * childCount: number, - * indexInParent: number, - * className: string, - * htmlTag: string }} - */ -let Attributes; - -/** A class used to identify AutomationNodes. */ -export class NodeIdentifier { - /** - * @param {!{ - * attributes: !Attributes, - * pageUrl: string}} params - * @private - */ - constructor(params) { - if (!SwitchAccess.instance.multistepAutomationFeaturesEnabled()) { - throw new Error( - 'Multistep automation flag must be enabled to access ActionRecorder'); - } - - /** @type {!Attributes} */ - this.attributes = params.attributes; - /** @type {string} */ - this.pageUrl = params.pageUrl; - } - - /** - * @param {!chrome.automation.AutomationNode} node - * @return {!NodeIdentifier} - */ - static fromNode(node) { - const params = { - attributes: NodeIdentifier.createAttributes_(node), - pageUrl: node.root.docUrl || '', - }; - - return new NodeIdentifier(params); - } - - /** - * Returns true if |this| is equal to |other|. - * @param {!NodeIdentifier} other - * @return {boolean} - */ - equals(other) { - // If pageUrl and HTML Id match, we know they refer to the same node. - if (this.pageUrl && this.attributes.id && this.pageUrl === other.pageUrl && - this.attributes.id === other.attributes.id) { - return true; - } - - // TODO: Implement better matching algorithm. - // Ensure both NodeIdentifiers are composed of matching Attributes. - if (!this.matchingAttributes_(this.attributes, other.attributes)) { - return false; - } - - return true; - } - - /** - * @param {!chrome.automation.AutomationNode} node - * @return {!Attributes} - * @private - */ - static createAttributes_(node) { - return { - id: (node.htmlAttributes) ? node.htmlAttributes['id'] || '' : '', - name: node.name || '', - role: node.role || '', - childCount: node.childCount || 0, - indexInParent: node.indexInParent || 0, - className: node.className || '', - htmlTag: node.htmlTag || '' - }; - } - - /** - * @param {!Attributes} target - * @param {!Attributes} candidate - * @return {boolean} - * @private - */ - matchingAttributes_(target, candidate) { - for (const [key, targetValue] of Object.entries(target)) { - if (candidate[key] !== targetValue) { - return false; - } - } - return true; - } - - /** @override */ - toString() { - return JSON.stringify(this); - } -}
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access.js b/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access.js index b3bad09..3324fb4 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access.js
@@ -61,20 +61,11 @@ */ this.enableImprovedTextInput_ = false; - /** @private {boolean} */ - this.enableMultistepAutomationFeatures_ = false; - chrome.commandLinePrivate.hasSwitch( 'enable-experimental-accessibility-switch-access-text', (result) => { this.enableImprovedTextInput_ = result; }); - chrome.commandLinePrivate.hasSwitch( - 'enable-experimental-accessibility-switch-access-multistep-automation', - (enabled) => { - this.enableMultistepAutomationFeatures_ = enabled; - }); - /* @private {!SAConstants.Mode} */ this.mode_ = SAConstants.Mode.ITEM_SCAN; } @@ -88,11 +79,6 @@ return this.enableImprovedTextInput_; } - /** @return {boolean} */ - multistepAutomationFeaturesEnabled() { - return this.enableMultistepAutomationFeatures_; - } - /** @return {!SAConstants.Mode} */ get mode() { return this.mode_;
diff --git a/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js b/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js index 49b12c45..fa3358a 100644 --- a/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js +++ b/chrome/browser/resources/chromeos/accessibility/switch_access/switch_access_constants.js
@@ -84,18 +84,7 @@ * @enum {number} * @const */ - MenuType: { - MAIN_MENU: 0, - TEXT_NAVIGATION: 1, - POINT_SCAN_MENU: 2, - SHORTCUTS_MENU: 3, - ACTION_RECORDER_MENU: 4, - WEB_MENU: 5, - SYSTEM_MENU: 6, - MEDIA_MENU: 7, - USER_MENU: 8, - DISPLAY_MENU: 9, - }, + MenuType: {MAIN_MENU: 0, TEXT_NAVIGATION: 1, POINT_SCAN_MENU: 2}, /** * The modes of interaction the user can select for how to interact with the @@ -179,26 +168,5 @@ * @const */ OUTER_COLOR: '#174EA6', // Google Blue 900 - - /** - * The inner color of the primary focus ring when recording marcos. - * @type {string} - * @const - */ - PRIMARY_COLOR_RECORDING_MACRO: '#E57373', // Google Red 300 - - /** - * The inner color of the preview focus ring when recording marcos. - * @type {string} - * @const - */ - PREVIEW_COLOR_RECORDING_MACRO: '#E5737380', // Google Red 300, 50% opacity - - /** - * The outer color of the focus rings when recording marcos. - * @type {string} - * @const - */ - OUTER_COLOR_RECORDING_MACRO: '#B71C1C', // Google Red 900 }, };
diff --git a/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.html b/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.html index 09cf185..4071b8b 100644 --- a/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.html +++ b/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.html
@@ -14,6 +14,7 @@ </template> <template is="dom-if" if="[[isBluetoothRevampEnabled_]]" restamp> <bluetooth-pairing-ui on-finished="closeDialog_" - pairing-device-address="[[deviceAddress_]]"> + pairing-device-address="[[deviceAddress_]]" + should-omit-links="[[shouldOmitLinks_]]"> </bluetooth-pairing-ui> </template>
diff --git a/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js b/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js index 454472d..833e43e 100644 --- a/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js +++ b/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js
@@ -57,6 +57,18 @@ type: String, value: null, }, + + /** + * Flag indicating whether links should be displayed or not. In some + * cases, such as the user being in OOBE or the login screen, links will + * not work and should not be displayed. + * This is set by the dialog arguments when |isBluetoothRevampEnabled_| is + * true. + */ + shouldOmitLinks_: { + type: Boolean, + value: false, + }, }, /** @override */ @@ -74,6 +86,7 @@ } this.deviceAddress_ = parsedDialogArgs.address; + this.shouldOmitLinks_ = !!parsedDialogArgs.shouldOmitLinks; return; }
diff --git a/chrome/browser/resources/read_later/BUILD.gn b/chrome/browser/resources/read_later/BUILD.gn index 8859992..7f12dab 100644 --- a/chrome/browser/resources/read_later/BUILD.gn +++ b/chrome/browser/resources/read_later/BUILD.gn
@@ -34,7 +34,7 @@ "images/read_later_empty.svg", "read_later.html", "side_panel/bookmarks.html", - "side_panel/reader_mode/reader_mode.html", + "side_panel/read_anything/read_anything.html", "side_panel/side_panel.html", ] input_files_base_dir = rebase_path(".", "//") @@ -95,9 +95,9 @@ "side_panel/bookmarks_api_proxy.ts", "side_panel/bookmarks_drag_manager.ts", "side_panel/bookmarks.mojom-webui.js", - "side_panel/reader_mode/app.ts", - "side_panel/reader_mode/reader_mode_api_proxy.ts", - "side_panel/reader_mode/reader_mode.mojom-webui.js", + "side_panel/read_anything/app.ts", + "side_panel/read_anything/read_anything_api_proxy.ts", + "side_panel/read_anything/read_anything.mojom-webui.js", ] definitions = [ "//tools/typescript/definitions/bookmark_manager_private.d.ts",
diff --git a/chrome/browser/resources/read_later/side_panel/BUILD.gn b/chrome/browser/resources/read_later/side_panel/BUILD.gn index 03f8abc..eb8de8f 100644 --- a/chrome/browser/resources/read_later/side_panel/BUILD.gn +++ b/chrome/browser/resources/read_later/side_panel/BUILD.gn
@@ -14,14 +14,14 @@ in_files = [ "bookmarks_api_proxy.ts", "bookmarks_drag_manager.ts", - "reader_mode/reader_mode_api_proxy.ts", + "read_anything/read_anything_api_proxy.ts", ] } preprocess_if_expr("preprocess_generated") { deps = [ ":web_components", - "reader_mode:web_components", + "read_anything:web_components", ] in_folder = target_gen_dir out_folder = preprocess_folder @@ -29,14 +29,14 @@ "app.ts", "bookmark_folder.ts", "bookmarks_list.ts", - "reader_mode/app.ts", + "read_anything/app.ts", ] } preprocess_if_expr("preprocess_mojo") { deps = [ "//chrome/browser/ui/webui/read_later/side_panel:mojo_bindings_webui_js", - "//chrome/browser/ui/webui/read_later/side_panel/reader_mode:mojo_bindings_webui_js", + "//chrome/browser/ui/webui/read_later/side_panel/read_anything:mojo_bindings_webui_js", ] in_folder = "$root_gen_dir/mojom-webui/chrome/browser/ui/webui/read_later/side_panel/" @@ -44,7 +44,7 @@ out_manifest = "$target_gen_dir/preprocessed_mojo_manifest.json" in_files = [ "bookmarks.mojom-webui.js", - "reader_mode/reader_mode.mojom-webui.js", + "read_anything/read_anything.mojom-webui.js", ] }
diff --git a/chrome/browser/resources/read_later/side_panel/app.html b/chrome/browser/resources/read_later/side_panel/app.html index 22654a7..161fe4b 100644 --- a/chrome/browser/resources/read_later/side_panel/app.html +++ b/chrome/browser/resources/read_later/side_panel/app.html
@@ -79,7 +79,7 @@ </div> <div> <template is="dom-if" if="[[isSelectedTab_(selectedTab_, 2)]]"> - <reader-mode-app></reader-mode-app> + <read-anything-app></read-anything-app> </template> </div> </iron-pages>
diff --git a/chrome/browser/resources/read_later/side_panel/app.ts b/chrome/browser/resources/read_later/side_panel/app.ts index ec01c97..ce57cbc4 100644 --- a/chrome/browser/resources/read_later/side_panel/app.ts +++ b/chrome/browser/resources/read_later/side_panel/app.ts
@@ -12,7 +12,7 @@ import '../app.js'; /* <read-later-app> */ import '../strings.m.js'; import './bookmarks_list.js'; -import './reader_mode/app.js'; /* <reader-mode-app> */ +import './read_anything/app.js'; /* <read-anything-app> */ import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -52,8 +52,9 @@ private tabs_: {[key: string]: string}; override ready() { - if (loadTimeData.getBoolean('readerModeSidePanelEnabled')) { - this.tabs_['readerMode'] = loadTimeData.getString('readerModeTabTitle'); + if (loadTimeData.getBoolean('readAnythingEnabled')) { + this.tabs_['readAnything'] = + loadTimeData.getString('readAnythingTabTitle'); } super.ready(); }
diff --git a/chrome/browser/resources/read_later/side_panel/reader_mode/BUILD.gn b/chrome/browser/resources/read_later/side_panel/read_anything/BUILD.gn similarity index 100% rename from chrome/browser/resources/read_later/side_panel/reader_mode/BUILD.gn rename to chrome/browser/resources/read_later/side_panel/read_anything/BUILD.gn
diff --git a/chrome/browser/resources/read_later/side_panel/reader_mode/OWNERS b/chrome/browser/resources/read_later/side_panel/read_anything/OWNERS similarity index 67% rename from chrome/browser/resources/read_later/side_panel/reader_mode/OWNERS rename to chrome/browser/resources/read_later/side_panel/read_anything/OWNERS index a62bec20..7a95f65 100644 --- a/chrome/browser/resources/read_later/side_panel/reader_mode/OWNERS +++ b/chrome/browser/resources/read_later/side_panel/read_anything/OWNERS
@@ -1,2 +1,3 @@ abigailbklein@google.com dtseng@chromium.org +mschillaci@google.com
diff --git a/chrome/browser/resources/read_later/side_panel/reader_mode/app.html b/chrome/browser/resources/read_later/side_panel/read_anything/app.html similarity index 100% rename from chrome/browser/resources/read_later/side_panel/reader_mode/app.html rename to chrome/browser/resources/read_later/side_panel/read_anything/app.html
diff --git a/chrome/browser/resources/read_later/side_panel/reader_mode/app.ts b/chrome/browser/resources/read_later/side_panel/read_anything/app.ts similarity index 77% rename from chrome/browser/resources/read_later/side_panel/reader_mode/app.ts rename to chrome/browser/resources/read_later/side_panel/read_anything/app.ts index 53b5998..ca876e81 100644 --- a/chrome/browser/resources/read_later/side_panel/reader_mode/app.ts +++ b/chrome/browser/resources/read_later/side_panel/read_anything/app.ts
@@ -7,13 +7,13 @@ import {WebUIListenerMixin} from 'chrome://resources/js/web_ui_listener_mixin.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {ReaderModeApiProxy} from './reader_mode_api_proxy.js'; +import {ReadAnythingApiProxy} from './read_anything_api_proxy.js'; -const ReaderModeElementBase = WebUIListenerMixin(PolymerElement); +const ReadAnythingElementBase = WebUIListenerMixin(PolymerElement); -export class ReaderModeElement extends ReaderModeElementBase { +export class ReadAnythingElement extends ReadAnythingElementBase { static get is() { - return 'reader-mode-app'; + return 'read-anything-app'; } static get template() { @@ -29,7 +29,7 @@ }; } - private apiProxy_: ReaderModeApiProxy = ReaderModeApiProxy.getInstance(); + private apiProxy_: ReadAnythingApiProxy = ReadAnythingApiProxy.getInstance(); private listenerIds_: number[]; private paragraphs_: string[]; @@ -55,4 +55,4 @@ this.paragraphs_ = essential_content; } } -customElements.define(ReaderModeElement.is, ReaderModeElement); +customElements.define(ReadAnythingElement.is, ReadAnythingElement);
diff --git a/chrome/browser/resources/read_later/side_panel/reader_mode/reader_mode.html b/chrome/browser/resources/read_later/side_panel/read_anything/read_anything.html similarity index 75% rename from chrome/browser/resources/read_later/side_panel/reader_mode/reader_mode.html rename to chrome/browser/resources/read_later/side_panel/read_anything/read_anything.html index 62fe1ce..f94bc29c 100644 --- a/chrome/browser/resources/read_later/side_panel/reader_mode/reader_mode.html +++ b/chrome/browser/resources/read_later/side_panel/read_anything/read_anything.html
@@ -2,7 +2,7 @@ <html dir="$i18n{textdirection}" lang="$i18n{language}"> <head> <meta charset="utf-8"> - <title>$i18n{readerModeTabTitle}</title> + <title>$i18n{readAnythingTabTitle}</title> <meta name="color-scheme" content="light dark"> <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <link rel="stylesheet" href="chrome://resources/css/md_colors.css"> @@ -21,8 +21,8 @@ </style> </head> <body> - <reader-mode-app></reader-mode-app> - <script type="module" src="side_panel/reader_mode/app.js"></script> + <read-anything-app></read-anything-app> + <script type="module" src="side_panel/read_anything/app.js"></script> </script> </body> </html> \ No newline at end of file
diff --git a/chrome/browser/resources/read_later/side_panel/reader_mode/reader_mode_api_proxy.ts b/chrome/browser/resources/read_later/side_panel/read_anything/read_anything_api_proxy.ts similarity index 76% rename from chrome/browser/resources/read_later/side_panel/reader_mode/reader_mode_api_proxy.ts rename to chrome/browser/resources/read_later/side_panel/read_anything/read_anything_api_proxy.ts index 0cac321f..fb1a1ab 100644 --- a/chrome/browser/resources/read_later/side_panel/reader_mode/reader_mode_api_proxy.ts +++ b/chrome/browser/resources/read_later/side_panel/read_anything/read_anything_api_proxy.ts
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {PageCallbackRouter, PageHandlerFactory, PageHandlerRemote} from './reader_mode.mojom-webui.js'; +import {PageCallbackRouter, PageHandlerFactory, PageHandlerRemote} from './read_anything.mojom-webui.js'; -let instance: ReaderModeApiProxy|null = null; +let instance: ReadAnythingApiProxy|null = null; -export class ReaderModeApiProxy { +export class ReadAnythingApiProxy { callbackRouter: PageCallbackRouter; handler: PageHandlerRemote; @@ -28,10 +28,10 @@ } static getInstance() { - return instance || (instance = new ReaderModeApiProxy()); + return instance || (instance = new ReadAnythingApiProxy()); } - static setInstance(obj: ReaderModeApiProxy) { + static setInstance(obj: ReadAnythingApiProxy) { instance = obj; } }
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_section.html b/chrome/browser/resources/settings/autofill_page/passwords_section.html index 886a5f1..67595557 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_section.html +++ b/chrome/browser/resources/settings/autofill_page/passwords_section.html
@@ -79,7 +79,12 @@ flex-grow: 1; } </style> - <settings-toggle-button id="passwordToggle" no-extension-indicator + <div class="cr-row first" hidden$="[[!isUnifiedPasswordManagerEnabled_]]"> + $i18n{passwordsDescription} + </div> + <settings-toggle-button id="passwordToggle" + class$="[[getPasswordToggleClass_(isUnifiedPasswordManagerEnabled_)]]" + no-extension-indicator label="$i18n{passwordsSavePasswordsLabel}" pref="{{prefs.credentials_enable_service}}"> </settings-toggle-button>
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_section.ts b/chrome/browser/resources/settings/autofill_page/passwords_section.ts index 545d223..9fa35c6e 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_section.ts +++ b/chrome/browser/resources/settings/autofill_page/passwords_section.ts
@@ -218,6 +218,13 @@ 'eligibleForAccountStorage_)', }, + isUnifiedPasswordManagerEnabled_: { + type: Boolean, + value() { + return loadTimeData.getBoolean('unifiedPasswordManagerEnabled'); + }, + }, + showImportPasswords_: { type: Boolean, value() { @@ -275,6 +282,7 @@ private hasPasswordExceptions_: boolean; private shouldShowBanner_: boolean; private isAccountStoreUser_: boolean; + private isUnifiedPasswordManagerEnabled_: boolean; private shouldShowDevicePasswordsLink_: boolean; private trustedVaultBannerState_: TrustedVaultBannerState; private hasLeakedCredentials_: boolean; @@ -476,6 +484,10 @@ return !this.status.elapsedTimeSinceLastCheck; } + private getPasswordToggleClass_(): string { + return this.isUnifiedPasswordManagerEnabled_ ? 'hr' : ''; + } + /** * Shows the check passwords sub page. */
diff --git a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.js b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.js index 6660c982..18081b0e 100644 --- a/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.js +++ b/chrome/browser/resources/settings/chromeos/multidevice_page/multidevice_page.js
@@ -504,6 +504,7 @@ const urlParams = Router.getInstance().getQueryParameters(); if (urlParams.get('showPhonePermissionSetupDialog') !== null) { this.showPhonePermissionSetupDialog_ = true; + Router.getInstance().navigateTo(routes.MULTIDEVICE_FEATURES); } },
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc index 81f7b39..4c0855be 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -40,7 +40,7 @@ #include "url/gurl.h" #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/tpm/stub_install_attributes.h" +#include "ash/components/tpm/stub_install_attributes.h" #endif using ::testing::Invoke;
diff --git a/chrome/browser/signin/account_reconcilor_factory.cc b/chrome/browser/signin/account_reconcilor_factory.cc index e4374c6..b15b4b80 100644 --- a/chrome/browser/signin/account_reconcilor_factory.cc +++ b/chrome/browser/signin/account_reconcilor_factory.cc
@@ -25,11 +25,11 @@ #include "components/signin/public/base/signin_switches.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/install_attributes.h" #include "base/metrics/histogram_macros.h" #include "base/time/time.h" #include "chrome/browser/ash/account_manager/account_manager_util.h" #include "chrome/browser/lifetime/application_lifetime.h" -#include "chromeos/tpm/install_attributes.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" #include "components/signin/core/browser/active_directory_account_reconcilor_delegate.h"
diff --git a/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc b/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc index abb0b92..013fbae 100644 --- a/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc +++ b/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc
@@ -15,7 +15,6 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/test/bind.h" -#include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/safe_browsing/test_safe_browsing_database_helper.h" @@ -82,25 +81,6 @@ return content_settings->IsContentBlocked(ContentSettingsType::ADS); } -#if BUILDFLAG(IS_ANDROID) -bool SubresourceFilterBrowserTest::PresentingAdsBlockedInfobar( - content::WebContents* web_contents) { - auto* infobar_manager = - infobars::ContentInfoBarManager::FromWebContents(web_contents); - if (infobar_manager->infobar_count() == 0) - return false; - - // No infobars other than the ads blocked infobar should be displayed in the - // context of these tests. - EXPECT_EQ(infobar_manager->infobar_count(), 1u); - auto* infobar = infobar_manager->infobar_at(0); - EXPECT_EQ(infobar->delegate()->GetIdentifier(), - infobars::InfoBarDelegate::ADS_BLOCKED_INFOBAR_DELEGATE_ANDROID); - - return true; -} -#endif - void SubresourceFilterBrowserTest::SetUp() { database_helper_ = CreateTestDatabase(); PlatformBrowserTest::SetUp();
diff --git a/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h b/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h index f3dc0f43..8fa8cd5 100644 --- a/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h +++ b/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h
@@ -133,9 +133,6 @@ "SubresourceFilter.Actions2"; bool AdsBlockedInContentSettings(content::RenderFrameHost* frame_host); -#if BUILDFLAG(IS_ANDROID) - bool PresentingAdsBlockedInfobar(content::WebContents* web_contents); -#endif protected: // InProcessBrowserTest:
diff --git a/chrome/browser/subresource_filter/subresource_filter_prerender_browsertest.cc b/chrome/browser/subresource_filter/subresource_filter_prerender_browsertest.cc index 1149c36..b4ab7779 100644 --- a/chrome/browser/subresource_filter/subresource_filter_prerender_browsertest.cc +++ b/chrome/browser/subresource_filter/subresource_filter_prerender_browsertest.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h" -#include "build/build_config.h" #include "chrome/test/base/ui_test_utils.h" #include "components/subresource_filter/content/browser/ad_tagging_browser_test_utils.h" #include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h" @@ -30,6 +29,10 @@ namespace subresource_filter { +// TODO(bokan): These tests don't run on Android but it'd be good to test there +// as well as the UI differs. In particular, testing that prerender activation +// hides infobars. + // Tests ----------------------------------------------------------------------- // A very basic smoke test for prerendering; this test just activates on the @@ -236,9 +239,6 @@ // still prerendering. EXPECT_FALSE(AdsBlockedInContentSettings(web_contents()->GetMainFrame())); EXPECT_FALSE(AdsBlockedInContentSettings(prerender_rfh)); -#if BUILDFLAG(IS_ANDROID) - EXPECT_FALSE(PresentingAdsBlockedInfobar()); -#endif } // Makes the prerendering page primary (i.e. the user clicked on a link to @@ -250,9 +250,6 @@ EXPECT_TRUE(AdsBlockedInContentSettings(web_contents()->GetMainFrame())); EXPECT_TRUE(AdsBlockedInContentSettings(prerender_rfh)); -#if BUILDFLAG(IS_ANDROID) - EXPECT_TRUE(PresentingAdsBlockedInfobar()); -#endif } } @@ -522,6 +519,4 @@ } } -// TODO - test that prerender activation hides infobars. - } // namespace subresource_filter
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index ad7eb75..95a6d0d 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -416,7 +416,7 @@ "//chrome/browser/ui/webui/omnibox:mojo_bindings", "//chrome/browser/ui/webui/read_later:mojo_bindings", "//chrome/browser/ui/webui/read_later/side_panel:mojo_bindings", - "//chrome/browser/ui/webui/read_later/side_panel/reader_mode:mojo_bindings", + "//chrome/browser/ui/webui/read_later/side_panel/read_anything:mojo_bindings", "//chrome/browser/ui/webui/realbox:mojo_bindings", "//chrome/browser/ui/webui/segmentation_internals:mojo_bindings", "//chrome/browser/ui/webui/tab_search:mojo_bindings", @@ -1581,10 +1581,10 @@ "webui/read_later/side_panel/bookmarks_page_handler.h", "webui/read_later/side_panel/bookmarks_side_panel_ui.cc", "webui/read_later/side_panel/bookmarks_side_panel_ui.h", - "webui/read_later/side_panel/reader_mode/reader_mode_page_handler.cc", - "webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h", - "webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.cc", - "webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h", + "webui/read_later/side_panel/read_anything/read_anything_page_handler.cc", + "webui/read_later/side_panel/read_anything/read_anything_page_handler.h", + "webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.cc", + "webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h", "webui/realbox/realbox_handler.cc", "webui/realbox/realbox_handler.h", "webui/sanitized_image_source.cc", @@ -2965,6 +2965,7 @@ "//ash/components/proximity_auth", "//ash/components/settings", "//ash/components/tether", + "//ash/components/tpm", "//ash/constants", "//ash/keyboard/ui", "//ash/public/cpp", @@ -3095,7 +3096,6 @@ "//chromeos/services/network_config/public/mojom", "//chromeos/services/network_health/public/mojom", "//chromeos/system", - "//chromeos/tpm", "//chromeos/ui/base", "//chromeos/ui/frame", "//chromeos/ui/vector_icons", @@ -3558,11 +3558,8 @@ "cocoa/fullscreen/fullscreen_toolbar_controller.mm", "cocoa/fullscreen/fullscreen_toolbar_mouse_tracker.h", "cocoa/fullscreen/fullscreen_toolbar_mouse_tracker.mm", - "cocoa/handoff_active_url_observer.cc", - "cocoa/handoff_active_url_observer.h", - "cocoa/handoff_active_url_observer_bridge.h", - "cocoa/handoff_active_url_observer_bridge.mm", - "cocoa/handoff_active_url_observer_delegate.h", + "cocoa/handoff_observer.h", + "cocoa/handoff_observer.mm", "cocoa/history_menu_bridge.h", "cocoa/history_menu_bridge.mm", "cocoa/history_menu_cocoa_controller.h",
diff --git a/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuItemViewBinderRenderTest.java b/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuItemViewBinderRenderTest.java index 07cb0b1..287a5f2 100644 --- a/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuItemViewBinderRenderTest.java +++ b/chrome/browser/ui/android/appmenu/internal/java/src/org/chromium/chrome/browser/ui/appmenu/AppMenuItemViewBinderRenderTest.java
@@ -62,7 +62,9 @@ new BaseActivityTestRule<>(BlankUiTestActivity.class); @Rule public ChromeRenderTestRule mRenderTestRule = - ChromeRenderTestRule.Builder.withPublicCorpus().build(); + ChromeRenderTestRule.Builder.withPublicCorpus() + .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_APP_MENU) + .build(); private static Activity sActivity; private static ListView sListView; private static View sContentView;
diff --git a/chrome/browser/ui/android/quickactionsearchwidget/java/res/drawable/quick_action_search_widget_xsmall_background.xml b/chrome/browser/ui/android/quickactionsearchwidget/java/res/drawable/quick_action_search_widget_xsmall_background.xml index c86d066..57cfdc7 100644 --- a/chrome/browser/ui/android/quickactionsearchwidget/java/res/drawable/quick_action_search_widget_xsmall_background.xml +++ b/chrome/browser/ui/android/quickactionsearchwidget/java/res/drawable/quick_action_search_widget_xsmall_background.xml
@@ -5,6 +5,6 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - <solid android:color="@color/default_bg_color" /> + <solid android:color="@color/default_bg_color_baseline" /> <corners android:radius="@dimen/quick_action_search_widget_xsmall_background_radius" /> </shape>
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index d2452c7..02f4c0f 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -5410,10 +5410,10 @@ Sign in to <ph name="SITE_ETLD_PLUS_ONE">%1$s<ex>rp.example</ex></ph> with <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">%2$s<ex>idp.com</ex></ph> </message> <message name="IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT_NO_TOS" desc="The consent text shown to the user before sign up when there are no terms of service."> - To continue, <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">%1$s<ex>idp.com</ex></ph> will share your name, email, address, and profile picture with this site. See this site's <ph name="BEGIN_LINK1"><link_privacy_policy></ph>privacy policy<ph name="END_LINK1"></link_privacy_policy></ph>. + To continue, <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">%1$s<ex>idp.com</ex></ph> will share your name, email address, and profile picture with this site. See this site's <ph name="BEGIN_LINK1"><link_privacy_policy></ph>privacy policy<ph name="END_LINK1"></link_privacy_policy></ph>. </message> <message name="IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT" desc="The consent text shown to the user before sign up."> - To continue, <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">%1$s<ex>idp.com</ex></ph> will share your name, email, address, and profile picture with this site. See this site's <ph name="BEGIN_LINK1"><link_privacy_policy></ph>privacy policy<ph name="END_LINK1"></link_privacy_policy></ph> and <ph name="BEGIN_LINK2"><link_terms_of_service></ph>terms of service<ph name="END_LINK2"></link_terms_of_service></ph>. + To continue, <ph name="IDENTITY_PROVIDER_ETLD_PLUS_ONE">%1$s<ex>idp.com</ex></ph> will share your name, email address, and profile picture with this site. See this site's <ph name="BEGIN_LINK1"><link_privacy_policy></ph>privacy policy<ph name="END_LINK1"></link_privacy_policy></ph> and <ph name="BEGIN_LINK2"><link_terms_of_service></ph>terms of service<ph name="END_LINK2"></link_terms_of_service></ph>. </message> <message name="IDS_ACCOUNT_SELECTION_CONTINUE" desc="Title of the button that continues filling with the only available set of credentials.">
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT.png.sha1 index 2cf2c4e..1329c13d 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT.png.sha1 +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT.png.sha1
@@ -1 +1 @@ -a347db38f7f0b57121163aa7ff7a0de62aaa354a \ No newline at end of file +7199251cd76622c7710972c5d04b480fcebd3ed5 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT_NO_TOS.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT_NO_TOS.png.sha1 index ac7cf6e2..da858e3 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT_NO_TOS.png.sha1 +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_ACCOUNT_SELECTION_DATA_SHARING_CONSENT_NO_TOS.png.sha1
@@ -1 +1 @@ -9aca4007727c025f7ebabfd42b5f9fa705d36ed8 \ No newline at end of file +55f757b03dfd7b7841523f891b2e1465950e5924 \ No newline at end of file
diff --git a/chrome/browser/ui/android/toolbar/java/res/drawable/modern_toolbar_text_box_background_with_primary_color.xml b/chrome/browser/ui/android/toolbar/java/res/drawable/modern_toolbar_text_box_background_with_primary_color.xml index 56a8f96..6763d1c 100644 --- a/chrome/browser/ui/android/toolbar/java/res/drawable/modern_toolbar_text_box_background_with_primary_color.xml +++ b/chrome/browser/ui/android/toolbar/java/res/drawable/modern_toolbar_text_box_background_with_primary_color.xml
@@ -6,7 +6,7 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > - <solid android:color="@color/toolbar_background_primary" /> + <solid android:color="@macro/toolbar_background_primary" /> <size android:width="@dimen/modern_toolbar_background_size" android:height="@dimen/modern_toolbar_background_size" />
diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml index 58bebd0..bc469f3a 100644 --- a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml +++ b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml
@@ -14,7 +14,7 @@ android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height_no_shadow" android:layout_marginTop="@dimen/tab_strip_height" - android:background="?attr/default_bg_color_dynamic" + android:background="@macro/default_bg_color" android:paddingStart="@dimen/tablet_toolbar_start_padding" > <LinearLayout
diff --git a/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc index 0560541..fd22a1fc 100644 --- a/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_profile_support_unittest.cc
@@ -8,6 +8,7 @@ #include <set> #include <vector> +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/display/screen_orientation_controller.h" #include "ash/display/screen_orientation_controller_test_api.h" #include "ash/multi_user/multi_user_window_manager_impl.h" @@ -53,7 +54,6 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_info.h"
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm index 1fd2042c4..8b87122 100644 --- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm +++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
@@ -407,7 +407,11 @@ } // Test Maximize, Fullscreen, Restore combinations. -IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, MaximizeFullscreen) { +// Disabled because ScopedFakeNSWindowFullscreen is incompatible with +// NSWindowFullscreenNotificationWaiter. +// https://crbug.com/1307803 +IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, + DISABLED_MaximizeFullscreen) { ui::test::ScopedFakeNSWindowFullscreen fake_fullscreen; SetUpAppWithWindows(1);
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer.cc b/chrome/browser/ui/cocoa/handoff_active_url_observer.cc deleted file mode 100644 index ffb72e7..0000000 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer.cc +++ /dev/null
@@ -1,93 +0,0 @@ -// Copyright 2014 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/cocoa/handoff_active_url_observer.h" - -#include "base/check.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_finder.h" -#include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h" -#include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "content/public/browser/page.h" -#include "content/public/browser/web_contents.h" - -HandoffActiveURLObserver::HandoffActiveURLObserver( - HandoffActiveURLObserverDelegate* delegate) - : delegate_(delegate), - active_browser_(nullptr) { - DCHECK(delegate_); - - BrowserList::AddObserver(this); - SetActiveBrowser(chrome::FindLastActive()); -} - -HandoffActiveURLObserver::~HandoffActiveURLObserver() { - BrowserList::RemoveObserver(this); - SetActiveBrowser(nullptr); -} - -void HandoffActiveURLObserver::OnBrowserSetLastActive(Browser* browser) { - SetActiveBrowser(browser); - delegate_->HandoffActiveURLChanged(GetActiveWebContents()); -} - -void HandoffActiveURLObserver::OnBrowserRemoved(Browser* removed_browser) { - if (active_browser_ != removed_browser) - return; - - SetActiveBrowser(chrome::FindLastActive()); - delegate_->HandoffActiveURLChanged(GetActiveWebContents()); -} - -void HandoffActiveURLObserver::OnTabStripModelChanged( - TabStripModel* tab_strip_model, - const TabStripModelChange& change, - const TabStripSelectionChange& selection) { - if (tab_strip_model->empty() || !selection.active_tab_changed()) - return; - - StartObservingWebContents(selection.new_contents); - delegate_->HandoffActiveURLChanged(selection.new_contents); -} - -void HandoffActiveURLObserver::PrimaryPageChanged(content::Page& page) { - delegate_->HandoffActiveURLChanged(web_contents()); -} - -void HandoffActiveURLObserver::SetActiveBrowser(Browser* active_browser) { - if (active_browser == active_browser_) - return; - - if (active_browser_) { - active_browser_->tab_strip_model()->RemoveObserver(this); - StopObservingWebContents(); - } - - active_browser_ = active_browser; - - if (active_browser_) { - active_browser_->tab_strip_model()->AddObserver(this); - content::WebContents* web_contents = GetActiveWebContents(); - if (web_contents) - StartObservingWebContents(web_contents); - } -} - -void HandoffActiveURLObserver::StartObservingWebContents( - content::WebContents* web_contents) { - DCHECK(web_contents); - Observe(web_contents); -} - -void HandoffActiveURLObserver::StopObservingWebContents() { - Observe(nullptr); -} - -content::WebContents* HandoffActiveURLObserver::GetActiveWebContents() { - if (!active_browser_) - return nullptr; - - return active_browser_->tab_strip_model()->GetActiveWebContents(); -}
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h b/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h deleted file mode 100644 index 50aecaa5..0000000 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h +++ /dev/null
@@ -1,50 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_BRIDGE_H_ -#define CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_BRIDGE_H_ - -#import <Cocoa/Cocoa.h> - -#include <memory> - -#include "chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h" - -namespace content { -class WebContents; -} - -class HandoffActiveURLObserver; - -// A protocol that allows ObjC objects to receive delegate callbacks from -// HandoffActiveURLObserver. -@protocol HandoffActiveURLObserverBridgeDelegate -- (void)handoffActiveURLChanged:(content::WebContents*)webContents; -@end - -// This class allows an ObjC object to receive the delegate callbacks from an -// HandoffActiveURLObserver. -class HandoffActiveURLObserverBridge : public HandoffActiveURLObserverDelegate { - public: - explicit HandoffActiveURLObserverBridge( - NSObject<HandoffActiveURLObserverBridgeDelegate>* delegate); - - HandoffActiveURLObserverBridge(const HandoffActiveURLObserverBridge&) = - delete; - HandoffActiveURLObserverBridge& operator=( - const HandoffActiveURLObserverBridge&) = delete; - - ~HandoffActiveURLObserverBridge() override; - - private: - void HandoffActiveURLChanged(content::WebContents* web_contents) override; - - // Instances of this class should be owned by their |delegate_|. - NSObject<HandoffActiveURLObserverBridgeDelegate>* delegate_; - - // The C++ object that this class acts as a bridge for. - std::unique_ptr<HandoffActiveURLObserver> observer_; -}; - -#endif // CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_BRIDGE_H_
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.mm b/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.mm deleted file mode 100644 index 381bb0cc..0000000 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.mm +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright 2014 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/cocoa/handoff_active_url_observer_bridge.h" - -#include "chrome/browser/ui/cocoa/handoff_active_url_observer.h" - -HandoffActiveURLObserverBridge::HandoffActiveURLObserverBridge( - NSObject<HandoffActiveURLObserverBridgeDelegate>* delegate) - : delegate_(delegate) { - DCHECK(delegate_); - observer_ = std::make_unique<HandoffActiveURLObserver>(this); -} - -HandoffActiveURLObserverBridge::~HandoffActiveURLObserverBridge() {} - -void HandoffActiveURLObserverBridge::HandoffActiveURLChanged( - content::WebContents* web_contents) { - [delegate_ handoffActiveURLChanged:web_contents]; -}
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h b/chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h deleted file mode 100644 index 1fcdbf6..0000000 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer_delegate.h +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_DELEGATE_H_ -#define CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_DELEGATE_H_ - -namespace content { -class WebContents; -} - -// The delegate for a HandoffActiveURLObserver. -class HandoffActiveURLObserverDelegate { - public: - // Called when: - // 1. The most recently focused browser changes. - // 2. The active tab of the browser changes. - // 3. After a navigation of the web contents of the active tab. - // |web_contents| is the WebContents whose VisibleURL is considered the - // "Active URL" of Chrome. - virtual void HandoffActiveURLChanged(content::WebContents* web_contents) = 0; - - protected: - virtual ~HandoffActiveURLObserverDelegate() {} -}; - -#endif // CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_DELEGATE_H_
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer.h b/chrome/browser/ui/cocoa/handoff_observer.h similarity index 63% rename from chrome/browser/ui/cocoa/handoff_active_url_observer.h rename to chrome/browser/ui/cocoa/handoff_observer.h index af19043..f7ea652 100644 --- a/chrome/browser/ui/cocoa/handoff_active_url_observer.h +++ b/chrome/browser/ui/cocoa/handoff_observer.h
@@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ -#define CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ +#ifndef CHROME_BROWSER_UI_COCOA_HANDOFF_OBSERVER_H_ +#define CHROME_BROWSER_UI_COCOA_HANDOFF_OBSERVER_H_ + +#import <Cocoa/Cocoa.h> #include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" @@ -15,24 +17,28 @@ } class Browser; -class HandoffActiveURLObserverDelegate; + +// A protocol that allows ObjC objects to receive delegate callbacks from +// HandoffObserver. +@protocol HandoffObserverDelegate +- (void)handoffContentsChanged:(content::WebContents*)webContents; +@end // This class observes changes to the "active URL". This is defined as the // visible URL of the WebContents of the selected tab of the most recently // focused browser window. -class HandoffActiveURLObserver : public BrowserListObserver, - public TabStripModelObserver, - public content::WebContentsObserver { +class HandoffObserver : public BrowserListObserver, + public TabStripModelObserver, + public content::WebContentsObserver { public: - explicit HandoffActiveURLObserver(HandoffActiveURLObserverDelegate* delegate); + explicit HandoffObserver(NSObject<HandoffObserverDelegate>* delegate); - HandoffActiveURLObserver(const HandoffActiveURLObserver&) = delete; - HandoffActiveURLObserver& operator=(const HandoffActiveURLObserver&) = delete; + HandoffObserver(const HandoffObserver&) = delete; + HandoffObserver& operator=(const HandoffObserver&) = delete; - ~HandoffActiveURLObserver() override; + ~HandoffObserver() override; - private: - // BrowserListObserver + private: // BrowserListObserver void OnBrowserSetLastActive(Browser* browser) override; void OnBrowserRemoved(Browser* browser) override; @@ -44,6 +50,7 @@ // content::WebContentsObserver void PrimaryPageChanged(content::Page& page) override; + void TitleWasSet(content::NavigationEntry* entry) override; // Updates the active browser. void SetActiveBrowser(Browser* active_browser); @@ -58,12 +65,12 @@ // Returns the active WebContents. May return nullptr. content::WebContents* GetActiveWebContents(); - // Instances of this class should be owned by their |delegate_|. - HandoffActiveURLObserverDelegate* delegate_; - // This pointer is always up to date, and points to the most recently // activated browser, or nullptr if no browsers exist. - Browser* active_browser_; + Browser* active_browser_ = nullptr; + + // Instances of this class should be owned by their |delegate_|. + NSObject<HandoffObserverDelegate>* delegate_; }; -#endif // CHROME_BROWSER_UI_COCOA_HANDOFF_ACTIVE_URL_OBSERVER_H_ +#endif // CHROME_BROWSER_UI_COCOA_HANDOFF_OBSERVER_H_
diff --git a/chrome/browser/ui/cocoa/handoff_observer.mm b/chrome/browser/ui/cocoa/handoff_observer.mm new file mode 100644 index 0000000..7b847c3 --- /dev/null +++ b/chrome/browser/ui/cocoa/handoff_observer.mm
@@ -0,0 +1,93 @@ +// Copyright 2014 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/cocoa/handoff_observer.h" + +#include "base/check.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "content/public/browser/navigation_handle.h" +#include "content/public/browser/web_contents.h" + +HandoffObserver::HandoffObserver(NSObject<HandoffObserverDelegate>* delegate) + : delegate_(delegate) { + DCHECK(delegate_); + BrowserList::AddObserver(this); + SetActiveBrowser(chrome::FindLastActive()); +} + +HandoffObserver::~HandoffObserver() { + BrowserList::RemoveObserver(this); + SetActiveBrowser(nullptr); +} + +void HandoffObserver::OnBrowserSetLastActive(Browser* browser) { + SetActiveBrowser(browser); + [delegate_ handoffContentsChanged:GetActiveWebContents()]; +} + +void HandoffObserver::OnBrowserRemoved(Browser* removed_browser) { + if (active_browser_ != removed_browser) + return; + + SetActiveBrowser(chrome::FindLastActive()); + [delegate_ handoffContentsChanged:GetActiveWebContents()]; +} + +void HandoffObserver::OnTabStripModelChanged( + TabStripModel* tab_strip_model, + const TabStripModelChange& change, + const TabStripSelectionChange& selection) { + if (tab_strip_model->empty() || !selection.active_tab_changed()) + return; + + StartObservingWebContents(selection.new_contents); + [delegate_ handoffContentsChanged:GetActiveWebContents()]; +} + +void HandoffObserver::PrimaryPageChanged(content::Page& page) { + [delegate_ handoffContentsChanged:GetActiveWebContents()]; +} + +void HandoffObserver::TitleWasSet(content::NavigationEntry* entry) { + [delegate_ handoffContentsChanged:GetActiveWebContents()]; +} + +void HandoffObserver::SetActiveBrowser(Browser* active_browser) { + if (active_browser == active_browser_) + return; + + if (active_browser_) { + active_browser_->tab_strip_model()->RemoveObserver(this); + StopObservingWebContents(); + } + + active_browser_ = active_browser; + + if (active_browser_) { + active_browser_->tab_strip_model()->AddObserver(this); + content::WebContents* web_contents = GetActiveWebContents(); + if (web_contents) + StartObservingWebContents(web_contents); + } +} + +void HandoffObserver::StartObservingWebContents( + content::WebContents* web_contents) { + DCHECK(web_contents); + Observe(web_contents); +} + +void HandoffObserver::StopObservingWebContents() { + Observe(nullptr); +} + +content::WebContents* HandoffObserver::GetActiveWebContents() { + if (!active_browser_) + return nullptr; + + return active_browser_->tab_strip_model()->GetActiveWebContents(); +}
diff --git a/chrome/browser/ui/side_search/side_search_config.cc b/chrome/browser/ui/side_search/side_search_config.cc index 194185fc..5a8878140 100644 --- a/chrome/browser/ui/side_search/side_search_config.cc +++ b/chrome/browser/ui/side_search/side_search_config.cc
@@ -111,6 +111,9 @@ if (auto* template_url_service = TemplateURLServiceFactory::GetForProfile(profile_)) { template_url_service_observation_.Observe(template_url_service); + + // Call this initially in case the default URL has already been set. + OnTemplateURLServiceChanged(); } ApplyDSEConfiguration(profile_, *this); } @@ -141,6 +144,7 @@ default_template_url_id_ != kInvalidTemplateURLID) { default_template_url_id_ = kInvalidTemplateURLID; ResetStateAndNotifyConfigChanged(); + return; } // Propagate an update only if the current default search provider has
diff --git a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc index b8d39cf..f27bcf7 100644 --- a/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc +++ b/chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view_browsertest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/plugin_vm/plugin_vm_installer_view.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/files/file_util.h" #include "base/test/scoped_feature_list.h" @@ -25,7 +26,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/debug_daemon/fake_debug_daemon_client.h" #include "chromeos/dbus/vm_plugin_dispatcher/fake_vm_plugin_dispatcher_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/download/public/background_service/download_metadata.h" #include "components/download/public/background_service/features.h"
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc b/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc index d6ada2c..a9d23be 100644 --- a/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc +++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/ui/views/side_panel/side_panel_web_ui_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/browser/ui/webui/read_later/side_panel/bookmarks_side_panel_ui.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h" #include "chrome/common/webui_url_constants.h" #include "chrome/grit/generated_resources.h" #include "components/feature_engagement/public/feature_constants.h" @@ -107,12 +107,12 @@ ui::ImageModel::FromVectorIcon(omnibox::kStarIcon, ui::kColorIcon), base::BindRepeating(&SidePanelCoordinator::CreateBookmarksWebView, base::Unretained(this), browser_view->browser()))); - if (features::IsReaderModeSidePanelEnabled()) { + if (features::IsReadAnythingEnabled()) { global_registry->Register(std::make_unique<SidePanelEntry>( - SidePanelEntry::Id::kReaderMode, - l10n_util::GetStringUTF16(IDS_READER_MODE_TITLE), + SidePanelEntry::Id::kReadAnything, + l10n_util::GetStringUTF16(IDS_READ_ANYTHING_TITLE), ui::ImageModel::FromVectorIcon(kReaderModeIcon, ui::kColorIcon), - base::BindRepeating(&SidePanelCoordinator::CreateReaderModeWebView, + base::BindRepeating(&SidePanelCoordinator::CreateReadAnythingWebView, base::Unretained(this), browser_view->browser()))); } } @@ -344,14 +344,14 @@ return bookmarks_web_view; } -std::unique_ptr<views::View> SidePanelCoordinator::CreateReaderModeWebView( +std::unique_ptr<views::View> SidePanelCoordinator::CreateReadAnythingWebView( Browser* browser) { - return std::make_unique<SidePanelWebUIViewT<ReaderModeSidePanelUI>>( + return std::make_unique<SidePanelWebUIViewT<ReadAnythingSidePanelUI>>( browser, base::RepeatingClosure(), base::BindRepeating(&SidePanelCoordinator::Close, base::Unretained(this)), - std::make_unique<BubbleContentsWrapperT<ReaderModeSidePanelUI>>( - GURL(chrome::kChromeUIReaderModeSidePanelURL), browser->profile(), - IDS_READER_MODE_TITLE, + std::make_unique<BubbleContentsWrapperT<ReadAnythingSidePanelUI>>( + GURL(chrome::kChromeUIReadAnythingSidePanelURL), browser->profile(), + IDS_READ_ANYTHING_TITLE, /*webui_resizes_host=*/false, /*esc_closes_ui=*/false)); }
diff --git a/chrome/browser/ui/views/side_panel/side_panel_coordinator.h b/chrome/browser/ui/views/side_panel/side_panel_coordinator.h index 8fe8ff5..c146d10a 100644 --- a/chrome/browser/ui/views/side_panel/side_panel_coordinator.h +++ b/chrome/browser/ui/views/side_panel/side_panel_coordinator.h
@@ -68,7 +68,7 @@ void OnComboboxChanged(); std::unique_ptr<views::View> CreateBookmarksWebView(Browser* browser); - std::unique_ptr<views::View> CreateReaderModeWebView(Browser* browser); + std::unique_ptr<views::View> CreateReadAnythingWebView(Browser* browser); // SidePanelRegistryObserver: void OnEntryRegistered(SidePanelEntry* entry) override;
diff --git a/chrome/browser/ui/views/side_panel/side_panel_entry.h b/chrome/browser/ui/views/side_panel/side_panel_entry.h index d61aef4..b2e1d55 100644 --- a/chrome/browser/ui/views/side_panel/side_panel_entry.h +++ b/chrome/browser/ui/views/side_panel/side_panel_entry.h
@@ -20,7 +20,7 @@ class SidePanelEntry final { public: // Note this order matches that of the combobox options in the side panel. - enum class Id { kReadingList, kBookmarks, kReaderMode, kSideSearch, kLens }; + enum class Id { kReadingList, kBookmarks, kReadAnything, kSideSearch, kLens }; // TODO(pbos): Add an icon ImageModel here. SidePanelEntry(Id id,
diff --git a/chrome/browser/ui/views/side_search/default_search_icon_source.cc b/chrome/browser/ui/views/side_search/default_search_icon_source.cc index 34e1099..d929358 100644 --- a/chrome/browser/ui/views/side_search/default_search_icon_source.cc +++ b/chrome/browser/ui/views/side_search/default_search_icon_source.cc
@@ -23,6 +23,9 @@ if (auto* template_url_service = TemplateURLServiceFactory::GetForProfile(browser->profile())) { template_url_service_observation_.Observe(template_url_service); + + // Call this initially in case the default URL has already been set. + OnTemplateURLServiceChanged(); } } @@ -38,15 +41,22 @@ if (!default_template_url && default_template_url_id_ != kInvalidTemplateURLID) { default_template_url_id_ = kInvalidTemplateURLID; + favicon_url_ = GURL(); icon_changed_subscription_.Run(); + return; } - // Update the favicon only if the current default search provider has changed. + // Update the favicon only if the current default search provider or the + // favicon url has changed. The favicon url may update without the default + // search provider changing. if (!default_template_url || - default_template_url->id() == default_template_url_id_) + (default_template_url->id() == default_template_url_id_ && + default_template_url->favicon_url() == favicon_url_)) { return; + } default_template_url_id_ = default_template_url->id(); + favicon_url_ = default_template_url->favicon_url(); icon_changed_subscription_.Run(); }
diff --git a/chrome/browser/ui/views/side_search/default_search_icon_source.h b/chrome/browser/ui/views/side_search/default_search_icon_source.h index d0ef6760..5f39141 100644 --- a/chrome/browser/ui/views/side_search/default_search_icon_source.h +++ b/chrome/browser/ui/views/side_search/default_search_icon_source.h
@@ -10,6 +10,7 @@ #include "base/scoped_observation.h" #include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service_observer.h" +#include "url/gurl.h" class Browser; @@ -68,6 +69,11 @@ // we update the page action's favicon only when the default instance changes. TemplateURLID default_template_url_id_ = kInvalidTemplateURLID; + // The most recently seen favicon url of the default search provider. We keep + // track of this since the favicon url may change even if the default search + // provider does not itself change. + GURL favicon_url_; + base::ScopedObservation<TemplateURLService, TemplateURLServiceObserver> template_url_service_observation_{this};
diff --git a/chrome/browser/ui/views/side_search/side_search_browser_controller.cc b/chrome/browser/ui/views/side_search/side_search_browser_controller.cc index 0263d5a..6827eca 100644 --- a/chrome/browser/ui/views/side_search/side_search_browser_controller.cc +++ b/chrome/browser/ui/views/side_search/side_search_browser_controller.cc
@@ -112,11 +112,31 @@ SetBorder(views::CreateEmptyBorder( gfx::Insets(0, views::LayoutProvider::Get()->GetDistanceMetric( views::DISTANCE_RELATED_CONTROL_VERTICAL)))); + UpdateIconImage(); } ~DseImageView() override = default; void UpdateIconImage() { - SetImage(default_search_icon_source_.GetIconImage()); + // Attempt to get the default search engine's favicon. + auto icon_image = default_search_icon_source_.GetIconImage(); + + // Use the DSE's icon image if available. + if (!icon_image.IsEmpty()) { + SetImage(default_search_icon_source_.GetIconImage()); + return; + } + + // If the icon image is empty use kSearchIcon as a default. It is not + // guaranteed that the FaviconService will return a favicon for the search + // provider. + const int icon_size = + ui::TouchUiController::Get()->touch_ui() + ? kDefaultTouchableIconSize + : ChromeLayoutProvider::Get()->GetDistanceMetric( + ChromeDistanceMetric:: + DISTANCE_SIDE_PANEL_HEADER_VECTOR_ICON_SIZE); + SetImage(ui::ImageModel::FromVectorIcon(vector_icons::kSearchIcon, + ui::kColorIcon, icon_size)); } private:
diff --git a/chrome/browser/ui/views/side_search/side_search_icon_view.cc b/chrome/browser/ui/views/side_search/side_search_icon_view.cc index 1235ff9d..6a8789e 100644 --- a/chrome/browser/ui/views/side_search/side_search_icon_view.cc +++ b/chrome/browser/ui/views/side_search/side_search_icon_view.cc
@@ -69,7 +69,8 @@ } const gfx::VectorIcon& SideSearchIconView::GetVectorIcon() const { - return gfx::kNoneIcon; + // Default to the kSearchIcon if the DSE icon image is not available. + return vector_icons::kSearchIcon; } ui::ImageModel SideSearchIconView::GetSizedIconImage(int size) const {
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 3fcb95a..f62311cd 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -151,7 +151,7 @@ #include "chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_dialog_ui.h" #include "chrome/browser/ui/webui/read_later/read_later_ui.h" #include "chrome/browser/ui/webui/read_later/side_panel/bookmarks_side_panel_ui.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h" #include "chrome/browser/ui/webui/settings/settings_ui.h" #include "chrome/browser/ui/webui/settings/settings_utils.h" #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" @@ -853,9 +853,9 @@ } if (url.host_piece() == chrome::kChromeUIBookmarksSidePanelHost) return &NewWebUI<BookmarksSidePanelUI>; - if (features::IsReaderModeSidePanelEnabled()) { - if (url.host_piece() == chrome::kChromeUIReaderModeSidePanelHost) - return &NewWebUI<ReaderModeSidePanelUI>; + if (features::IsReadAnythingEnabled()) { + if (url.host_piece() == chrome::kChromeUIReadAnythingSidePanelHost) + return &NewWebUI<ReadAnythingSidePanelUI>; } // Settings are implemented with native UI elements on Android. if (url.host_piece() == chrome::kChromeUISettingsHost)
diff --git a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc index 696a908..4aeffea 100644 --- a/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc +++ b/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
@@ -19,6 +19,7 @@ #include "chrome/grit/bluetooth_pairing_dialog_resources.h" #include "chrome/grit/bluetooth_pairing_dialog_resources_map.h" #include "chrome/grit/generated_resources.h" +#include "components/session_manager/core/session_manager.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" @@ -97,6 +98,14 @@ } else { CHECK(ash::features::IsBluetoothRevampEnabled()); } + + if (!ash::features::IsBluetoothRevampEnabled()) + return; + + device_data_.SetBoolKey( + "shouldOmitLinks", + session_manager::SessionManager::Get()->session_state() != + session_manager::SessionState::ACTIVE); } BluetoothPairingDialog::~BluetoothPairingDialog() = default;
diff --git a/chrome/browser/ui/webui/chromeos/bluetooth_shared_load_time_data_provider.cc b/chrome/browser/ui/webui/chromeos/bluetooth_shared_load_time_data_provider.cc index 5752e409..3c3b4c1f 100644 --- a/chrome/browser/ui/webui/chromeos/bluetooth_shared_load_time_data_provider.cc +++ b/chrome/browser/ui/webui/chromeos/bluetooth_shared_load_time_data_provider.cc
@@ -63,6 +63,7 @@ {"bluetoothA11yDeviceTypeMouse", IDS_BLUETOOTH_A11Y_DEVICE_TYPE_MOUSE}, {"bluetoothA11yDeviceTypeTablet", IDS_BLUETOOTH_A11Y_DEVICE_TYPE_TABLET}, {"bluetoothA11yDeviceName", IDS_BLUETOOTH_A11Y_DEVICE_NAME}, + {"bluetoothPairingDescription", IDS_BLUETOOTH_PAIRING_DESCRIPTION}, {"bluetoothPairingDeviceItemSecondaryErrorA11YLabel", IDS_BLUETOOTH_PAIRINGS_DEVICE_ITEM_SECONDARY_ERROR_A11Y_LABEL}, {"bluetoothPairingDeviceItemSecondaryPairingA11YLabel",
diff --git a/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h b/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h index 470a4d9..46818d34 100644 --- a/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h +++ b/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/network_settings_dialog.h
@@ -46,4 +46,9 @@ } // namespace cfm } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash::cfm { +using ::chromeos::cfm::NetworkSettingsDialog; +} + #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_CHROMEBOX_FOR_MEETINGS_NETWORK_SETTINGS_DIALOG_H_
diff --git a/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc b/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc index 791b9f7..aec4990 100644 --- a/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc +++ b/chrome/browser/ui/webui/management/management_ui_handler_unittest.cc
@@ -39,6 +39,7 @@ #include "ui/base/l10n/l10n_util.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/stub_install_attributes.h" #include "base/files/file_path.h" #include "base/test/test_simple_task_runner.h" #include "base/time/time.h" @@ -70,7 +71,6 @@ #include "chromeos/network/proxy/proxy_config_handler.h" #include "chromeos/network/proxy/ui_proxy_config_service.h" #include "chromeos/system/fake_statistics_provider.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/enterprise/browser/reporting/common_pref_names.h" #include "components/onc/onc_pref_names.h"
diff --git a/chrome/browser/ui/webui/read_later/read_later_ui.cc b/chrome/browser/ui/webui/read_later/read_later_ui.cc index 3473c2e..d314b21f 100644 --- a/chrome/browser/ui/webui/read_later/read_later_ui.cc +++ b/chrome/browser/ui/webui/read_later/read_later_ui.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/browser/ui/webui/read_later/read_later_page_handler.h" #include "chrome/browser/ui/webui/read_later/side_panel/bookmarks_page_handler.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.h" #include "chrome/browser/ui/webui/webui_util.h" #include "chrome/common/webui_url_constants.h" #include "chrome/grit/generated_resources.h" @@ -50,7 +50,7 @@ IDS_READ_LATER_MENU_EMPTY_STATE_ADD_FROM_DIALOG_SUBHEADER}, {"emptyStateHeader", IDS_READ_LATER_MENU_EMPTY_STATE_HEADER}, {"emptyStateSubheader", IDS_READ_LATER_MENU_EMPTY_STATE_SUBHEADER}, - {"readerModeTabTitle", IDS_READER_MODE_TITLE}, + {"readAnythingTabTitle", IDS_READ_ANYTHING_TITLE}, {"readHeader", IDS_READ_LATER_MENU_READ_HEADER}, {"title", IDS_READ_LATER_TITLE}, {"sidePanelTitle", IDS_SIDE_PANEL_TITLE}, @@ -86,8 +86,7 @@ "hasUnseenReadingListEntries", reading_list_model->loaded() ? reading_list_model->unseen_size() : false); - source->AddBoolean("readerModeSidePanelEnabled", - features::IsReaderModeSidePanelEnabled()); + source->AddBoolean("readAnythingEnabled", features::IsReadAnythingEnabled()); source->AddBoolean("unifiedSidePanel", base::FeatureList::IsEnabled(features::kUnifiedSidePanel)); @@ -137,16 +136,16 @@ } void ReadLaterUI::BindInterface( - mojo::PendingReceiver<reader_mode::mojom::PageHandlerFactory> receiver) { - reader_mode_page_factory_receiver_.reset(); - reader_mode_page_factory_receiver_.Bind(std::move(receiver)); + mojo::PendingReceiver<read_anything::mojom::PageHandlerFactory> receiver) { + read_anything_page_factory_receiver_.reset(); + read_anything_page_factory_receiver_.Bind(std::move(receiver)); } void ReadLaterUI::CreatePageHandler( - mojo::PendingRemote<reader_mode::mojom::Page> page, - mojo::PendingReceiver<reader_mode::mojom::PageHandler> receiver) { + mojo::PendingRemote<read_anything::mojom::Page> page, + mojo::PendingReceiver<read_anything::mojom::PageHandler> receiver) { DCHECK(page); - reader_mode_page_handler_ = std::make_unique<ReaderModePageHandler>( + read_anything_page_handler_ = std::make_unique<ReadAnythingPageHandler>( std::move(page), std::move(receiver)); }
diff --git a/chrome/browser/ui/webui/read_later/read_later_ui.h b/chrome/browser/ui/webui/read_later/read_later_ui.h index 797e0b78..72e1872 100644 --- a/chrome/browser/ui/webui/read_later/read_later_ui.h +++ b/chrome/browser/ui/webui/read_later/read_later_ui.h
@@ -9,7 +9,7 @@ #include "chrome/browser/ui/webui/read_later/read_later.mojom.h" #include "chrome/browser/ui/webui/read_later/side_panel/bookmarks.mojom.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode.mojom.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything.mojom.h" #include "chrome/browser/ui/webui/webui_load_timer.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -17,13 +17,13 @@ #include "ui/webui/mojo_bubble_web_ui_controller.h" class BookmarksPageHandler; -class ReaderModePageHandler; +class ReadAnythingPageHandler; class ReadLaterPageHandler; class ReadLaterUI : public ui::MojoBubbleWebUIController, public read_later::mojom::PageHandlerFactory, public side_panel::mojom::BookmarksPageHandlerFactory, - public reader_mode::mojom::PageHandlerFactory { + public read_anything::mojom::PageHandlerFactory { public: explicit ReadLaterUI(content::WebUI* web_ui); ReadLaterUI(const ReadLaterUI&) = delete; @@ -40,7 +40,7 @@ receiver); void BindInterface( - mojo::PendingReceiver<reader_mode::mojom::PageHandlerFactory> receiver); + mojo::PendingReceiver<read_anything::mojom::PageHandlerFactory> receiver); void SetActiveTabURL(const GURL& url); @@ -55,10 +55,11 @@ mojo::PendingReceiver<side_panel::mojom::BookmarksPageHandler> receiver) override; - // reader_mode::mojom::PageHandlerFactory: + // read_anything::mojom::PageHandlerFactory: void CreatePageHandler( - mojo::PendingRemote<reader_mode::mojom::Page> page, - mojo::PendingReceiver<reader_mode::mojom::PageHandler> receiver) override; + mojo::PendingRemote<read_anything::mojom::Page> page, + mojo::PendingReceiver<read_anything::mojom::PageHandler> receiver) + override; std::unique_ptr<ReadLaterPageHandler> page_handler_; mojo::Receiver<read_later::mojom::PageHandlerFactory> page_factory_receiver_{ @@ -68,9 +69,9 @@ mojo::Receiver<side_panel::mojom::BookmarksPageHandlerFactory> bookmarks_page_factory_receiver_{this}; - std::unique_ptr<ReaderModePageHandler> reader_mode_page_handler_; - mojo::Receiver<reader_mode::mojom::PageHandlerFactory> - reader_mode_page_factory_receiver_{this}; + std::unique_ptr<ReadAnythingPageHandler> read_anything_page_handler_; + mojo::Receiver<read_anything::mojom::PageHandlerFactory> + read_anything_page_factory_receiver_{this}; WebuiLoadTimer webui_load_timer_;
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/BUILD.gn b/chrome/browser/ui/webui/read_later/side_panel/read_anything/BUILD.gn similarity index 88% rename from chrome/browser/ui/webui/read_later/side_panel/reader_mode/BUILD.gn rename to chrome/browser/ui/webui/read_later/side_panel/read_anything/BUILD.gn index a353e06..66c05e4 100644 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/BUILD.gn +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/BUILD.gn
@@ -5,7 +5,7 @@ import("//mojo/public/tools/bindings/mojom.gni") mojom("mojo_bindings") { - sources = [ "reader_mode.mojom" ] + sources = [ "read_anything.mojom" ] webui_module_path = "/" public_deps = [ "//mojo/public/mojom/base" ] }
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/OWNERS b/chrome/browser/ui/webui/read_later/side_panel/read_anything/OWNERS similarity index 84% rename from chrome/browser/ui/webui/read_later/side_panel/reader_mode/OWNERS rename to chrome/browser/ui/webui/read_later/side_panel/read_anything/OWNERS index 267d0fc..f41f529 100644 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/OWNERS +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/OWNERS
@@ -1,5 +1,6 @@ abigailbklein@google.com dtseng@chromium.org +mschillaci@google.com per-file *.mojom=set noparent per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode.mojom b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything.mojom similarity index 83% rename from chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode.mojom rename to chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything.mojom index 88cdd77..ce32afd 100644 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode.mojom +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything.mojom
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// A module for a prototype of the Reader Mode feature. -module reader_mode.mojom; +// A module for a prototype of the Read Anything feature. +module read_anything.mojom; // Used by the WebUI page to bootstrap bidirectional communication. interface PageHandlerFactory { @@ -20,7 +20,7 @@ // WebUI-side handler for requests from the browser. interface Page { - // Trigger the frontend to update the current reader mode display. Essential + // Trigger the frontend to update the current read anything display. Essential // content is a list of paragraphs from a web page, where each paragraph is // considered essential (is part of the main content of the web page). OnEssentialContent(array<string> essential_content);
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.cc b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.cc similarity index 78% rename from chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.cc rename to chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.cc index e5a2c52..c47d0f83 100644 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.cc +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.h" #include <algorithm> #include <queue> @@ -77,31 +77,31 @@ } // namespace -ReaderModePageHandler::ReaderModePageHandler( - mojo::PendingRemote<reader_mode::mojom::Page> page, - mojo::PendingReceiver<reader_mode::mojom::PageHandler> receiver) +ReadAnythingPageHandler::ReadAnythingPageHandler( + mojo::PendingRemote<read_anything::mojom::Page> page, + mojo::PendingReceiver<read_anything::mojom::PageHandler> receiver) : receiver_(this, std::move(receiver)), page_(std::move(page)) {} -ReaderModePageHandler::~ReaderModePageHandler() = default; +ReadAnythingPageHandler::~ReadAnythingPageHandler() = default; -void ReaderModePageHandler::ShowUI() { +void ReadAnythingPageHandler::ShowUI() { Browser* browser = chrome::FindLastActive(); if (!browser) return; content::WebContents* web_contents = browser->tab_strip_model()->GetActiveWebContents(); - // Get page contents (via snapshot of a11y tree) for reader generation. + // Get page contents (via snapshot of a11y tree) for read anything generation. // This will include subframe content for any subframes loaded at this point. web_contents->RequestAXTreeSnapshot( - base::BindOnce(&ReaderModePageHandler::CombineTextNodesAndMakeCallback, + base::BindOnce(&ReadAnythingPageHandler::CombineTextNodesAndMakeCallback, weak_pointer_factory_.GetWeakPtr()), ui::AXMode::kWebContents, /* exclude_offscreen= */ false, kMaxNodes, /* timeout= */ {}); } -void ReaderModePageHandler::CombineTextNodesAndMakeCallback( +void ReadAnythingPageHandler::CombineTextNodesAndMakeCallback( const ui::AXTreeUpdate& update) { ui::AXTree tree; bool success = tree.Unserialize(update); @@ -109,14 +109,14 @@ return; // If this page has an article node, only combine text from that node. - const ui::AXNode* reader_root = GetArticleNode(tree.root()); - if (!reader_root) { - reader_root = tree.root(); + const ui::AXNode* read_anything_root = GetArticleNode(tree.root()); + if (!read_anything_root) { + read_anything_root = tree.root(); } std::vector<std::string> text_node_contents; text_node_contents.reserve(update.nodes.size()); - AddTextNodesToVector(reader_root, &text_node_contents); + AddTextNodesToVector(read_anything_root, &text_node_contents); page_->OnEssentialContent(std::move(text_node_contents)); }
diff --git a/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.h b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.h new file mode 100644 index 0000000..0c9d9c6 --- /dev/null +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.h
@@ -0,0 +1,39 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_PAGE_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_PAGE_HANDLER_H_ + +#include "base/memory/weak_ptr.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace ui { +struct AXTreeUpdate; +} + +class ReadAnythingPageHandler : public read_anything::mojom::PageHandler { + public: + explicit ReadAnythingPageHandler( + mojo::PendingRemote<read_anything::mojom::Page> page, + mojo::PendingReceiver<read_anything::mojom::PageHandler> receiver); + ReadAnythingPageHandler(const ReadAnythingPageHandler&) = delete; + ReadAnythingPageHandler& operator=(const ReadAnythingPageHandler&) = delete; + ~ReadAnythingPageHandler() override; + + // read_anything::mojom::PageHandler: + void ShowUI() override; + + private: + void CombineTextNodesAndMakeCallback(const ui::AXTreeUpdate& update); + + mojo::Receiver<read_anything::mojom::PageHandler> receiver_; + mojo::Remote<read_anything::mojom::Page> page_; + base::WeakPtrFactory<ReadAnythingPageHandler> weak_pointer_factory_{this}; +}; + +#endif // CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_PAGE_HANDLER_H_
diff --git a/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.cc b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.cc new file mode 100644 index 0000000..c81eaab1 --- /dev/null +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.cc
@@ -0,0 +1,59 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h" + +#include <string> +#include <utility> + +#include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_page_handler.h" +#include "chrome/browser/ui/webui/webui_util.h" +#include "chrome/common/webui_url_constants.h" +#include "chrome/grit/generated_resources.h" +#include "chrome/grit/read_later_resources.h" +#include "chrome/grit/read_later_resources_map.h" +#include "components/strings/grit/components_strings.h" +#include "content/public/browser/web_contents.h" +#include "content/public/browser/web_ui.h" +#include "content/public/browser/web_ui_data_source.h" +#include "ui/accessibility/accessibility_features.h" +#include "ui/base/webui/web_ui_util.h" +#include "ui/views/style/platform_style.h" + +ReadAnythingSidePanelUI::ReadAnythingSidePanelUI(content::WebUI* web_ui) + : ui::MojoBubbleWebUIController(web_ui) { + content::WebUIDataSource* source = content::WebUIDataSource::Create( + chrome::kChromeUIReadAnythingSidePanelHost); + static constexpr webui::LocalizedString kLocalizedStrings[] = { + {"readAnythingTabTitle", IDS_READ_ANYTHING_TITLE}, + }; + for (const auto& str : kLocalizedStrings) + webui::AddLocalizedString(source, str.name, str.id); + + webui::SetupWebUIDataSource( + source, base::make_span(kReadLaterResources, kReadLaterResourcesSize), + IDR_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_HTML); + content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), + source); +} + +ReadAnythingSidePanelUI::~ReadAnythingSidePanelUI() = default; + +WEB_UI_CONTROLLER_TYPE_IMPL(ReadAnythingSidePanelUI) + +void ReadAnythingSidePanelUI::BindInterface( + mojo::PendingReceiver<read_anything::mojom::PageHandlerFactory> receiver) { + read_anything_page_factory_receiver_.reset(); + read_anything_page_factory_receiver_.Bind(std::move(receiver)); +} +void ReadAnythingSidePanelUI::CreatePageHandler( + mojo::PendingRemote<read_anything::mojom::Page> page, + mojo::PendingReceiver<read_anything::mojom::PageHandler> receiver) { + DCHECK(page); + read_anything_page_handler_ = std::make_unique<ReadAnythingPageHandler>( + std::move(page), std::move(receiver)); + if (embedder()) + embedder()->ShowUI(); +}
diff --git a/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h new file mode 100644 index 0000000..e9b59f0 --- /dev/null +++ b/chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything_side_panel_ui.h
@@ -0,0 +1,46 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_SIDE_PANEL_UI_H_ +#define CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_SIDE_PANEL_UI_H_ + +#include <memory> + +#include "chrome/browser/ui/webui/read_later/side_panel/read_anything/read_anything.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "ui/webui/mojo_bubble_web_ui_controller.h" + +class ReadAnythingPageHandler; + +class ReadAnythingSidePanelUI + : public ui::MojoBubbleWebUIController, + public read_anything::mojom::PageHandlerFactory { + public: + explicit ReadAnythingSidePanelUI(content::WebUI* web_ui); + ReadAnythingSidePanelUI(const ReadAnythingSidePanelUI&) = delete; + ReadAnythingSidePanelUI& operator=(const ReadAnythingSidePanelUI&) = delete; + ~ReadAnythingSidePanelUI() override; + + // Instantiates the implementor of the mojom::PageHandlerFactory mojo + // interface passing the pending receiver that will be internally bound. + void BindInterface( + mojo::PendingReceiver<read_anything::mojom::PageHandlerFactory> receiver); + + private: + // read_anything::mojom::PageHandlerFactory: + void CreatePageHandler( + mojo::PendingRemote<read_anything::mojom::Page> page, + mojo::PendingReceiver<read_anything::mojom::PageHandler> receiver) + override; + + std::unique_ptr<ReadAnythingPageHandler> read_anything_page_handler_; + mojo::Receiver<read_anything::mojom::PageHandlerFactory> + read_anything_page_factory_receiver_{this}; + + WEB_UI_CONTROLLER_TYPE_DECL(); +}; + +#endif // CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READ_ANYTHING_READ_ANYTHING_SIDE_PANEL_UI_H_
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h b/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h deleted file mode 100644 index dc7b3ba..0000000 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h +++ /dev/null
@@ -1,39 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_PAGE_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_PAGE_HANDLER_H_ - -#include "base/memory/weak_ptr.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode.mojom.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "mojo/public/cpp/bindings/remote.h" - -namespace ui { -struct AXTreeUpdate; -} - -class ReaderModePageHandler : public reader_mode::mojom::PageHandler { - public: - explicit ReaderModePageHandler( - mojo::PendingRemote<reader_mode::mojom::Page> page, - mojo::PendingReceiver<reader_mode::mojom::PageHandler> receiver); - ReaderModePageHandler(const ReaderModePageHandler&) = delete; - ReaderModePageHandler& operator=(const ReaderModePageHandler&) = delete; - ~ReaderModePageHandler() override; - - // reader_mode::mojom::PageHandler: - void ShowUI() override; - - private: - void CombineTextNodesAndMakeCallback(const ui::AXTreeUpdate& update); - - mojo::Receiver<reader_mode::mojom::PageHandler> receiver_; - mojo::Remote<reader_mode::mojom::Page> page_; - base::WeakPtrFactory<ReaderModePageHandler> weak_pointer_factory_{this}; -}; - -#endif // CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_PAGE_HANDLER_H_
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.cc b/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.cc deleted file mode 100644 index 38bfdb16..0000000 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.cc +++ /dev/null
@@ -1,59 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h" - -#include <string> -#include <utility> - -#include "chrome/browser/ui/ui_features.h" -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_page_handler.h" -#include "chrome/browser/ui/webui/webui_util.h" -#include "chrome/common/webui_url_constants.h" -#include "chrome/grit/generated_resources.h" -#include "chrome/grit/read_later_resources.h" -#include "chrome/grit/read_later_resources_map.h" -#include "components/strings/grit/components_strings.h" -#include "content/public/browser/web_contents.h" -#include "content/public/browser/web_ui.h" -#include "content/public/browser/web_ui_data_source.h" -#include "ui/accessibility/accessibility_features.h" -#include "ui/base/webui/web_ui_util.h" -#include "ui/views/style/platform_style.h" - -ReaderModeSidePanelUI::ReaderModeSidePanelUI(content::WebUI* web_ui) - : ui::MojoBubbleWebUIController(web_ui) { - content::WebUIDataSource* source = content::WebUIDataSource::Create( - chrome::kChromeUIReaderModeSidePanelHost); - static constexpr webui::LocalizedString kLocalizedStrings[] = { - {"readerModeTabTitle", IDS_READER_MODE_TITLE}, - }; - for (const auto& str : kLocalizedStrings) - webui::AddLocalizedString(source, str.name, str.id); - - webui::SetupWebUIDataSource( - source, base::make_span(kReadLaterResources, kReadLaterResourcesSize), - IDR_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_HTML); - content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), - source); -} - -ReaderModeSidePanelUI::~ReaderModeSidePanelUI() = default; - -WEB_UI_CONTROLLER_TYPE_IMPL(ReaderModeSidePanelUI) - -void ReaderModeSidePanelUI::BindInterface( - mojo::PendingReceiver<reader_mode::mojom::PageHandlerFactory> receiver) { - reader_mode_page_factory_receiver_.reset(); - reader_mode_page_factory_receiver_.Bind(std::move(receiver)); -} -void ReaderModeSidePanelUI::CreatePageHandler( - mojo::PendingRemote<reader_mode::mojom::Page> page, - mojo::PendingReceiver<reader_mode::mojom::PageHandler> receiver) { - DCHECK(page); - reader_mode_page_handler_ = std::make_unique<ReaderModePageHandler>( - std::move(page), std::move(receiver)); - if (embedder()) - embedder()->ShowUI(); -}
diff --git a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h b/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h deleted file mode 100644 index c2fc150b..0000000 --- a/chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode_side_panel_ui.h +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2022 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_SIDE_PANEL_UI_H_ -#define CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_SIDE_PANEL_UI_H_ - -#include <memory> - -#include "chrome/browser/ui/webui/read_later/side_panel/reader_mode/reader_mode.mojom.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver.h" -#include "ui/webui/mojo_bubble_web_ui_controller.h" - -class ReaderModePageHandler; - -class ReaderModeSidePanelUI : public ui::MojoBubbleWebUIController, - public reader_mode::mojom::PageHandlerFactory { - public: - explicit ReaderModeSidePanelUI(content::WebUI* web_ui); - ReaderModeSidePanelUI(const ReaderModeSidePanelUI&) = delete; - ReaderModeSidePanelUI& operator=(const ReaderModeSidePanelUI&) = delete; - ~ReaderModeSidePanelUI() override; - - // Instantiates the implementor of the mojom::PageHandlerFactory mojo - // interface passing the pending receiver that will be internally bound. - void BindInterface( - mojo::PendingReceiver<reader_mode::mojom::PageHandlerFactory> receiver); - - private: - // reader_mode::mojom::PageHandlerFactory: - void CreatePageHandler( - mojo::PendingRemote<reader_mode::mojom::Page> page, - mojo::PendingReceiver<reader_mode::mojom::PageHandler> receiver) override; - - std::unique_ptr<ReaderModePageHandler> reader_mode_page_handler_; - mojo::Receiver<reader_mode::mojom::PageHandlerFactory> - reader_mode_page_factory_receiver_{this}; - - WEB_UI_CONTROLLER_TYPE_DECL(); -}; - -#endif // CHROME_BROWSER_UI_WEBUI_READ_LATER_SIDE_PANEL_READER_MODE_READER_MODE_SIDE_PANEL_UI_H_
diff --git a/chrome/browser/ui/webui/settings/chromeos/DEPS b/chrome/browser/ui/webui/settings/chromeos/DEPS index 130f889..14daad8 100644 --- a/chrome/browser/ui/webui/settings/chromeos/DEPS +++ b/chrome/browser/ui/webui/settings/chromeos/DEPS
@@ -2,7 +2,6 @@ "+ash/components/peripheral_notification", "+components/account_manager_core", "+chrome/services/local_search_service", - "+chromeos/tpm:tpm", "+device/udev_linux/fake_udev_loader.h", # For keyboard unit test. ]
diff --git a/chrome/browser/ui/webui/settings/chromeos/peripheral_data_access_handler.cc b/chrome/browser/ui/webui/settings/chromeos/peripheral_data_access_handler.cc index d336ee5..3905c24 100644 --- a/chrome/browser/ui/webui/settings/chromeos/peripheral_data_access_handler.cc +++ b/chrome/browser/ui/webui/settings/chromeos/peripheral_data_access_handler.cc
@@ -9,6 +9,7 @@ #include "ash/components/peripheral_notification/peripheral_notification_manager.h" #include "ash/components/settings/cros_settings_names.h" +#include "ash/components/tpm/install_attributes.h" #include "ash/constants/ash_pref_names.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -20,7 +21,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/settings/chromeos/os_settings_features_util.h" #include "chromeos/dbus/pciguard/pciguard_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index b21d364..3a8f5e4 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -873,7 +873,7 @@ content::WebContents* web_contents) { static constexpr webui::LocalizedString kLocalizedStrings[] = { {"autofillPageTitle", IDS_SETTINGS_AUTOFILL}, - {"passwords", IDS_SETTINGS_PASSWORDS}, + {"passwordsDescription", IDS_SETTINGS_PASSWORD_MANAGER_DESCRIPTION}, {"passwordsDevice", IDS_SETTINGS_DEVICE_PASSWORDS}, {"checkPasswords", IDS_SETTINGS_CHECK_PASSWORDS}, {"checkPasswordsCanceled", IDS_SETTINGS_CHECK_PASSWORDS_CANCELED}, @@ -1126,6 +1126,15 @@ {"unenrollVirtualCardDialogConfirm", IDS_AUTOFILL_VIRTUAL_CARD_UNENROLL_DIALOG_CONFIRM_BUTTON_LABEL}}; + bool unifiedPasswordManagerEnabled = base::FeatureList::IsEnabled( + password_manager::features::kUnifiedPasswordManagerDesktop); + html_source->AddBoolean("unifiedPasswordManagerEnabled", + unifiedPasswordManagerEnabled); + html_source->AddString( + "passwords", l10n_util::GetStringUTF16(unifiedPasswordManagerEnabled + ? IDS_SETTINGS_PASSWORD_MANAGER + : IDS_SETTINGS_PASSWORDS)); + GURL google_password_manager_url = GetGooglePasswordManagerURL( password_manager::ManagePasswordsReferrer::kChromeSettings);
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 7d7c79f..ad694576 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1647604379-4659adbcb89e3313f9b9bb5d6a35e7f4c78d7573.profdata +chrome-linux-main-1647647847-90e8666ab9396c99b004403ee36b3d84421be818.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index d1af8a3..c3fda5e 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1647604379-78700c750a15a2472b8201eff336583a43ad72ff.profdata +chrome-mac-arm-main-1647647847-c8b44207efa851f522c24b988cfddc722afa4476.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index da0b99d..0f4f73a0 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1647604379-24bb3d5266972ce87702b39862f29f6a869a3062.profdata +chrome-mac-main-1647647847-91e1c3fe27022c6d94f8135dc83af586303ee54b.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 4488ae12..4e56c5b 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1647615131-2da567b73a28d4f77a4e7953b6d3e66ec7e1079f.profdata +chrome-win32-main-1647647847-598a01bcca65395c54f3e2bf4fa0c5c3409e7e1d.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 87645d6..87c9dcd 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1647615131-b9dde0dd2e55d0974d2fb79d0ff2754df8fdbf6b.profdata +chrome-win64-main-1647636991-8015ad0d2dcf766ffc3b67a9b4867361d1f7a3e4.profdata
diff --git a/chrome/common/extensions/api/accessibility_private.json b/chrome/common/extensions/api/accessibility_private.json index f38508e..51aa677 100644 --- a/chrome/common/extensions/api/accessibility_private.json +++ b/chrome/common/extensions/api/accessibility_private.json
@@ -89,7 +89,7 @@ { "id": "SwitchAccessMenuAction", "type": "string", - "enum": [ "copy", "cut", "decrement", "dictation", "endTextSelection", "increment", "itemScan", "jumpToBeginningOfText", "jumpToEndOfText", "keyboard", "leftClick", "moveBackwardOneCharOfText", "moveBackwardOneWordOfText", "moveCursor", "moveDownOneLineOfText", "moveForwardOneCharOfText", "moveForwardOneWordOfText", "moveUpOneLineOfText", "paste", "pointScan", "rightClick", "scrollDown", "scrollLeft", "scrollRight", "scrollUp", "select", "settings", "startTextSelection", "shortcuts", "leaveGroup", "webMenu", "webBookmark", "webBottomOfPage", "webTopOfPage", "webFindInPage", "webDownloads", "webClearHistory", "systemMenu", "systemStatusBar", "systemLauncher", "systemTaskManager", "systemDiagnostics", "systemScreenshot", "systemHelp", "mediaMenu", "mediaMute", "mediaVolumeDown", "mediaVolumeUp", "mediaRewind", "mediaPlayPause", "mediaFastforward", "displayMenu", "displayMirror", "displayBrightnessDown", "displayBrightnessUp", "displayRotate", "displayZoomOut", "displayZoomIn", "userMenu", "userLock", "userPreviousUser", "userNextUser", "userSignOut", "actionRecorder", "startRecording", "stopRecording", "executeMacro"], + "enum": [ "copy", "cut", "decrement", "dictation", "endTextSelection", "increment", "itemScan", "jumpToBeginningOfText", "jumpToEndOfText", "keyboard", "leftClick", "moveBackwardOneCharOfText", "moveBackwardOneWordOfText", "moveCursor", "moveDownOneLineOfText", "moveForwardOneCharOfText", "moveForwardOneWordOfText", "moveUpOneLineOfText", "paste", "pointScan", "rightClick", "scrollDown", "scrollLeft", "scrollRight", "scrollUp", "select", "settings", "startTextSelection" ], "description": "Available actions to be shown in the Switch Access menu. Must be kept in sync with the strings in ash/system/accessibility/switch_access/switch_access_menu_view.cc" }, {
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index fc52954..4eef000 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -3127,10 +3127,6 @@ "profile.sandbox_external_protocol_blocked"; #if BUILDFLAG(IS_LINUX) -// Boolean that indicates if native notifications are allowed to be used in -// place of Chrome notifications. Will be replaced by kAllowSystemNotifications. -const char kAllowNativeNotifications[] = "native_notifications.allowed"; - // Boolean that indicates if system notifications are allowed to be used in // place of Chrome notifications. const char kAllowSystemNotifications[] = "system_notifications.allowed";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index d430931b..4a39d7cd 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -1070,7 +1070,6 @@ extern const char kSandboxExternalProtocolBlocked[]; #if BUILDFLAG(IS_LINUX) -extern const char kAllowNativeNotifications[]; extern const char kAllowSystemNotifications[]; #endif
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index 9d36967..15a735bc 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc
@@ -238,10 +238,10 @@ "bookmarks-side-panel.top-chrome"; const char kChromeUIBookmarksSidePanelURL[] = "chrome://bookmarks-side-panel.top-chrome/"; -const char kChromeUIReaderModeSidePanelHost[] = - "reader-mode-side-panel.top-chrome"; -const char kChromeUIReaderModeSidePanelURL[] = - "chrome://reader-mode-side-panel.top-chrome/"; +const char kChromeUIReadAnythingSidePanelHost[] = + "read-anything-side-panel.top-chrome"; +const char kChromeUIReadAnythingSidePanelURL[] = + "chrome://read-anything-side-panel.top-chrome/"; const char kChromeUIReadLaterHost[] = "read-later.top-chrome"; const char kChromeUIReadLaterURL[] = "chrome://read-later.top-chrome/"; const char kChromeUIWebAppInternalsHost[] = "web-app-internals";
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h index f6d491d..e36bb12 100644 --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h
@@ -228,8 +228,8 @@ extern const char kChromeUINearbyInternalsHost[]; extern const char kChromeUIBookmarksSidePanelHost[]; extern const char kChromeUIBookmarksSidePanelURL[]; -extern const char kChromeUIReaderModeSidePanelHost[]; -extern const char kChromeUIReaderModeSidePanelURL[]; +extern const char kChromeUIReadAnythingSidePanelHost[]; +extern const char kChromeUIReadAnythingSidePanelURL[]; extern const char kChromeUIReadLaterHost[]; extern const char kChromeUIReadLaterURL[]; extern const char kChromeUIWebAppInternalsHost[];
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 8d1e1afa..5f18dd7 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -513,6 +513,8 @@ "//ash:test_support", "//ash/components/account_manager", "//ash/components/settings", + "//ash/components/tpm", + "//ash/components/tpm:test_support", "//ash/constants", "//ash/public/cpp:test_support", "//chrome/browser/chromeos", @@ -520,8 +522,6 @@ "//chromeos/dbus/tpm_manager", "//chromeos/dbus/userdataauth", "//chromeos/login/login_state", - "//chromeos/tpm", - "//chromeos/tpm:test_support", "//components/exo", "//components/ownership", "//components/user_manager:test_support", @@ -4663,7 +4663,12 @@ } if (!is_android) { - data_deps += [ "//chrome/test:performance_browser_tests" ] + if (is_chromeos_lacros) { + # Work around crbug/1299041 + data_deps += [ "//testing:run_perf_test" ] + } else { + data_deps += [ "//chrome/test:performance_browser_tests" ] + } } if (!is_ios && !is_fuchsia && !is_android) {
diff --git a/chrome/test/base/browser_with_test_window_test.h b/chrome/test/base/browser_with_test_window_test.h index a7c6997..0b4c70a 100644 --- a/chrome/test/base/browser_with_test_window_test.h +++ b/chrome/test/base/browser_with_test_window_test.h
@@ -23,10 +23,10 @@ #include "chrome/test/views/chrome_test_views_delegate.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/tpm/stub_install_attributes.h" #include "ash/test/ash_test_helper.h" #include "ash/test/ash_test_views_delegate.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" -#include "chromeos/tpm/stub_install_attributes.h" #else #include "ui/views/test/scoped_views_test_helper.h" #endif
diff --git a/chrome/test/data/webui/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page_test.js b/chrome/test/data/webui/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page_test.js index 153c11b5..a768a8d 100644 --- a/chrome/test/data/webui/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page_test.js
@@ -73,12 +73,23 @@ deviceSelectionPage.shadowRoot.querySelector('bluetooth-base-page'); assertTrue(getBasePage().showScanProgress); - const learnMoreLink = + const getLearnMoreLink = () => deviceSelectionPage.shadowRoot.querySelector('localized-link'); - assertTrue(!!learnMoreLink); + assertTrue(!!getLearnMoreLink()); assertEquals( - learnMoreLink.localizedString, + getLearnMoreLink().localizedString, deviceSelectionPage.i18nAdvanced('bluetoothPairingLearnMoreLabel')); + + const getLearnMoreDescription = () => + deviceSelectionPage.shadowRoot.querySelector('#learn-more-description'); + assertFalse(!!getLearnMoreDescription()); + + deviceSelectionPage.shouldOmitLinks = true; + await flushAsync(); + + assertTrue(!!getLearnMoreDescription); + assertFalse(!!getLearnMoreLink()); + // No lists should be showing at first. assertFalse(!!getDeviceList()); assertTrue(!!getDeviceListTitle());
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn index 120c3f2..503e7ffb 100644 --- a/chromeos/BUILD.gn +++ b/chromeos/BUILD.gn
@@ -76,7 +76,6 @@ "//chromeos/dbus:test_support", "//chromeos/login/login_state:test_support", "//chromeos/network:test_support", - "//chromeos/tpm:test_support", "//google_apis", "//net:test_support", "//services/network:test_support", @@ -126,7 +125,6 @@ "//chromeos/process_proxy:unit_tests", "//chromeos/services:unit_tests", "//chromeos/startup:unit_tests", - "//chromeos/tpm:unit_tests", "//chromeos/ui/base:unit_tests", "//chromeos/utils:unit_tests", "//components/onc",
diff --git a/chromeos/components/chromebox_for_meetings/features/features.h b/chromeos/components/chromebox_for_meetings/features/features.h index 45b33b3e..e4835f1 100644 --- a/chromeos/components/chromebox_for_meetings/features/features.h +++ b/chromeos/components/chromebox_for_meetings/features/features.h
@@ -30,4 +30,10 @@ } // namespace cfm } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash::cfm::features { +using ::chromeos::cfm::features::kCloudLogger; +using ::chromeos::cfm::features::kMojoServices; +} // namespace ash::cfm::features + #endif // CHROMEOS_COMPONENTS_CHROMEBOX_FOR_MEETINGS_FEATURES_FEATURES_H_
diff --git a/chromeos/dbus/BUILD.gn b/chromeos/dbus/BUILD.gn index 57f3ed5..4702a47 100644 --- a/chromeos/dbus/BUILD.gn +++ b/chromeos/dbus/BUILD.gn
@@ -122,6 +122,7 @@ deps = [ ":dbus", ":test_support", + "//ash/components/tpm:test_support", "//base", "//base/test:test_support", "//chromeos/dbus/audio", @@ -156,7 +157,6 @@ "//chromeos/dbus/userdataauth", "//chromeos/dbus/userdataauth:userdataauth_proto", "//chromeos/dbus/util:unit_tests", - "//chromeos/tpm:test_support", "//components/account_id", "//dbus", "//dbus:test_support",
diff --git a/chromeos/dbus/audio/fake_cras_audio_client.cc b/chromeos/dbus/audio/fake_cras_audio_client.cc index 146d8058..05bdc6f2 100644 --- a/chromeos/dbus/audio/fake_cras_audio_client.cc +++ b/chromeos/dbus/audio/fake_cras_audio_client.cc
@@ -207,6 +207,7 @@ void FakeCrasAudioClient::SetNoiseCancellationEnabled( bool noise_cancellation_on) { + noise_cancellation_enabled_ = noise_cancellation_on; ++noise_cancellation_enabled_counter_; }
diff --git a/chromeos/dbus/audio/fake_cras_audio_client.h b/chromeos/dbus/audio/fake_cras_audio_client.h index 9fb79c8a..3cf2105 100644 --- a/chromeos/dbus/audio/fake_cras_audio_client.h +++ b/chromeos/dbus/audio/fake_cras_audio_client.h
@@ -120,6 +120,10 @@ notify_volume_change_with_delay_ = notify_with_delay; } + bool noise_cancellation_enabled() const { + return noise_cancellation_enabled_; + } + private: // Finds a node in the list based on the id. AudioNodeList::iterator FindNode(uint64_t node_id); @@ -134,6 +138,7 @@ bool noise_cancellation_supported_ = false; uint32_t battery_level_ = 0; uint32_t noise_cancellation_enabled_counter_ = 0; + bool noise_cancellation_enabled_ = false; // Maps audio client type to the number of active input streams for clients // with the type specified ClientTypeToInputStreamCount active_input_streams_;
diff --git a/chromeos/dbus/authpolicy/BUILD.gn b/chromeos/dbus/authpolicy/BUILD.gn index a9c5de5..812cc29 100644 --- a/chromeos/dbus/authpolicy/BUILD.gn +++ b/chromeos/dbus/authpolicy/BUILD.gn
@@ -19,9 +19,9 @@ "//dbus", # For FakeAuthPolicyClient + "//ash/components/tpm", "//chromeos/dbus/cryptohome:cryptohome_proto", "//chromeos/dbus/session_manager", - "//chromeos/tpm", "//components/policy:cloud_policy_proto_generated_compile", ]
diff --git a/chromeos/dbus/authpolicy/DEPS b/chromeos/dbus/authpolicy/DEPS index e5ebe3e..39c5eb1a 100644 --- a/chromeos/dbus/authpolicy/DEPS +++ b/chromeos/dbus/authpolicy/DEPS
@@ -1,5 +1,5 @@ specific_include_rules = { "fake_authpolicy_client.*\.cc": [ - "+chromeos/tpm", + "+ash/components/tpm", ], }
diff --git a/chromeos/dbus/authpolicy/fake_authpolicy_client.cc b/chromeos/dbus/authpolicy/fake_authpolicy_client.cc index 127918a..2abfebf9 100644 --- a/chromeos/dbus/authpolicy/fake_authpolicy_client.cc +++ b/chromeos/dbus/authpolicy/fake_authpolicy_client.cc
@@ -7,6 +7,7 @@ #include <memory> #include <vector> +#include "ash/components/tpm/install_attributes.h" #include "base/bind.h" #include "base/files/file_util.h" #include "base/hash/md5.h" @@ -18,7 +19,6 @@ #include "base/threading/thread_task_runner_handle.h" #include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/session_manager/session_manager_client.h" -#include "chromeos/tpm/install_attributes.h" #include "components/account_id/account_id.h" #include "components/policy/proto/cloud_policy.pb.h" #include "dbus/message.h"
diff --git a/chromeos/dbus/authpolicy/fake_authpolicy_client_unittest.cc b/chromeos/dbus/authpolicy/fake_authpolicy_client_unittest.cc index 7efdc3fb..fc72535 100644 --- a/chromeos/dbus/authpolicy/fake_authpolicy_client_unittest.cc +++ b/chromeos/dbus/authpolicy/fake_authpolicy_client_unittest.cc
@@ -4,11 +4,11 @@ #include "chromeos/dbus/authpolicy/fake_authpolicy_client.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "base/bind.h" #include "base/run_loop.h" #include "base/test/task_environment.h" #include "chromeos/dbus/session_manager/session_manager_client.h" -#include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h b/chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h index 39de3860..abd4f8b 100644 --- a/chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h +++ b/chromeos/dbus/chromebox_for_meetings/cfm_hotline_client.h
@@ -79,4 +79,9 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash { +using ::chromeos::CfmHotlineClient; +} + #endif // CHROMEOS_DBUS_CHROMEBOX_FOR_MEETINGS_CFM_HOTLINE_CLIENT_H_
diff --git a/chromeos/dbus/chromebox_for_meetings/cfm_observer.h b/chromeos/dbus/chromebox_for_meetings/cfm_observer.h index d9e5420c..b78ae2d6 100644 --- a/chromeos/dbus/chromebox_for_meetings/cfm_observer.h +++ b/chromeos/dbus/chromebox_for_meetings/cfm_observer.h
@@ -30,4 +30,9 @@ } // namespace cfm } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash::cfm { +using ::chromeos::cfm::CfmObserver; +} + #endif // CHROMEOS_DBUS_CHROMEBOX_FOR_MEETINGS_CFM_OBSERVER_H_
diff --git a/chromeos/dbus/chromebox_for_meetings/fake_cfm_hotline_client.h b/chromeos/dbus/chromebox_for_meetings/fake_cfm_hotline_client.h index e41dd2c..d517711 100644 --- a/chromeos/dbus/chromebox_for_meetings/fake_cfm_hotline_client.h +++ b/chromeos/dbus/chromebox_for_meetings/fake_cfm_hotline_client.h
@@ -40,4 +40,9 @@ } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash { +using ::chromeos::FakeCfmHotlineClient; +} + #endif // CHROMEOS_DBUS_CHROMEBOX_FOR_MEETINGS_FAKE_CFM_HOTLINE_CLIENT_H_
diff --git a/chromeos/dbus/rmad/fake_rmad_client.cc b/chromeos/dbus/rmad/fake_rmad_client.cc index 3162942..4e2b4d2 100644 --- a/chromeos/dbus/rmad/fake_rmad_client.cc +++ b/chromeos/dbus/rmad/fake_rmad_client.cc
@@ -4,6 +4,7 @@ #include "chromeos/dbus/rmad/fake_rmad_client.h" +#include "base/callback_forward.h" #include "base/logging.h" #include "base/threading/thread_task_runner_handle.h" @@ -324,9 +325,11 @@ return NumStates() > 0; } -bool FakeRmadClient::WasRmaStateDetectedForSessionManager( - base::OnceCallback<void()> session_manager_callback) { - return NumStates() > 0; +void FakeRmadClient::SetRmaRequiredCallbackForSessionManager( + base::OnceClosure session_manager_callback) { + if (NumStates() > 0) { + std::move(session_manager_callback).Run(); + } } void FakeRmadClient::SetAbortable(bool abortable) {
diff --git a/chromeos/dbus/rmad/fake_rmad_client.h b/chromeos/dbus/rmad/fake_rmad_client.h index d1793cc..2f84acc 100644 --- a/chromeos/dbus/rmad/fake_rmad_client.h +++ b/chromeos/dbus/rmad/fake_rmad_client.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/callback_forward.h" #include "base/component_export.h" #include "base/observer_list.h" #include "chromeos/dbus/rmad/rmad.pb.h" @@ -26,8 +27,8 @@ static FakeRmadClient* Get(); bool WasRmaStateDetected() override; - bool WasRmaStateDetectedForSessionManager( - base::OnceCallback<void()> session_manager_callback) override; + void SetRmaRequiredCallbackForSessionManager( + base::OnceClosure session_manager_callback) override; void GetCurrentState( DBusMethodCallback<rmad::GetStateReply> callback) override; void TransitionNextState(
diff --git a/chromeos/dbus/rmad/rmad_client.cc b/chromeos/dbus/rmad/rmad_client.cc index f1963ca..ce2f7b5 100644 --- a/chromeos/dbus/rmad/rmad_client.cc +++ b/chromeos/dbus/rmad/rmad_client.cc
@@ -35,7 +35,7 @@ void Init(dbus::Bus* bus); bool WasRmaStateDetected() override; - bool WasRmaStateDetectedForSessionManager( + void SetRmaRequiredCallbackForSessionManager( base::OnceClosure session_manager_callback) override; void GetCurrentState( DBusMethodCallback<rmad::GetStateReply> callback) override; @@ -519,13 +519,13 @@ (is_rma_required_ || rma_state_file_exists_.value_or(false)); } -bool RmadClientImpl::WasRmaStateDetectedForSessionManager( +void RmadClientImpl::SetRmaRequiredCallbackForSessionManager( base::OnceClosure session_manager_callback) { - const bool was_rma_state_detected = WasRmaStateDetected(); - if (!was_rma_state_detected) { + if (WasRmaStateDetected()) { + std::move(session_manager_callback).Run(); + } else { session_manager_callback_ = std::move(session_manager_callback); } - return was_rma_state_detected; } RmadClient::RmadClient() {
diff --git a/chromeos/dbus/rmad/rmad_client.h b/chromeos/dbus/rmad/rmad_client.h index b80445e..6386cd2c 100644 --- a/chromeos/dbus/rmad/rmad_client.h +++ b/chromeos/dbus/rmad/rmad_client.h
@@ -72,11 +72,9 @@ // Returns true if RMA is supported and the RMA state files were detected. virtual bool WasRmaStateDetected() = 0; - // Called by ChromeSessionManager, this returns true if RMA state is detected. - // Otherwise, return false meanings either RMA not required, or RMA check is - // pending. `session_manager_callback` is invoked when the pending RMA check - // is finished and RMA is required. - virtual bool WasRmaStateDetectedForSessionManager( + // Called by ChromeSessionManager, `session_manager_callback` is invoked when + // the RMA check completes and it's determined that RMA is required. + virtual void SetRmaRequiredCallbackForSessionManager( base::OnceClosure session_manager_callback) = 0; // Asynchronously gets the current RMA state.
diff --git a/chromeos/dbus/userdataauth/fake_install_attributes_client.cc b/chromeos/dbus/userdataauth/fake_install_attributes_client.cc index c4391b4..3868cde 100644 --- a/chromeos/dbus/userdataauth/fake_install_attributes_client.cc +++ b/chromeos/dbus/userdataauth/fake_install_attributes_client.cc
@@ -204,7 +204,7 @@ &cache_file) && base::PathExists(cache_file); DCHECK(file_exists); - // Mostly copied from chrome/browser/chromeos/tpm/install_attributes.cc. + // Mostly copied from ash/components/tpm/install_attributes.cc. std::string file_blob; if (!base::ReadFileToStringWithMaxSize(cache_file, &file_blob, kInstallAttributesFileMaxSize)) {
diff --git a/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_connection.h b/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_connection.h index 53152ad..0f83d7a8 100644 --- a/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_connection.h +++ b/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_connection.h
@@ -45,4 +45,9 @@ } // namespace cfm } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash::cfm { +using ::chromeos::cfm::FakeServiceConnectionImpl; +} + #endif // CHROMEOS_SERVICES_CHROMEBOX_FOR_MEETINGS_PUBLIC_CPP_FAKE_SERVICE_CONNECTION_H_
diff --git a/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_context.h b/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_context.h index 783b9b98..b6ea7e7 100644 --- a/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_context.h +++ b/chromeos/services/chromebox_for_meetings/public/cpp/fake_service_context.h
@@ -53,4 +53,9 @@ } // namespace cfm } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash::cfm { +using ::chromeos::cfm::FakeCfmServiceContext; +} + #endif // CHROMEOS_SERVICES_CHROMEBOX_FOR_MEETINGS_PUBLIC_CPP_FAKE_SERVICE_CONTEXT_H_
diff --git a/chromeos/services/chromebox_for_meetings/public/cpp/service_connection.h b/chromeos/services/chromebox_for_meetings/public/cpp/service_connection.h index 82de55d..ad825665 100644 --- a/chromeos/services/chromebox_for_meetings/public/cpp/service_connection.h +++ b/chromeos/services/chromebox_for_meetings/public/cpp/service_connection.h
@@ -39,4 +39,9 @@ } // namespace cfm } // namespace chromeos +// TODO(https://crbug.com/1164001): remove after the migration is finished. +namespace ash::cfm { +using ::chromeos::cfm::ServiceConnection; +} + #endif // CHROMEOS_SERVICES_CHROMEBOX_FOR_MEETINGS_PUBLIC_CPP_SERVICE_CONNECTION_H_
diff --git a/chromeos/services/chromebox_for_meetings/public/mojom/README.md b/chromeos/services/chromebox_for_meetings/public/mojom/README.md index 39873e8..212d76b2 100644 --- a/chromeos/services/chromebox_for_meetings/public/mojom/README.md +++ b/chromeos/services/chromebox_for_meetings/public/mojom/README.md
@@ -6,7 +6,7 @@ edited before changing this file. Due to the requirement of chrome dependencies individual service implementation -lives in `chrome/browser/chromeos/chromebox_for_meetings/`. +lives in `chrome/browser/ash/chromebox_for_meetings/`. Hot-tip: Generate Js w/
diff --git a/components/autofill/core/browser/payments/autofill_virtual_card_enrollment_infobar_delegate_mobile.cc b/components/autofill/core/browser/payments/autofill_virtual_card_enrollment_infobar_delegate_mobile.cc index 1bb7295..fcf9d1e 100644 --- a/components/autofill/core/browser/payments/autofill_virtual_card_enrollment_infobar_delegate_mobile.cc +++ b/components/autofill/core/browser/payments/autofill_virtual_card_enrollment_infobar_delegate_mobile.cc
@@ -117,12 +117,12 @@ } void AutofillVirtualCardEnrollmentInfoBarDelegateMobile::InfoBarDismissed() { - OnInfobarClosed(PaymentsBubbleClosedReason::kClosed); + OnInfobarClosed(PaymentsBubbleClosedReason::kCancelled); virtual_card_enroll_bubble_controller_->OnDeclineButton(); } bool AutofillVirtualCardEnrollmentInfoBarDelegateMobile::Cancel() { - OnInfobarClosed(PaymentsBubbleClosedReason::kClosed); + OnInfobarClosed(PaymentsBubbleClosedReason::kCancelled); virtual_card_enroll_bubble_controller_->OnDeclineButton(); return true; }
diff --git a/components/browser_ui/styles/android/java/res/values-v27/styles.xml b/components/browser_ui/styles/android/java/res/values-v27/styles.xml index 4cdb401..1ed1e39 100644 --- a/components/browser_ui/styles/android/java/res/values-v27/styles.xml +++ b/components/browser_ui/styles/android/java/res/values-v27/styles.xml
@@ -5,7 +5,7 @@ <resources> <style name="ThemeOverlay.BrowserUI.Fullscreen" parent="Base.ThemeOverlay.BrowserUI.Fullscreen"> - <item name="android:navigationBarColor">@color/bottom_system_nav_color</item> + <item name="android:navigationBarColor">@macro/bottom_system_nav_color</item> <item name="android:navigationBarDividerColor">@macro/bottom_system_nav_divider_color</item> <item name="android:windowLightNavigationBar">@bool/window_light_navigation_bar</item> </style>
diff --git a/components/browser_ui/styles/android/java/res/values/colors.xml b/components/browser_ui/styles/android/java/res/values/colors.xml index 0743f96..c834d5c 100644 --- a/components/browser_ui/styles/android/java/res/values/colors.xml +++ b/components/browser_ui/styles/android/java/res/values/colors.xml
@@ -11,7 +11,6 @@ <!-- Toolbar colors --> <!-- Same as ?attr/colorSurface. --> - <color name="toolbar_background_primary">@color/default_bg_color</color> <color name="toolbar_background_primary_dark">@color/default_bg_color_dark</color> <!-- Infobar colors --> @@ -33,13 +32,13 @@ <color name="default_favicon_background_color">@color/default_control_color_normal_light</color> <!-- Navigation bar colors --> - <color name="bottom_system_nav_color">@color/toolbar_background_primary</color> + <macro name="bottom_system_nav_color" tools:ignore="UnusedResources">@macro/toolbar_background_primary</macro> <macro name="bottom_system_nav_divider_color">@macro/divider_line_bg_color</macro> <color name="bottom_system_nav_divider_color_light">@color/divider_line_bg_color_light</color> <!-- This is the color that will appear on the system recents UI. It is a neutral background color that adapts to dark/light modes but not a dynamic color. --> - <color name="default_task_description_color">@color/default_bg_color</color> + <color name="default_task_description_color">@color/default_bg_color_baseline</color> <!-- Progress Bar colors --> <macro name="progress_bar_foreground">@macro/default_control_color_active</macro>
diff --git a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml index b4cac963..f7517ac 100644 --- a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml +++ b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml
@@ -75,7 +75,7 @@ <macro name="chip_state_layer_color">@color/chip_state_layer_color_baseline</macro> <macro name="chip_state_layer_selected_color">@color/chip_state_layer_selected_color_baseline</macro> - <macro name="toolbar_background_primary">@color/default_bg_color</macro> + <macro name="toolbar_background_primary">@color/default_bg_color_baseline</macro> --> <!-- Gated by full dynamic colors param, no fallback needed. -->
diff --git a/components/browser_ui/styles/android/java/res/values/styles.xml b/components/browser_ui/styles/android/java/res/values/styles.xml index ea1d824c..5733e19 100644 --- a/components/browser_ui/styles/android/java/res/values/styles.xml +++ b/components/browser_ui/styles/android/java/res/values/styles.xml
@@ -31,13 +31,6 @@ <item name="errorTextAppearance">@style/TextAppearance.ErrorCaption</item> </style> - <!-- Popup and long-press context popup menu style --> - <style name="PopupMenuStyle" parent="Widget.AppCompat.Light.PopupMenu"> - <item name="android:popupBackground">@drawable/menu_bg_tinted</item> - <item name="android:overlapAnchor" tools:targetApi="21">true</item> - <item name="android:popupElevation" tools:targetApi="21">0dp</item> - </style> - <!-- Basic theme for an overflow menu displayed in Chrome. --> <style name="Base.OverflowMenuThemeOverlay" parent=""> <item name="android:popupMenuStyle">@android:style/Widget.Material.PopupMenu</item> @@ -83,12 +76,6 @@ <item name="android:indeterminateTint">@macro/default_icon_color_accent1</item> </style> - <!-- Spinner styles --> - <style name="SpinnerStyle" parent="Widget.AppCompat.Spinner"> - <item name="android:popupBackground">@drawable/dialog_bg_tinted</item> - <item name="android:popupElevation" tools:targetApi="21">0dp</item> - </style> - <!-- Switch styling for dark theme --> <!-- TODO(sinansahin): See if we can pass the baseline dark theme to the incognito NTP instead. -->
diff --git a/components/browser_ui/styles/android/java/res/values/themes.xml b/components/browser_ui/styles/android/java/res/values/themes.xml index 67d766db..7bd2727 100644 --- a/components/browser_ui/styles/android/java/res/values/themes.xml +++ b/components/browser_ui/styles/android/java/res/values/themes.xml
@@ -45,7 +45,6 @@ <item name="colorOnPrimaryContainer">@color/baseline_primary_900</item> <item name="colorPrimaryContainer">@color/baseline_primary_100</item> <!-- Supports dynamic colors now. --> - <item name="default_bg_color_dynamic">?attr/colorSurface</item> <item name="divider_line_bg_color_dynamic">?attr/colorSurfaceVariant</item> </style>
diff --git a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/ChromeColors.java b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/ChromeColors.java index 6e5ba3e9..0053e37a 100644 --- a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/ChromeColors.java +++ b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/ChromeColors.java
@@ -46,9 +46,7 @@ */ public static @ColorInt int getPrimaryBackgroundColor(Context context, boolean isIncognito) { return isIncognito ? context.getColor(R.color.default_bg_color_dark) - : MaterialColors.getColor(context, R.attr.default_bg_color_dynamic, - // Temporarily pass a default, see https://crbug.com/1247186. - context.getColor(R.color.default_bg_color)); + : SemanticColorUtils.getDefaultBgColor(context); } /**
diff --git a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java index 8f5945a..59a4f33 100644 --- a/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java +++ b/components/browser_ui/styles/android/java/src/org/chromium/components/browser_ui/styles/SemanticColorUtils.java
@@ -89,6 +89,11 @@ return resolve(R.attr.colorSurfaceVariant, R.color.divider_line_bg_color_baseline, context); } + /** Returns the semantic color value that corresponds to bottom_system_nav_color. */ + public static @ColorInt int getBottomSystemNavColor(Context context) { + return getDefaultBgColor(context); + } + /** Returns the semantic color value that corresponds to bottom_system_nav_divider_color. */ public static @ColorInt int getBottomSystemNavDividerColor(Context context) { return getDividerLineBgColor(context);
diff --git a/components/browser_ui/theme/android/java/res/values/themes.xml b/components/browser_ui/theme/android/java/res/values/themes.xml index 464ee0e1..06f260b 100644 --- a/components/browser_ui/theme/android/java/res/values/themes.xml +++ b/components/browser_ui/theme/android/java/res/values/themes.xml
@@ -47,7 +47,6 @@ <!-- Custom semantic names --> <!-- Supports dynamic colors now. --> - <item name="default_bg_color_dynamic">?attr/colorSurface</item> <item name="divider_line_bg_color_dynamic">?attr/colorSurfaceVariant</item> <!-- Baseline values for the theme attributes in ThemeOverlay.DynamicButtons, used to @@ -140,7 +139,6 @@ <!-- Custom semantic names --> <!-- Supports dynamic colors now. --> - <item name="default_bg_color_dynamic">?attr/colorSurface</item> <item name="divider_line_bg_color_dynamic">?attr/colorSurfaceVariant</item> <!-- Baseline values for the theme attributes in ThemeOverlay.DynamicButtons, used to
diff --git a/components/browser_ui/widget/android/BUILD.gn b/components/browser_ui/widget/android/BUILD.gn index 2db5ca7..0735e65 100644 --- a/components/browser_ui/widget/android/BUILD.gn +++ b/components/browser_ui/widget/android/BUILD.gn
@@ -259,6 +259,7 @@ "java/res/values-night/dimens.xml", "java/res/values-night/drawables.xml", "java/res/values-sw600dp/dimens.xml", + "java/res/values-v23/drawables.xml", "java/res/values/attrs.xml", "java/res/values/colors.xml", "java/res/values/dimens.xml",
diff --git a/components/browser_ui/widget/android/java/res/color/chip_ripple_color.xml b/components/browser_ui/widget/android/java/res/color/chip_ripple_color.xml index cda4f354..41134bf 100644 --- a/components/browser_ui/widget/android/java/res/color/chip_ripple_color.xml +++ b/components/browser_ui/widget/android/java/res/color/chip_ripple_color.xml
@@ -15,5 +15,5 @@ android:color="@color/default_chip_ripple_color" android:state_focused="true"/> <item android:alpha="@dimen/default_hovered_alpha" android:color="@color/default_chip_ripple_color" android:state_hovered="true"/> - <item android:color="@color/default_bg_color" /> + <item android:color="@macro/default_bg_color" /> </selector>
diff --git a/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml b/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml index 0b7d928..69acb58 100644 --- a/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml +++ b/components/browser_ui/widget/android/java/res/layout/selectable_list_layout.xml
@@ -12,7 +12,7 @@ android:id="@+id/action_bar_bg" android:layout_width="match_parent" android:layout_height="@dimen/selectable_list_toolbar_height" - android:background="@color/toolbar_background_primary" /> + android:background="@macro/toolbar_background_primary" /> <ViewStub android:id="@+id/action_bar_stub"
diff --git a/components/browser_ui/widget/android/java/res/values-v23/drawables.xml b/components/browser_ui/widget/android/java/res/values-v23/drawables.xml new file mode 100644 index 0000000..54a20a4 --- /dev/null +++ b/components/browser_ui/widget/android/java/res/values-v23/drawables.xml
@@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2022 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<resources> + <drawable name="dialog_bg_tinted">@drawable/dialog_bg_baseline</drawable> + <drawable name="menu_bg_tinted">@drawable/menu_bg_baseline</drawable> +</resources>
diff --git a/components/browser_ui/widget/android/java/res/values/styles.xml b/components/browser_ui/widget/android/java/res/values/styles.xml index 173ffb9..b594ec6 100644 --- a/components/browser_ui/widget/android/java/res/values/styles.xml +++ b/components/browser_ui/widget/android/java/res/values/styles.xml
@@ -202,4 +202,17 @@ <item name="solidColorChip">true</item> <item name="verticalInset">@dimen/menu_chip_vertical_inset</item> </style> + + <!-- Popup and long-press context popup menu style --> + <style name="PopupMenuStyle" parent="Widget.AppCompat.Light.PopupMenu"> + <item name="android:popupBackground">@drawable/menu_bg_tinted</item> + <item name="android:overlapAnchor" tools:targetApi="21">true</item> + <item name="android:popupElevation" tools:targetApi="21">0dp</item> + </style> + + <!-- Spinner styles --> + <style name="SpinnerStyle" parent="Widget.AppCompat.Spinner"> + <item name="android:popupBackground">@drawable/dialog_bg_tinted</item> + <item name="android:popupElevation" tools:targetApi="21">0dp</item> + </style> </resources>
diff --git a/components/chromeos_camera/BUILD.gn b/components/chromeos_camera/BUILD.gn index 9039bbc..237fb160 100644 --- a/components/chromeos_camera/BUILD.gn +++ b/components/chromeos_camera/BUILD.gn
@@ -59,7 +59,7 @@ ] deps = [ - "//media/gpu", + "//media/gpu:buffer_validation", "//mojo/public/cpp/system", ] }
diff --git a/components/embedder_support/android/java/res/values/colors.xml b/components/embedder_support/android/java/res/values/colors.xml index e7b2571..4243f23a 100644 --- a/components/embedder_support/android/java/res/values/colors.xml +++ b/components/embedder_support/android/java/res/values/colors.xml
@@ -7,5 +7,5 @@ <resources> <!-- TODO(crbug.com/775198): update colors once UX spec available. --> <color name="color_picker_border_color">@color/hairline_stroke_color_baseline</color> - <color name="color_picker_background_color">@color/default_bg_color</color> + <color name="color_picker_background_color">@color/default_bg_color_baseline</color> </resources>
diff --git a/components/embedder_support/android/javatests/src/org/chromium/components/embedder_support/delegate/ColorPickerDialogRenderTest.java b/components/embedder_support/android/javatests/src/org/chromium/components/embedder_support/delegate/ColorPickerDialogRenderTest.java index 4229ab3..40db301 100644 --- a/components/embedder_support/android/javatests/src/org/chromium/components/embedder_support/delegate/ColorPickerDialogRenderTest.java +++ b/components/embedder_support/android/javatests/src/org/chromium/components/embedder_support/delegate/ColorPickerDialogRenderTest.java
@@ -72,7 +72,7 @@ ColorPickerDialog dialog = new ColorPickerDialog(activity, (v) -> {}, Color.RED, suggestions); mView = dialog.getContentView(); - mView.setBackgroundResource(R.color.default_bg_color); + mView.setBackgroundResource(R.color.default_bg_color_baseline); activity.setContentView(mView, new LayoutParams(WRAP_CONTENT, WRAP_CONTENT)); }); }
diff --git a/components/messages/README.md b/components/messages/README.md index 560d317b..7e92349 100644 --- a/components/messages/README.md +++ b/components/messages/README.md
@@ -25,7 +25,7 @@ You need to do the following things to enable your message UI, all described in detail below. -1. [Declare your message UI](#Declaring-your-message-ui) by adding a Message Identifier. +1. [Declare your message UI](#Declare-your-message-ui) by adding a Message Identifier. 2. [Build a message model](#Build-a-message-model). 3. [Enqueue your message model](#Enqueue-your-message-model). @@ -213,24 +213,3 @@ Records the time interval the message was displayed on the screen before the user explicitly dismissed it. The metric is recorded when the user presses the primary or secondary button, or dismisses the message with a gesture. - - -## Built-in Finch Parameter to control the duration - -Using `autodismiss_duration_ms_{MessageIdentifier}` inside the feature -`MessagesForAndroidInfrastructure` to configure the duration through finch. -This method does not require any code changes in clients. E.g.: - - -``` -// update the default timer duration of Sync Error Message to 30000 ms -Feature MessagesForAndroidInfrastructure { - params = { - autodismiss_duration_ms_SyncError = 30000 - } -} -``` - -> **Warning**: MessagesForAndroidInfrastructure is enabled by default. -> **DO NOT** disable it in any group. Disabling MessagesForAndroidInfrastructure -> will break other experiments depending on that flag.
diff --git a/components/messages/android/internal/java/src/org/chromium/components/messages/MessageBannerRenderTest.java b/components/messages/android/internal/java/src/org/chromium/components/messages/MessageBannerRenderTest.java index 59ca4aa2..0fb6abd 100644 --- a/components/messages/android/internal/java/src/org/chromium/components/messages/MessageBannerRenderTest.java +++ b/components/messages/android/internal/java/src/org/chromium/components/messages/MessageBannerRenderTest.java
@@ -48,7 +48,10 @@ new NightModeTestUtils.NightModeParams().getParameters(); @Rule - public RenderTestRule mRenderTestRule = RenderTestRule.Builder.withPublicCorpus().build(); + public RenderTestRule mRenderTestRule = + RenderTestRule.Builder.withPublicCorpus() + .setBugComponent(RenderTestRule.Component.UI_BROWSER_MOBILE_MESSAGES) + .build(); public MessageBannerRenderTest(boolean nightModeEnabled) { NightModeTestUtils.setUpNightModeForBlankUiTestActivity(nightModeEnabled);
diff --git a/components/omnibox/browser/document_provider.cc b/components/omnibox/browser/document_provider.cc index ee030f28..010489f 100644 --- a/components/omnibox/browser/document_provider.cc +++ b/components/omnibox/browser/document_provider.cc
@@ -26,7 +26,6 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "components/bookmarks/browser/bookmark_utils.h" #include "components/omnibox/browser/autocomplete_input.h" @@ -76,6 +75,32 @@ DOCUMENT_MAX_REQUEST_HISTOGRAM_VALUE); } +void LogTotalTime(base::TimeTicks start_time, bool interrupted) { + DCHECK(!start_time.is_null()); + const base::TimeDelta elapsed_time = base::TimeTicks::Now() - start_time; + UMA_HISTOGRAM_TIMES("Omnibox.DocumentSuggest.TotalTime", elapsed_time); + if (interrupted) { + UMA_HISTOGRAM_TIMES("Omnibox.DocumentSuggest.TotalTime.Interrupted", + elapsed_time); + } else { + UMA_HISTOGRAM_TIMES("Omnibox.DocumentSuggest.TotalTime.NotInterrupted", + elapsed_time); + } +} + +void LogRequestTime(base::TimeTicks start_time, bool interrupted) { + DCHECK(!start_time.is_null()); + const base::TimeDelta elapsed_time = base::TimeTicks::Now() - start_time; + UMA_HISTOGRAM_TIMES("Omnibox.DocumentSuggest.RequestTime", elapsed_time); + if (interrupted) { + UMA_HISTOGRAM_TIMES("Omnibox.DocumentSuggest.RequestTime.Interrupted", + elapsed_time); + } else { + UMA_HISTOGRAM_TIMES("Omnibox.DocumentSuggest.RequestTime.NotInterrupted", + elapsed_time); + } +} + // MIME types sent by the server for different document types. const char kDocumentMimetype[] = "application/vnd.google-apps.document"; const char kFormMimetype[] = "application/vnd.google-apps.form"; @@ -477,6 +502,7 @@ } void DocumentProvider::Run() { + time_run_invoked_ = base::TimeTicks::Now(); client_->GetDocumentSuggestionsService(/*create_if_necessary=*/true) ->CreateDocumentSuggestionsRequest( input_.text(), client_->IsOffTheRecord(), @@ -492,9 +518,26 @@ bool due_to_user_inactivity) { TRACE_EVENT0("omnibox", "DocumentProvider::Stop"); debouncer_->CancelRequest(); - if (loader_) + + // If the request was sent, then log its duration and that it was invalidated. + if (loader_) { + DCHECK(!time_run_invoked_.is_null()); + DCHECK(!time_request_sent_.is_null()); + loader_.reset(); + LogRequestTime(time_request_sent_, true); + time_request_sent_ = base::TimeTicks(); LogOmniboxDocumentRequest(DOCUMENT_REQUEST_INVALIDATED); - loader_.reset(); + } + + // If `Run()` has been invoked, log its duration. It's possible `Stop()` is + // invoked before `Run()` has been invoked if 1) this is the first user input, + // 2) the previous call was debounced, or 3) the previous request was filtered + // (e.g. input too short). + if (!time_run_invoked_.is_null()) { + LogTotalTime(time_run_invoked_, true); + time_run_invoked_ = base::TimeTicks(); + } + auto* document_suggestions_service = client_->GetDocumentSuggestionsService(/*create_if_necessary=*/false); if (document_suggestions_service != nullptr) { @@ -570,6 +613,7 @@ DCHECK(!done_); DCHECK_EQ(loader_.get(), source); + LogRequestTime(time_request_sent_, false); LogOmniboxDocumentRequest(DOCUMENT_REPLY_RECEIVED); int httpStatusCode = source->ResponseInfo() && source->ResponseInfo()->headers @@ -583,6 +627,7 @@ response_body && source->NetError() == net::OK && httpStatusCode == 200 && UpdateResults(SearchSuggestionParser::ExtractJsonData( source, std::move(response_body))); + LogTotalTime(time_run_invoked_, false); loader_.reset(); done_ = true; listener_->OnProviderUpdate(results_updated); @@ -624,6 +669,7 @@ void DocumentProvider::OnDocumentSuggestionsLoaderAvailable( std::unique_ptr<network::SimpleURLLoader> loader) { + time_request_sent_ = base::TimeTicks::Now(); loader_ = std::move(loader); LogOmniboxDocumentRequest(DOCUMENT_REQUEST_SENT); }
diff --git a/components/omnibox/browser/document_provider.h b/components/omnibox/browser/document_provider.h index 6310aaa..960b334 100644 --- a/components/omnibox/browser/document_provider.h +++ b/components/omnibox/browser/document_provider.h
@@ -17,6 +17,7 @@ #include "base/feature_list.h" #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" +#include "base/time/time.h" #include "components/history/core/browser/history_types.h" #include "components/omnibox/browser/autocomplete_provider.h" #include "components/omnibox/browser/autocomplete_provider_debouncer.h" @@ -97,6 +98,7 @@ FRIEND_TEST_ALL_PREFIXES(DocumentProviderTest, CachingForAsyncMatches); FRIEND_TEST_ALL_PREFIXES(DocumentProviderTest, CachingForSyncMatches); FRIEND_TEST_ALL_PREFIXES(DocumentProviderTest, StartCallsStop); + FRIEND_TEST_ALL_PREFIXES(DocumentProviderTest, Logging); using MatchesCache = base::LRUCache<GURL, AutocompleteMatch>; @@ -201,6 +203,12 @@ // Loader used to retrieve results. std::unique_ptr<network::SimpleURLLoader> loader_; + // The time `Run()` was invoked. Used for histogram logging. + base::TimeTicks time_run_invoked_; + // The time `OnDocumentSuggestionsLoaderAvailable()` was invoked and the + // remote request was sent. Used for histogram logging. + base::TimeTicks time_request_sent_; + // Because the drive server is async and may intermittently provide a // particular suggestion for consecutive inputs, without caching, doc // suggestions flicker between drive format (title - date - doc_type) and URL
diff --git a/components/omnibox/browser/document_provider_unittest.cc b/components/omnibox/browser/document_provider_unittest.cc index f568f7f..2b349692 100644 --- a/components/omnibox/browser/document_provider_unittest.cc +++ b/components/omnibox/browser/document_provider_unittest.cc
@@ -11,7 +11,9 @@ #include "base/memory/raw_ptr.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" +#include "base/time/time.h" #include "base/time/time_to_iso8601.h" #include "base/values.h" #include "build/build_config.h" @@ -1160,3 +1162,80 @@ provider_->Start(invalid_input, false); EXPECT_TRUE(provider_->done()); } + +TEST_F(DocumentProviderTest, Logging) { + // The code flow is: + // 1) `Start()` is invoked when document matches are desired. + // 2) `Run()` is invoked from `Start()` after a potential debouncing delay. + // 3) A request is asyncly made to the document backend once an auth token is + // ready. + // 4) A response is asyncly received from the document backend. + // At any point, the chain of events can be interrupted by a `Stop()` + // invocation; usually when there's a new input. + // The below 3 cases test the logged histograms when `Stop()` is invoked after + // steps 1, 2, and 3. + + { + SCOPED_TRACE("Case: Stop() before Run()."); + base::HistogramTester histogram_tester; + provider_->Stop(false, false); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.Requests", 0); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.TotalTime", 0); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.TotalTime.Interrupted", 0); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.TotalTime.NotInterrupted", 0); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.RequestTime", 0); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.RequestTime.Interrupted", 0); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.RequestTime.NotInterrupted", 0); + } + + { + SCOPED_TRACE("Case: Stop() before request."); + base::HistogramTester histogram_tester; + provider_->time_run_invoked_ = base::TimeTicks::Now(); + provider_->Stop(false, false); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.Requests", 0); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.TotalTime", 1); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.TotalTime.Interrupted", 1); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.TotalTime.NotInterrupted", 0); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.RequestTime", 0); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.RequestTime.Interrupted", 0); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.RequestTime.NotInterrupted", 0); + } + + { + SCOPED_TRACE("Case: Stop() before response."); + base::HistogramTester histogram_tester; + provider_->time_run_invoked_ = base::TimeTicks::Now(); + provider_->OnDocumentSuggestionsLoaderAvailable( + network::SimpleURLLoader::Create( + std::make_unique<network::ResourceRequest>(), + net::DefineNetworkTrafficAnnotation("test", "test"))); + provider_->Stop(false, false); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.Requests", 2); + histogram_tester.ExpectBucketCount("Omnibox.DocumentSuggest.Requests", 1, + 1); + histogram_tester.ExpectBucketCount("Omnibox.DocumentSuggest.Requests", 2, + 1); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.TotalTime", 1); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.TotalTime.Interrupted", 1); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.TotalTime.NotInterrupted", 0); + histogram_tester.ExpectTotalCount("Omnibox.DocumentSuggest.RequestTime", 1); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.RequestTime.Interrupted", 1); + histogram_tester.ExpectTotalCount( + "Omnibox.DocumentSuggest.RequestTime.NotInterrupted", 0); + } + + // It's difficult to simulate a completed `SimpleURLLoader` response, so we + // don't test the "Case: Stop() after response" or "Case: No Stop()." +}
diff --git a/components/omnibox/browser/history_fuzzy_provider.cc b/components/omnibox/browser/history_fuzzy_provider.cc index 0e8f2c1ad..356b5c9 100644 --- a/components/omnibox/browser/history_fuzzy_provider.cc +++ b/components/omnibox/browser/history_fuzzy_provider.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <functional> #include <memory> +#include <ostream> #include <unordered_map> #include <utility> #include <vector> @@ -22,24 +23,97 @@ namespace fuzzy { +Correction::Correction(Correction& other) { + kind = other.kind; + at = other.at; + new_char = other.new_char; + if (other.next) { + next = std::make_unique<Correction>(*other.next.get()); + } +} + Correction::Correction(Correction&&) = default; -Correction::Correction(size_t at, char16_t replacement) - : at(at), replacement(replacement) {} +Correction::Correction(Kind kind, size_t at, char16_t new_char) + : kind(kind), at(at), new_char(new_char) {} + +Correction::Correction(Kind kind, + size_t at, + char16_t new_char, + std::unique_ptr<Correction> next) + : kind(kind), at(at), new_char(new_char), next(std::move(next)) {} Correction::~Correction() = default; void Correction::ApplyTo(std::u16string& text) const { - if (replacement == 0) { - text.erase(at, 1); - } else { - text[at] = replacement; + switch (kind) { + case Kind::DELETE: { + text.erase(at, 1); + break; + } + case Kind::INSERT: { + text.insert(at, 1, new_char); + break; + } + case Kind::REPLACE: { + text[at] = new_char; + break; + } + case Kind::KEEP: + default: { + NOTREACHED(); + break; + } } if (next) { next->ApplyTo(text); } } +std::unique_ptr<Correction> Correction::GetApplicableCorrection() { + if (kind == Kind::KEEP) { + // Because this function eliminates KEEP corrections as the chain is built, + // it doesn't need to work recursively; a single elimination is sufficient. + DCHECK(!next || next->kind != Kind::KEEP); + return next ? std::make_unique<Correction>(*next) : nullptr; + } else { + // TODO(orinj): Consider a shared ownership model or preallocated pool to + // eliminate lots of copy allocations. For now this is kept simple with + // direct ownership of the full correction chain. + return std::make_unique<Correction>(*this); + } +} + +// This operator implementation is for debugging. +std::ostream& operator<<(std::ostream& os, Correction& correction) { + os << '{'; + switch (correction.kind) { + case Correction::Kind::KEEP: { + os << 'K'; + break; + } + case Correction::Kind::DELETE: { + os << 'D'; + break; + } + case Correction::Kind::INSERT: { + os << 'I'; + break; + } + case Correction::Kind::REPLACE: { + os << 'R'; + break; + } + default: { + NOTREACHED(); + break; + } + } + os << "," << correction.at << "," << static_cast<char>(correction.new_char) + << "}"; + return os; +} + Node::Node() = default; Node::~Node() = default; @@ -58,48 +132,142 @@ } bool Node::FindCorrections(const std::u16string& text, - size_t from, int tolerance, std::vector<Correction>& corrections) const { - if (from >= text.length()) { + DVLOG(1) << "FindCorrections(" << text << ", " << tolerance << ")"; + DCHECK(corrections.empty()); + + // TODO(orinj): Use priority_queue; prioritize minimum distance and use index + // to break ties. Then there's no need to compare with best, as the first + // found solution is best (and fastest in common cases near input on trie). + // Algorithm can then return all equally-best results as soon as distance + // increases beyond that of found results. Length also needs to be + // considered to avoid producing shorter substring texts. + + if (text.length() == 0) { return true; } - char16_t c = text[from]; - const auto it = next.find(c); - if (it == next.end()) { - // Not found; abort if tolerance is exhausted, otherwise correct the - // mistake and reduce tolerance. - if (tolerance <= 0) { - return false; + + // A utility class to track search progression. + struct Step { + // Walks through trie. + const Node* node; + + // Edit distance. + int distance; + + // Advances through input text. This effectively tells how much of the + // input has been consumed so far, regardless of output text length. + size_t index; + + // Length of corrected text. This tells how long the output string will + // be, regardless of input text length. It is independent of `index` + // because corrections are not only 1:1 replacements but may involve + // insertions or deletions as well. + int length; + + // Backtracking data to enable text correction (from end of string back + // to beginning, i.e. correction chains are applied in reverse). + // TODO(orinj): This should be optimized in final algorithm; stop copying. + Correction correction; + + Step(Step&&) = default; + Step& operator=(Step&&) = default; + }; + // TODO(orinj): Don't need to keep full best anymore, only best distance. + Step best{ + nullptr, INT_MAX, SIZE_MAX, INT_MAX, {Correction::Kind::KEEP, 0, '_'}}; + std::queue<Step> q; + q.push({this, 0, 0, 0, {Correction::Kind::KEEP, 0, '_'}}); + int i = 0; + while (!q.empty()) { + i++; + Step step = std::move(q.front()); + q.pop(); + DVLOG(1) << i << "(" << step.distance << "," << step.index << "," + << step.length << "," << step.correction << ")"; + // TODO(orinj): Enforce a tolerance schedule with index versus distance; + // this would allow more errors for longer inputs and prevents searching + // through long corrections near start of input. + if (step.distance > best.distance) { + // Prune early. This won't be needed once driven by priority_queue. + DVLOG(1) << "skipped"; + continue; } - for (const auto& entry : next) { - // TODO(orinj): Here is the place to search also for deletion and - // insertion, not only replacement. Change `from` parameter and modify - // correction accordingly. - std::vector<Correction> subcorrections; - bool found = entry.second->FindCorrections(text, from + 1, tolerance - 1, - subcorrections); - if (found) { - // Remaining input without further correction is on trie. - corrections.emplace_back(from, entry.first); - // Note: We might consider searching further for an optimal relevance - // match but in terms of corrections it isn't possible to do any - // better than this. Any later corrections will be at least - // the size of this one, so return early for efficiency. - return false; + // Strictly greater should not be possible for this comparison. + if (step.index >= text.length()) { + if (step.distance == 0) { + // Ideal common case, full input on trie with no correction required. + // Note, we won't need to clear when search is directed; this is a + // temporary hack while the bare queue bumbles around the search space. + corrections.clear(); + return true; } - // Propagate corrections including current correction first. - for (auto& subcorrection : subcorrections) { - Correction current = {from, entry.first}; - current.next = std::make_unique<Correction>(std::move(subcorrection)); - corrections.push_back(std::move(current)); + // Check `length` to keep longer results. Without this, we could end up + // with shorter substring corrections (e.g. both "was" and "wash"). + // It may not be necessary to do this if priority_queue keeps results + // optimal or returns a first best result immediately. + if (step.distance < best.distance || step.length > best.length) { + best = std::move(step); + DVLOG(1) << "new best"; + corrections.clear(); + // Dereference is safe because nonzero distance implies presence of + // nontrivial correction. + corrections.emplace_back(*best.correction.GetApplicableCorrection()); + } else { + // Equal distance. + // Strictly greater should not be possible for this comparison. + if (step.length >= best.length) { + // Dereference is safe because this is another equally + // distant correction, necessarily discovered after the first. + corrections.emplace_back(*step.correction.GetApplicableCorrection()); + } +#if DCHECK_ALWAYS_ON + std::u16string corrected = text; + step.correction.GetApplicableCorrection()->ApplyTo(corrected); + DCHECK_EQ(corrected.length(), static_cast<size_t>(step.length)) + << corrected; +#endif + } + continue; + } + if (step.distance < tolerance) { + // Delete + q.push({step.node, + step.distance + 1, + step.index + 1, + step.length, + {Correction::Kind::DELETE, step.index, '_', + step.correction.GetApplicableCorrection()}}); + } + for (const auto& entry : step.node->next) { + if (entry.first == text[step.index]) { + // Keep + q.push({entry.second.get(), + step.distance, + step.index + 1, + step.length + 1, + {Correction::Kind::KEEP, step.index, '_', + step.correction.GetApplicableCorrection()}}); + } else if (step.distance < tolerance) { + // Insert + q.push({entry.second.get(), + step.distance + 1, + step.index, + step.length + 1, + {Correction::Kind::INSERT, step.index, entry.first, + step.correction.GetApplicableCorrection()}}); + // Replace + q.push({entry.second.get(), + step.distance + 1, + step.index + 1, + step.length + 1, + {Correction::Kind::REPLACE, step.index, entry.first, + step.correction.GetApplicableCorrection()}}); } } - return false; - } else { - // Found; proceed with tolerance. - return it->second->FindCorrections(text, from + 1, tolerance, corrections); } + return false; } void Node::Log(std::u16string built) const { @@ -157,7 +325,7 @@ } else { std::vector<fuzzy::Correction> corrections; DVLOG(1) << "FindCorrections: <" << text << "> ---> ?{"; - if (root_.FindCorrections(text, 0, 1, corrections)) { + if (root_.FindCorrections(text, 1, corrections)) { DVLOG(1) << "Trie contains input; no fuzzy results needed?"; AddMatchForText(u"INPUT ON TRIE"); }
diff --git a/components/omnibox/browser/history_fuzzy_provider.h b/components/omnibox/browser/history_fuzzy_provider.h index 4fe68f8..e32b384 100644 --- a/components/omnibox/browser/history_fuzzy_provider.h +++ b/components/omnibox/browser/history_fuzzy_provider.h
@@ -26,17 +26,42 @@ // of algorithm robustness. // If the `replacement` character is 0, it is interpreted as deletion. struct Correction { + // The kind of change to apply to text. Note, KEEP essentially means + // no edit, and will never be applied or kept as part of a correction chain. + enum class Kind { + KEEP, + DELETE, + INSERT, + REPLACE, + }; + Kind kind; + + // Text index at which to apply correction. size_t at; - char16_t replacement; + + // Character data; relevant only for REPLACE and INSERT. + char16_t new_char; + + // A short chain of additional related corrections to apply with this one. std::unique_ptr<Correction> next; - Correction(Correction&) = delete; + Correction(Correction&); Correction(Correction&&); - Correction(size_t at, char16_t replacement); + Correction& operator=(Correction&&) = default; + Correction(Kind kind, size_t at, char16_t new_char); + Correction(Kind kind, + size_t at, + char16_t new_char, + std::unique_ptr<Correction> next); ~Correction(); // Applies this correction to given text, mutating it in place. void ApplyTo(std::u16string& text) const; + + // This is a utility method to eliminate the need for allocation of + // non-applicable corrections. It returns a copy of this, or `next` if + // this `kind` is KEEP. + std::unique_ptr<Correction> GetApplicableCorrection(); }; // Nodes form a trie structure used to find potential input corrections. @@ -50,7 +75,8 @@ void Insert(const std::u16string& text, size_t from); // Produce corrections necessary to get `text` back on trie. Each correction - // will be of size `tolerance` or smaller. + // will be of size `tolerance` or smaller, and none will have smaller edit + // distance than any other (i.e. all corrections are equally optimal). // Returns whether input `text` starting at `from` is present in this trie. // - true without corrections -> `text` on trie. // - false without corrections -> cannot complete on trie within `tolerance`. @@ -59,7 +85,6 @@ // Note: For efficiency, not all possible corrections are returned; any found // valid corrections will preclude further more elaborate subcorrections. bool FindCorrections(const std::u16string& text, - size_t from, int tolerance, std::vector<Correction>& corrections) const;
diff --git a/components/omnibox/browser/history_fuzzy_provider_unittest.cc b/components/omnibox/browser/history_fuzzy_provider_unittest.cc index b278ca5..8db011a3 100644 --- a/components/omnibox/browser/history_fuzzy_provider_unittest.cc +++ b/components/omnibox/browser/history_fuzzy_provider_unittest.cc
@@ -11,6 +11,13 @@ namespace { +struct TestCase { + int tolerance; + std::u16string input; + bool expect_found; + std::vector<std::u16string> corrected_inputs; +}; + template <typename Container, typename Item> void SwapRemoveElement(Container& container, const Item& item) { typename Container::iterator it = @@ -25,6 +32,31 @@ container.pop_back(); } +void VerifyCases(fuzzy::Node* node, std::vector<TestCase>& cases) { + // Note: Each case is destroyed in place as it is checked. + for (TestCase& test_case : cases) { + std::vector<fuzzy::Correction> corrections; + bool found = node->FindCorrections(test_case.input, test_case.tolerance, + corrections); + for (const fuzzy::Correction& correction : corrections) { + std::u16string corrected_input = test_case.input; + correction.ApplyTo(corrected_input); + DVLOG(1) << "-> " << corrected_input; + } + CHECK_EQ(found, test_case.expect_found) + << " input(" << test_case.tolerance << "): " << test_case.input; + CHECK_EQ(test_case.corrected_inputs.size(), corrections.size()) + << " input(" << test_case.tolerance << "): " << test_case.input; + for (const fuzzy::Correction& correction : corrections) { + std::u16string corrected_input = test_case.input; + correction.ApplyTo(corrected_input); + SwapRemoveElement(test_case.corrected_inputs, corrected_input); + } + CHECK_EQ(test_case.corrected_inputs.size(), size_t{0}) + << " input(" << test_case.tolerance << "): " << test_case.input; + } +} + } // namespace class HistoryFuzzyProviderTest : public testing::Test { @@ -36,23 +68,65 @@ void SetUp() override {} }; -TEST_F(HistoryFuzzyProviderTest, TrieProducesCorrections) { - // TODO(orinj): Confirm that changing from memory store to table store - // doesn't break. +TEST_F(HistoryFuzzyProviderTest, AlgorithmIsNotGreedy) { fuzzy::Node node; + node.Insert(u"wind", 0); + node.Insert(u"wash", 0); + std::vector<TestCase> cases = { + { + 1, + u"wand", + false, + { + u"wind", + }, + }, + { + 1, + u"wish", + false, + { + u"wash", + }, + }, + { + 2, + u"xasx", + false, + { + u"wash", + }, + }, + { + 3, + u"xaxsx", + false, + { + u"wash", + }, + }, + { + 2, + u"want", + false, + { + u"wind", + u"wash", + }, + }, + }; + + VerifyCases(&node, cases); +} + +TEST_F(HistoryFuzzyProviderTest, ReplacementWorksAnywhere) { + fuzzy::Node node; node.Insert(u"abcdefg", 0); node.Insert(u"abcdxyz", 0); node.Insert(u"tuvwxyz", 0); node.Insert(u"tuvabcd", 0); - struct Case { - int tolerance; - std::u16string input; - bool expect_found; - std::vector<std::u16string> corrected_inputs; - }; - // A few things to note about these cases: // They don't complete to full strings; minimal corrections are supplied. // Tolerance consumption is currently naive. This should likely change, @@ -60,7 +134,7 @@ // incremental tolerance gains as more of the input string is scanned. // A stepping tolerance schedule like this would greatly increase efficiency // and allow more tolerance for longer strings without risking odd matches. - Case cases[] = { + std::vector<TestCase> cases = { { 0, u"abcdefg", @@ -121,7 +195,7 @@ }, }, { - 10, + 4, u"abc____", false, { @@ -131,18 +205,116 @@ }, }; - // Note: Each case is destroyed in place as it is checked. - for (Case& test_case : cases) { - std::vector<fuzzy::Correction> corrections; - bool found = node.FindCorrections(test_case.input, 0, test_case.tolerance, - corrections); - CHECK_EQ(found, test_case.expect_found); - CHECK_EQ(test_case.corrected_inputs.size(), corrections.size()); - for (const fuzzy::Correction& correction : corrections) { - std::u16string corrected_input = test_case.input; - correction.ApplyTo(corrected_input); - SwapRemoveElement(test_case.corrected_inputs, corrected_input); - } - CHECK_EQ(test_case.corrected_inputs.size(), size_t{0}); - } + VerifyCases(&node, cases); +} + +TEST_F(HistoryFuzzyProviderTest, InsertionWorksAnywhereExceptEnd) { + fuzzy::Node node; + node.Insert(u"abc", 0); + + std::vector<TestCase> cases = { + { + 1, + u"bc", + false, + { + u"abc", + }, + }, + { + 1, + u"ac", + false, + { + u"abc", + }, + }, + { + 1, + u"ab", + true, + { + // Note, we are NOT expecting "abc" here because insertion at + // end of input is generally predictive, and that is the job + // of the whole autocomplete system, not the fuzzy input + // correction algorithm, which seeks only to get inputs back + // on track for good suggestions. + }, + }, + { + 2, + u"b", + false, + { + u"ab", + }, + }, + }; + + VerifyCases(&node, cases); +} + +TEST_F(HistoryFuzzyProviderTest, DeletionWorksAnywhere) { + fuzzy::Node node; + node.Insert(u"abc", 0); + + std::vector<TestCase> cases = { + { + 1, + u"xabc", + false, + { + u"abc", + }, + }, + { + 1, + u"abxc", + false, + { + u"abc", + }, + }, + { + 1, + u"abcx", + false, + { + u"abc", + }, + }, + { + 2, + u"axbxc", + false, + { + u"abc", + }, + }, + }; + + VerifyCases(&node, cases); +} + +// This test ensures a preference for longer results when edit distances are +// equal. This isn't an absolute requirement, and some relevance or probability +// guidance might be better, but this simple heuristic avoids creating shorter +// substring corrections, for example both "was" and "wash". +TEST_F(HistoryFuzzyProviderTest, LongerResultsArePreferred) { + fuzzy::Node node; + node.Insert(u"ao", 0); + node.Insert(u"eeo", 0); + + std::vector<TestCase> cases = { + { + 1, + u"eo", + false, + { + u"eeo", + }, + }, + }; + + VerifyCases(&node, cases); }
diff --git a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h index 4f9bb53..90b9eaaf 100644 --- a/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h +++ b/components/policy/core/common/cloud/encrypted_reporting_job_configuration.h
@@ -18,6 +18,8 @@ namespace policy { +// {{{Note}}} ERP Payload Overview +// // EncryptedReportingJobConfiguration configures a payload for the Encrypted // server endpoint. A JSON version of the payload looks like this: // { @@ -25,7 +27,7 @@ // { // "encryptedWrappedRecord": "EncryptedMessage", // "encryptionInfo" : { -// "encryptionKey": "EncryptedMessage", +// "encryptionKey": "LocalPublicValue", // "publicKeyId": 1 // }, // "sequencingInformation": { @@ -37,7 +39,7 @@ // { // "encryptedWrappedRecord": "EncryptedMessage", // "encryptionInfo" : { -// "encryptionKey": "EncryptedMessage", +// "encryptionKey": "LocalPublicValue", // "publicKeyId": 2 // }, // "sequencingInformation": { @@ -63,6 +65,9 @@ // } // "device" and "browser" are populated by the base class, // the rest needs to be provided as |merging_payload|. +// +// Details of "encryptedRecord" are documented at note "ERP Encrypted Record". + class POLICY_EXPORT EncryptedReportingJobConfiguration : public ReportingJobConfigurationBase { public:
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm index b1f7683..6394980 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -1645,10 +1645,6 @@ } void NativeWidgetNSWindowBridge::UpdateWindowGeometry() { - if (fullscreen_controller_ && - fullscreen_controller_->IsInFullscreenTransition()) - return; - gfx::Rect window_in_screen = gfx::ScreenRectFromNSRect([window_ frame]); gfx::Rect content_in_screen = gfx::ScreenRectFromNSRect( [window_ contentRectForFrameRect:[window_ frame]]);
diff --git a/components/reporting/proto/synced/record.proto b/components/reporting/proto/synced/record.proto index 48d04e2..1899e5a 100644 --- a/components/reporting/proto/synced/record.proto +++ b/components/reporting/proto/synced/record.proto
@@ -57,15 +57,16 @@ message EncryptionInfo { // Encryption key (optional). // Represents the client's X25519 public key used along with the server's - // private key (identified by |public_key_id|) for shared secret recreation - // by the server to get the symmetric key used for |encrypted_wrapped_record| - // encryption. + // private key (identified by |public_key_id|) for shared secret recreation by + // the server to compose the symmetric key used for |encrypted_wrapped_record| + // encryption. Is transmitted in plaintext. optional bytes encryption_key = 1; // Public key id (optional) - // Hash of the public key used to do encryption. Used to identity the - // private key for decryption. If no key_id is present, it is assumed that - // |key| has been transferred in plaintext. + // Hash of the public key used to do encryption. Used to identity the server + // private key for decryption. If no key_id is present, + // |encrypted_wrapped_record| is transmitted in plaintext (which has become a + // test-only feature). optional int64 public_key_id = 2; } @@ -73,15 +74,17 @@ message SequenceInformation { // Sequencing ID (monotonic number, required) // Tracks records processing progress and is used for confirming that this - // and all prior records have been processed. If the same number is + // and all prior records have been processed. Always starts from zero, and + // increases by one each time in a perfect world. If the same number is // encountered more than once, only one instance needs to be processed. If // certain number is absent when higher are encountered, it indicates that - // some records have been lost and there is a gap in the records stream - // (what to do with that is a decision that the caller needs to make). + // some records have been lost and there is a gap in the records stream (what + // to do with that is a decision that the caller needs to make). optional int64 sequencing_id = 1; - // Generation ID (required). Unique per device and priority. Generated anew - // when previous record digest is not found at startup (e.g. after powerwash). + // Generation ID (required). Unique per device and priority. Generated + // randomly anew when previous record digest is not found at startup (e.g. + // after powerwash). optional int64 generation_id = 2; // Priority (required) @@ -93,10 +96,10 @@ // disk and sent to the server. message EncryptedRecord { // Encrypted Wrapped Record (required) - // |WrappedRecord| encrypted with the |encryption_key| in |encryption_info|. - // When absent, indicates gap - respective record is irreparably corrupt or - // missing from Storage, and server side should log it as such and no longer - // expect client to deliver it. + // |WrappedRecord| encrypted with the symmetric key. When absent, indicates + // gap - respective record is irreparably corrupt or missing from Storage, and + // server side should log it as such and no longer expect client to deliver + // it. Otherwise, must be present. optional bytes encrypted_wrapped_record = 1; // Must be present to facilitate decryption of encrypted record.
diff --git a/components/signin/core/browser/BUILD.gn b/components/signin/core/browser/BUILD.gn index 64c2d2b..efe9ed3 100644 --- a/components/signin/core/browser/BUILD.gn +++ b/components/signin/core/browser/BUILD.gn
@@ -84,8 +84,8 @@ "active_directory_account_reconcilor_delegate.h", ] deps += [ + "//ash/components/tpm", "//chromeos/crosapi/mojom", - "//chromeos/tpm:tpm", ] sources -= [ "signin_status_metrics_provider.cc", @@ -153,8 +153,8 @@ if (is_chromeos_ash) { deps += [ + "//ash/components/tpm:test_support", "//chromeos/crosapi/mojom", - "//chromeos/tpm:test_support", ] sources -= [ "account_investigator_unittest.cc",
diff --git a/components/signin/core/browser/DEPS b/components/signin/core/browser/DEPS index 18afe92..b166d8a 100644 --- a/components/signin/core/browser/DEPS +++ b/components/signin/core/browser/DEPS
@@ -6,11 +6,10 @@ specific_include_rules = { "active_directory_account_reconcilor_delegate.cc": [ - "+chromeos/tpm/install_attributes.h" + "+ash/components/tpm/install_attributes.h" ], "account_reconcilor_unittest.cc": [ - "+chromeos/tpm/install_attributes.h", - "+chromeos/tpm/stub_install_attributes.h" + "+ash/components/tpm/stub_install_attributes.h" ], # TODO(crbug.com/1198528): remove Lacros deps after the rollout. "chrome_connected_header_helper.cc": [
diff --git a/components/signin/core/browser/account_reconcilor_unittest.cc b/components/signin/core/browser/account_reconcilor_unittest.cc index 6faa4028..ca41105 100644 --- a/components/signin/core/browser/account_reconcilor_unittest.cc +++ b/components/signin/core/browser/account_reconcilor_unittest.cc
@@ -48,7 +48,7 @@ #endif #if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chromeos/tpm/stub_install_attributes.h" +#include "ash/components/tpm/stub_install_attributes.h" #include "components/signin/core/browser/active_directory_account_reconcilor_delegate.h" #endif
diff --git a/components/signin/core/browser/active_directory_account_reconcilor_delegate.cc b/components/signin/core/browser/active_directory_account_reconcilor_delegate.cc index 637d53e6..c5360ea 100644 --- a/components/signin/core/browser/active_directory_account_reconcilor_delegate.cc +++ b/components/signin/core/browser/active_directory_account_reconcilor_delegate.cc
@@ -4,8 +4,8 @@ #include "components/signin/core/browser/active_directory_account_reconcilor_delegate.h" +#include "ash/components/tpm/install_attributes.h" #include "base/containers/contains.h" -#include "chromeos/tpm/install_attributes.h" #include "google_apis/gaia/core_account_id.h" namespace signin {
diff --git a/components/subresource_filter/FILTER_LIST_GENERATION.md b/components/subresource_filter/FILTER_LIST_GENERATION.md index d9b1e2a..4ecb0792 100644 --- a/components/subresource_filter/FILTER_LIST_GENERATION.md +++ b/components/subresource_filter/FILTER_LIST_GENERATION.md
@@ -103,3 +103,25 @@ 2. out/Release/ruleset_converter --input_format=filter-list --output_format=unindexed-ruleset --input_files=final_list.txt --output_file=final_list_unindexed 3. out/Release/subresource_indexing_tool final_list_unindexed final_list_indexed ``` + +# Generating and using a mock ruleset for development/testing + +It can be useful for development and testing to create a custom ruleset to activate the filter on your testing page: + +1. Grab easylist: https://easylist.to/easylist/easylist.txt or create your own, see https://adblockplus.org/filter-cheatsheet for the format. Here's an example `mock_easylist.txt`: + ``` + ||mockad.glitch.me^ + ``` + Will filter a subframe coming from `http(s)://mockad.glitch.me`. +2. Build tools needed to build the ruleset: `autoninja -C out/Release subresource_filter_tools` +3. Run `./out/Release/ruleset_converter --input_format=filter-list --output_format=unindexed-ruleset --input_files=mock_easylist.txt --output_file=mock_easylist_unindexed` +4. In `chrome://components` ensure "Subresource Filter Rules" has a non-0 version number or click "Check For Update". This ensures the path used in the following steps is created. +5. In your Chrome user-data-dir, go to the `Subresource Filter/Unindexed` directory. Duplicate the latest version directory and increment the number: e.g. `cp -R 9.34.0/ 9.34.1/` (note: long-term, Chrome may replace this with a real list again when a new version is found). +6. Update the `version` property in `manifext.json` to match the incremented version number +7. Overwrite `Filtering Rules` with the unindexed ruleset generated in step 3: `cp $CHROME_DIR/mock_easylist_indexed ./Filtering\ Rules` +8. Remove `manifest.fingerprint` and `\_metadata`, leaving just `Filtering Rules`, `LICENSE.txt`, and `manifest.json`: `rm -rf manifest.fingerprint _metadata` +9. Open Chrome. Confirm you're on the incremented version in chrome://components. A matching version directory should be created in `Subresource Filter/Indexed`, e.g. `Subresource Filter/Indexed Rules/35/9.34.1` + +The ruleset is now loaded in Chrome but filtering will only occur on a pages +that have the ad blocker activated. Activation can be simulated using the "Force ad +blocking on this site" option in [DevTools Settings](https://www.chromium.org/testing-chrome-ad-filtering/).
diff --git a/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc b/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc index 92cd3c6..4ffccc0 100644 --- a/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc +++ b/components/url_formatter/spoof_checks/idn_spoof_checker_unittest.cc
@@ -1328,63 +1328,73 @@ TEST(IDNSpoofCheckerNoFixtureTest, MultipleSkeletons) { IDNSpoofChecker checker; // apple with U+04CF (ӏ) - const GURL url("http://appӏe.com"); - const url_formatter::IDNConversionResult result = - UnsafeIDNToUnicodeWithDetails(url.host()); - Skeletons skeletons = checker.GetSkeletons(result.result); - EXPECT_EQ(Skeletons({"apple.corn", "appie.corn"}), skeletons); + const GURL url1("http://appӏe.com"); + const url_formatter::IDNConversionResult result1 = + UnsafeIDNToUnicodeWithDetails(url1.host()); + Skeletons skeletons1 = checker.GetSkeletons(result1.result); + EXPECT_EQ(Skeletons({"apple.corn", "appie.corn"}), skeletons1); + + const GURL url2("http://œxamþle.com"); + const url_formatter::IDNConversionResult result2 = + UnsafeIDNToUnicodeWithDetails(url2.host()); + Skeletons skeletons2 = checker.GetSkeletons(result2.result); + // This skeleton set doesn't include strings with "œ" because it gets + // converted to "oe" by ICU during skeleton extraction. + EXPECT_EQ(Skeletons({"oexarnþle.corn", "oexarnple.corn", "oexarnble.corn", + "cexarnþle.corn", "cexarnple.corn", "cexarnble.corn"}), + skeletons2); } TEST(IDNSpoofCheckerNoFixtureTest, AlternativeSkeletons) { struct TestCase { - // Skeleton whose alternative skeletons will be generated - std::string skeleton; - // Maximum number of skeletons to generate. - size_t max_skeletons; - // Expected skeleton set. - Skeletons expected_skeletons; - } kTestCases[] = {{"", 0, {}}, - {"", 1, {}}, - {"", 2, {}}, - {"", 100, {}}, + // String whose alternative strings will be generated + std::u16string input; + // Maximum number of alternative strings to generate. + size_t max_alternatives; + // Expected string set. + base::flat_set<std::u16string> expected_strings; + } kTestCases[] = { + {u"", 0, {}}, + {u"", 1, {}}, + {u"", 2, {}}, + {u"", 100, {}}, - {"a", 0, {}}, - {"a", 1, {"a"}}, - {"a", 2, {"a"}}, - {"a", 100, {"a"}}, + {u"a", 0, {}}, + {u"a", 1, {u"a"}}, + {u"a", 2, {u"a"}}, + {u"a", 100, {u"a"}}, - {"ab", 0, {}}, - {"ab", 1, {"ab"}}, - {"ab", 2, {"ab"}}, - {"ab", 100, {"ab"}}, + {u"ab", 0, {}}, + {u"ab", 1, {u"ab"}}, + {u"ab", 2, {u"ab"}}, + {u"ab", 100, {u"ab"}}, - {"œ", 0, {}}, - {"œ", 1, {"œ"}}, - {"œ", 2, {"œ", "ce"}}, - {"œ", 100, {"œ", "ce", "oe"}}, + {u"œ", 0, {}}, + {u"œ", 1, {u"œ"}}, + {u"œ", 2, {u"œ", u"ce"}}, + {u"œ", 100, {u"œ", u"ce", u"oe"}}, - {"œxample", 0, {}}, - {"œxample", 1, {"œxample"}}, - {"œxample", 2, {"œxample", "cexample"}}, - {"œxample", 100, {"œxample", "cexample", "oexample"}}, + {u"œxample", 0, {}}, + {u"œxample", 1, {u"œxample"}}, + {u"œxample", 2, {u"œxample", u"cexample"}}, + {u"œxample", 100, {u"œxample", u"cexample", u"oexample"}}, - {"œxamþle", 0, {}}, - {"œxamþle", 1, {"œxamþle"}}, - {"œxamþle", 2, {"œxamþle", "œxamble"}}, - {"œxamþle", - 100, - {"œxamþle", "œxample", "œxamble", "oexamþle", "oexample", - "oexamble", "cexamþle", "cexample", "cexamble"}}}; - // IDNSpoofChecker checker; + {u"œxamþle", 0, {}}, + {u"œxamþle", 1, {u"œxamþle"}}, + {u"œxamþle", 2, {u"œxamþle", u"œxamble"}}, + {u"œxamþle", + 100, + {u"œxamþle", u"œxample", u"œxamble", u"oexamþle", u"oexample", + u"oexamble", u"cexamþle", u"cexample", u"cexamble"}}}; SkeletonMap skeleton_map; skeleton_map[u'œ'] = {"ce", "oe"}; skeleton_map[u'þ'] = {"b", "p"}; for (const TestCase& test_case : kTestCases) { - Skeletons skeletons = SkeletonGenerator::GenerateSupplementalSkeletons( - test_case.skeleton, test_case.max_skeletons, skeleton_map); - EXPECT_LE(skeletons.size(), test_case.max_skeletons); - EXPECT_EQ(skeletons, test_case.expected_skeletons); + const auto strings = SkeletonGenerator::GenerateSupplementalHostnames( + test_case.input, test_case.max_alternatives, skeleton_map); + EXPECT_LE(strings.size(), test_case.max_alternatives); + EXPECT_EQ(strings, test_case.expected_strings); } }
diff --git a/components/url_formatter/spoof_checks/skeleton_generator.cc b/components/url_formatter/spoof_checks/skeleton_generator.cc index df026d6..da557a5 100644 --- a/components/url_formatter/spoof_checks/skeleton_generator.cc +++ b/components/url_formatter/spoof_checks/skeleton_generator.cc
@@ -7,6 +7,7 @@ #include <ostream> #include <queue> + #include "base/i18n/unicodestring.h" #include "base/memory/ptr_util.h" #include "base/strings/string_piece.h" @@ -20,7 +21,12 @@ using QueueItem = std::vector<std::u16string>; -} +// Maximum number of supplemental hostname to generate for a given input. +// If this number is too high, we may end up DOSing the browser process. +// If it's too low, we may not be able to cover some lookalike URLs. +const size_t kMaxSupplementalHostnames = 128; + +} // namespace SkeletonGenerator::SkeletonGenerator(const USpoofChecker* checker) : checker_(checker) { @@ -61,7 +67,6 @@ // - {U+0138 (ĸ), U+03BA (κ), U+043A (к), U+049B (қ), U+049D (ҝ), // U+049F (ҟ), U+04A1(ҡ), U+04C4 (ӄ), U+051F (ԟ)} => k // - {U+014B (ŋ), U+043F (п), U+0525 (ԥ), U+0E01 (ก), U+05D7 (ח)} => n - // - U+0153 (œ) => "ce" // TODO(crbug/843352): Handle multiple skeletons for U+0525 and U+0153. // - {U+0167 (ŧ), U+0442 (т), U+04AD (ҭ), U+050F (ԏ), U+4E03 (七), // U+4E05 (丅), U+4E06 (丆), U+4E01 (丁)} => t @@ -101,7 +106,7 @@ UNICODE_STRING_SIMPLE("ExtraConf"), icu::UnicodeString::fromUTF8( "[æӕ] > ae; [ϼҏ] > p; [ħнћңҥӈӊԋԧԩ] > h;" - "[ĸκкқҝҟҡӄԟ] > k; [ŋпԥกח] > n; œ > ce;" + "[ĸκкқҝҟҡӄԟ] > k; [ŋпԥกח] > n;" "[ŧтҭԏ七丅丆丁] > t; [ƅьҍв] > b; [ωшщพฟພຟ] > w;" "[мӎ] > m; [єҽҿၔ] > e; ґ > r; [ғӻ] > f;" "[ҫင] > c; [ұ丫] > y; [χҳӽӿ乂] > x;" @@ -121,6 +126,10 @@ DCHECK(U_SUCCESS(status)) << "Skeleton generator initialization failed due to an error: " << u_errorName(status); + + // Characters that look like multiple characters. + character_map_[u'þ'] = {"b", "p"}; + character_map_[u'œ'] = {"ce", "oe"}; } SkeletonGenerator::~SkeletonGenerator() = default; @@ -141,25 +150,34 @@ return base::i18n::UnicodeStringToString16(host); } -Skeletons SkeletonGenerator::GetSkeletons(base::StringPiece16 hostname) { +Skeletons SkeletonGenerator::GetSkeletons(base::StringPiece16 input_hostname) { + std::u16string hostname_no_diacritics = MaybeRemoveDiacritics(input_hostname); + + // Generate alternative versions of the input hostname and extract skeletons. Skeletons skeletons; - size_t hostname_length = hostname.length() - (hostname.back() == '.' ? 1 : 0); - icu::UnicodeString host(false, hostname.data(), hostname_length); - MaybeRemoveDiacritics(host); - extra_confusable_mapper_->transliterate(host); + for (const std::u16string& hostname : GenerateSupplementalHostnames( + hostname_no_diacritics, kMaxSupplementalHostnames, character_map_)) { + size_t hostname_length = + hostname.length() - (hostname.back() == '.' ? 1 : 0); + icu::UnicodeString hostname_unicode(false, hostname.data(), + hostname_length); + extra_confusable_mapper_->transliterate(hostname_unicode); - UErrorCode status = U_ZERO_ERROR; - icu::UnicodeString ustr_skeleton; + UErrorCode status = U_ZERO_ERROR; + icu::UnicodeString ustr_skeleton; - // Map U+04CF (ӏ) to lowercase L in addition to what uspoof_getSkeleton does - // (mapping it to lowercase I). - AddSkeletonMapping(host, 0x4CF /* ӏ */, 0x6C /* lowercase L */, &skeletons); + // Map U+04CF (ӏ) to lowercase L in addition to what uspoof_getSkeleton does + // (mapping it to lowercase I). + AddSkeletonMapping(hostname_unicode, 0x4CF /* ӏ */, 0x6C /* lowercase L */, + &skeletons); - uspoof_getSkeletonUnicodeString(checker_, 0, host, ustr_skeleton, &status); - if (U_SUCCESS(status)) { - std::string skeleton; - ustr_skeleton.toUTF8String(skeleton); - skeletons.insert(skeleton); + uspoof_getSkeletonUnicodeString(checker_, 0, hostname_unicode, + ustr_skeleton, &status); + if (U_SUCCESS(status)) { + std::string skeleton; + ustr_skeleton.toUTF8String(skeleton); + skeletons.insert(skeleton); + } } return skeletons; } @@ -197,18 +215,19 @@ } // static -Skeletons SkeletonGenerator::GenerateSupplementalSkeletons( - base::StringPiece input, +base::flat_set<std::u16string> SkeletonGenerator::GenerateSupplementalHostnames( + base::StringPiece16 input, size_t max_alternatives, const SkeletonMap& mapping) { + base::flat_set<std::u16string> output; if (!input.size() || max_alternatives == 0) { - return Skeletons(); + return output; } - icu::UnicodeString input_unicode = icu::UnicodeString::fromUTF8(input); + icu::UnicodeString input_unicode = + icu::UnicodeString::fromUTF8(base::UTF16ToUTF8(input)); // Read only buffer, doesn't need to be released. const char16_t* input_buffer = input_unicode.getBuffer(); - Skeletons output; // This queue contains vectors of skeleton strings. For each character in // the input string, its skeleton string will be appended to the queue item. // Thus, the number of skeleton strings in the queue item will always @@ -223,7 +242,7 @@ if (current.size() == static_cast<size_t>(input_unicode.length())) { // Reached the end of the original string. We now generated a complete // alternative string. Add the result to output. - output.insert(base::UTF16ToUTF8(base::JoinString(current, u""))); + output.insert(base::JoinString(current, u"")); if (output.size() == max_alternatives) { break; }
diff --git a/components/url_formatter/spoof_checks/skeleton_generator.h b/components/url_formatter/spoof_checks/skeleton_generator.h index 401c6ff3..114371a 100644 --- a/components/url_formatter/spoof_checks/skeleton_generator.h +++ b/components/url_formatter/spoof_checks/skeleton_generator.h
@@ -37,18 +37,26 @@ // 1. The hostname is "normalized" by removing its diacritics. This is done so // that more confusable hostnames can be detected than would be using the // plain ICU API. -// 2. Certain characters in the normalized hostname are mapped to their -// confusable equivalents using a manually curated table (extra confusable -// mapper). This table has a many-to-one relationship between characters and -// their skeletons. For example, the characters є, ҽ, ҿ, and ၔ are all +// 2. Supplemental hostname strings are generated from the normalized hostname +// using a manually curated "multiple skeleton" table. This table has a +// one-to-many relationship between characters and their skeletons. The +// number of skeletons generated by this step is capped to a maximum number. +// This step is done before ICU's skeleton generation (which is many-to-one) +// so that we can generate more supplemental hostnames. For example, ICU +// maps "œ" to "oe". Since the character "œ" won't appear in the ICU +// skeleton, we can't produce supplemental skeletons for it. Therefore, we +// must map it to "oe" and "ce" before skeleton generation. +// 3. For each supplemental hostname, the following steps are performed: +// 4. Certain characters in the hostname are mapped to their confusable +// equivalents using a manually curated table (extra confusible mapper). This +// table has a many-to-one relationship between characters and their +// skeletons. For example, the characters є, ҽ, ҿ, and ၔ are all // mapped to Latin lowercase e. -// 3. The hostname is passed to ICU to generate actual skeleton strings. -// 3. If the character U+04CF (ӏ) is present in the skeleton, another skeleton +// 5. The hostname is passed to ICU to generate actual skeleton strings. +// 6. If the character U+04CF (ӏ) is present in the skeleton, another skeleton // is generated by mapping it to lowercase L (U+6C). -// 4. Finally, alternative skeletons are generated from the skeleton set using -// a manually curated "multiple skeleton" table. This table has a one-to-many -// relationship between characters and their skeletons. The number of -// skeletons generated by this step is capped to a maximum number. +// 7. The final output is a Skeletons instance which contains one or more +// skeleton strings that represent the input hostname. class SkeletonGenerator { public: explicit SkeletonGenerator(const USpoofChecker* checker); @@ -68,11 +76,12 @@ std::u16string MaybeRemoveDiacritics(base::StringPiece16 hostname); // Returns the set of alternative strings using the one-to-many string - // mapping. Generates at most `max_alternatives` strings from the input - // string. - static Skeletons GenerateSupplementalSkeletons(base::StringPiece skeleton, - size_t max_alternatives, - const SkeletonMap& mapping); + // mapping provided in `mapping`. Generates at most `max_alternatives` strings + // from the input string. + static base::flat_set<std::u16string> GenerateSupplementalHostnames( + base::StringPiece16 input, + size_t max_alternatives, + const SkeletonMap& mapping); private: // Adds an additional mapping from |src_char| to |mapped_char| when generating @@ -90,6 +99,9 @@ std::unique_ptr<icu::Transliterator> diacritic_remover_; std::unique_ptr<icu::Transliterator> extra_confusable_mapper_; + // Map of characters to their skeletons. This map is manually curated. + std::map<char16_t, Skeletons> character_map_; + raw_ptr<const USpoofChecker> checker_; };
diff --git a/components/viz/common/BUILD.gn b/components/viz/common/BUILD.gn index 67097186..7abb58d 100644 --- a/components/viz/common/BUILD.gn +++ b/components/viz/common/BUILD.gn
@@ -38,6 +38,7 @@ deps = [ "//base", + "//build:chromeos_buildflags", "//cc/base:base", "//gpu/vulkan:buildflags", "//skia",
diff --git a/components/viz/common/resources/resource_format_utils.cc b/components/viz/common/resources/resource_format_utils.cc index cdcc20e..8beec02 100644 --- a/components/viz/common/resources/resource_format_utils.cc +++ b/components/viz/common/resources/resource_format_utils.cc
@@ -12,6 +12,7 @@ #include "base/check_op.h" #include "base/notreached.h" +#include "build/chromeos_buildflags.h" #include "ui/gfx/buffer_types.h" namespace viz { @@ -403,7 +404,13 @@ bool IsGpuMemoryBufferFormatSupported(ResourceFormat format) { switch (format) { case BGRA_8888: +#if !BUILDFLAG(IS_CHROMEOS_LACROS) + // TODO(crbug.com/1307837): On ARM devices LaCrOS can't create RED_8 + // GpuMemoryBuffer Objects with GBM device. This capability should be + // plumbed and known by clients requesting shared images as overlay + // candidate. case RED_8: +#endif case R16_EXT: case RGBA_4444: case RGBA_8888: @@ -416,6 +423,9 @@ case ETC1: case ALPHA_8: case LUMINANCE_8: +#if BUILDFLAG(IS_CHROMEOS_LACROS) + case RED_8: +#endif case RGB_565: case LUMINANCE_F16: case BGR_565:
diff --git a/components/viz/service/display/ca_layer_overlay.cc b/components/viz/service/display/ca_layer_overlay.cc index 43fcd04..1c873a3e 100644 --- a/components/viz/service/display/ca_layer_overlay.cc +++ b/components/viz/service/display/ca_layer_overlay.cc
@@ -19,6 +19,7 @@ #include "gpu/GLES2/gl2extchromium.h" #include "third_party/skia/include/core/SkDeferredDisplayList.h" #include "ui/base/cocoa/remote_layer_api.h" +#include "ui/gfx/buffer_types.h" namespace viz { @@ -44,8 +45,37 @@ // or equal to this number. const int kMaxNumVideos = 5; -void RecordCALayerHistogram(gfx::CALayerResult result) { +void RecordCALayerHistogram(gfx::CALayerResult result, + bool odd_width, + bool odd_height, + bool odd_x, + bool odd_y) { UMA_HISTOGRAM_ENUMERATION("Compositing.Renderer.CALayerResult", result); + + // Record any odd sized and odd offset videos in the current frame. + gfx::OddSize size_enum; + if (odd_width && odd_height) + size_enum = gfx::OddSize::kOddWidthAndHeight; + else if (odd_width) + size_enum = gfx::OddSize::kOddWidthOnly; + else if (odd_height) + size_enum = gfx::OddSize::kOddHeightOnly; + else + size_enum = gfx::OddSize::kEvenWidthAndHeight; + UMA_HISTOGRAM_ENUMERATION("Compositing.Renderer.CALayer.OddSizedVideo", + size_enum); + + gfx::OddOffset offset_enum; + if (odd_x && odd_y) + offset_enum = gfx::OddOffset::kOddXAndY; + else if (odd_x) + offset_enum = gfx::OddOffset::kOddXOnly; + else if (odd_y) + offset_enum = gfx::OddOffset::kOddYOnly; + else + offset_enum = gfx::OddOffset::kEvenXAndY; + UMA_HISTOGRAM_ENUMERATION("Compositing.Renderer.CALayer.OddOffsetVideo", + offset_enum); } bool FilterOperationSupported(const cc::FilterOperation& operation) { @@ -166,7 +196,11 @@ gfx::CALayerResult FromYUVVideoQuad(DisplayResourceProvider* resource_provider, const YUVVideoDrawQuad* quad, - CALayerOverlay* ca_layer_overlay) { + CALayerOverlay* ca_layer_overlay, + bool& video_with_odd_width_out, + bool& video_with_odd_height_out, + bool& video_with_odd_x_out, + bool& video_with_odd_y_out) { // For YUVVideoDrawQuads, the Y and UV planes alias the same underlying // IOSurface. Ensure all planes are overlays and have the same contents // rect. Then use the Y plane as the resource for the overlay. @@ -205,6 +239,17 @@ return gfx::kCALayerFailedYUVTexcoordMismatch; } + // Check any odd sized and odd offset video in the current frame. + if (quad->ya_tex_size.width() % 2) + video_with_odd_width_out = true; + if (quad->ya_tex_size.height() % 2) + video_with_odd_height_out = true; + float integer = 0; + if (std::modf(quad->ya_tex_coord_rect.x() / 2.f, &integer) != 0) + video_with_odd_x_out = true; + if (std::modf(quad->ya_tex_coord_rect.y() / 2.f, &integer) != 0) + video_with_odd_y_out = true; + ca_layer_overlay->contents_resource_id = y_resource_id; ca_layer_overlay->contents_rect = ya_contents_rect; ca_layer_overlay->protected_video_type = quad->protected_video_type; @@ -326,9 +371,10 @@ return gfx::kCALayerFailedSurfaceContent; case DrawQuad::Material::kYuvVideoContent: yuv_draw_quad_count++; - return FromYUVVideoQuad(resource_provider, - YUVVideoDrawQuad::MaterialCast(quad), - ca_layer_overlay); + return FromYUVVideoQuad( + resource_provider, YUVVideoDrawQuad::MaterialCast(quad), + ca_layer_overlay, video_with_odd_width_, video_with_odd_height_, + video_with_odd_x_, video_with_odd_y_); default: break; } @@ -336,9 +382,18 @@ return gfx::kCALayerFailedUnknown; } + bool video_with_odd_width() { return video_with_odd_width_; } + bool video_with_odd_height() { return video_with_odd_height_; } + bool video_with_odd_x() { return video_with_odd_x_; } + bool video_with_odd_y() { return video_with_odd_y_; } + private: const SharedQuadState* most_recent_shared_quad_state_ = nullptr; scoped_refptr<CALayerOverlaySharedState> most_recent_overlay_shared_state_; + bool video_with_odd_width_ = false; + bool video_with_odd_height_ = false; + bool video_with_odd_x_ = false; + bool video_with_odd_y_ = false; }; // Control using the CoreAnimation renderer, which is the path that replaces @@ -411,7 +466,6 @@ render_pass_backdrop_filters, CALayerOverlayList* ca_layer_overlays) const { bool failed = false; - CALayerOverlayProcessorInternal processor; for (auto it = quad_list->begin(); it != quad_list->end(); ++it) { const DrawQuad* quad = *it; @@ -485,7 +539,7 @@ } if (result != gfx::kCALayerSuccess) { - RecordCALayerHistogram(result); + RecordCALayerHistogram(result, false, false, false, false); SaveCALayerResult(result); return false; } @@ -538,7 +592,10 @@ result = gfx::kCALayerFailedTooManyQuads; } - RecordCALayerHistogram(result); + RecordCALayerHistogram(result, processor.video_with_odd_width(), + processor.video_with_odd_height(), + processor.video_with_odd_x(), + processor.video_with_odd_y()); SaveCALayerResult(result); if (result != gfx::kCALayerSuccess) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 7835771a..6cfd3c6d 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -3021,7 +3021,6 @@ "//chromeos/dbus/power:power_manager_proto", "//chromeos/network", "//chromeos/system", - "//chromeos/tpm", "//components/session_manager/core", ] }
diff --git a/content/browser/attribution_reporting/attribution_src_browsertest.cc b/content/browser/attribution_reporting/attribution_src_browsertest.cc index 7ceadbef..2241dc8 100644 --- a/content/browser/attribution_reporting/attribution_src_browsertest.cc +++ b/content/browser/attribution_reporting/attribution_src_browsertest.cc
@@ -154,17 +154,8 @@ ::testing::Values("createAttributionSrcImg($1);", "window.attributionReporting.registerSource($1);")); -// TODO(crbug.com/1307363): Consistently failing on Linux MSAN and Linux -// ChromiumOS MSAN. -#if BUILDFLAG(IS_LINUX) -#define MAYBE_AttributionSrcAnchor_SourceRegistered \ - DISABLED_AttributionSrcAnchor_SourceRegistered -#else -#define MAYBE_AttributionSrcAnchor_SourceRegistered \ - AttributionSrcAnchor_SourceRegistered -#endif IN_PROC_BROWSER_TEST_F(AttributionSrcBrowserTest, - MAYBE_AttributionSrcAnchor_SourceRegistered) { + AttributionSrcAnchor_SourceRegistered) { SourceObserver source_observer(web_contents()); GURL page_url = https_server()->GetURL("b.test", "/page_with_impression_creator.html");
diff --git a/content/browser/attribution_reporting/attributions_browsertest.cc b/content/browser/attribution_reporting/attributions_browsertest.cc index 7ce8de5..a46d898 100644 --- a/content/browser/attribution_reporting/attributions_browsertest.cc +++ b/content/browser/attribution_reporting/attributions_browsertest.cc
@@ -840,17 +840,8 @@ expected_report.WaitForReport(); } -// TODO(crbug.com/1307363): Consistently failing on Linux MSAN and Linux -// ChromiumOS MSAN. -#if BUILDFLAG(IS_LINUX) -#define MAYBE_AttributionSrcNavigationSourceAndTrigger_ReportSent \ - DISABLED_AttributionSrcNavigationSourceAndTrigger_ReportSent -#else -#define MAYBE_AttributionSrcNavigationSourceAndTrigger_ReportSent \ - AttributionSrcNavigationSourceAndTrigger_ReportSent -#endif IN_PROC_BROWSER_TEST_F(AttributionsBrowserTest, - MAYBE_AttributionSrcNavigationSourceAndTrigger_ReportSent) { + AttributionSrcNavigationSourceAndTrigger_ReportSent) { // Expected reports must be registered before the server starts. ExpectedReportWaiter expected_report( GURL("https://a.test/.well-known/attribution-reporting/"
diff --git a/content/browser/font_access/font_access_manager_impl_browsertest.cc b/content/browser/font_access/font_access_manager_impl_browsertest.cc index 185793e..160b6037 100644 --- a/content/browser/font_access/font_access_manager_impl_browsertest.cc +++ b/content/browser/font_access/font_access_manager_impl_browsertest.cc
@@ -60,7 +60,7 @@ // Must be called before the StoragePartition's FontAccessManager is accessed. // // This method replaces the StoragePartition's FontAccessManager. This leads - // to confusin if the old FontAccessManager is already in use, either due to + // to confusion if the old FontAccessManager is already in use, either due to // a font_access_manager() call, or due to JavaScript connecting to the Font // Access API. void OverrideFontAccessLocale(std::string locale) { @@ -118,17 +118,11 @@ ASSERT_TRUE(NavigateToURL(shell(), GetTestUrl(nullptr, "simple_page.html"))); font_access_manager()->SkipPrivacyChecksForTesting(true); - EvalJsResult result = - EvalJs(shell(), - "(async () => {" - " let count = 0;" - " const fonts = await " - "navigator.fonts.query({persistentAccess: true});" - " for (const item of fonts) {" - " count++;" - " }" - " return count;" - "})()"); + EvalJsResult result = EvalJs(shell(), + "(async () => {" + " const fonts = await navigator.fonts.query();" + " return fonts.length;" + "})()"); if (FontEnumerationDataSource::IsOsSupportedForTesting()) { EXPECT_LT(0, result.ExtractInt()) @@ -139,6 +133,28 @@ } } +IN_PROC_BROWSER_TEST_F(FontAccessManagerImplBrowserTest, + EnumerationTestWithInvalidSelect) { + ASSERT_TRUE(NavigateToURL(shell(), GetTestUrl(nullptr, "simple_page.html"))); + font_access_manager()->SkipPrivacyChecksForTesting(true); + + EvalJsResult result = + EvalJs(shell(), + "(async () => {" + " const fonts =" + " await navigator.fonts.query({select: ['invalid-query']});" + " return fonts.length;" + "})()"); + + if (FontEnumerationDataSource::IsOsSupportedForTesting()) { + EXPECT_EQ(0, result.ExtractInt()) + << "Enumeration should return no fonts with an invalid select query."; + } else { + // TODO(crbug.com/1296792): Figure out Android situation. + EXPECT_TRUE(!result.error.empty()); + } +} + #if BUILDFLAG(IS_WIN) IN_PROC_BROWSER_TEST_F(FontAccessManagerImplBrowserTest, LocaleTest) { ASSERT_TRUE(NavigateToURL(shell(), GetTestUrl(nullptr, "simple_page.html")));
diff --git a/content/browser/font_access/font_access_manager_impl_unittest.cc b/content/browser/font_access/font_access_manager_impl_unittest.cc index f95ca3e..ac768c5 100644 --- a/content/browser/font_access/font_access_manager_impl_unittest.cc +++ b/content/browser/font_access/font_access_manager_impl_unittest.cc
@@ -182,9 +182,10 @@ base::ReadOnlySharedMemoryRegion region) { ASSERT_EQ(status, FontEnumerationStatus::kOk) << "enumeration status is kOk"; - blink::FontEnumerationTable table; base::ReadOnlySharedMemoryMapping mapping = region.Map(); - table.ParseFromArray(mapping.memory(), mapping.size()); + ASSERT_TRUE(mapping.IsValid()); + blink::FontEnumerationTable table; + EXPECT_TRUE(table.ParseFromArray(mapping.memory(), mapping.size())); blink::FontEnumerationTable_FontMetadata previous_font; for (const auto& font : table.fonts()) { @@ -192,6 +193,7 @@ << "postscript_name size is not zero."; EXPECT_GT(font.full_name().size(), 0ULL) << "full_name size is not zero."; EXPECT_GT(font.family().size(), 0ULL) << "family size is not zero."; + EXPECT_GT(font.style().size(), 0ULL) << "style size is not zero."; if (previous_font.IsInitialized()) { EXPECT_LT(previous_font.postscript_name(), font.postscript_name())
diff --git a/content/browser/isolated_origin_browsertest.cc b/content/browser/isolated_origin_browsertest.cc index 45342297..ea32371 100644 --- a/content/browser/isolated_origin_browsertest.cc +++ b/content/browser/isolated_origin_browsertest.cc
@@ -117,6 +117,18 @@ .requires_origin_keyed_process(); } + OriginAgentClusterIsolationState DetermineOriginAgentClusterIsolation( + SiteInstanceImpl* site_instance, + const GURL& url) { + OriginAgentClusterIsolationState isolation_request = + OriginAgentClusterIsolationState::CreateNonIsolated(); + + return ChildProcessSecurityPolicyImpl::GetInstance() + ->DetermineOriginAgentClusterIsolation( + site_instance->GetIsolationContext(), url::Origin::Create(url), + isolation_request); + } + ProcessLock ProcessLockFromUrl(const std::string& url) { BrowserContext* browser_context = web_contents()->GetBrowserContext(); return ProcessLock::FromSiteInfo(SiteInfo( @@ -302,6 +314,24 @@ std::queue<std::string> content_; }; +// A set of tests that enable OriginAgentCluster by default. +class OriginIsolationDefaultOACTest : public OriginIsolationOptInHeaderTest { + public: + OriginIsolationDefaultOACTest() { + feature_list_.InitAndEnableFeature( + blink::features::kOriginAgentClusterDefaultEnabled); + } + + ~OriginIsolationDefaultOACTest() override = default; + + OriginIsolationDefaultOACTest(const OriginIsolationDefaultOACTest&) = delete; + OriginIsolationDefaultOACTest& operator=(OriginIsolationDefaultOACTest&) = + delete; + + private: + base::test::ScopedFeatureList feature_list_; +}; + class OriginIsolationPrerenderOptInHeaderTest : public OriginIsolationOptInHeaderTest { public: @@ -565,6 +595,128 @@ 1))); } +IN_PROC_BROWSER_TEST_F(OriginIsolationDefaultOACTest, Basic) { + GURL test_url(https_server()->GetURL("foo.com", + "/cross_site_iframe_factory.html?" + "foo.com(foo.com)")); + // We must load the origins to be isolated (or not) into a child frame so that + // they all stay in the same BrowsingInstance, since the test relies on + // knowing isolation history for the OriginAgentClusterEndResult::*But* cases. + // In this test, the convention is: + // foo.com is (implicitly) isolated, + // isolated.foo.com is (explicitly) isolated, + // isolated.bar.com is (implicitly) isolated, and + // bar.com is (explicitly) not isolated. + EXPECT_TRUE(NavigateToURL(shell(), test_url)); + EXPECT_EQ(2u, CollectAllRenderFrameHosts(shell()->web_contents()).size()); + FrameTreeNode* root = web_contents()->GetPrimaryFrameTree().root(); + FrameTreeNode* child_frame_node = root->child_at(0); + + // The first three scenarios should all get the isolation status they request + // (the "And" cases). + { + // Explicitly request OriginAgentCluster via the header. + SetHeaderValue("?1"); + GURL isolated_suborigin_url( + https_server()->GetURL("isolated.foo.com", "/isolate_origin")); + EXPECT_TRUE( + NavigateToURLFromRenderer(child_frame_node, isolated_suborigin_url)); + auto* site_instance = + child_frame_node->current_frame_host()->GetSiteInstance(); + EXPECT_TRUE(DetermineOriginAgentClusterIsolation(site_instance, + isolated_suborigin_url) + .requires_origin_keyed_process()); + } + { + // Even though this request has no OriginAgentCluster header, it should get + // OAC by default. + SetHeaderValue(""); + GURL default_isolated_url( + https_server()->GetURL("isolated.bar.com", "/title1.html")); + EXPECT_TRUE( + NavigateToURLFromRenderer(child_frame_node, default_isolated_url)); + + auto* site_instance = + child_frame_node->current_frame_host()->GetSiteInstance(); + OriginAgentClusterIsolationState isolation_state = + DetermineOriginAgentClusterIsolation(site_instance, + default_isolated_url); + // TODO(wjmaclean): If OriginAgentCluster-by-default transitions to using + // process-isolation at some future date, the second expectation below will + // need to change to EXPECT_TRUE. + EXPECT_TRUE(isolation_state.is_origin_agent_cluster()); + EXPECT_FALSE(isolation_state.requires_origin_keyed_process()); + } + { + // The "isolate_origin" path in the url will force the test framework to + // include the OriginAgentCluster header. Here we explicitly request not to + // have OAC. + SetHeaderValue("?0"); + GURL explicit_non_isolated_url( + https_server()->GetURL("bar.com", "/isolate_origin")); + EXPECT_TRUE( + NavigateToURLFromRenderer(child_frame_node, explicit_non_isolated_url)); + auto* site_instance = + child_frame_node->current_frame_host()->GetSiteInstance(); + + EXPECT_FALSE(DetermineOriginAgentClusterIsolation(site_instance, + explicit_non_isolated_url) + .is_origin_agent_cluster()); + } + + // The next three cases should all fail to get the isolation status they + // request (the "But" cases). In these cases, URLs from origins we have + // already visited in the BrowsingInstance return different OAC header values, + // but are forced to stick with their earlier value rather than the newly + // requested value. + { + // Even though the lack of a header would normally lead to default OAC + // isolation, the previous explicitly non-isolated visit to this origin + // means that this origin will remain not origin keyed. + SetHeaderValue(""); + GURL url(https_server()->GetURL("bar.com", "/title1.html")); + EXPECT_TRUE(NavigateToURLFromRenderer(child_frame_node, url)); + auto* site_instance = + child_frame_node->current_frame_host()->GetSiteInstance(); + + EXPECT_FALSE(DetermineOriginAgentClusterIsolation(site_instance, url) + .is_origin_agent_cluster()); + } + + { + // An explicit opt-out for isolated.bar.com should not be granted given the + // previous default-opt-in above. + SetHeaderValue("?0"); + GURL explicit_non_isolated_url( + https_server()->GetURL("isolated.bar.com", "/isolate_origin")); + EXPECT_TRUE( + NavigateToURLFromRenderer(child_frame_node, explicit_non_isolated_url)); + auto* site_instance = + child_frame_node->current_frame_host()->GetSiteInstance(); + + OriginAgentClusterIsolationState isolation_state = + DetermineOriginAgentClusterIsolation(site_instance, + explicit_non_isolated_url); + EXPECT_TRUE(isolation_state.is_origin_agent_cluster()); + EXPECT_FALSE(isolation_state.requires_origin_keyed_process()); + } + { + // Verify that we don't explicitly opt-in an origin that was explicitly + // opted-out. + SetHeaderValue("?1"); + GURL explicit_isolated_url( + https_server()->GetURL("bar.com", "/isolate_origin")); + EXPECT_TRUE( + NavigateToURLFromRenderer(child_frame_node, explicit_isolated_url)); + auto* site_instance = + child_frame_node->current_frame_host()->GetSiteInstance(); + + EXPECT_FALSE(DetermineOriginAgentClusterIsolation(site_instance, + explicit_isolated_url) + .is_origin_agent_cluster()); + } +} + // These tests ensure that non-HTTPS secure contexts (see // https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy) are // able to use origin isolation.
diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc index fc2cedfa..41b9640 100644 --- a/content/browser/media/encrypted_media_browsertest.cc +++ b/content/browser/media/encrypted_media_browsertest.cc
@@ -304,8 +304,9 @@ // TODO(crbug.com/707127): Decide when it's supported on Android. #if !BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_FUCHSIA) && defined(PLATFORM_IS_ARM)) // https://crbug.com/1222685 +// https://crbug.com/1280308 #define MAYBE_Playback_VideoOnly_WebM_VP9Profile2 \ DISABLED_Playback_VideoOnly_WebM_VP9Profile2 #else
diff --git a/content/browser/renderer_host/cursor_manager_unittest.cc b/content/browser/renderer_host/cursor_manager_unittest.cc index c1a0b0c3..291c2d79 100644 --- a/content/browser/renderer_host/cursor_manager_unittest.cc +++ b/content/browser/renderer_host/cursor_manager_unittest.cc
@@ -7,9 +7,9 @@ #include "base/memory/raw_ptr.h" #include "build/build_config.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/mock_render_widget_host.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/site_instance_group.h" #include "content/common/cursors/webcursor.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/mock_render_process_host.h" @@ -58,8 +58,8 @@ browser_context_ = std::make_unique<TestBrowserContext>(); process_host_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); - agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*process_host_); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_host_.get())); widget_host_ = MakeNewWidgetHost(); top_view_ = new MockRenderWidgetHostViewForCursors(widget_host_.get(), true); @@ -68,7 +68,7 @@ std::unique_ptr<RenderWidgetHostImpl> MakeNewWidgetHost() { int32_t routing_id = process_host_->GetNextRoutingID(); return MockRenderWidgetHost::Create( - /*frame_tree=*/nullptr, &delegate_, *agent_scheduling_group_host_, + /*frame_tree=*/nullptr, &delegate_, site_instance_group_->GetSafeRef(), routing_id); } @@ -78,7 +78,7 @@ widget_host_ = nullptr; process_host_->Cleanup(); - agent_scheduling_group_host_ = nullptr; + site_instance_group_.reset(); process_host_ = nullptr; } @@ -87,7 +87,7 @@ std::unique_ptr<BrowserContext> browser_context_; std::unique_ptr<MockRenderProcessHost> process_host_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; std::unique_ptr<RenderWidgetHostImpl> widget_host_; // Tests should set this to nullptr if they've already triggered its
diff --git a/content/browser/renderer_host/input/fling_scheduler_unittest.cc b/content/browser/renderer_host/input/fling_scheduler_unittest.cc index ffb52587..f8de4972b 100644 --- a/content/browser/renderer_host/input/fling_scheduler_unittest.cc +++ b/content/browser/renderer_host/input/fling_scheduler_unittest.cc
@@ -6,6 +6,7 @@ #include "build/build_config.h" #include "content/browser/renderer_host/agent_scheduling_group_host.h" +#include "content/browser/site_instance_group.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/mock_render_process_host.h" #include "content/public/test/test_browser_context.h" @@ -74,7 +75,7 @@ widget_host_->ShutdownAndDestroyWidget(false); widget_host_.reset(); process_host_->Cleanup(); - agent_scheduling_group_host_.reset(); + site_instance_group_.reset(); process_host_.reset(); browser_context_.reset(); @@ -86,13 +87,13 @@ process_host_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); process_host_->Init(); - agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*process_host_); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_host_.get())); int32_t routing_id = process_host_->GetNextRoutingID(); delegate_ = std::make_unique<MockRenderWidgetHostDelegate>(); widget_host_ = TestRenderWidgetHost::Create( /* frame_tree= */ nullptr, delegate_.get(), - *agent_scheduling_group_host_, routing_id, false); + site_instance_group_->GetSafeRef(), routing_id, false); delegate_->set_widget_host(widget_host_.get()); return std::make_unique<TestRenderWidgetHostView>(widget_host_.get()); } @@ -135,7 +136,7 @@ std::unique_ptr<TestBrowserContext> browser_context_; std::unique_ptr<RenderWidgetHostImpl> widget_host_; std::unique_ptr<MockRenderProcessHost> process_host_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; std::unique_ptr<TestRenderWidgetHostView> view_; std::unique_ptr<MockRenderWidgetHostDelegate> delegate_; #if BUILDFLAG(IS_WIN)
diff --git a/content/browser/renderer_host/input/mouse_latency_browsertest.cc b/content/browser/renderer_host/input/mouse_latency_browsertest.cc index 271a613..2a1e7219 100644 --- a/content/browser/renderer_host/input/mouse_latency_browsertest.cc +++ b/content/browser/renderer_host/input/mouse_latency_browsertest.cc
@@ -78,13 +78,13 @@ public: TracingRenderWidgetHost(FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) : RenderWidgetHostImpl(frame_tree, /*self_owned=*/false, delegate, - agent_scheduling_group, + std::move(site_instance_group), routing_id, hidden, /*renderer_initiated_creation=*/false, @@ -116,11 +116,12 @@ std::unique_ptr<RenderWidgetHostImpl> CreateRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) override { return std::make_unique<TracingRenderWidgetHost>( - frame_tree, delegate, agent_scheduling_group, routing_id, hidden); + frame_tree, delegate, std::move(site_instance_group), routing_id, + hidden); } };
diff --git a/content/browser/renderer_host/mock_render_widget_host.cc b/content/browser/renderer_host/mock_render_widget_host.cc index e96e96e..190e263f 100644 --- a/content/browser/renderer_host/mock_render_widget_host.cc +++ b/content/browser/renderer_host/mock_render_widget_host.cc
@@ -44,23 +44,23 @@ std::unique_ptr<MockRenderWidgetHost> MockRenderWidgetHost::Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id) { - return Create(frame_tree, delegate, agent_scheduling_group, routing_id, - TestRenderWidgetHost::CreateStubWidgetRemote()); + return Create(frame_tree, delegate, std::move(site_instance_group), + routing_id, TestRenderWidgetHost::CreateStubWidgetRemote()); } // static std::unique_ptr<MockRenderWidgetHost> MockRenderWidgetHost::Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, mojo::PendingAssociatedRemote<blink::mojom::Widget> pending_blink_widget) { DCHECK(pending_blink_widget); - return base::WrapUnique( - new MockRenderWidgetHost(frame_tree, delegate, agent_scheduling_group, - routing_id, std::move(pending_blink_widget))); + return base::WrapUnique(new MockRenderWidgetHost( + frame_tree, delegate, std::move(site_instance_group), routing_id, + std::move(pending_blink_widget))); } blink::mojom::WidgetInputHandler* @@ -75,13 +75,13 @@ MockRenderWidgetHost::MockRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int routing_id, mojo::PendingAssociatedRemote<blink::mojom::Widget> pending_blink_widget) : RenderWidgetHostImpl(frame_tree, /*self_owned=*/false, delegate, - agent_scheduling_group, + std::move(site_instance_group), routing_id, /*hidden=*/false, /*renderer_initiated_creation=*/false,
diff --git a/content/browser/renderer_host/mock_render_widget_host.h b/content/browser/renderer_host/mock_render_widget_host.h index 6742d97..b757218 100644 --- a/content/browser/renderer_host/mock_render_widget_host.h +++ b/content/browser/renderer_host/mock_render_widget_host.h
@@ -64,13 +64,13 @@ static std::unique_ptr<MockRenderWidgetHost> Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id); static std::unique_ptr<MockRenderWidgetHost> Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, mojo::PendingAssociatedRemote<blink::mojom::Widget> pending_blink_widget); @@ -88,7 +88,7 @@ MockRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, mojo::PendingAssociatedRemote<blink::mojom::Widget> pending_blink_widget);
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index d0961b6..448953b 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc
@@ -2717,7 +2717,12 @@ } void NavigationRequest::CheckForIsolationOptIn(const GURL& url) { - if (!IsOptInIsolationRequested()) + // Check whether an origin-keyed agent cluster is either explicitly requested + // or implied (i.e., on by default), before attempting to isolate it. If + // requested or implied, then we must check if the origin has been previously + // encountered in order to remain consistent within the isolation context + // (BrowserContext). + if (!IsOptInIsolationRequested() && !IsIsolationImplied()) return; auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); @@ -2748,13 +2753,24 @@ void NavigationRequest::AddSameProcessOriginAgentClusterOptInIfNecessary( const IsolationContext& isolation_context, const GURL& url) { - // If site isolation isn't disabled and OriginAgentCluster is allowed to use - // process isolation, then no need to add the opt-in here; it will be handled - // when the origin's SiteInstance is created. - if (SiteIsolationPolicy::IsProcessIsolationForOriginAgentClusterEnabled() || - !IsOptInIsolationRequested()) { - return; + bool should_isolate_origin = false; + if (IsIsolationImplied()) { + // If OAC-by-default is enabled, then we can have origin-keyed agent + // clusters with site-keyed processes (when no header is present) + // alongside origin-keyed agent clusters with origin-keyed processes (when + // a header is present). For this case when the header is absent, try to + // register the origin in a site-keyed process below. + should_isolate_origin = true; + } else if (IsOptInIsolationRequested()) { + // If OAC-by-default is disabled and the origin requests isolation, we + // should only register it in a site-keyed process below if Site Isolation + // is disabled for OAC. Otherwise it will be handled when the origin's + // SiteInstance is created. + should_isolate_origin = + !SiteIsolationPolicy::IsProcessIsolationForOriginAgentClusterEnabled(); } + if (!should_isolate_origin) + return; // Since site isolation is disabled, we can't rely on the newly created // SiteInstance to add the origin as OAC, so we do it manually here.
diff --git a/content/browser/renderer_host/render_frame_host_delegate.cc b/content/browser/renderer_host/render_frame_host_delegate.cc index 00a32dae..f8b3042 100644 --- a/content/browser/renderer_host/render_frame_host_delegate.cc +++ b/content/browser/renderer_host/render_frame_host_delegate.cc
@@ -168,7 +168,7 @@ } RenderWidgetHostImpl* RenderFrameHostDelegate::CreateNewPopupWidget( - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t route_id, mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host,
diff --git a/content/browser/renderer_host/render_frame_host_delegate.h b/content/browser/renderer_host/render_frame_host_delegate.h index 5ec02c03..9019556 100644 --- a/content/browser/renderer_host/render_frame_host_delegate.h +++ b/content/browser/renderer_host/render_frame_host_delegate.h
@@ -12,6 +12,7 @@ #include "base/callback_forward.h" #include "base/i18n/rtl.h" +#include "base/memory/safe_ref.h" #include "build/build_config.h" #include "components/viz/common/surfaces/surface_id.h" #include "content/browser/renderer_host/render_frame_host_impl.h" @@ -94,12 +95,12 @@ } namespace content { -class AgentSchedulingGroupHost; class FrameTreeNode; class PrerenderHostRegistry; class RenderFrameHostImpl; class RenderWidgetHostImpl; class SessionStorageNamespace; +class SiteInstanceGroup; struct AXEventNotificationDetails; struct AXLocationChangeNotificationDetails; struct ContextMenuParams; @@ -561,10 +562,10 @@ // The page is trying to open a new widget (e.g. a select popup). The // widget should be created associated with the given - // |agent_scheduling_group|, but it should not be shown yet. That should + // |site_instance_group|, but it should not be shown yet. That should // happen in response to ShowCreatedWidget. virtual RenderWidgetHostImpl* CreateNewPopupWidget( - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t route_id, mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host,
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index bd98463..a159147 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -1495,7 +1495,8 @@ DCHECK_EQ(nullptr, GetLocalRenderWidgetHost()); owned_render_widget_host_ = RenderWidgetHostFactory::Create( frame_tree_, frame_tree_->render_widget_delegate(), - agent_scheduling_group_, widget_routing_id, /*hidden=*/true, + site_instance_->group()->GetSafeRef(), widget_routing_id, + /*hidden=*/true, /*renderer_initiated_creation=*/false); } @@ -2958,7 +2959,7 @@ void RenderFrameHostImpl::RenderProcessGone( SiteInstanceGroup* site_instance_group, const ChildProcessTerminationInfo& info) { - DCHECK_EQ(site_instance_.get()->group(), site_instance_group); + DCHECK_EQ(site_instance_->group(), site_instance_group); if (IsInBackForwardCache()) { EvictFromBackForwardCacheWithReason( @@ -7238,7 +7239,7 @@ // widgets in various global tables. int32_t widget_route_id = GetProcess()->GetNextRoutingID(); RenderWidgetHostImpl* widget = delegate_->CreateNewPopupWidget( - agent_scheduling_group_, widget_route_id, + site_instance_->group()->GetSafeRef(), widget_route_id, std::move(blink_popup_widget_host), std::move(blink_widget_host), std::move(blink_widget)); if (!widget)
diff --git a/content/browser/renderer_host/render_view_host_factory.cc b/content/browser/renderer_host/render_view_host_factory.cc index d244386..284e040 100644 --- a/content/browser/renderer_host/render_view_host_factory.cc +++ b/content/browser/renderer_host/render_view_host_factory.cc
@@ -42,18 +42,16 @@ std::move(main_browsing_context_state)); } - RenderViewHostImpl* view_host = - new RenderViewHostImpl(frame_tree, instance, - RenderWidgetHostFactory::Create( - frame_tree, widget_delegate, - static_cast<SiteInstanceImpl*>(instance) - ->group() - ->agent_scheduling_group(), - widget_routing_id, - /*hidden=*/true, renderer_initiated_creation), - delegate, routing_id, main_frame_routing_id, - swapped_out, true /* has_initialized_audio_host */, - std::move(main_browsing_context_state)); + RenderViewHostImpl* view_host = new RenderViewHostImpl( + frame_tree, instance, + RenderWidgetHostFactory::Create( + frame_tree, widget_delegate, + static_cast<SiteInstanceImpl*>(instance)->group()->GetSafeRef(), + widget_routing_id, + /*hidden=*/true, renderer_initiated_creation), + delegate, routing_id, main_frame_routing_id, swapped_out, + true /* has_initialized_audio_host */, + std::move(main_browsing_context_state)); return view_host; }
diff --git a/content/browser/renderer_host/render_widget_host_factory.cc b/content/browser/renderer_host/render_widget_host_factory.cc index 64ad4a5..b370b74 100644 --- a/content/browser/renderer_host/render_widget_host_factory.cc +++ b/content/browser/renderer_host/render_widget_host_factory.cc
@@ -16,16 +16,17 @@ std::unique_ptr<RenderWidgetHostImpl> RenderWidgetHostFactory::Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, bool renderer_initiated_creation) { if (factory_) { - return factory_->CreateRenderWidgetHost( - frame_tree, delegate, agent_scheduling_group, routing_id, hidden); + return factory_->CreateRenderWidgetHost(frame_tree, delegate, + std::move(site_instance_group), + routing_id, hidden); } return RenderWidgetHostImpl::Create( - frame_tree, delegate, agent_scheduling_group, routing_id, hidden, + frame_tree, delegate, std::move(site_instance_group), routing_id, hidden, renderer_initiated_creation, std::make_unique<FrameTokenMessageQueue>()); }
diff --git a/content/browser/renderer_host/render_widget_host_factory.h b/content/browser/renderer_host/render_widget_host_factory.h index 30a0a2b..143e7bc 100644 --- a/content/browser/renderer_host/render_widget_host_factory.h +++ b/content/browser/renderer_host/render_widget_host_factory.h
@@ -8,14 +8,15 @@ #include <stdint.h> #include <memory> +#include "base/memory/safe_ref.h" #include "content/common/content_export.h" #include "mojo/public/cpp/bindings/pending_remote.h" namespace content { -class AgentSchedulingGroupHost; class FrameTree; class RenderWidgetHostDelegate; class RenderWidgetHostImpl; +class SiteInstanceGroup; // A factory for creating RenderWidgetHostImpls. There is a global factory // function that can be installed for the purposes of testing to provide a @@ -31,7 +32,7 @@ static std::unique_ptr<RenderWidgetHostImpl> Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, bool renderer_initiated_creation); @@ -48,7 +49,7 @@ virtual std::unique_ptr<RenderWidgetHostImpl> CreateRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) = 0;
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index d6b7b25..606015f 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -395,27 +395,29 @@ std::unique_ptr<RenderWidgetHostImpl> RenderWidgetHostImpl::Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_host, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, bool renderer_initiated_creation, std::unique_ptr<FrameTokenMessageQueue> frame_token_message_queue) { return base::WrapUnique(new RenderWidgetHostImpl( frame_tree, - /*self_owned=*/false, delegate, agent_scheduling_host, routing_id, hidden, - renderer_initiated_creation, std::move(frame_token_message_queue))); + /*self_owned=*/false, delegate, std::move(site_instance_group), + routing_id, hidden, renderer_initiated_creation, + std::move(frame_token_message_queue))); } // static RenderWidgetHostImpl* RenderWidgetHostImpl::CreateSelfOwned( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_host, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, std::unique_ptr<FrameTokenMessageQueue> frame_token_message_queue) { return new RenderWidgetHostImpl(frame_tree, /*self_owned=*/true, delegate, - agent_scheduling_host, routing_id, hidden, + std::move(site_instance_group), routing_id, + hidden, /*renderer_initiated_creation=*/true, std::move(frame_token_message_queue)); } @@ -424,7 +426,7 @@ FrameTree* frame_tree, bool self_owned, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, bool renderer_initiated_creation, @@ -433,7 +435,8 @@ self_owned_(self_owned), waiting_for_init_(renderer_initiated_creation), delegate_(delegate), - agent_scheduling_group_(agent_scheduling_group), + agent_scheduling_group_(site_instance_group->agent_scheduling_group()), + site_instance_group_(std::move(site_instance_group)), routing_id_(routing_id), is_hidden_(hidden), last_view_screen_rect_(kInvalidScreenRect), @@ -450,7 +453,7 @@ #endif frame_token_message_queue_.get()), frame_sink_id_(base::checked_cast<uint32_t>( - agent_scheduling_group.GetProcess()->GetID()), + agent_scheduling_group_.GetProcess()->GetID()), base::checked_cast<uint32_t>(routing_id_)), power_mode_input_voter_( power_scheduler::PowerModeArbiter::GetInstance()->NewVoter( @@ -475,7 +478,7 @@ std::pair<RoutingIDWidgetMap::iterator, bool> result = g_routing_id_widget_map.Get().insert(std::make_pair( - RenderWidgetHostID(agent_scheduling_group.GetProcess()->GetID(), + RenderWidgetHostID(agent_scheduling_group_.GetProcess()->GetID(), routing_id_), this)); CHECK(result.second) << "Inserting a duplicate item!"; @@ -484,14 +487,14 @@ // To avoid leaking any instance. They self-delete when their renderer process // is gone. if (self_owned_) - agent_scheduling_group.GetProcess()->AddObserver(this); + agent_scheduling_group_.GetProcess()->AddObserver(this); render_process_blocked_state_changed_subscription_ = - agent_scheduling_group.GetProcess()->RegisterBlockStateChangedCallback( + agent_scheduling_group_.GetProcess()->RegisterBlockStateChangedCallback( base::BindRepeating( &RenderWidgetHostImpl::RenderProcessBlockedStateChanged, base::Unretained(this))); - agent_scheduling_group.GetProcess()->AddPriorityClient(this); + agent_scheduling_group_.GetProcess()->AddPriorityClient(this); SetupInputRouter(); @@ -2630,6 +2633,10 @@ } } +SiteInstanceGroup* RenderWidgetHostImpl::GetSiteInstanceGroup() { + return &*site_instance_group_; +} + // static bool RenderWidgetHostImpl::DidVisualPropertiesSizeChange( const blink::VisualProperties& old_visual_properties,
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 5cc97c9..5e2e1fe4 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -21,6 +21,7 @@ #include "base/gtest_prod_util.h" #include "base/memory/raw_ptr.h" #include "base/memory/read_only_shared_memory_region.h" +#include "base/memory/safe_ref.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/process/kill.h" @@ -100,7 +101,6 @@ } namespace content { -class AgentSchedulingGroupHost; class BrowserAccessibilityManager; class FlingSchedulerBase; class FrameTree; @@ -108,6 +108,7 @@ class MockRenderWidgetHost; class PeakGpuMemoryTracker; class RenderWidgetHostOwnerDelegate; +class SiteInstanceGroup; class SyntheticGestureController; class TimeoutMonitor; class TouchEmulator; @@ -158,7 +159,7 @@ static std::unique_ptr<RenderWidgetHostImpl> Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_host, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, bool renderer_initiated_creation, @@ -174,7 +175,7 @@ static RenderWidgetHostImpl* CreateSelfOwned( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_host, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, std::unique_ptr<FrameTokenMessageQueue> frame_token_message_queue); @@ -877,15 +878,19 @@ void OnLocalSurfaceIdChanged( const cc::RenderFrameMetadata& metadata) override; + SiteInstanceGroup* GetSiteInstanceGroup(); + protected: // |routing_id| must not be MSG_ROUTING_NONE. // If this object outlives |delegate|, DetachDelegate() must be called when - // |delegate| goes away. + // |delegate| goes away. |site_instance_group| will outlive this + // widget but we store it via a `base::SafeRef` instead of a scoped_refptr to + // not create a cycle and keep alive the `SiteInstanceGroup`. RenderWidgetHostImpl( FrameTree* frame_tree, bool self_owned, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_host, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden, bool renderer_initiated_creation, @@ -1166,9 +1171,15 @@ // AgentSchedulingGroupHost to be used for IPC with the corresponding // (renderer-side) AgentSchedulingGroup. Its channel may be nullptr if the - // renderer crashed. + // renderer crashed. We store it here as a separate reference instead of + // dynamically fetching it from `site_instance_group_` since its + // value gets cleared early in `SiteInstanceGroup` via + // RenderProcessHostDestroyed before this object is destroyed. AgentSchedulingGroupHost& agent_scheduling_group_; + // The SiteInstanceGroup this RenderWidgetHost belongs to. + base::SafeRef<SiteInstanceGroup> site_instance_group_; + // The ID of the corresponding object in the Renderer Instance. const int routing_id_;
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc b/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc index 03c0396..6a6114c 100644 --- a/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_input_event_router_unittest.cc
@@ -20,6 +20,7 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_child_frame.h" #include "content/browser/renderer_host/render_widget_targeter.h" +#include "content/browser/site_instance_group.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/mock_render_process_host.h" #include "content/public/test/test_browser_context.h" @@ -211,10 +212,11 @@ process_host_root_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); - agent_scheduling_group_host_root_ = - std::make_unique<AgentSchedulingGroupHost>(*process_host_root_); + site_instance_group_root_ = base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_host_root_.get())); widget_host_root_ = RenderWidgetHostImpl::Create( - /*frame_tree=*/nullptr, &delegate_, *agent_scheduling_group_host_root_, + /*frame_tree=*/nullptr, &delegate_, + site_instance_group_root_->GetSafeRef(), process_host_root_->GetNextRoutingID(), /*hidden=*/false, /*renderer_initiated_creation=*/false, std::make_unique<FrameTokenMessageQueue>()); @@ -254,7 +256,7 @@ struct ChildViewState { std::unique_ptr<MockRenderProcessHost> process_host; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host; + scoped_refptr<SiteInstanceGroup> site_instance_group; std::unique_ptr<RenderWidgetHostImpl> widget_host; std::unique_ptr<TestRenderWidgetHostViewChildFrame> view; std::unique_ptr<MockFrameConnector> frame_connector; @@ -269,10 +271,12 @@ child.process_host = std::make_unique<MockRenderProcessHost>(browser_context_.get()); - child.agent_scheduling_group_host = - std::make_unique<AgentSchedulingGroupHost>(*child.process_host); + child.site_instance_group = base::WrapRefCounted( + new SiteInstanceGroup(site_instance_group_root_->browsing_instance_id(), + child.process_host.get())); child.widget_host = RenderWidgetHostImpl::Create( - /*frame_tree=*/nullptr, &delegate_, *child.agent_scheduling_group_host, + /*frame_tree=*/nullptr, &delegate_, + child.site_instance_group->GetSafeRef(), child.process_host->GetNextRoutingID(), /*hidden=*/false, /*renderer_initiated_creation=*/false, std::make_unique<FrameTokenMessageQueue>()); @@ -292,7 +296,7 @@ view_root_.reset(); widget_host_root_.reset(); process_host_root_->Cleanup(); - agent_scheduling_group_host_root_.reset(); + site_instance_group_root_.reset(); process_host_root_.reset(); base::RunLoop().RunUntilIdle(); @@ -325,7 +329,7 @@ std::unique_ptr<BrowserContext> browser_context_; std::unique_ptr<MockRenderProcessHost> process_host_root_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_root_; + scoped_refptr<SiteInstanceGroup> site_instance_group_root_; std::unique_ptr<RenderWidgetHostImpl> widget_host_root_; std::unique_ptr<MockRootRenderWidgetHostView> view_root_; std::unique_ptr<MockInputTargetClient> input_target_client_root_;
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 0be83b9..f1b395b1 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -28,7 +28,6 @@ #include "components/viz/test/begin_frame_args_test.h" #include "content/browser/blob_storage/chrome_blob_storage_context.h" #include "content/browser/gpu/compositor_util.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/data_transfer_util.h" #include "content/browser/renderer_host/display_feature.h" #include "content/browser/renderer_host/frame_token_message_queue.h" @@ -38,6 +37,7 @@ #include "content/browser/renderer_host/render_view_host_delegate_view.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" +#include "content/browser/site_instance_group.h" #include "content/browser/storage_partition_impl.h" #include "content/common/content_constants_internal.h" #include "content/public/browser/keyboard_event_processing_result.h" @@ -543,8 +543,8 @@ delegate_ = std::make_unique<MockRenderWidgetHostDelegate>(); process_ = std::make_unique<RenderWidgetHostProcess>(browser_context_.get()); - agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*process_); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_.get())); sink_ = &process_->sink(); #if defined(USE_AURA) || BUILDFLAG(IS_MAC) ImageTransportFactory::SetFactory( @@ -560,7 +560,7 @@ #endif host_ = MockRenderWidgetHost::Create( /* frame_tree= */ nullptr, delegate_.get(), - *agent_scheduling_group_host_, process_->GetNextRoutingID(), + site_instance_group_->GetSafeRef(), process_->GetNextRoutingID(), widget_.GetNewRemote()); // Set up the RenderWidgetHost as being for a main frame. host_->set_owner_delegate(&mock_owner_delegate_); @@ -610,7 +610,7 @@ host_.reset(); delegate_.reset(); process_->Cleanup(); - agent_scheduling_group_host_.reset(); + site_instance_group_.reset(); process_.reset(); browser_context_.reset(); @@ -796,7 +796,7 @@ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; std::unique_ptr<TestBrowserContext> browser_context_; std::unique_ptr<RenderWidgetHostProcess> process_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; std::unique_ptr<MockRenderWidgetHostDelegate> delegate_; testing::NiceMock<MockRenderWidgetHostOwnerDelegate> mock_owner_delegate_; std::unique_ptr<MockRenderWidgetHost> host_;
diff --git a/content/browser/renderer_host/render_widget_host_view_android_unittest.cc b/content/browser/renderer_host/render_widget_host_view_android_unittest.cc index 07ded6b0..83f00a52 100644 --- a/content/browser/renderer_host/render_widget_host_view_android_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_android_unittest.cc
@@ -12,9 +12,9 @@ #include "cc/layers/layer.h" #include "components/viz/common/features.h" #include "components/viz/common/surfaces/local_surface_id.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/frame_tree.h" #include "content/browser/renderer_host/mock_render_widget_host.h" +#include "content/browser/site_instance_group.h" #include "content/browser/site_instance_impl.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/mock_render_process_host.h" @@ -119,7 +119,7 @@ std::unique_ptr<TestWebContents> web_contents_; std::unique_ptr<FrameTree> frame_tree_; std::unique_ptr<MockRenderProcessHost> process_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; std::unique_ptr<MockRenderWidgetHostDelegate> delegate_; scoped_refptr<cc::Layer> parent_layer_; scoped_refptr<cc::Layer> layer_; @@ -179,12 +179,12 @@ delegate_ = std::make_unique<MockRenderWidgetHostDelegate>(); process_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); - agent_scheduling_group_ = - std::make_unique<AgentSchedulingGroupHost>(*process_); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + site_instance_->GetBrowsingInstanceId(), process_.get())); // Initialized before ownership is given to `render_view_host_`. std::unique_ptr<MockRenderWidgetHost> mock_host = MockRenderWidgetHost::Create(frame_tree_.get(), delegate_.get(), - *agent_scheduling_group_, + site_instance_group_->GetSafeRef(), process_->GetNextRoutingID()); host_ = mock_host.get(); render_view_host_ = new TestRenderViewHost( @@ -212,7 +212,7 @@ delegate_.reset(); process_->Cleanup(); - agent_scheduling_group_ = nullptr; + site_instance_group_.reset(); process_ = nullptr; browser_context_.reset(); }
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 1aca25c..93837dd 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -41,7 +41,6 @@ #include "content/browser/browser_main_loop.h" #include "content/browser/compositor/test/test_image_transport_factory.h" #include "content/browser/gpu/compositor_util.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/delegated_frame_host.h" #include "content/browser/renderer_host/delegated_frame_host_client_aura.h" #include "content/browser/renderer_host/frame_token_message_queue.h" @@ -56,6 +55,7 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" #include "content/browser/renderer_host/text_input_manager.h" +#include "content/browser/site_instance_group.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_view_aura.h" #include "content/public/browser/context_menu_params.h" @@ -375,16 +375,17 @@ return widget_.ReceivedScreenRects(); } - // Instance self-delete when its |agent_scheduling_groups|'s process will + // Instance self-delete when its |site_instance_group|'s process will // exit. static MockRenderWidgetHostImpl* Create( FrameTree& frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) { - return new MockRenderWidgetHostImpl( - &frame_tree, delegate, agent_scheduling_group, routing_id, hidden); + return new MockRenderWidgetHostImpl(&frame_tree, delegate, + std::move(site_instance_group), + routing_id, hidden); } MockWidgetInputHandler* input_handler() { return &input_handler_; } @@ -414,13 +415,13 @@ private: MockRenderWidgetHostImpl(FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) : RenderWidgetHostImpl(frame_tree, /*self_owned=*/true, delegate, - agent_scheduling_group, + std::move(site_instance_group), routing_id, hidden, /*renderer_initiated_creation=*/false, @@ -508,8 +509,8 @@ int32_t routing_id = process_host_->GetNextRoutingID(); delegates_.push_back(std::make_unique<MockRenderWidgetHostDelegate>()); auto* widget_host = MockRenderWidgetHostImpl::Create( - GetFrameTree(), delegates_.back().get(), *agent_scheduling_group_host_, - routing_id, hidden); + GetFrameTree(), delegates_.back().get(), + site_instance_group_->GetSafeRef(), routing_id, hidden); delegates_.back()->set_widget_host(widget_host); return new FakeRenderWidgetHostViewAura(widget_host); @@ -540,19 +541,20 @@ process_host_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); process_host_->Init(); - agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*process_host_); + auto site_instance = SiteInstance::Create(browser_context_.get()); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + site_instance->GetBrowsingInstanceId(), process_host_.get())); sink_ = &process_host_->sink(); - web_contents_ = WebContents::Create(WebContents::CreateParams( - browser_context_.get(), SiteInstance::Create(browser_context_.get()))); + web_contents_ = WebContents::Create( + WebContents::CreateParams(browser_context_.get(), site_instance)); int32_t routing_id = process_host_->GetNextRoutingID(); delegates_.push_back(std::make_unique<MockRenderWidgetHostDelegate>()); parent_host_ = MockRenderWidgetHostImpl::Create( - GetFrameTree(), delegates_.back().get(), *agent_scheduling_group_host_, - routing_id, /*hidden = */ false); + GetFrameTree(), delegates_.back().get(), + site_instance_group_->GetSafeRef(), routing_id, /*hidden = */ false); delegates_.back()->set_widget_host(parent_host_); parent_view_ = new RenderWidgetHostViewAura(parent_host_); @@ -620,7 +622,7 @@ parent_view_->Destroy(); process_host_->Cleanup(); - agent_scheduling_group_host_ = nullptr; + site_instance_group_.reset(); web_contents_ = nullptr; process_host_ = nullptr; browser_context_ = nullptr; @@ -713,7 +715,7 @@ std::unique_ptr<WebContents> web_contents_; std::vector<std::unique_ptr<MockRenderWidgetHostDelegate>> delegates_; std::unique_ptr<MockRenderProcessHost> process_host_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; // Tests should set these to nullptr if they've already triggered their // destruction. @@ -3254,8 +3256,8 @@ int32_t routing_id = process_host_->GetNextRoutingID(); delegates_.push_back(base::WrapUnique(new MockRenderWidgetHostDelegate)); hosts[i] = MockRenderWidgetHostImpl::Create( - GetFrameTree(), delegates_.back().get(), *agent_scheduling_group_host_, - routing_id, /*hidden = */ false); + GetFrameTree(), delegates_.back().get(), + site_instance_group_->GetSafeRef(), routing_id, /*hidden = */ false); delegates_.back()->set_widget_host(hosts[i]); views[i] = new FakeRenderWidgetHostViewAura(hosts[i]); @@ -3376,8 +3378,8 @@ delegates_.push_back(base::WrapUnique(new MockRenderWidgetHostDelegate)); hosts[i] = MockRenderWidgetHostImpl::Create( - GetFrameTree(), delegates_.back().get(), *agent_scheduling_group_host_, - routing_id, /*hidden = */ false); + GetFrameTree(), delegates_.back().get(), + site_instance_group_->GetSafeRef(), routing_id, /*hidden = */ false); delegates_.back()->set_widget_host(hosts[i]); hosts[i]->BindWidgetInterfaces( @@ -5988,26 +5990,26 @@ InitializeAura(); widget_host_for_first_process_ = - CreateRenderWidgetHostForAgentSchedulingGroup( - tab_agent_scheduling_group()); + CreateRenderWidgetHostForSiteInstanceGroup(tab_site_instance_group()); view_for_first_process_ = CreateViewForProcess(widget_host_for_first_process_); second_process_host_ = CreateNewProcessHost(); - second_agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*second_process_host_); + second_site_instance_group_ = base::WrapRefCounted( + new SiteInstanceGroup(tab_site_instance_group()->browsing_instance_id(), + second_process_host_.get())); widget_host_for_second_process_ = - CreateRenderWidgetHostForAgentSchedulingGroup( - *second_agent_scheduling_group_host_); + CreateRenderWidgetHostForSiteInstanceGroup( + second_site_instance_group_.get()); view_for_second_process_ = CreateViewForProcess(widget_host_for_second_process_); third_process_host_ = CreateNewProcessHost(); - third_agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*third_process_host_); - widget_host_for_third_process_ = - CreateRenderWidgetHostForAgentSchedulingGroup( - *third_agent_scheduling_group_host_); + third_site_instance_group_ = base::WrapRefCounted( + new SiteInstanceGroup(tab_site_instance_group()->browsing_instance_id(), + third_process_host_.get())); + widget_host_for_third_process_ = CreateRenderWidgetHostForSiteInstanceGroup( + third_site_instance_group_.get()); view_for_third_process_ = CreateViewForProcess(widget_host_for_third_process_); @@ -6027,12 +6029,12 @@ view_for_second_process_->Destroy(); second_process_host_->Cleanup(); - second_agent_scheduling_group_host_.reset(); + second_site_instance_group_.reset(); second_process_host_.reset(); view_for_third_process_->Destroy(); third_process_host_->Cleanup(); - third_agent_scheduling_group_host_.reset(); + third_site_instance_group_.reset(); third_process_host_.reset(); RenderWidgetHostViewAuraTest::TearDown(); @@ -6049,12 +6051,12 @@ return std::make_unique<MockRenderProcessHost>(browser_context()); } - MockRenderWidgetHostImpl* CreateRenderWidgetHostForAgentSchedulingGroup( - AgentSchedulingGroupHost& agent_scheduling_group_host) { + MockRenderWidgetHostImpl* CreateRenderWidgetHostForSiteInstanceGroup( + SiteInstanceGroup* site_instance_group) { return MockRenderWidgetHostImpl::Create( GetFrameTree(), render_widget_host_delegate(), - agent_scheduling_group_host, - agent_scheduling_group_host.GetProcess()->GetNextRoutingID(), + site_instance_group->GetSafeRef(), + site_instance_group->process()->GetNextRoutingID(), /*hidden = */ false); } @@ -6074,8 +6076,8 @@ MockRenderProcessHost* tab_process() const { return process_host_.get(); } - AgentSchedulingGroupHost& tab_agent_scheduling_group() const { - return *agent_scheduling_group_host_; + SiteInstanceGroup* tab_site_instance_group() const { + return site_instance_group_.get(); } RenderWidgetHostViewAura* tab_view() const { return view_; } @@ -6100,11 +6102,11 @@ raw_ptr<MockRenderWidgetHostImpl> widget_host_for_first_process_; raw_ptr<TestRenderWidgetHostView> view_for_first_process_; std::unique_ptr<MockRenderProcessHost> second_process_host_; - std::unique_ptr<AgentSchedulingGroupHost> second_agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> second_site_instance_group_; raw_ptr<MockRenderWidgetHostImpl> widget_host_for_second_process_; raw_ptr<TestRenderWidgetHostView> view_for_second_process_; std::unique_ptr<MockRenderProcessHost> third_process_host_; - std::unique_ptr<AgentSchedulingGroupHost> third_agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> third_site_instance_group_; raw_ptr<MockRenderWidgetHostImpl> widget_host_for_third_process_; raw_ptr<TestRenderWidgetHostView> view_for_third_process_; };
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc b/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc index 8e2d464..efb2ee10 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc
@@ -21,12 +21,12 @@ #include "components/viz/test/fake_external_begin_frame_source.h" #include "content/browser/compositor/test/test_image_transport_factory.h" #include "content/browser/gpu/compositor_util.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/cross_process_frame_connector.h" #include "content/browser/renderer_host/frame_token_message_queue.h" #include "content/browser/renderer_host/frame_tree.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/site_instance_group.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" @@ -125,8 +125,8 @@ process_host_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); - agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*process_host_); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_host_.get())); int32_t routing_id = process_host_->GetNextRoutingID(); sink_ = &process_host_->sink(); @@ -136,7 +136,7 @@ widget_host_ = RenderWidgetHostImpl::Create( /*frame_tree=*/&web_contents_->GetPrimaryFrameTree(), &delegate_, - *agent_scheduling_group_host_, routing_id, + site_instance_group_->GetSafeRef(), routing_id, /*hidden=*/false, /*renderer_initiated_creation=*/false, std::make_unique<FrameTokenMessageQueue>()); @@ -170,8 +170,8 @@ view_->Destroy(); widget_host_.reset(); web_contents_.reset(); + site_instance_group_.reset(); process_host_->Cleanup(); - agent_scheduling_group_host_ = nullptr; delete test_frame_connector_; process_host_.reset(); @@ -198,8 +198,8 @@ BrowserTaskEnvironment task_environment_; std::unique_ptr<BrowserContext> browser_context_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; std::unique_ptr<MockRenderProcessHost> process_host_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; std::unique_ptr<WebContentsImpl> web_contents_; raw_ptr<IPC::TestSink> sink_ = nullptr; MockRenderWidgetHostDelegate delegate_;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm index 929225a..c79d604 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -3,7 +3,6 @@ // found in the LICENSE file. #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #import <Cocoa/Cocoa.h> #include <stddef.h> @@ -14,10 +13,11 @@ #include "base/threading/thread_task_runner_handle.h" #include "content/browser/compositor/test/test_image_transport_factory.h" #include "content/browser/gpu/compositor_util.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/frame_token_message_queue.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/browser/site_instance_group.h" +#include "content/browser/site_instance_impl.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/mock_render_process_host.h" #include "content/public/test/test_browser_context.h" @@ -139,8 +139,9 @@ MockRenderProcessHostFactory process_host_factory; RenderProcessHost* process_host = process_host_factory.CreateRenderProcessHost(&browser_context, nullptr); - auto agent_scheduling_group_host = - std::make_unique<AgentSchedulingGroupHost>(*process_host); + scoped_refptr<SiteInstanceGroup> site_instance_group = + base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_host)); // Populates |g_supported_scale_factors|. std::vector<ui::ResourceScaleFactor> supported_factors; supported_factors.push_back(ui::k100Percent); @@ -151,8 +152,8 @@ int32_t routing_id = process_host->GetNextRoutingID(); std::unique_ptr<RenderWidgetHostImpl> render_widget = RenderWidgetHostImpl::Create( - /*frmae_tree=*/nullptr, &delegate, *agent_scheduling_group_host, - routing_id, + /*frmae_tree=*/nullptr, &delegate, + site_instance_group->GetSafeRef(), routing_id, /*hidden=*/false, /*renderer_initiated_creation=*/false, std::make_unique<FrameTokenMessageQueue>());
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm index 2ade2677..38d4fb3 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -25,10 +25,10 @@ #import "content/app_shim_remote_cocoa/render_widget_host_view_cocoa.h" #include "content/browser/compositor/image_transport_factory.h" #include "content/browser/gpu/compositor_util.h" -#include "content/browser/renderer_host/agent_scheduling_group_host.h" #include "content/browser/renderer_host/frame_token_message_queue.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/text_input_manager.h" +#include "content/browser/site_instance_group.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_types.h" @@ -317,15 +317,14 @@ class MockRenderWidgetHostImpl : public RenderWidgetHostImpl { public: - MockRenderWidgetHostImpl( - RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group_host, - int32_t routing_id, - bool for_frame_widget) + MockRenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, + base::SafeRef<SiteInstanceGroup> site_instance_group, + int32_t routing_id, + bool for_frame_widget) : RenderWidgetHostImpl(/*frame_tree=*/nullptr, /*self_owned=*/false, delegate, - agent_scheduling_group_host, + std::move(site_instance_group), routing_id, /*hidden=*/false, /*renderer_initiated_creation=*/false, @@ -490,10 +489,10 @@ process_host_ = std::make_unique<MockRenderProcessHost>(browser_context_.get()); process_host_->Init(); - agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*process_host_); + site_instance_group_ = base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), process_host_.get())); host_ = std::make_unique<MockRenderWidgetHostImpl>( - &delegate_, *agent_scheduling_group_host_, + &delegate_, site_instance_group_->GetSafeRef(), process_host_->GetNextRoutingID(), /*for_frame_widget=*/true); host_->set_owner_delegate(&mock_owner_delegate_); @@ -517,7 +516,7 @@ host_->ShutdownAndDestroyWidget(/*also_delete=*/false); host_.reset(); process_host_->Cleanup(); - agent_scheduling_group_host_.reset(); + site_instance_group_.reset(); process_host_.reset(); browser_context_.reset(); RecycleAndWait(); @@ -551,7 +550,7 @@ std::unique_ptr<TestBrowserContext> browser_context_; std::unique_ptr<MockRenderProcessHost> process_host_; - std::unique_ptr<AgentSchedulingGroupHost> agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> site_instance_group_; testing::NiceMock<MockRenderWidgetHostOwnerDelegate> mock_owner_delegate_; std::unique_ptr<MockRenderWidgetHostImpl> host_; RenderWidgetHostViewMac* rwhv_mac_ = nullptr; @@ -1241,11 +1240,13 @@ TestBrowserContext browser_context; MockRenderProcessHost process_host(&browser_context); process_host.Init(); - AgentSchedulingGroupHost agent_scheduling_group_host(process_host); + scoped_refptr<SiteInstanceGroup> site_instance_group = + base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), &process_host)); MockRenderWidgetHostDelegate delegate; int32_t routing_id = process_host.GetNextRoutingID(); auto host = std::make_unique<MockRenderWidgetHostImpl>( - &delegate, agent_scheduling_group_host, routing_id, + &delegate, site_instance_group->GetSafeRef(), routing_id, /*for_frame_widget=*/false); RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host.get()); base::RunLoop().RunUntilIdle(); @@ -1304,11 +1305,13 @@ TestBrowserContext browser_context; MockRenderProcessHost process_host(&browser_context); process_host.Init(); - AgentSchedulingGroupHost agent_scheduling_group_host(process_host); + scoped_refptr<SiteInstanceGroup> site_instance_group = + base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), &process_host)); MockRenderWidgetHostDelegate delegate; int32_t routing_id = process_host.GetNextRoutingID(); auto host = std::make_unique<MockRenderWidgetHostImpl>( - &delegate, agent_scheduling_group_host, routing_id, + &delegate, site_instance_group->GetSafeRef(), routing_id, /*for_frame_widget=*/false); RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host.get()); base::RunLoop().RunUntilIdle(); @@ -1364,10 +1367,12 @@ MockRenderProcessHost process_host(&browser_context); process_host.Init(); MockRenderWidgetHostDelegate delegate; - AgentSchedulingGroupHost agent_scheduling_group_host(process_host); + scoped_refptr<SiteInstanceGroup> site_instance_group = + base::WrapRefCounted(new SiteInstanceGroup( + SiteInstanceImpl::NextBrowsingInstanceId(), &process_host)); int32_t routing_id = process_host.GetNextRoutingID(); auto host = std::make_unique<MockRenderWidgetHostImpl>( - &delegate, agent_scheduling_group_host, routing_id, + &delegate, site_instance_group->GetSafeRef(), routing_id, /*for_frame_widget=*/false); RenderWidgetHostViewMac* view = new RenderWidgetHostViewMac(host.get()); base::RunLoop().RunUntilIdle(); @@ -1681,10 +1686,11 @@ child_process_host_ = std::make_unique<MockRenderProcessHost>(child_browser_context_.get()); child_process_host_->Init(); - child_agent_scheduling_group_host_ = - std::make_unique<AgentSchedulingGroupHost>(*child_process_host_); + child_site_instance_group_ = base::WrapRefCounted( + new SiteInstanceGroup(site_instance_group_->browsing_instance_id(), + child_process_host_.get())); child_widget_ = std::make_unique<MockRenderWidgetHostImpl>( - &delegate_, *child_agent_scheduling_group_host_, + &delegate_, child_site_instance_group_->GetSafeRef(), child_process_host_->GetNextRoutingID(), /*for_frame_widget=*/false); child_view_ = new TestRenderWidgetHostView(child_widget_.get()); base::RunLoop().RunUntilIdle(); @@ -1694,7 +1700,7 @@ child_widget_->ShutdownAndDestroyWidget(false); child_widget_.reset(); child_process_host_->Cleanup(); - child_agent_scheduling_group_host_.reset(); + child_site_instance_group_.reset(); child_process_host_.reset(); child_browser_context_.reset(); RenderWidgetHostViewMacTest::TearDown(); @@ -1726,7 +1732,7 @@ protected: std::unique_ptr<MockRenderProcessHost> child_process_host_; - std::unique_ptr<AgentSchedulingGroupHost> child_agent_scheduling_group_host_; + scoped_refptr<SiteInstanceGroup> child_site_instance_group_; std::unique_ptr<MockRenderWidgetHostImpl> child_widget_; TestRenderWidgetHostView* child_view_;
diff --git a/content/browser/service_worker/service_worker_internals_ui_browsertest.cc b/content/browser/service_worker/service_worker_internals_ui_browsertest.cc index 74dd04c..37652e9 100644 --- a/content/browser/service_worker/service_worker_internals_ui_browsertest.cc +++ b/content/browser/service_worker/service_worker_internals_ui_browsertest.cc
@@ -317,8 +317,16 @@ EXPECT_EQ(0, CountRenderProcessHosts()); } +// TODO(crbug.com/1307548): Flaky on Linux +#if BUILDFLAG(IS_LINUX) +#define MAYBE_RegisteredSWReflectedOnInternalUI \ + DISABLED_RegisteredSWReflectedOnInternalUI +#else +#define MAYBE_RegisteredSWReflectedOnInternalUI \ + RegisteredSWReflectedOnInternalUI +#endif IN_PROC_BROWSER_TEST_F(ServiceWorkerInternalsUIBrowserTest, - RegisteredSWReflectedOnInternalUI) { + MAYBE_RegisteredSWReflectedOnInternalUI) { Shell* SWInternalUIWindow = CreateNewWindow(); NavigateToServiceWorkerInternalUI(); EXPECT_EQ(1, CountRenderProcessHosts());
diff --git a/content/browser/site_instance_group.cc b/content/browser/site_instance_group.cc index 2c727e2..5c2d2e08 100644 --- a/content/browser/site_instance_group.cc +++ b/content/browser/site_instance_group.cc
@@ -35,6 +35,10 @@ return id_; } +base::SafeRef<SiteInstanceGroup> SiteInstanceGroup::GetSafeRef() { + return weak_ptr_factory_.GetSafeRef(); +} + void SiteInstanceGroup::AddObserver(Observer* observer) { observers_.AddObserver(observer); }
diff --git a/content/browser/site_instance_group.h b/content/browser/site_instance_group.h index a07e729..e722d91 100644 --- a/content/browser/site_instance_group.h +++ b/content/browser/site_instance_group.h
@@ -7,6 +7,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" +#include "base/memory/safe_ref.h" #include "base/observer_list.h" #include "base/types/id_type.h" #include "content/browser/renderer_host/agent_scheduling_group_host.h" @@ -84,6 +85,8 @@ SiteInstanceGroupId GetId() const; + base::SafeRef<SiteInstanceGroup> GetSafeRef(); + void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -160,6 +163,8 @@ raw_ptr<AgentSchedulingGroupHost> agent_scheduling_group_ = nullptr; base::ObserverList<Observer, true>::Unchecked observers_; + + base::WeakPtrFactory<SiteInstanceGroup> weak_ptr_factory_{this}; }; } // namespace content
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 8e7e528..2afbf96 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4046,7 +4046,7 @@ } RenderWidgetHostImpl* WebContentsImpl::CreateNewPopupWidget( - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t route_id, mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host, @@ -4054,9 +4054,8 @@ mojo::PendingAssociatedRemote<blink::mojom::Widget> blink_widget) { OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::CreateNewPopupWidget", "route_id", route_id); - RenderProcessHost* process = agent_scheduling_group.GetProcess(); RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::CreateSelfOwned( - &primary_frame_tree_, this, agent_scheduling_group, route_id, IsHidden(), + &primary_frame_tree_, this, site_instance_group, route_id, IsHidden(), std::make_unique<FrameTokenMessageQueue>()); widget_host->BindWidgetInterfaces(std::move(blink_widget_host), @@ -4070,7 +4069,8 @@ widget_view->SetWidgetType(WidgetType::kPopup); // Save the created widget associated with the route so we can show it later. - pending_widgets_[GlobalRoutingID(process->GetID(), route_id)] = widget_host; + pending_widgets_[GlobalRoutingID(site_instance_group->process()->GetID(), + route_id)] = widget_host; AddRenderWidgetHostDestructionObserver(widget_host); return widget_host;
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index f8bb8da..349ff375 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -106,7 +106,6 @@ class JavaScriptDialogDismissNotifier; } enum class PictureInPictureResult; -class AgentSchedulingGroupHost; class BeforeUnloadBlockingDelegate; // content_browser_test_utils_internal.h class BrowserPluginEmbedder; class BrowserPluginGuest; @@ -748,7 +747,7 @@ bool IsTransientAllowFullscreenActive() const override; bool IsBackForwardCacheSupported() override; RenderWidgetHostImpl* CreateNewPopupWidget( - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t route_id, mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host,
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 7bc658f..4095ee0e 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -863,43 +863,46 @@ bool WebContentsViewAura::IsValidDragTarget( RenderWidgetHostImpl* target_rwh) const { - // This is the browser-side check for https://crbug.com/59081 to prevent - // drags between cross-origin frames within the same page. + // This is the browser-side check for https://crbug.com/59081 to block + // drags between cross-origin frames within the same page. Otherwise, a + // malicious attacker could abuse drag interactions to leak information + // across origins without explicit user intent. + if (!drag_start_) + return true; + + // For site isolation, it is desirable to avoid having the renderer + // perform the check unless it already has access to the starting + // document's origin. If the SiteInstanceGroups match, then the process + // allocation policy decided that it is OK for the source and target + // frames to live in the same renderer process. Furthermore, it means that + // either the source and target frame are part of the same `blink::Page` or + // that there is an opener relationship and would cross tab boundaries. Allow + // this drag to the renderer. Blink will perform an additional check against + // `blink::DragController::drag_initiator_` to decide whether or not to + // allow the drag operation. This can be done in the renderer, as the + // browser-side checks only have local tree fragment (potentially with + // multiple origins) granularity at best, but a drag operation eventually + // targets one single frame in that local tree fragment. + bool same_site_instance_group = target_rwh->GetSiteInstanceGroup()->GetId() == + drag_start_->site_instance_group_id; + if (same_site_instance_group) + return true; + + // Otherwise, if the SiteInstanceGroups do not match, enforce explicit + // user intent by ensuring this drag operation is crossing page boundaries. + // `drag_start_->view_id` is set to the main `RenderFrameHost`'s + // `RenderViewHost`'s ID when a drag starts, so if the two IDs match here, + // the drag is within the same page and disallowed. // - // First, check if the target widget's render process ID matches the starting - // frame's render process ID. If it matches, this is either: - // - // - a same-process drag between frames in the same page. Since this is a drag - // within the same `blink::Page`, `blink::DragController::drag_initiator_` - // will be non-null (since each `blink::Page` owns `blink::DragController`) - // and the render process will use `drag_initiator_` to perform an origin - // check to decide whether or not to allow the drag. For example, frames - // in the same renderer process may be same-site but cross-origin: in this - // case, the drag should be disallowed. - // - // - a same-process drag between frames in different pages. Since this is a - // drag between two different `blink::Page`s, the aforementioned - // `blink::DragController::drag_initiator_` for the target - // `blink::Page` will be null. When `drag_initiator_` is unset, Blink always - // allows the drag, but this is OK: cross-origin cross-page drags should be - // allowed. - // - // Otherwise, if the render process IDs do not match, this is a cross-process - // drag—but still possibly within the same page. `drag_start_->view_id` is set - // to the main `RenderFrameHost`'s `RenderViewHost`'s ID—so if the two - // IDs match here, the drag is within the same page and disallowed. It is - // important to block these drags here, as if it were allowed to go to the - // render process, `blink::DragController::drag_initiator_` will be null (by - // definition, since the target frame is cross-process to the starting frame), - // and the drag will be incorrectly allowed. - // - // TODO(https://crbug.com/1266953): There are some known gaps caused by - // comparing `RenderViewHost` IDs, as `RenderViewHost` ID is not really a - // strong signal for page identity. - return !drag_start_ || - target_rwh->GetProcess()->GetID() == drag_start_->process_id || - GetRenderViewHostID(web_contents_->GetRenderViewHost()) != - drag_start_->view_id; + // Drags between an embedder and an inner `WebContents` will disallowed by + // the above view ID check because `WebContentsViewAura` is always created + // for the outermost view. Inner `WebContents` will have a + // `WebContentsViewChildFrame` so when dragging between an inner + // `WebContents` and its embedder the view IDs will be the same. + bool cross_tab_drag = + GetRenderViewHostID(web_contents_->GetRenderViewHost()) != + drag_start_->view_id; + return cross_tab_drag; } //////////////////////////////////////////////////////////////////////////////// @@ -1147,7 +1150,7 @@ source_rwh->GetWeakPtr(); drag_start_ = - DragStart(source_rwh->GetProcess()->GetID(), + DragStart(source_rwh->GetSiteInstanceGroup()->GetId(), GetRenderViewHostID(web_contents_->GetRenderViewHost()), drop_data.file_contents_image_accessible);
diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index 1a0f1a4..9c1943a 100644 --- a/content/browser/web_contents/web_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h
@@ -16,6 +16,7 @@ #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "content/browser/renderer_host/render_view_host_delegate_view.h" +#include "content/browser/site_instance_group.h" #include "content/browser/web_contents/web_contents_view.h" #include "content/common/buildflags.h" #include "content/common/content_export.h" @@ -367,15 +368,15 @@ // We also track whether a dragged image is accessible from its frame, so we // can disallow tainted-cross-origin same-page drag-drop. struct DragStart { - DragStart(int process_id, + DragStart(SiteInstanceGroupId site_instance_group_id, GlobalRoutingID view_id, bool image_accessible_from_frame) - : process_id(process_id), + : site_instance_group_id(site_instance_group_id), view_id(view_id), image_accessible_from_frame(image_accessible_from_frame) {} ~DragStart() = default; - int process_id; + SiteInstanceGroupId site_instance_group_id; GlobalRoutingID view_id; bool image_accessible_from_frame; };
diff --git a/content/public/android/java/res/drawable/floating_popup_background.xml b/content/public/android/java/res/drawable/floating_popup_background.xml index d43022f..c7d6bd8 100644 --- a/content/public/android/java/res/drawable/floating_popup_background.xml +++ b/content/public/android/java/res/drawable/floating_popup_background.xml
@@ -5,6 +5,6 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - <solid android:color="@color/default_bg_color"/> + <solid android:color="@color/default_bg_color_baseline"/> <corners android:radius="2dp" /> </shape>
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 709a5c53..4304cc5 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -785,6 +785,9 @@ data_deps = [ ":telemetry_gpu_integration_test_data", + # For WebGPU CTS tests. + "//third_party/dawn/third_party/gn/webgpu-cts", + # For anything using Skia Gold (pixel, maps). "//ui/base:goldctl", ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 906b491..d4b3a8e 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -462,6 +462,9 @@ crbug.com/1291276 [ win nvidia angle-vulkan passthrough ] conformance/ogles/GL/mod/mod_001_to_008.html [ Failure ] +# Flaky on Win / Passthrough command decoder (both GL and D3D11 backends) +crbug.com/1307905 [ win passthrough ] conformance/attribs/gl-vertexattribpointer.html [ RetryOnFailure ] + #################### # Mac failures # ####################
diff --git a/content/test/test_render_view_host_factory.cc b/content/test/test_render_view_host_factory.cc index 36229cf3..3a116d35 100644 --- a/content/test/test_render_view_host_factory.cc +++ b/content/test/test_render_view_host_factory.cc
@@ -49,10 +49,10 @@ scoped_refptr<BrowsingContextState> main_browsing_context_state) { return new TestRenderViewHost( frame_tree, instance, - TestRenderWidgetHost::Create(frame_tree, widget_delegate, - static_cast<SiteInstanceImpl*>(instance) - ->GetOrCreateAgentSchedulingGroup(), - widget_routing_id, false), + TestRenderWidgetHost::Create( + frame_tree, widget_delegate, + static_cast<SiteInstanceImpl*>(instance)->group()->GetSafeRef(), + widget_routing_id, false), delegate, routing_id, main_frame_routing_id, swapped_out, std::move(main_browsing_context_state)); }
diff --git a/content/test/test_render_widget_host.cc b/content/test/test_render_widget_host.cc index 36d372d..5823452 100644 --- a/content/test/test_render_widget_host.cc +++ b/content/test/test_render_widget_host.cc
@@ -14,23 +14,24 @@ std::unique_ptr<RenderWidgetHostImpl> TestRenderWidgetHost::Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) { return base::WrapUnique(new TestRenderWidgetHost( - frame_tree, delegate, agent_scheduling_group, routing_id, hidden)); + frame_tree, delegate, std::move(site_instance_group), routing_id, + hidden)); } TestRenderWidgetHost::TestRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) : RenderWidgetHostImpl(frame_tree, /*self_owned=*/false, delegate, - agent_scheduling_group, + std::move(site_instance_group), routing_id, hidden, /*renderer_initiated_creation=*/false,
diff --git a/content/test/test_render_widget_host.h b/content/test/test_render_widget_host.h index a07a4c2..3f5b03ff 100644 --- a/content/test/test_render_widget_host.h +++ b/content/test/test_render_widget_host.h
@@ -19,7 +19,7 @@ static std::unique_ptr<RenderWidgetHostImpl> Create( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden); ~TestRenderWidgetHost() override; @@ -37,7 +37,7 @@ private: TestRenderWidgetHost(FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden); MockWidgetInputHandler input_handler_;
diff --git a/content/test/test_render_widget_host_factory.cc b/content/test/test_render_widget_host_factory.cc index 6ea22535..fe2c166c 100644 --- a/content/test/test_render_widget_host_factory.cc +++ b/content/test/test_render_widget_host_factory.cc
@@ -20,11 +20,11 @@ TestRenderWidgetHostFactory::CreateRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) { return TestRenderWidgetHost::Create( - frame_tree, delegate, agent_scheduling_group, routing_id, hidden); + frame_tree, delegate, std::move(site_instance_group), routing_id, hidden); } } // namespace content
diff --git a/content/test/test_render_widget_host_factory.h b/content/test/test_render_widget_host_factory.h index 2589c423..a0419fcb 100644 --- a/content/test/test_render_widget_host_factory.h +++ b/content/test/test_render_widget_host_factory.h
@@ -29,7 +29,7 @@ std::unique_ptr<RenderWidgetHostImpl> CreateRenderWidgetHost( FrameTree* frame_tree, RenderWidgetHostDelegate* delegate, - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t routing_id, bool hidden) override; };
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index 292ec4e..a9a1e92 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc
@@ -333,7 +333,7 @@ } RenderWidgetHostImpl* TestWebContents::CreateNewPopupWidget( - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t route_id, mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host,
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h index d33bfcf7..7ad9de5 100644 --- a/content/test/test_web_contents.h +++ b/content/test/test_web_contents.h
@@ -164,7 +164,7 @@ bool has_user_gesture, SessionStorageNamespace* session_storage_namespace) override; RenderWidgetHostImpl* CreateNewPopupWidget( - AgentSchedulingGroupHost& agent_scheduling_group, + base::SafeRef<SiteInstanceGroup> site_instance_group, int32_t route_id, mojo::PendingAssociatedReceiver<blink::mojom::PopupWidgetHost> blink_popup_widget_host,
diff --git a/docs/testing/android_test_instructions.md b/docs/testing/android_test_instructions.md index 4f1792fd..0638ccc 100644 --- a/docs/testing/android_test_instructions.md +++ b/docs/testing/android_test_instructions.md
@@ -1,290 +1,3 @@ # Android Test Instructions -[TOC] - -## Device Setup - -### Physical Device Setup - -#### Root Access - -Running tests requires root access, which requires using a userdebug build on -your device. - -To use a userdebug build, see -[Running Builds](https://source.android.com/setup/build/running.html). Googlers -can refer to [this page](https://goto.google.com/flashdevice). - -If you can't run "adb root", you will get an error when trying to install -the test APKs like "adb: error: failed to copy" and -"remote secure_mkdirs failed: Operation not permitted" (use "adb unroot" to -return adb to normal). - -#### ADB Debugging - -The adb executable exists within the Android SDK: - -```shell -third_party/android_sdk/public/platform-tools/adb -``` - -In order to allow the ADB to connect to the device, you must enable USB -debugging: - -* Developer options are hidden by default. To unhide them: - * Go to "About phone" - * Tap 10 times on "Build number" - * The "Developer options" menu will now be available. - * Check "USB debugging". - * Un-check "Verify apps over USB". - -#### Screen - -You **must** ensure that the screen stays on while testing: `adb shell svc power -stayon usb` Or do this manually on the device: Settings -> Developer options -> -Stay Awake. - -If this option is greyed out, stay awake is probably disabled by policy. In that -case, get another device or log in with a normal, unmanaged account (because the -tests will break in exciting ways if stay awake is off). - -#### Disable Verify Apps - -You may see a dialog like [this -one](http://www.samsungmobileusa.com/simulators/ATT_GalaxyMega/mobile/screens/06-02_12.jpg), -which states, _Google may regularly check installed apps for potentially harmful -behavior._ This can interfere with the test runner. To disable this dialog, run: - -```shell -adb shell settings put global package_verifier_enable 0 -``` - -### Using Emulators - -Running tests on emulators is the same as [on device](#Running-Tests). Refer to -[android_emulator.md](../android_emulator.md) for setting up emulators. - -## Building Tests - -If you're adding a new test file, you'll need to explicitly add it to a gn -target. If you're adding a test to an existing file, you won't need to make gn -changes, but you may be interested in where your test winds up. In either case, -here are some guidelines for where a test belongs: - -### C++ - -C++ test files typically belong in `<top-level directory>_unittests` (e.g. -`base_unittests` for `//base`). There are a few exceptions -- browser tests are -typically their own target (e.g. `content_browsertests` for `//content`, or -`browser_tests` for `//chrome`), and some unit test suites are broken at the -second directory rather than the top-level one. - -### Java - -Java test files vary a bit more widely than their C++ counterparts: - -- Instrumentation test files -- i.e., tests that will run on a device -- - typically belong in either `<top-level directory>_javatests` or `<top-level - directory>_test_java`. Regardless, they'll wind up getting packaged into one - of a few test APKs: - - `webview_instrumentation_test_apk` for anything in `//android_webview` - - `content_shell_test_apk` for anything in `//content` or below - - `chrome_public_test_apk` for most things in `//chrome` -- JUnit or Robolectric test files -- i.e., tests that will run on the host -- - typically belong in `<top-level directory>_junit_tests` (e.g. - `base_junit_tests` for `//base`), though here again there are cases - (particularly in `//components`) where suites are split at the second - directory rather than the top-level one. - -Once you know what to build, just do it like you normally would build anything -else, e.g.: `ninja -C out/Release chrome_public_test_apk` - -## Running Tests - -All functional tests should be runnable via the wrapper scripts generated at -build time: - -```sh -<output directory>/bin/run_<target_name> [options] -``` - -Note that tests are sharded across all attached devices unless explicitly told -to do otherwise by `-d/--device`. - -The commands used by the buildbots are printed in the logs. Look at -https://build.chromium.org/ to duplicate the same test command as a particular -builder. - -### INSTALL\_FAILED\_CONTAINER\_ERROR or INSTALL\_FAILED\_INSUFFICIENT\_STORAGE - -If you see this error when the test runner is attempting to deploy the test -binaries to the AVD emulator, you may need to resize your userdata partition -with the following commands: - -```shell -# Resize userdata partition to be 1G -resize2fs android_emulator_sdk/sdk/system-images/android-25/x86/userdata.img 1G - -# Set filesystem parameter to continue on errors; Android doesn't like some -# things e2fsprogs does. -tune2fs -e continue android_emulator_sdk/sdk/system-images/android-25/x86/userdata.img -``` - -### AdbCommandFailedError: failed to stat remote object - -There's a known issue (https://crbug.com/1094062) where the unit test binaries can fail on -Android R and later: if you see this error, try rerunning on an Android version -with API level <= 29 (Android <= Q). - -## Symbolizing Crashes - -Crash stacks are logged and can be viewed using `adb logcat`. To symbolize the -traces, define `CHROMIUM_OUTPUT_DIR=$OUTDIR` where `$OUTDIR` is the argument you -pass to `ninja -C`, and pipe the output through -`third_party/android_platform/development/scripts/stack`. If -`$CHROMIUM_OUTPUT_DIR` is unset, the script will search `out/Debug` and -`out/Release`. For example: - -```shell -# If you build with -ninja -C out/Debug chrome_public_test_apk -# You can run: -adb logcat -d | third_party/android_platform/development/scripts/stack - -# If you build with -ninja -C out/android chrome_public_test_apk -# You can run: -adb logcat -d | CHROMIUM_OUTPUT_DIR=out/android third_party/android_platform/development/scripts/stack -# or -export CHROMIUM_OUTPUT_DIR=out/android -adb logcat -d | third_party/android_platform/development/scripts/stack -``` - -## JUnit tests - -JUnit tests are Java unittests running on the host instead of the target device. -They are faster to run and therefore are recommended over instrumentation tests -when possible. - -The JUnits tests are usually following the pattern of *target*\_junit\_tests, -for example, `content_junit_tests` and `chrome_junit_tests`. - -When adding a new JUnit test, the associated `BUILD.gn` file must be updated. -For example, adding a test to `chrome_junit_tests` requires to update -`chrome/android/BUILD.gn`. - -```shell -# Build the test suite. -ninja -C out/Default chrome_junit_tests - -# Run the test suite. -out/Default/bin/run_chrome_junit_tests - -# Run a subset of tests. You might need to pass the package name for some tests. -out/Default/bin/run_chrome_junit_tests -f "org.chromium.chrome.browser.media.*" -``` - -### Debugging - -Similar to [debugging apk targets](../android_debugging_instructions.md#debugging-java): - -```shell -out/Default/bin/run_chrome_junit_tests --wait-for-java-debugger -out/Default/bin/run_chrome_junit_tests --wait-for-java-debugger # Specify custom port via --debug-socket=9999 -``` - -## Gtests - -```shell -# Build a test suite -ninja -C out/Release content_unittests - -# Run a test suite -out/Release/bin/run_content_unittests [-vv] - -# Run a subset of tests and enable some "please go faster" options: -out/Release/bin/run_content_unittests --fast-local-dev -f "ByteStreamTest.*" -``` - -## Instrumentation Tests - -In order to run instrumentation tests, you must leave your device screen ON and -UNLOCKED. Otherwise, the test will timeout trying to launch an intent. -Optionally you can disable screen lock under Settings -> Security -> Screen Lock --> None. - -Next, you need to build the app, build your tests, and then run your tests -(which will install the APK under test and the test APK automatically). - -Examples: - -ContentShell tests: - -```shell -# Build the tests: -ninja -C out/Release content_shell_test_apk - -# Run the test suite: -out/Release/bin/run_content_shell_test_apk [-vv] - -# Run a subset of tests and enable some "please go faster" options: -out/Release/bin/run_content_shell_test_apk --fast-local-dev -f "*TestClass*" -``` - -Android WebView tests: - -See [WebView's instructions](/android_webview/docs/test-instructions.md). - -In order to run a subset of tests, use -f to filter based on test class/method -or -A/-E to filter using annotations. - -More Filtering examples: - -```shell -# Run a specific test class -out/Debug/bin/run_content_shell_test_apk -f "AddressDetectionTest.*" - -# Run a specific test method -out/Debug/bin/run_content_shell_test_apk -f AddressDetectionTest#testAddressLimits - -# Run a subset of tests by size (Smoke, SmallTest, MediumTest, LargeTest, -# EnormousTest) -out/Debug/bin/run_content_shell_test_apk -A Smoke - -# Run a subset of tests by annotation, such as filtering by Feature -out/Debug/bin/run_content_shell_test_apk -A Feature=Navigation -``` - -You might want to add stars `*` to each as a regular expression, e.g. -`*`AddressDetectionTest`*` - -### Debugging - -Similar to [debugging apk targets](../android_debugging_instructions.md#debugging-java): - -```shell -out/Debug/bin/run_content_shell_test_apk --wait-for-java-debugger -``` - -### Deobfuscating Java Stacktraces - -If running with `is_debug=false`, Java stacks from logcat need to be fixed up: - -```shell -build/android/stacktrace/java_deobfuscate.py out/Release/apks/ChromePublicTest.apk.mapping < stacktrace.txt -``` - -Any stacks produced by test runner output will already be deobfuscated. - - -## Running Blink Web Tests - -See [Web Tests](web_tests.md). - -## Running GPU tests - -(e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) - -See https://www.chromium.org/developers/testing/gpu-testing for details. Use -`--browser=android-content-shell`. Examine the stdio from the test invocation on -the bots to see arguments to pass to `src/content/test/gpu/run_gpu_test.py`. +See [Android testing in Chromium](/testing/android/docs/README.md)
diff --git a/docs/threading_and_tasks.md b/docs/threading_and_tasks.md index e51f561..69a8c28 100644 --- a/docs/threading_and_tasks.md +++ b/docs/threading_and_tasks.md
@@ -622,7 +622,7 @@ }; ``` -Note: `WeakPtr` is not thread-safe: `GetWeakPtr()`, `~WeakPtrFactory()`, and +Note: `WeakPtr` is not thread-safe: `~WeakPtrFactory()` and `Store()` (bound to a `WeakPtr`) must all run on the same sequence. ### Using base::CancelableTaskTracker
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc index 979dfd3..fe33f70 100644 --- a/headless/app/headless_shell.cc +++ b/headless/app/headless_shell.cc
@@ -635,6 +635,7 @@ LOG(ERROR) << "Writing to file " << file_name.value() << " was unsuccessful, could not open file: " << base::File::ErrorToString(error_code); + ShutdownSoon(); return; } if (!file_proxy_->Write(
diff --git a/infra/config/generated/builders/ci/gpu-fyi-chromeos-zork-exp/properties.json b/infra/config/generated/builders/ci/gpu-fyi-chromeos-zork-exp/properties.json new file mode 100644 index 0000000..9ddaa26 --- /dev/null +++ b/infra/config/generated/builders/ci/gpu-fyi-chromeos-zork-exp/properties.json
@@ -0,0 +1,73 @@ +{ + "$build/chromium_tests_builder_config": { + "builder_config": { + "builder_db": { + "entries": [ + { + "builder_id": { + "bucket": "ci", + "builder": "gpu-fyi-chromeos-zork-exp", + "project": "chromium" + }, + "builder_spec": { + "builder_group": "chromium.gpu.fyi", + "execution_mode": "COMPILE_AND_TEST", + "legacy_chromium_config": { + "apply_configs": [ + "mb" + ], + "build_config": "Release", + "config": "chromium", + "target_arch": "intel", + "target_bits": 64, + "target_cros_boards": [ + "zork" + ], + "target_platform": "chromeos" + }, + "legacy_gclient_config": { + "apply_configs": [ + "chromeos" + ], + "config": "chromium" + }, + "run_tests_serially": true + } + } + ] + }, + "builder_ids": [ + { + "bucket": "ci", + "builder": "gpu-fyi-chromeos-zork-exp", + "project": "chromium" + } + ], + "mirroring_builder_group_and_names": [ + { + "builder": "gpu-fyi-try-chromeos-zork-exp", + "group": "tryserver.chromium.chromiumos" + } + ] + } + }, + "$build/goma": { + "enable_ats": true, + "rpc_extra_params": "?prod", + "server_host": "goma.chromium.org", + "use_luci_auth": true + }, + "$recipe_engine/resultdb/test_presentation": { + "column_keys": [], + "grouping_keys": [ + "status", + "v.test_suite" + ] + }, + "builder_group": "chromium.gpu.fyi", + "perf_dashboard_machine_group": "ChromiumGPUFYI", + "recipe": "chromium", + "sheriff_rotations": [ + "chromium.gpu" + ] +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/gpu-fyi-try-chromeos-zork-exp/properties.json b/infra/config/generated/builders/try/gpu-fyi-try-chromeos-zork-exp/properties.json new file mode 100644 index 0000000..6a71889 --- /dev/null +++ b/infra/config/generated/builders/try/gpu-fyi-try-chromeos-zork-exp/properties.json
@@ -0,0 +1,63 @@ +{ + "$build/chromium_tests_builder_config": { + "builder_config": { + "builder_db": { + "entries": [ + { + "builder_id": { + "bucket": "ci", + "builder": "gpu-fyi-chromeos-zork-exp", + "project": "chromium" + }, + "builder_spec": { + "builder_group": "chromium.gpu.fyi", + "execution_mode": "COMPILE_AND_TEST", + "legacy_chromium_config": { + "apply_configs": [ + "mb" + ], + "build_config": "Release", + "config": "chromium", + "target_arch": "intel", + "target_bits": 64, + "target_cros_boards": [ + "zork" + ], + "target_platform": "chromeos" + }, + "legacy_gclient_config": { + "apply_configs": [ + "chromeos" + ], + "config": "chromium" + }, + "run_tests_serially": true + } + } + ] + }, + "builder_ids": [ + { + "bucket": "ci", + "builder": "gpu-fyi-chromeos-zork-exp", + "project": "chromium" + } + ] + } + }, + "$build/goma": { + "enable_ats": true, + "rpc_extra_params": "?prod", + "server_host": "goma.chromium.org", + "use_luci_auth": true + }, + "$recipe_engine/resultdb/test_presentation": { + "column_keys": [], + "grouping_keys": [ + "status", + "v.test_suite" + ] + }, + "builder_group": "tryserver.chromium.chromiumos", + "recipe": "chromium_trybot" +} \ No newline at end of file
diff --git a/infra/config/generated/cq-builders.md b/infra/config/generated/cq-builders.md index f11c6ce..c0a6718 100644 --- a/infra/config/generated/cq-builders.md +++ b/infra/config/generated/cq-builders.md
@@ -213,6 +213,7 @@ * [dawn-linux-x64-deps-rel](https://ci.chromium.org/p/chromium/builders/try/dawn-linux-x64-deps-rel) ([definition](https://cs.chromium.org/search?q=+file:/try.star$+""dawn-linux-x64-deps-rel"")) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+""dawn-linux-x64-deps-rel"")) Path regular expressions: + * [`//content/test/gpu/.+`](https://cs.chromium.org/chromium/src/content/test/gpu/) * [`//gpu/.+`](https://cs.chromium.org/chromium/src/gpu/) * [`//testing/buildbot/chromium.dawn.json`](https://cs.chromium.org/search?q=+file:testing/buildbot/chromium.dawn.json) * [`//third_party/blink/renderer/modules/webgpu/.+`](https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/webgpu/) @@ -227,6 +228,7 @@ * [dawn-mac-x64-deps-rel](https://ci.chromium.org/p/chromium/builders/try/dawn-mac-x64-deps-rel) ([definition](https://cs.chromium.org/search?q=+file:/try.star$+""dawn-mac-x64-deps-rel"")) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+""dawn-mac-x64-deps-rel"")) Path regular expressions: + * [`//content/test/gpu/.+`](https://cs.chromium.org/chromium/src/content/test/gpu/) * [`//gpu/.+`](https://cs.chromium.org/chromium/src/gpu/) * [`//testing/buildbot/chromium.dawn.json`](https://cs.chromium.org/search?q=+file:testing/buildbot/chromium.dawn.json) * [`//third_party/blink/renderer/modules/webgpu/.+`](https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/webgpu/) @@ -241,6 +243,7 @@ * [dawn-win10-x64-deps-rel](https://ci.chromium.org/p/chromium/builders/try/dawn-win10-x64-deps-rel) ([definition](https://cs.chromium.org/search?q=+file:/try.star$+""dawn-win10-x64-deps-rel"")) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+""dawn-win10-x64-deps-rel"")) Path regular expressions: + * [`//content/test/gpu/.+`](https://cs.chromium.org/chromium/src/content/test/gpu/) * [`//gpu/.+`](https://cs.chromium.org/chromium/src/gpu/) * [`//testing/buildbot/chromium.dawn.json`](https://cs.chromium.org/search?q=+file:testing/buildbot/chromium.dawn.json) * [`//third_party/blink/renderer/modules/webgpu/.+`](https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/webgpu/) @@ -255,6 +258,7 @@ * [dawn-win10-x86-deps-rel](https://ci.chromium.org/p/chromium/builders/try/dawn-win10-x86-deps-rel) ([definition](https://cs.chromium.org/search?q=+file:/try.star$+""dawn-win10-x86-deps-rel"")) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+""dawn-win10-x86-deps-rel"")) Path regular expressions: + * [`//content/test/gpu/.+`](https://cs.chromium.org/chromium/src/content/test/gpu/) * [`//gpu/.+`](https://cs.chromium.org/chromium/src/gpu/) * [`//testing/buildbot/chromium.dawn.json`](https://cs.chromium.org/search?q=+file:testing/buildbot/chromium.dawn.json) * [`//third_party/blink/renderer/modules/webgpu/.+`](https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/webgpu/) @@ -312,7 +316,7 @@ * [`//chromeos/components/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chromeos/components/chromebox_for_meetings/) * [`//chromeos/dbus/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chromeos/dbus/chromebox_for_meetings/) * [`//chromeos/services/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chromeos/services/chromebox_for_meetings/) - * [`//chrome/browser/chromeos/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chrome/browser/chromeos/chromebox_for_meetings/) + * [`//chrome/browser/ash/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chrome/browser/ash/chromebox_for_meetings/) * [`//chrome/browser/resources/chromeos/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chrome/browser/resources/chromeos/chromebox_for_meetings/) * [`//chrome/browser/ui/webui/chromeos/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/) * [`//chrome/test/data/webui/chromeos/chromebox_for_meetings/.+`](https://cs.chromium.org/chromium/src/chrome/test/data/webui/chromeos/chromebox_for_meetings/)
diff --git a/infra/config/generated/cq-usage/full.cfg b/infra/config/generated/cq-usage/full.cfg index d6f97ee..8915da1 100644 --- a/infra/config/generated/cq-usage/full.cfg +++ b/infra/config/generated/cq-usage/full.cfg
@@ -212,6 +212,7 @@ } builders { name: "chromium/try/dawn-linux-x64-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -227,6 +228,7 @@ } builders { name: "chromium/try/dawn-mac-x64-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -242,6 +244,7 @@ } builders { name: "chromium/try/dawn-win10-x64-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -257,6 +260,7 @@ } builders { name: "chromium/try/dawn-win10-x86-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -355,7 +359,7 @@ location_regexp: ".+/[+]/chromeos/components/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chromeos/dbus/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chromeos/services/chromebox_for_meetings/.+" - location_regexp: ".+/[+]/chrome/browser/chromeos/chromebox_for_meetings/.+" + location_regexp: ".+/[+]/chrome/browser/ash/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chrome/browser/resources/chromeos/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chrome/test/data/webui/chromeos/chromebox_for_meetings/.+"
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index 27f9302..cdcfd0f4 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -718,6 +718,7 @@ } builders { name: "chromium/try/dawn-linux-x64-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -733,6 +734,7 @@ } builders { name: "chromium/try/dawn-mac-x64-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -764,6 +766,7 @@ } builders { name: "chromium/try/dawn-win10-x64-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -779,6 +782,7 @@ } builders { name: "chromium/try/dawn-win10-x86-deps-rel" + location_regexp: ".+/[+]/content/test/gpu/.+" location_regexp: ".+/[+]/gpu/.+" location_regexp: ".+/[+]/testing/buildbot/chromium.dawn.json" location_regexp: ".+/[+]/third_party/blink/renderer/modules/webgpu/.+" @@ -912,6 +916,10 @@ includable_only: true } builders { + name: "chromium/try/gpu-fyi-try-chromeos-zork-exp" + includable_only: true + } + builders { name: "chromium/try/gpu-fyi-try-lacros-amd-rel" includable_only: true } @@ -1227,7 +1235,7 @@ location_regexp: ".+/[+]/chromeos/components/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chromeos/dbus/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chromeos/services/chromebox_for_meetings/.+" - location_regexp: ".+/[+]/chrome/browser/chromeos/chromebox_for_meetings/.+" + location_regexp: ".+/[+]/chrome/browser/ash/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chrome/browser/resources/chromeos/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/.+" location_regexp: ".+/[+]/chrome/test/data/webui/chromeos/chromebox_for_meetings/.+"
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index 5680d01..8f0e9ea 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -30600,6 +30600,88 @@ } } builders { + name: "gpu-fyi-chromeos-zork-exp" + swarming_host: "chromium-swarm.appspot.com" + dimensions: "builderless:1" + dimensions: "cores:8" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.chromium.gpu.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/chromium/bootstrapper/${platform}" + cipd_version: "latest" + cmd: "bootstrapper" + } + properties: + '{' + ' "$bootstrap/exe": {' + ' "exe": {' + ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' + ' "cipd_version": "refs/heads/main",' + ' "cmd": [' + ' "luciexe"' + ' ]' + ' }' + ' },' + ' "$bootstrap/properties": {' + ' "properties_file": "infra/config/generated/builders/ci/gpu-fyi-chromeos-zork-exp/properties.json",' + ' "top_level_project": {' + ' "ref": "refs/heads/main",' + ' "repo": {' + ' "host": "chromium.googlesource.com",' + ' "project": "chromium/src"' + ' }' + ' }' + ' },' + ' "builder_group": "chromium.gpu.fyi",' + ' "led_builder_is_bootstrapped": true,' + ' "recipe": "chromium",' + ' "sheriff_rotations": [' + ' "chromium.gpu"' + ' ]' + '}' + execution_timeout_secs: 21600 + build_numbers: YES + service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + experiments { + key: "luci.recipes.use_python3" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "gpu_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" + } + } + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "blink_web_tests_ci_test_results" + test_results { + predicate { + test_id_regexp: "ninja://[^/]*blink_web_tests/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { name: "ios-angle-builder" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" @@ -58858,6 +58940,92 @@ } } builders { + name: "gpu-fyi-try-chromeos-zork-exp" + swarming_host: "chromium-swarm.appspot.com" + dimensions: "builderless:1" + dimensions: "cores:8" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.chromium.gpu.chromeos.zork.try" + exe { + cipd_package: "infra/chromium/bootstrapper/${platform}" + cipd_version: "latest" + cmd: "bootstrapper" + } + properties: + '{' + ' "$bootstrap/exe": {' + ' "exe": {' + ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' + ' "cipd_version": "refs/heads/main",' + ' "cmd": [' + ' "luciexe"' + ' ]' + ' }' + ' },' + ' "$bootstrap/properties": {' + ' "properties_file": "infra/config/generated/builders/try/gpu-fyi-try-chromeos-zork-exp/properties.json",' + ' "top_level_project": {' + ' "ref": "refs/heads/main",' + ' "repo": {' + ' "host": "chromium.googlesource.com",' + ' "project": "chromium/src"' + ' }' + ' }' + ' },' + ' "builder_group": "tryserver.chromium.chromiumos",' + ' "led_builder_is_bootstrapped": true,' + ' "recipe": "chromium_trybot"' + '}' + execution_timeout_secs: 21600 + expiration_secs: 7200 + caches { + name: "win_toolchain" + path: "win_toolchain" + } + build_numbers: YES + service_account: "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + task_template_canary_percentage { + value: 5 + } + experiments { + key: "luci.recipes.use_python3" + value: 100 + } + resultdb { + enable: true + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "try_test_results" + test_results {} + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "gpu_try_test_results" + test_results { + predicate { + test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" + } + } + } + bq_exports { + project: "chrome-luci-data" + dataset: "chromium" + table: "blink_web_tests_try_test_results" + test_results { + predicate { + test_id_regexp: "ninja://[^/]*blink_web_tests/.+" + } + } + } + history_options { + use_invocation_timestamp: true + } + } + } + builders { name: "gpu-fyi-try-lacros-amd-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1"
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index e966578a..fd71bfc 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -8432,6 +8432,9 @@ builders { name: "buildbucket/luci.chromium.ci/gpu-fyi-chromeos-octopus-exp" } + builders { + name: "buildbucket/luci.chromium.ci/gpu-fyi-chromeos-zork-exp" + } builder_view_only: true } consoles { @@ -8711,6 +8714,11 @@ short_name: "P6" } builders { + name: "buildbucket/luci.chromium.ci/gpu-fyi-chromeos-zork-exp" + category: "ChromeOS|AMD" + short_name: "zrk" + } + builders { name: "buildbucket/luci.chromium.ci/gpu-fyi-chromeos-jacuzzi-exp" category: "ChromeOS|ARM" short_name: "jcz" @@ -15020,6 +15028,9 @@ name: "buildbucket/luci.chromium.try/gpu-fyi-try-chromeos-octopus-exp" } builders { + name: "buildbucket/luci.chromium.try/gpu-fyi-try-chromeos-zork-exp" + } + builders { name: "buildbucket/luci.chromium.try/gpu-fyi-try-lacros-amd-rel" } builders { @@ -16096,6 +16107,9 @@ name: "buildbucket/luci.chromium.try/gpu-fyi-try-chromeos-octopus-exp" } builders { + name: "buildbucket/luci.chromium.try/gpu-fyi-try-chromeos-zork-exp" + } + builders { name: "buildbucket/luci.chromium.try/lacros-amd64-generic-rel" } builders {
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index b4b3caf..3f59137 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -5159,6 +5159,16 @@ } } job { + id: "gpu-fyi-chromeos-zork-exp" + realm: "ci" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "ci" + builder: "gpu-fyi-chromeos-zork-exp" + } +} +job { id: "ios-angle-builder" realm: "ci" acl_sets: "ci" @@ -7407,6 +7417,7 @@ triggers: "fuchsia-x64-dbg" triggers: "gpu-fyi-chromeos-jacuzzi-exp" triggers: "gpu-fyi-chromeos-octopus-exp" + triggers: "gpu-fyi-chromeos-zork-exp" triggers: "ios-angle-builder" triggers: "ios-asan" triggers: "ios-catalyst"
diff --git a/infra/config/generated/sheriff-rotations/chromium.gpu.txt b/infra/config/generated/sheriff-rotations/chromium.gpu.txt index 6c7e312..e453673 100644 --- a/infra/config/generated/sheriff-rotations/chromium.gpu.txt +++ b/infra/config/generated/sheriff-rotations/chromium.gpu.txt
@@ -69,6 +69,7 @@ ci/Win7 FYI x64 Release (NVIDIA) ci/gpu-fyi-chromeos-jacuzzi-exp ci/gpu-fyi-chromeos-octopus-exp +ci/gpu-fyi-chromeos-zork-exp ci/linux-swangle-chromium-x64 ci/linux-swangle-tot-angle-x64 ci/linux-swangle-tot-swiftshader-x64
diff --git a/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star b/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star index 1152256..929332c2 100644 --- a/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.gpu.fyi.star
@@ -160,6 +160,31 @@ ) ci.gpu.linux_builder( + name = "gpu-fyi-chromeos-zork-exp", + builder_spec = builder_config.builder_spec( + chromium_config = builder_config.chromium_config( + config = "chromium", + apply_configs = ["mb"], + build_config = builder_config.build_config.RELEASE, + target_arch = builder_config.target_arch.INTEL, + target_bits = 64, + target_platform = builder_config.target_platform.CHROMEOS, + target_cros_boards = ["zork"], + ), + gclient_config = builder_config.gclient_config( + config = "chromium", + apply_configs = ["chromeos"], + ), + run_tests_serially = True, + ), + console_view_entry = consoles.console_view_entry( + category = "ChromeOS|AMD", + short_name = "zrk", + ), + list_view = "chromium.gpu.experimental", +) + +ci.gpu.linux_builder( name = "GPU FYI Android arm Builder", console_view_entry = consoles.console_view_entry( category = "Android|Builder",
diff --git a/infra/config/subprojects/chromium/gpu.try.star b/infra/config/subprojects/chromium/gpu.try.star index 5fef038..5a0efc80 100644 --- a/infra/config/subprojects/chromium/gpu.try.star +++ b/infra/config/subprojects/chromium/gpu.try.star
@@ -118,6 +118,12 @@ pool = "luci.chromium.gpu.chromeos.octopus.try", ) +gpu_chromeos_builder( + name = "gpu-fyi-try-chromeos-zork-exp", + mirrors = ["ci/gpu-fyi-chromeos-zork-exp"], + pool = "luci.chromium.gpu.chromeos.zork.try", +) + def gpu_linux_builder(*, name, **kwargs): return try_.builder( name = name,
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star b/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star index b55a8725..85c8849 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star
@@ -211,7 +211,7 @@ ".+/[+]/chromeos/components/chromebox_for_meetings/.+", ".+/[+]/chromeos/dbus/chromebox_for_meetings/.+", ".+/[+]/chromeos/services/chromebox_for_meetings/.+", - ".+/[+]/chrome/browser/chromeos/chromebox_for_meetings/.+", + ".+/[+]/chrome/browser/ash/chromebox_for_meetings/.+", ".+/[+]/chrome/browser/resources/chromeos/chromebox_for_meetings/.+", ".+/[+]/chrome/browser/ui/webui/chromeos/chromebox_for_meetings/.+", ".+/[+]/chrome/test/data/webui/chromeos/chromebox_for_meetings/.+",
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.dawn.star b/infra/config/subprojects/chromium/try/tryserver.chromium.dawn.star index 30e0e67..6b02b41 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.dawn.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.dawn.star
@@ -30,6 +30,7 @@ os = os.LINUX_BIONIC_REMOVE, tryjob = try_.job( location_regexp = [ + ".+/[+]/content/test/gpu/.+", ".+/[+]/gpu/.+", ".+/[+]/testing/buildbot/chromium.dawn.json", ".+/[+]/third_party/blink/renderer/modules/webgpu/.+", @@ -51,6 +52,7 @@ os = os.MAC_ANY, tryjob = try_.job( location_regexp = [ + ".+/[+]/content/test/gpu/.+", ".+/[+]/gpu/.+", ".+/[+]/testing/buildbot/chromium.dawn.json", ".+/[+]/third_party/blink/renderer/modules/webgpu/.+", @@ -72,6 +74,7 @@ os = os.WINDOWS_ANY, tryjob = try_.job( location_regexp = [ + ".+/[+]/content/test/gpu/.+", ".+/[+]/gpu/.+", ".+/[+]/testing/buildbot/chromium.dawn.json", ".+/[+]/third_party/blink/renderer/modules/webgpu/.+", @@ -93,6 +96,7 @@ os = os.WINDOWS_ANY, tryjob = try_.job( location_regexp = [ + ".+/[+]/content/test/gpu/.+", ".+/[+]/gpu/.+", ".+/[+]/testing/buildbot/chromium.dawn.json", ".+/[+]/third_party/blink/renderer/modules/webgpu/.+",
diff --git a/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm b/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm index 9b44d2c0..ccdfdb3e 100644 --- a/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm +++ b/ios/chrome/browser/infobars/infobar_badge_tab_helper.mm
@@ -191,6 +191,10 @@ // states. if (GetInfobarType(old_infobar) == InfobarType::kInfobarTypePermissions && GetInfobarType(new_infobar) == InfobarType::kInfobarTypePermissions) { + infobar_accept_observer_->scoped_observations().RemoveObservation( + static_cast<InfoBarIOS*>(old_infobar)); + infobar_accept_observer_->scoped_observations().AddObservation( + static_cast<InfoBarIOS*>(new_infobar)); return; } OnInfoBarRemoved(old_infobar, /*animate=*/false);
diff --git a/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm b/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm index 2242e9c..1ca2e27b6 100644 --- a/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm +++ b/ios/chrome/browser/ui/ntp/feed_management/follow_management_view_controller.mm
@@ -176,10 +176,11 @@ // TODO(crbug.com/1296745): Start spinner over UNDO text in snackbar. FollowedWebChannelItem* unfollowedItem = self.lastUnfollowedWebChannelItem; + __weak FollowManagementViewController* weakSelf = self; unfollowedItem.followedWebChannel.refollowRequestBlock(^(BOOL success) { // TODO(crbug.com/1296745): Stop spinner over UNDO text in snackbar. if (success) { - // TODO(crbug.com/1296745): Re-insert row. + [weakSelf reinsertLastUnfollowedItem]; } else { // TODO(crbug.com/1296745): Show undo failure snackbar. } @@ -202,4 +203,22 @@ withRowAnimation:UITableViewRowAnimationAutomatic]; } +// Reinserts last unfollowed item into both model and UI. +- (void)reinsertLastUnfollowedItem { + TableViewModel* model = self.tableViewModel; + NSIndexPath* indexPath = self.indexPathOfLastUnfollowAttempt; + + NSInteger sectionID = + [model sectionIdentifierForSectionIndex:indexPath.section]; + NSUInteger index = [model indexInItemTypeForIndexPath:indexPath]; + + [model insertItem:self.lastUnfollowedWebChannelItem + inSectionWithIdentifier:sectionID + atIndex:index]; + [self.tableView insertRowsAtIndexPaths:@[ indexPath ] + withRowAnimation:UITableViewRowAnimationAutomatic]; + self.lastUnfollowedWebChannelItem = nil; + self.indexPathOfLastUnfollowAttempt = nil; +} + @end
diff --git a/media/formats/BUILD.gn b/media/formats/BUILD.gn index 36e7fe3..e06b0b3 100644 --- a/media/formats/BUILD.gn +++ b/media/formats/BUILD.gn
@@ -348,6 +348,7 @@ sources = [ "hls/media_playlist_fuzzer.cc" ] deps = [ "//base", + "//base:i18n", "//media", ] }
diff --git a/media/formats/hls/media_playlist_fuzzer.cc b/media/formats/hls/media_playlist_fuzzer.cc index 3601d62a..50a91a1 100644 --- a/media/formats/hls/media_playlist_fuzzer.cc +++ b/media/formats/hls/media_playlist_fuzzer.cc
@@ -5,12 +5,22 @@ #include <cstddef> #include <cstdint> +#include "base/at_exit.h" #include "base/check.h" +#include "base/i18n/icu_util.h" #include "base/strings/string_piece.h" #include "media/formats/hls/media_playlist.h" #include "third_party/abseil-cpp/absl/types/variant.h" #include "url/gurl.h" +struct IcuEnvironment { + IcuEnvironment() { CHECK(base::i18n::InitializeICU()); } + // used by ICU integration. + base::AtExitManager at_exit_manager; +}; + +IcuEnvironment* env = new IcuEnvironment(); + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { // Create a StringPiece from the given input const base::StringPiece source(reinterpret_cast<const char*>(data), size);
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn index 78d151f..8b4dcc6 100644 --- a/media/gpu/BUILD.gn +++ b/media/gpu/BUILD.gn
@@ -260,8 +260,6 @@ defines = [ "MEDIA_GPU_IMPLEMENTATION" ] sources = [ "accelerated_video_decoder.h", - "buffer_validation.cc", - "buffer_validation.h", "codec_picture.cc", "codec_picture.h", "gpu_video_decode_accelerator_helpers.cc", @@ -341,6 +339,21 @@ } } +# The buffer validation functionality is in its own component so that it can be +# depended on without pulling the entire //media/gpu target. +component("buffer_validation") { + defines = [ "IS_MEDIA_GPU_BUFFER_VALIDATION_IMPL" ] + sources = [ + "buffer_validation.cc", + "buffer_validation.h", + ] + + public_deps = [ + "//base", + "//media", + ] +} + source_set("command_buffer_helper") { defines = [ "MEDIA_GPU_IMPLEMENTATION" ] sources = [ @@ -507,6 +520,8 @@ } if (is_linux || is_chromeos) { sources += [ "buffer_validation_unittest.cc" ] + + deps += [ ":buffer_validation" ] } # TODO(b/219079009): consider running these tests without VA-API or V4L2.
diff --git a/media/gpu/buffer_validation.cc b/media/gpu/buffer_validation.cc index 25a0f42..24c432c 100644 --- a/media/gpu/buffer_validation.cc +++ b/media/gpu/buffer_validation.cc
@@ -7,11 +7,11 @@ #include <algorithm> #include <cstdint> +#include "base/logging.h" #include "base/numerics/checked_math.h" #include "base/numerics/safe_conversions.h" #include "build/build_config.h" #include "media/base/video_frame.h" -#include "media/gpu/macros.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -25,22 +25,22 @@ bool GetFileSize(const int fd, size_t* size) { #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) if (fd < 0) { - VLOGF(1) << "Invalid file descriptor"; + VLOG(1) << "Invalid file descriptor"; return false; } off_t fd_size = lseek(fd, 0, SEEK_END); lseek(fd, 0, SEEK_SET); if (fd_size < 0u) { - VPLOGF(1) << "Fail to find the size of fd"; + VPLOG(1) << "Fail to find the size of fd"; return false; } if (!base::IsValueInRangeForNumericType<size_t>(fd_size)) { - VLOGF(1) << "fd_size is out of range of size_t" - << ", size=" << size - << ", size_t max=" << std::numeric_limits<size_t>::max() - << ", size_t min=" << std::numeric_limits<size_t>::min(); + VLOG(1) << "fd_size is out of range of size_t" + << ", size=" << size + << ", size_t max=" << std::numeric_limits<size_t>::max() + << ", size_t min=" << std::numeric_limits<size_t>::min(); return false; } @@ -58,26 +58,26 @@ const gfx::GpuMemoryBufferHandle& gmb_handle, GetFileSizeCBForTesting file_size_cb_for_testing) { if (gmb_handle.type != gfx::NATIVE_PIXMAP) { - VLOGF(1) << "Unexpected GpuMemoryBufferType: " << gmb_handle.type; + VLOG(1) << "Unexpected GpuMemoryBufferType: " << gmb_handle.type; return false; } if (!media::VideoFrame::IsValidCodedSize(coded_size)) { - VLOGF(1) << "Coded size is beyond allowed dimensions: " - << coded_size.ToString(); + VLOG(1) << "Coded size is beyond allowed dimensions: " + << coded_size.ToString(); return false; } if (pixel_format != PIXEL_FORMAT_I420 && pixel_format != PIXEL_FORMAT_NV12 && pixel_format != PIXEL_FORMAT_P016LE) { - VLOGF(1) << "Unsupported: " << pixel_format; + VLOG(1) << "Unsupported: " << pixel_format; return false; } #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format); if (num_planes != gmb_handle.native_pixmap_handle.planes.size() || num_planes == 0) { - VLOGF(1) << "Invalid number of dmabuf planes passed: " - << gmb_handle.native_pixmap_handle.planes.size() - << ", expected: " << num_planes; + VLOG(1) << "Invalid number of dmabuf planes passed: " + << gmb_handle.native_pixmap_handle.planes.size() + << ", expected: " << num_planes; return false; } @@ -91,8 +91,8 @@ for (size_t i = 0; i < num_planes; i++) { const auto& plane = gmb_handle.native_pixmap_handle.planes[i]; - DVLOGF(4) << "Plane " << i << ", offset: " << plane.offset - << ", stride: " << plane.stride; + DVLOG(4) << "Plane " << i << ", offset: " << plane.offset + << ", stride: " << plane.stride; size_t file_size_in_bytes; if (file_size_cb_for_testing) { @@ -110,7 +110,7 @@ if (!min_plane_size.IsValid<uint64_t>() || min_plane_size.ValueOrDie<uint64_t>() > plane.size || base::strict_cast<size_t>(plane.stride) < plane_pixel_width) { - VLOGF(1) << "Invalid strides/sizes"; + VLOG(1) << "Invalid strides/sizes"; return false; } @@ -122,7 +122,7 @@ if (!min_buffer_size.IsValid() || min_buffer_size.ValueOrDie() > base::strict_cast<uint64_t>(file_size_in_bytes)) { - VLOGF(1) << "Invalid strides/offsets"; + VLOG(1) << "Invalid strides/offsets"; return false; } }
diff --git a/media/gpu/buffer_validation.h b/media/gpu/buffer_validation.h index 8d9a01b..a63526d 100644 --- a/media/gpu/buffer_validation.h +++ b/media/gpu/buffer_validation.h
@@ -6,8 +6,8 @@ #define MEDIA_GPU_BUFFER_VALIDATION_H_ #include "base/callback.h" +#include "base/component_export.h" #include "media/base/video_types.h" -#include "media/gpu/media_gpu_export.h" namespace gfx { class Size; @@ -19,10 +19,12 @@ using GetFileSizeCBForTesting = base::RepeatingCallback<size_t()>; // Gets the file size of |fd| and writes in |size|. Returns false on failure. -MEDIA_GPU_EXPORT bool GetFileSize(const int fd, size_t* size); +COMPONENT_EXPORT(MEDIA_GPU_BUFFER_VALIDATION) +bool GetFileSize(const int fd, size_t* size); // Verifies if GpuMemoryBufferHandle is valid. -MEDIA_GPU_EXPORT bool VerifyGpuMemoryBufferHandle( +COMPONENT_EXPORT(MEDIA_GPU_BUFFER_VALIDATION) +bool VerifyGpuMemoryBufferHandle( media::VideoPixelFormat pixel_format, const gfx::Size& coded_size, const gfx::GpuMemoryBufferHandle& gmb_handle,
diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn index 6fe21c1..e57e1ef 100644 --- a/media/gpu/chromeos/BUILD.gn +++ b/media/gpu/chromeos/BUILD.gn
@@ -64,6 +64,8 @@ "libyuv_image_processor_backend.h", "mailbox_video_frame_converter.cc", "mailbox_video_frame_converter.h", + "oop_video_decoder.cc", + "oop_video_decoder.h", "platform_video_frame_pool.cc", "platform_video_frame_pool.h", "platform_video_frame_utils.cc", @@ -78,7 +80,10 @@ ] # TODO(crbug.com/1012587): Merge :fourcc to :common. - public_deps = [ ":fourcc" ] + public_deps = [ + ":fourcc", + "//media/mojo/mojom/stable:stable_video_decoder_cpp_sources", + ] deps = [ ":fourcc", @@ -87,6 +92,7 @@ "//build/config/linux/libdrm", "//gpu/ipc/common:common", "//media", + "//media/gpu:buffer_validation", "//media/gpu:buildflags", "//media/gpu:command_buffer_helper", "//media/gpu:common",
diff --git a/media/gpu/chromeos/DEPS b/media/gpu/chromeos/DEPS index a22f2ffd..22746046 100644 --- a/media/gpu/chromeos/DEPS +++ b/media/gpu/chromeos/DEPS
@@ -1,4 +1,5 @@ include_rules = [ "+chromeos/components/cdm_factory_daemon", + "+mojo/public/cpp/bindings", "+third_party/cros_system_api/constants/cdm_oemcrypto.h", -] \ No newline at end of file +]
diff --git a/media/gpu/chromeos/oop_video_decoder.cc b/media/gpu/chromeos/oop_video_decoder.cc new file mode 100644 index 0000000..ed93854 --- /dev/null +++ b/media/gpu/chromeos/oop_video_decoder.cc
@@ -0,0 +1,377 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/gpu/chromeos/oop_video_decoder.h" + +#include "media/gpu/macros.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" + +// Throughout this file, we have sprinkled many CHECK()s to assert invariants +// that should hold regardless of the behavior of the remote decoder or +// untrusted client. We use CHECK()s instead of DCHECK()s because +// OOPVideoDecoder and associated classes are very stateful so: +// +// a) They're hard to reason about. +// b) They're hard to fully exercise with tests. +// c) It's hard to reason if the violation of an invariant can have security +// implications because once we enter into a bad state, everything is fair +// game. +// +// Hence it's safer to crash and surface those crashes. +// +// More specifically: +// +// - It's illegal to call many methods if OOPVideoDecoder enters into an error +// state (tracked by |has_error_|). +// +// - The media::VideoDecoder interface demands that its users don't call certain +// methods while in specific states. An OOPVideoDecoder is used by an +// in-process class (the VideoDecoderPipeline) to communicate with an +// out-of-process video decoder. Therefore, we trust that the in-process user +// of this class abides by the requirements of the media::VideoDecoder +// interface and thus, we don't handle violations gracefully. In particular: +// +// - No media::VideoDecoder methods should be called before the |init_cb| +// passed to Initialize() is called. We track this interim state with +// |init_cb_|. +// +// - Initialize() should not be called while there are pending decodes (i.e., +// while !pending_decodes_.empty()). +// +// - No media::VideoDecoder methods should be called before the |closure| +// passed to Reset() is called. We track this interim state with +// |reset_cb_|. + +// TODO(b/220915557): OOPVideoDecoder cannot trust |remote_decoder_| (but +// |remote_decoder_| might trust us). We need to audit this class to make sure: +// +// - That OOPVideoDecoder validates everything coming from +// |remote_video_decoder_|. +// +// - That OOPVideoDecoder meets the requirements of the media::VideoDecoder and +// the media::VideoDecoderMixin interfaces. For example, we need to make sure +// we guarantee statements like "all pending Decode() requests will be +// finished or aborted before |closure| is called" (for +// VideoDecoder::Reset()). +// +// - That OOPVideoDecoder asserts it's not being misused (which might cause us +// to violate the requirements of the StableVideoDecoder interface). For +// example, the StableVideoDecoder interface says for Decode(): "this must not +// be called while there are pending Initialize(), Reset(), or Decode(EOS) +// requests." + +namespace media { + +// static +std::unique_ptr<VideoDecoderMixin> OOPVideoDecoder::Create( + std::unique_ptr<MediaLog> media_log, + scoped_refptr<base::SequencedTaskRunner> decoder_task_runner, + base::WeakPtr<VideoDecoderMixin::Client> client, + mojo::PendingRemote<stable::mojom::StableVideoDecoder> + pending_remote_decoder) { + // TODO(b/171813538): make the destructor of this class (as well as the + // destructor of sister class VaapiVideoDecoder) public so the explicit + // argument can be removed from this call to base::WrapUnique(). + return base::WrapUnique<VideoDecoderMixin>(new OOPVideoDecoder( + std::move(media_log), std::move(decoder_task_runner), std::move(client), + std::move(pending_remote_decoder))); +} + +OOPVideoDecoder::OOPVideoDecoder( + std::unique_ptr<MediaLog> media_log, + scoped_refptr<base::SequencedTaskRunner> decoder_task_runner, + base::WeakPtr<VideoDecoderMixin::Client> client, + mojo::PendingRemote<stable::mojom::StableVideoDecoder> + pending_remote_decoder) + : VideoDecoderMixin(std::move(media_log), + std::move(decoder_task_runner), + std::move(client)), + remote_decoder_(std::move(pending_remote_decoder)), + weak_this_factory_(this) { + VLOGF(2); + DCHECK(decoder_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // Set a connection error handler in case the remote decoder gets + // disconnected, for instance, if the remote decoder process crashes. + // The remote decoder lives in a utility process (for lacros-chrome, + // this utility process is in ash-chrome). + // base::Unretained() is safe because `this` owns the `mojo::Remote`. + remote_decoder_.set_disconnect_handler( + base::BindOnce(&OOPVideoDecoder::Stop, base::Unretained(this))); + + CHECK(!has_error_); + // TODO(b/171813538): plumb the remaining parameters. + remote_decoder_->Construct( + client_receiver_.BindNewEndpointAndPassRemote(), + mojo::PendingRemote<stable::mojom::MediaLog>(), + mojo::PendingReceiver<stable::mojom::VideoFrameHandleReleaser>(), + mojo::ScopedDataPipeConsumerHandle(), gfx::ColorSpace()); +} + +OOPVideoDecoder::~OOPVideoDecoder() { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + for (auto& pending_decode : pending_decodes_) { + decoder_task_runner_->PostTask( + FROM_HERE, base::BindOnce(std::move(pending_decode.second), + DecoderStatus::Codes::kAborted)); + } +} + +void OOPVideoDecoder::Initialize(const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + InitCB init_cb, + const OutputCB& output_cb, + const WaitingCB& waiting_cb) { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!init_cb_); + CHECK(pending_decodes_.empty()); + CHECK(!reset_cb_); + + if (has_error_) { + // TODO(b/171813538): create specific error code for this decoder. + std::move(init_cb).Run(DecoderStatus::Codes::kFailed); + return; + } + + // TODO(b/171813538): implement the re-initialization logic. The client can + // call Initialize() multiple times. This implies properly asserting the + // invariant imposed by media::VideoDecoder::Initialize(): "No VideoDecoder + // calls should be made before |init_cb| is executed." + if (output_cb_) { + // TODO(b/171813538): create specific error code for this decoder. + std::move(init_cb).Run(DecoderStatus::Codes::kFailed); + return; + } + + init_cb_ = std::move(init_cb); + output_cb_ = output_cb; + waiting_cb_ = waiting_cb; + + // TODO(b/171813538): plumb protected content. + mojo::PendingRemote<stable::mojom::StableCdmContext> + pending_remote_cdm_context; + + remote_decoder_->Initialize(config, low_delay, + std::move(pending_remote_cdm_context), + base::BindOnce(&OOPVideoDecoder::OnInitializeDone, + weak_this_factory_.GetWeakPtr())); +} + +void OOPVideoDecoder::OnInitializeDone(const DecoderStatus& status, + bool needs_bitstream_conversion, + int32_t max_decode_requests, + VideoDecoderType decoder_type) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!has_error_); + + if (!status.is_ok() || (decoder_type != VideoDecoderType::kVaapi && + decoder_type != VideoDecoderType::kV4L2)) { + Stop(); + return; + } + decoder_type_ = decoder_type; + std::move(init_cb_).Run(status); +} + +void OOPVideoDecoder::Decode(scoped_refptr<DecoderBuffer> buffer, + DecodeCB decode_cb) { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!init_cb_); + CHECK(!reset_cb_); + + if (has_error_ || decoder_type_ == VideoDecoderType::kUnknown) { + decoder_task_runner_->PostTask( + FROM_HERE, base::BindOnce(std::move(decode_cb), + DecoderStatus::Codes::kNotInitialized)); + return; + } + + if (decode_counter_ == std::numeric_limits<uint64_t>::max()) { + // Error out in case of overflow. + decoder_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(std::move(decode_cb), DecoderStatus::Codes::kFailed)); + return; + } + const uint64_t decode_id = decode_counter_++; + + pending_decodes_.insert({decode_id, std::move(decode_cb)}); + + const bool is_flushing = buffer->end_of_stream(); + + // TODO(b/171813538): create buffer from input parameter |buffer|. + remote_decoder_->Decode( + stable::mojom::DecoderBufferPtr(), + base::BindOnce(&OOPVideoDecoder::OnDecodeDone, + weak_this_factory_.GetWeakPtr(), decode_id, is_flushing)); +} + +void OOPVideoDecoder::OnDecodeDone(uint64_t decode_id, + bool is_flushing, + const DecoderStatus& status) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!has_error_); + + // Check that decode callbacks are called in the same order as Decode(). + CHECK(!pending_decodes_.empty()); + if (pending_decodes_.cbegin()->first != decode_id) { + VLOGF(2) << "Unexpected decode callback for request " << decode_id; + Stop(); + return; + } + + // Check that the |decode_cb| corresponding to the flush is not called until + // the decode callback has been called for each pending decode. + if (is_flushing && pending_decodes_.size() != 1) { + VLOGF(2) << "Received a flush callback while having pending decodes"; + Stop(); + return; + } + + auto it = pending_decodes_.begin(); + DecodeCB decode_cb = std::move(it->second); + pending_decodes_.erase(it); + std::move(decode_cb).Run(status); +} + +void OOPVideoDecoder::Reset(base::OnceClosure reset_cb) { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!init_cb_); + CHECK(!reset_cb_); + + if (has_error_ || decoder_type_ == VideoDecoderType::kUnknown) { + std::move(reset_cb).Run(); + return; + } + + reset_cb_ = std::move(reset_cb); + remote_decoder_->Reset(base::BindOnce(&OOPVideoDecoder::OnResetDone, + weak_this_factory_.GetWeakPtr())); +} + +void OOPVideoDecoder::OnResetDone() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!has_error_); + CHECK(reset_cb_); + if (!pending_decodes_.empty()) { + VLOGF(2) << "Received a reset callback while having pending decodes"; + Stop(); + return; + } + std::move(reset_cb_).Run(); +} + +void OOPVideoDecoder::Stop() { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (has_error_) + return; + + has_error_ = true; + + // There may be in-flight decode, initialize or reset callbacks. + // Invalidate any outstanding weak pointers so those callbacks are ignored. + weak_this_factory_.InvalidateWeakPtrs(); + + // |init_cb_| is likely to reentrantly destruct |this|, so we check for that + // using an on-stack WeakPtr. + base::WeakPtr<OOPVideoDecoder> weak_this = weak_this_factory_.GetWeakPtr(); + + client_receiver_.reset(); + remote_decoder_.reset(); + + if (init_cb_) + std::move(init_cb_).Run(DecoderStatus::Codes::kFailed); + + if (!weak_this) + return; + + for (auto& pending_decode : pending_decodes_) { + std::move(pending_decode.second).Run(DecoderStatus::Codes::kFailed); + if (!weak_this) + return; + } + pending_decodes_.clear(); + + if (reset_cb_) + std::move(reset_cb_).Run(); +} + +void OOPVideoDecoder::ApplyResolutionChange() { + NOTREACHED(); +} + +bool OOPVideoDecoder::NeedsBitstreamConversion() const { + NOTIMPLEMENTED(); + NOTREACHED(); + return false; +} + +bool OOPVideoDecoder::CanReadWithoutStalling() const { + NOTIMPLEMENTED(); + NOTREACHED(); + return true; +} + +int OOPVideoDecoder::GetMaxDecodeRequests() const { + NOTIMPLEMENTED(); + NOTREACHED(); + return 4; +} + +VideoDecoderType OOPVideoDecoder::GetDecoderType() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return decoder_type_; +} + +bool OOPVideoDecoder::IsPlatformDecoder() const { + NOTIMPLEMENTED(); + NOTREACHED(); + return true; +} + +bool OOPVideoDecoder::NeedsTranscryption() { + return false; +} + +void OOPVideoDecoder::OnVideoFrameDecoded( + const scoped_refptr<VideoFrame>& frame, + bool can_read_without_stalling, + const absl::optional<base::UnguessableToken>& release_token) { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!has_error_); + + // TODO(b/220915557): validate |frame|. + if (output_cb_) + output_cb_.Run(frame); +} + +void OOPVideoDecoder::OnWaiting(WaitingReason reason) { + VLOGF(2); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + CHECK(!has_error_); + + if (waiting_cb_) + waiting_cb_.Run(reason); +} + +} // namespace media
diff --git a/media/gpu/chromeos/oop_video_decoder.h b/media/gpu/chromeos/oop_video_decoder.h new file mode 100644 index 0000000..7cec18e --- /dev/null +++ b/media/gpu/chromeos/oop_video_decoder.h
@@ -0,0 +1,108 @@ +// Copyright 2022 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_GPU_CHROMEOS_OOP_VIDEO_DECODER_H_ +#define MEDIA_GPU_CHROMEOS_OOP_VIDEO_DECODER_H_ + +#include "base/memory/scoped_refptr.h" +#include "base/memory/weak_ptr.h" +#include "media/base/media_log.h" +#include "media/gpu/chromeos/video_decoder_pipeline.h" +#include "media/mojo/mojom/stable/stable_video_decoder.mojom.h" +#include "mojo/public/cpp/bindings/associated_receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace media { + +// Proxy video decoder that connects with an out-of-process +// video decoder via Mojo. This class should be operated and +// destroyed on |decoder_task_runner_|. +class OOPVideoDecoder : public VideoDecoderMixin, + public stable::mojom::VideoDecoderClient { + public: + OOPVideoDecoder(const OOPVideoDecoder&) = delete; + OOPVideoDecoder& operator=(const OOPVideoDecoder&) = delete; + + static std::unique_ptr<VideoDecoderMixin> Create( + std::unique_ptr<MediaLog> media_log, + scoped_refptr<base::SequencedTaskRunner> decoder_task_runner, + base::WeakPtr<VideoDecoderMixin::Client> client, + mojo::PendingRemote<stable::mojom::StableVideoDecoder> + pending_remote_decoder); + + // VideoDecoderMixin implementation, VideoDecoder part. + void Initialize(const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + InitCB init_cb, + const OutputCB& output_cb, + const WaitingCB& waiting_cb) override; + void Decode(scoped_refptr<DecoderBuffer> buffer, DecodeCB decode_cb) override; + void Reset(base::OnceClosure reset_cb) override; + bool NeedsBitstreamConversion() const override; + bool CanReadWithoutStalling() const override; + int GetMaxDecodeRequests() const override; + VideoDecoderType GetDecoderType() const override; + bool IsPlatformDecoder() const override; + // VideoDecoderMixin implementation, specific part. + void ApplyResolutionChange() override; + bool NeedsTranscryption() override; + + // stable::mojom::VideoDecoderClient implementation. + void OnVideoFrameDecoded( + const scoped_refptr<VideoFrame>& frame, + bool can_read_without_stalling, + const absl::optional<base::UnguessableToken>& release_token) final; + void OnWaiting(WaitingReason reason) final; + + private: + OOPVideoDecoder(std::unique_ptr<MediaLog> media_log, + scoped_refptr<base::SequencedTaskRunner> decoder_task_runner, + base::WeakPtr<VideoDecoderMixin::Client> client, + mojo::PendingRemote<stable::mojom::StableVideoDecoder> + pending_remote_decoder); + ~OOPVideoDecoder() override; + + void OnInitializeDone(const DecoderStatus& status, + bool needs_bitstream_conversion, + int32_t max_decode_requests, + VideoDecoderType decoder_type); + void OnDecodeDone(uint64_t decode_id, + bool is_flushing, + const DecoderStatus& status); + void OnResetDone(); + + void Stop(); + + InitCB init_cb_ GUARDED_BY_CONTEXT(sequence_checker_); + OutputCB output_cb_ GUARDED_BY_CONTEXT(sequence_checker_); + WaitingCB waiting_cb_ GUARDED_BY_CONTEXT(sequence_checker_); + uint64_t decode_counter_ GUARDED_BY_CONTEXT(sequence_checker_) = 0; + + // std::map is used to ensure that iterating through |pending_decodes_| is + // done in the order in which Decode() is called. + std::map<uint64_t, DecodeCB> pending_decodes_ + GUARDED_BY_CONTEXT(sequence_checker_); + + base::OnceClosure reset_cb_ GUARDED_BY_CONTEXT(sequence_checker_); + + mojo::AssociatedReceiver<stable::mojom::VideoDecoderClient> client_receiver_ + GUARDED_BY_CONTEXT(sequence_checker_){this}; + + VideoDecoderType decoder_type_ GUARDED_BY_CONTEXT(sequence_checker_) = + VideoDecoderType::kUnknown; + + mojo::Remote<stable::mojom::StableVideoDecoder> remote_decoder_ + GUARDED_BY_CONTEXT(sequence_checker_); + bool has_error_ GUARDED_BY_CONTEXT(sequence_checker_) = false; + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory<OOPVideoDecoder> weak_this_factory_ + GUARDED_BY_CONTEXT(sequence_checker_); +}; + +} // namespace media + +#endif // MEDIA_GPU_CHROMEOS_OOP_VIDEO_DECODER_H_
diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc index 4cfb99c9..5bf723f 100644 --- a/media/gpu/chromeos/video_decoder_pipeline.cc +++ b/media/gpu/chromeos/video_decoder_pipeline.cc
@@ -118,6 +118,8 @@ VideoDecoderPipeline::GetSupportedConfigs( const gpu::GpuDriverBugWorkarounds& workarounds) { absl::optional<SupportedVideoDecoderConfigs> configs = + // TODO(b/195769334): figure out the best way to query the supported + // configurations when using an out-of-process video decoder. #if BUILDFLAG(USE_VAAPI) VaapiVideoDecoder::GetSupportedConfigs(); #elif BUILDFLAG(USE_V4L2_CODEC)
diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn index 65e5f58..4966be8d 100644 --- a/media/gpu/v4l2/BUILD.gn +++ b/media/gpu/v4l2/BUILD.gn
@@ -43,7 +43,6 @@ "v4l2_slice_video_decode_accelerator.h", "v4l2_stateful_workaround.cc", "v4l2_stateful_workaround.h", - "v4l2_status.h", "v4l2_utils.cc", "v4l2_utils.h", "v4l2_vda_helpers.cc", @@ -94,6 +93,7 @@ public_deps = [ "//ui/gl" ] deps = [ + ":v4l2_status", "//base", "//gpu/ipc/common", "//gpu/ipc/service", @@ -127,6 +127,19 @@ } } +# The v4l2 status functionality is in its own source set so that it can be +# depended on without pulling the //media/gpu/v4l2:v4l2 target. +source_set("v4l2_status") { + sources = [ "v4l2_status.h" ] + + visibility = [ + ":v4l2", + "//media/mojo/mojom/stable:*", + ] + + deps = [ "//media" ] +} + source_set("unit_test") { testonly = true sources = [
diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn index 78ac788..b4e42889 100644 --- a/media/gpu/vaapi/BUILD.gn +++ b/media/gpu/vaapi/BUILD.gn
@@ -55,7 +55,6 @@ "vaapi_picture.h", "vaapi_picture_factory.cc", "vaapi_picture_factory.h", - "vaapi_status.h", "vaapi_video_decode_accelerator.cc", "vaapi_video_decode_accelerator.h", "vaapi_video_decoder.cc", @@ -91,6 +90,7 @@ deps = [ ":common", + ":vaapi_status", "//base", "//build:chromeos_buildflags", "//gpu/config", @@ -146,7 +146,10 @@ } if (use_ozone) { - deps += [ "//ui/ozone" ] + deps += [ + "//media/gpu:buffer_validation", + "//ui/ozone", + ] sources += [ "vaapi_picture_native_pixmap_ozone.cc", "vaapi_picture_native_pixmap_ozone.h", @@ -161,6 +164,19 @@ } } +# The vaapi status functionality is in its own source set so that it can be +# depended on without pulling the //media/gpu/vaapi:vaapi target. +source_set("vaapi_status") { + sources = [ "vaapi_status.h" ] + + visibility = [ + ":vaapi", + "//media/mojo/mojom/stable:*", + ] + + deps = [ "//media" ] +} + source_set("common") { defines = [ "MEDIA_GPU_IMPLEMENTATION" ] sources = [
diff --git a/media/mojo/mojom/stable/BUILD.gn b/media/mojo/mojom/stable/BUILD.gn index 814e36fd..25d636f 100644 --- a/media/mojo/mojom/stable/BUILD.gn +++ b/media/mojo/mojom/stable/BUILD.gn
@@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//media/gpu/args.gni") import("//mojo/public/tools/bindings/mojom.gni") mojom("stable_video_decoder") { @@ -123,7 +124,15 @@ ] traits_headers = [ "stable_video_decoder_types_mojom_traits.h" ] traits_sources = [ "stable_video_decoder_types_mojom_traits.cc" ] - traits_public_deps = [ "//media/gpu" ] + traits_deps = [ "//media/gpu:buffer_validation" ] + + if (use_vaapi) { + traits_deps += [ "//media/gpu/vaapi:vaapi_status" ] + } + + if (use_v4l2_codec) { + traits_deps += [ "//media/gpu/v4l2:v4l2_status" ] + } }, ]
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.cc b/media/video/gpu_memory_buffer_video_frame_pool.cc index 564c753..5dc87ab 100644 --- a/media/video/gpu_memory_buffer_video_frame_pool.cc +++ b/media/video/gpu_memory_buffer_video_frame_pool.cc
@@ -23,6 +23,7 @@ #include "base/location.h" #include "base/logging.h" #include "base/memory/raw_ptr.h" +#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/strings/stringprintf.h" #include "base/sys_byteorder.h" @@ -39,6 +40,7 @@ #include "media/video/gpu_video_accelerator_factories.h" #include "third_party/libyuv/include/libyuv.h" #include "ui/gfx/buffer_format_util.h" +#include "ui/gfx/buffer_types.h" #include "ui/gfx/color_space.h" #include "ui/gl/trace_util.h" @@ -49,6 +51,68 @@ namespace media { +namespace { + +const std::string PixelFormatToString(VideoPixelFormat format) { + switch (format) { + case PIXEL_FORMAT_YV12: + return "YV12"; + case PIXEL_FORMAT_I420: + return "I420"; + case PIXEL_FORMAT_YUV420P10: + return "YUV420P10"; + case PIXEL_FORMAT_I420A: + return "I420A"; + case PIXEL_FORMAT_NV12: + return "NV12"; + default: + NOTREACHED(); + return "UNKNOWN"; + } +} + +void RecordVideoFrameSizeAndOffsetHistogram(VideoPixelFormat pixel_format, + gfx::Size coded_size, + gfx::Rect visible_rect) { + bool odd_width = (coded_size.width() % 2) == 1; + bool odd_height = (coded_size.height() % 2) == 1; + bool odd_x = (visible_rect.x() % 2) == 1; + bool odd_y = (visible_rect.y() % 2) == 1; + + gfx::OddSize size_enum; + if (odd_width && odd_height) + size_enum = gfx::OddSize::kOddWidthAndHeight; + else if (odd_width) + size_enum = gfx::OddSize::kOddWidthOnly; + else if (odd_height) + size_enum = gfx::OddSize::kOddHeightOnly; + else + size_enum = gfx::OddSize::kEvenWidthAndHeight; + + base::UmaHistogramEnumeration("Media.GpuMemoryBufferVideoFramePool.Size", + size_enum); + base::UmaHistogramEnumeration("Media.GpuMemoryBufferVideoFramePool.Size." + + PixelFormatToString(pixel_format), + size_enum); + + gfx::OddOffset offset_enum; + if (odd_x && odd_y) + offset_enum = gfx::OddOffset::kOddXAndY; + else if (odd_x) + offset_enum = gfx::OddOffset::kOddXOnly; + else if (odd_y) + offset_enum = gfx::OddOffset::kOddYOnly; + else + offset_enum = gfx::OddOffset::kEvenXAndY; + + base::UmaHistogramEnumeration("Media.GpuMemoryBufferVideoFramePool.Offset", + offset_enum); + base::UmaHistogramEnumeration("Media.GpuMemoryBufferVideoFramePool.Offset." + + PixelFormatToString(pixel_format), + offset_enum); +} +} // namespace + const base::Feature kMultiPlaneSoftwareVideoSharedImages { "MultiPlaneSoftwareVideoSharedImages", #if BUILDFLAG(IS_MAC) @@ -749,6 +813,8 @@ case PIXEL_FORMAT_YUV420P10: case PIXEL_FORMAT_I420A: case PIXEL_FORMAT_NV12: + RecordVideoFrameSizeAndOffsetHistogram( + pixel_format, video_frame->coded_size(), video_frame->visible_rect()); break; // Unsupported cases. case PIXEL_FORMAT_I422:
diff --git a/net/BUILD.gn b/net/BUILD.gn index 9175073..ff1dac8 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -778,15 +778,6 @@ "quic/network_connection.h", "quic/platform/impl/quic_chromium_clock.cc", "quic/platform/impl/quic_chromium_clock.h", - "quic/platform/impl/quic_containers_impl.h", - "quic/platform/impl/quic_error_code_wrappers_impl.h", - "quic/platform/impl/quic_file_utils_impl.h", - "quic/platform/impl/quic_hostname_utils_impl.cc", - "quic/platform/impl/quic_hostname_utils_impl.h", - "quic/platform/impl/quic_prefetch_impl.h", - "quic/platform/impl/quic_server_stats_impl.h", - "quic/platform/impl/quic_sleep_impl.h", - "quic/platform/impl/quic_stack_trace_impl.h", "quic/properties_based_quic_server_info.cc", "quic/properties_based_quic_server_info.h", "quic/quic_address_mismatch.cc", @@ -2494,8 +2485,6 @@ sources = [ "quic/platform/impl/quic_epoll_clock.cc", "quic/platform/impl/quic_epoll_clock.h", - "quic/platform/impl/quic_stream_buffer_allocator_impl.h", - "quic/platform/impl/quic_udp_socket_platform_impl.h", ] deps = [ ":epoll_server", @@ -2630,12 +2619,6 @@ "quic/mock_encrypter.h", "quic/mock_quic_context.cc", "quic/mock_quic_context.h", - "quic/platform/impl/quic_expect_bug_impl.h", - "quic/platform/impl/quic_mock_log_impl.h", - "quic/platform/impl/quic_test_loopback_impl.cc", - "quic/platform/impl/quic_test_loopback_impl.h", - "quic/platform/impl/quic_test_output_impl.cc", - "quic/platform/impl/quic_test_output_impl.h", "quic/test_task_runner.cc", "quic/test_task_runner.h", "third_party/quiche/src/quic/test_tools/test_ticket_crypter.cc", @@ -2663,8 +2646,6 @@ source_set("simple_quic_tools") { sources = [ - "quic/platform/impl/quic_default_proof_providers_impl.cc", - "quic/platform/impl/quic_default_proof_providers_impl.h", "tools/quic/quic_client_message_loop_network_helper.cc", "tools/quic/quic_client_message_loop_network_helper.h", "tools/quic/quic_http_proxy_backend.cc",
diff --git a/net/quic/platform/impl/quic_containers_impl.h b/net/quic/platform/impl/quic_containers_impl.h deleted file mode 100644 index 05ea221..0000000 --- a/net/quic/platform/impl/quic_containers_impl.h +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright (c) 2017 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 NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_ - -#include <vector> - -#include "base/containers/flat_set.h" - -namespace quic { - -// TODO(wub): Switch to absl::InlinedVector once it is allowed. -template <typename T, size_t N, typename A = std::allocator<T>> -using QuicInlinedVectorImpl = std::vector<T, A>; - -template <typename Key, typename Compare> -using QuicSmallOrderedSetImpl = base::flat_set<Key, Compare>; - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_CONTAINERS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_default_proof_providers_impl.h b/net/quic/platform/impl/quic_default_proof_providers_impl.h deleted file mode 100644 index f490e53..0000000 --- a/net/quic/platform/impl/quic_default_proof_providers_impl.h +++ /dev/null
@@ -1,21 +0,0 @@ -// Copyright (c) 2019 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 NET_QUIC_PLATFORM_IMPL_QUIC_DEFAULT_PROOF_PROVIDERS_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_DEFAULT_PROOF_PROVIDERS_IMPL_H_ - -#include <memory> - -#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h" -#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h" - -namespace quic { - -std::unique_ptr<ProofVerifier> CreateDefaultProofVerifierImpl( - const std::string& host); -std::unique_ptr<ProofSource> CreateDefaultProofSourceImpl(); - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_DEFAULT_PROOF_PROVIDERS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_epoll_impl.h b/net/quic/platform/impl/quic_epoll_impl.h deleted file mode 100644 index f53ef8b..0000000 --- a/net/quic/platform/impl/quic_epoll_impl.h +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright (c) 2019 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. - -// A toy server, which listens on a specified address for QUIC traffic and -// handles incoming responses. -// -// Note that this server is intended to verify correctness of the client and is -// in no way expected to be performant. -#ifndef NET_QUIC_PLATFORM_IMPL_QUIC_EPOLL_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_EPOLL_IMPL_H_ - -#include "net/third_party/quiche/src/epoll_server/simple_epoll_server.h" - -namespace quic { - -using QuicEpollServerImpl = epoll_server::SimpleEpollServer; -using QuicEpollEventImpl = epoll_server::EpollEvent; -using QuicEpollAlarmBaseImpl = epoll_server::EpollAlarm; -using QuicEpollCallbackInterfaceImpl = epoll_server::EpollCallbackInterface; - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_EPOLL_IMPL_H_
diff --git a/net/quic/platform/impl/quic_error_code_wrappers_impl.h b/net/quic/platform/impl/quic_error_code_wrappers_impl.h deleted file mode 100644 index 504ee6b..0000000 --- a/net/quic/platform/impl/quic_error_code_wrappers_impl.h +++ /dev/null
@@ -1,12 +0,0 @@ -// Copyright (c) 2019 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 NET_QUIC_PLATFORM_IMPL_QUIC_ERROR_CODE_WRAPPERS_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_ERROR_CODE_WRAPPERS_IMPL_H_ - -#include "net/base/net_errors.h" - -#define QUIC_EMSGSIZE_IMPL net::ERR_MSG_TOO_BIG - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_ERROR_CODE_WRAPPERS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_expect_bug_impl.h b/net/quic/platform/impl/quic_expect_bug_impl.h deleted file mode 100644 index c4458ba..0000000 --- a/net/quic/platform/impl/quic_expect_bug_impl.h +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright (c) 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 NET_QUIC_PLATFORM_IMPL_QUIC_EXPECT_BUG_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_EXPECT_BUG_IMPL_H_ - -#include "net/test/gtest_util.h" - -#define EXPECT_QUIC_BUG_IMPL EXPECT_DFATAL -#define EXPECT_QUIC_PEER_BUG_IMPL(statement, regex) statement; - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_EXPECT_BUG_IMPL_H_
diff --git a/net/quic/platform/impl/quic_file_utils_impl.h b/net/quic/platform/impl/quic_file_utils_impl.h deleted file mode 100644 index a49fdd3..0000000 --- a/net/quic/platform/impl/quic_file_utils_impl.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright (c) 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 NET_QUIC_PLATFORM_IMPL_QUIC_FILE_UTILS_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_FILE_UTILS_IMPL_H_ - -#include <vector> - -#include "base/files/file_enumerator.h" -#include "base/files/file_util.h" -#include "base/strings/abseil_string_conversions.h" - -using base::FilePath; - -namespace quic { - -// Traverses the directory |dirname| and returns all of the files it contains. -std::vector<std::string> ReadFileContentsImpl(const std::string& dirname) { - std::vector<std::string> files; - FilePath directory(FilePath::FromUTF8Unsafe(dirname)); - base::FileEnumerator file_list(directory, true /* recursive */, - base::FileEnumerator::FILES); - for (FilePath file_iter = file_list.Next(); !file_iter.empty(); - file_iter = file_list.Next()) { - files.push_back(file_iter.AsUTF8Unsafe()); - } - return files; -} - -// Reads the contents of |filename| as a string into |contents|. -void ReadFileContentsImpl(absl::string_view filename, std::string* contents) { - base::ReadFileToString( - FilePath::FromUTF8Unsafe(base::StringViewToStringPiece(filename)), - contents); -} - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_FILE_UTILS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_hostname_utils_impl.h b/net/quic/platform/impl/quic_hostname_utils_impl.h deleted file mode 100644 index 247842a..0000000 --- a/net/quic/platform/impl/quic_hostname_utils_impl.h +++ /dev/null
@@ -1,31 +0,0 @@ -// Copyright (c) 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. - -#ifndef NET_QUIC_PLATFORM_IMPL_QUIC_HOSTNAME_UTILS_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_HOSTNAME_UTILS_IMPL_H_ - -#include "net/third_party/quiche/src/quic/platform/api/quic_export.h" -#include "third_party/abseil-cpp/absl/strings/string_view.h" - -namespace quic { - -class QUIC_EXPORT_PRIVATE QuicHostnameUtilsImpl { - public: - QuicHostnameUtilsImpl(const QuicHostnameUtilsImpl&) = delete; - QuicHostnameUtilsImpl& operator=(const QuicHostnameUtilsImpl&) = delete; - - // Returns true if the sni is valid, false otherwise. - // (1) disallow IP addresses; - // (2) check that the hostname contains valid characters only; and - // (3) contains at least one dot. - static bool IsValidSNI(absl::string_view sni); - - // Convert hostname to lowercase and remove the trailing '.'. - // WARNING: mutates |hostname| in place and returns |hostname|. - static std::string NormalizeHostname(absl::string_view hostname); -}; - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_HOSTNAME_UTILS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_mock_log_impl.h b/net/quic/platform/impl/quic_mock_log_impl.h deleted file mode 100644 index 6797c93..0000000 --- a/net/quic/platform/impl/quic_mock_log_impl.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright (c) 2017 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 NET_QUIC_PLATFORM_IMPL_QUIC_MOCK_LOG_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_MOCK_LOG_IMPL_H_ - -#include "base/test/mock_log.h" -#include "testing/gmock/include/gmock/gmock.h" // IWYU pragma: export - -using QuicMockLogImpl = base::test::MockLog; -#define CREATE_QUIC_MOCK_LOG_IMPL(log) QuicMockLog log - -#define EXPECT_QUIC_LOG_CALL_IMPL(log) EXPECT_CALL(log, Log(_, _, _, _, _)) - -#define EXPECT_QUIC_LOG_CALL_CONTAINS_IMPL(log, level, content) \ - EXPECT_CALL(log, \ - Log(logging::LOG_##level, _, _, _, testing::HasSubstr(content))) - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_MOCK_LOG_IMPL_H_
diff --git a/net/quic/platform/impl/quic_prefetch_impl.h b/net/quic/platform/impl/quic_prefetch_impl.h deleted file mode 100644 index 781720a..0000000 --- a/net/quic/platform/impl/quic_prefetch_impl.h +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2017 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 NET_QUIC_PLATFORM_IMPL_QUIC_PREFETCH_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_PREFETCH_IMPL_H_ - -#if defined(_MSC_VER) -#include <intrin.h> -#endif - -namespace quic { - -inline void QuicPrefetchT0Impl(const void* addr) { -#if defined(__GNUC__) || (defined(_M_ARM64) && defined(__clang__)) - __builtin_prefetch(addr, 0, 3); -#elif defined(_MSC_VER) - _mm_prefetch(reinterpret_cast<const char*>(addr), _MM_HINT_T0); -#endif -} - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_PREFETCH_IMPL_H_
diff --git a/net/quic/platform/impl/quic_server_stats_impl.h b/net/quic/platform/impl/quic_server_stats_impl.h deleted file mode 100644 index 1e7f100e..0000000 --- a/net/quic/platform/impl/quic_server_stats_impl.h +++ /dev/null
@@ -1,30 +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 NET_QUIC_PLATFORM_IMPL_QUIC_SERVER_STATS_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_SERVER_STATS_IMPL_H_ - -namespace quic { - -#define QUIC_SERVER_HISTOGRAM_ENUM_IMPL(name, sample, enum_size, docstring) \ - do { \ - } while (0) - -#define QUIC_SERVER_HISTOGRAM_BOOL_IMPL(name, sample, docstring) \ - do { \ - } while (0) - -#define QUIC_SERVER_HISTOGRAM_TIMES_IMPL(name, sample, min, max, bucket_count, \ - docstring) \ - do { \ - } while (0) - -#define QUIC_SERVER_HISTOGRAM_COUNTS_IMPL(name, sample, min, max, \ - bucket_count, docstring) \ - do { \ - } while (0) - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_SERVER_STATS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_sleep_impl.h b/net/quic/platform/impl/quic_sleep_impl.h deleted file mode 100644 index 14466f0..0000000 --- a/net/quic/platform/impl/quic_sleep_impl.h +++ /dev/null
@@ -1,20 +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 NET_QUIC_PLATFORM_IMPL_QUIC_SLEEP_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_SLEEP_IMPL_H_ - -#include "base/threading/platform_thread.h" -#include "base/time/time.h" -#include "net/third_party/quiche/src/quic/core/quic_time.h" - -namespace quic { - -inline void QuicSleepImpl(QuicTime::Delta duration) { - base::PlatformThread::Sleep(base::Milliseconds(duration.ToMilliseconds())); -} - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_SLEEP_IMPL_H_
diff --git a/net/quic/platform/impl/quic_stack_trace_impl.h b/net/quic/platform/impl/quic_stack_trace_impl.h deleted file mode 100644 index aa574f3..0000000 --- a/net/quic/platform/impl/quic_stack_trace_impl.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright (c) 2017 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 NET_QUIC_PLATFORM_IMPL_QUIC_STACK_TRACE_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_STACK_TRACE_IMPL_H_ - -#include "base/debug/stack_trace.h" - -namespace quic { - -inline std::string QuicStackTraceImpl() { - return base::debug::StackTrace().ToString(); -} - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_STACK_TRACE_IMPL_H_
diff --git a/net/quic/platform/impl/quic_stream_buffer_allocator_impl.h b/net/quic/platform/impl/quic_stream_buffer_allocator_impl.h deleted file mode 100644 index ca68ef4..0000000 --- a/net/quic/platform/impl/quic_stream_buffer_allocator_impl.h +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright (c) 2019 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 NET_QUIC_PLATFORM_IMPL_QUIC_STREAM_BUFFER_ALLOCATOR_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_STREAM_BUFFER_ALLOCATOR_IMPL_H_ - -#include "net/third_party/quiche/src/common/simple_buffer_allocator.h" - -namespace quic { - -using QuicStreamBufferAllocatorImpl = quiche::SimpleBufferAllocator; - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_STREAM_BUFFER_ALLOCATOR_IMPL_H_
diff --git a/net/quic/platform/impl/quic_test_loopback_impl.cc b/net/quic/platform/impl/quic_test_loopback_impl.cc deleted file mode 100644 index 92cea540..0000000 --- a/net/quic/platform/impl/quic_test_loopback_impl.cc +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright (c) 2017 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 "net/quic/platform/impl/quic_test_loopback_impl.h" - -namespace quic { - -IpAddressFamily AddressFamilyUnderTestImpl() { - return IpAddressFamily::IP_V4; -} - -QuicIpAddress TestLoopback4Impl() { - return QuicIpAddress::Loopback4(); -} - -QuicIpAddress TestLoopback6Impl() { - return QuicIpAddress::Loopback6(); -} - -QuicIpAddress TestLoopbackImpl() { - return QuicIpAddress::Loopback4(); -} - -QuicIpAddress TestLoopbackImpl(int index) { - const char kLocalhostIPv4[] = {127, 0, 0, static_cast<char>(index)}; - QuicIpAddress address; - address.FromPackedString(kLocalhostIPv4, 4); - return address; -} - -} // namespace quic
diff --git a/net/quic/platform/impl/quic_test_loopback_impl.h b/net/quic/platform/impl/quic_test_loopback_impl.h deleted file mode 100644 index 4f261ab0..0000000 --- a/net/quic/platform/impl/quic_test_loopback_impl.h +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright (c) 2017 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 NET_QUIC_PLATFORM_IMPL_QUIC_TEST_LOOPBACK_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_TEST_LOOPBACK_IMPL_H_ - -#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h" - -namespace quic { - -// Returns the address family IPv4 used to run test under. -IpAddressFamily AddressFamilyUnderTestImpl(); - -// Returns an IPv4 loopback address. -QuicIpAddress TestLoopback4Impl(); - -// Returns the only IPv6 loopback address. -QuicIpAddress TestLoopback6Impl(); - -// Returns an IPv4 loopback address. -QuicIpAddress TestLoopbackImpl(); - -// Returns an indexed IPv4 loopback address. -QuicIpAddress TestLoopbackImpl(int index); - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_TEST_LOOPBACK_IMPL_H_
diff --git a/net/quic/platform/impl/quic_test_output_impl.h b/net/quic/platform/impl/quic_test_output_impl.h deleted file mode 100644 index 6798fd4..0000000 --- a/net/quic/platform/impl/quic_test_output_impl.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright (c) 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 NET_QUIC_PLATFORM_IMPL_QUIC_TEST_OUTPUT_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_TEST_OUTPUT_IMPL_H_ - -#include "third_party/abseil-cpp/absl/strings/string_view.h" - -namespace quic { - -void QuicSaveTestOutputImpl(absl::string_view filename, absl::string_view data); - -bool QuicLoadTestOutputImpl(absl::string_view filename, std::string* data); - -void QuicRecordTraceImpl(absl::string_view identifier, absl::string_view data); - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_TEST_OUTPUT_IMPL_H_
diff --git a/net/quic/platform/impl/quic_thread_impl.h b/net/quic/platform/impl/quic_thread_impl.h deleted file mode 100644 index e4a788ad..0000000 --- a/net/quic/platform/impl/quic_thread_impl.h +++ /dev/null
@@ -1,22 +0,0 @@ -// Copyright (c) 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 NET_QUIC_PLATFORM_IMPL_QUIC_THREAD_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_THREAD_IMPL_H_ - -#include "base/threading/simple_thread.h" - -namespace quic { - -// A class representing a thread of execution in QUIC. -class QuicThreadImpl : public base::SimpleThread { - public: - QuicThreadImpl(const std::string& string) : base::SimpleThread(string) {} - QuicThreadImpl(const QuicThreadImpl&) = delete; - QuicThreadImpl& operator=(const QuicThreadImpl&) = delete; -}; - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_THREAD_IMPL_H_
diff --git a/net/quic/platform/impl/quic_udp_socket_platform_impl.h b/net/quic/platform/impl/quic_udp_socket_platform_impl.h deleted file mode 100644 index 12e589a9..0000000 --- a/net/quic/platform/impl/quic_udp_socket_platform_impl.h +++ /dev/null
@@ -1,28 +0,0 @@ -// 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 NET_QUIC_PLATFORM_IMPL_QUIC_UDP_SOCKET_PLATFORM_IMPL_H_ -#define NET_QUIC_PLATFORM_IMPL_QUIC_UDP_SOCKET_PLATFORM_IMPL_H_ - -#include <sys/socket.h> - -#include <cstddef> -#include <cstdint> - -namespace quic { - -const size_t kCmsgSpaceForGooglePacketHeaderImpl = 0; - -inline bool GetGooglePacketHeadersFromControlMessageImpl( - struct ::cmsghdr* cmsg, - char** packet_headers, - size_t* packet_headers_len) { - return false; -} - -inline void SetGoogleSocketOptionsImpl(int fd) {} - -} // namespace quic - -#endif // NET_QUIC_PLATFORM_IMPL_QUIC_UDP_SOCKET_PLATFORM_IMPL_H_
diff --git a/net/spdy/fuzzing/http2_frame_decoder_fuzzer.cc b/net/spdy/fuzzing/http2_frame_decoder_fuzzer.cc index cdc5ba1c..dac818b 100644 --- a/net/spdy/fuzzing/http2_frame_decoder_fuzzer.cc +++ b/net/spdy/fuzzing/http2_frame_decoder_fuzzer.cc
@@ -15,7 +15,7 @@ // Entry point for LibFuzzer. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { FuzzedDataProvider fuzzed_data_provider(data, size); - http2::Http2FrameDecoder decoder; + http2::Http2FrameDecoder decoder(nullptr); // Store all chunks in a function scope list, as the API requires the caller // to make sure the fragment chunks data is accessible during the whole
diff --git a/net/third_party/quiche/BUILD.gn b/net/third_party/quiche/BUILD.gn index b3c0728..5ec92f4 100644 --- a/net/third_party/quiche/BUILD.gn +++ b/net/third_party/quiche/BUILD.gn
@@ -35,20 +35,30 @@ "overrides/quiche_platform_impl/quic_flags_impl.h", "overrides/quiche_platform_impl/quiche_bug_tracker_impl.h", "overrides/quiche_platform_impl/quiche_client_stats_impl.h", + "overrides/quiche_platform_impl/quiche_containers_impl.h", + "overrides/quiche_platform_impl/quiche_error_code_wrappers_impl.h", "overrides/quiche_platform_impl/quiche_export_impl.h", + "overrides/quiche_platform_impl/quiche_hostname_utils_impl.cc", + "overrides/quiche_platform_impl/quiche_hostname_utils_impl.h", "overrides/quiche_platform_impl/quiche_logging_impl.h", "overrides/quiche_platform_impl/quiche_mutex_impl.cc", "overrides/quiche_platform_impl/quiche_mutex_impl.h", "overrides/quiche_platform_impl/quiche_reference_counted_impl.h", + "overrides/quiche_platform_impl/quiche_server_stats_impl.h", "overrides/quiche_platform_impl/quiche_thread_local_impl.h", "overrides/quiche_platform_impl/quiche_time_utils_impl.cc", "overrides/quiche_platform_impl/quiche_time_utils_impl.h", "overrides/quiche_platform_impl/quiche_url_utils_impl.cc", "overrides/quiche_platform_impl/quiche_url_utils_impl.h", "src/common/platform/api/quiche_bug_tracker.h", + "src/common/platform/api/quiche_containers.h", + "src/common/platform/api/quiche_error_code_wrappers.h", + "src/common/platform/api/quiche_export.h", "src/common/platform/api/quiche_export.h", "src/common/platform/api/quiche_flag_utils.h", "src/common/platform/api/quiche_flags.h", + "src/common/platform/api/quiche_hostname_utils.cc", + "src/common/platform/api/quiche_hostname_utils.h", "src/common/platform/api/quiche_iovec.h", "src/common/platform/api/quiche_logging.h", "src/common/platform/api/quiche_mem_slice.h", @@ -56,7 +66,10 @@ "src/common/platform/api/quiche_mutex.h", "src/common/platform/api/quiche_prefetch.h", "src/common/platform/api/quiche_reference_counted.h", + "src/common/platform/api/quiche_server_stats.h", + "src/common/platform/api/quiche_stack_trace.h", "src/common/platform/api/quiche_testvalue.h", + "src/common/platform/api/quiche_thread.h", "src/common/platform/api/quiche_thread_local.h", "src/common/platform/api/quiche_time_utils.h", "src/common/platform/api/quiche_url_utils.h", @@ -605,7 +618,6 @@ "src/quic/platform/api/quic_exported_stats.h", "src/quic/platform/api/quic_flag_utils.h", "src/quic/platform/api/quic_flags.h", - "src/quic/platform/api/quic_hostname_utils.cc", "src/quic/platform/api/quic_hostname_utils.h", "src/quic/platform/api/quic_ip_address.cc", "src/quic/platform/api/quic_ip_address.h", @@ -722,6 +734,11 @@ source_set("epoll_quic_tools_core") { testonly = true sources = [ + "overrides/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h", + "overrides/quiche_platform_impl/quiche_udp_socket_platform_impl.h", + "src/common/platform/api/quiche_epoll.h", + "src/common/platform/api/quiche_stream_buffer_allocator.h", + "src/common/platform/api/quiche_udp_socket_platform_api.h", "src/quic/core/quic_default_packet_writer.cc", "src/quic/core/quic_default_packet_writer.h", "src/quic/core/quic_epoll_alarm_factory.cc", @@ -909,14 +926,25 @@ testonly = true sources = [ "overrides/quiche_platform_impl/quiche_epoll_test_tools_impl.h", + "overrides/quiche_platform_impl/quiche_expect_bug_impl.h", + "overrides/quiche_platform_impl/quiche_mock_log_impl.h", + "overrides/quiche_platform_impl/quiche_test_loopback_impl.cc", + "overrides/quiche_platform_impl/quiche_test_loopback_impl.h", + "overrides/quiche_platform_impl/quiche_test_output_impl.cc", + "overrides/quiche_platform_impl/quiche_test_output_impl.h", "src/common/platform/api/quiche_epoll_test_tools.h", + "src/common/platform/api/quiche_expect_bug.h", + "src/common/platform/api/quiche_mock_log.h", + "src/common/platform/api/quiche_test.h", + "src/common/platform/api/quiche_test_loopback.cc", + "src/common/platform/api/quiche_test_loopback.h", + "src/common/platform/api/quiche_test_output.h", "src/quic/core/quic_trace_visitor.cc", "src/quic/core/quic_trace_visitor.h", "src/quic/platform/api/quic_expect_bug.h", "src/quic/platform/api/quic_mock_log.h", "src/quic/platform/api/quic_port_utils.h", "src/quic/platform/api/quic_test.h", - "src/quic/platform/api/quic_test_loopback.cc", "src/quic/platform/api/quic_test_loopback.h", "src/quic/platform/api/quic_test_output.h", "src/quic/test_tools/crypto_test_utils.cc", @@ -1091,7 +1119,10 @@ source_set("simple_quic_tools_core") { sources = [ + "overrides/quiche_platform_impl/quiche_default_proof_providers_impl.cc", + "overrides/quiche_platform_impl/quiche_default_proof_providers_impl.h", "overrides/quiche_platform_impl/quiche_system_event_loop_impl.h", + "src/common/platform/api/quiche_default_proof_providers.h", "src/common/platform/api/quiche_system_event_loop.h", "src/quic/core/chlo_extractor.cc", "src/quic/core/chlo_extractor.h", @@ -1108,7 +1139,6 @@ "src/quic/core/quic_time_wait_list_manager.h", "src/quic/core/tls_chlo_extractor.cc", "src/quic/core/tls_chlo_extractor.h", - "src/quic/platform/api/quic_default_proof_providers.h", "src/quic/tools/fake_proof_verifier.h", "src/quic/tools/quic_backend_response.cc", "src/quic/tools/quic_backend_response.h", @@ -1227,6 +1257,7 @@ sources = [ # TODO(bnc): Include in tests after test data files are added to QUICHE. # "src/common/platform/api/quiche_file_utils_test.cc", + "src/common/platform/api/quiche_hostname_utils_test.cc", "src/common/platform/api/quiche_mem_slice_test.cc", "src/common/platform/api/quiche_reference_counted_test.cc", "src/common/platform/api/quiche_time_utils_test.cc", @@ -1463,7 +1494,6 @@ "src/quic/core/tls_client_handshaker_test.cc", "src/quic/core/uber_quic_stream_id_manager_test.cc", "src/quic/core/uber_received_packet_manager_test.cc", - "src/quic/platform/api/quic_hostname_utils_test.cc", "src/quic/platform/api/quic_ip_address_test.cc", "src/quic/platform/api/quic_socket_address_test.cc", "src/quic/test_tools/crypto_test_utils_test.cc",
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_containers_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_containers_impl.h new file mode 100644 index 0000000..47a1c16 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_containers_impl.h
@@ -0,0 +1,23 @@ +// Copyright (c) 2017 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_ + +#include <vector> + +#include "base/containers/flat_set.h" + +namespace quiche { + +// TODO(wub): Switch to absl::InlinedVector once it is allowed. +template <typename T, size_t N, typename A = std::allocator<T>> +using QuicheInlinedVectorImpl = std::vector<T, A>; + +template <typename Key, typename Compare> +using QuicheSmallOrderedSetImpl = base::flat_set<Key, Compare>; + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_CONTAINERS_IMPL_H_
diff --git a/net/quic/platform/impl/quic_default_proof_providers_impl.cc b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.cc similarity index 88% rename from net/quic/platform/impl/quic_default_proof_providers_impl.cc rename to net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.cc index 341ab94..12313d1 100644 --- a/net/quic/platform/impl/quic_default_proof_providers_impl.cc +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/quic/platform/impl/quic_default_proof_providers_impl.h" +#include "net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.h" #include <utility> @@ -40,7 +40,7 @@ using net::CertVerifier; using net::ProofVerifierChromium; -namespace quic { +namespace quiche { namespace { @@ -74,7 +74,7 @@ net::TransportSecurityState transport_security_state_; }; -std::unique_ptr<ProofVerifier> CreateDefaultProofVerifierImpl( +std::unique_ptr<quic::ProofVerifier> CreateDefaultProofVerifierImpl( const std::string& host) { std::unique_ptr<net::CertVerifier> cert_verifier = net::CertVerifier::CreateDefault(/*cert_net_fetcher=*/nullptr); @@ -82,10 +82,10 @@ std::move(cert_verifier), host); } -std::unique_ptr<ProofSource> CreateDefaultProofSourceImpl() { +std::unique_ptr<quic::ProofSource> CreateDefaultProofSourceImpl() { auto proof_source = std::make_unique<net::ProofSourceChromium>(); - proof_source->SetTicketCrypter( - std::make_unique<SimpleTicketCrypter>(QuicChromiumClock::GetInstance())); + proof_source->SetTicketCrypter(std::make_unique<quic::SimpleTicketCrypter>( + quic::QuicChromiumClock::GetInstance())); CHECK(proof_source->Initialize( #if BUILDFLAG(IS_WIN) base::FilePath(base::UTF8ToWide(GetQuicFlag(FLAGS_certificate_file))), @@ -98,4 +98,4 @@ return std::move(proof_source); } -} // namespace quic +} // namespace quiche
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.h new file mode 100644 index 0000000..ea8661b --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_default_proof_providers_impl.h
@@ -0,0 +1,21 @@ +// Copyright (c) 2019 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_DEFAULT_PROOF_PROVIDERS_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_DEFAULT_PROOF_PROVIDERS_IMPL_H_ + +#include <memory> + +#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h" +#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h" + +namespace quiche { + +std::unique_ptr<quic::ProofVerifier> CreateDefaultProofVerifierImpl( + const std::string& host); +std::unique_ptr<quic::ProofSource> CreateDefaultProofSourceImpl(); + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_DEFAULT_PROOF_PROVIDERS_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_epoll_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_epoll_impl.h new file mode 100644 index 0000000..0eef2e1a --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_epoll_impl.h
@@ -0,0 +1,24 @@ +// Copyright (c) 2019 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. + +// A toy server, which listens on a specified address for QUIC traffic and +// handles incoming responses. +// +// Note that this server is intended to verify correctness of the client and is +// in no way expected to be performant. +#ifndef NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_EPOLL_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_EPOLL_IMPL_H_ + +#include "net/third_party/quiche/src/epoll_server/simple_epoll_server.h" + +namespace quiche { + +using QuicheEpollServerImpl = epoll_server::SimpleEpollServer; +using QuicheEpollEventImpl = epoll_server::EpollEvent; +using QuicheEpollAlarmBaseImpl = epoll_server::EpollAlarm; +using QuicheEpollCallbackInterfaceImpl = epoll_server::EpollCallbackInterface; + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_EPOLL_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_error_code_wrappers_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_error_code_wrappers_impl.h new file mode 100644 index 0000000..81ac2171 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_error_code_wrappers_impl.h
@@ -0,0 +1,12 @@ +// Copyright (c) 2019 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_ERROR_CODE_WRAPPERS_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_ERROR_CODE_WRAPPERS_IMPL_H_ + +#include "net/base/net_errors.h" + +#define QUICHE_EMSGSIZE_IMPL net::ERR_MSG_TOO_BIG + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_ERROR_CODE_WRAPPERS_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_expect_bug_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_expect_bug_impl.h new file mode 100644 index 0000000..74c8222 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_expect_bug_impl.h
@@ -0,0 +1,13 @@ +// Copyright (c) 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_EXPECT_BUG_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_EXPECT_BUG_IMPL_H_ + +#include "net/test/gtest_util.h" + +#define EXPECT_QUICHE_BUG_IMPL EXPECT_DFATAL +#define EXPECT_QUICHE_PEER_BUG_IMPL(statement, regex) statement; + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_EXPECT_BUG_IMPL_H_
diff --git a/net/quic/platform/impl/quic_hostname_utils_impl.cc b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.cc similarity index 84% rename from net/quic/platform/impl/quic_hostname_utils_impl.cc rename to net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.cc index 2fdf09f..7912a65 100644 --- a/net/quic/platform/impl/quic_hostname_utils_impl.cc +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/quic/platform/impl/quic_hostname_utils_impl.h" +#include "net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.h" #include "base/strings/abseil_string_conversions.h" #include "net/base/url_util.h" @@ -10,10 +10,10 @@ #include "url/gurl.h" #include "url/url_canon.h" -namespace quic { +namespace quiche { // static -bool QuicHostnameUtilsImpl::IsValidSNI(absl::string_view sni) { +bool QuicheHostnameUtilsImpl::IsValidSNI(absl::string_view sni) { // TODO(rtenneti): Support RFC2396 hostname. // NOTE: Microsoft does NOT enforce this spec, so if we throw away hostnames // based on the above spec, we may be losing some hostnames that windows @@ -27,7 +27,7 @@ } // static -std::string QuicHostnameUtilsImpl::NormalizeHostname( +std::string QuicheHostnameUtilsImpl::NormalizeHostname( absl::string_view hostname) { url::CanonHostInfo host_info; std::string host(net::CanonicalizeHost( @@ -47,4 +47,4 @@ return host; } -} // namespace quic +} // namespace quiche
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.h new file mode 100644 index 0000000..869f698 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_hostname_utils_impl.h
@@ -0,0 +1,30 @@ +// Copyright (c) 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. + +#ifndef NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_HOSTNAME_UTILS_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_HOSTNAME_UTILS_IMPL_H_ + +#include "net/third_party/quiche/src/common/platform/api/quiche_export.h" +#include "third_party/abseil-cpp/absl/strings/string_view.h" + +namespace quiche { + +class QUICHE_EXPORT_PRIVATE QuicheHostnameUtilsImpl { + public: + QuicheHostnameUtilsImpl(const QuicheHostnameUtilsImpl&) = delete; + QuicheHostnameUtilsImpl& operator=(const QuicheHostnameUtilsImpl&) = delete; + + // Returns true if the sni is valid, false otherwise. + // (1) disallow IP addresses; + // (2) check that the hostname contains valid characters only; and + // (3) contains at least one dot. + static bool IsValidSNI(absl::string_view sni); + + // Convert hostname to lowercase and remove the trailing '.'. + static std::string NormalizeHostname(absl::string_view hostname); +}; + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_HOSTNAME_UTILS_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_mock_log_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_mock_log_impl.h new file mode 100644 index 0000000..fe5071a --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_mock_log_impl.h
@@ -0,0 +1,21 @@ +// Copyright (c) 2017 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_MOCK_LOG_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_MOCK_LOG_IMPL_H_ + +#include "base/test/mock_log.h" +#include "testing/gmock/include/gmock/gmock.h" // IWYU pragma: export + +using QuicheMockLogImpl = base::test::MockLog; + +#define CREATE_QUICHE_MOCK_LOG_IMPL(log) QuicheMockLog log + +#define EXPECT_QUICHE_LOG_CALL_IMPL(log) EXPECT_CALL(log, Log(_, _, _, _, _)) + +#define EXPECT_QUICHE_LOG_CALL_CONTAINS_IMPL(log, level, content) \ + EXPECT_CALL(log, \ + Log(logging::LOG_##level, _, _, _, testing::HasSubstr(content))) + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_MOCK_LOG_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_server_stats_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_server_stats_impl.h new file mode 100644 index 0000000..e56d15cd --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_server_stats_impl.h
@@ -0,0 +1,26 @@ +// 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_SERVER_STATS_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_SERVER_STATS_IMPL_H_ + +#define QUICHE_SERVER_HISTOGRAM_ENUM_IMPL(name, sample, enum_size, docstring) \ + do { \ + } while (0) + +#define QUICHE_SERVER_HISTOGRAM_BOOL_IMPL(name, sample, docstring) \ + do { \ + } while (0) + +#define QUICHE_SERVER_HISTOGRAM_TIMES_IMPL(name, sample, min, max, \ + bucket_count, docstring) \ + do { \ + } while (0) + +#define QUICHE_SERVER_HISTOGRAM_COUNTS_IMPL(name, sample, min, max, \ + bucket_count, docstring) \ + do { \ + } while (0) + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_SERVER_STATS_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_stack_trace_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_stack_trace_impl.h new file mode 100644 index 0000000..5cc8701 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_stack_trace_impl.h
@@ -0,0 +1,18 @@ +// Copyright (c) 2017 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_ + +#include "base/debug/stack_trace.h" + +namespace quiche { + +inline std::string QuicheStackTraceImpl() { + return base::debug::StackTrace().ToString(); +} + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_STACK_TRACE_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h new file mode 100644 index 0000000..c3ea706 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h
@@ -0,0 +1,16 @@ +// Copyright (c) 2019 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_STREAM_BUFFER_ALLOCATOR_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_STREAM_BUFFER_ALLOCATOR_IMPL_H_ + +#include "net/third_party/quiche/src/common/simple_buffer_allocator.h" + +namespace quiche { + +using QuicheStreamBufferAllocatorImpl = quiche::SimpleBufferAllocator; + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_STREAM_BUFFER_ALLOCATOR_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.cc b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.cc new file mode 100644 index 0000000..00474b3 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.cc
@@ -0,0 +1,32 @@ +// Copyright (c) 2017 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 "net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.h" + +namespace quiche { + +quic::IpAddressFamily AddressFamilyUnderTestImpl() { + return quic::IpAddressFamily::IP_V4; +} + +quic::QuicIpAddress TestLoopback4Impl() { + return quic::QuicIpAddress::Loopback4(); +} + +quic::QuicIpAddress TestLoopback6Impl() { + return quic::QuicIpAddress::Loopback6(); +} + +quic::QuicIpAddress TestLoopbackImpl() { + return quic::QuicIpAddress::Loopback4(); +} + +quic::QuicIpAddress TestLoopbackImpl(int index) { + const char kLocalhostIPv4[] = {127, 0, 0, static_cast<char>(index)}; + quic::QuicIpAddress address; + address.FromPackedString(kLocalhostIPv4, 4); + return address; +} + +} // namespace quiche
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.h new file mode 100644 index 0000000..6db6c85 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_loopback_impl.h
@@ -0,0 +1,29 @@ +// Copyright (c) 2017 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_TEST_LOOPBACK_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_TEST_LOOPBACK_IMPL_H_ + +#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h" + +namespace quiche { + +// Returns the address family IPv4 used to run test under. +quic::IpAddressFamily AddressFamilyUnderTestImpl(); + +// Returns an IPv4 loopback address. +quic::QuicIpAddress TestLoopback4Impl(); + +// Returns the only IPv6 loopback address. +quic::QuicIpAddress TestLoopback6Impl(); + +// Returns an IPv4 loopback address. +quic::QuicIpAddress TestLoopbackImpl(); + +// Returns an indexed IPv4 loopback address. +quic::QuicIpAddress TestLoopbackImpl(int index); + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_TEST_LOOPBACK_IMPL_H_
diff --git a/net/quic/platform/impl/quic_test_output_impl.cc b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.cc similarity index 77% rename from net/quic/platform/impl/quic_test_output_impl.cc rename to net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.cc index 2f8c8c3..2f3ad49e 100644 --- a/net/quic/platform/impl/quic_test_output_impl.cc +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/quic/platform/impl/quic_test_output_impl.h" +#include "net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.h" #include <stdlib.h> #include <time.h> @@ -16,10 +16,10 @@ #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h" #include "testing/gtest/include/gtest/gtest.h" -namespace quic { +namespace quiche { -void QuicRecordTestOutputToFile(absl::string_view filename, - absl::string_view data) { +void QuicheRecordTestOutputToFile(absl::string_view filename, + absl::string_view data) { std::string output_dir; if (!base::Environment::Create()->GetVar("QUIC_TEST_OUTPUT_DIR", &output_dir) || @@ -39,12 +39,12 @@ QUIC_LOG(INFO) << "Recorded test output into " << path; } -void QuicSaveTestOutputImpl(absl::string_view filename, - absl::string_view data) { - QuicRecordTestOutputToFile(filename, data); +void QuicheSaveTestOutputImpl(absl::string_view filename, + absl::string_view data) { + QuicheRecordTestOutputToFile(filename, data); } -bool QuicLoadTestOutputImpl(absl::string_view filename, std::string* data) { +bool QuicheLoadTestOutputImpl(absl::string_view filename, std::string* data) { std::string output_dir; if (!base::Environment::Create()->GetVar("QUIC_TEST_OUTPUT_DIR", &output_dir) || @@ -61,7 +61,8 @@ return base::ReadFileToString(path, data); } -void QuicRecordTraceImpl(absl::string_view identifier, absl::string_view data) { +void QuicheRecordTraceImpl(absl::string_view identifier, + absl::string_view data) { const testing::TestInfo* test_info = testing::UnitTest::GetInstance()->current_test_info(); @@ -81,7 +82,7 @@ "%s.%s.%s.%s.qtr", test_info->name(), test_info->test_case_name(), identifier.data(), timestamp); - QuicRecordTestOutputToFile(filename, data); + QuicheRecordTestOutputToFile(filename, data); } -} // namespace quic +} // namespace quiche
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.h new file mode 100644 index 0000000..abdc496a --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_test_output_impl.h
@@ -0,0 +1,22 @@ +// Copyright (c) 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_TEST_OUTPUT_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_TEST_OUTPUT_IMPL_H_ + +#include "third_party/abseil-cpp/absl/strings/string_view.h" + +namespace quiche { + +void QuicheSaveTestOutputImpl(absl::string_view filename, + absl::string_view data); + +bool QuicheLoadTestOutputImpl(absl::string_view filename, std::string* data); + +void QuicheRecordTraceImpl(absl::string_view identifier, + absl::string_view data); + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_TEST_OUTPUT_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_thread_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_thread_impl.h new file mode 100644 index 0000000..70238c9 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_thread_impl.h
@@ -0,0 +1,23 @@ +// Copyright (c) 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_THREAD_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_THREAD_IMPL_H_ + +#include "base/threading/simple_thread.h" + +namespace quiche { + +// A class representing a thread of execution in QUIC. +class QuicheThreadImpl : public base::SimpleThread { + public: + explicit QuicheThreadImpl(const std::string& string) + : base::SimpleThread(string) {} + QuicheThreadImpl(const QuicheThreadImpl&) = delete; + QuicheThreadImpl& operator=(const QuicheThreadImpl&) = delete; +}; + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_THREAD_IMPL_H_
diff --git a/net/third_party/quiche/overrides/quiche_platform_impl/quiche_udp_socket_platform_impl.h b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_udp_socket_platform_impl.h new file mode 100644 index 0000000..f71d982 --- /dev/null +++ b/net/third_party/quiche/overrides/quiche_platform_impl/quiche_udp_socket_platform_impl.h
@@ -0,0 +1,29 @@ +// 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 NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_UDP_SOCKET_PLATFORM_IMPL_H_ +#define NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_UDP_SOCKET_PLATFORM_IMPL_H_ + +#include <sys/socket.h> +#include <unistd.h> + +#include <cstddef> +#include <cstdint> + +namespace quiche { + +const size_t kCmsgSpaceForGooglePacketHeaderImpl = 0; + +inline bool GetGooglePacketHeadersFromControlMessageImpl( + struct ::cmsghdr* cmsg, + char** packet_headers, + size_t* packet_headers_len) { + return false; +} + +inline void SetGoogleSocketOptionsImpl(int fd) {} + +} // namespace quiche + +#endif // NET_THIRD_PARTY_QUICHE_OVERRIDES_QUICHE_PLATFORM_IMPL_QUICHE_UDP_SOCKET_PLATFORM_IMPL_H_
diff --git a/pdf/pdf_view_plugin_base.cc b/pdf/pdf_view_plugin_base.cc index 40ef7bd5..1ec0869 100644 --- a/pdf/pdf_view_plugin_base.cc +++ b/pdf/pdf_view_plugin_base.cc
@@ -86,8 +86,6 @@ // responsive. constexpr base::TimeDelta kAccessibilityPageDelay = base::Milliseconds(100); -constexpr base::TimeDelta kFindResultCooldown = base::Milliseconds(100); - constexpr char kChromeExtensionHost[] = "chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/"; @@ -297,40 +295,6 @@ SendMessage(std::move(message)); } -void PdfViewPluginBase::UpdateTickMarks( - const std::vector<gfx::Rect>& tickmarks) { - float inverse_scale = 1.0f / device_scale_; - tickmarks_.clear(); - tickmarks_.reserve(tickmarks.size()); - std::transform(tickmarks.begin(), tickmarks.end(), - std::back_inserter(tickmarks_), - [inverse_scale](const gfx::Rect& t) -> gfx::Rect { - return gfx::ScaleToEnclosingRect(t, inverse_scale); - }); -} - -void PdfViewPluginBase::NotifyNumberOfFindResultsChanged(int total, - bool final_result) { - // We don't want to spam the renderer with too many updates to the number of - // find results. Don't send an update if we sent one too recently. If it's the - // final update, we always send it though. - if (recently_sent_find_update_ && !final_result) - return; - - NotifyFindResultsChanged(total, final_result); - NotifyFindTickmarks(tickmarks_); - - if (final_result) - return; - - recently_sent_find_update_ = true; - base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, - base::BindOnce(&PdfViewPluginBase::ResetRecentlySentFindUpdate, - GetWeakPtr()), - kFindResultCooldown); -} - void PdfViewPluginBase::NotifyTouchSelectionOccurred() { base::Value message(base::Value::Type::DICTIONARY); message.SetStringKey("type", "touchSelectionOccurred"); @@ -1061,22 +1025,6 @@ SetAccessibilityViewportInfo(std::move(viewport_info)); } -bool PdfViewPluginBase::StartFind(const std::string& text, - bool case_sensitive) { - engine_->StartFind(text, case_sensitive); - return true; -} - -void PdfViewPluginBase::SelectFindResult(bool forward) { - engine_->SelectFindResult(forward); -} - -void PdfViewPluginBase::StopFind() { - engine_->StopFind(); - tickmarks_.clear(); - NotifyFindTickmarks(tickmarks_); -} - gfx::Vector2d PdfViewPluginBase::plugin_offset_in_frame() const { return plugin_rect_.OffsetFromOrigin(); } @@ -1658,10 +1606,6 @@ kAccessibilityPageDelay); } -void PdfViewPluginBase::ResetRecentlySentFindUpdate() { - recently_sent_find_update_ = false; -} - namespace { // These values are persisted to logs. Entries should not be renumbered and
diff --git a/pdf/pdf_view_plugin_base.h b/pdf/pdf_view_plugin_base.h index 66b60ca..2dae3dae 100644 --- a/pdf/pdf_view_plugin_base.h +++ b/pdf/pdf_view_plugin_base.h
@@ -107,8 +107,6 @@ const float* x, const float* y, const float* zoom) override; - void UpdateTickMarks(const std::vector<gfx::Rect>& tickmarks) override; - void NotifyNumberOfFindResultsChanged(int total, bool final_result) override; void NotifyTouchSelectionOccurred() override; void GetDocumentPassword( base::OnceCallback<void(const std::string&)> callback) override; @@ -320,17 +318,6 @@ virtual void SetAccessibilityViewportInfo( AccessibilityViewportInfo viewport_info) = 0; - // Find handlers. - bool StartFind(const std::string& text, bool case_sensitive); - void SelectFindResult(bool forward); - void StopFind(); - - // Notify the plugin container about the total matches for a find request. - virtual void NotifyFindResultsChanged(int total, bool final_result) = 0; - - // Notify the frame about the tickmarks for the find request. - virtual void NotifyFindTickmarks(const std::vector<gfx::Rect>& tickmarks) = 0; - // Returns the print preset options for the document. blink::WebPrintPresetOptions GetPrintPresetOptions(); @@ -481,8 +468,6 @@ // Starts loading accessibility information. void LoadAccessibility(); - void ResetRecentlySentFindUpdate(); - // Records metrics about the attachment types. void RecordAttachmentTypes(); @@ -631,13 +616,6 @@ // reconstructing the tree for new document layouts. int32_t next_accessibility_page_index_ = 0; - // Whether an update to the number of find results found was sent less than - // `kFindResultCooldownMs` milliseconds ago. - bool recently_sent_find_update_ = false; - - // Stores the tickmarks to be shown for the current find results. - std::vector<gfx::Rect> tickmarks_; - // Keeps track of which unsupported features have been reported to avoid // spamming the metrics if a feature shows up many times per document. base::flat_set<std::string> unsupported_features_reported_;
diff --git a/pdf/pdf_view_plugin_base_unittest.cc b/pdf/pdf_view_plugin_base_unittest.cc index 9a1cc71..2e1fe4cc 100644 --- a/pdf/pdf_view_plugin_base_unittest.cc +++ b/pdf/pdf_view_plugin_base_unittest.cc
@@ -244,13 +244,6 @@ (AccessibilityViewportInfo), (override)); - MOCK_METHOD(void, NotifyFindResultsChanged, (int, bool), (override)); - - MOCK_METHOD(void, - NotifyFindTickmarks, - (const std::vector<gfx::Rect>&), - (override)); - MOCK_METHOD(void, SetContentRestrictions, (int), (override)); MOCK_METHOD(void, SetPluginCanSave, (bool), (override));
diff --git a/pdf/pdf_view_web_plugin.cc b/pdf/pdf_view_web_plugin.cc index 0e8ffed..222c923 100644 --- a/pdf/pdf_view_web_plugin.cc +++ b/pdf/pdf_view_web_plugin.cc
@@ -96,6 +96,8 @@ namespace { +constexpr base::TimeDelta kFindResultCooldown = base::Milliseconds(100); + // Initialization performed per renderer process. Initialization may be // triggered from multiple plugin instances, but should only execute once. // @@ -637,17 +639,20 @@ bool case_sensitive, int identifier) { find_identifier_ = identifier; - return PdfViewPluginBase::StartFind(search_text.Utf8(), case_sensitive); + engine()->StartFind(search_text.Utf8(), case_sensitive); + return true; } void PdfViewWebPlugin::SelectFindResult(bool forward, int identifier) { find_identifier_ = identifier; - PdfViewPluginBase::SelectFindResult(forward); + engine()->SelectFindResult(forward); } void PdfViewWebPlugin::StopFind() { find_identifier_ = -1; - PdfViewPluginBase::StopFind(); + engine()->StopFind(); + tickmarks_.clear(); + container_wrapper_->ReportFindInPageTickmarks(tickmarks_); } bool PdfViewWebPlugin::CanRotateView() { @@ -705,6 +710,47 @@ set_cursor_type(new_cursor_type); } +void PdfViewWebPlugin::UpdateTickMarks( + const std::vector<gfx::Rect>& tickmarks) { + float inverse_scale = 1.0f / device_scale(); + tickmarks_.clear(); + tickmarks_.reserve(tickmarks.size()); + std::transform(tickmarks.begin(), tickmarks.end(), + std::back_inserter(tickmarks_), + [inverse_scale](const gfx::Rect& t) -> gfx::Rect { + return gfx::ScaleToEnclosingRect(t, inverse_scale); + }); +} + +void PdfViewWebPlugin::NotifyNumberOfFindResultsChanged(int total, + bool final_result) { + // We don't want to spam the renderer with too many updates to the number of + // find results. Don't send an update if we sent one too recently. If it's the + // final update, we always send it though. + if (recently_sent_find_update_ && !final_result) + return; + + // After stopping search and setting `find_identifier_` to -1 there still may + // be a NotifyNumberOfFindResultsChanged notification pending from engine. + // Just ignore them. + if (find_identifier_ != -1) { + container_wrapper_->ReportFindInPageMatchCount(find_identifier_, total, + final_result); + } + + container_wrapper_->ReportFindInPageTickmarks(tickmarks_); + + if (final_result) + return; + + recently_sent_find_update_ = true; + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::BindOnce(&PdfViewWebPlugin::ResetRecentlySentFindUpdate, + weak_factory_.GetWeakPtr()), + kFindResultCooldown); +} + void PdfViewWebPlugin::NotifySelectedFindResultChanged(int current_find_index) { if (find_identifier_ == -1 || !container_wrapper_) return; @@ -923,22 +969,6 @@ weak_factory_.GetWeakPtr(), std::move(viewport_info))); } -void PdfViewWebPlugin::NotifyFindResultsChanged(int total, bool final_result) { - // After stopping search and setting `find_identifier_` to -1 there still may - // be a NotifyNumberOfFindResultsChanged notification pending from engine. - // Just ignore them. - if (find_identifier_ == -1 || !container_wrapper_) - return; - - container_wrapper_->ReportFindInPageMatchCount(find_identifier_, total, - final_result); -} - -void PdfViewWebPlugin::NotifyFindTickmarks( - const std::vector<gfx::Rect>& tickmarks) { - container_wrapper_->ReportFindInPageTickmarks(tickmarks); -} - void PdfViewWebPlugin::SetContentRestrictions(int content_restrictions) { auto* service = GetPdfService(); if (!service) @@ -1121,4 +1151,8 @@ return pdf_service_remote_.is_bound() ? pdf_service_remote_.get() : nullptr; } +void PdfViewWebPlugin::ResetRecentlySentFindUpdate() { + recently_sent_find_update_ = false; +} + } // namespace chrome_pdf
diff --git a/pdf/pdf_view_web_plugin.h b/pdf/pdf_view_web_plugin.h index 8b9ec31..70917d2 100644 --- a/pdf/pdf_view_web_plugin.h +++ b/pdf/pdf_view_web_plugin.h
@@ -234,10 +234,11 @@ int relative_cursor_pos) override; void ImeFinishComposingTextForPlugin(bool keep_selection) override; - // PdfViewPluginBase: + // PDFEngine::Client: void UpdateCursor(ui::mojom::CursorType new_cursor_type) override; + void UpdateTickMarks(const std::vector<gfx::Rect>& tickmarks) override; + void NotifyNumberOfFindResultsChanged(int total, bool final_result) override; void NotifySelectedFindResultChanged(int current_find_index) override; - void CaretChanged(const gfx::Rect& caret_rect) override; void Alert(const std::string& message) override; bool Confirm(const std::string& message) override; std::string Prompt(const std::string& question, @@ -245,8 +246,11 @@ std::vector<SearchStringResult> SearchString(const char16_t* string, const char16_t* term, bool case_sensitive) override; + void CaretChanged(const gfx::Rect& caret_rect) override; void SetSelectedText(const std::string& selected_text) override; bool IsValidLink(const std::string& url) override; + + // PdfViewPluginBase: std::unique_ptr<Graphics> CreatePaintGraphics(const gfx::Size& size) override; bool BindPaintGraphics(Graphics& graphics) override; @@ -303,8 +307,6 @@ AccessibilityPageObjects page_objects) override; void SetAccessibilityViewportInfo( AccessibilityViewportInfo viewport_info) override; - void NotifyFindResultsChanged(int total, bool final_result) override; - void NotifyFindTickmarks(const std::vector<gfx::Rect>& tickmarks) override; void SetContentRestrictions(int content_restrictions) override; void SetPluginCanSave(bool can_save) override; void PluginDidStartLoading() override; @@ -375,6 +377,8 @@ // May be null in unit tests. pdf::mojom::PdfService* GetPdfService(); + void ResetRecentlySentFindUpdate(); + blink::WebString selected_text_; std::unique_ptr<Client> const client_; @@ -431,6 +435,13 @@ std::unique_ptr<PdfAccessibilityDataHandler> const pdf_accessibility_data_handler_; + // Whether an update to the number of find results found was sent less than + // `kFindResultCooldown` TimeDelta ago. + bool recently_sent_find_update_ = false; + + // Stores the tickmarks to be shown for the current find results. + std::vector<gfx::Rect> tickmarks_; + // The metafile in which to save the printed output. Assigned a value only // between `PrintBegin()` and `PrintEnd()` calls. raw_ptr<printing::MetafileSkia> printing_metafile_ = nullptr;
diff --git a/remoting/host/remote_open_url/remote_open_url_client_delegate_win.cc b/remoting/host/remote_open_url/remote_open_url_client_delegate_win.cc index bf15594..9a70846 100644 --- a/remoting/host/remote_open_url/remote_open_url_client_delegate_win.cc +++ b/remoting/host/remote_open_url/remote_open_url_client_delegate_win.cc
@@ -16,12 +16,12 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/win/current_module.h" +#include "base/win/default_apps_util.h" #include "remoting/base/logging.h" #include "remoting/base/user_settings.h" #include "remoting/host/remote_open_url/remote_open_url_constants.h" #include "remoting/host/user_setting_keys.h" #include "remoting/host/win/core_resource.h" -#include "remoting/host/win/default_apps_util.h" #include "remoting/host/win/simple_task_dialog.h" namespace remoting { @@ -57,7 +57,7 @@ task_dialog.set_default_button(IDOK); absl::optional<int> result = task_dialog.Show(); DCHECK_EQ(IDOK, *result); - LaunchDefaultAppsSettingsModernDialog(); + base::win::LaunchDefaultAppsSettingsModernDialog(/*protocol=*/std::wstring()); } } // namespace
diff --git a/remoting/host/remote_open_url/url_forwarder_configurator_main_win.cc b/remoting/host/remote_open_url/url_forwarder_configurator_main_win.cc index 44bad0b..e6a8d53 100644 --- a/remoting/host/remote_open_url/url_forwarder_configurator_main_win.cc +++ b/remoting/host/remote_open_url/url_forwarder_configurator_main_win.cc
@@ -23,6 +23,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/time/time.h" +#include "base/win/default_apps_util.h" #include "base/win/scoped_co_mem.h" #include "base/win/scoped_com_initializer.h" #include "base/win/windows_types.h" @@ -32,7 +33,6 @@ #include "remoting/host/remote_open_url/remote_open_url_constants.h" #include "remoting/host/user_setting_keys.h" #include "remoting/host/win/core_resource.h" -#include "remoting/host/win/default_apps_util.h" #include "remoting/host/win/simple_task_dialog.h" namespace remoting { @@ -177,7 +177,8 @@ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nullptr, nullptr); HOST_LOG << "Launching default apps settings dialog"; - if (!LaunchDefaultAppsSettingsModernDialog()) { + if (!base::win::LaunchDefaultAppsSettingsModernDialog( + /*protocol=*/std::wstring())) { std::move(done_callback_).Run(false); return; }
diff --git a/remoting/host/win/BUILD.gn b/remoting/host/win/BUILD.gn index dd3a719..79044ec 100644 --- a/remoting/host/win/BUILD.gn +++ b/remoting/host/win/BUILD.gn
@@ -116,8 +116,6 @@ "com_security.cc", "com_security.h", "core_resource.h", - "default_apps_util.cc", - "default_apps_util.h", "default_audio_device_change_detector.cc", "default_audio_device_change_detector.h", "etw_trace_consumer.h",
diff --git a/remoting/host/win/default_apps_util.cc b/remoting/host/win/default_apps_util.cc deleted file mode 100644 index 3484054ae..0000000 --- a/remoting/host/win/default_apps_util.cc +++ /dev/null
@@ -1,41 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "remoting/host/win/default_apps_util.h" - -#include <shobjidl.h> -#include <wrl/client.h> - -#include "base/logging.h" - -namespace remoting { - -// The appModelId looks arbitrary but it is the same in Win8 and Win10. There is -// no easy way to retrieve the appModelId from the registry. -bool LaunchDefaultAppsSettingsModernDialog() { - static const wchar_t kControlPanelAppModelId[] = - L"windows.immersivecontrolpanel_cw5n1h2txyewy" - L"!microsoft.windows.immersivecontrolpanel"; - - Microsoft::WRL::ComPtr<IApplicationActivationManager> activator; - HRESULT hr = ::CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, - CLSCTX_ALL, IID_PPV_ARGS(&activator)); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to create IApplicationActivationManager: " - << logging::SystemErrorCodeToString(hr); - return false; - } - DWORD pid = 0; - CoAllowSetForegroundWindow(activator.Get(), nullptr); - hr = activator->ActivateApplication( - kControlPanelAppModelId, L"page=SettingsPageAppsDefaults", AO_NONE, &pid); - if (FAILED(hr)) { - LOG(ERROR) << "Failed to activate application: " - << logging::SystemErrorCodeToString(hr); - return false; - } - return true; -} - -} // namespace remoting
diff --git a/remoting/host/win/default_apps_util.h b/remoting/host/win/default_apps_util.h deleted file mode 100644 index 8b73adc..0000000 --- a/remoting/host/win/default_apps_util.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2021 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef REMOTING_HOST_WIN_DEFAULT_APPS_UTIL_H_ -#define REMOTING_HOST_WIN_DEFAULT_APPS_UTIL_H_ - -namespace remoting { - -// Launches the Windows 'settings' modern app with the 'default apps' view -// focused. This only works for Windows 8 and Windows 10. -// Returns a boolean indicating whether the default apps view is successfully -// launched. -bool LaunchDefaultAppsSettingsModernDialog(); - -} // namespace remoting - -#endif // REMOTING_HOST_WIN_DEFAULT_APPS_UTIL_H_
diff --git a/services/network/expect_ct_reporter.cc b/services/network/expect_ct_reporter.cc index d91c7a6..a8d132c 100644 --- a/services/network/expect_ct_reporter.cc +++ b/services/network/expect_ct_reporter.cc
@@ -60,7 +60,7 @@ std::vector<std::string> pem_encoded_chain; cert_chain->GetPEMEncodedChain(&pem_encoded_chain); for (const std::string& cert : pem_encoded_chain) - result.Append(std::make_unique<base::Value>(cert)); + result.Append(cert); return result; } @@ -82,9 +82,9 @@ bool AddSCT(const net::SignedCertificateTimestampAndStatus& sct, base::ListValue* list) { - std::unique_ptr<base::DictionaryValue> list_item(new base::DictionaryValue()); + base::Value::Dict list_item; // Chrome implements RFC6962, not 6962-bis, so the reports contain v1 SCTs. - list_item->SetInteger("version", 1); + list_item.Set("version", 1); std::string status; switch (sct.status) { case net::ct::SCT_STATUS_LOG_UNKNOWN: @@ -100,15 +100,15 @@ case net::ct::SCT_STATUS_NONE: NOTREACHED(); } - list_item->SetString("status", status); - list_item->SetString("source", SCTOriginToString(sct.sct->origin)); + list_item.Set("status", status); + list_item.Set("source", SCTOriginToString(sct.sct->origin)); std::string serialized_sct; if (!net::ct::EncodeSignedCertificateTimestamp(sct.sct, &serialized_sct)) return false; std::string encoded_serialized_sct; base::Base64Encode(serialized_sct, &encoded_serialized_sct); - list_item->SetString("serialized_sct", encoded_serialized_sct); - list->Append(std::move(list_item)); + list_item.Set("serialized_sct", encoded_serialized_sct); + list->Append(base::Value(std::move(list_item))); return true; }
diff --git a/services/network/first_party_sets/first_party_set_parser.cc b/services/network/first_party_sets/first_party_set_parser.cc index b3fe9eb5..1c7eb59 100644 --- a/services/network/first_party_sets/first_party_set_parser.cc +++ b/services/network/first_party_sets/first_party_set_parser.cc
@@ -204,7 +204,7 @@ if (!value_deserialized || !value_deserialized->is_dict()) return {}; - base::flat_map<net::SchemefulSite, net::SchemefulSite> map; + std::vector<std::pair<net::SchemefulSite, net::SchemefulSite>> map; base::flat_set<net::SchemefulSite> owner_set; base::flat_set<net::SchemefulSite> member_set; for (const auto item : value_deserialized->DictItems()) { @@ -223,7 +223,7 @@ continue; } if (!owner_set.contains(maybe_owner)) { - map.emplace(*maybe_owner, *maybe_owner); + map.emplace_back(*maybe_owner, *maybe_owner); } // Check disjointness. Note that we are relying on the JSON Parser to // eliminate the possibility of a site being used as a key more than once, @@ -234,7 +234,7 @@ } owner_set.insert(*maybe_owner); member_set.insert(*maybe_member); - map.emplace(std::move(*maybe_member), std::move(*maybe_owner)); + map.emplace_back(std::move(*maybe_member), std::move(*maybe_owner)); } return map; } @@ -264,7 +264,7 @@ base::flat_map<net::SchemefulSite, net::SchemefulSite> FirstPartySetParser::ParseSetsFromStream(std::istream& input) { - base::flat_map<net::SchemefulSite, net::SchemefulSite> map; + std::vector<std::pair<net::SchemefulSite, net::SchemefulSite>> map; base::flat_set<net::SchemefulSite> elements; for (std::string line; std::getline(input, line);) { base::StringPiece trimmed = base::TrimWhitespaceASCII(line, base::TRIM_ALL); @@ -278,9 +278,9 @@ if (ParseSet(*maybe_value, elements, output).has_value()) return {}; auto [owner, members] = output; - map.emplace(owner, owner); + map.emplace_back(owner, owner); for (net::SchemefulSite& member : members) { - map.emplace(std::move(member), owner); + map.emplace_back(std::move(member), owner); } } return map;
diff --git a/testing/android/docs/OWNERS b/testing/android/docs/OWNERS new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/testing/android/docs/OWNERS
@@ -0,0 +1 @@ +* \ No newline at end of file
diff --git a/testing/android/docs/README.md b/testing/android/docs/README.md index 5563d115..2701a83 100644 --- a/testing/android/docs/README.md +++ b/testing/android/docs/README.md
@@ -1,24 +1,35 @@ # Android Testing in Chromium +## Concepts + - **Native Unit Tests**: Normal Chromium unit tests based on the [gtest framework](/testing/android/docs/gtest_implementation.md). Tests for native code. + - **Java Unit Tests**: JUnit tests that run on the host machine using [Robolectric](http://robolectric.org) to emulate Android APIs. + - **Instrumentation Tests**: JUnit tests that run on Android devices (or emulators). + - **Unit Instrumentation Tests**: Instrumentation tests that test an individual feature. They do not require starting up ContentShell (or Chrome browser). These use [BaseActivityTestRule](https://source.chromium.org/chromium/chromium/src/+/main:base/test/android/javatests/src/org/chromium/base/test/BaseActivityTestRule.java) or [BlankUiTestActivityTestCase](https://source.chromium.org/chromium/chromium/src/+/main:ui/android/javatests/src/org/chromium/ui/test/util/BlankUiTestActivityTestCase.java) based on `BaseActivityTestRule`. + - **Integration Instrumentation Tests**: Instrumentation tests that bring up ContentShell (or Chrome browser) to test a certain feature in the end-to-end flow. These typically use more specialized test rules such as [ContentShellActivityTestRule](https://source.chromium.org/chromium/chromium/src/+/main:content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java) or [ChromeActivityTestRule](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java). + ## How do I... - **set up** - - [... set up a device for local testing?](/testing/android/docs/todo.md) - - [... set up an emulator for local testing?](/testing/android/docs/todo.md) + - [... set up a device for local testing?](/testing/android/docs/android_test_instructions.md#physical-device-setup) + - [... set up an emulator for local testing?](/docs/android_emulator.md) - **writing tests** - [... write an instrumentation test?](/testing/android/docs/instrumentation.md) - [... write a JUnit or Robolectric test?](/testing/android/docs/junit.md) + - [... write a test that needs to mock native calls?](/base/android/jni_generator/README.md#testing-mockable-natives) - **running tests** - - [... run a gtest?](/testing/android/docs/todo.md) - - [... run an instrumentation test?](/testing/android/docs/todo.md) - - [... run a Robolectric test?](/testing/android/docs/todo.md) - - [... run the blink layout tests?](/testing/layout_tests.md) - - [... run a telemetry test?](/testing/android/docs/todo.md) + - [... run a gtest?](/testing/android/docs/android_test_instructions.md#gtests) + - [... run an instrumentation test?](/testing/android/docs/android_test_instructions.md#instrumentation-tests) + - [... run a JUnit test?](/testing/android/docs/android_test_instructions.md#junit-tests) + - [... run the Web tests?](/docs/testing/web_tests.md) + - [... run a telemetry test?](https://chromium.googlesource.com/catapult/+/HEAD/telemetry/README.md) + - **debugging tests** + - [... debug junit tests?](/testing/android/docs/android_test_instructions.md#junit-tests-debugging) + - [... debug flaky tests?](/testing/android/docs/todo.md) - **miscellaneous** - [... use code coverage for Java tests?](/build/android/docs/coverage.md) ## How does it work on Android? - [gtests](/testing/android/docs/gtest_implementation.md) - - [instrumentation tests](/testing/android/docs/todo.md) - - [junit tests](/testing/android/docs/todo.md) + - [instrumentation tests](https://source.android.com/compatibility/tests/development/instrumentation) + - [junit tests](/testing/android/docs/junit.md)
diff --git a/testing/android/docs/android_test_instructions.md b/testing/android/docs/android_test_instructions.md new file mode 100644 index 0000000..6ecbd307 --- /dev/null +++ b/testing/android/docs/android_test_instructions.md
@@ -0,0 +1,290 @@ +# Building and Running Android Tests + +[TOC] + +## Device Setup + +### Physical Device Setup + +#### Root Access + +Running tests requires root access, which requires using a userdebug build on +your device. + +To use a userdebug build, see +[Running Builds](https://source.android.com/setup/build/running.html). Googlers +can refer to [this page](https://goto.google.com/flashdevice). + +If you can't run "adb root", you will get an error when trying to install +the test APKs like "adb: error: failed to copy" and +"remote secure_mkdirs failed: Operation not permitted" (use "adb unroot" to +return adb to normal). + +#### ADB Debugging + +The adb executable exists within the Android SDK: + +```shell +third_party/android_sdk/public/platform-tools/adb +``` + +In order to allow the ADB to connect to the device, you must enable USB +debugging: + +* Developer options are hidden by default. To unhide them: + * Go to "About phone" + * Tap 10 times on "Build number" + * The "Developer options" menu will now be available. + * Check "USB debugging". + * Un-check "Verify apps over USB". + +#### Screen + +You **must** ensure that the screen stays on while testing: `adb shell svc power +stayon usb` Or do this manually on the device: Settings -> Developer options -> +Stay Awake. + +If this option is greyed out, stay awake is probably disabled by policy. In that +case, get another device or log in with a normal, unmanaged account (because the +tests will break in exciting ways if stay awake is off). + +#### Disable Verify Apps + +You may see a dialog like [this +one](http://www.samsungmobileusa.com/simulators/ATT_GalaxyMega/mobile/screens/06-02_12.jpg), +which states, _Google may regularly check installed apps for potentially harmful +behavior._ This can interfere with the test runner. To disable this dialog, run: + +```shell +adb shell settings put global package_verifier_enable 0 +``` + +### Using Emulators + +Running tests on emulators is the same as [on device](#Running-Tests). Refer to +[android_emulator.md](../android_emulator.md) for setting up emulators. + +## Building Tests + +If you're adding a new test file, you'll need to explicitly add it to a gn +target. If you're adding a test to an existing file, you won't need to make gn +changes, but you may be interested in where your test winds up. In either case, +here are some guidelines for where a test belongs: + +### C++ + +C++ test files typically belong in `<top-level directory>_unittests` (e.g. +`base_unittests` for `//base`). There are a few exceptions -- browser tests are +typically their own target (e.g. `content_browsertests` for `//content`, or +`browser_tests` for `//chrome`), and some unit test suites are broken at the +second directory rather than the top-level one. + +### Java + +Java test files vary a bit more widely than their C++ counterparts: + +- Instrumentation test files -- i.e., tests that will run on a device -- + typically belong in either `<top-level directory>_javatests` or `<top-level + directory>_test_java`. Regardless, they'll wind up getting packaged into one + of a few test APKs: + - `webview_instrumentation_test_apk` for anything in `//android_webview` + - `content_shell_test_apk` for anything in `//content` or below + - `chrome_public_test_apk` for most things in `//chrome` +- JUnit or Robolectric test files -- i.e., tests that will run on the host -- + typically belong in `<top-level directory>_junit_tests` (e.g. + `base_junit_tests` for `//base`), though here again there are cases + (particularly in `//components`) where suites are split at the second + directory rather than the top-level one. + +Once you know what to build, just do it like you normally would build anything +else, e.g.: `ninja -C out/Release chrome_public_test_apk` + +## Running Tests + +All functional tests should be runnable via the wrapper scripts generated at +build time: + +```sh +<output directory>/bin/run_<target_name> [options] +``` + +Note that tests are sharded across all attached devices unless explicitly told +to do otherwise by `-d/--device`. + +The commands used by the buildbots are printed in the logs. Look at +https://build.chromium.org/ to duplicate the same test command as a particular +builder. + +### INSTALL\_FAILED\_CONTAINER\_ERROR or INSTALL\_FAILED\_INSUFFICIENT\_STORAGE + +If you see this error when the test runner is attempting to deploy the test +binaries to the AVD emulator, you may need to resize your userdata partition +with the following commands: + +```shell +# Resize userdata partition to be 1G +resize2fs android_emulator_sdk/sdk/system-images/android-25/x86/userdata.img 1G + +# Set filesystem parameter to continue on errors; Android doesn't like some +# things e2fsprogs does. +tune2fs -e continue android_emulator_sdk/sdk/system-images/android-25/x86/userdata.img +``` + +### AdbCommandFailedError: failed to stat remote object + +There's a known issue (https://crbug.com/1094062) where the unit test binaries can fail on +Android R and later: if you see this error, try rerunning on an Android version +with API level <= 29 (Android <= Q). + +## Symbolizing Crashes + +Crash stacks are logged and can be viewed using `adb logcat`. To symbolize the +traces, define `CHROMIUM_OUTPUT_DIR=$OUTDIR` where `$OUTDIR` is the argument you +pass to `ninja -C`, and pipe the output through +`third_party/android_platform/development/scripts/stack`. If +`$CHROMIUM_OUTPUT_DIR` is unset, the script will search `out/Debug` and +`out/Release`. For example: + +```shell +# If you build with +ninja -C out/Debug chrome_public_test_apk +# You can run: +adb logcat -d | third_party/android_platform/development/scripts/stack + +# If you build with +ninja -C out/android chrome_public_test_apk +# You can run: +adb logcat -d | CHROMIUM_OUTPUT_DIR=out/android third_party/android_platform/development/scripts/stack +# or +export CHROMIUM_OUTPUT_DIR=out/android +adb logcat -d | third_party/android_platform/development/scripts/stack +``` + +## JUnit tests + +JUnit tests are Java unittests running on the host instead of the target device. +They are faster to run and therefore are recommended over instrumentation tests +when possible. + +The JUnits tests are usually following the pattern of *target*\_junit\_tests, +for example, `content_junit_tests` and `chrome_junit_tests`. + +When adding a new JUnit test, the associated `BUILD.gn` file must be updated. +For example, adding a test to `chrome_junit_tests` requires to update +`chrome/android/BUILD.gn`. + +```shell +# Build the test suite. +ninja -C out/Default chrome_junit_tests + +# Run the test suite. +out/Default/bin/run_chrome_junit_tests + +# Run a subset of tests. You might need to pass the package name for some tests. +out/Default/bin/run_chrome_junit_tests -f "org.chromium.chrome.browser.media.*" +``` + +### Debugging + +Similar to [debugging apk targets](/docs/android_debugging_instructions.md#debugging-java): + +```shell +out/Default/bin/run_chrome_junit_tests --wait-for-java-debugger +out/Default/bin/run_chrome_junit_tests --wait-for-java-debugger # Specify custom port via --debug-socket=9999 +``` + +## Gtests + +```shell +# Build a test suite +ninja -C out/Release content_unittests + +# Run a test suite +out/Release/bin/run_content_unittests [-vv] + +# Run a subset of tests and enable some "please go faster" options: +out/Release/bin/run_content_unittests --fast-local-dev -f "ByteStreamTest.*" +``` + +## Instrumentation Tests + +In order to run instrumentation tests, you must leave your device screen ON and +UNLOCKED. Otherwise, the test will timeout trying to launch an intent. +Optionally you can disable screen lock under Settings -> Security -> Screen Lock +-> None. + +Next, you need to build the app, build your tests, and then run your tests +(which will install the APK under test and the test APK automatically). + +Examples: + +ContentShell tests: + +```shell +# Build the tests: +ninja -C out/Release content_shell_test_apk + +# Run the test suite: +out/Release/bin/run_content_shell_test_apk [-vv] + +# Run a subset of tests and enable some "please go faster" options: +out/Release/bin/run_content_shell_test_apk --fast-local-dev -f "*TestClass*" +``` + +Android WebView tests: + +See [WebView's instructions](/android_webview/docs/test-instructions.md). + +In order to run a subset of tests, use -f to filter based on test class/method +or -A/-E to filter using annotations. + +More Filtering examples: + +```shell +# Run a specific test class +out/Debug/bin/run_content_shell_test_apk -f "AddressDetectionTest.*" + +# Run a specific test method +out/Debug/bin/run_content_shell_test_apk -f AddressDetectionTest#testAddressLimits + +# Run a subset of tests by size (Smoke, SmallTest, MediumTest, LargeTest, +# EnormousTest) +out/Debug/bin/run_content_shell_test_apk -A Smoke + +# Run a subset of tests by annotation, such as filtering by Feature +out/Debug/bin/run_content_shell_test_apk -A Feature=Navigation +``` + +You might want to add stars `*` to each as a regular expression, e.g. +`*`AddressDetectionTest`*` + +### Debugging + +Similar to [debugging apk targets](../android_debugging_instructions.md#debugging-java): + +```shell +out/Debug/bin/run_content_shell_test_apk --wait-for-java-debugger +``` + +### Deobfuscating Java Stacktraces + +If running with `is_debug=false`, Java stacks from logcat need to be fixed up: + +```shell +build/android/stacktrace/java_deobfuscate.py out/Release/apks/ChromePublicTest.apk.mapping < stacktrace.txt +``` + +Any stacks produced by test runner output will already be deobfuscated. + + +## Running Blink Web Tests + +See [Web Tests](web_tests.md). + +## Running GPU tests + +(e.g. the "Android Debug (Nexus 7)" bot on the chromium.gpu waterfall) + +See https://www.chromium.org/developers/testing/gpu-testing for details. Use +`--browser=android-content-shell`. Examine the stdio from the test invocation on +the bots to see arguments to pass to `src/content/test/gpu/run_gpu_test.py`.
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index b0d9b1f..8107b5a 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -32,7 +32,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -109,7 +109,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -357,7 +357,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -1328,7 +1328,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", @@ -1422,7 +1422,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", @@ -1623,7 +1623,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/",
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index d460147..9879392 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -2103,7 +2103,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2171,7 +2172,8 @@ "--test-launcher-batch-limit=1", "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2238,7 +2240,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2305,7 +2308,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2374,7 +2378,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2441,7 +2446,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2509,6 +2515,7 @@ "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests", "--git-revision=${got_revision}" ], "isolate_profile_data": true, @@ -2581,7 +2588,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2648,7 +2656,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -2717,6 +2726,7 @@ "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests", "--git-revision=${got_revision}" ], "isolate_profile_data": true, @@ -2792,6 +2802,7 @@ "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests", "--git-revision=${got_revision}" ], "isolate_profile_data": true, @@ -2866,6 +2877,7 @@ "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests", "--git-revision=${got_revision}" ], "isolate_profile_data": true, @@ -2938,7 +2950,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3006,7 +3019,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3074,7 +3088,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3141,7 +3156,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3208,7 +3224,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3276,7 +3293,8 @@ "--use-cmd-decoder=validating", "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3344,7 +3362,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3411,7 +3430,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3478,7 +3498,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3545,7 +3566,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3612,7 +3634,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3680,7 +3703,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3747,7 +3771,8 @@ "args": [ "--gs-results-bucket=chromium-result-details", "--recover-devices", - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "merge": { @@ -3815,7 +3840,8 @@ "isolated_scripts": [ { "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_name": "monochrome_public_apk_checker", "isolate_profile_data": true, @@ -3870,7 +3896,8 @@ "scripts": [ { "args": [ - "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" + "--avd-config=../../tools/android/avd/proto/generic_android23.textpb", + "--gtest_also_run_disabled_tests" ], "isolate_profile_data": true, "name": "check_network_annotations", @@ -9597,12 +9624,12 @@ "--test-runner-outdir", ".", "--client-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--client-version=100", + "--client-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android30.textpb" @@ -9612,11 +9639,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_client_from_100" + "weblayer_skew_tests_with_client_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_client_from_100", + "name": "weblayer_skew_tests_with_client_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -9626,8 +9653,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -10103,10 +10130,10 @@ "--client-outdir", ".", "--implementation-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--impl-version=100", + "--impl-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android30.textpb" @@ -10116,11 +10143,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_impl_from_100" + "weblayer_skew_tests_with_impl_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_impl_from_100", + "name": "weblayer_skew_tests_with_impl_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -10130,8 +10157,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 7cc5d4b..ee01546 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -44851,12 +44851,12 @@ "--test-runner-outdir", ".", "--client-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--client-version=100", + "--client-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android29.textpb" @@ -44866,11 +44866,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_client_from_100" + "weblayer_skew_tests_with_client_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_client_from_100", + "name": "weblayer_skew_tests_with_client_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -44880,8 +44880,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -45357,10 +45357,10 @@ "--client-outdir", ".", "--implementation-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--impl-version=100", + "--impl-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android29.textpb" @@ -45370,11 +45370,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_impl_from_100" + "weblayer_skew_tests_with_impl_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_impl_from_100", + "name": "weblayer_skew_tests_with_impl_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -45384,8 +45384,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -45863,12 +45863,12 @@ "--test-runner-outdir", ".", "--client-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--client-version=100", + "--client-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" @@ -45878,11 +45878,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_chrome_with_client_from_100" + "weblayer_skew_tests_with_chrome_with_client_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_chrome_with_client_from_100", + "name": "weblayer_skew_tests_with_chrome_with_client_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -45892,8 +45892,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46369,10 +46369,10 @@ "--client-outdir", ".", "--implementation-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--impl-version=100", + "--impl-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android23.textpb" @@ -46382,11 +46382,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_chrome_with_impl_from_100" + "weblayer_skew_tests_with_chrome_with_impl_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_chrome_with_impl_from_100", + "name": "weblayer_skew_tests_with_chrome_with_impl_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -46396,8 +46396,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -46942,12 +46942,12 @@ "--test-runner-outdir", ".", "--client-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--client-version=100", + "--client-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android27.textpb" @@ -46957,11 +46957,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_client_from_100" + "weblayer_skew_tests_with_client_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_client_from_100", + "name": "weblayer_skew_tests_with_client_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -46971,8 +46971,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -47448,10 +47448,10 @@ "--client-outdir", ".", "--implementation-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--impl-version=100", + "--impl-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android27.textpb" @@ -47461,11 +47461,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_impl_from_100" + "weblayer_skew_tests_with_impl_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_impl_from_100", + "name": "weblayer_skew_tests_with_impl_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -47475,8 +47475,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48021,12 +48021,12 @@ "--test-runner-outdir", ".", "--client-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--implementation-outdir", ".", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--client-version=100", + "--client-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android28.textpb" @@ -48036,11 +48036,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_client_from_100" + "weblayer_skew_tests_with_client_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_client_from_100", + "name": "weblayer_skew_tests_with_client_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -48050,8 +48050,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}", @@ -48527,10 +48527,10 @@ "--client-outdir", ".", "--implementation-outdir", - "../../weblayer_instrumentation_test_M100/out/Release", + "../../weblayer_instrumentation_test_M101/out/Release", "--test-expectations", "../../weblayer/browser/android/javatests/skew/expectations.txt", - "--impl-version=100", + "--impl-version=101", "--gs-results-bucket=chromium-result-details", "--recover-devices", "--avd-config=../../tools/android/avd/proto/generic_android28.textpb" @@ -48540,11 +48540,11 @@ "--bucket", "chromium-result-details", "--test-name", - "weblayer_skew_tests_with_impl_from_100" + "weblayer_skew_tests_with_impl_from_101" ], "script": "//build/android/pylib/results/presentation/test_results_presentation.py" }, - "name": "weblayer_skew_tests_with_impl_from_100", + "name": "weblayer_skew_tests_with_impl_from_101", "resultdb": { "enable": true, "has_native_resultdb_integration": true @@ -48554,8 +48554,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/weblayer-x86", - "location": "weblayer_instrumentation_test_M100", - "revision": "version:100.0.4896.49" + "location": "weblayer_instrumentation_test_M101", + "revision": "version:101.0.4951.3" }, { "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index b43bd71..2072027e 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -250,7 +250,7 @@ }, "quickrun_shards": 8, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -1316,7 +1316,7 @@ "idempotent": false, "io_timeout": 3600, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/",
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 0b48a86..e2415f3 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -15762,7 +15762,7 @@ ] }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/" @@ -17003,7 +17003,7 @@ ] }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/"
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 6d08475f..57ad640 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -29835,5 +29835,48 @@ } } ] + }, + "gpu-fyi-chromeos-zork-exp": { + "additional_compile_targets": [ + "chromiumos_preflight" + ], + "isolated_scripts": [ + { + "args": [ + "noop_sleep", + "--show-stdout", + "--browser=cros-chrome", + "--passthrough", + "-v", + "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", + "--remote=variable_chromeos_device_hostname" + ], + "isolate_name": "telemetry_gpu_integration_test", + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" + }, + "name": "noop_sleep_tests", + "should_retry_with_patch": false, + "swarming": { + "can_use_on_swarming_builders": true, + "containment_type": "AUTO", + "dimension_sets": [ + { + "device_type": "zork", + "os": "ChromeOS", + "pool": "chromium.tests.gpu.experimental" + } + ], + "expiration": 21600, + "idempotent": false, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/", + "trigger_script": { + "script": "//testing/trigger_scripts/chromeos_device_trigger.py" + } + } + ] } }
diff --git a/testing/buildbot/filters/mac.mac11-arm64-rel.browser_tests.filter b/testing/buildbot/filters/mac.mac11-arm64-rel.browser_tests.filter index 6eec4e1..28bfbbe7 100644 --- a/testing/buildbot/filters/mac.mac11-arm64-rel.browser_tests.filter +++ b/testing/buildbot/filters/mac.mac11-arm64-rel.browser_tests.filter
@@ -1,10 +1,9 @@ # crbug.com/1262402 Test filter for browser_tests on mac11-arm64-rel --SavePageOriginalVsSavedComparisonTest.AboutBlank/0 --SavePageOriginalVsSavedComparisonTest.CrossSiteObject/0 --EncryptedMediaTest.Playback_VideoOnly_WebM_VP9Profile2/0 --MseEncryptedMediaTest.Playback_VideoOnly_MP4_VP9Profile2/0 --ContentScriptTrackerBrowserTest.ContentScriptViaDeclarativeContentApi +-All/CryptotokenBrowserTest.SandboxedPageDoesNotSign/0 +-All/CryptotokenBrowserTest.SignShowsPrompt/0 +-All/LoginPromptBrowserTest.TestBasicAuth/0 +-All/LoginPromptBrowserTest.TestBasicAuth/1 -All/CastV2PerformanceTest.Performance/1 -All/CastV2PerformanceTest.Performance/2 -All/CastV2PerformanceTest.Performance/5 @@ -15,7 +14,85 @@ -BackForwardCachePageLoadMetricsObserverBrowserTest.LayoutShiftNormalization_AfterBackForwardCacheRestore -BackForwardCachePageLoadMetricsObserverBrowserTest.ResponsivenessMetricsNormalizationWithSendingAllLatencies -BackForwardCachePageLoadMetricsObserverBrowserTest.ResumesLoggingAfterRestoringFromCacheAfterBackgrounding --WebAppBrowserTest.WebAppCreateAndDeleteShortcut --SaveAsMhtml/SavePageOriginalVsSavedComparisonTest.NestedFrames/0 --WorkerDevToolsTest.PauseInSharedWorkerInitialization +-BackgroundFetchBrowserTest.OfflineItemCollection_VerifyIconReceived +-ContentScriptTrackerBrowserTest.ContentScriptViaDeclarativeContentApi +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_marquee +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_meta_viewport_large +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_list +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_heading_order +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_link_name +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_input_image_alt +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_server_side_image_map +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_th_has_data_cells +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_aria_valid_attr +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_td_headers_attr +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_aria_allowed_attr +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_object_alt +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_meta_viewport +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_aria_required_parent +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_document_title +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_frame_title +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_hidden_content +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_valid_lang +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_video_caption +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_radiogroup +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_p_as_heading +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_video_description +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_audio_caption +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_html_has_lang +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_meta_refresh +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_duplicate_id +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_aria_required_children +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_aria_hidden_body +-CrExtensionsA11yTestWithMultipleExensions.WithExtensions_listitem +-ComponentCloudPolicyTest.InstallNewExtension +-CookieControlsBubbleViewTest.InvokeUi_CookiesBlocked +-DeclarativeNetRequestApiFencedFrameTest/DeclarativeNetRequestApiFencedFrameTest.Load/0 +-DeclarativeNetRequestApiFencedFrameTest/DeclarativeNetRequestApiFencedFrameTest.Load/1 +-DevToolsNetInfoTest.EmulateNetworkConditions +-DevToolsTest.TestNetworkSize +-DevToolsTest.TestNetworkSyncSize +-DevToolsTest.TestNetworkTiming +-DevToolsTest.TestRawHeadersWithRedirectAndHSTS +-DevToolsExtensionTest.TestExtensionOnNewTab +-DownloadTestWithFakeSafeBrowsing.SendUncommonDownloadReportIfUserProceed +-ExternallyManagedAppManagerImplBrowserTest.CannotFetchManifest +-EncryptedMediaTest.Playback_VideoOnly_WebM_VP9Profile2/0 +-FirstRunMasterPrefsWithTrackedPreferencesInstance/FirstRunMasterPrefsWithTrackedPreferences.TrackedPreferencesSurviveFirstRun/0 +-FirstRunMasterPrefsWithTrackedPreferencesInstance/FirstRunMasterPrefsWithTrackedPreferences.TrackedPreferencesSurviveFirstRun/1 +-FirstRunMasterPrefsWithTrackedPreferencesInstance/FirstRunMasterPrefsWithTrackedPreferences.TrackedPreferencesSurviveFirstRun/2 +-FirstRunMasterPrefsWithTrackedPreferencesInstance/FirstRunMasterPrefsWithTrackedPreferences.TrackedPreferencesSurviveFirstRun/3 +-FirstRunMasterPrefsVariationsSeedTests/FirstRunMasterPrefsVariationsSeedTest.Test/1 -GetDisplayMediaChangeSourceBrowserTest.ChangeSource +-HttpsOnlyModeBrowserTest.BadHttpsFollowedByGoodHttps +-InlineLoginHelperBrowserTest.UntrustedSigninDialogCancel +-InspectUIFencedFrameTest.FencedFrameInFrontEnd +-InspectUITest.LaunchUIDevtools +-ManagementUITest.ManagementStateChange +-MediaEngagementBrowserTest.SessionMultipleTabsClosingParent +-MediaInternalsUIBrowserTest.Integration +-MediaGalleriesGalleryWatchApiTest.SetupGalleryWatchWithoutListeners +-MetricsServiceBrowserSampledOutTest.FilesRemoved +-MseEncryptedMediaTest.Playback_VideoOnly_MP4_VP9Profile2/0 +-NativeMessagingLaunchApiTest.Error +-PDFExtensionSaveTest.Save +-PDFExtensionSaveWithPolicyTest.SaveWithPolicyUniqueTimeSuffix +-PreinstalledAppsBrowserTest.TestUninstall +-PreinstalledAppsMigrationBrowserTest.TestRollbackCompatibility +-PreinstalledAppsMigrationBrowserTest.TestExtensionWasAlreadyUninstalled +-PrintBrowserTest.LazyLoadedIframeFetchedCrossOrigin +-ProfileBrowserTest.CreateOldProfileAsynchronous +-ProfileBrowserTestWithoutDestroyProfile.DISABLE_DestroyRegularProfileBeforeOTRs +-ProfileHelperTest.DeleteSoleProfile +-ReaderModeIconViewBrowserTest.NonSecurePagesNotDistillable +-RestoreOnStartupPolicyTestInstance/RestoreOnStartupPolicyTest.RunTest/3 +-SaveAsMhtml/SavePageOriginalVsSavedComparisonTest.NestedFrames/0 +-SavePageOriginalVsSavedComparisonTest.AboutBlank/0 +-SavePageOriginalVsSavedComparisonTest.CrossSiteObject/0 +-SSLUITest.BadCertFollowedByGoodCert +-StartupBrowserWithWebAppTest.LastUsedProfilesWithWebApp +-TabRestoreTest.RestoreTabFromClosedWindowByID +-WebAppBrowserTest.WebAppCreateAndDeleteShortcut +-WebAppFileHandlingBrowserTest_FeatureSwitchesOff.OsIntegrationIsRemoved +-WebViewNewWindowTest.Shim_TestAddContentScriptsWithNewWindowAPI +-WorkerDevToolsTest.PauseInSharedWorkerInitialization
diff --git a/testing/buildbot/internal.chromeos.fyi.json b/testing/buildbot/internal.chromeos.fyi.json index a9b025e3..ff6ba45 100644 --- a/testing/buildbot/internal.chromeos.fyi.json +++ b/testing/buildbot/internal.chromeos.fyi.json
@@ -201,7 +201,7 @@ ] }, "service_account": "chrome-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 6 + "shards": 7 }, "test": "chrome_all_tast_tests", "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/"
diff --git a/testing/buildbot/mixins.pyl b/testing/buildbot/mixins.pyl index ac7de16..e71a943 100644 --- a/testing/buildbot/mixins.pyl +++ b/testing/buildbot/mixins.pyl
@@ -312,6 +312,14 @@ }, }, }, + 'chromeos-zork': { + 'swarming': { + 'dimensions': { + 'os': 'ChromeOS', + 'device_type': 'zork', + }, + }, + }, 'chromium-tester-dev-service-account': { 'swarming': { 'service_account': 'chromium-tester-dev@chops-service-accounts.iam.gserviceaccount.com', @@ -428,6 +436,13 @@ }, }, }, + 'gtest_run_disabled': { + '$mixin_append': { + 'args': [ + '--gtest_also_run_disabled_tests', + ], + }, + }, 'gtest_run_disabled_only': { '$mixin_append': { 'args': [
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 87329ab..efb2778 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -614,7 +614,7 @@ 'idempotent': False, # https://crbug.com/923426#c27 # Tast test doesn't always output. See crbug.com/1306300 'io_timeout': 3600, - 'shards': 6, + 'shards': 7, }, 'resultdb': { 'enable': True,
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 7c490b7a..14c92d88 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -448,18 +448,18 @@ '--client-outdir', '.', '--implementation-outdir', - '../../weblayer_instrumentation_test_M100/out/Release', + '../../weblayer_instrumentation_test_M101/out/Release', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--impl-version=100', + '--impl-version=101', ], - 'identifier': 'with_impl_from_100', + 'identifier': 'with_impl_from_101', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', - 'location': 'weblayer_instrumentation_test_M100', - 'revision': 'version:100.0.4896.49', + 'location': 'weblayer_instrumentation_test_M101', + 'revision': 'version:101.0.4951.3', } ], }, @@ -592,18 +592,18 @@ '--client-outdir', '.', '--implementation-outdir', - '../../weblayer_instrumentation_test_M100/out/Release', + '../../weblayer_instrumentation_test_M101/out/Release', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--impl-version=100', + '--impl-version=101', ], - 'identifier': 'with_impl_from_100', + 'identifier': 'with_impl_from_101', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', - 'location': 'weblayer_instrumentation_test_M100', - 'revision': 'version:100.0.4896.49', + 'location': 'weblayer_instrumentation_test_M101', + 'revision': 'version:101.0.4951.3', } ], }, @@ -734,20 +734,20 @@ '--test-runner-outdir', '.', '--client-outdir', - '../../weblayer_instrumentation_test_M100/out/Release', + '../../weblayer_instrumentation_test_M101/out/Release', '--implementation-outdir', '.', '--test-expectations', '../../weblayer/browser/android/javatests/skew/expectations.txt', - '--client-version=100', + '--client-version=101', ], - 'identifier': 'with_client_from_100', + 'identifier': 'with_client_from_101', 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/weblayer-x86', - 'location': 'weblayer_instrumentation_test_M100', - 'revision': 'version:100.0.4896.49', + 'location': 'weblayer_instrumentation_test_M101', + 'revision': 'version:101.0.4951.3', } ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 92327051..93526d0 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1202,6 +1202,7 @@ 'emulator-4-cores', 'linux-xenial-or-bionic', 'x86-64', + 'gtest_run_disabled', ], 'os_type': 'android', 'test_suites': { @@ -4925,6 +4926,22 @@ 'gpu_telemetry_tests': 'gpu_noop_sleep_telemetry_test', }, }, + 'gpu-fyi-chromeos-zork-exp': { + 'additional_compile_targets': [ + 'chromiumos_preflight', + ], + 'browser_config': 'cros-chrome', + 'os_type': 'chromeos', + 'skip_merge_script': True, + 'mixins': [ + 'chromeos-zork', + 'gpu-exp-swarming-pool', + 'limited_capacity_bot', + ], + 'test_suites': { + 'gpu_telemetry_tests': 'gpu_noop_sleep_telemetry_test', + }, + }, }, }, {
diff --git a/third_party/blink/public/mojom/use_counter/css_property_id.mojom b/third_party/blink/public/mojom/use_counter/css_property_id.mojom index a1df9d8..e79558d 100644 --- a/third_party/blink/public/mojom/use_counter/css_property_id.mojom +++ b/third_party/blink/public/mojom/use_counter/css_property_id.mojom
@@ -763,6 +763,7 @@ kBasePalette = 710, kOverrideColors = 711, kPageTransitionTag = 712, + kObjectViewBox = 713, // 1. Add new features above this line (don't change the assigned numbers of // the existing items). // 2. Run the src/tools/metrics/histograms/update_use_counter_css.py script
diff --git a/third_party/blink/public/platform/web_impression.h b/third_party/blink/public/platform/web_impression.h index a5681a2..40cd1602 100644 --- a/third_party/blink/public/platform/web_impression.h +++ b/third_party/blink/public/platform/web_impression.h
@@ -29,7 +29,7 @@ // Data that will be sent in conversion reports to identify this impression. // Declared by the impression tag. - uint64_t impression_data; + uint64_t impression_data = 0; // Optional expiry specifying the amount of time this impression can convert. // Declared by the impression tag. @@ -37,7 +37,7 @@ // Priority for the attribution source. Declared by the impression tag. // This is 64 bits to allow timestamps to be used as a prioirty. - int64_t priority; + int64_t priority = 0; // Indicates the attributionsrc request associated with `this`, if any. If // provided, data parameters should be used from the attributionsrc response.
diff --git a/third_party/blink/renderer/bindings/generated_in_core.gni b/third_party/blink/renderer/bindings/generated_in_core.gni index 4974f81..e94da9a 100644 --- a/third_party/blink/renderer/bindings/generated_in_core.gni +++ b/third_party/blink/renderer/bindings/generated_in_core.gni
@@ -1562,8 +1562,8 @@ "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_eventlisteneroptions.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_scrollintoviewoptions.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_scrollintoviewoptions.h", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_string_unrestricteddouble_null.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_string_unrestricteddouble_null.h", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_string_unrestricteddouble.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_boolean_string_unrestricteddouble.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_bytestringbytestringrecord_bytestringsequencesequence.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_bytestringbytestringrecord_bytestringsequencesequence.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_union_compositeoperationorauto_compositeoperationorautosequence.cc",
diff --git a/third_party/blink/renderer/core/css/css.dict b/third_party/blink/renderer/core/css/css.dict index ee9304a..d870c5bf 100644 --- a/third_party/blink/renderer/core/css/css.dict +++ b/third_party/blink/renderer/core/css/css.dict
@@ -1226,6 +1226,7 @@ "nav-up" "negative" "object-fit" +"object-view-box" "offset" "offset-after" "offset-anchor"
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index e5f1cf8..99943d5a 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -3036,6 +3036,21 @@ typedom_types: ["Keyword", "Position"], }, { + name: "object-view-box", + property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], + interpolable: true, + field_group: "*", + field_template: "pointer", + include_paths: ["third_party/blink/renderer/core/style/basic_shapes.h"], + wrapper_pointer_name: "scoped_refptr", + default_value: "nullptr", + type_name: "BasicShape", + converter: "ConvertObjectViewBox", + keywords: ["none"], + typedom_types: ["Keyword"], + runtime_flag: "CSSObjectViewBoxAndOverflow", + }, + { name: "offset-anchor", property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], interpolable: true,
diff --git a/third_party/blink/renderer/core/css/css_property_equality.cc b/third_party/blink/renderer/core/css/css_property_equality.cc index 2d51760b4..92c7563 100644 --- a/third_party/blink/renderer/core/css/css_property_equality.cc +++ b/third_party/blink/renderer/core/css/css_property_equality.cc
@@ -205,6 +205,8 @@ return a.MinWidth() == b.MinWidth(); case CSSPropertyID::kObjectPosition: return a.ObjectPosition() == b.ObjectPosition(); + case CSSPropertyID::kObjectViewBox: + return a.ObjectViewBox() == b.ObjectViewBox(); case CSSPropertyID::kOffsetAnchor: return a.OffsetAnchor() == b.OffsetAnchor(); case CSSPropertyID::kOffsetDistance:
diff --git a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc index d44bc61..873c708 100644 --- a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc +++ b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc
@@ -1472,8 +1472,7 @@ // TODO(ansollan): Add support for track lists with auto and integer // repeaters. - const NGGridTrackList& ng_track_list = - computed_grid_track_list.track_sizes.NGTrackList(); + const NGGridTrackList& ng_track_list = computed_grid_track_list.TrackList(); wtf_size_t track_index = 0; auto AppendValues = [&](CSSValueList* list, const GridTrackSize& track_size, GridTrackListSerializationType named_line_type) {
diff --git a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc index 83a5b2e..96d2774c 100644 --- a/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc +++ b/third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
@@ -26,6 +26,7 @@ #include "third_party/blink/renderer/core/css/css_resolution_units.h" #include "third_party/blink/renderer/core/css/css_string_value.h" #include "third_party/blink/renderer/core/css/css_uri_value.h" +#include "third_party/blink/renderer/core/css/css_value.h" #include "third_party/blink/renderer/core/css/css_value_list.h" #include "third_party/blink/renderer/core/css/css_value_pair.h" #include "third_party/blink/renderer/core/css/parser/css_parser_context.h" @@ -4939,6 +4940,35 @@ CSSValuePair::kKeepIdenticalValues); } +const CSSValue* ObjectViewBox::ParseSingleValue( + CSSParserTokenRange& range, + const CSSParserContext& context, + const CSSParserLocalContext&) const { + DCHECK(RuntimeEnabledFeatures::CSSObjectViewBoxAndOverflowEnabled()); + + if (range.Peek().Id() == CSSValueID::kNone) + return css_parsing_utils::ConsumeIdent(range); + auto* css_value = css_parsing_utils::ConsumeBasicShape( + range, context, css_parsing_utils::AllowPathValue::kForbid); + // TODO(khushalsagar) : Also allow rect() and xywh(). + return (css_value && css_value->IsBasicShapeInsetValue()) ? css_value + : nullptr; +} + +const CSSValue* ObjectViewBox::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const LayoutObject*, + bool allow_visited_style) const { + if (!RuntimeEnabledFeatures::CSSObjectViewBoxAndOverflowEnabled()) { + DCHECK(!style.ObjectViewBox()); + return CSSIdentifierValue::Create(CSSValueID::kNone); + } + + if (auto* basic_shape = style.ObjectViewBox()) + return ValueForBasicShape(style, basic_shape); + return CSSIdentifierValue::Create(CSSValueID::kNone); +} + const CSSValue* OffsetAnchor::ParseSingleValue( CSSParserTokenRange& range, const CSSParserContext& context,
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc index 096a061d..c8822c8a 100644 --- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc +++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
@@ -2023,6 +2023,13 @@ return ConvertPathOrNone(state, value); } +scoped_refptr<BasicShape> StyleBuilderConverter::ConvertObjectViewBox( + StyleResolverState& state, + const CSSValue& value) { + return value.IsBasicShapeInsetValue() ? BasicShapeForValue(state, value) + : nullptr; +} + static const CSSValue& ComputeRegisteredPropertyValue( const Document& document, const StyleResolverState* state,
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.h b/third_party/blink/renderer/core/css/resolver/style_builder_converter.h index 4e6c2a7..1c6be09 100644 --- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.h +++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.h
@@ -27,6 +27,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_STYLE_BUILDER_CONVERTER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_RESOLVER_STYLE_BUILDER_CONVERTER_H_ +#include "base/memory/scoped_refptr.h" #include "cc/input/scroll_snap_data.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/css/css_function_value.h" @@ -38,6 +39,7 @@ #include "third_party/blink/renderer/core/css/css_value_pair.h" #include "third_party/blink/renderer/core/css/css_variable_data.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver_state.h" +#include "third_party/blink/renderer/core/style/basic_shapes.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/style/grid_area.h" #include "third_party/blink/renderer/core/style/grid_positions_resolver.h" @@ -255,6 +257,8 @@ const CSSValue&); static scoped_refptr<StylePath> ConvertPathOrNone(StyleResolverState&, const CSSValue&); + static scoped_refptr<BasicShape> ConvertObjectViewBox(StyleResolverState&, + const CSSValue&); static scoped_refptr<BasicShape> ConvertOffsetPath(StyleResolverState&, const CSSValue&); static StyleOffsetRotation ConvertOffsetRotate(const CSSValue&);
diff --git a/third_party/blink/renderer/core/css/style_element.cc b/third_party/blink/renderer/core/css/style_element.cc index 9ef76f0..8af5f1b 100644 --- a/third_party/blink/renderer/core/css/style_element.cc +++ b/third_party/blink/renderer/core/css/style_element.cc
@@ -50,6 +50,7 @@ : has_finished_parsing_children_(!created_by_parser), loading_(false), registered_as_candidate_(false), + created_by_parser_(created_by_parser), start_position_(TextPosition::BelowRangePosition()), pending_sheet_type_(PendingSheetType::kNone) { if (created_by_parser && document && @@ -169,10 +170,13 @@ media_query_matches = evaluator.Eval(*media_queries); } } - // TODO(crbug.com/1271296): Should be blocking only when created by parser - // or has `blocking="render"`. - pending_sheet_type_ = media_query_matches ? PendingSheetType::kBlocking - : PendingSheetType::kNonBlocking; + pending_sheet_type_ = + media_query_matches && + (created_by_parser_ || + (RuntimeEnabledFeatures::BlockingAttributeEnabled() && + blocking() && blocking()->IsRenderBlocking())) + ? PendingSheetType::kBlocking + : PendingSheetType::kNonBlocking; loading_ = true; TextPosition start_position = start_position_ == TextPosition::BelowRangePosition()
diff --git a/third_party/blink/renderer/core/css/style_element.h b/third_party/blink/renderer/core/css/style_element.h index d5a991472..925dd46bb 100644 --- a/third_party/blink/renderer/core/css/style_element.h +++ b/third_party/blink/renderer/core/css/style_element.h
@@ -73,6 +73,7 @@ bool has_finished_parsing_children_ : 1; bool loading_ : 1; bool registered_as_candidate_ : 1; + bool created_by_parser_ : 1; TextPosition start_position_; PendingSheetType pending_sheet_type_; };
diff --git a/third_party/blink/renderer/core/dom/shadow_root.h b/third_party/blink/renderer/core/dom/shadow_root.h index e474cb5b..faec991 100644 --- a/third_party/blink/renderer/core/dom/shadow_root.h +++ b/third_party/blink/renderer/core/dom/shadow_root.h
@@ -146,7 +146,7 @@ return static_cast<SlotAssignmentMode>(slot_assignment_mode_); } String slotAssignment() const { - return IsManualSlotting() ? "manual" : "auto"; + return IsManualSlotting() ? "manual" : "named"; } void SetIsDeclarativeShadowRoot(bool flag) {
diff --git a/third_party/blink/renderer/core/html/html_element.cc b/third_party/blink/renderer/core/html/html_element.cc index bfa1cbff..d3ef087 100644 --- a/third_party/blink/renderer/core/html/html_element.cc +++ b/third_party/blink/renderer/core/html/html_element.cc
@@ -1080,40 +1080,40 @@ "'plaintext-only', or 'inherit'."); } -V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull* HTMLElement::hidden() const { +V8UnionBooleanOrStringOrUnrestrictedDouble* HTMLElement::hidden() const { const AtomicString& attribute = FastGetAttribute(html_names::kHiddenAttr); if (!RuntimeEnabledFeatures::BeforeMatchEventEnabled(GetExecutionContext())) { - return MakeGarbageCollected< - V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull>(attribute != - g_null_atom); + return MakeGarbageCollected<V8UnionBooleanOrStringOrUnrestrictedDouble>( + attribute != g_null_atom); } if (attribute == g_null_atom) { - return MakeGarbageCollected< - V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull>(false); + return MakeGarbageCollected<V8UnionBooleanOrStringOrUnrestrictedDouble>( + false); } if (attribute == "until-found") { - return MakeGarbageCollected< - V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull>( + return MakeGarbageCollected<V8UnionBooleanOrStringOrUnrestrictedDouble>( String("until-found")); } - return MakeGarbageCollected<V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull>( - true); + return MakeGarbageCollected<V8UnionBooleanOrStringOrUnrestrictedDouble>(true); } void HTMLElement::setHidden( - const V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull* value) { + const V8UnionBooleanOrStringOrUnrestrictedDouble* value) { + if (!value) { + removeAttribute(html_names::kHiddenAttr); + return; + } switch (value->GetContentType()) { - case V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull::ContentType:: - kBoolean: + case V8UnionBooleanOrStringOrUnrestrictedDouble::ContentType::kBoolean: if (value->GetAsBoolean()) { setAttribute(html_names::kHiddenAttr, ""); } else { removeAttribute(html_names::kHiddenAttr); } break; - case V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull::ContentType::kString: + case V8UnionBooleanOrStringOrUnrestrictedDouble::ContentType::kString: if (RuntimeEnabledFeatures::BeforeMatchEventEnabled( GetExecutionContext()) && EqualIgnoringASCIICase(value->GetAsString(), "until-found")) { @@ -1124,10 +1124,7 @@ setAttribute(html_names::kHiddenAttr, ""); } break; - case V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull::ContentType::kNull: - removeAttribute(html_names::kHiddenAttr); - break; - case V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull::ContentType:: + case V8UnionBooleanOrStringOrUnrestrictedDouble::ContentType:: kUnrestrictedDouble: double double_value = value->GetAsUnrestrictedDouble(); if (double_value && !std::isnan(double_value)) {
diff --git a/third_party/blink/renderer/core/html/html_element.h b/third_party/blink/renderer/core/html/html_element.h index 8d81cfd9..fc55bae 100644 --- a/third_party/blink/renderer/core/html/html_element.h +++ b/third_party/blink/renderer/core/html/html_element.h
@@ -24,7 +24,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_HTML_ELEMENT_H_ #include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_union_boolean_string_unrestricteddouble_null.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_union_boolean_string_unrestricteddouble.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/events/simulated_click_options.h" @@ -174,8 +174,8 @@ void AdjustDirectionalityIfNeededAfterShadowRootChanged(); void BeginParsingChildren() override; - V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull* hidden() const; - void setHidden(const V8UnionBooleanOrStringOrUnrestrictedDoubleOrNull*); + V8UnionBooleanOrStringOrUnrestrictedDouble* hidden() const; + void setHidden(const V8UnionBooleanOrStringOrUnrestrictedDouble*); protected: enum AllowPercentage { kDontAllowPercentageValues, kAllowPercentageValues };
diff --git a/third_party/blink/renderer/core/html/html_element.idl b/third_party/blink/renderer/core/html/html_element.idl index 8ae18ce..f2fd80b6 100644 --- a/third_party/blink/renderer/core/html/html_element.idl +++ b/third_party/blink/renderer/core/html/html_element.idl
@@ -30,7 +30,7 @@ [CEReactions] attribute DOMString dir; // user interaction - [CEReactions] attribute (boolean or unrestricted double or DOMString?) hidden; + [CEReactions] attribute (boolean or unrestricted double or DOMString)? hidden; [RuntimeCallStatsCounter=HTMLElementClick] void click(); [CEReactions, RuntimeEnabled=InertAttribute, Reflect] attribute boolean inert;
diff --git a/third_party/blink/renderer/core/html/html_link_element.cc b/third_party/blink/renderer/core/html/html_link_element.cc index cb25608a..afdabcad 100644 --- a/third_party/blink/renderer/core/html/html_link_element.cc +++ b/third_party/blink/renderer/core/html/html_link_element.cc
@@ -324,6 +324,10 @@ if (rel_attribute_.IsLinkPrefetch()) { UseCounter::Count(GetDocument(), WebFeature::kLinkPrefetchLoadEvent); } + if (RenderBlockingResourceManager* manager = + GetDocument().GetRenderBlockingResourceManager()) { + manager->RemovePendingPreload(*this); + } DispatchEvent(*Event::Create(event_type_names::kLoad)); } @@ -331,6 +335,10 @@ if (rel_attribute_.IsLinkPrefetch()) { UseCounter::Count(GetDocument(), WebFeature::kLinkPrefetchErrorEvent); } + if (RenderBlockingResourceManager* manager = + GetDocument().GetRenderBlockingResourceManager()) { + manager->RemovePendingPreload(*this); + } DispatchEvent(*Event::Create(event_type_names::kError)); } @@ -438,6 +446,17 @@ return scopes_.Get(); } +bool HTMLLinkElement::IsRenderBlockingPreload() const { + if (!RuntimeEnabledFeatures::BlockingAttributeEnabled()) + return false; + return (rel_attribute_.IsLinkPreload() || rel_attribute_.IsModulePreload()) && + blocking_attribute_->IsRenderBlocking(); +} + +bool HTMLLinkElement::IsFontPreload() const { + return rel_attribute_.IsLinkPreload() && EqualIgnoringASCIICase(as_, "font"); +} + void HTMLLinkElement::Trace(Visitor* visitor) const { visitor->Trace(link_); visitor->Trace(sizes_);
diff --git a/third_party/blink/renderer/core/html/html_link_element.h b/third_party/blink/renderer/core/html/html_link_element.h index 905e62f..ab18bf25 100644 --- a/third_party/blink/renderer/core/html/html_link_element.h +++ b/third_party/blink/renderer/core/html/html_link_element.h
@@ -110,6 +110,8 @@ // From LinkLoaderClient bool ShouldLoadLink() override; bool IsLinkCreatedByParser() override; + bool IsRenderBlockingPreload() const override; + bool IsFontPreload() const override; // For LinkStyle bool LoadLink(const LinkLoadParameters&);
diff --git a/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc b/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc index fe2bdd4b1..3bc5835 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/layout_ng_grid.cc
@@ -42,14 +42,12 @@ bool ExplicitGridDidResize(const ComputedStyle& new_style, const ComputedStyle& old_style) { - const NGGridTrackList& old_ng_columns_track_list = - old_style.GridTemplateColumns().track_sizes.NGTrackList(); - const NGGridTrackList& new_ng_columns_track_list = - new_style.GridTemplateColumns().track_sizes.NGTrackList(); - const NGGridTrackList& old_ng_rows_track_list = - old_style.GridTemplateRows().track_sizes.NGTrackList(); - const NGGridTrackList& new_ng_rows_track_list = - new_style.GridTemplateRows().track_sizes.NGTrackList(); + const auto& old_ng_columns_track_list = + old_style.GridTemplateColumns().TrackList(); + const auto& new_ng_columns_track_list = + new_style.GridTemplateColumns().TrackList(); + const auto& old_ng_rows_track_list = old_style.GridTemplateRows().TrackList(); + const auto& new_ng_rows_track_list = new_style.GridTemplateRows().TrackList(); return old_ng_columns_track_list.TrackCountWithoutAutoRepeat() != new_ng_columns_track_list.TrackCountWithoutAutoRepeat() || @@ -85,15 +83,15 @@ if (!old_style) return; - const ComputedStyle& new_style = StyleRef(); - const GridTrackList& new_grid_columns_track_sizes = - new_style.GridTemplateColumns().track_sizes; - const GridTrackList& new_grid_rows_track_sizes = - new_style.GridTemplateRows().track_sizes; + const auto& new_style = StyleRef(); + const auto& new_grid_columns_track_list = + new_style.GridTemplateColumns().TrackList(); + const auto& new_grid_rows_track_list = + new_style.GridTemplateRows().TrackList(); - if (new_grid_columns_track_sizes != - old_style->GridTemplateColumns().track_sizes || - new_grid_rows_track_sizes != old_style->GridTemplateRows().track_sizes || + if (new_grid_columns_track_list != + old_style->GridTemplateColumns().TrackList() || + new_grid_rows_track_list != old_style->GridTemplateRows().TrackList() || new_style.GridAutoColumns() != old_style->GridAutoColumns() || new_style.GridAutoRows() != old_style->GridAutoRows() || new_style.GetGridAutoFlow() != old_style->GetGridAutoFlow()) { @@ -103,8 +101,8 @@ if (ExplicitGridDidResize(new_style, *old_style) || NamedGridLinesDefinitionDidChange(new_style, *old_style) || (diff.NeedsLayout() && - (new_grid_columns_track_sizes.NGTrackList().AutoRepeatTrackCount() || - new_grid_rows_track_sizes.NGTrackList().AutoRepeatTrackCount()))) { + (new_grid_columns_track_list.AutoRepeatTrackCount() || + new_grid_rows_track_list.AutoRepeatTrackCount()))) { SetGridPlacementDirty(true); } } @@ -145,15 +143,10 @@ return 0; const bool is_for_columns = track_direction == kForColumns; - const wtf_size_t auto_repeat_size = is_for_columns - ? StyleRef() - .GridTemplateColumns() - .track_sizes.NGTrackList() - .AutoRepeatTrackCount() - : StyleRef() - .GridTemplateRows() - .track_sizes.NGTrackList() - .AutoRepeatTrackCount(); + const wtf_size_t auto_repeat_size = + is_for_columns + ? StyleRef().GridTemplateColumns().TrackList().AutoRepeatTrackCount() + : StyleRef().GridTemplateRows().TrackList().AutoRepeatTrackCount(); return auto_repeat_size * (is_for_columns ? cached_placement_data_->column_auto_repetitions
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_data.h b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_data.h index 583ab87..61f5ef3 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_data.h +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_data.h
@@ -60,8 +60,10 @@ } void CopyFrom(const NGGridLayoutData& other) { - columns = std::make_unique<NGGridLayoutTrackCollection>(*other.Columns()); - rows = std::make_unique<NGGridLayoutTrackCollection>(*other.Rows()); + if (other.columns) + columns = std::make_unique<NGGridLayoutTrackCollection>(*other.Columns()); + if (other.rows) + rows = std::make_unique<NGGridLayoutTrackCollection>(*other.Rows()); } NGGridLayoutTrackCollection* Columns() const {
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_item.h b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_item.h index 1ba31d6a..2f4bc4e 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_item.h +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_item.h
@@ -94,6 +94,15 @@ return resolved_position.SpanSize(track_direction); } + bool HasSubgriddedAxis(const GridTrackSizingDirection track_direction) const { + if (node.IsGrid()) { + return (track_direction == kForColumns) + ? node.Style().GridTemplateColumns().IsSubgriddedAxis() + : node.Style().GridTemplateRows().IsSubgriddedAxis(); + } + return false; + } + bool IsGridContainingBlock() const { return node.IsContainingBlockNGGrid(); } bool IsOutOfFlow() const { return node.IsOutOfFlowPositioned(); } @@ -154,8 +163,8 @@ NGAutoBehavior inline_auto_behavior; NGAutoBehavior block_auto_behavior; - BaselineType row_baseline_type; BaselineType column_baseline_type; + BaselineType row_baseline_type; TrackSpanProperties column_span_properties; TrackSpanProperties row_span_properties;
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc index 4559c0f2..66b7711 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
@@ -153,7 +153,7 @@ Vector<GridItemData*, 16> grid_items_spanning_multiple_ranges; for (auto& grid_item : grid_items->item_data) { - GridItemIndices range_indices = grid_item.RangeIndices(track_direction); + const auto& range_indices = grid_item.RangeIndices(track_direction); // If a grid item spans only one range, then we can just cache the track // span properties directly. On the contrary, if a grid item spans multiple @@ -1193,8 +1193,8 @@ const GridTrackSizingDirection track_direction) const { const NGGridTrackList& track_list = (track_direction == kForColumns) - ? Style().GridTemplateColumns().track_sizes.NGTrackList() - : Style().GridTemplateRows().track_sizes.NGTrackList(); + ? Style().GridTemplateColumns().TrackList() + : Style().GridTemplateRows().TrackList(); if (!track_list.HasAutoRepeater()) return 0; @@ -1413,7 +1413,7 @@ continue; LogicalRect unused_grid_area; - const auto space = CreateConstraintSpaceForLayout(layout_data, grid_item, + const auto space = CreateConstraintSpaceForLayout(grid_item, layout_data, &unused_grid_area); // We cannot apply some of the baseline alignment rules for synthesized @@ -2737,17 +2737,21 @@ const NGConstraintSpace NGGridLayoutAlgorithm::CreateConstraintSpace( const GridItemData& grid_item, + const NGGridLayoutData& layout_data, const LogicalSize& containing_grid_area_size, NGCacheSlot cache_slot, absl::optional<LayoutUnit> opt_fixed_block_size, absl::optional<LayoutUnit> opt_fragment_relative_block_offset, bool opt_min_block_size_should_encompass_intrinsic_size) const { + const auto& container_constraint_space = ConstraintSpace(); + NGConstraintSpaceBuilder builder( - ConstraintSpace(), grid_item.node.Style().GetWritingDirection(), + container_constraint_space, grid_item.node.Style().GetWritingDirection(), /* is_new_fc */ true, /* adjust_inline_size_if_needed */ false); builder.SetCacheSlot(cache_slot); builder.SetIsPaintedAtomically(true); + if (opt_fixed_block_size) { builder.SetAvailableSize( {containing_grid_area_size.inline_size, *opt_fixed_block_size}); @@ -2755,27 +2759,55 @@ } else { builder.SetAvailableSize(containing_grid_area_size); } + builder.SetPercentageResolutionSize(containing_grid_area_size); builder.SetInlineAutoBehavior(grid_item.inline_auto_behavior); builder.SetBlockAutoBehavior(grid_item.block_auto_behavior); - if (ConstraintSpace().HasBlockFragmentation() && + const bool is_grid_item_parallel = + IsParallelWritingMode(container_constraint_space.GetWritingMode(), + grid_item.node.Style().GetWritingMode()); + + if (grid_item.HasSubgriddedAxis(kForColumns)) { + const auto& range_indices = is_grid_item_parallel + ? grid_item.column_range_indices + : grid_item.row_range_indices; + const auto* track_collection = + is_grid_item_parallel ? layout_data.Columns() : layout_data.Rows(); + + builder.SetSubgriddedColumns(std::make_unique<NGGridLayoutTrackCollection>( + track_collection->CreateSubgridCollection(range_indices.begin, + range_indices.end))); + } + + if (grid_item.HasSubgriddedAxis(kForRows)) { + const auto& range_indices = is_grid_item_parallel + ? grid_item.row_range_indices + : grid_item.column_range_indices; + const auto* track_collection = + is_grid_item_parallel ? layout_data.Rows() : layout_data.Columns(); + + builder.SetSubgriddedRows(std::make_unique<NGGridLayoutTrackCollection>( + track_collection->CreateSubgridCollection(range_indices.begin, + range_indices.end))); + } + + if (container_constraint_space.HasBlockFragmentation() && opt_fragment_relative_block_offset) { if (opt_min_block_size_should_encompass_intrinsic_size) builder.SetMinBlockSizeShouldEncompassIntrinsicSize(); + SetupSpaceBuilderForFragmentation( - ConstraintSpace(), grid_item.node, *opt_fragment_relative_block_offset, - &builder, - /* is_new_fc */ true, + container_constraint_space, grid_item.node, + *opt_fragment_relative_block_offset, &builder, /* is_new_fc */ true, container_builder_.RequiresContentBeforeBreaking()); } - return builder.ToConstraintSpace(); } const NGConstraintSpace NGGridLayoutAlgorithm::CreateConstraintSpaceForLayout( - const NGGridLayoutData& layout_data, const GridItemData& grid_item, + const NGGridLayoutData& layout_data, LogicalRect* containing_grid_area, absl::optional<LayoutUnit> opt_fragment_relative_block_offset, bool opt_min_block_size_should_encompass_intrinsic_size) const { @@ -2788,7 +2820,7 @@ &containing_grid_area->size.block_size); return CreateConstraintSpace( - grid_item, containing_grid_area->size, NGCacheSlot::kLayout, + grid_item, layout_data, containing_grid_area->size, NGCacheSlot::kLayout, /* opt_fixed_block_size */ absl::nullopt, opt_fragment_relative_block_offset, opt_min_block_size_should_encompass_intrinsic_size); @@ -2811,8 +2843,9 @@ &unused_offset.inline_offset, &containing_grid_area_size.inline_size); } - return CreateConstraintSpace(grid_item, containing_grid_area_size, - NGCacheSlot::kMeasure, opt_fixed_block_size); + return CreateConstraintSpace(grid_item, layout_data, + containing_grid_area_size, NGCacheSlot::kMeasure, + opt_fixed_block_size); } namespace { @@ -2899,7 +2932,7 @@ for (const auto& grid_item : grid_items.item_data) { LogicalRect containing_grid_area; - const auto space = CreateConstraintSpaceForLayout(layout_data, grid_item, + const auto space = CreateConstraintSpaceForLayout(grid_item, layout_data, &containing_grid_area); const auto& item_style = grid_item.node.Style(); @@ -3126,7 +3159,7 @@ .has_descendant_that_depends_on_percentage_block_size); LogicalRect grid_area; const auto space = CreateConstraintSpaceForLayout( - *layout_data, grid_item, &grid_area, fragment_relative_block_offset, + grid_item, *layout_data, &grid_area, fragment_relative_block_offset, min_block_size_should_encompass_intrinsic_size); // Make the grid area relative to this fragment.
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.h b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.h index f31babfa..f618f907 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.h
@@ -147,6 +147,7 @@ const NGConstraintSpace CreateConstraintSpace( const GridItemData& grid_item, + const NGGridLayoutData& layout_data, const LogicalSize& containing_grid_area_size, NGCacheSlot cache_slot, absl::optional<LayoutUnit> opt_fixed_block_size, @@ -155,8 +156,8 @@ bool opt_min_block_size_should_encompass_intrinsic_size = false) const; const NGConstraintSpace CreateConstraintSpaceForLayout( - const NGGridLayoutData& layout_data, const GridItemData& grid_item, + const NGGridLayoutData& layout_data, LogicalRect* containing_grid_area, absl::optional<LayoutUnit> opt_fragment_relative_block_offset = absl::nullopt,
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_placement.cc b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_placement.cc index 0f0960d8a..70a69564 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_placement.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_placement.cc
@@ -46,14 +46,12 @@ : kForColumns), minor_direction_(grid_style.IsGridAutoFlowDirectionRow() ? kForColumns : kForRows), - column_auto_repeat_track_count_(grid_style.GridTemplateColumns() - .track_sizes.NGTrackList() - .AutoRepeatTrackCount() * - placement_data.column_auto_repetitions), - row_auto_repeat_track_count_(grid_style.GridTemplateRows() - .track_sizes.NGTrackList() - .AutoRepeatTrackCount() * - placement_data.row_auto_repetitions), + column_auto_repeat_track_count_( + grid_style.GridTemplateColumns().TrackList().AutoRepeatTrackCount() * + placement_data.column_auto_repetitions), + row_auto_repeat_track_count_( + grid_style.GridTemplateRows().TrackList().AutoRepeatTrackCount() * + placement_data.row_auto_repetitions), column_auto_repetitions_(placement_data.column_auto_repetitions), row_auto_repetitions_(placement_data.row_auto_repetitions), is_parent_grid_container_(placement_data.is_parent_grid_container),
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.cc b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.cc index d56606c..d43e033 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.cc
@@ -70,10 +70,9 @@ ? placement_data.column_start_offset : placement_data.row_start_offset), track_indices_need_sort_(false), - explicit_tracks_( - (track_direction == kForColumns) - ? grid_style.GridTemplateColumns().track_sizes.NGTrackList() - : grid_style.GridTemplateRows().track_sizes.NGTrackList()), + explicit_tracks_((track_direction == kForColumns) + ? grid_style.GridTemplateColumns().TrackList() + : grid_style.GridTemplateRows().TrackList()), implicit_tracks_((track_direction == kForColumns) ? grid_style.GridAutoColumns().NGTrackList() : grid_style.GridAutoRows().NGTrackList()) { @@ -455,6 +454,14 @@ return properties.HasProperty(TrackSpanProperties::kIsCollapsed); } +bool NGGridLayoutTrackCollection::operator==( + const NGGridLayoutTrackCollection& other) const { + return gutter_size_ == other.gutter_size_ && ranges_ == other.ranges_ && + major_baselines_ == other.minor_baselines_ && + major_baselines_ == other.minor_baselines_ && + sets_geometry_ == other.sets_geometry_; +} + wtf_size_t NGGridLayoutTrackCollection::RangeStartLine( wtf_size_t range_index) const { DCHECK_LT(range_index, ranges_.size()); @@ -563,6 +570,63 @@ return (set_span_size - gutter_size_).ClampNegativeToZero(); } +NGGridLayoutTrackCollection +NGGridLayoutTrackCollection::CreateSubgridCollection( + wtf_size_t begin_range_index, + wtf_size_t end_range_index) const { + DCHECK_LE(begin_range_index, end_range_index); + DCHECK_LT(end_range_index, ranges_.size()); + + NGGridLayoutTrackCollection subgrid_collection(Direction()); + subgrid_collection.ranges_.ReserveInitialCapacity(end_range_index - + begin_range_index); + + const wtf_size_t start_line_offset = ranges_[begin_range_index].start_line; + const wtf_size_t begin_set_index = ranges_[begin_range_index].begin_set_index; + + for (wtf_size_t i = begin_range_index; i < end_range_index; ++i) { + Range translated_range = ranges_[i]; + translated_range.start_line -= start_line_offset; + translated_range.begin_set_index -= begin_set_index; + subgrid_collection.ranges_.emplace_back(std::move(translated_range)); + } + + const wtf_size_t end_set_index = ranges_[end_range_index].begin_set_index + + ranges_[end_range_index].set_count; + + DCHECK_LT(begin_set_index, end_set_index); + DCHECK_LT(end_set_index, sets_geometry_.size()); + + const wtf_size_t set_span_size = end_set_index - begin_set_index; + const auto first_set_offset = sets_geometry_[begin_set_index].offset; + + subgrid_collection.sets_geometry_.ReserveInitialCapacity(set_span_size + 1); + subgrid_collection.sets_geometry_.emplace_back(/* offset */ LayoutUnit(), + /* track_count */ 0); + + for (wtf_size_t i = begin_set_index + 1; i <= end_set_index; ++i) { + subgrid_collection.sets_geometry_.emplace_back( + sets_geometry_[i].offset - first_set_offset, + sets_geometry_[i].track_count); + } + + if (!major_baselines_.IsEmpty()) { + DCHECK_LE(end_set_index, major_baselines_.size()); + DCHECK_LE(end_set_index, minor_baselines_.size()); + + subgrid_collection.major_baselines_.ReserveInitialCapacity(set_span_size); + subgrid_collection.minor_baselines_.ReserveInitialCapacity(set_span_size); + + for (wtf_size_t i = begin_set_index; i < end_set_index; ++i) { + subgrid_collection.major_baselines_.emplace_back(major_baselines_[i]); + subgrid_collection.minor_baselines_.emplace_back(minor_baselines_[i]); + } + } + + subgrid_collection.gutter_size_ = gutter_size_; + return subgrid_collection; +} + NGGridSizingTrackCollection::NGGridSizingTrackCollection( const NGGridBlockTrackCollection& block_track_collection, bool is_available_size_indefinite)
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.h b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.h index 3fabc3a2..dc4495a1 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.h +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_track_collection.h
@@ -174,6 +174,8 @@ virtual ~NGGridLayoutTrackCollection() = default; + bool operator==(const NGGridLayoutTrackCollection& other) const; + // NGGridTrackCollectionBase overrides. wtf_size_t RangeCount() const override { return ranges_.size(); } wtf_size_t RangeStartLine(wtf_size_t range_index) const override; @@ -210,6 +212,12 @@ LayoutUnit ComputeSetSpanSize(wtf_size_t begin_set_index, wtf_size_t end_set_index) const; + // Creates a track collection containing every |Range| with index in the range + // [begin, end], including their respective |SetGeometry| and baselines. + NGGridLayoutTrackCollection CreateSubgridCollection( + wtf_size_t begin_range_index, + wtf_size_t end_range_index) const; + LayoutUnit GutterSize() const { return gutter_size_; } const Vector<Range>& Ranges() const { return ranges_; }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h b/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h index a423fb30..c5e20ce 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h +++ b/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h
@@ -13,6 +13,7 @@ #include "third_party/blink/renderer/core/layout/ng/exclusions/ng_exclusion_space.h" #include "third_party/blink/renderer/core/layout/ng/geometry/ng_bfc_offset.h" #include "third_party/blink/renderer/core/layout/ng/geometry/ng_margin_strut.h" +#include "third_party/blink/renderer/core/layout/ng/grid/ng_grid_data.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_appeal.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/layout/ng/table/ng_table_constraint_space_data.h" @@ -805,7 +806,8 @@ kTableRowData, // A table-row (display: table-row). kTableSectionData, // A table-section (display: table-section). kCustomData, // A custom layout (display: layout(foo)). - kStretchData // The target inline/block stretch sizes for MathML. + kStretchData, // The target inline/block stretch sizes for MathML. + kSubgridData // A nested grid with subgridded columns/rows. }; explicit RareData(const NGBfcOffset bfc_offset) @@ -869,6 +871,9 @@ case kStretchData: new (&stretch_data_) StretchData(other.stretch_data_); break; + case kSubgridData: + new (&subgrid_data_) SubgridData(other.subgrid_data_); + break; default: NOTREACHED(); } @@ -895,6 +900,9 @@ case kStretchData: stretch_data_.~StretchData(); break; + case kSubgridData: + subgrid_data_.~SubgridData(); + break; default: NOTREACHED(); } @@ -931,6 +939,8 @@ return custom_data_.MaySkipLayout(other.custom_data_); case kStretchData: return stretch_data_.MaySkipLayout(other.stretch_data_); + case kSubgridData: + return subgrid_data_.MaySkipLayout(other.subgrid_data_); } NOTREACHED(); return false; @@ -962,6 +972,8 @@ return custom_data_.IsInitialForMaySkipLayout(); case kStretchData: return stretch_data_.IsInitialForMaySkipLayout(); + case kSubgridData: + return subgrid_data_.IsInitialForMaySkipLayout(); } NOTREACHED(); return false; @@ -1149,6 +1161,27 @@ target_stretch_block_sizes; } + const NGGridLayoutTrackCollection* SubgriddedColumns() { + return data_union_type == kSubgridData + ? subgrid_data_.layout_data.columns.get() + : nullptr; + } + + void SetSubgriddedColumns( + std::unique_ptr<NGGridLayoutTrackCollection> columns) { + EnsureSubgridData()->layout_data.columns = std::move(columns); + } + + const NGGridLayoutTrackCollection* SubgriddedRows() { + return data_union_type == kSubgridData + ? subgrid_data_.layout_data.rows.get() + : nullptr; + } + + void SetSubgriddedRows(std::unique_ptr<NGGridLayoutTrackCollection> rows) { + EnsureSubgridData()->layout_data.rows = std::move(rows); + } + LogicalSize percentage_resolution_size; LayoutUnit replaced_percentage_resolution_block_size; LayoutUnit block_start_annotation_space; @@ -1272,6 +1305,28 @@ absl::optional<MathTargetStretchBlockSizes> target_stretch_block_sizes; }; + struct SubgridData { + bool MaySkipLayout(const SubgridData& other) const { + const bool other_has_same_column_geometry = + (layout_data.columns && other.layout_data.columns) + ? *layout_data.Columns() == *other.layout_data.Columns() + : !layout_data.columns && !other.layout_data.columns; + + const bool other_has_same_row_geometry = + (layout_data.rows && other.layout_data.rows) + ? *layout_data.Rows() == *other.layout_data.Rows() + : !layout_data.rows && !other.layout_data.rows; + + return other_has_same_column_geometry && other_has_same_row_geometry; + } + + bool IsInitialForMaySkipLayout() const { + return !layout_data.columns && !layout_data.rows; + } + + NGGridLayoutData layout_data; + }; + BlockData* EnsureBlockData() { DCHECK(data_union_type == kNone || data_union_type == kBlockData); if (data_union_type != kBlockData) { @@ -1326,6 +1381,15 @@ return &stretch_data_; } + SubgridData* EnsureSubgridData() { + DCHECK(data_union_type == kNone || data_union_type == kSubgridData); + if (data_union_type != kSubgridData) { + data_union_type = kSubgridData; + new (&subgrid_data_) SubgridData(); + } + return &subgrid_data_; + } + union { BlockData block_data_; TableCellData table_cell_data_; @@ -1333,6 +1397,7 @@ TableSectionData table_section_data_; CustomData custom_data_; StretchData stretch_data_; + SubgridData subgrid_data_; }; };
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h b/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h index 0896552..95dab74 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h +++ b/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h
@@ -452,6 +452,23 @@ target_stretch_block_sizes); } + void SetSubgriddedColumns( + std::unique_ptr<NGGridLayoutTrackCollection> columns) { +#if DCHECK_IS_ON() + DCHECK(!is_subgridded_columns_set_); + is_subgridded_columns_set_ = true; +#endif + space_.EnsureRareData()->SetSubgriddedColumns(std::move(columns)); + } + + void SetSubgriddedRows(std::unique_ptr<NGGridLayoutTrackCollection> rows) { +#if DCHECK_IS_ON() + DCHECK(!is_subgridded_rows_set_); + is_subgridded_rows_set_ = true; +#endif + space_.EnsureRareData()->SetSubgriddedRows(std::move(rows)); + } + // Creates a new constraint space. const NGConstraintSpace ToConstraintSpace() { #if DCHECK_IS_ON() @@ -505,6 +522,8 @@ bool is_table_row_data_set_ = false; bool is_table_section_data_set_ = false; bool is_line_clamp_context_set_ = false; + bool is_subgridded_columns_set_ = false; + bool is_subgridded_rows_set_ = false; bool to_constraint_space_called_ = false; #endif
diff --git a/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc index 08a4b0d..66c7fbc 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc
@@ -75,9 +75,6 @@ container_builder_.SetIsPushedByFloats(); container_builder_.SetAdjoiningObjectTypes(result.AdjoiningObjectTypes()); - if (physical_fragment.LastBaseline()) - container_builder_.SetLastBaseline(*physical_fragment.LastBaseline()); - if (ConstraintSpace().IsTableCell()) { container_builder_.SetHasCollapsedBorders( physical_fragment.HasCollapsedBorders()); @@ -107,8 +104,6 @@ DCHECK(!result.IsPushedByFloats()); DCHECK_EQ(result.AdjoiningObjectTypes(), kAdjoiningNone); - DCHECK(!physical_fragment.LastBaseline()); - if (physical_fragment.IsFieldsetContainer()) container_builder_.SetIsFieldsetContainer(); @@ -149,8 +144,10 @@ if (physical_fragment.IsHiddenForPaint()) container_builder_.SetIsHiddenForPaint(true); - if (physical_fragment.Baseline()) - container_builder_.SetBaseline(*physical_fragment.Baseline()); + if (auto baseline = physical_fragment.Baseline()) + container_builder_.SetBaseline(*baseline); + if (auto last_baseline = physical_fragment.LastBaseline()) + container_builder_.SetLastBaseline(*last_baseline); if (physical_fragment.IsTableNGPart()) container_builder_.SetIsTableNGPart();
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_constraint_space_data.h b/third_party/blink/renderer/core/layout/ng/table/ng_table_constraint_space_data.h index 8e52337..2ebafdd2 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_constraint_space_data.h +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_constraint_space_data.h
@@ -42,22 +42,17 @@ LayoutUnit block_size, wtf_size_t start_cell_index, wtf_size_t cell_count, - bool has_baseline_aligned_percentage_block_size_descendants, bool is_collapsed) : baseline(baseline), block_size(block_size), start_cell_index(start_cell_index), cell_count(cell_count), - has_baseline_aligned_percentage_block_size_descendants( - has_baseline_aligned_percentage_block_size_descendants), is_collapsed(is_collapsed) {} bool MaySkipLayout(const Row& other) const { // We don't compare |start_cell_index| as this is allowed to change. return baseline == other.baseline && block_size == other.block_size && cell_count == other.cell_count && - has_baseline_aligned_percentage_block_size_descendants == - other.has_baseline_aligned_percentage_block_size_descendants && is_collapsed == other.is_collapsed; } @@ -65,7 +60,6 @@ const LayoutUnit block_size; const wtf_size_t start_cell_index; const wtf_size_t cell_count; - const bool has_baseline_aligned_percentage_block_size_descendants; const bool is_collapsed; }; @@ -74,20 +68,18 @@ Cell(NGBoxStrut borders, LayoutUnit rowspan_block_size, wtf_size_t start_column, - bool has_grown, - bool is_constrained) + bool is_initial_block_size_indefinite) : borders(borders), rowspan_block_size(rowspan_block_size), start_column(start_column), - has_grown(has_grown), - is_constrained(is_constrained) {} + is_initial_block_size_indefinite(is_initial_block_size_indefinite) {} bool operator==(const Cell& other) const { return borders == other.borders && rowspan_block_size == other.rowspan_block_size && start_column == other.start_column && - has_grown == other.has_grown && - is_constrained == other.is_constrained; + is_initial_block_size_indefinite == + other.is_initial_block_size_indefinite; } bool operator!=(const Cell& other) const { return !(*this == other); } @@ -96,8 +88,7 @@ // Size of the cell. Need this for cells that span multiple rows. const LayoutUnit rowspan_block_size; const wtf_size_t start_column; - const bool has_grown; - const bool is_constrained; + const bool is_initial_block_size_indefinite; }; bool IsTableSpecificDataEqual(const NGTableConstraintSpaceData& other) const {
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.cc index bdc5132..55b2821 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.cc
@@ -278,11 +278,12 @@ const NGTableTypes::Rows& rows, const NGTableTypes::CellBlockConstraints& cell_block_constraints, const LogicalSize& border_spacing) { + bool is_table_block_size_specified = !style.LogicalHeight().IsAuto(); scoped_refptr<NGTableConstraintSpaceData> data = base::MakeRefCounted<NGTableConstraintSpaceData>(); data->table_writing_direction = style.GetWritingDirection(); data->table_border_spacing = border_spacing; - data->is_table_block_size_specified = !style.LogicalHeight().IsAuto(); + data->is_table_block_size_specified = is_table_block_size_specified; data->has_collapsed_borders = style.BorderCollapse() == EBorderCollapse::kCollapse; data->column_locations = column_locations; @@ -292,10 +293,8 @@ data->sections.emplace_back(section.start_row, section.row_count); data->rows.ReserveCapacity(rows.size()); for (const auto& row : rows) { - data->rows.emplace_back( - row.baseline, row.block_size, row.start_cell_index, row.cell_count, - row.has_baseline_aligned_percentage_block_size_descendants, - row.is_collapsed); + data->rows.emplace_back(row.baseline, row.block_size, row.start_cell_index, + row.cell_count, row.is_collapsed); } data->cells.ReserveCapacity(cell_block_constraints.size()); // Traversing from section is necessary to limit cell's rowspan to the @@ -306,31 +305,20 @@ const auto& row = rows[row_index]; for (wtf_size_t cell_index = row.start_cell_index; cell_index < row.start_cell_index + row.cell_count; ++cell_index) { - const wtf_size_t effective_rowspan = - cell_block_constraints[cell_index].effective_rowspan; + const auto& cell_block_constraint = cell_block_constraints[cell_index]; + const auto [cell_block_size, is_initial_block_size_indefinite] = + NGTableAlgorithmUtils::ComputeCellBlockSize( + cell_block_constraint, rows, row_index, border_spacing, + is_table_block_size_specified); - // Determine the cell's block-size. - LayoutUnit cell_block_size; - for (wtf_size_t i = 0; i < effective_rowspan; ++i) { - if (rows[row_index + i].is_collapsed) - continue; - cell_block_size += rows[row_index + i].block_size; - if (i != 0) - cell_block_size += border_spacing.block_size; - } - - // Confusingly a rowspanned cell originating from a collapsed-row will - // have no block-size. LayoutUnit rowspan_block_size = - effective_rowspan > 1 && !row.is_collapsed ? cell_block_size - : kIndefiniteSize; + cell_block_constraint.effective_rowspan > 1 ? cell_block_size + : kIndefiniteSize; - data->cells.emplace_back( - cell_block_constraints[cell_index].borders, rowspan_block_size, - cell_block_constraints[cell_index].column_index, - /* has_grown */ cell_block_size > - cell_block_constraints[cell_index].min_block_size, - cell_block_constraints[cell_index].is_constrained); + data->cells.emplace_back(cell_block_constraint.borders, + rowspan_block_size, + cell_block_constraint.column_index, + is_initial_block_size_indefinite); } } } @@ -568,8 +556,8 @@ LayoutUnit minimal_table_grid_block_size; ComputeRows(table_inline_size_before_collapse - border_padding.InlineSum(), grouped_children, column_locations, *table_borders, - border_spacing, border_padding, captions_block_size, - is_fixed_layout, &rows, &cell_block_constraints, §ions, + border_spacing, border_padding, captions_block_size, &rows, + &cell_block_constraints, §ions, &minimal_table_grid_block_size); if (has_collapsed_columns) { @@ -659,7 +647,6 @@ const LogicalSize& border_spacing, const NGBoxStrut& table_border_padding, const LayoutUnit captions_block_size, - bool is_fixed, NGTableTypes::Rows* rows, NGTableTypes::CellBlockConstraints* cell_block_constraints, NGTableTypes::Sections* sections, @@ -715,9 +702,12 @@ } } - // Collapsed rows get 0 block-size, and shrink the minimum table size. - for (NGTableTypes::Row& row : *rows) { + bool recompute_row_baselines = false; + for (auto& row : *rows) { + // Collapsed rows get zero block-size, and shrink the minimum table size. if (row.is_collapsed) { + // TODO(ikilpatrick): As written |minimal_table_grid_block_size| can go + // negative. Investigate. if (*minimal_table_grid_block_size != LayoutUnit()) { *minimal_table_grid_block_size -= row.block_size; if (rows->size() > 1) @@ -725,8 +715,19 @@ } row.block_size = LayoutUnit(); } + + // Check if we need to perform a final pass. + recompute_row_baselines |= + row.has_baseline_aligned_percentage_block_size_descendants; } - minimal_table_grid_block_size->ClampNegativeToZero(); + + // There is at least one row which needs its baseline recomputed. + if (recompute_row_baselines) { + NGTableAlgorithmUtils::RecomputeRowBaselines( + grouped_children, column_locations, *cell_block_constraints, + border_spacing, Style().GetWritingDirection(), table_grid_inline_size, + is_table_block_size_specified, table_borders.IsCollapsed(), rows); + } } // Method also sets LogicalWidth/Height on columns.
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.h b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.h index d19db5bd..56ae37b 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm.h
@@ -63,7 +63,6 @@ const LogicalSize& border_spacing, const NGBoxStrut& table_border_padding, const LayoutUnit captions_block_size, - bool is_fixed_layout, NGTableTypes::Rows* rows, NGTableTypes::CellBlockConstraints* cell_block_constraints, NGTableTypes::Sections* sections,
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc index ca26523..f06d5d0b 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc
@@ -440,6 +440,38 @@ } // namespace // static +NGTableAlgorithmUtils::CellBlockSizeData +NGTableAlgorithmUtils::ComputeCellBlockSize( + const NGTableTypes::CellBlockConstraint& cell_block_constraint, + const NGTableTypes::Rows& rows, + wtf_size_t row_index, + const LogicalSize& border_spacing, + bool is_table_block_size_specified) { + // NOTE: Confusingly rowspanned cells originating from a collapsed-row also + // have no block-size. + LayoutUnit cell_block_size; + if (!rows[row_index].is_collapsed) { + for (wtf_size_t i = 0; i < cell_block_constraint.effective_rowspan; ++i) { + if (rows[row_index + i].is_collapsed) + continue; + cell_block_size += rows[row_index + i].block_size; + if (i != 0) + cell_block_size += border_spacing.block_size; + } + } + + bool has_grown = cell_block_size > cell_block_constraint.min_block_size; + + // Our initial block-size is definite if this cell has a fixed block-size, + // or we have grown and the table has a specified block-size. + bool is_initial_block_size_definite = + cell_block_constraint.is_constrained || + (has_grown && is_table_block_size_specified); + + return {cell_block_size, !is_initial_block_size_definite}; +} + +// static NGConstraintSpaceBuilder NGTableAlgorithmUtils::CreateTableCellConstraintSpaceBuilder( const WritingDirectionMode table_writing_direction, @@ -659,6 +691,67 @@ section_block_size, treat_section_as_tbody)); } +// static +void NGTableAlgorithmUtils::RecomputeRowBaselines( + const NGTableGroupedChildren& grouped_children, + const Vector<NGTableColumnLocation>& column_locations, + const NGTableTypes::CellBlockConstraints& cell_block_constraints, + const LogicalSize& border_spacing, + WritingDirectionMode table_writing_direction, + LayoutUnit cell_percentage_inline_size, + bool is_table_block_size_specified, + bool has_collapsed_borders, + NGTableTypes::Rows* rows) { + DCHECK(rows); + + wtf_size_t row_index = 0; + for (auto section : grouped_children) { + for (NGBlockNode row = To<NGBlockNode>(section.FirstChild()); row; + row = To<NGBlockNode>(row.NextSibling()), ++row_index) { + // Only recompute the baseline if we have a %-block-size descendant. + auto& row_data = rows->at(row_index); + if (!row_data.has_baseline_aligned_percentage_block_size_descendants) + continue; + + wtf_size_t cell_index = row_data.start_cell_index; + NGRowBaselineTabulator row_baseline_tabulator; + for (NGBlockNode cell = To<NGBlockNode>(row.FirstChild()); cell; + cell = To<NGBlockNode>(cell.NextSibling()), ++cell_index) { + const auto& cell_block_constraint = cell_block_constraints[cell_index]; + const auto [cell_block_size, is_initial_block_size_indefinite] = + ComputeCellBlockSize(cell_block_constraint, *rows, row_index, + border_spacing, is_table_block_size_specified); + + // This constraint space is almost identical to the final space which + // we use in the row layout algorithm. Due to this we use the layout + // cache-slot instead of the measure cache-slot. + const auto cell_space = + NGTableAlgorithmUtils::CreateTableCellConstraintSpaceBuilder( + table_writing_direction, cell, cell_block_constraint.borders, + column_locations, cell_block_size, cell_percentage_inline_size, + /* row_baseline */ absl::nullopt, + cell_block_constraint.column_index, + is_initial_block_size_indefinite, is_table_block_size_specified, + has_collapsed_borders, NGCacheSlot::kLayout) + .ToConstraintSpace(); + const NGLayoutResult* layout_result = cell.Layout(cell_space); + + const NGBoxFragment fragment( + table_writing_direction, + To<NGPhysicalBoxFragment>(layout_result->PhysicalFragment())); + row_baseline_tabulator.ProcessCell( + fragment, + NGTableAlgorithmUtils::IsBaseline(cell.Style().VerticalAlign()), + cell_block_constraint.effective_rowspan != 1, + layout_result->HasDescendantThatDependsOnPercentageBlockSize()); + } + + row_data.baseline = + row_baseline_tabulator.ComputeBaseline(row_data.block_size); + } + } +} + void NGColspanCellTabulator::StartRow() { current_column_ = 0; }
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.h b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.h index 0337dc7c..8554183 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.h +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.h
@@ -29,6 +29,19 @@ align == EVerticalAlign::kLength; } + // Computes a cell's block-size, and if its initial block-size should be + // considered indefinite. + struct CellBlockSizeData { + LayoutUnit block_size; + bool is_initial_block_size_indefinite; + }; + static CellBlockSizeData ComputeCellBlockSize( + const NGTableTypes::CellBlockConstraint& cell_block_constraint, + const NGTableTypes::Rows& rows, + wtf_size_t row_index, + const LogicalSize& border_spacing, + bool is_table_block_size_specified); + // Creates a constraint space builder for a table-cell. // // In order to make the cache as effective as possible, we try and keep @@ -69,6 +82,19 @@ NGTableTypes::Sections* sections, NGTableTypes::Rows* rows, NGTableTypes::CellBlockConstraints* cell_block_constraints); + + // Recalculates any row baselines if needed. Rows which contain %-block-size + // descendants may shift their baseline once we have the final row geometry. + static void RecomputeRowBaselines( + const NGTableGroupedChildren&, + const Vector<NGTableColumnLocation>&, + const NGTableTypes::CellBlockConstraints&, + const LogicalSize& border_spacing, + WritingDirectionMode table_writing_direction, + LayoutUnit cell_percentage_inline_size, + bool is_table_block_size_specified, + bool has_collapsed_borders, + NGTableTypes::Rows*); }; // NGColspanCellTabulator keeps track of columns occupied by colspanned cells
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc index 3e6fdc2..7e21dd7 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc
@@ -27,30 +27,22 @@ auto CreateCellConstraintSpace = [this, &row, &table_data]( NGBlockNode cell, const NGTableConstraintSpaceData::Cell& - cell_data, - absl::optional<LayoutUnit> row_baseline, - bool use_block_fragmentation = false) { + cell_data) { const LayoutUnit cell_block_size = cell_data.rowspan_block_size != kIndefiniteSize ? cell_data.rowspan_block_size : row.block_size; - // Our initial block-size is definite if this cell has a fixed block-size, - // or we have grown and the table has a specified block-size. - const bool is_initial_block_size_definite = - cell_data.is_constrained || - (cell_data.has_grown && table_data.is_table_block_size_specified); - NGConstraintSpaceBuilder builder = NGTableAlgorithmUtils::CreateTableCellConstraintSpaceBuilder( table_data.table_writing_direction, cell, cell_data.borders, table_data.column_locations, cell_block_size, - container_builder_.InlineSize(), row_baseline, - cell_data.start_column, !is_initial_block_size_definite, + container_builder_.InlineSize(), row.baseline, + cell_data.start_column, cell_data.is_initial_block_size_indefinite, table_data.is_table_block_size_specified, table_data.has_collapsed_borders, NGCacheSlot::kLayout); - if (use_block_fragmentation) { + if (ConstraintSpace().HasBlockFragmentation()) { SetupSpaceBuilderForFragmentation( ConstraintSpace(), cell, /* fragmentainer_offset_delta */ LayoutUnit(), &builder, @@ -61,33 +53,6 @@ return builder.ToConstraintSpace(); }; - // A cell with perecentage block-size descendants can layout with size that - // differs from its intrinsic size. This might cause row baseline to move, if - // cell was baseline-aligned. - // To compute correct baseline, we need to do an initial layout pass. - LayoutUnit row_baseline = row.baseline; - if (row.has_baseline_aligned_percentage_block_size_descendants) { - wtf_size_t cell_index = row.start_cell_index; - NGRowBaselineTabulator row_baseline_tabulator; - for (NGBlockNode cell = To<NGBlockNode>(Node().FirstChild()); cell; - cell = To<NGBlockNode>(cell.NextSibling()), ++cell_index) { - const NGTableConstraintSpaceData::Cell& cell_data = - table_data.cells[cell_index]; - NGConstraintSpace cell_constraint_space = - CreateCellConstraintSpace(cell, cell_data, absl::nullopt); - const NGLayoutResult* layout_result = cell.Layout(cell_constraint_space); - NGBoxFragment fragment( - table_data.table_writing_direction, - To<NGPhysicalBoxFragment>(layout_result->PhysicalFragment())); - row_baseline_tabulator.ProcessCell( - fragment, - NGTableAlgorithmUtils::IsBaseline(cell.Style().VerticalAlign()), - cell.TableCellRowspan() > 1, - layout_result->HasDescendantThatDependsOnPercentageBlockSize()); - } - row_baseline = row_baseline_tabulator.ComputeBaseline(row.block_size); - } - bool should_propagate_child_break_values = ConstraintSpace().ShouldPropagateChildBreakValues(); EBreakBetween row_break_before = EBreakBetween::kAuto; @@ -106,8 +71,7 @@ const NGTableConstraintSpaceData::Cell& cell_data = table_data.cells[cell_index]; NGConstraintSpace cell_constraint_space = - CreateCellConstraintSpace(cell, cell_data, row_baseline, - ConstraintSpace().HasBlockFragmentation()); + CreateCellConstraintSpace(cell, cell_data); const NGLayoutResult* cell_result = cell.Layout(cell_constraint_space, cell_break_token);
diff --git a/third_party/blink/renderer/core/loader/link_loader.cc b/third_party/blink/renderer/core/loader/link_loader.cc index ee26e87..881b99bd 100644 --- a/third_party/blink/renderer/core/loader/link_loader.cc +++ b/third_party/blink/renderer/core/loader/link_loader.cc
@@ -162,6 +162,18 @@ if (!client_->ShouldLoadLink()) return false; + if (RenderBlockingResourceManager* manager = + document.GetRenderBlockingResourceManager()) { + if (client_->IsRenderBlockingPreload()) { + manager->AddPendingPreload( + *client_, RenderBlockingResourceManager::PreloadType::kRegular); + } else if (client_->IsFontPreload()) { + manager->AddPendingPreload( + *client_, + RenderBlockingResourceManager::PreloadType::kShortBlockingFont); + } + } + PreloadHelper::DnsPrefetchIfNeeded(params, &document, document.GetFrame(), PreloadHelper::kLinkCalledFromMarkup);
diff --git a/third_party/blink/renderer/core/loader/link_loader_client.h b/third_party/blink/renderer/core/loader/link_loader_client.h index 0dbb916f..4525441 100644 --- a/third_party/blink/renderer/core/loader/link_loader_client.h +++ b/third_party/blink/renderer/core/loader/link_loader_client.h
@@ -45,6 +45,12 @@ virtual bool ShouldLoadLink() = 0; + // Returns true if the link is a render-blocking preload or modulepreload. + // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#render-blocking + virtual bool IsRenderBlockingPreload() const = 0; + + virtual bool IsFontPreload() const = 0; + virtual void LinkLoaded() = 0; virtual void LinkLoadingErrored() = 0; // There is no notification for cancellation.
diff --git a/third_party/blink/renderer/core/loader/link_loader_test.cc b/third_party/blink/renderer/core/loader/link_loader_test.cc index 6bf1b0f..3f5f008 100644 --- a/third_party/blink/renderer/core/loader/link_loader_test.cc +++ b/third_party/blink/renderer/core/loader/link_loader_test.cc
@@ -50,6 +50,9 @@ bool ShouldLoadLink() override { return should_load_; } bool IsLinkCreatedByParser() override { return true; } + bool IsRenderBlockingPreload() const override { return false; } + bool IsFontPreload() const override { return false; } + void LinkLoaded() override {} void LinkLoadingErrored() override {}
diff --git a/third_party/blink/renderer/core/loader/preload_helper.cc b/third_party/blink/renderer/core/loader/preload_helper.cc index da5f551..adada160 100644 --- a/third_party/blink/renderer/core/loader/preload_helper.cc +++ b/third_party/blink/renderer/core/loader/preload_helper.cc
@@ -712,10 +712,6 @@ break; case ResourceType::kFont: resource = FontResource::Fetch(params, resource_fetcher, nullptr); - if (document.GetRenderBlockingResourceManager()) { - document.GetRenderBlockingResourceManager()->FontPreloadingStarted( - To<FontResource>(resource)); - } break; case ResourceType::kAudio: case ResourceType::kVideo:
diff --git a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc index f232e8e0..23c6505 100644 --- a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc +++ b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.cc
@@ -4,15 +4,11 @@ #include "third_party/blink/renderer/core/loader/render_blocking_resource_manager.h" -#include "build/build_config.h" -#include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/core/css/font_face.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/html/html_document.h" -#include "third_party/blink/renderer/core/loader/document_loader.h" -#include "third_party/blink/renderer/core/loader/resource/font_resource.h" +#include "third_party/blink/renderer/core/loader/link_loader_client.h" #include "third_party/blink/renderer/core/script/script_element_base.h" -#include "third_party/blink/renderer/platform/loader/fetch/resource_finish_observer.h" namespace blink { @@ -21,32 +17,6 @@ // 50ms is the overall best performing value in our experiments. const base::TimeDelta kMaxRenderingDelay = base::Milliseconds(50); -class FontPreloadFinishObserver final : public ResourceFinishObserver { - public: - FontPreloadFinishObserver(FontResource& font_resource, Document& document) - : font_resource_(font_resource), document_(document) {} - - ~FontPreloadFinishObserver() final = default; - - void Trace(blink::Visitor* visitor) const final { - visitor->Trace(font_resource_); - visitor->Trace(document_); - ResourceFinishObserver::Trace(visitor); - } - - private: - void NotifyFinished() final { - DCHECK(document_->GetRenderBlockingResourceManager()); - document_->GetRenderBlockingResourceManager()->FontPreloadingFinished( - font_resource_, this); - } - - String DebugName() const final { return "FontPreloadFinishObserver"; } - - Member<FontResource> font_resource_; - Member<Document> document_; -}; - class ImperativeFontLoadFinishedCallback final : public GarbageCollected<ImperativeFontLoadFinishedCallback>, public FontFace::LoadFontCallback { @@ -86,25 +56,20 @@ &RenderBlockingResourceManager::FontPreloadingTimerFired), font_preload_timeout_(kMaxRenderingDelay) {} -void RenderBlockingResourceManager::FontPreloadingStarted( - FontResource* font_resource) { - // The font is either already in the memory cache, or has errored out. In - // either case, we don't any further processing. - if (font_resource->IsLoaded()) +void RenderBlockingResourceManager::AddPendingPreload( + const LinkLoaderClient& link, + PreloadType type) { + if (type == PreloadType::kShortBlockingFont && font_preload_timer_has_fired_) return; - if (font_preload_timer_has_fired_ || document_->body()) + if (document_->body()) return; - FontPreloadFinishObserver* observer = - MakeGarbageCollected<FontPreloadFinishObserver>(*font_resource, - *document_); - font_resource->AddFinishObserver( - observer, document_->GetTaskRunner(TaskType::kInternalLoading).get()); - font_preload_finish_observers_.insert(observer); - - if (!font_preload_timer_.IsActive()) - font_preload_timer_.StartOneShot(font_preload_timeout_, FROM_HERE); + pending_preloads_.insert(&link, type); + if (type == PreloadType::kShortBlockingFont) { + if (!font_preload_timer_.IsActive()) + font_preload_timer_.StartOneShot(font_preload_timeout_, FROM_HERE); + } } void RenderBlockingResourceManager::ImperativeFontLoadingStarted( @@ -124,13 +89,12 @@ font_preload_timer_.StartOneShot(font_preload_timeout_, FROM_HERE); } -void RenderBlockingResourceManager::FontPreloadingFinished( - FontResource* font_resource, - ResourceFinishObserver* observer) { - if (font_preload_timer_has_fired_) +void RenderBlockingResourceManager::RemovePendingPreload( + const LinkLoaderClient& link) { + auto iter = pending_preloads_.find(&link); + if (iter == pending_preloads_.end()) return; - DCHECK(font_preload_finish_observers_.Contains(observer)); - font_preload_finish_observers_.erase(observer); + pending_preloads_.erase(iter); document_->RenderBlockingResourceUnblocked(); } @@ -144,7 +108,12 @@ void RenderBlockingResourceManager::FontPreloadingTimerFired(TimerBase*) { font_preload_timer_has_fired_ = true; - font_preload_finish_observers_.clear(); + VectorOf<const LinkLoaderClient> short_blocking_font_preloads; + for (auto preload_and_type : pending_preloads_) { + if (preload_and_type.value == PreloadType::kShortBlockingFont) + short_blocking_font_preloads.push_back(preload_and_type.key); + } + pending_preloads_.RemoveAll(short_blocking_font_preloads); imperative_font_loading_count_ = 0; document_->RenderBlockingResourceUnblocked(); } @@ -202,7 +171,7 @@ visitor->Trace(document_); visitor->Trace(pending_stylesheet_owner_nodes_); visitor->Trace(pending_scripts_); - visitor->Trace(font_preload_finish_observers_); + visitor->Trace(pending_preloads_); visitor->Trace(font_preload_timer_); }
diff --git a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h index dbabefd3..da3d5bc 100644 --- a/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h +++ b/third_party/blink/renderer/core/loader/render_blocking_resource_manager.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LOADER_RENDER_BLOCKING_RESOURCE_MANAGER_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/timer.h" @@ -13,10 +14,9 @@ namespace blink { class Document; -class FontResource; class FontFace; +class LinkLoaderClient; class Node; -class ResourceFinishObserver; class ScriptElementBase; // https://html.spec.whatwg.org/#render-blocking-mechanism with some extensions. @@ -32,12 +32,9 @@ bool HasRenderBlockingResources() const { return pending_stylesheet_owner_nodes_.size() || pending_scripts_.size() || - font_preload_finish_observers_.size() || - imperative_font_loading_count_; + pending_preloads_.size() || imperative_font_loading_count_; } - // TODO(crbug.com/1271296): Use this class to handle render-blocking preloads. - bool HasPendingStylesheets() const { return pending_stylesheet_owner_nodes_.size(); } @@ -55,8 +52,11 @@ // Loading API) to block rendering for a short period, so that preloaded fonts // have a higher chance to be used by the first paint. // Design doc: https://bit.ly/36E8UKB - void FontPreloadingStarted(FontResource*); - void FontPreloadingFinished(FontResource*, ResourceFinishObserver*); + enum class PreloadType { kRegular, kShortBlockingFont }; + void AddPendingPreload(const LinkLoaderClient& link, PreloadType type); + void RemovePendingPreload(const LinkLoaderClient& link); + + // TODO(xiaochengh): Rename these methods to be consistent with the others. void FontPreloadingTimerFired(TimerBase*); void ImperativeFontLoadingStarted(FontFace*); void ImperativeFontLoadingFinished(); @@ -77,14 +77,15 @@ // directly included in this set. See: // https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet // https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block - HeapHashSet<Member<const Node>> pending_stylesheet_owner_nodes_; + HeapHashSet<WeakMember<const Node>> pending_stylesheet_owner_nodes_; // Tracks the currently pending render-blocking script elements. - HeapHashSet<Member<const ScriptElementBase>> pending_scripts_; + HeapHashSet<WeakMember<const ScriptElementBase>> pending_scripts_; - // Need to hold strong references here, otherwise they'll be GC-ed immediately - // as Resource only holds weak references. - HeapHashSet<Member<ResourceFinishObserver>> font_preload_finish_observers_; + // Tracks the currently pending render-blocking preload and modulepreload + // links, including short-blocking font preloads. + HeapHashMap<WeakMember<const LinkLoaderClient>, PreloadType> + pending_preloads_; unsigned imperative_font_loading_count_ = 0;
diff --git a/third_party/blink/renderer/core/navigation_api/navigate_event.idl b/third_party/blink/renderer/core/navigation_api/navigate_event.idl index 09a91140..96e244c 100644 --- a/third_party/blink/renderer/core/navigation_api/navigate_event.idl +++ b/third_party/blink/renderer/core/navigation_api/navigate_event.idl
@@ -5,7 +5,7 @@ // https://wicg.github.io/navigation-api/ [ Exposed=Window, - RuntimeEnabled=AppHistory + RuntimeEnabled=NavigationApi ] interface NavigateEvent : Event { [CallWith=ExecutionContext] constructor(DOMString type, NavigateEventInit eventInit);
diff --git a/third_party/blink/renderer/core/navigation_api/navigation.idl b/third_party/blink/renderer/core/navigation_api/navigation.idl index 3a29669..e894b02 100644 --- a/third_party/blink/renderer/core/navigation_api/navigation.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation.idl
@@ -5,7 +5,7 @@ // https://wicg.github.io/navigation-api/ [ Exposed=Window, - RuntimeEnabled=AppHistory, + RuntimeEnabled=NavigationApi, ImplementedAs=NavigationApi ] interface Navigation : EventTarget { readonly attribute NavigationHistoryEntry? currentEntry;
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_api.cc b/third_party/blink/renderer/core/navigation_api/navigation_api.cc index d6050ca..e67661d0f 100644 --- a/third_party/blink/renderer/core/navigation_api/navigation_api.cc +++ b/third_party/blink/renderer/core/navigation_api/navigation_api.cc
@@ -177,8 +177,8 @@ const char NavigationApi::kSupplementName[] = "NavigationApi"; NavigationApi* NavigationApi::navigation(LocalDOMWindow& window) { - return RuntimeEnabledFeatures::AppHistoryEnabled(&window) ? From(window) - : nullptr; + return RuntimeEnabledFeatures::NavigationApiEnabled(&window) ? From(window) + : nullptr; } NavigationApi* NavigationApi::From(LocalDOMWindow& window) {
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl index b757e47..3dd6691 100644 --- a/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_current_entry_change_event.idl
@@ -5,7 +5,7 @@ // https://wicg.github.io/navigation-api/ [ Exposed=Window, - RuntimeEnabled=AppHistory + RuntimeEnabled=NavigationApi ] interface NavigationCurrentEntryChangeEvent : Event { constructor(DOMString type, NavigationCurrentEntryChangeEventInit eventInit); readonly attribute NavigationNavigationType? navigationType;
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_destination.idl b/third_party/blink/renderer/core/navigation_api/navigation_destination.idl index 2e422e06..464e0ba 100644 --- a/third_party/blink/renderer/core/navigation_api/navigation_destination.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_destination.idl
@@ -5,7 +5,7 @@ // https://wicg.github.io/navigation-api/ [ Exposed=Window, - RuntimeEnabled=AppHistory + RuntimeEnabled=NavigationApi ] interface NavigationDestination { readonly attribute DOMString? key; readonly attribute DOMString? id;
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl index 85f1f2b..1fd6997 100644 --- a/third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_history_entry.idl
@@ -5,7 +5,7 @@ // https://wicg.github.io/navigation-api/ [ Exposed=Window, - RuntimeEnabled=AppHistory + RuntimeEnabled=NavigationApi ] interface NavigationHistoryEntry : EventTarget { readonly attribute DOMString key; readonly attribute DOMString id;
diff --git a/third_party/blink/renderer/core/navigation_api/navigation_transition.idl b/third_party/blink/renderer/core/navigation_api/navigation_transition.idl index 2b4c8fd..4cf295a 100644 --- a/third_party/blink/renderer/core/navigation_api/navigation_transition.idl +++ b/third_party/blink/renderer/core/navigation_api/navigation_transition.idl
@@ -1,5 +1,5 @@ [Exposed=Window, - RuntimeEnabled=AppHistory] + RuntimeEnabled=NavigationApi] interface NavigationTransition { readonly attribute NavigationNavigationType navigationType; readonly attribute NavigationHistoryEntry from;
diff --git a/third_party/blink/renderer/core/navigation_api/window_navigation.idl b/third_party/blink/renderer/core/navigation_api/window_navigation.idl index c5b1809..6e96c15 100644 --- a/third_party/blink/renderer/core/navigation_api/window_navigation.idl +++ b/third_party/blink/renderer/core/navigation_api/window_navigation.idl
@@ -6,5 +6,5 @@ [ ImplementedAs=NavigationApi ] partial interface Window { - [RuntimeEnabled=AppHistory, Replaceable] readonly attribute Navigation navigation; + [RuntimeEnabled=NavigationApi, Replaceable] readonly attribute Navigation navigation; };
diff --git a/third_party/blink/renderer/core/style/computed_grid_track_list.h b/third_party/blink/renderer/core/style/computed_grid_track_list.h index cdc67757..5dfa71d0 100644 --- a/third_party/blink/renderer/core/style/computed_grid_track_list.h +++ b/third_party/blink/renderer/core/style/computed_grid_track_list.h
@@ -28,8 +28,8 @@ ordered_named_grid_lines == other.ordered_named_grid_lines && auto_repeat_ordered_named_grid_lines == other.auto_repeat_ordered_named_grid_lines && - auto_repeat_type == other.auto_repeat_type && auto_repeat_insertion_point == other.auto_repeat_insertion_point && + auto_repeat_type == other.auto_repeat_type && axis_type == other.axis_type; } @@ -37,16 +37,23 @@ return !(*this == other); } + bool IsSubgriddedAxis() const { + return axis_type == GridAxisType::kSubgriddedAxis; + } + + const NGGridTrackList& TrackList() const { return track_sizes.NGTrackList(); } + GridTrackList track_sizes; Vector<GridTrackSize, 1> auto_repeat_track_sizes; + NamedGridLinesMap named_grid_lines; NamedGridLinesMap auto_repeat_named_grid_lines; OrderedNamedGridLines ordered_named_grid_lines; OrderedNamedGridLines auto_repeat_ordered_named_grid_lines; - GridAxisType axis_type = GridAxisType::kStandaloneAxis; - AutoRepeatType auto_repeat_type = AutoRepeatType::kNoAutoRepeat; - wtf_size_t auto_repeat_insertion_point = 0; + wtf_size_t auto_repeat_insertion_point{0}; + AutoRepeatType auto_repeat_type{AutoRepeatType::kNoAutoRepeat}; + GridAxisType axis_type{GridAxisType::kStandaloneAxis}; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/style/grid_positions_resolver.cc b/third_party/blink/renderer/core/style/grid_positions_resolver.cc index f8a43976..368b7b0 100644 --- a/third_party/blink/renderer/core/style/grid_positions_resolver.cc +++ b/third_party/blink/renderer/core/style/grid_positions_resolver.cc
@@ -74,8 +74,7 @@ insertion_point_ = computed_grid_track_list.auto_repeat_insertion_point; auto_repeat_track_list_length_ = - is_ng_grid ? computed_grid_track_list.track_sizes.NGTrackList() - .AutoRepeatTrackCount() + is_ng_grid ? computed_grid_track_list.TrackList().AutoRepeatTrackCount() : computed_grid_track_list.auto_repeat_track_sizes.size(); }
diff --git a/third_party/blink/renderer/core/style/grid_track_list.h b/third_party/blink/renderer/core/style/grid_track_list.h index 8526ef0..42ce0420 100644 --- a/third_party/blink/renderer/core/style/grid_track_list.h +++ b/third_party/blink/renderer/core/style/grid_track_list.h
@@ -78,6 +78,7 @@ void operator=(const NGGridTrackList& o); bool operator==(const NGGridTrackList& o) const; + bool operator!=(const NGGridTrackList& o) const { return !(*this == o); } private: // Returns the amount of tracks available before overflow.
diff --git a/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc b/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc index 69bfdc88..a0d1d72 100644 --- a/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc +++ b/third_party/blink/renderer/modules/webgpu/dawn_conversions.cc
@@ -141,8 +141,7 @@ return dawn_origin; } -WGPUImageCopyTexture AsDawnType(const GPUImageCopyTexture* webgpu_view, - GPUDevice* device) { +WGPUImageCopyTexture AsDawnType(const GPUImageCopyTexture* webgpu_view) { DCHECK(webgpu_view); DCHECK(webgpu_view->texture());
diff --git a/third_party/blink/renderer/modules/webgpu/dawn_conversions.h b/third_party/blink/renderer/modules/webgpu/dawn_conversions.h index d18c1ee..f97f602 100644 --- a/third_party/blink/renderer/modules/webgpu/dawn_conversions.h +++ b/third_party/blink/renderer/modules/webgpu/dawn_conversions.h
@@ -34,8 +34,7 @@ WGPUColor AsDawnType(const V8GPUColor* webgpu_color); WGPUExtent3D AsDawnType(const V8GPUExtent3D* webgpu_extent); WGPUOrigin3D AsDawnType(const V8GPUOrigin3D* webgpu_extent); -WGPUImageCopyTexture AsDawnType(const GPUImageCopyTexture* webgpu_view, - GPUDevice* device); +WGPUImageCopyTexture AsDawnType(const GPUImageCopyTexture* webgpu_view); WGPUTextureFormat AsDawnType(SkColorType color_type); const char* ValidateTextureDataLayout(const GPUImageDataLayout* webgpu_layout,
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.cc b/third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.cc index 03aaf14..4346fccd 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_bind_group_layout.cc
@@ -19,7 +19,6 @@ WGPUBindGroupLayoutEntry AsDawnType( const GPUBindGroupLayoutEntry* webgpu_binding, - GPUDevice* device, Vector<std::unique_ptr<WGPUExternalTextureBindingLayout>>* externalTextureBindingLayouts) { WGPUBindGroupLayoutEntry dawn_binding = {}; @@ -79,15 +78,14 @@ // TODO(crbug.com/1069302): Remove when unused. std::unique_ptr<WGPUBindGroupLayoutEntry[]> AsDawnType( const HeapVector<Member<GPUBindGroupLayoutEntry>>& webgpu_objects, - GPUDevice* device, Vector<std::unique_ptr<WGPUExternalTextureBindingLayout>>* externalTextureBindingLayouts) { wtf_size_t count = webgpu_objects.size(); std::unique_ptr<WGPUBindGroupLayoutEntry[]> dawn_objects( new WGPUBindGroupLayoutEntry[count]); for (wtf_size_t i = 0; i < count; ++i) { - dawn_objects[i] = AsDawnType(webgpu_objects[i].Get(), device, - externalTextureBindingLayouts); + dawn_objects[i] = + AsDawnType(webgpu_objects[i].Get(), externalTextureBindingLayouts); } return dawn_objects; } @@ -106,8 +104,8 @@ externalTextureBindingLayouts; entry_count = static_cast<uint32_t>(webgpu_desc->entries().size()); if (entry_count > 0) { - entries = AsDawnType(webgpu_desc->entries(), device, - &externalTextureBindingLayouts); + entries = + AsDawnType(webgpu_desc->entries(), &externalTextureBindingLayouts); } std::string label;
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc index f034195..de22be6 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_command_encoder.cc
@@ -307,7 +307,7 @@ GPUImageCopyTexture* destination, const V8GPUExtent3D* copy_size) { WGPUExtent3D dawn_copy_size = AsDawnType(copy_size); - WGPUImageCopyTexture dawn_destination = AsDawnType(destination, device_); + WGPUImageCopyTexture dawn_destination = AsDawnType(destination); const char* error = nullptr; WGPUImageCopyBuffer dawn_source = @@ -325,7 +325,7 @@ GPUImageCopyBuffer* destination, const V8GPUExtent3D* copy_size) { WGPUExtent3D dawn_copy_size = AsDawnType(copy_size); - WGPUImageCopyTexture dawn_source = AsDawnType(source, device_); + WGPUImageCopyTexture dawn_source = AsDawnType(source); const char* error = nullptr; WGPUImageCopyBuffer dawn_destination = @@ -342,8 +342,8 @@ void GPUCommandEncoder::copyTextureToTexture(GPUImageCopyTexture* source, GPUImageCopyTexture* destination, const V8GPUExtent3D* copy_size) { - WGPUImageCopyTexture dawn_source = AsDawnType(source, device_); - WGPUImageCopyTexture dawn_destination = AsDawnType(destination, device_); + WGPUImageCopyTexture dawn_source = AsDawnType(source); + WGPUImageCopyTexture dawn_destination = AsDawnType(destination); WGPUExtent3D dawn_copy_size = AsDawnType(copy_size); GetProcs().commandEncoderCopyTextureToTexture(
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.cc b/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.cc index 37f1869c..d27a649 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.cc
@@ -16,8 +16,7 @@ WGPUComputePipelineDescriptor AsDawnType( const GPUComputePipelineDescriptor* webgpu_desc, std::string* label, - OwnedProgrammableStageDescriptor* computeStageDescriptor, - GPUDevice* device) { + OwnedProgrammableStageDescriptor* computeStageDescriptor) { DCHECK(webgpu_desc); DCHECK(label); DCHECK(computeStageDescriptor); @@ -48,7 +47,7 @@ std::string label; OwnedProgrammableStageDescriptor computeStageDescriptor; WGPUComputePipelineDescriptor dawn_desc = - AsDawnType(webgpu_desc, &label, &computeStageDescriptor, device); + AsDawnType(webgpu_desc, &label, &computeStageDescriptor); GPUComputePipeline* pipeline = MakeGarbageCollected<GPUComputePipeline>( device, device->GetProcs().deviceCreateComputePipeline(
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.h b/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.h index 08bb6a8c..552590a 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.h +++ b/third_party/blink/renderer/modules/webgpu/gpu_compute_pipeline.h
@@ -16,8 +16,7 @@ WGPUComputePipelineDescriptor AsDawnType( const GPUComputePipelineDescriptor* webgpu_desc, std::string* label, - OwnedProgrammableStageDescriptor* computeStageDescriptor, - GPUDevice* device); + OwnedProgrammableStageDescriptor* computeStageDescriptor); class GPUComputePipeline : public DawnObject<WGPUComputePipeline> { DEFINE_WRAPPERTYPEINFO();
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_device.cc b/third_party/blink/renderer/modules/webgpu/gpu_device.cc index d12e6c1..b749ea8 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_device.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_device.cc
@@ -381,7 +381,7 @@ std::string label; OwnedProgrammableStageDescriptor computeStageDescriptor; WGPUComputePipelineDescriptor dawn_desc = - AsDawnType(descriptor, &label, &computeStageDescriptor, this); + AsDawnType(descriptor, &label, &computeStageDescriptor); auto* callback = BindDawnOnceCallback(&GPUDevice::OnCreateComputePipelineAsyncCallback,
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc index 531eecd..5fbf92e 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_queue.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_queue.cc
@@ -396,7 +396,7 @@ const V8GPUExtent3D* write_size, ExceptionState& exception_state) { WGPUExtent3D dawn_write_size = AsDawnType(write_size); - WGPUImageCopyTexture dawn_destination = AsDawnType(destination, device_); + WGPUImageCopyTexture dawn_destination = AsDawnType(destination); WGPUTextureDataLayout dawn_data_layout = {}; { @@ -471,7 +471,7 @@ return; } - WGPUImageCopyTexture dawn_destination = AsDawnType(destination, device_); + WGPUImageCopyTexture dawn_destination = AsDawnType(destination); if (!IsValidExternalImageDestinationFormat( destination->texture()->Format())) {
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_render_pipeline.cc b/third_party/blink/renderer/modules/webgpu/gpu_render_pipeline.cc index 4f3aae0..98fd9a0 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_render_pipeline.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_render_pipeline.cc
@@ -31,8 +31,7 @@ namespace { -WGPUBlendComponent AsDawnType(const GPUBlendComponent* webgpu_desc, - GPUDevice* device) { +WGPUBlendComponent AsDawnType(const GPUBlendComponent* webgpu_desc) { DCHECK(webgpu_desc); WGPUBlendComponent dawn_desc = {}; @@ -44,12 +43,12 @@ return dawn_desc; } -WGPUBlendState AsDawnType(const GPUBlendState* webgpu_desc, GPUDevice* device) { +WGPUBlendState AsDawnType(const GPUBlendState* webgpu_desc) { DCHECK(webgpu_desc); WGPUBlendState dawn_desc = {}; - dawn_desc.color = AsDawnType(webgpu_desc->color(), device); - dawn_desc.alpha = AsDawnType(webgpu_desc->alpha(), device); + dawn_desc.color = AsDawnType(webgpu_desc->color()); + dawn_desc.alpha = AsDawnType(webgpu_desc->alpha()); return dawn_desc; } @@ -245,8 +244,7 @@ for (wtf_size_t i = 0; i < descriptor->targets().size(); ++i) { const GPUColorTargetState* color_target = descriptor->targets()[i]; if (color_target->hasBlend()) { - dawn_fragment->blend_states[i] = - AsDawnType(color_target->blend(), device); + dawn_fragment->blend_states[i] = AsDawnType(color_target->blend()); dawn_fragment->targets[i].blend = &dawn_fragment->blend_states[i]; } }
diff --git a/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc b/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc index cd3d2b0..62a77276 100644 --- a/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc +++ b/third_party/blink/renderer/platform/graphics/paint/cull_rect.cc
@@ -137,11 +137,7 @@ for (const auto* t = &destination.Transform(); t != &source.Transform(); t = t->UnaliasedParent()) { - // TODO(wangxianzhu): This should be DCHECK(t), but for now we need to - // work around crbug.com/1262837 etc. Also see the TODO in - // FragmentData::LocalBorderBoxProperties(). - if (!t) - return false; + DCHECK(t); if (t == &root.Transform()) { abnormal_hierarchy = true; break;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index f15a16f..75620aa 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -196,11 +196,6 @@ status: "experimental", }, { - name: "AppHistory", - origin_trial_feature_name: "AppHistory", - status: "experimental", - }, - { name: "AriaTouchPassthrough", status: "experimental", }, @@ -713,6 +708,10 @@ status: "stable", }, { + name: "CSSObjectViewBoxAndOverflow", + status: "experimental", + }, + { name: "CSSOffsetPathRay", status: "experimental", }, @@ -1325,7 +1324,7 @@ { name: "LayoutNGBlockFragmentation", implied_by: ["LayoutNGFlexFragmentation", "LayoutNGGridFragmentation", "LayoutNGPrinting", "LayoutNGTableFragmentation"], - status: "test", + status: "stable", }, { name: "LayoutNGBlockInInline", @@ -1579,6 +1578,10 @@ status: "stable", }, { + name: "NavigationApi", + status: "experimental", + }, + { name: "NavigationId", status: "experimental", },
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 7d68f80a..a280dc3 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3458,6 +3458,7 @@ crbug.com/626703 [ Win ] virtual/partitioned-cookies/http/tests/inspector-protocol/network/disabled-cache-navigation.js [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Mac10.12 ] virtual/prerender/external/wpt/speculation-rules/prerender/opt-out.html [ Skip Timeout ] crbug.com/626703 external/wpt/css/css-grid/subgrid/subgrid-stretch.html [ Failure ] crbug.com/626703 [ Mac11 ] external/wpt/css/css-animations/parsing/animation-computed.html [ Failure Timeout ] crbug.com/626703 [ Mac11 ] virtual/threaded/external/wpt/css/css-animations/parsing/animation-computed.html [ Failure Timeout ] @@ -3508,7 +3509,6 @@ crbug.com/626703 [ Mac10.12 ] virtual/fenced-frame-mparch/wpt_internal/fenced_frame/navigate-ancestor-nested-fenced-frame.https.html [ Timeout ] crbug.com/626703 [ Mac10.12 ] virtual/no-auto-wpt-origin-isolation/external/wpt/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html [ Timeout ] crbug.com/626703 [ Mac10.12 ] virtual/no-auto-wpt-origin-isolation/external/wpt/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html [ Timeout ] -crbug.com/626703 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/header-inserted-preload-link.tentative.html [ Timeout ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/html/cross-origin-embedder-policy/worker-inheritance.sub.https.html [ Timeout ] crbug.com/626703 [ Mac11-arm64 ] virtual/no-auto-wpt-origin-isolation/external/wpt/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-port.sub.https.html [ Timeout ] crbug.com/626703 [ Mac11-arm64 ] virtual/no-auto-wpt-origin-isolation/external/wpt/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomainport.sub.https.html [ Timeout ] @@ -5954,7 +5954,6 @@ crbug.com/1061226 [ Fuchsia ] wpt_internal/speech/scripted/speechrecognition-restart-onend.html [ Skip ] # Sheriff 2020-03-13 -crbug.com/1061043 fast/plugins/keypress-event.html [ Failure Pass ] crbug.com/1061131 [ Mac ] editing/selection/replaced-boundaries-1.html [ Failure Pass ] crbug.com/1058888 [ Linux ] animations/animationworklet/peek-updated-composited-property-on-main.html [ Failure Pass ] @@ -7652,10 +7651,8 @@ crbug.com/1038139 [ Linux ] virtual/gpu-rasterization/images/2-comp.html [ Failure Pass ] crbug.com/1038139 [ Mac ] virtual/gpu-rasterization/images/2-comp.html [ Failure Pass ] -# Need implementation of blocking=render attribute -crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/parser-inserted-preload-link.tentative.html [ Skip ] -crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/render-blocked-apis-by-preload-link.tentative.html [ Skip ] -crbug.com/1271296 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/script-inserted-preload-link.tentative.html [ Skip ] +# Need implementation of blocking=render on link headers +crbug.com/626703 virtual/no-forced-frame-updates/external/wpt/html/dom/render-blocking/header-inserted-preload-link.tentative.html [ Timeout ] # Sheriff 2022-02-07 crbug.com/1289759 [ Linux ] http/tests/loading/slow-parsing-subframe.html [ Failure Pass ] @@ -7775,4 +7772,4 @@ # WebAudio flaky timeout (crbug.com/1307741) crbug.com/1307741 [ Mac ] external/wpt/webaudio/the-audio-api/the-mediastreamaudiosourcenode-interface/mediastreamaudiosourcenode-routing.html [ Timeout ] crbug.com/1307741 external/wpt/webaudio/the-audio-api/the-pannernode-interface/pannernode-basic.html [ Timeout ] -crbug.com/1307741 webaudio/AudioParam/audioparam-k-rate.html [ Timeout ] \ No newline at end of file +crbug.com/1307741 webaudio/AudioParam/audioparam-k-rate.html [ Timeout ]
diff --git a/third_party/blink/web_tests/WebGPUExpectations b/third_party/blink/web_tests/WebGPUExpectations index c65fff2..64db269 100644 --- a/third_party/blink/web_tests/WebGPUExpectations +++ b/third_party/blink/web_tests/WebGPUExpectations
@@ -74,6 +74,8 @@ # All cases take a while, and there are very many for splitting. Prefer to wait till the harness doesn't need manual splits. wpt_internal/webgpu/cts.https.html?q=webgpu:web_platform,copyToTexture,canvas:color_space_conversion:* [ Timeout ] +[ Mac ] wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,image_copy,layout_related:bound_on_bytes_per_row:* [ Timeout ] + ### ### Test bugs ### @@ -163,6 +165,12 @@ ### Platform-independent failures ### +# Dawn has incorrect validation. +crbug.com/dawn/1325 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,render_bundle:depth_stencil_readonly_mismatch:* [ Failure ] +crbug.com/dawn/1325 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly:depthStencilFormat="depth24plus-stencil8";* [ Failure ] +crbug.com/dawn/1325 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly:depthStencilFormat="depth24unorm-stencil8";* [ Failure ] +crbug.com/dawn/1325 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly:depthStencilFormat="depth32float-stencil8";* [ Failure ] + # Replace depth-clamp feature with depth-clip crbug.com/dawn/1178 wpt_internal/webgpu/cts.https.html?q=webgpu:api,operation,rendering,depth_clip_clamp:* [ Failure ] @@ -303,6 +311,9 @@ crbug.com/dawn/666 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,createRenderPipeline:depth_stencil_state,stencil_aspect,stencil_test:isAsync=true;format="stencil8";* [ Failure ] crbug.com/dawn/666 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,createRenderPipeline:depth_stencil_state,stencil_aspect,stencil_write:isAsync=false;format="stencil8";* [ Failure ] crbug.com/dawn/666 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,createRenderPipeline:depth_stencil_state,stencil_aspect,stencil_write:isAsync=true;format="stencil8";* [ Failure ] +crbug.com/dawn/666 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly:depthStencilFormat="stencil8";* [ Failure ] +crbug.com/dawn/666 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,createRenderBundleEncoder:valid_texture_formats:format="stencil8";* [ Failure ] +crbug.com/dawn/666 wpt_internal/webgpu/cts.https.html?q=webgpu:api,validation,encoding,render_bundle:depth_stencil_formats_mismatch:bundleFormat="stencil8";* [ Failure ] crbug.com/tint/1215 wpt_internal/webgpu/cts.https.html?q=webgpu:shader,execution,shader_io,compute_builtins:inputs:* [ Failure ]
diff --git a/third_party/blink/web_tests/external/Version b/third_party/blink/web_tests/external/Version index f9549ab..0c379ff 100644 --- a/third_party/blink/web_tests/external/Version +++ b/third_party/blink/web_tests/external/Version
@@ -1 +1 @@ -Version: 1fb461292d43f1d25da167e05afe54f6b93df5d5 +Version: d6d6e9898ed1a7cb994f5d2bc23e5b23d0e8b90c
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 2704a4a3..bca8eb3d 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -274875,6 +274875,10 @@ "de80b40399280b99029ae20d9f043fed34a1795d", [] ], + "container-type-expected.txt": [ + "244ec2146406ec299ce2b3e17d2e841d672bcaaa", + [] + ], "dominant-baseline-expected.txt": [ "b61e9c7db19b6713b4c00758870af00f8fa615cb", [] @@ -360055,8 +360059,8 @@ {} ] ], - "fedcm-logout.https.html": [ - "4b38e863bf4ae91f28aa48dc11df6447ae6758ed", + "fedcm-logout.sub.https.html": [ + "7024638a127dcd8e579083813c031e048b0fbeb5", [ null, {} @@ -383193,6 +383197,13 @@ {} ] ], + "container-type.html": [ + "d52915492390dc0c6300a710f7f77565c7754145", + [ + null, + {} + ] + ], "coordinate.html": [ "31ccbfa9b9010a3e510f23ebe4fbc4aa0d3e245d", [ @@ -451317,6 +451328,13 @@ null, {} ] + ], + "hidden-ua-stylesheet.html": [ + "913ecc037cfcd3ff4d0b1f41f210808f009d9ca4", + [ + null, + {} + ] ] } }, @@ -458882,10 +458900,14 @@ ] ], "selection-not-application.html": [ - "aa98a030a83b8b9506c8e04dc945e022f11073ee", + "7771c3cf312d5514c0bc1d68d34109ac54e87f6d", [ null, {} + ], + [ + "html/semantics/forms/textfieldselection/selection-not-application.html?week,month", + {} ] ], "selection-start-end-extra.html": [
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-detached-subtree-expected.txt b/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-detached-subtree-expected.txt index 2c45153..bc03eaa 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-detached-subtree-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-detached-subtree-expected.txt
@@ -1,9 +1,9 @@ This is a testharness.js-based test. PASS getComputedStyle returns no style for detached element -FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 353 -FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 353 -FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 353 -FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 353 +FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) assert_equals: expected 0 but got 354 +FAIL getComputedStyle returns no style for element in non-rendered iframe (display: none) from iframe's window assert_equals: expected 0 but got 354 +FAIL getComputedStyle returns no style for element outside the flat tree assert_equals: expected 0 but got 354 +FAIL getComputedStyle returns no style for descendant outside the flat tree assert_equals: expected 0 but got 354 PASS getComputedStyle returns no style for shadow tree outside of flattened tree Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-pseudo-expected.txt b/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-pseudo-expected.txt index 57e9e881..705b6204 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-pseudo-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/cssom/getComputedStyle-pseudo-expected.txt
@@ -7,6 +7,6 @@ PASS Item-based blockification of nonexistent pseudo-elements PASS display: contents on pseudo-elements PASS Dynamically change to display: contents on pseudo-elements -FAIL Unknown pseudo-elements assert_equals: Should return an empty style for unknown pseudo-elements starting with double-colon expected 0 but got 353 +FAIL Unknown pseudo-elements assert_equals: Should return an empty style for unknown pseudo-elements starting with double-colon expected 0 but got 354 Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/font-access/font_access_detached_iframe.tentative.https.window.js b/third_party/blink/web_tests/external/wpt/font-access/font_access_detached_iframe.tentative.https.window.js index 9d0c8bc..c0cd579 100644 --- a/third_party/blink/web_tests/external/wpt/font-access/font_access_detached_iframe.tentative.https.window.js +++ b/third_party/blink/web_tests/external/wpt/font-access/font_access_detached_iframe.tentative.https.window.js
@@ -27,4 +27,17 @@ // Call query() in the main frame. This should keep the test running long // enough to catch any crash from the query() call in the removed iframe. await navigator.fonts.query(); -}, 'Detaching iframe while query() settles.'); \ No newline at end of file +}, 'Detaching iframe while query() settles.'); + +font_access_test(async t => { + const iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + + const iframeFonts = await iframe.contentWindow.navigator.fonts.query(); + assert_greater_than_equal(iframeFonts.length, 1, 'Need a least one font'); + const iframeFontMetadata = iframeFonts[0]; + const frameDOMException = iframe.contentWindow.DOMException; + iframe.remove(); + + iframeFontMetadata.blob(); +}, 'FontMetadata.blob() should not crash when called from a detached iframe.');
diff --git a/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/parser-inserted-modulepreload-link.tentative.html b/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/parser-inserted-modulepreload-link.tentative.html new file mode 100644 index 0000000..70fbac6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/parser-inserted-modulepreload-link.tentative.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<title>Parser-inserted modulepreload links with "blocking=render" are render-blocking</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/preload/resources/preload_helper.js"></script> +<script src="support/test-render-blocking.js"></script> + +<link rel="modulepreload" blocking="render" href="support/dummy-1.mjs?pipe=trickle(d1)"> +<div id="dummy">Lorem ipsum</div> + +<script> +test_render_blocking( + document.querySelector('link'), + async () => { + // Attach the module script into document. + // It should not start a new load as it's already preloaded. + const script = document.createElement('script'); + const scriptObserver = new LoadObserver(script); + script.type = 'module'; + script.src = 'support/dummy-1.mjs?pipe=trickle(d1)'; + document.body.appendChild(script); + await scriptObserver.load; + verifyLoadedAndNoDoubleDownload('support/dummy-1.mjs?pipe=trickle(d1)'); + assert_equals(document.getElementById('dummy').textContent, '1', + 'preloadedmodule script should be executed'); + }, + 'Parser-inserted render-blocking module script is preloaded and evaluated'); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/render-blocked-apis-by-module-preload-link.tentative.html b/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/render-blocked-apis-by-module-preload-link.tentative.html new file mode 100644 index 0000000..fd4884a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/render-blocked-apis-by-module-preload-link.tentative.html
@@ -0,0 +1,31 @@ +<!doctype html> +<title>Certain APIs should not trigger while rendering is blocked by a preload link</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/preload/resources/preload_helper.js"></script> +<script src="support/test-render-blocking.js"></script> + +<link id="module-preload" rel="modulepreload" blocking="render" + href="support/dummy-1.mjs?pipe=trickle(d1)"> + +<div id="dummy">Lorem ipsum</div> + +<script> +const preload = document.getElementById('module-preload'); +test_render_blocked_apis( + preload, + async () => { + // Attach the module script into document. + // It should not start a new load as it's already preloaded. + const script = document.createElement('script'); + const scriptObserver = new LoadObserver(script); + script.type = 'module'; + script.src = 'support/dummy-1.mjs?pipe=trickle(d1)'; + document.body.appendChild(script); + await scriptObserver.load; + verifyLoadedAndNoDoubleDownload('support/dummy-1.mjs?pipe=trickle(d1)'); + assert_equals(document.getElementById('dummy').textContent, '1', + 'preloadedmodule script should be executed'); + }, + 'Render-blocking module script is preloaded and executed'); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/script-inserted-modulepreload-link.tentative.html b/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/script-inserted-modulepreload-link.tentative.html new file mode 100644 index 0000000..67c79f0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/dom/render-blocking/script-inserted-modulepreload-link.tentative.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<title>Script-inserted modulepreload links with "blocking=render" are render-blocking</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/preload/resources/preload_helper.js"></script> +<script src="support/test-render-blocking.js"></script> + +<script> +const link = document.createElement('link'); +link.rel = 'modulepreload'; +link.blocking = 'render'; +link.href = 'support/dummy-1.mjs?pipe=trickle(d1)'; +document.head.appendChild(link); +</script> + +<div id="dummy">Lorem ipsum</div> + +<script> +test_render_blocking( + link, + async () => { + // Attach the module script into document. + // It should not start a new load as it's already preloaded. + const script = document.createElement('script'); + const scriptObserver = new LoadObserver(script); + script.type = 'module'; + script.src = 'support/dummy-1.mjs?pipe=trickle(d1)'; + document.body.appendChild(script); + await scriptObserver.load; + verifyLoadedAndNoDoubleDownload('support/dummy-1.mjs?pipe=trickle(d1)'); + assert_equals(document.getElementById('dummy').textContent, '1', + 'preloadedmodule script should be executed'); + }, + 'Script-inserted render-blocking module script is preloaded and evaluated'); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-dynamic-baseline-ref.html b/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-dynamic-baseline-ref.html new file mode 100644 index 0000000..c34096f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-dynamic-baseline-ref.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +baseline +<fieldset style="display: inline-block;"> + <div style="position: relative;"> + line1<br>line2 + </div> +</fieldset>
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-dynamic-baseline.html b/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-dynamic-baseline.html new file mode 100644 index 0000000..88aeed2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-dynamic-baseline.html
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1307140"> +<link rel="match" href="fieldset-dynamic-baseline-ref.html"> +baseline +<fieldset style="display: inline-block;"> + <div style="position: relative;"> + line1<br>line2<div id="target" style="position: absolute;"></div> + </div> +</fieldset> +<script> +document.body.offsetTop; +document.getElementById('target').style.top = '10px'; +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/conditionally-block-rendering-on-link-media-attr.html b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/conditionally-block-rendering-on-link-media-attr.html index 3304982..d21df46d 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/conditionally-block-rendering-on-link-media-attr.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/conditionally-block-rendering-on-link-media-attr.html
@@ -2,22 +2,12 @@ <meta charset="utf-8"> <script src=/resources/testharness.js></script> <script src=/resources/testharnessreport.js></script> +<script src="support/utils.js"></script> <link rel=stylesheet href=stylesheet.py> <link rel=stylesheet media="screen and (max-width:10px)" href=stylesheet.py?stylesNotMatchingEnvironment&delay=2> <h1>Dominic Farolino</h1> <script> - function styleExists(styleText) { - for (let styleRule of document.styleSheets) { - let currentStyleText = styleRule.cssRules["0"].cssText; - if (currentStyleText == styleText) { - return true; - } - } - - return false; - } - test(() => { const h1 = document.querySelector('h1'); const computedColor = getComputedStyle(h1).color;
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/script-created-link-stylesheet-does-not-block-script.html b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/script-created-link-stylesheet-does-not-block-script.html new file mode 100644 index 0000000..2c27bd3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/script-created-link-stylesheet-does-not-block-script.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<title>Script-created link stylesheet is not script-blocking</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support/utils.js"></script> +<script> +const link = document.createElement('link'); +link.rel = 'stylesheet'; +link.href = 'stylesheet.py?delay=1'; +document.head.appendChild(link); +</script> +<h1>Some text</h1> +<script> +test(() => { + assert_false(styleExists("h1 { color: purple; }"), + 'stylesheet should still be pending'); + const h1 = document.querySelector('h1'); + assert_equals(getComputedStyle(h1).color, 'rgb(0, 0, 0)'); +}); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/script-created-style-element-does-not-block-script.html b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/script-created-style-element-does-not-block-script.html new file mode 100644 index 0000000..f04c3f6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/script-created-style-element-does-not-block-script.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<title>Script-created style element is not script-blocking</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support/utils.js"></script> +<script> +const style = document.createElement('style'); +const sheet = document.createTextNode('@import url(stylesheet.py?delay=1);'); +style.appendChild(sheet); +document.head.appendChild(style); +</script> +<h1>Some text</h1> +<script> +test(() => { + assert_false(styleExists("h1 { color: purple; }"), + 'stylesheet should still be pending'); + const h1 = document.querySelector('h1'); + assert_equals(getComputedStyle(h1).color, 'rgb(0, 0, 0)'); +}); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-match-block-script.html b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-match-block-script.html index 46d26f6..17adfc17 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-match-block-script.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-match-block-script.html
@@ -2,20 +2,16 @@ <title>Style element is script-blocking when media matches</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script> -const start = performance.now(); -</script> +<script src="support/utils.js"></script> <style> @import url('stylesheet.py?delay=1'); </style> +<h1>Some text</h1> <script> -// The loading of the imported sheet may start before the <style> element is set -// up due to preload scanner, so even when it's script-blocking, it may block -// script for a bit less than 1000ms. So we set an error margin to make the test -// more robust. -const epsilon = 50; test(() => { - const delay = performance.now() - start; - assert_greater_than(delay, 1000 - epsilon); + assert_true(styleExists("h1 { color: purple; }"), + 'script should be blocked until the stylesheet is loaded'); + const h1 = document.querySelector('h1'); + assert_equals(getComputedStyle(h1).color, 'rgb(128, 0, 128)'); }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-not-match-does-not-block-script.html b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-not-match-does-not-block-script.html index 71b5388..c05b6ed 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-not-match-does-not-block-script.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/style-element-media-not-match-does-not-block-script.html
@@ -2,20 +2,16 @@ <title>Style element is not script-blocking when media doesn't match</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script> -const start = performance.now(); -</script> +<script src="support/utils.js"></script> <style media="print"> @import url('stylesheet.py?delay=1'); </style> +<h1>Some text</h1> <script> -// The loading of the imported sheet may start before the <style> element is set -// up due to preload scanner, so even when it's script-blocking, it may block -// script for a bit less than 1000ms. So we set an error margin to make the test -// more robust. -const epsilon = 50; test(() => { - const delay = performance.now() - start; - assert_less_than(delay, 1000 - epsilon); + assert_false(styleExists("h1 { color: purple; }"), + 'stylesheet should still be pending'); + const h1 = document.querySelector('h1'); + assert_equals(getComputedStyle(h1).color, 'rgb(0, 0, 0)'); }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/support/utils.js b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/support/utils.js new file mode 100644 index 0000000..02d3a09 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/document-metadata/interactions-of-styling-and-scripting/support/utils.js
@@ -0,0 +1,20 @@ +function styleExistsInSheet(styleText, sheet) { + for (let rule of sheet.cssRules) { + if (styleText == rule.cssText) + return true; + if (rule instanceof CSSImportRule) { + if (rule.styleSheet && styleExistsInSheet(styleText, rule.styleSheet)) + return true; + } + } + return false; +} + +function styleExists(styleText) { + for (let sheet of document.styleSheets) { + if (styleExistsInSheet(styleText, sheet)) + return true; + } + return false; +} +
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html b/third_party/blink/web_tests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html index aa98a030..7771c3c 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html
@@ -1,5 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> +<meta name=variant content=""> +<meta name=variant content="?week,month"> <title>text field selection</title> <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> <link rel=help href="https://html.spec.whatwg.org/multipage/#textFieldSelection"> @@ -7,18 +9,19 @@ <script src="/resources/testharnessreport.js"></script> <div id="log"></div> <script> - var nonApplicableTypes = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; + var nonApplicableTypes = ["hidden", "email", "datetime-local", "date", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; var applicableTypes = ["text", "search", "tel", "url", "password", "aninvalidtype", null]; + if (location.search) { + // If the <meta name=variant> tag used is non-empty, then use it instead of + // nonApplicableTypes. + nonApplicableTypes = location.search.substr(1).split(','); + } + nonApplicableTypes.forEach(function(type){ var el = document.createElement("input"); el.type = type; - if (el.type != type) { - // Type is not supported - don't bother with the following checks. - return; - } - test(() => { assert_equals(el.selectionStart, null); }, `selectionStart on an input[type=${type}] returns null`);
diff --git a/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/not-on-load.html b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/not-on-load.html new file mode 100644 index 0000000..8cc1688 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/navigation-api/currententrychange-event/not-on-load.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<!-- Per https://github.com/WICG/navigation-api/issues/31, make sure nothing happens on page loads --> + +<script> +async_test(t => { + navigation.onnavigate = t.unreached_func("navigate must not fire"); + navigation.oncurrententrychange = t.unreached_func("currententrychange must not fire"); + + // pageshow is the latest event in the normal document loading cycle. + // Ensure nothing happens even 10 ms afterward. + window.addEventListener("pageshow", () => t.step_timeout(() => { + t.done(); + }, 10)); +}, "No navigation API events happen on initial page load"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html index 67a05553..b176add 100644 --- a/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html +++ b/third_party/blink/web_tests/external/wpt/shadow-dom/imperative-slot-api.html
@@ -13,10 +13,12 @@ <script> test(() => { let tTree = createTestTree(test_basic); - assert_not_equals(tTree.host1.attachShadow({ mode: 'open', slotAssignment: 'manual'}), - null, 'slot assignment manual should work'); - assert_not_equals(tTree.host2.attachShadow({ mode: 'open', slotAssignment: 'named'}), - null, 'slot assignment named should work'); + const shadow1 = tTree.host1.attachShadow({ mode: 'open', slotAssignment: 'manual'}); + assert_not_equals(shadow1, null, 'slot assignment manual should work'); + assert_equals(shadow1.slotAssignment, "manual", 'slotAssignment should return "manual"'); + const shadow2 = tTree.host2.attachShadow({ mode: 'open', slotAssignment: 'named'}); + assert_not_equals(shadow2, null, 'slot assignment named should work'); + assert_equals(shadow2.slotAssignment, "named", 'slotAssignment should return "named"'); assert_throws_js(TypeError, () => { tTree.host3.attachShadow({ mode: 'open', slotAssignment: 'exceptional' })}, 'others should throw exception');
diff --git a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt index e382b95b..99549d9 100644 --- a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt +++ b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt
@@ -242,6 +242,7 @@ mix-blend-mode: normal object-fit: fill object-position: 50% 50% +object-view-box: none offset-anchor: auto offset-distance: 0px offset-path: none
diff --git a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt index 51b6e3a..7535adb 100644 --- a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt +++ b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
@@ -242,6 +242,7 @@ mix-blend-mode: normal object-fit: fill object-position: 50% 50% +object-view-box: none offset-anchor: auto offset-distance: 0px offset-path: none
diff --git a/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt b/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt index 7f35b5b..4e248c9 100644 --- a/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt +++ b/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt
@@ -242,6 +242,7 @@ mix-blend-mode: normal object-fit: fill object-position: 50% 50% +object-view-box: none offset-anchor: auto offset-distance: 0px offset-path: none
diff --git a/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt b/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt index 25349f7..87480220 100644 --- a/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt +++ b/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt
@@ -280,6 +280,7 @@ negative objectFit objectPosition +objectViewBox offset offsetAnchor offsetDistance
diff --git a/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt b/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt index f19e0c0..6fdf36d9 100644 --- a/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt
@@ -259,6 +259,7 @@ mix-blend-mode object-fit object-position + object-view-box offset-anchor offset-distance offset-path
diff --git a/third_party/blink/web_tests/wpt_internal/css/css-images/object-view-box-parsing.html b/third_party/blink/web_tests/wpt_internal/css/css-images/object-view-box-parsing.html new file mode 100644 index 0000000..1f5e258a --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/css/css-images/object-view-box-parsing.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS object-view-box: computed values</title> +<link rel="author" title="Khushal Sagar" href="mailto:khushalsagar@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<div id=target></div> +<script> +test_valid_value('object-view-box', 'inset(10%)'); +test_valid_value('object-view-box', 'inset(10px 20px 30px 40px)'); + +test_invalid_value('object-view-box', 'circle(10px)'); +test_invalid_value('object-view-box', 'ellipse(10px 20px)'); +test_invalid_value('object-view-box', 'polygon(10px 20px 30px)'); +test_invalid_value('object-view-box', 'path("M20,80 L50,20")'); +test_invalid_value('object-view-box', 'blah'); + +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/cts.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/cts.https.html index 4886186..aabdae9 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/cts.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/cts.https.html
@@ -2187,6 +2187,10 @@ <meta name=variant content='?q=webgpu:api,validation,encoding,cmds,setBindGroup:dynamic_offsets_passed_but_not_expected:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,cmds,setBindGroup:dynamic_offsets_match_expectations_in_pass_encoder:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,cmds,setBindGroup:u32array_start_and_length:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,createRenderBundleEncoder:attachment_state:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,createRenderBundleEncoder:valid_texture_formats:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,createRenderBundleEncoder:depth_stencil_readonly_with_undefined_depth:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bind_groups_and_pipeline_layout_mismatch:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:buffer_binding,render_pipeline:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:sampler_binding,render_pipeline:*'> @@ -2209,7 +2213,12 @@ <meta name=variant content='?q=webgpu:api,validation,encoding,queries,resolveQuerySet:destination_offset_alignment:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,queries,resolveQuerySet:resolve_buffer_oob:*'> <meta name=variant content='?q=webgpu:api,validation,encoding,queries,resolveQuerySet:query_set_buffer,device_mismatch:*'> -<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:render_bundles,device_mismatch:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:empty_bundle_list:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:device_mismatch:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:color_formats_mismatch:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:depth_stencil_formats_mismatch:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:depth_stencil_readonly_mismatch:*'> +<meta name=variant content='?q=webgpu:api,validation,encoding,render_bundle:sample_count_mismatch:*'> <meta name=variant content='?q=webgpu:api,validation,error_scope:simple_case_where_the_error_scope_catches_an_error:*'> <meta name=variant content='?q=webgpu:api,validation,error_scope:errors_bubble_to_the_parent_scope_if_not_handled_by_the_current_scope:*'> <meta name=variant content='?q=webgpu:api,validation,error_scope:if_an_error_scope_matches_an_error_it_does_not_bubble_to_the_parent_scope:*'> @@ -2577,6 +2586,7 @@ <meta name=variant content='?q=webgpu:api,validation,resource_usages,texture,in_pass_encoder:validation_scope,different_draws_or_dispatches:*'> <meta name=variant content='?q=webgpu:api,validation,resource_usages,texture,in_pass_encoder:validation_scope,different_passes:*'> <meta name=variant content='?q=webgpu:api,validation,resource_usages,texture,in_render_common:subresources_from_same_texture_as_color_attachments:*'> +<meta name=variant content='?q=webgpu:api,validation,resource_usages,texture,in_render_common:subresources_from_same_texture_as_color_attachment_and_in_bind_group:*'> <meta name=variant content='?q=webgpu:api,validation,texture,destroy:base:*'> <meta name=variant content='?q=webgpu:api,validation,texture,destroy:twice:*'> <meta name=variant content='?q=webgpu:api,validation,texture,destroy:submit_a_destroyed_texture_as_attachment:*'> @@ -2706,6 +2716,11 @@ <meta name=variant content='?q=webgpu:shader,execution,expression,binary,bitwise:bitwise_or:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,binary,bitwise:bitwise_and:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,binary,bitwise:bitwise_exclusive_or:*'> +<meta name=variant content='?q=webgpu:shader,execution,expression,binary,f32_arithmetic:addition:*'> +<meta name=variant content='?q=webgpu:shader,execution,expression,binary,f32_arithmetic:subtraction:*'> +<meta name=variant content='?q=webgpu:shader,execution,expression,binary,f32_arithmetic:multiplication:*'> +<meta name=variant content='?q=webgpu:shader,execution,expression,binary,f32_arithmetic:division:*'> +<meta name=variant content='?q=webgpu:shader,execution,expression,binary,f32_arithmetic:modulus:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,call,builtin,abs:u32:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,call,builtin,abs:i32:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,call,builtin,abs:f32:*'> @@ -2793,6 +2808,7 @@ <meta name=variant content='?q=webgpu:shader,execution,expression,call,builtin,select:vector:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,call,builtin,sin:f32:*'> <meta name=variant content='?q=webgpu:shader,execution,expression,call,builtin,value_testing_built_in_functions:value_testing_builtin_functions,runtime_sized_array_length:*'> +<meta name=variant content='?q=webgpu:shader,execution,expression,unary,f32_arithmetic:negation:*'> <meta name=variant content='?q=webgpu:shader,execution,memory_model,atomicity:atomicity:memType="atomic_storage";testType="inter_workgroup"'> <meta name=variant content='?q=webgpu:shader,execution,memory_model,atomicity:atomicity:memType="atomic_storage";testType="intra_workgroup";*'> <meta name=variant content='?q=webgpu:shader,execution,memory_model,atomicity:atomicity:memType="atomic_workgroup";*'> @@ -3571,3 +3587,4 @@ <meta name=variant content='?q=webgpu:web_platform,external_texture,video:importExternalTexture,sample:*'> <meta name=variant content='?q=webgpu:web_platform,external_texture,video:importExternalTexture,destroy:*'> <meta name=variant content='?q=webgpu:web_platform,external_texture,video:importExternalTexture,compute:*'> +<meta name=variant content='?q=webgpu:web_platform,worker,worker:worker:*'>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_copy.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_copy.https.html index 567b504..a0a83bd 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_copy.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_copy.https.html
@@ -8,7 +8,7 @@ content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space" /> <link rel="match" href="./ref/canvas_complex-ref.html" /> - <meta name=fuzzy content="maxDifference=4;totalPixels=50"> + <meta name=fuzzy content="maxDifference=0-3;totalPixels=0-50"> <canvas id="cvs_copy_buffer_to_texture" width="2" height="2" style="width: 20px; height: 20px;"></canvas> <canvas id="cvs_copy_texture_to_texture" width="2" height="2" style="width: 20px; height: 20px;"></canvas>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_draw.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_draw.https.html index 088770f7f..72144f3 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_draw.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_draw.https.html
@@ -8,7 +8,7 @@ content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space" /> <link rel="match" href="./ref/canvas_complex-ref.html" /> - <meta name=fuzzy content="maxDifference=4;totalPixels=50"> + <meta name=fuzzy content="maxDifference=0-3;totalPixels=0-50"> <canvas id="cvs_draw_texture_sample" width="2" height="2" style="width: 20px; height: 20px;"></canvas> <canvas id="cvs_draw_vertex_color" width="2" height="2" style="width: 20px; height: 20px;"></canvas>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_copy.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_copy.https.html index 8f17862..b2b06d8 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_copy.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_copy.https.html
@@ -8,7 +8,7 @@ content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space" /> <link rel="match" href="./ref/canvas_composite_alpha_opaque-ref.html" /> - <meta name=fuzzy content="maxDifference=4;totalPixels=400"> + <meta name=fuzzy content="maxDifference=0-3;totalPixels=0-400"> <style> body { background-color: #F0E68C; } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_draw.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_draw.https.html index 225d3e10..e24258f 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_draw.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_opaque_draw.https.html
@@ -8,7 +8,7 @@ content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space" /> <link rel="match" href="./ref/canvas_composite_alpha_opaque-ref.html" /> - <meta name=fuzzy content="maxDifference=4;totalPixels=400"> + <meta name=fuzzy content="maxDifference=0-3;totalPixels=0-400"> <style> body { background-color: #F0E68C; } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html index 6d4834f0..c2df3c8 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html
@@ -8,7 +8,7 @@ content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space" /> <link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" /> - <meta name=fuzzy content="maxDifference=4;totalPixels=400"> + <meta name=fuzzy content="maxDifference=0-3;totalPixels=0-400"> <style> body { background-color: #F0E68C; } </style>
diff --git a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html index 273bb8d..4715e171 100644 --- a/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html +++ b/third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html
@@ -8,7 +8,7 @@ content="WebGPU canvas should have correct orientation, components, scaling, filtering, color space" /> <link rel="match" href="./ref/canvas_composite_alpha_premultiplied-ref.html" /> - <meta name=fuzzy content="maxDifference=4;totalPixels=400"> + <meta name=fuzzy content="maxDifference=0-3;totalPixels=0-400"> <style> body { background-color: #F0E68C; } </style>
diff --git a/third_party/closure_compiler/externs/accessibility_private.js b/third_party/closure_compiler/externs/accessibility_private.js index dc03c744..5c212fa 100644 --- a/third_party/closure_compiler/externs/accessibility_private.js +++ b/third_party/closure_compiler/externs/accessibility_private.js
@@ -145,45 +145,6 @@ SELECT: 'select', SETTINGS: 'settings', START_TEXT_SELECTION: 'startTextSelection', - SHORTCUTS: 'shortcuts', - LEAVE_GROUP: 'leaveGroup', - WEB_MENU: 'webMenu', - WEB_BOOKMARK: 'webBookmark', - WEB_BOTTOM_OF_PAGE: 'webBottomOfPage', - WEB_TOP_OF_PAGE: 'webTopOfPage', - WEB_FIND_IN_PAGE: 'webFindInPage', - WEB_DOWNLOADS: 'webDownloads', - WEB_CLEAR_HISTORY: 'webClearHistory', - SYSTEM_MENU: 'systemMenu', - SYSTEM_STATUS_BAR: 'systemStatusBar', - SYSTEM_LAUNCHER: 'systemLauncher', - SYSTEM_TASK_MANAGER: 'systemTaskManager', - SYSTEM_DIAGNOSTICS: 'systemDiagnostics', - SYSTEM_SCREENSHOT: 'systemScreenshot', - SYSTEM_HELP: 'systemHelp', - MEDIA_MENU: 'mediaMenu', - MEDIA_MUTE: 'mediaMute', - MEDIA_VOLUME_DOWN: 'mediaVolumeDown', - MEDIA_VOLUME_UP: 'mediaVolumeUp', - MEDIA_REWIND: 'mediaRewind', - MEDIA_PLAY_PAUSE: 'mediaPlayPause', - MEDIA_FASTFORWARD: 'mediaFastforward', - DISPLAY_MENU: 'displayMenu', - DISPLAY_MIRROR: 'displayMirror', - DISPLAY_BRIGHTNESS_DOWN: 'displayBrightnessDown', - DISPLAY_BRIGHTNESS_UP: 'displayBrightnessUp', - DISPLAY_ROTATE: 'displayRotate', - DISPLAY_ZOOM_OUT: 'displayZoomOut', - DISPLAY_ZOOM_IN: 'displayZoomIn', - USER_MENU: 'userMenu', - USER_LOCK: 'userLock', - USER_PREVIOUS_USER: 'userPreviousUser', - USER_NEXT_USER: 'userNextUser', - USER_SIGN_OUT: 'userSignOut', - ACTION_RECORDER: 'actionRecorder', - START_RECORDING: 'startRecording', - STOP_RECORDING: 'stopRecording', - EXECUTE_MACRO: 'executeMacro', }; /**
diff --git a/third_party/grpc/BUILD.gn b/third_party/grpc/BUILD.gn index 968f6d7..8868e01 100644 --- a/third_party/grpc/BUILD.gn +++ b/third_party/grpc/BUILD.gn
@@ -399,6 +399,7 @@ "src/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h", "src/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h", "src/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h", + "src/src/core/ext/filters/client_channel/resolver/polling_resolver.h", "src/src/core/ext/filters/client_channel/resolver_result_parsing.h", "src/src/core/ext/filters/client_channel/retry_filter.h", "src/src/core/ext/filters/client_channel/retry_service_config.h", @@ -406,6 +407,7 @@ "src/src/core/ext/filters/client_channel/subchannel.h", "src/src/core/ext/filters/client_channel/subchannel_interface.h", "src/src/core/ext/filters/client_channel/subchannel_pool_interface.h", + "src/src/core/ext/filters/client_channel/subchannel_stream_client.h", "src/src/core/ext/filters/client_idle/idle_filter_state.h", "src/src/core/ext/filters/deadline/deadline_filter.h", "src/src/core/ext/filters/fault_injection/fault_injection_filter.h", @@ -749,6 +751,7 @@ "src/src/core/lib/channel/channel_args_preconditioning.h", "src/src/core/lib/channel/channel_stack.h", "src/src/core/lib/channel/channel_stack_builder.h", + "src/src/core/lib/channel/channel_stack_builder_impl.h", "src/src/core/lib/channel/channel_trace.h", "src/src/core/lib/channel/channelz.h", "src/src/core/lib/channel/channelz_registry.h", @@ -794,9 +797,11 @@ "src/src/core/lib/gprpp/global_config_generic.h", "src/src/core/lib/gprpp/host_port.h", "src/src/core/lib/gprpp/manual_constructor.h", + "src/src/core/lib/gprpp/match.h", "src/src/core/lib/gprpp/memory.h", "src/src/core/lib/gprpp/mpscq.h", "src/src/core/lib/gprpp/orphanable.h", + "src/src/core/lib/gprpp/overload.h", "src/src/core/lib/gprpp/ref_counted.h", "src/src/core/lib/gprpp/ref_counted_ptr.h", "src/src/core/lib/gprpp/stat.h", @@ -898,6 +903,8 @@ "src/src/core/lib/promise/detail/status.h", "src/src/core/lib/promise/detail/switch.h", "src/src/core/lib/promise/exec_ctx_wakeup_scheduler.h", + "src/src/core/lib/promise/intra_activity_waiter.h", + "src/src/core/lib/promise/latch.h", "src/src/core/lib/promise/loop.h", "src/src/core/lib/promise/map.h", "src/src/core/lib/promise/poll.h", @@ -941,6 +948,7 @@ "src/src/core/lib/security/credentials/fake/fake_credentials.h", "src/src/core/lib/security/credentials/google_default/google_default_credentials.h", "src/src/core/lib/security/credentials/iam/iam_credentials.h", + "src/src/core/lib/security/credentials/insecure/insecure_credentials.h", "src/src/core/lib/security/credentials/jwt/json_token.h", "src/src/core/lib/security/credentials/jwt/jwt_credentials.h", "src/src/core/lib/security/credentials/jwt/jwt_verifier.h", @@ -1115,6 +1123,7 @@ "src/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc", # "src/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc", + "src/src/core/ext/filters/client_channel/resolver/polling_resolver.cc", "src/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc", "src/src/core/ext/filters/client_channel/resolver_result_parsing.cc", "src/src/core/ext/filters/client_channel/retry_filter.cc", @@ -1123,6 +1132,7 @@ "src/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc", "src/src/core/ext/filters/client_channel/subchannel.cc", "src/src/core/ext/filters/client_channel/subchannel_pool_interface.cc", + "src/src/core/ext/filters/client_channel/subchannel_stream_client.cc", "src/src/core/ext/filters/client_idle/client_idle_filter.cc", "src/src/core/ext/filters/client_idle/idle_filter_state.cc", "src/src/core/ext/filters/deadline/deadline_filter.cc", @@ -1428,6 +1438,7 @@ "src/src/core/lib/channel/channel_args_preconditioning.cc", "src/src/core/lib/channel/channel_stack.cc", "src/src/core/lib/channel/channel_stack_builder.cc", + "src/src/core/lib/channel/channel_stack_builder_impl.cc", "src/src/core/lib/channel/channel_trace.cc", "src/src/core/lib/channel/channelz.cc", "src/src/core/lib/channel/channelz_registry.cc",
diff --git a/third_party/grpc/README.chromium b/third_party/grpc/README.chromium index 5bca654..47dc6b63 100644 --- a/third_party/grpc/README.chromium +++ b/third_party/grpc/README.chromium
@@ -2,7 +2,7 @@ URL: https://github.com/grpc/grpc License: Apache 2.0 Version: v1.46.0-dev -Revision: 2a0d6234cb2ccebb265c035ffd09ecc9a347b4bf +Revision: 208619cdce3b7cdc681cb50c29db619e46dd5af6 Security Critical: yes Please note that that the use of gRPC is not generally allowed within Chromium.
diff --git a/third_party/nearby/README.chromium b/third_party/nearby/README.chromium index 25b548c..f9e0f70 100644 --- a/third_party/nearby/README.chromium +++ b/third_party/nearby/README.chromium
@@ -1,7 +1,7 @@ Name: Nearby Connections Library Short Name: Nearby URL: https://github.com/google/nearby-connections -Version: 517d77f5aa4fea8f4437125830cfc55f84705e3d +Version: 6d24d4213292b6911e0ed980e249c4ef6303a12c License: Apache 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/webgpu-cts/BUILD.gn b/third_party/webgpu-cts/BUILD.gn index 9e63e3b..e4a7a1e 100644 --- a/third_party/webgpu-cts/BUILD.gn +++ b/third_party/webgpu-cts/BUILD.gn
@@ -27,7 +27,9 @@ if (js_node_file != "src-node/common/runtime/wpt.js" && js_node_file != "src-node/common/runtime/standalone.js" && - js_node_file != "src-node/common/runtime/helper/test_worker.js") { + js_node_file != "src-node/common/runtime/helper/test_worker.js" && + js_node_file != + "src-node/webgpu/web_platform/worker/worker_launcher.js") { js_outputs += [ "$target_gen_dir/$js_node_file" ] } }
diff --git a/third_party/webgpu-cts/ts_sources.txt b/third_party/webgpu-cts/ts_sources.txt index 775be19..51927cf 100644 --- a/third_party/webgpu-cts/ts_sources.txt +++ b/third_party/webgpu-cts/ts_sources.txt
@@ -62,6 +62,7 @@ src/webgpu/util/texture/layout.ts src/webgpu/capability_info.ts src/webgpu/util/buffer.ts +src/webgpu/util/pretty_diff_tables.ts src/webgpu/util/check_contents.ts src/webgpu/util/command_buffer_maker.ts src/webgpu/util/device_pool.ts @@ -198,6 +199,7 @@ src/webgpu/api/validation/capability_checks/features/query_types.spec.ts src/webgpu/api/validation/capability_checks/features/texture_formats.spec.ts src/webgpu/api/validation/encoding/beginRenderPass.spec.ts +src/webgpu/api/validation/encoding/createRenderBundleEncoder.spec.ts src/webgpu/api/validation/encoding/encoder_state.spec.ts src/webgpu/api/validation/encoding/render_bundle.spec.ts src/webgpu/api/validation/encoding/cmds/buffer_texture_copies.spec.ts @@ -255,6 +257,7 @@ src/webgpu/shader/execution/expression/expression.ts src/webgpu/shader/execution/expression/binary/binary.ts src/webgpu/shader/execution/expression/binary/bitwise.spec.ts +src/webgpu/shader/execution/expression/binary/f32_arithmetic.spec.ts src/webgpu/shader/execution/expression/call/builtin/builtin.ts src/webgpu/shader/execution/expression/call/builtin/abs.spec.ts src/webgpu/shader/execution/expression/call/builtin/all.spec.ts @@ -285,6 +288,8 @@ src/webgpu/shader/execution/expression/call/builtin/select.spec.ts src/webgpu/shader/execution/expression/call/builtin/sin.spec.ts src/webgpu/shader/execution/expression/call/builtin/value_testing_built_in_functions.spec.ts +src/webgpu/shader/execution/expression/unary/unary.ts +src/webgpu/shader/execution/expression/unary/f32_arithmetic.spec.ts src/webgpu/shader/execution/memory_model/memory_model_setup.ts src/webgpu/shader/execution/memory_model/atomicity.spec.ts src/webgpu/shader/execution/memory_model/barrier.spec.ts @@ -320,3 +325,6 @@ src/webgpu/web_platform/reftests/canvas_complex.html.ts src/webgpu/web_platform/reftests/canvas_composite_alpha.html.ts src/webgpu/web_platform/reftests/canvas_size_different_with_back_buffer_size.html.ts +src/webgpu/web_platform/worker/worker.spec.ts +src/webgpu/web_platform/worker/worker.ts +src/webgpu/web_platform/worker/worker_launcher.ts
diff --git a/tools/binary_size/libsupersize/dex_disassembly.py b/tools/binary_size/libsupersize/dex_disassembly.py index 9f5b30b..560f979 100644 --- a/tools/binary_size/libsupersize/dex_disassembly.py +++ b/tools/binary_size/libsupersize/dex_disassembly.py
@@ -216,8 +216,8 @@ else: before = None logging.debug('Adding disassembly for symbol: %s ', symbol.full_name) - symbol.disassembly = _CreateUnifiedDiff(symbol.full_name, before or [], - after) + symbol.after_symbol.disassembly = _CreateUnifiedDiff( + symbol.full_name, before or [], after) counter -= 1 if counter == 0: break
diff --git a/tools/binary_size/libsupersize/file_format.py b/tools/binary_size/libsupersize/file_format.py index 0fcf913..c8a16c4 100644 --- a/tools/binary_size/libsupersize/file_format.py +++ b/tools/binary_size/libsupersize/file_format.py
@@ -278,6 +278,7 @@ fields = { 'has_components': True, 'has_padding': include_padding, + 'has_disassembly': True } if has_multi_containers: @@ -371,8 +372,12 @@ w.LogSize('component indices') prev_aliases = None + symbols_with_disassembly = [] + disassembly_idx = 0 for group in symbol_group_by_segment: for symbol in group: + if symbol.disassembly: + symbols_with_disassembly.append((disassembly_idx, symbol.disassembly)) w.WriteString(symbol.full_name) if symbol.aliases and symbol.aliases is not prev_aliases: w.WriteString('\t0%x' % symbol.num_aliases) @@ -380,8 +385,15 @@ if symbol.flags: w.WriteString('\t%x' % symbol.flags) w.WriteBytes(b'\n') + disassembly_idx += 1 w.LogSize('names (final)') # For libchrome: adds 3.5mb. + w.WriteNumberList(x[0] for x in symbols_with_disassembly) + for _, disassembly in symbols_with_disassembly: + disassembly_bytes = disassembly.encode('utf-8') + w.WriteBytes(b'%d\n' % len(disassembly_bytes)) + w.WriteBytes(disassembly_bytes) + def _ReadLine(file_iter): """Read a line from a file object iterator and remove the newline character. @@ -465,6 +477,7 @@ has_components = fields.get('has_components', False) has_padding = fields.get('has_padding', False) + has_disassembly = fields.get('has_disassembly', False) # Eat empty line. _ReadLine(lines) @@ -574,6 +587,7 @@ component = components[cur_component_indices[i]] if has_components else '' new_sym.component = component new_sym.flags = flags + new_sym.disassembly = '' # Derived. if cur_paddings: new_sym.padding = cur_paddings[i] @@ -601,6 +615,15 @@ if not has_padding: CalculatePadding(raw_symbols) + # Get disassmebly if it exists. + if has_disassembly: + idx_disassembly = _ReadValuesFromLine(lines, split=' ') + if len(idx_disassembly) > 0 and idx_disassembly[0] != '': + for elem in idx_disassembly: + elem = int(elem) + diss_len = int(_ReadLine(lines)) + diss_text = lines.read(diss_len) + raw_symbols[elem].disassembly = diss_text return models.SizeInfo(build_config, containers, raw_symbols, @@ -628,20 +651,18 @@ if os.environ.get('SUPERSIZE_MEASURE_GZIP') == '1': # Doing serialization and Gzip together. with _OpenGzipForWrite(path, file_obj=file_obj) as f: - _SaveSizeInfoToFile( - size_info, - f, - include_padding=include_padding, - sparse_symbols=sparse_symbols) + _SaveSizeInfoToFile(size_info, + f, + include_padding=include_padding, + sparse_symbols=sparse_symbols) else: # Doing serizliation and Gzip separately. # This turns out to be faster. On Python 3: 40s -> 14s. bytesio = io.BytesIO() - _SaveSizeInfoToFile( - size_info, - bytesio, - include_padding=include_padding, - sparse_symbols=sparse_symbols) + _SaveSizeInfoToFile(size_info, + bytesio, + include_padding=include_padding, + sparse_symbols=sparse_symbols) logging.debug('Serialization complete. Gzipping...') with _OpenGzipForWrite(path, file_obj=file_obj) as f: @@ -671,13 +692,12 @@ before_size_file = io.BytesIO() after_size_file = io.BytesIO() - after_promise = parallel.CallOnThread( - SaveSizeInfo, - delta_size_info.after, - '', - file_obj=after_size_file, - include_padding=True, - sparse_symbols=after_symbols) + after_promise = parallel.CallOnThread(SaveSizeInfo, + delta_size_info.after, + '', + file_obj=after_size_file, + include_padding=True, + sparse_symbols=after_symbols) SaveSizeInfo( delta_size_info.before, '',
diff --git a/tools/binary_size/libsupersize/models.py b/tools/binary_size/libsupersize/models.py index 86a92bd..416608f3 100644 --- a/tools/binary_size/libsupersize/models.py +++ b/tools/binary_size/libsupersize/models.py
@@ -546,21 +546,9 @@ class Symbol(BaseSymbol): """Represents a single symbol within a binary.""" - __slots__ = ( - 'address', - 'full_name', - 'template_name', - 'name', - 'flags', - 'object_path', - 'aliases', - 'padding', - 'container', - 'section_name', - 'source_path', - 'size', - 'component', - ) + __slots__ = ('address', 'full_name', 'template_name', 'name', 'flags', + 'object_path', 'aliases', 'padding', 'container', 'section_name', + 'source_path', 'size', 'component', 'disassembly') def __init__(self, section_name, @@ -572,7 +560,8 @@ source_path=None, object_path=None, flags=0, - aliases=None): + aliases=None, + disassembly=None): self.section_name = section_name self.address = address or 0 self.full_name = full_name or '' @@ -586,6 +575,7 @@ self.padding = 0 self.container = None self.component = '' + self.disassembly = disassembly or '' def __repr__(self): if self.container_name: @@ -627,7 +617,7 @@ to one symbol in the |before|, and then be an alias to another in |after|. """ - __slots__ = ('before_symbol', 'after_symbol', 'disassembly') + __slots__ = ('before_symbol', 'after_symbol') def __init__(self, before_symbol, after_symbol): self.before_symbol = before_symbol
diff --git a/tools/binary_size/libsupersize/testdata/Console.golden b/tools/binary_size/libsupersize/testdata/Console.golden index 624f883..642af63 100644 --- a/tools/binary_size/libsupersize/testdata/Console.golden +++ b/tools/binary_size/libsupersize/testdata/Console.golden
@@ -2,12 +2,12 @@ Entering interactive Python shell. Quick reference: SizeInfo: ContainerForName, build_config, containers, metadata_legacy, native_symbols, pak_symbols, raw_symbols, section_sizes, size_path, symbols -Symbol: FlagsString, IsBss, IsDelta, IsDex, IsGeneratedByToolchain, IsGroup, IsNameUnique, IsNative, IsOther, IsOverhead, IsPak, IsStringLiteral, IterLeafSymbols, SetName, address, aliases, component, container, container_name, container_short_name, end_address, flags, full_name, generated_source, is_anonymous, name, num_aliases, object_path, padding, padding_pss, pss, pss_without_padding, section, section_name, size, size_without_padding, source_path, template_name +Symbol: FlagsString, IsBss, IsDelta, IsDex, IsGeneratedByToolchain, IsGroup, IsNameUnique, IsNative, IsOther, IsOverhead, IsPak, IsStringLiteral, IterLeafSymbols, SetName, address, aliases, component, container, container_name, container_short_name, disassembly, end_address, flags, full_name, generated_source, is_anonymous, name, num_aliases, object_path, padding, padding_pss, pss, pss_without_padding, section, section_name, size, size_without_padding, source_path, template_name SymbolGroup (extends Symbol): CountUniqueSymbols, Filter, GroupedBy, GroupedByAliases, GroupedByComponent, GroupedByContainer, GroupedByContainerAndSectionName, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereComponentMatches, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasComponent, WhereHasFlag, WhereHasPath, WhereInContainer, WhereInSection, WhereIsDex, WhereIsGroup, WhereIsNative, WhereIsOnDemand, WhereIsPak, WhereIsPlaceholder, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_default_sorted DeltaSizeInfo: ContainerForName, after, before, build_config, containers, native_symbols, pak_symbols, raw_symbols, section_sizes, symbols -DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status, disassembly +DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status DeltaSymbolGroup (extends SymbolGroup): CountsByDiffStatus, WhereDiffStatusIs, diff_status canned_queries: CategorizeByChromeComponent, CategorizeGenerated, LargeFiles, PakByPath, StaticInitializers, TemplatesByName
diff --git a/tools/binary_size/libsupersize/viewer/caspian/cli.cc b/tools/binary_size/libsupersize/viewer/caspian/cli.cc index 541d8d9..702b6e96 100644 --- a/tools/binary_size/libsupersize/viewer/caspian/cli.cc +++ b/tools/binary_size/libsupersize/viewer/caspian/cli.cc
@@ -71,6 +71,20 @@ ParseDiffSizeInfoFromFile(filename, &before, &after); } +void ShowDisassembly(const char* filename) { + caspian::SizeInfo before; + caspian::SizeInfo after; + ParseDiffSizeInfoFromFile(filename, &before, &after); + + for (const auto& sym : after.raw_symbols) { + if (sym.disassembly_ != nullptr) { + std::cout << "Symbol Name: " << sym.full_name_ << std::endl; + std::cout << "Disassembly:" << std::endl + << *sym.disassembly_ << std::endl; + } + } +} + void PrintUsageAndExit() { std::cerr << "Must have exactly one of:" << std::endl; std::cerr << " validate, diff" << std::endl; @@ -78,6 +92,7 @@ std::cerr << " caspian_cli validate <.size file>" << std::endl; std::cerr << " caspian_cli validatediff <.sizediff file>" << std::endl; std::cerr << " caspian_cli diff <before_file> <after_file>" << std::endl; + std::cerr << " caspian_cli showdisassembly <.sizediff file>" << std::endl; exit(1); } @@ -91,6 +106,8 @@ Validate(argv[2]); } else if (std::string_view(argv[1]) == "validatediff") { ValidateDiff(argv[2]); + } else if (std::string_view(argv[1]) == "showdisassembly") { + ShowDisassembly(argv[2]); } else { PrintUsageAndExit(); }
diff --git a/tools/binary_size/libsupersize/viewer/caspian/file_format.cc b/tools/binary_size/libsupersize/viewer/caspian/file_format.cc index c7951a3..d8482815 100644 --- a/tools/binary_size/libsupersize/viewer/caspian/file_format.cc +++ b/tools/binary_size/libsupersize/viewer/caspian/file_format.cc
@@ -244,6 +244,7 @@ const bool has_components = info->fields["has_components"].asBool(); const bool has_padding = info->fields["has_padding"].asBool(); + const bool has_disassembly = info->fields["has_disassembly"].asBool(); // List of paths: (object_path, [source_path]). int n_paths = ReadLoneInt(&rest); @@ -441,6 +442,18 @@ CalculatePadding(&info->raw_symbols); } + if (has_disassembly) { + std::vector<const char*> disassemby_list = ReadValuesFromLine(&rest, " "); + for (const char* disassembly_idx : disassemby_list) { + int num_bytes_disassembly = ReadLoneInt(&rest); + int index = atoi(disassembly_idx); + std::string disassembly(rest, rest + num_bytes_disassembly); + info->owned_strings.push_back(disassembly); + info->raw_symbols[index].disassembly_ = &(info->owned_strings.back()); + rest += num_bytes_disassembly; + } + } + // If there are unparsed non-empty lines, something's gone wrong. CheckNoNonEmptyLinesRemain(rest);
diff --git a/tools/binary_size/libsupersize/viewer/caspian/model.cc b/tools/binary_size/libsupersize/viewer/caspian/model.cc index 5a0c3d2..76cc2da7 100644 --- a/tools/binary_size/libsupersize/viewer/caspian/model.cc +++ b/tools/binary_size/libsupersize/viewer/caspian/model.cc
@@ -116,6 +116,9 @@ const char* Symbol::Component() const { return component_; } +std::string* Symbol::Disassembly() const { + return disassembly_; +} float Symbol::Pss() const { return static_cast<float>(Size()) / NumAliases(); @@ -228,6 +231,10 @@ return (after_ ? after_ : before_)->Component(); } +std::string* DeltaSymbol::Disassembly() const { + return (after_ ? after_ : before_)->Disassembly(); +} + float DeltaSymbol::Pss() const { if (!after_) { return -before_->Pss();
diff --git a/tools/binary_size/libsupersize/viewer/caspian/model.h b/tools/binary_size/libsupersize/viewer/caspian/model.h index c01296f..c81913b 100644 --- a/tools/binary_size/libsupersize/viewer/caspian/model.h +++ b/tools/binary_size/libsupersize/viewer/caspian/model.h
@@ -105,6 +105,7 @@ virtual const char* SourcePath() const = 0; virtual const char* SectionName() const = 0; virtual const char* Component() const = 0; + virtual std::string* Disassembly() const = 0; virtual float Pss() const = 0; virtual float PssWithoutPadding() const = 0; @@ -193,6 +194,7 @@ const char* SourcePath() const override; const char* SectionName() const override; const char* Component() const override; + std::string* Disassembly() const override; float Pss() const override; @@ -216,6 +218,7 @@ const char* object_path_ = nullptr; const char* source_path_ = nullptr; const char* component_ = nullptr; + std::string* disassembly_ = nullptr; std::vector<Symbol*>* aliases_ = nullptr; const Container* container_ = nullptr; @@ -250,6 +253,7 @@ const char* SourcePath() const override; const char* SectionName() const override; const char* Component() const override; + std::string* Disassembly() const override; float Pss() const override; float PssWithoutPadding() const override;
diff --git a/tools/mac/power/benchmark.py b/tools/mac/power/benchmark.py index 71df264..bf9ebd5 100755 --- a/tools/mac/power/benchmark.py +++ b/tools/mac/power/benchmark.py
@@ -67,10 +67,6 @@ dest='chrome_user_dir', action='store', help='The user data dir to pass to Chrome via --user-data-dir') - parser.add_argument('--chromium-path', - dest='chromium_path', - action='store', - help='The path to Chromium.app') parser.add_argument('--verbose', action='store_true', @@ -102,8 +98,7 @@ def BrowserFactory(browser_name, variation): return browsers.MakeBrowserDriver(browser_name, variation, - chrome_user_dir=args.chrome_user_dir, - chromium_path=args.chromium_path) + chrome_user_dir=args.chrome_user_dir) for scenario in IterScenarios(args.scenarios, BrowserFactory,
diff --git a/tools/mac/power/browsers.py b/tools/mac/power/browsers.py index 46e9c1e..63f7e409 100644 --- a/tools/mac/power/browsers.py +++ b/tools/mac/power/browsers.py
@@ -17,18 +17,17 @@ """Abstract Base Class encapsulating browser setup and tear down. """ - def __init__(self, - browser_name: str, - process_name: str, - executable: str = None): + def __init__(self, browser_name: str, process_name: str): self.name = browser_name self.process_name = process_name self.browser_process = None - self.executable = executable - executable_path = (self.executable - if self.executable is not None else os.path.join( - "/Applications", f"{self.process_name}.app")) + # LaunchServices can get confused when an application is launched from + # more than one location and break AppleScript commands. Always launch + # browsers from /Applications to avoid such problems. + self.executable_path = (os.path.join("/Applications", + f"{self.process_name}.app")) + if not os.path.exists(executable_path): raise ValueError(f"Application doesn't exist for {browser_name}.") @@ -47,14 +46,7 @@ def GetApplicationInfo(self) -> typing.Dict: """ Returns the Info.plist data in the application folder. """ - # `executable` may be either a path or an identifier. - if self.executable is not None: - executable_path = self.executable - else: - executable_path = os.path.join("/Applications", - f"{self.process_name}.app") - - plist_path = os.path.join(executable_path, "Contents", "Info.plist") + plist_path = os.path.join(self.executable_path, "Contents", "Info.plist") with open(plist_path, 'rb') as plist_file: return plistlib.load(plist_file) @@ -80,7 +72,7 @@ class SafariDriver(BrowserDriver): def __init__(self, extra_args=[]): - super().__init__("safari", "", "Safari") + super().__init__("safari", "Safari") self.extra_args = extra_args def Launch(self): @@ -102,19 +94,15 @@ browser_name: str, variation: str, process_name: str, - executable_path=None, extra_args=[]): if variation != "": browser_name += f"_{variation}" - super().__init__(browser_name, process_name, executable_path) + super().__init__(browser_name, process_name) self.extra_args = extra_args def Launch(self): - if self.executable is not None: - open_args = [self.executable] - else: - open_args = ["-a", self.process_name] + open_args = ["-a", self.process_name] subprocess.call(["open"] + open_args + ["--args"] + ["--enable-benchmarking", "--disable-stack-profiler"] + self.extra_args) @@ -155,11 +143,10 @@ extra_args=extra_args) -def Chromium(variation, executable_path=None, extra_args=[]): +def Chromium(variation, extra_args=[]): return ChromiumDriver("chromium", variation, "Chromium", - executable_path=executable_path, extra_args=extra_args) @@ -176,10 +163,8 @@ ] -def MakeBrowserDriver(browser_name: str, - variation: str, - chrome_user_dir=None, - chromium_path=None) -> BrowserDriver: +def MakeBrowserDriver(browser_name: str, variation: str, + chrome_user_dir=None) -> BrowserDriver: """Creates browser driver by name. Args: @@ -190,7 +175,7 @@ if "safari" == browser_name: return Safari() - if browser_name in ["chrome", "chromium", "canary"]: + if browser_name in ["chrome", "chromium", "canary", "edge"]: if chrome_user_dir: chrome_extra_arg = [f"--user-data-dir={chrome_user_dir}"] else: @@ -202,7 +187,7 @@ if browser_name == "canary": return Canary(variation, extra_args=chrome_extra_arg) elif browser_name == "chromium": - return Chromium(variation, - executable_path=chromium_path, - extra_args=chrome_extra_arg) + return Chromium(variation, extra_args=chrome_extra_arg) + elif browser_name == "edge": + return Edge(variation, extra_args=chrome_extra_arg) return None
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 512cafef..93f0932c 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -494,6 +494,7 @@ 'gpu-fyi-chromeos-jacuzzi-exp': 'gpu_tests_chromeos_jacuzzi_release_trybot', 'ChromeOS FYI Release (kevin)': 'gpu_tests_chromeos_kevin_release_trybot_dcheck_off_no_symbols', 'gpu-fyi-chromeos-octopus-exp': 'gpu_tests_chromeos_octopus_release_trybot', + 'gpu-fyi-chromeos-zork-exp': 'gpu_tests_chromeos_zork_release_trybot', 'GPU FYI Android arm Builder': 'gpu_tests_android_release_trybot_reclient', 'GPU FYI Android arm64 Builder': 'gpu_tests_android_release_trybot_arm64_reclient', 'GPU FYI Lacros x64 Builder': 'gpu_tests_ozone_linux_non_x11_release_trybot', @@ -987,6 +988,7 @@ 'gpu-fyi-try-chromeos-jacuzzi-exp': 'gpu_tests_chromeos_jacuzzi_release_trybot', 'gpu-fyi-try-chromeos-kevin': 'gpu_tests_chromeos_kevin_release_trybot_dcheck_off_no_symbols', 'gpu-fyi-try-chromeos-octopus-exp': 'gpu_tests_chromeos_octopus_release_trybot', + 'gpu-fyi-try-chromeos-zork-exp': 'gpu_tests_chromeos_zork_release_trybot', 'lacros-amd64-generic-rel': 'chromeos_amd64-generic_lacros_rel_dchecks', 'lacros-arm-generic-rel': 'chromeos_arm-generic_lacros_rel_dchecks', 'linux-chromeos-inverse-fieldtrials-fyi-rel': 'chromeos_with_codecs_release_trybot_invert_fieldtrials', @@ -2490,6 +2492,10 @@ 'gpu_tests', 'chromeos_device', 'octopus', 'release_trybot', ], + 'gpu_tests_chromeos_zork_release_trybot': [ + 'gpu_tests', 'chromeos_device', 'zork', 'release_trybot', + ], + 'gpu_tests_debug_bot': [ 'gpu_tests', 'debug_bot', ], @@ -4345,5 +4351,9 @@ 'x86_host': { 'gn_args': 'host_cpu="x86"', }, + + 'zork': { + 'args_file': '//build/args/chromeos/zork.gni', + }, }, }
diff --git a/tools/mb/mb_config_expectations/chromium.gpu.fyi.json b/tools/mb/mb_config_expectations/chromium.gpu.fyi.json index 6467fa81..bf3779b 100644 --- a/tools/mb/mb_config_expectations/chromium.gpu.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.gpu.fyi.json
@@ -434,5 +434,20 @@ "symbol_level": 0, "use_goma": true } + }, + "gpu-fyi-chromeos-zork-exp": { + "args_file": "//build/args/chromeos/zork.gni", + "gn_args": { + "blink_enable_generated_code_formatting": false, + "dcheck_always_on": true, + "ffmpeg_branding": "Chrome", + "is_chromeos_device": true, + "is_component_build": false, + "is_debug": false, + "ozone_platform_headless": true, + "proprietary_codecs": true, + "symbol_level": 0, + "use_goma": true + } } } \ No newline at end of file
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json b/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json index ad7ba681..12b20b07 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json
@@ -147,6 +147,21 @@ "use_goma": true } }, + "gpu-fyi-try-chromeos-zork-exp": { + "args_file": "//build/args/chromeos/zork.gni", + "gn_args": { + "blink_enable_generated_code_formatting": false, + "dcheck_always_on": true, + "ffmpeg_branding": "Chrome", + "is_chromeos_device": true, + "is_component_build": false, + "is_debug": false, + "ozone_platform_headless": true, + "proprietary_codecs": true, + "symbol_level": 0, + "use_goma": true + } + }, "lacros-amd64-generic-rel": { "args_file": "//build/args/chromeos/amd64-generic-crostoolchain.gni", "gn_args": {
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 70d291e..635908a 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -6064,8 +6064,11 @@ <action name="ContentSuggestions.Feed.CardAction.ManageHidden"> <owner>edchin@google.com</owner> + <owner>harringtond@chromium.org</owner> + <owner>carlosk@chromium.org</owner> + <owner>feed@chromium.org</owner> <description> - TODO(edchin): Please enter the description of the metric. + The user selected the 'manage hidden' option from the Feed header menu. </description> </action> @@ -6221,6 +6224,27 @@ </description> </action> +<action name="ContentSuggestions.Feed.HeaderAction.ManageFollowing"> + <owner>edchin@google.com</owner> + <owner>adamta@google.com</owner> + <owner>sczs@chromium.org</owner> + <owner>feed@chromium.org</owner> + <description> + The user selected the 'Manage Following' option in the feed management + surface. + </description> +</action> + +<action name="ContentSuggestions.Feed.HeaderAction.ManageHidden"> + <owner>edchin@google.com</owner> + <owner>adamta@google.com</owner> + <owner>sczs@chromium.org</owner> + <owner>feed@chromium.org</owner> + <description> + The user selected the 'Manage Hidden' option in the feed management surface. + </description> +</action> + <action name="ContentSuggestions.Feed.HeaderAction.ManageInterests"> <owner>adamta@google.org</owner> <owner>sczs@chromium.org</owner>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index fc7f5aa..51171bd 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -59466,6 +59466,7 @@ <int value="710" label="base-palette"/> <int value="711" label="override-colors"/> <int value="712" label="page-transition-tag"/> + <int value="713" label="object-view-box"/> </enum> <enum name="MappedEditingCommands"> @@ -66432,6 +66433,20 @@ <int value="2" label="Unknown"/> </enum> +<enum name="OddOffset"> + <int value="0" label="Even offset"/> + <int value="1" label="Odd x only"/> + <int value="2" label="Odd y only"/> + <int value="3" label="Odd x and y"/> +</enum> + +<enum name="OddSize"> + <int value="0" label="Even size"/> + <int value="1" label="Odd width only"/> + <int value="2" label="Odd height only"/> + <int value="3" label="Odd width and height"/> +</enum> + <enum name="OfficeFileHandler"> <int value="0" label="Other"/> <int value="1" label="Web Drive Office"/>
diff --git a/tools/metrics/histograms/metadata/account_manager/histograms.xml b/tools/metrics/histograms/metadata/account_manager/histograms.xml index 62c77b7..063be0d 100644 --- a/tools/metrics/histograms/metadata/account_manager/histograms.xml +++ b/tools/metrics/histograms/metadata/account_manager/histograms.xml
@@ -24,7 +24,7 @@ <histograms> <histogram name="AccountManager.AccountAdditionResultStatus" - enum="AccountManagerAccountAdditionResultStatus" expires_after="2022-04-24"> + enum="AccountManagerAccountAdditionResultStatus" expires_after="2023-01-31"> <owner>sinhak@chromium.org</owner> <owner>anastasiian@chromium.org</owner> <summary> @@ -36,7 +36,7 @@ </histogram> <histogram name="AccountManager.AccountAdditionSource" - enum="AccountManagerAccountAdditionSource" expires_after="2022-04-24"> + enum="AccountManagerAccountAdditionSource" expires_after="2023-01-31"> <owner>sinhak@chromium.org</owner> <owner>anastasiian@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/compositing/histograms.xml b/tools/metrics/histograms/metadata/compositing/histograms.xml index 792e33d269..e661d832 100644 --- a/tools/metrics/histograms/metadata/compositing/histograms.xml +++ b/tools/metrics/histograms/metadata/compositing/histograms.xml
@@ -478,6 +478,26 @@ </summary> </histogram> +<histogram name="Compositing.Renderer.CALayer.OddOffsetVideo" enum="OddOffset" + expires_after="2022-09-17"> + <owner>magchen@chromium.org</owner> + <owner>ccameron@chromium.org</owner> + <summary> + Recorded whether the draw frame contains an odd offset video when processing + CALayerOverlay. + </summary> +</histogram> + +<histogram name="Compositing.Renderer.CALayer.OddSizedVideo" enum="OddSize" + expires_after="2022-09-17"> + <owner>magchen@chromium.org</owner> + <owner>ccameron@chromium.org</owner> + <summary> + Recorded whether the draw frame contains an odd sized video when processing + CALayerOverlay. + </summary> +</histogram> + <histogram name="Compositing.Renderer.CALayerResult" enum="CALayerResult" expires_after="2022-09-11"> <owner>ccameron@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/families/histograms.xml b/tools/metrics/histograms/metadata/families/histograms.xml index 9affca4..035732b3a 100644 --- a/tools/metrics/histograms/metadata/families/histograms.xml +++ b/tools/metrics/histograms/metadata/families/histograms.xml
@@ -88,6 +88,16 @@ </summary> </histogram> +<histogram name="ChildAccountReconcilor.ForcedUserExitOnReconcileError" + enum="BooleanHit" expires_after="2023-01-20"> + <owner>agawronska@chromium.org</owner> + <owner>cros-families-eng@google.com</owner> + <summary> + Number of forced logouts for child accounts on an account reconciliation + error. Check `ChromeOSLimitedAccessAccountReconcilorDelegate`. + </summary> +</histogram> + <histogram name="ChromeOS.FamilyLink.ChildStatusReportRequest.Size" units="KB" expires_after="2023-01-20"> <owner>tobyhuang@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index 238c75b..843c4636 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -2572,9 +2572,47 @@ </summary> </histogram> +<histogram + name="Media.GpuMemoryBufferVideoFramePool.Offset.{GMBVideoPixelFormat}" + enum="OddOffset" expires_after="2022-09-17"> + <owner>magchen@chromium.org</owner> + <owner>ccameron@chromium.org</owner> + <summary> + Record whether the input VideoFrame in GpuMemoryBufferVideoFramePool has a + odd offset. Emitted on VideoFrame arrival. + </summary> + <token key="GMBVideoPixelFormat"> + <variant name="I420"/> + <variant name="I420A"/> + <variant name="NV12"/> + <variant name="UNKNOWN"/> + <variant name="YUV420P10"/> + <variant name="YV12"/> + </token> +</histogram> + +<histogram + name="Media.GpuMemoryBufferVideoFramePool.Size.{GMBVideoPixelFormat}" + enum="OddSize" expires_after="2022-09-17"> + <owner>magchen@chromium.org</owner> + <owner>ccameron@chromium.org</owner> + <summary> + Record whether the input VideoFrame in GpuMemoryBufferVideoFramePool has a + odd size. Emitted on VideoFrame arrival. + </summary> + <token key="GMBVideoPixelFormat"> + <variant name="I420"/> + <variant name="I420A"/> + <variant name="NV12"/> + <variant name="UNKNOWN"/> + <variant name="YUV420P10"/> + <variant name="YV12"/> + </token> +</histogram> + <histogram name="Media.GpuMemoryBufferVideoFramePool.UnsupportedFormat" - enum="VideoPixelFormatUnion" expires_after="2022-01-06"> - <owner>dcastagna@chromium.org</owner> + enum="VideoPixelFormatUnion" expires_after="2022-09-17"> + <owner>magchen@chromium.org</owner> <owner>mcasas@chromium.org</owner> <summary> GpuMemoryBufferVideoFramePool is called with an unsupported VideoFrame pixel
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml index eb30868..5cb95b8e 100644 --- a/tools/metrics/histograms/metadata/omnibox/histograms.xml +++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -271,6 +271,60 @@ </summary> </histogram> +<histogram name="Omnibox.DocumentSuggest.RequestTime" units="ms" + expires_after="2022-08-14"> + <owner>manukh@chromium.org</owner> + <owner>jdonnelly@chromium.org</owner> + <summary> + Measures the duration between when the async backend request was sent and + response received. + + Recorded exactly once per backend request. This will be a subset of times + document suggestions were requested, as 1) the provider is debounced, 2) the + provider may be interrupted (e.g. due to a new input) before the request is + sent (i.e. before the oauth token is ready), and 3) some provider requests + are filtered (e.g. input too short). + </summary> +</histogram> + +<histogram name="Omnibox.DocumentSuggest.RequestTime.Interrupted" units="ms" + expires_after="2022-08-14"> + <owner>manukh@chromium.org</owner> + <owner>jdonnelly@chromium.org</owner> + <summary> + Measures the duration between when the async backend request was sent and + response received. + + Recorded at most once per backend request. This will be a subset of times + document suggestions were requested, as 1) the provider is debounced, 2) the + provider may be interrupted (e.g. due to a new input) before the request is + sent (i.e. before the oauth token is ready), and 3) some provider requests + are filtered (e.g. input too short). + + Only recorded if the backend request was invalidated; i.e., the provider was + interrupted before the response was received. + </summary> +</histogram> + +<histogram name="Omnibox.DocumentSuggest.RequestTime.NotInterrupted" units="ms" + expires_after="2022-08-14"> + <owner>manukh@chromium.org</owner> + <owner>jdonnelly@chromium.org</owner> + <summary> + Measures the duration between when the async backend request was sent and + response received. + + Recorded at most once per backend request. This will be a subset of times + document suggestions were requested, as 1) the provider is debounced, 2) the + provider may be interrupted (e.g. due to a new input) before the request is + sent (i.e. before the oauth token is ready), and 3) some provider requests + are filtered (e.g. input too short). + + Only recorded if the backend request was not invalidated; i.e., the provider + was not interrupted before the response was received. + </summary> +</histogram> + <histogram name="Omnibox.DocumentSuggest.ResultCount" units="count" expires_after="2022-08-14"> <owner>manukh@chromium.org</owner> @@ -283,6 +337,55 @@ </summary> </histogram> +<histogram name="Omnibox.DocumentSuggest.TotalTime" units="ms" + expires_after="2022-08-14"> + <owner>manukh@chromium.org</owner> + <owner>jdonnelly@chromium.org</owner> + <summary> + Measures the duration between when the provider begins (after a debouncing + delay) and ends. + + Recorded exactly once per processed provider request. This will be a subset + of times document suggestions were requested, as 1) the provider is + debounced, and 2) some provider requests are filtered (e.g. input too + short). + </summary> +</histogram> + +<histogram name="Omnibox.DocumentSuggest.TotalTime.Interrupted" units="ms" + expires_after="2022-08-14"> + <owner>manukh@chromium.org</owner> + <owner>jdonnelly@chromium.org</owner> + <summary> + Measures the duration between when the provider begins (after a debouncing + delay) and ends. + + Recorded at most once per processed provider request. This will be a subset + of times document suggestions were requested, as 1) the provider is + debounced, and 2) some provider requests are filtered (e.g. input too + short). + + Only recorded if the provider was interrupted (e.g. due to a new input). + </summary> +</histogram> + +<histogram name="Omnibox.DocumentSuggest.TotalTime.NotInterrupted" units="ms" + expires_after="2022-08-14"> + <owner>manukh@chromium.org</owner> + <owner>jdonnelly@chromium.org</owner> + <summary> + Measures the duration between when the provider begins (after a debouncing + delay) and ends. + + Recorded at most once per processed provider request. This will be a subset + of times document suggestions were requested, as 1) the provider is + debounced, and 2) some provider requests are filtered (e.g. input too + short). + + Only recorded if the provider was not interrupted (e.g. due to a new input). + </summary> +</histogram> + <histogram name="Omnibox.EnteredKeywordMode2" enum="OmniboxEnteredKeywordMode2" expires_after="2022-08-07"> <owner>jdonnelly@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index 0620137e..9da24556 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -1832,16 +1832,6 @@ </summary> </histogram> -<histogram name="ChildAccountReconcilor.ForcedUserExitOnReconcileError" - enum="BooleanHit" expires_after="2021-10-04"> - <owner>sinhak@chromium.org</owner> - <owner>escordeiro@chromium.org</owner> - <summary> - Number of forced logouts for child accounts on an account reconciliation - error. Check |ChromeOSChildAccountReconcilorDelegate|. - </summary> -</histogram> - <histogram name="ChildProcess.BadMessgeTerminated" enum="ProcessType2" expires_after="M81"> <owner>jam@chromium.org</owner>
diff --git a/tools/perf/core/bot_platforms.py b/tools/perf/core/bot_platforms.py index e2cdc315..bd1fdfc 100644 --- a/tools/perf/core/bot_platforms.py +++ b/tools/perf/core/bot_platforms.py
@@ -498,7 +498,6 @@ ]) _FUCHSIA_ATLAS_PERF_FYI_BENCHMARK_CONFIGS = PerfSuite([ _GetBenchmarkConfig('system_health.common_desktop'), - _GetBenchmarkConfig('rendering.desktop'), _GetBenchmarkConfig('power.desktop'), _GetBenchmarkConfig('media.desktop'), _GetBenchmarkConfig('speedometer'),
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 76e8ab8..4d4fc10 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -6,7 +6,7 @@ }, "win": { "hash": "15b2482fb98e1aa361460722abf1ecb3ffab894e", - "remote_path": "perfetto_binaries/trace_processor_shell/win/9b8eaa21f16d10cffefdf758a8b900e014e4788d/trace_processor_shell.exe" + "remote_path": "perfetto_binaries/trace_processor_shell/win/6dadd2c3b267bd4776762dc5c0a4acb391abbc5e/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", @@ -14,7 +14,7 @@ }, "mac": { "hash": "72ae2950a4333c3450bee06ba63cbe4578da7ddb", - "remote_path": "perfetto_binaries/trace_processor_shell/mac/9b8eaa21f16d10cffefdf758a8b900e014e4788d/trace_processor_shell" + "remote_path": "perfetto_binaries/trace_processor_shell/mac/5f95e723334de734243833fd44456be8951ff0a0/trace_processor_shell" }, "mac_arm64": { "hash": "c0397e87456ad6c6a7aa0133e5b81c97adbab4ab", @@ -22,7 +22,7 @@ }, "linux": { "hash": "6b0a9130ba5c2cc1c6ff67bf6fa3064297bc7f19", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/9b8eaa21f16d10cffefdf758a8b900e014e4788d/trace_processor_shell" + "remote_path": "perfetto_binaries/trace_processor_shell/linux/5f95e723334de734243833fd44456be8951ff0a0/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/perf/core/shard_maps/fuchsia-perf-atlas-fyi_map.json b/tools/perf/core/shard_maps/fuchsia-perf-atlas-fyi_map.json index 9067af5f..2c6af85b 100644 --- a/tools/perf/core/shard_maps/fuchsia-perf-atlas-fyi_map.json +++ b/tools/perf/core/shard_maps/fuchsia-perf-atlas-fyi_map.json
@@ -8,13 +8,7 @@ "abridged": false }, "media.desktop": { - "abridged": false - }, - "power.desktop": { - "abridged": false - }, - "rendering.desktop": { - "end": 64, + "end": 10, "abridged": false } }, @@ -33,17 +27,11 @@ }, "1": { "benchmarks": { - "rendering.desktop": { - "begin": 64, - "end": 260, + "media.desktop": { + "begin": 10, "abridged": false - } - } - }, - "2": { - "benchmarks": { - "rendering.desktop": { - "begin": 260, + }, + "power.desktop": { "abridged": false }, "speedometer": { @@ -53,7 +41,16 @@ "abridged": false }, "system_health.common_desktop": { - "end": 38, + "end": 7, + "abridged": false + } + } + }, + "2": { + "benchmarks": { + "system_health.common_desktop": { + "begin": 7, + "end": 60, "abridged": false } } @@ -61,20 +58,20 @@ "3": { "benchmarks": { "system_health.common_desktop": { - "begin": 38, + "begin": 60, "abridged": false } } }, "extra_infos": { - "num_stories": 457, - "predicted_min_shard_time": 1956.0, - "predicted_min_shard_index": 3, - "predicted_max_shard_time": 1972.0, + "num_stories": 127, + "predicted_min_shard_time": 1542.0, + "predicted_min_shard_index": 0, + "predicted_max_shard_time": 1579.0, "predicted_max_shard_index": 2, - "shard #0": 1960.0, - "shard #1": 1960, - "shard #2": 1972.0, - "shard #3": 1956.0 + "shard #0": 1542.0, + "shard #1": 1577.0, + "shard #2": 1579.0, + "shard #3": 1578.0 } } \ No newline at end of file
diff --git a/tools/perf/core/shard_maps/timing_data/fuchsia-perf-atlas-fyi_timing.json b/tools/perf/core/shard_maps/timing_data/fuchsia-perf-atlas-fyi_timing.json index f042b00..947d7ab 100644 --- a/tools/perf/core/shard_maps/timing_data/fuchsia-perf-atlas-fyi_timing.json +++ b/tools/perf/core/shard_maps/timing_data/fuchsia-perf-atlas-fyi_timing.json
@@ -1,50 +1,226 @@ [ { + "duration": "199.0", + "name": "jetstream/JetStream" + }, + { + "duration": "245.0", + "name": "jetstream2/JetStream2" + }, + { + "duration": "15.0", + "name": "media.desktop/mse.html?media=aac_audio.mp4" + }, + { + "duration": "15.0", + "name": "media.desktop/mse.html?media=aac_audio.mp4,h264_video.mp4" + }, + { + "duration": "15.0", + "name": "media.desktop/mse.html?media=h264_video.mp4" + }, + { + "duration": "13.0", + "name": "media.desktop/mse.html?media=tulip0.av1.mp4" + }, + { + "duration": "15.0", + "name": "media.desktop/mse.html?media=tulip2.vp9.webm" + }, + { + "duration": "132.0", + "name": "media.desktop/video.html?src=boat_1080p60fps_vp9.webm" + }, + { + "duration": "18.0", + "name": "media.desktop/video.html?src=crowd1080.mp4" + }, + { + "duration": "19.0", + "name": "media.desktop/video.html?src=crowd1080.webm" + }, + { + "duration": "5.0", + "name": "media.desktop/video.html?src=crowd1080_vp9.webm" + }, + { + "duration": "131.0", + "name": "media.desktop/video.html?src=foodmarket_720p30fps.mp4" + }, + { + "duration": "13.0", + "name": "media.desktop/video.html?src=garden2_10s.mp4&seek" + }, + { + "duration": "10.0", + "name": "media.desktop/video.html?src=garden2_10s.webm&seek" + }, + { + "duration": "5.0", + "name": "media.desktop/video.html?src=smpte_3840x2160_60fps_vp9.webm&seek" + }, + { + "duration": "19.0", + "name": "media.desktop/video.html?src=tulip0.av1.mp4" + }, + { + "duration": "10.0", + "name": "media.desktop/video.html?src=tulip0.av1.mp4&seek" + }, + { + "duration": "25.0", + "name": "media.desktop/video.html?src=tulip2.m4a&type=audio" + }, + { + "duration": "25.0", + "name": "media.desktop/video.html?src=tulip2.mp3&type=audio" + }, + { + "duration": "9.0", + "name": "media.desktop/video.html?src=tulip2.mp3&type=audio&seek" + }, + { + "duration": "26.0", + "name": "media.desktop/video.html?src=tulip2.mp4" + }, + { + "duration": "45.0", + "name": "media.desktop/video.html?src=tulip2.mp4&busyjs" + }, + { + "duration": "25.0", + "name": "media.desktop/video.html?src=tulip2.ogg&type=audio" + }, + { + "duration": "9.0", + "name": "media.desktop/video.html?src=tulip2.ogg&type=audio&seek" + }, + { + "duration": "5.0", + "name": "media.desktop/video.html?src=tulip2.vp9.webm" + }, + { + "duration": "5.0", + "name": "media.desktop/video.html?src=tulip2.vp9.webm&background" + }, + { + "duration": "5.0", + "name": "media.desktop/video.html?src=tulip2.vp9.webm_WiFi" + }, + { + "duration": "45.0", + "name": "power.desktop/TrivialAnimationPageSharedPageState" + }, + { + "duration": "44.0", + "name": "power.desktop/TrivialBlinkingCursorPageSharedPageState" + }, + { + "duration": "44.0", + "name": "power.desktop/TrivialBlurAnimationPageSharedPageState" + }, + { + "duration": "45.0", + "name": "power.desktop/TrivialCanvasPageSharedPageState" + }, + { + "duration": "45.0", + "name": "power.desktop/TrivialFullscreenVideoPageSharedPageState" + }, + { + "duration": "44.0", + "name": "power.desktop/TrivialGifPageSharedPageState" + }, + { + "duration": "45.0", + "name": "power.desktop/TrivialScrollingPageSharedPageState" + }, + { + "duration": "45.0", + "name": "power.desktop/TrivialWebGLPageSharedPageState" + }, + { + "duration": "68.0", + "name": "power.desktop/abcnews" + }, + { + "duration": "46.0", + "name": "power.desktop/indiatimes" + }, + { + "duration": "45.0", + "name": "power.desktop/instagram" + }, + { + "duration": "45.0", + "name": "power.desktop/microsoft" + }, + { + "duration": "47.0", + "name": "power.desktop/sina" + }, + { + "duration": "46.0", + "name": "power.desktop/slideshare" + }, + { + "duration": "68.0", + "name": "power.desktop/uol" + }, + { + "duration": "79.0", + "name": "speedometer/http://browserbench.org/Speedometer/" + }, + { + "duration": "123.0", + "name": "speedometer2/Speedometer2" + }, + { "duration": "37.0", "name": "system_health.common_desktop/browse:media:googleplaystore:2021" }, { - "duration": "11.0", + "duration": "10.0", "name": "system_health.common_desktop/browse:media:imgur" }, { - "duration": "108.0", + "duration": "117.0", "name": "system_health.common_desktop/browse:media:pinterest:2018" }, { - "duration": "78.0", + "duration": "87.0", "name": "system_health.common_desktop/browse:media:tumblr:2018" }, { - "duration": "18.0", + "duration": "27.0", "name": "system_health.common_desktop/browse:media:youtube:2019" }, { - "duration": "81.0", + "duration": "92.0", "name": "system_health.common_desktop/browse:media:youtubetv:2019" }, { - "duration": "90.0", + "duration": "99.0", "name": "system_health.common_desktop/browse:media:youtubetv_watch:2020" }, { - "duration": "52.0", + "duration": "51.0", "name": "system_health.common_desktop/browse:news:cnn:2021" }, { - "duration": "54.0", + "duration": "53.0", "name": "system_health.common_desktop/browse:news:flipboard:2020" }, { - "duration": "58.0", + "duration": "57.0", "name": "system_health.common_desktop/browse:news:hackernews:2020" }, { - "duration": "92.0", + "duration": "101.0", "name": "system_health.common_desktop/browse:news:nytimes:2020" }, { - "duration": "81.0", + "duration": "90.0", "name": "system_health.common_desktop/browse:news:reddit:2020" }, { @@ -60,15 +236,15 @@ "name": "system_health.common_desktop/browse:social:facebook_infinite_scroll:2018" }, { - "duration": "71.0", + "duration": "81.0", "name": "system_health.common_desktop/browse:social:tumblr_infinite_scroll:2018" }, { - "duration": "69.0", + "duration": "79.0", "name": "system_health.common_desktop/browse:social:twitter:2018" }, { - "duration": "76.0", + "duration": "87.0", "name": "system_health.common_desktop/browse:social:twitter_infinite_scroll:2018" }, { @@ -76,11 +252,11 @@ "name": "system_health.common_desktop/browse:tech:discourse_infinite_scroll:2018" }, { - "duration": "84.0", + "duration": "81.0", "name": "system_health.common_desktop/browse:tools:autocad:2021" }, { - "duration": "41.0", + "duration": "40.0", "name": "system_health.common_desktop/browse:tools:docs_scrolling" }, { @@ -96,7 +272,7 @@ "name": "system_health.common_desktop/browse:tools:gmail-labelclick:2020" }, { - "duration": "39.0", + "duration": "38.0", "name": "system_health.common_desktop/browse:tools:gmail-openconversation:2020" }, { @@ -104,15 +280,15 @@ "name": "system_health.common_desktop/browse:tools:gmail-search:2020" }, { - "duration": "79.0", + "duration": "78.0", "name": "system_health.common_desktop/browse:tools:maps:2019" }, { - "duration": "18.0", + "duration": "27.0", "name": "system_health.common_desktop/browse:tools:photoshop:2021" }, { - "duration": "18.0", + "duration": "27.0", "name": "system_health.common_desktop/browse:tools:photoshop_warm:2021" }, { @@ -120,7 +296,7 @@ "name": "system_health.common_desktop/browse:tools:sheets:2019" }, { - "duration": "8.0", + "duration": "7.0", "name": "system_health.common_desktop/browse_accessibility:media:youtube" }, { @@ -132,23 +308,23 @@ "name": "system_health.common_desktop/load:chrome:blank" }, { - "duration": "23.0", + "duration": "22.0", "name": "system_health.common_desktop/load:games:alphabetty:2018" }, { - "duration": "22.0", + "duration": "21.0", "name": "system_health.common_desktop/load:games:bubbles:2020" }, { - "duration": "24.0", + "duration": "29.0", "name": "system_health.common_desktop/load:games:lazors" }, { - "duration": "26.0", + "duration": "28.0", "name": "system_health.common_desktop/load:games:miniclip:2018" }, { - "duration": "28.0", + "duration": "29.0", "name": "system_health.common_desktop/load:games:spychase:2018" }, { @@ -156,43 +332,43 @@ "name": "system_health.common_desktop/load:media:9gag" }, { - "duration": "32.0", + "duration": "38.0", "name": "system_health.common_desktop/load:media:dailymotion:2019" }, { - "duration": "25.0", + "duration": "26.0", "name": "system_health.common_desktop/load:media:facebook_feed:desktop:2020" }, { - "duration": "25.0", + "duration": "26.0", "name": "system_health.common_desktop/load:media:facebook_photos:2018" }, { - "duration": "27.0", + "duration": "28.0", "name": "system_health.common_desktop/load:media:facebook_photos:desktop:2020" }, { - "duration": "25.0", + "duration": "27.0", "name": "system_health.common_desktop/load:media:flickr:2018" }, { - "duration": "16.0", + "duration": "14.0", "name": "system_health.common_desktop/load:media:google_images:2018" }, { - "duration": "25.0", + "duration": "27.0", "name": "system_health.common_desktop/load:media:imgur:2018" }, { - "duration": "27.0", + "duration": "29.0", "name": "system_health.common_desktop/load:media:soundcloud:2018" }, { - "duration": "24.0", + "duration": "26.0", "name": "system_health.common_desktop/load:media:youtube:2018" }, { - "duration": "23.0", + "duration": "25.0", "name": "system_health.common_desktop/load:media:youtubelivingroom:2020" }, { @@ -204,31 +380,31 @@ "name": "system_health.common_desktop/load:news:cnn:2020" }, { - "duration": "24.0", + "duration": "28.0", "name": "system_health.common_desktop/load:news:flipboard" }, { - "duration": "22.0", + "duration": "24.0", "name": "system_health.common_desktop/load:news:hackernews:2018" }, { - "duration": "29.0", + "duration": "31.0", "name": "system_health.common_desktop/load:news:nytimes:2018" }, { - "duration": "25.0", + "duration": "27.0", "name": "system_health.common_desktop/load:news:qq:2018" }, { - "duration": "27.0", + "duration": "28.0", "name": "system_health.common_desktop/load:news:reddit:2018" }, { - "duration": "24.0", + "duration": "26.0", "name": "system_health.common_desktop/load:news:wikipedia:2018" }, { - "duration": "23.0", + "duration": "22.0", "name": "system_health.common_desktop/load:search:amazon:2018" }, { @@ -240,35 +416,35 @@ "name": "system_health.common_desktop/load:search:ebay:2018" }, { - "duration": "25.0", + "duration": "27.0", "name": "system_health.common_desktop/load:search:flipkart:2018" }, { - "duration": "25.0", + "duration": "26.0", "name": "system_health.common_desktop/load:search:google:2018" }, { - "duration": "24.0", + "duration": "26.0", "name": "system_health.common_desktop/load:search:taobao:2018" }, { - "duration": "23.0", + "duration": "25.0", "name": "system_health.common_desktop/load:search:yahoo:2018" }, { - "duration": "24.0", + "duration": "26.0", "name": "system_health.common_desktop/load:search:yandex:2018" }, { - "duration": "24.0", + "duration": "26.0", "name": "system_health.common_desktop/load:social:instagram:2018" }, { - "duration": "27.0", + "duration": "29.0", "name": "system_health.common_desktop/load:social:pinterest:2019" }, { - "duration": "25.0", + "duration": "26.0", "name": "system_health.common_desktop/load:social:vk:2018" }, { @@ -276,47 +452,47 @@ "name": "system_health.common_desktop/load:tools:chat:2020" }, { - "duration": "79.0", + "duration": "76.0", "name": "system_health.common_desktop/load:tools:docs:2019" }, { - "duration": "25.0", + "duration": "26.0", "name": "system_health.common_desktop/load:tools:drive:2019" }, { - "duration": "10.0", + "duration": "12.0", "name": "system_health.common_desktop/load:tools:gmail:2019" }, { - "duration": "25.0", + "duration": "27.0", "name": "system_health.common_desktop/load:tools:stackoverflow:2018" }, { - "duration": "25.0", + "duration": "26.0", "name": "system_health.common_desktop/load:tools:weather:2019" }, { - "duration": "23.0", + "duration": "22.0", "name": "system_health.common_desktop/load_accessibility:media:wikipedia:2018" }, { - "duration": "22.0", + "duration": "21.0", "name": "system_health.common_desktop/load_accessibility:shopping:amazon:2018" }, { - "duration": "136.0", + "duration": "138.0", "name": "system_health.common_desktop/long_running:tools:gmail-background" }, { - "duration": "145.0", + "duration": "147.0", "name": "system_health.common_desktop/long_running:tools:gmail-foreground" }, { - "duration": "18.0", + "duration": "27.0", "name": "system_health.common_desktop/multitab:misc:typical24" }, { - "duration": "142.0", + "duration": "153.0", "name": "system_health.common_desktop/multitab:misc:typical24:2018" }, { @@ -324,7 +500,7 @@ "name": "system_health.common_desktop/play:media:google_play_music" }, { - "duration": "62.0", + "duration": "71.0", "name": "system_health.common_desktop/play:media:soundcloud:2018" }, {
diff --git a/ui/accessibility/accessibility_features.cc b/ui/accessibility/accessibility_features.cc index fe54ebf..455d0b51 100644 --- a/ui/accessibility/accessibility_features.cc +++ b/ui/accessibility/accessibility_features.cc
@@ -203,11 +203,11 @@ } #endif // BUILDFLAG(IS_ANDROID) -const base::Feature kReaderModeSidePanel{"ReaderModeSidePanel", - base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kReadAnything{"ReadAnything", + base::FEATURE_DISABLED_BY_DEFAULT}; -bool IsReaderModeSidePanelEnabled() { - return base::FeatureList::IsEnabled(::features::kReaderModeSidePanel); +bool IsReadAnythingEnabled() { + return base::FeatureList::IsEnabled(::features::kReadAnything); } #if !BUILDFLAG(IS_ANDROID)
diff --git a/ui/accessibility/accessibility_features.h b/ui/accessibility/accessibility_features.h index 98d7859..06466e31 100644 --- a/ui/accessibility/accessibility_features.h +++ b/ui/accessibility/accessibility_features.h
@@ -175,12 +175,11 @@ AX_BASE_EXPORT bool IsComputeAXModeEnabled(); #endif // BUILDFLAG(IS_ANDROID) -AX_BASE_EXPORT extern const base::Feature kReaderModeSidePanel; +AX_BASE_EXPORT extern const base::Feature kReadAnything; -// Returns true if reader mode in a side panel is enabled. This feature shows -// users websites, such as articles, in a comfortable reading experience in a -// side panel. -AX_BASE_EXPORT bool IsReaderModeSidePanelEnabled(); +// Returns true if read anything is enabled. This feature shows users websites, +// such as articles, in a comfortable reading experience in a side panel. +AX_BASE_EXPORT bool IsReadAnythingEnabled(); #if !BUILDFLAG(IS_ANDROID) // Enables using Screen AI library to add metadata for accessibility tools.
diff --git a/ui/accessibility/accessibility_switches.cc b/ui/accessibility/accessibility_switches.cc index f7f6d43..09dfce1 100644 --- a/ui/accessibility/accessibility_switches.cc +++ b/ui/accessibility/accessibility_switches.cc
@@ -36,11 +36,6 @@ // zooming in. const char kEnableMagnifierDebugDrawRect[] = "enable-magnifier-debug-draw-rect"; -// Enables multistep automation for Switch Access, which is a 2021 accessibility -// sprint project and hasn't launched yet. -const char kEnableExperimentalAccessibilitySwitchAccessMultistepAutomation[] = - "enable-experimental-accessibility-switch-access-multistep-automation"; - bool IsExperimentalAccessibilityLanguageDetectionEnabled() { return base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kEnableExperimentalAccessibilityLanguageDetection); @@ -61,12 +56,6 @@ ::switches::kEnableMagnifierDebugDrawRect); } -bool IsSwitchAccessMultistepAutomationEnabled() { - return base::CommandLine::ForCurrentProcess()->HasSwitch( - ::switches:: - kEnableExperimentalAccessibilitySwitchAccessMultistepAutomation); -} - #if BUILDFLAG(IS_WIN) // Enables UI Automation platform API in addition to the IAccessible API. const char kEnableExperimentalUIAutomation[] =
diff --git a/ui/accessibility/accessibility_switches.h b/ui/accessibility/accessibility_switches.h index beb04ef4..a8ddf2ad 100644 --- a/ui/accessibility/accessibility_switches.h +++ b/ui/accessibility/accessibility_switches.h
@@ -20,8 +20,6 @@ kEnableExperimentalAccessibilityLanguageDetectionDynamic[]; AX_BASE_EXPORT extern const char kEnableExperimentalAccessibilitySwitchAccessText[]; -AX_BASE_EXPORT extern const char - kEnableExperimentalAccessibilitySwitchAccessMultistepAutomation[]; // Returns true if experimental accessibility language detection is enabled. AX_BASE_EXPORT bool IsExperimentalAccessibilityLanguageDetectionEnabled(); @@ -34,10 +32,6 @@ // Returns true if experimental accessibility Switch Access text is enabled. AX_BASE_EXPORT bool IsExperimentalAccessibilitySwitchAccessTextEnabled(); -// Returns true if experimental accessibility Switch Access multistep automation -// is enabled. -AX_BASE_EXPORT bool IsSwitchAccessMultistepAutomationEnabled(); - #if BUILDFLAG(IS_WIN) AX_BASE_EXPORT extern const char kEnableExperimentalUIAutomation[]; #endif
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn index 98ed1ee3..826048d 100644 --- a/ui/android/BUILD.gn +++ b/ui/android/BUILD.gn
@@ -151,7 +151,8 @@ "java/res/drawable-mdpi/popup_bg.9.png", "java/res/drawable-v21/transition_expand_less_expand_more_black_24dp.xml", "java/res/drawable-v21/transition_expand_more_expand_less_black_24dp.xml", - "java/res/drawable-v23/menu_bg_tinted.xml", + "java/res/drawable-v23/dialog_bg_baseline.xml", + "java/res/drawable-v23/menu_bg_baseline.xml", "java/res/drawable-xhdpi/btn_close.png", "java/res/drawable-xhdpi/ic_expand_less_black_24dp.png", "java/res/drawable-xhdpi/ic_expand_more_black_24dp.png", @@ -165,7 +166,6 @@ "java/res/drawable-xxxhdpi/ic_expand_more_black_24dp.png", "java/res/drawable-xxxhdpi/popup_bg.9.png", "java/res/drawable/custom_toast_background.xml", - "java/res/drawable/dialog_bg_tinted.xml", "java/res/drawable/drag_handlebar.xml", "java/res/drawable/ic_apps_blue_24dp.xml", "java/res/drawable/ic_expand_more_horizontal_black_24dp.xml",
diff --git a/ui/android/java/res/drawable/dialog_bg_tinted.xml b/ui/android/java/res/drawable-v23/dialog_bg_baseline.xml similarity index 100% rename from ui/android/java/res/drawable/dialog_bg_tinted.xml rename to ui/android/java/res/drawable-v23/dialog_bg_baseline.xml
diff --git a/ui/android/java/res/drawable-v23/menu_bg_tinted.xml b/ui/android/java/res/drawable-v23/menu_bg_baseline.xml similarity index 100% rename from ui/android/java/res/drawable-v23/menu_bg_tinted.xml rename to ui/android/java/res/drawable-v23/menu_bg_baseline.xml
diff --git a/ui/android/java/res/values-night/colors.xml b/ui/android/java/res/values-night/colors.xml index 768c6c32..78d3049 100644 --- a/ui/android/java/res/values-night/colors.xml +++ b/ui/android/java/res/values-night/colors.xml
@@ -27,8 +27,6 @@ <color name="default_icon_color_disabled_inverse_baseline">@color/default_icon_color_disabled_dark</color> <!-- Common background and branding color. --> - <!-- TODO(https://crbug.com/1272001): Remove @color/default_bg_color. --> - <color name="default_bg_color">@color/default_bg_color_baseline</color> <color name="default_bg_color_baseline">@color/default_bg_color_dark</color> <color name="default_bg_color_secondary">@color/default_bg_color_secondary_dark</color> <color name="default_bg_color_elev_1_baseline">@color/default_bg_color_dark_elev_1_baseline</color>
diff --git a/ui/android/java/res/values-v17/styles.xml b/ui/android/java/res/values-v17/styles.xml index ef457df..fe9b0e2 100644 --- a/ui/android/java/res/values-v17/styles.xml +++ b/ui/android/java/res/values-v17/styles.xml
@@ -8,7 +8,7 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <style name="DropdownPopupWindow" parent="@android:style/Widget.ListPopupWindow"> - <item name="android:popupBackground">@drawable/dialog_bg_tinted</item> + <item name="android:popupBackground">@drawable/dialog_bg_baseline</item> </style> <!-- Buttons -->
diff --git a/ui/android/java/res/values/attrs.xml b/ui/android/java/res/values/attrs.xml index 8390012..269bbaa 100644 --- a/ui/android/java/res/values/attrs.xml +++ b/ui/android/java/res/values/attrs.xml
@@ -9,7 +9,6 @@ <attr name="verticalInset" format="reference|dimension"/> <!-- Splintered semantic names that support dynamic colors. --> - <attr name="default_bg_color_dynamic" format="color"/> <attr name="divider_line_bg_color_dynamic" format="color"/> <declare-styleable name="ButtonCompat">
diff --git a/ui/android/java/res/values/semantic_colors_adaptive.xml b/ui/android/java/res/values/semantic_colors_adaptive.xml index 95b95ddf..98be254bb 100644 --- a/ui/android/java/res/values/semantic_colors_adaptive.xml +++ b/ui/android/java/res/values/semantic_colors_adaptive.xml
@@ -33,8 +33,6 @@ <color name="default_icon_color_disabled_inverse_baseline" tools:ignore="UnusedResources">@color/default_icon_color_disabled_light</color> <!-- Common background and branding color. --> - <!-- TODO(https://crbug.com/1272001): Remove @color/default_bg_color. --> - <color name="default_bg_color">@color/default_bg_color_baseline</color> <color name="default_bg_color_baseline">@color/default_bg_color_light</color> <color name="default_bg_color_secondary" tools:ignore="UnusedResources">@color/default_bg_color_secondary_light</color>
diff --git a/ui/android/java/src/org/chromium/ui/DropdownPopupWindowImpl.java b/ui/android/java/src/org/chromium/ui/DropdownPopupWindowImpl.java index 829f5d46..ec16f5fc 100644 --- a/ui/android/java/src/org/chromium/ui/DropdownPopupWindowImpl.java +++ b/ui/android/java/src/org/chromium/ui/DropdownPopupWindowImpl.java
@@ -83,7 +83,7 @@ ViewRectProvider rectProvider = new ViewRectProvider(mAnchorView); rectProvider.setIncludePadding(true); - mBackground = AppCompatResources.getDrawable(context, R.drawable.menu_bg_tinted); + mBackground = AppCompatResources.getDrawable(context, R.drawable.menu_bg_baseline); mAnchoredPopupWindow = new AnchoredPopupWindow( context, mAnchorView, mBackground, mContentView, rectProvider); mAnchoredPopupWindow.addOnDismissListener(onDismissLitener); @@ -118,7 +118,7 @@ boolean positionBelow, int x, int y, int width, int height, Rect anchorRect) { mBackground.setBounds(anchorRect); mAnchoredPopupWindow.setBackgroundDrawable( - AppCompatResources.getDrawable(mContext, R.drawable.menu_bg_tinted)); + AppCompatResources.getDrawable(mContext, R.drawable.menu_bg_baseline)); } /**
diff --git a/ui/android/javatests/src/org/chromium/ui/test/util/RenderTestRule.java b/ui/android/javatests/src/org/chromium/ui/test/util/RenderTestRule.java index 5ee51135..fc0de40c 100644 --- a/ui/android/javatests/src/org/chromium/ui/test/util/RenderTestRule.java +++ b/ui/android/javatests/src/org/chromium/ui/test/util/RenderTestRule.java
@@ -124,6 +124,11 @@ // Default for now, likely to be removed once all existing uses have a valid component. String NONE = "N/A"; String BLINK_FORMS_COLOR = "Blink>Forms>Color"; + String UI_BROWSER_FIRST_RUN = "UI>Browser>FirstRun"; + String UI_BROWSER_MOBILE_APP_MENU = "UI>Browser>Mobile>AppMenu"; + String UI_BROWSER_MOBILE_CONTEXT_MENU = "UI>Browser>Mobile>ContextMenu"; + String UI_BROWSER_MOBILE_MESSAGES = "UI>Browser>Mobile>Messages"; + String UI_BROWSER_MOBILE_START = "UI>Browser>Mobile>Start"; } // Skia Gold-specific constructor used by the builder.
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 3c04db03..55387b0 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc
@@ -1258,9 +1258,9 @@ bool state_modified = false; Env* env = Env::GetInstance(); state_modified |= env->gesture_recognizer()->CancelActiveTouches(this); + state_modified |= env->gesture_recognizer()->CleanupStateForConsumer(this); if (!tracking_this.Contains(this)) return state_modified; - state_modified |= env->gesture_recognizer()->CleanupStateForConsumer(this); // Potentially event handlers for CancelActiveTouches() within // CleanupGestureState may change the window hierarchy (or reorder the // |children_|), and therefore iterating over |children_| is not safe. Use
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc index 2cb88f81..491ce7c 100644 --- a/ui/aura/window_unittest.cc +++ b/ui/aura/window_unittest.cc
@@ -3646,6 +3646,72 @@ child2.reset(); } +class TestTouchWindowDelegate : public TestWindowDelegate { + public: + explicit TestTouchWindowDelegate() = default; + TestTouchWindowDelegate(const TestTouchWindowDelegate&) = delete; + TestTouchWindowDelegate& operator=(const TestTouchWindowDelegate&) = delete; + ~TestTouchWindowDelegate() override = default; + + void OnTouchEvent(ui::TouchEvent* event) override { + if (event->type() == ui::ET_TOUCH_CANCELLED) { + if (on_touch_cancel_callback_) { + std::move(on_touch_cancel_callback_) + .Run(static_cast<Window*>(event->target())); + } + } + } + + void SetOnTouchCancelCallback(base::OnceCallback<void(Window*)> callback) { + on_touch_cancel_callback_ = std::move(callback); + } + + private: + base::OnceCallback<void(Window*)> on_touch_cancel_callback_; +}; + +// Test for use-after-free in crbug.com/1297643. +TEST_F(WindowTest, DeleteWindowWhenCancellingTouch) { + TestTouchWindowDelegate window_delegate; + auto window = std::make_unique<Window>(&window_delegate); + window->Init(ui::LAYER_NOT_DRAWN); + root_window()->AddChild(window.get()); + window->SetBounds(gfx::Rect(0, 0, 200, 200)); + window->Show(); + + window_delegate.SetOnTouchCancelCallback( + base::BindLambdaForTesting([&window](Window* target) { + if (target == window.get()) { + window.reset(); + } + })); + + ui::test::EventGenerator event_generator(root_window(), window.get()); + event_generator.PressTouch(); + event_generator.MoveTouchBy(10, 10); + + auto* gesture_recognizer = Env::GetInstance()->gesture_recognizer(); + EXPECT_TRUE(gesture_recognizer->DoesConsumerHaveActiveTouch(window.get())); + + // Hide window which should cancel touch. + window->Hide(); + // Window should've been deleted. + EXPECT_FALSE(window); + + // Create two new windows to transfer between. + Window window1(nullptr); + window1.Init(ui::LAYER_NOT_DRAWN); + root_window()->AddChild(&window1); + + Window window2(nullptr); + window2.Init(ui::LAYER_NOT_DRAWN); + root_window()->AddChild(&window2); + + // This should not cause use-after-free. + gesture_recognizer->TransferEventsTo( + &window1, &window2, ui::TransferTouchesBehavior::kDontCancel); +} + class WindowActualScreenBoundsTest : public WindowTest, public testing::WithParamInterface<
diff --git a/ui/events/keycodes/keyboard_code_conversion_unittest.cc b/ui/events/keycodes/keyboard_code_conversion_unittest.cc index 1fec4ed..dba3e30 100644 --- a/ui/events/keycodes/keyboard_code_conversion_unittest.cc +++ b/ui/events/keycodes/keyboard_code_conversion_unittest.cc
@@ -520,7 +520,8 @@ uint32_t previous = 0; for (const auto& it : ui::kDomCodeToKeyboardCodeMap) { uint32_t current = static_cast<uint32_t>(it.dom_code); - EXPECT_LT(previous, current); + EXPECT_LT(previous, current) + << "kDomCodeToKeyboardCodeMap is not ordered by DomCode\n"; previous = current; } }
diff --git a/ui/events/platform/x11/x11_event_watcher_fdwatch.cc b/ui/events/platform/x11/x11_event_watcher_fdwatch.cc index 8cbba218..8778383 100644 --- a/ui/events/platform/x11/x11_event_watcher_fdwatch.cc +++ b/ui/events/platform/x11/x11_event_watcher_fdwatch.cc
@@ -4,12 +4,17 @@ #include "ui/events/platform/x11/x11_event_watcher_fdwatch.h" +#include <fcntl.h> +#include <unistd.h> + #include "base/task/current_thread.h" namespace ui { X11EventWatcherFdWatch::X11EventWatcherFdWatch(X11EventSource* source) - : event_source_(source), watcher_controller_(FROM_HERE) {} + : event_source_(source), + connection_watcher_(FROM_HERE), + pipe_watcher_(FROM_HERE) {} X11EventWatcherFdWatch::~X11EventWatcherFdWatch() { StopWatching(); @@ -23,7 +28,11 @@ int fd = event_source_->connection()->GetFd(); base::CurrentUIThread::Get()->WatchFileDescriptor( - fd, true, base::MessagePumpForUI::WATCH_READ, &watcher_controller_, this); + fd, true, base::MessagePumpForUI::WATCH_READ, &connection_watcher_, this); + + PCHECK(pipe2(pipe_, O_CLOEXEC | O_NONBLOCK) != -1); + base::CurrentUIThread::Get()->WatchFileDescriptor( + pipe_[0], true, base::MessagePumpForUI::WATCH_READ, &pipe_watcher_, this); started_ = true; } @@ -31,14 +40,37 @@ if (!started_) return; - watcher_controller_.StopWatchingFileDescriptor(); + connection_watcher_.StopWatchingFileDescriptor(); + pipe_watcher_.StopWatchingFileDescriptor(); + for (int& pfd : pipe_) { + PCHECK(close(pfd) != -1); + pfd = -1; + } started_ = false; } void X11EventWatcherFdWatch::OnFileCanReadWithoutBlocking(int fd) { - // We must dispatch all events, otherwise we may deadlock polling for new - // events when we already have events queued. - event_source_->connection()->DispatchAll(); + // Drain the pipe up to 128 bytes at a time (this should be enough to + // empty it under normal conditions in a single syscall). + char buf[128]; + while (read(pipe_[0], &buf, sizeof(buf)) != -1) { + } + PCHECK(errno == EAGAIN); + + // Dispatch a single event. + auto* connection = event_source_->connection(); + if (!connection->HasPendingResponses()) + connection->ReadResponses(); + connection->Dispatch(); + connection->Flush(); + + // We may deadlock if there are more events to dispatch but the socket is not + // readable. To prevent this, write a byte to the pipe so that the message + // loop will wake up and dispatch the event. This will cause the event to be + // dispatched with the same priority instead of being delayed if PostTask was + // used. + if (connection->HasPendingResponses()) + PCHECK(write(pipe_[1], "a", 1) != -1 || errno == EAGAIN); } void X11EventWatcherFdWatch::OnFileCanWriteWithoutBlocking(int fd) {
diff --git a/ui/events/platform/x11/x11_event_watcher_fdwatch.h b/ui/events/platform/x11/x11_event_watcher_fdwatch.h index 471c326..a585410 100644 --- a/ui/events/platform/x11/x11_event_watcher_fdwatch.h +++ b/ui/events/platform/x11/x11_event_watcher_fdwatch.h
@@ -33,7 +33,9 @@ X11EventSource* event_source_; - base::MessagePumpForUI::FdWatchController watcher_controller_; + int pipe_[2] = {-1, -1}; + base::MessagePumpForUI::FdWatchController connection_watcher_; + base::MessagePumpForUI::FdWatchController pipe_watcher_; bool started_ = false; };
diff --git a/ui/gfx/buffer_types.h b/ui/gfx/buffer_types.h index 45d2469..1319fbf 100644 --- a/ui/gfx/buffer_types.h +++ b/ui/gfx/buffer_types.h
@@ -97,6 +97,28 @@ LAST = V }; +// This enum is used for histogram states and should only have new values added +// to the end before kMaxValue. tools/metrics/histograms/enums.xml should be +// updated together. +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class OddSize { + kEvenWidthAndHeight = 0, + kOddWidthOnly = 1, + kOddHeightOnly = 2, + kOddWidthAndHeight = 3, + kMaxValue = kOddWidthAndHeight, +}; +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class OddOffset { + kEvenXAndY = 0, + kOddXOnly = 1, + kOddYOnly = 2, + kOddXAndY = 3, + kMaxValue = kOddXAndY, +}; + } // namespace gfx #endif // UI_GFX_BUFFER_TYPES_H_
diff --git a/ui/views/views_features.cc b/ui/views/views_features.cc index a494d122..06e664b 100644 --- a/ui/views/views_features.cc +++ b/ui/views/views_features.cc
@@ -29,7 +29,7 @@ // flakes are mopped up, this feature will be removed. // https://crbug.com/1302857 const base::Feature kFullscreenControllerMac{"FullscreenControllerMac", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; #endif } // namespace features
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index 069f754..ea08b87 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc
@@ -3613,8 +3613,17 @@ }; // Deletes a Widget when the bounds change as part of toggling fullscreen. -// This is a regression test for https://crbug.com/1197436 . -TEST_F(DesktopWidgetTest, DeleteInSetFullscreen) { +// This is a regression test for https://crbug.com/1197436. +// Disabled on Mac: This test has historically deleted the Widget not during +// SetFullscreen, but at the end of the test. When the Widget is deleted inside +// SetFullscreen, the test crashes. +// https://crbug.com/1307486 +#if BUILDFLAG(IS_MAC) +#define MAYBE_DeleteInSetFullscreen DISABLED_DeleteInSetFullscreen +#else +#define MAYBE_DeleteInSetFullscreen DeleteInSetFullscreen +#endif +TEST_F(DesktopWidgetTest, MAYBE_DeleteInSetFullscreen) { std::unique_ptr<Widget> widget = std::make_unique<Widget>(); Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_WINDOW); params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; @@ -3678,7 +3687,13 @@ EXPECT_FALSE(frame->fullscreen_layout_called()); widget->SetFullscreen(true); widget->Show(); +#if BUILDFLAG(IS_MAC) + // On macOS, a fullscreen layout is triggered from within SetFullscreen. + // https://crbug.com/1307496 + EXPECT_TRUE(frame->fullscreen_layout_called()); +#else EXPECT_TRUE(ViewTestApi(frame).needs_layout()); +#endif widget->LayoutRootViewIfNecessary(); RunPendingMessages();
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.html b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.html index aaa49f8..63a46291 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.html +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.html
@@ -1,5 +1,6 @@ <style include="cr-shared-style"> - localized-link { + localized-link, + #learn-more-description { color: var(--cros-text-color-secondary); } @@ -18,9 +19,16 @@ show-scan-progress="[[isBluetoothEnabled]]" button-bar-state="[[buttonBarState_]]"> <div slot="page-body" id="pageBody"> - <localized-link - localized-string="[[i18nAdvanced('bluetoothPairingLearnMoreLabel')]]"> - </localized-link> + <template is="dom-if" if="[[!shouldOmitLinks]]" restamp> + <localized-link + localized-string="[[i18nAdvanced('bluetoothPairingLearnMoreLabel')]]"> + </localized-link> + </template> + <template is="dom-if" if="[[shouldOmitLinks]]" restamp> + <div id="learn-more-description" aria-live="polite"> + [[i18n('bluetoothPairingDescription')]] + </div> + </template> <h2 id="deviceListTitle" aria-live="polite"> [[getDeviceListTitle_(devices.*, isBluetoothEnabled, devicePendingPairing.*)]] </h2>
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js index 2b25a938..29c70f5 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_device_selection_page.js
@@ -74,6 +74,16 @@ value: false, }, + /** + * Flag indicating whether links should be displayed or not. In some + * cases, such as the user being in OOBE or the login screen, links will + * not work and should not be displayed. + */ + shouldOmitLinks: { + type: Boolean, + value: false, + }, + /** @private {!ButtonBarState} */ buttonBarState_: { type: Object,
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.html b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.html index 1875432..78b414a2 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.html +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.html
@@ -16,6 +16,7 @@ device-pending-pairing="[[devicePendingPairing_]]" on-pair-device="onPairDevice_" is-bluetooth-enabled="[[isBluetoothEnabled_]]" + should-omit-links="[[shouldOmitLinks]]" id="deviceSelectionPage"> </bluetooth-pairing-device-selection-page> </template>
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.js b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.js index 2da02ad4..572f67e 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth/bluetooth_pairing_ui.js
@@ -104,6 +104,16 @@ }, /** + * Flag indicating whether links should be displayed or not. In some + * cases, such as the user being in OOBE or the login screen, links will + * not work and should not be displayed. + */ + shouldOmitLinks: { + type: Boolean, + value: false, + }, + + /** * Id of the currently selected Bluetooth pairing subpage. * @private {!BluetoothPairingSubpageId} */